|
@@ -70,10 +70,10 @@ namespace JLHHJSvr
|
|
|
var idList = textStr.Select(x => x.Trim());
|
|
|
var failIDs = new HashSet<string>(idList);
|
|
|
var okIDs = new HashSet<string>();
|
|
|
- var newOkIDs = new HashSet<string>();
|
|
|
|
|
|
var MattressHelper = HelperBase.GetHelper<MattressHelper>(cmd);
|
|
|
var BednetHelper = HelperBase.GetHelper<BedNetHelper>(cmd);
|
|
|
+ var InterFaceHelper = HelperBase.GetHelper<InterfaceHelper>(cmd);
|
|
|
|
|
|
var errMsg = string.Empty;
|
|
|
foreach (var mattress in list)
|
|
@@ -84,7 +84,6 @@ namespace JLHHJSvr
|
|
|
try
|
|
|
{
|
|
|
mattress.mattressid = 0;
|
|
|
- mattress.mattresscode = "";
|
|
|
|
|
|
var mxList = MattressHelper.GetMattressMxMtrl(id);
|
|
|
|
|
@@ -112,7 +111,11 @@ namespace JLHHJSvr
|
|
|
var saveRspBednet = LJHttpUtil.PostRequest(url + saveReqBednet.GetApiName(), JObject.FromObject(saveReqBednet))
|
|
|
.ToObject<SaveBedNetResponse>();
|
|
|
|
|
|
- if (string.IsNullOrEmpty(saveRspBednet.ErrMsg))
|
|
|
+ if (!string.IsNullOrEmpty(saveRspBednet.ErrMsg))
|
|
|
+ {
|
|
|
+ errMsg += $"{old_mattresscode}:ERRMSG Interface==> {saveRspBednet.ErrMsg}\r\n";
|
|
|
+ }
|
|
|
+ else
|
|
|
{
|
|
|
mx.mtrlid = saveRspBednet.bednet.bednetid;
|
|
|
}
|
|
@@ -127,6 +130,7 @@ namespace JLHHJSvr
|
|
|
token = token,
|
|
|
};
|
|
|
|
|
|
+ var newid = 0;
|
|
|
var saveRsp = LJHttpUtil.PostRequest(url + saveReq.GetApiName(), JObject.FromObject(saveReq))
|
|
|
.ToObject<SaveMattressResponse>();
|
|
|
if (!string.IsNullOrEmpty(saveRsp.ErrMsg))
|
|
@@ -135,10 +139,55 @@ namespace JLHHJSvr
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- newOkIDs.Add(saveRsp.mattresscode);
|
|
|
+ newid = saveRsp.mattressid;
|
|
|
okIDs.Add(old_mattresscode);
|
|
|
failIDs.Remove(old_mattresscode);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ //var interfaceList = InterFaceHelper.GetMattressInterfaceList(id, mattress.erp_configcodetype);
|
|
|
+ var interfaceList = new List<u_mattress_interface>();
|
|
|
+ var selectStr = @"SELECT mattressid
|
|
|
+ ,printid
|
|
|
+ ,itemname
|
|
|
+ ,bj_pzname
|
|
|
+ ,bj_namemx
|
|
|
+ ,actual_size
|
|
|
+ ,sb_craft
|
|
|
+ ,actual_size_sb
|
|
|
+ ,erp_pzid
|
|
|
+ ,ss_rate
|
|
|
+ ,ls_rate
|
|
|
+ ,bj_inputtype
|
|
|
+ FROM u_mattress_interface";
|
|
|
+ DbSqlHelper.SelectJoin(cmd, selectStr, "mattressid = @mattressid", new Dictionary<string, object>() { { "@mattressid", id } }, "printid", "mattressid,printid,itemname,bj_pzname,bj_namemx,actual_size,sb_craft,actual_size_sb,erp_pzid,ss_rate,ls_rate,bj_inputtype", 0, 0, interfaceList);
|
|
|
+
|
|
|
+ var qdList = InterFaceHelper.GetMattressInterfaceQdList(id);
|
|
|
+
|
|
|
+ mattress.mattressid = newid;
|
|
|
+ foreach (var mx in interfaceList)
|
|
|
+ {
|
|
|
+ mx.mattressid = newid;
|
|
|
+ }
|
|
|
+ foreach (var mx in qdList)
|
|
|
+ {
|
|
|
+ mx.mattressid = newid;
|
|
|
+ }
|
|
|
+
|
|
|
+ var saveReqInterface = new SaveMattressInterfaceRequest()
|
|
|
+ {
|
|
|
+ mattress = mattress,
|
|
|
+ interfaceList = interfaceList,
|
|
|
+ qdList = qdList,
|
|
|
+ token = token,
|
|
|
+ };
|
|
|
+
|
|
|
+ var saveRspInterface = LJHttpUtil.PostRequest(url + saveReqInterface.GetApiName(), JObject.FromObject(saveReqInterface))
|
|
|
+ .ToObject<SaveMattressInterfaceResponse>();
|
|
|
+ if (!string.IsNullOrEmpty(saveRspInterface.ErrMsg))
|
|
|
+ {
|
|
|
+ errMsg += $"{old_mattresscode}:ERRMSG Interface==> {saveRspInterface.ErrMsg}\r\n";
|
|
|
+ }
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
@@ -146,7 +195,7 @@ namespace JLHHJSvr
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- textBox1.Text = $"{textBox1Str}\r\n同步失败:{string.Join(",", failIDs)}\r\n同步成功:{string.Join(",", okIDs)}\r\n同步后编码:{string.Join(",", newOkIDs)}\r\n{errMsg}";
|
|
|
+ textBox1.Text = $"{textBox1Str}\r\n同步失败:{string.Join(",", failIDs)}\r\n同步成功:{string.Join(",", okIDs)}\r\n{errMsg}";
|
|
|
}
|
|
|
}
|
|
|
catch (Exception ex)
|