Commit 952e2e69 by mushishixian

优化

parent 87846042
......@@ -50,7 +50,7 @@ func (t *RecvPro) Consumer(dataByte []byte) (err error) {
goto ERR
}
if message.SyncName == "in_store" {
if message.SyncName == "in_store" || message.SyncName == "out_store"{
//得到入库数据以后,去组装金蝶需要的数据
storeErpData = map[string]interface{}{
"FSourceBillID": message.Data.ErpStoreId,
......@@ -67,6 +67,7 @@ func (t *RecvPro) Consumer(dataByte []byte) (err error) {
})
}
storeErpData["FEntrys"] = inStoreErpGoods
fmt.Println(storeErpData)
jsonByte, _ = json.Marshal(storeErpData)
}
//得到message以后,去请求金蝶的接口
......
......@@ -8,6 +8,7 @@ import (
func main() () {
message := `{"SyncName":"in_store","Data":{"erp_store_id":"FGipxV9OSXGWVCgqefjkesBZJbY=","detail":[{"number":"10.0000","erp_entry_sn":"mJ4W+QdYQoWe0WCnzEOJou0oFFw=","country":""},{"number":"900.0000","erp_entry_sn":"z0ULke\/wRhC5cQFzZZT4WO0oFFw=","country":""}],"pallet_number":1,"pallet_weight":"0.0000","box_number":1,"box_weight":"0.0000"}}`
message = `{"SyncName":"out_store","Data":{"erp_store_id":"Ncx3gMUSSEml7z2jL1\/p\/u+cpps=","box_number":1,"pallet_number":0,"detail":[{"erp_entry_sn":"123131","number":"25.0000","box_id":"39","pallet_id":0}]}}`
fmt.Println(message)
queueExchange := rabbitmq.QueueExchange{
"store_audit_status",
......
......@@ -176,6 +176,7 @@ func TransformParams(message OutStoreMessage) (params map[string]interface{}) {
}
outStoreDetail = append(outStoreDetail, map[string]interface{}{
"erp_goods_id": entry.FMaterialID,
"erp_entry_sn": entry.FSourceBillEntryID,
"goods_name": entry.FModel,
"brand_name": entry.FBrand,
"number": entry.FQty,
......
......@@ -95,6 +95,7 @@ func SyncErpDataStatus(syncName, uniqueId string) (err error) {
params = gosoap.ArrayParams{
{"json", fmt.Sprintf(`{"FType":"%s", "FID":"%s"}`, syncName, uniqueId)},
}
fmt.Println(fmt.Sprintf(`{"FType":"%s", "FID":"%s"}`, syncName, uniqueId))
res, err = soap.Call(apiMethod, params)
if err != nil {
return
......@@ -163,7 +164,6 @@ func CheckBillDataRequest(syncName, uniqueId string, res *gosoap.Response) (err
for key, value := range responseData {
//金蝶判断成功的标志
if key == "0000" {
fmt.Println("ok")
//成功还要去修改记录表
switch syncName {
case "inStore":
......@@ -175,7 +175,6 @@ func CheckBillDataRequest(syncName, uniqueId string, res *gosoap.Response) (err
}
//金额判断失败的标志
if key == "4444" {
fmt.Println("fail")
return errors.New("金蝶返回失败,失败信息为:" + value)
}
}
......
The file could not be displayed because it is too large.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment