药店ERP对接接口

1、生成会员卡前校验接口

接口:
/erp/other/member/generateCardCheck
入参:
1、手机号: String mobile
出参:
1、ERP内没有对应的会员卡,返回一个cardId对象,存储一个未用卡的信息,用于绑定该手机号
{
    "result":"OK",
    "errorCode":0,
    "errorDescription":null,
    "body":{
        "apiStatus":0,
        "apiMessage":"",
        "cardCode":"QW000001",
        "contactId":"QC000001"
} } 2、ERP内有对应的会员卡,返回2022012状态 { "result":"OK", "errorCode":0, "errorDescription":null, "body":{ "apiStatus":2022012, "apiMessage":"此手机号已存在会员请选择绑定线下会员" } }

2、生成会员卡接口

接口:/erp/other/member/generateCard
入参:都是字符串
1、手机号:mobile
2、名称:name
3、生日:birthday
5、性别:gender(男、女)
6、会员卡:cardCode
7、机构:orgId
出参:成功
{
    "result":"OK",
    "errorCode":0,
    "errorDescription":null,
    "body":{
        "apiStatus":0,
        "apiMessage":"",
        "erpCardId":"QD000001",
"erpCardCode":"QW000001",
"erpScore":0, "erpMobile":"18012629961", "erpName":"张三", "erpBirthday":"20110909", "erpGender":"男" } } 失败:2022013状态 { "result":"OK", "errorCode":0, "errorDescription":null, "body":{ "apiStatus":2022013, "apiMessage":"线下不存在此手机号的会员卡" } }

3、绑定线下会员卡接口

接口:/erp/other/member/bindCheck
入参:
1、用户手机号:mobile
出参:用户信息及会员卡信息(会存在一个手机号对多张卡的情况,都要返回,没有resultList为空)
{
    "result":"OK",
    "errorCode":0,
    "errorDescription":null,
    "body":{
        "apiStatus":0,
        "apiMessage":"",
        "resultList":[
            {
                "cardId":"18012629960",
                "score":20,
                "cardCode":"18012629960",
                "contactId":"18012629960",
                "mobile":"18012629960",
                "birthday":"2011-09-09 00:00:00.0",
                "gender":"F",
                "name":"张三"
            }
        ]
    }
}

4、同步会员积分接口

接口:/erp/other/member/syncScore
入参:
会员卡id:cardId
会员积分(积分增量):point 
出参:是否成功
{
    "result":"OK",
    "errorCode":0,
    "errorDescription":null,
    "body":{
        "apiStatus":0,
        "apiMessage":""
    }
}

5、批量同步会员积分接口

接口:/erp/other/member/batchSyncScore
入参:会员卡id,会员积分(积分增量)【列表,50个一组,调用多次】
1、String paramStr(会员卡id:会员积分,会员卡id:会员积分,,会员卡id:会员积分)
格式:paramStr="QD000001:5,QD000002:10,QD000003:-5,QD000004:5"
出参:是否成功
{
    "result":"OK",
    "errorCode":0,
    "errorDescription":null,
    "body":{
        "apiStatus":0,
        "apiMessage":""
    }
}

6、批量查询会员积分接口1

接口:/erp/other/member/batchSearchCard
入参:会员卡id【列表,一般50个一组】
String cardIds(多个用逗号隔开)
格式:cardIds=QD000001,QD000002,QD000003,QD000004
出参:会员卡id,会员积分(总积分)【列表】
{
    "result":"OK",
    "errorCode":0,
    "errorDescription":null,
    "body":{
        "apiStatus":0,
        "apiMessage":"",
        "cardList":[
            {
                "erpCardId":"QD000001",
"erpScore":1075 }, { "erpCardId":"QD000002",
"erpScore":45 }, { "erpCardId":"QD000003",
"erpScore":7 } ] } }

7、批量查询会员积分接口2

接口:/erp/other/member/querySyncCardInfo 查找erp里有变更的积分【2日内的】
入参:无 
出参:会员卡id,会员积分(总积分)【列表】
{
    "result":"OK",
    "errorCode":0,
    "errorDescription":null,
    "body":{
        "apiStatus":0,
        "apiMessage":"",
        "cardList":[
            {
                "erpCardId":"0308546",
                "erpScore":1075
            },
            {
                "erpCardId":"0308553",
                "erpScore":45
            },
            {
                "erpCardId":"1167574888",
                "erpScore":7
            },
            {
                "erpCardId":"1169417098",
                "erpScore":9
            },
            {
                "erpCardId":"1170019468",
                "erpScore":1626
            },
            {
                "erpCardId":"13695723149",
                "erpScore":856
            },
            {
                "erpCardId":"168556178",
                "erpScore":437.21
            }
        ]
    }
}

8、批量查询商品库存价格接口(旧版本)

接口:/erp/other/product/batchSyncProByCodes
入参:
1、门店id: String orgId
2、商品编码多个【列表,50个一组,查询多次】
String  proCodeList(用逗号分隔)
proCodeList=00096,10000,10005,10068
出参:门店商品库存、价格数据【列表,50个一组】BranchProResultList
{
    "result":"OK",
    "errorCode":0,
    "errorDescription":null,
    "body":{
        "apiStatus":0,
        "apiMessage":"",
        "resultList":[
            {
                "proCode":"00096",
                "stock":0,
                "price":8.5,
                "vipPrice":0
            },
            {
                "proCode":"10000",
                "stock":1,
                "price":11.8,
                "vipPrice":0
            },
            {
                "proCode":"10005",
                "stock":0,
                "price":5,
                "vipPrice":0
            },
            {
                "proCode":"10068",
                "stock":0,
                "price":15,
                "vipPrice":0
            }
        ]
    }
}

8.1、查询三日内商品信息【库存和价格有变更的商品】接口(新版本)

接口:/erp/other/product/batchSyncProByBranch

入参:
1、门店id: String orgId
2、第几页: int page
3、每页数量:int pageSize

出参:门店商品库存、价格数据【列表】BranchProResultList
{
    "result":"OK",
    "errorCode":0,
    "errorDescription":null,
    "body":{
        "apiStatus":0,
        "apiMessage":"",
        "total":"500",
        "page":"1",
"pageSize":"50", "resultList":[ { "proCode":"00096", "stock":0, "price":8.5, "vipPrice":0 }, { "proCode":"10000", "stock":1, "price":11.8, "vipPrice":0 }, { "proCode":"10005", "stock":0, "price":5, "vipPrice":0 }, { "proCode":"10068", "stock":0, "price":15, "vipPrice":0 } ] } }

9、批量查询订单接口

接口:/erp/other/order/queryErpOrder4Latest
入参:查询某个时间段内的订单 由全维服务器定时调用【System.currentTimeMillis()获取时间】
开始时间:long beginDate  :1507701903
结束时间:long endDate    :1512972303
出参:该时间段内的订单数据【订单信息以及相应的订单商品信息】ErpOrderListVo
{
    "result":"OK",
    "errorCode":0,
    "errorDescription":null,
    "body":{
        "apiStatus":0,
        "apiMessage":"",
        "orderList":[
            {
                "ordNo":"5998073",
                "orgId":"7159",
                "orgName":"武汉普安药房体育馆店",
                "userName":"会员1536995",
                "mobile":"13871245852",
                "erpCardId":"1536995",
                "erpCardCode":"0270065175",
                "erpCardName":"金卡8",
                "score":75,
                "amountFanal":25,
                "amountPro":35,
                "amountDiscount":0,
                "dateTime":"2017-10-10 17:28:40",
                "orderDetails":[
                    {
                        "ordNo":"5998073",
                        "proCode":"22",
                        "proName":"阿莫西林胶囊",
                        "proQty":1,
                        "price":35,
                        "amount":35
                    }
                ]
            },
            {
                "ordNo":"5998074",
                "orgId":"7159",
                "orgName":"武汉普安药房体育馆店",
                "userName":"会员1536995",
                "mobile":"13871245852",
                "erpCardId":"1536995",
                "erpCardCode":"0270065175",
                "erpCardName":"金卡8",
                "score":0,
                "amountFanal":0,
                "amountPro":35,
                "amountDiscount":0,
                "dateTime":"2017-10-10 17:30:30",
                "orderDetails":[
                    {
                        "ordNo":"5998074",
                        "proCode":"22",
                        "proName":"阿莫西林胶囊",
                        "proQty":1,
                        "price":35,
                        "amount":35
                    }
                ]
            }
        ]
    }
}