|
|
@@ -87,88 +87,90 @@ namespace JLHHJSvr.Excutor
|
|
|
if (!l1InterfaceMap.TryGetValue(workItem.mattressid, out var interfaceRows)) interfaceRows = new List<u_mattress_interface>();
|
|
|
var result = workItem.result;
|
|
|
|
|
|
- try
|
|
|
+ if (mattress == null)
|
|
|
{
|
|
|
- if (mattress == null)
|
|
|
- {
|
|
|
- result.err_msg = "床垫报价记录不存在,请检查!";
|
|
|
- return;
|
|
|
- }
|
|
|
+ result.status = 3;
|
|
|
+ result.err_msg = "床垫报价记录不存在,请检查!";
|
|
|
+ rslt.items.Add(result);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
|
|
|
- if (mattress.erp_configcodetype != request.configcodetype)
|
|
|
- {
|
|
|
- result.err_msg = "配置名称不匹配!";
|
|
|
- return;
|
|
|
- }
|
|
|
+ if (mattress.erp_configcodetype != request.configcodetype)
|
|
|
+ {
|
|
|
+ result.status = 3;
|
|
|
+ result.err_msg = "配置名称不匹配!";
|
|
|
+ rslt.items.Add(result);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
|
|
|
- if (LockHelper.CheckIsLock(cmd, MattressHelper.BillKeyWord, mattress.mattressid, tokendata.username, out string lockMsg)
|
|
|
- || LockHelper.CheckIsLock(cmd, InterfaceHelper.BillKeyWord, mattress.mattressid, tokendata.username, out lockMsg))
|
|
|
- {
|
|
|
- result.err_msg = lockMsg;
|
|
|
- return;
|
|
|
- }
|
|
|
+ if (LockHelper.CheckIsLock(cmd, MattressHelper.BillKeyWord, mattress.mattressid, tokendata.username, out string lockMsg)
|
|
|
+ || LockHelper.CheckIsLock(cmd, InterfaceHelper.BillKeyWord, mattress.mattressid, tokendata.username, out lockMsg))
|
|
|
+ {
|
|
|
+ result.status = 3;
|
|
|
+ result.err_msg = lockMsg;
|
|
|
+ rslt.items.Add(result);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
|
|
|
- if (targetRows.Count == 0)
|
|
|
- {
|
|
|
- result.status = 4;
|
|
|
- result.err_msg = "配置行不存在";
|
|
|
- return;
|
|
|
- }
|
|
|
- if (targetRows.Count > 1)
|
|
|
- {
|
|
|
- result.err_msg = $"床垫报价:{mattress}存在重复配置行,请先手动处理!";
|
|
|
- return;
|
|
|
- }
|
|
|
+ if (targetRows.Count == 0)
|
|
|
+ {
|
|
|
+ result.status = 4;
|
|
|
+ result.err_msg = "配置行不存在";
|
|
|
+ rslt.items.Add(result);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (targetRows.Count > 1)
|
|
|
+ {
|
|
|
+ result.status = 4;
|
|
|
+ result.err_msg = $"床垫报价:{mattress}存在重复配置行,请先手动处理!";
|
|
|
+ rslt.items.Add(result);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
|
|
|
- var target = targetRows[0];
|
|
|
- if (target.bj_inputtype != 1)
|
|
|
+ var target = targetRows[0];
|
|
|
+ if (target.bj_inputtype != 1)
|
|
|
+ {
|
|
|
+ result.status = 4;
|
|
|
+ result.err_msg = "配置不是录入类型,请检查!";
|
|
|
+ rslt.items.Add(result);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ using (cmd.Transaction = cmd.Connection.BeginTransaction())
|
|
|
+ {
|
|
|
+ try
|
|
|
{
|
|
|
- result.status = 4;
|
|
|
- result.err_msg = "配置不是录入类型,请检查!";
|
|
|
- return;
|
|
|
+ UpdateConfigName(cmd, request, mattress.mattressid, target.printid.Value);
|
|
|
+ UpdatePrefetchedInterfaceName(interfaceRows, target.printid.Value, request.new_bj_namemx);
|
|
|
+
|
|
|
+ //var l1Helper = HelperBase.GetHelper<ERPHelper>(cmd);
|
|
|
+ //l1Helper.context = new HelperBase.Context() { tokendata = tokendata };
|
|
|
+ //l1Helper.GetMattressMsg(mattress, interfaceRows);
|
|
|
+ //var errMsg = l1Helper.SaveMtrldef(mattress, interfaceRows);
|
|
|
+ //if (!string.IsNullOrEmpty(errMsg))
|
|
|
+ //{
|
|
|
+ // throw new Exception(errMsg);
|
|
|
+ //}
|
|
|
+
|
|
|
+ //if (mattress.erp_mtrlid > 0)
|
|
|
+ //{
|
|
|
+ // mattress.creatmtrl_flag = 1;
|
|
|
+ // mattress.creatmtrl_auditingrep = tokendata.username;
|
|
|
+ // mattress.creatmtrl_auditingdate = DateTime.Now;
|
|
|
+ // DbSqlHelper.Update(cmd, mattress, "erp_mtrlid,creatmtrl_flag,erp_mtrlcode,creatmtrl_auditingrep,creatmtrl_auditingdate");
|
|
|
+ //}
|
|
|
+
|
|
|
+ cmd.Transaction.Commit();
|
|
|
+ result.status = 2;
|
|
|
+ result.err_msg = "Success.";
|
|
|
}
|
|
|
-
|
|
|
- using (cmd.Transaction = cmd.Connection.BeginTransaction())
|
|
|
+ catch (Exception ex)
|
|
|
{
|
|
|
- try
|
|
|
- {
|
|
|
- UpdateConfigName(cmd, request, mattress.mattressid, target.printid.Value);
|
|
|
- UpdatePrefetchedInterfaceName(interfaceRows, target.printid.Value, request.new_bj_namemx);
|
|
|
-
|
|
|
- //var l1Helper = HelperBase.GetHelper<ERPHelper>(cmd);
|
|
|
- //l1Helper.context = new HelperBase.Context() { tokendata = tokendata };
|
|
|
- //l1Helper.GetMattressMsg(mattress, interfaceRows);
|
|
|
- //var errMsg = l1Helper.SaveMtrldef(mattress, interfaceRows);
|
|
|
- //if (!string.IsNullOrEmpty(errMsg))
|
|
|
- //{
|
|
|
- // throw new Exception(errMsg);
|
|
|
- //}
|
|
|
-
|
|
|
- //if (mattress.erp_mtrlid > 0)
|
|
|
- //{
|
|
|
- // mattress.creatmtrl_flag = 1;
|
|
|
- // mattress.creatmtrl_auditingrep = tokendata.username;
|
|
|
- // mattress.creatmtrl_auditingdate = DateTime.Now;
|
|
|
- // DbSqlHelper.Update(cmd, mattress, "erp_mtrlid,creatmtrl_flag,erp_mtrlcode,creatmtrl_auditingrep,creatmtrl_auditingdate");
|
|
|
- //}
|
|
|
-
|
|
|
- cmd.Transaction.Commit();
|
|
|
- result.status = 2;
|
|
|
- result.err_msg = "Success.";
|
|
|
- }
|
|
|
- catch (Exception ex)
|
|
|
- {
|
|
|
- cmd.Transaction.Rollback();
|
|
|
- result.status = 3;
|
|
|
- result.err_msg = ex.Message;
|
|
|
- }
|
|
|
+ cmd.Transaction.Rollback();
|
|
|
+ result.status = 3;
|
|
|
+ result.err_msg = ex.Message;
|
|
|
}
|
|
|
}
|
|
|
- catch (Exception ex)
|
|
|
- {
|
|
|
- result.status = 3;
|
|
|
- result.err_msg = ex.Message;
|
|
|
- }
|
|
|
|
|
|
rslt.items.Add(result);
|
|
|
}
|