|
@@ -70,6 +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 errMsg = string.Empty;
|
|
|
foreach (var mattress in list)
|
|
@@ -82,8 +86,39 @@ namespace JLHHJSvr
|
|
|
mattress.mattressid = 0;
|
|
|
mattress.mattresscode = "";
|
|
|
|
|
|
- var helper = HelperBase.GetHelper<MattressHelper>(cmd);
|
|
|
- var mxList = helper.GetMattressMxMtrl(id);
|
|
|
+ var mxList = MattressHelper.GetMattressMxMtrl(id);
|
|
|
+
|
|
|
+ if (mxList.Count > 0)
|
|
|
+ {
|
|
|
+ foreach(var mx in mxList)
|
|
|
+ {
|
|
|
+ mx.mattressid = 0;
|
|
|
+ mx.mattressmxid = 0;
|
|
|
+ if (mx.formulatype == 99 && mx.mtrlid > 0)
|
|
|
+ {
|
|
|
+ var bednetItm = BednetHelper.GetBedNet(mx.mtrlid.Value);
|
|
|
+ var bednetMx = BednetHelper.GetBedNetMxList(mx.mtrlid.Value);
|
|
|
+ var spring = BednetHelper.GetBedNetSpringList(mx.mtrlid.Value);
|
|
|
+ bednetItm.copy_id = bednetItm.bednetid;
|
|
|
+
|
|
|
+ var saveReqBednet = new SaveBedNetRequest()
|
|
|
+ {
|
|
|
+ bednet = bednetItm,
|
|
|
+ bednetMx = bednetMx,
|
|
|
+ spring = spring,
|
|
|
+ token = token,
|
|
|
+ };
|
|
|
+
|
|
|
+ var saveRspBednet = LJHttpUtil.PostRequest(url + saveReqBednet.GetApiName(), JObject.FromObject(saveReqBednet))
|
|
|
+ .ToObject<SaveBedNetResponse>();
|
|
|
+
|
|
|
+ if (string.IsNullOrEmpty(saveRspBednet.ErrMsg))
|
|
|
+ {
|
|
|
+ mx.mtrlid = saveRspBednet.bednet.bednetid;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
var saveReq = new SaveMattressRequest()
|
|
|
{
|
|
@@ -100,8 +135,9 @@ namespace JLHHJSvr
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- okIDs.Add(mattress.mattresscode);
|
|
|
- failIDs.Remove(mattress.mattresscode);
|
|
|
+ newOkIDs.Add(saveRsp.mattresscode);
|
|
|
+ okIDs.Add(old_mattresscode);
|
|
|
+ failIDs.Remove(old_mattresscode);
|
|
|
}
|
|
|
}
|
|
|
catch (Exception ex)
|
|
@@ -110,7 +146,7 @@ namespace JLHHJSvr
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- textBox1.Text = $"{textBox1Str}\r\n同步失败:{string.Join(",", failIDs)}\r\n同步成功:{string.Join(",", okIDs)}\r\n{errMsg}";
|
|
|
+ textBox1.Text = $"{textBox1Str}\r\n同步失败:{string.Join(",", failIDs)}\r\n同步成功:{string.Join(",", okIDs)}\r\n同步后编码:{string.Join(",", newOkIDs)}\r\n{errMsg}";
|
|
|
}
|
|
|
}
|
|
|
catch (Exception ex)
|