From fe98bca6b01e6c50551158644a6d564aed783ff8 Mon Sep 17 00:00:00 2001
From: yl <ykxkd@outlook.com>
Date: 星期六, 12 十一月 2022 16:10:20 +0800
Subject: [PATCH] 修改报工审核接口开发
---
VueWebApi/DLL/DAL/ProductionManagementDAL.cs | 96 ++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 89 insertions(+), 7 deletions(-)
diff --git a/VueWebApi/DLL/DAL/ProductionManagementDAL.cs b/VueWebApi/DLL/DAL/ProductionManagementDAL.cs
index a890be7..0e422ac 100644
--- a/VueWebApi/DLL/DAL/ProductionManagementDAL.cs
+++ b/VueWebApi/DLL/DAL/ProductionManagementDAL.cs
@@ -2410,7 +2410,7 @@
// --------------鏌ヨ鎸囧畾鑷埗鎶ュ伐澶栧崗鏀舵枡鏁版嵁--------------
var total = 0; //鎬绘潯鏁�
var sql = @"select * from(
- select A.id,A.wo_code,A.materiel_code as partnumber,P.partname,P.partspec,A.task_qty,M.wkshp_code,G.org_name as wkshp_name,A.eqp_code,E.name as eqp_name,
+ select A.id,B.id as sbid,A.wo_code,A.materiel_code as partnumber,P.partname,P.partspec,A.task_qty,M.wkshp_code,G.org_name as wkshp_name,A.eqp_code,E.name as eqp_name,
M.route_code,R.name as route_name,A.step_code,S.stepname,S.flwtype,D.first_choke,D.last_choke,T.unprice,B.usergroup_code,O.group_name as usergroup_name,B.report_person as usercode,U.username,
B.report_date,B.report_qty,B.ng_qty,B.bad_qty
from TK_Wrk_Record A
@@ -2461,7 +2461,7 @@
#endregion
#region[鐢熶骇绠$悊,淇敼鎶ュ伐鏁版嵁鎻愪氦]
- public static ToMessage MesOrderStepVerifySeave(string username, List<UpdateProductReport> json)
+ public static ToMessage MesOrderStepUpdateSeave(string username, List<UpdateProductReport> json)
{
var sql = "";
string[] arra1 = new string[] { };
@@ -2528,7 +2528,7 @@
return mes;
}
}
-
+
}
//鏄惁鏈亾
if (json[i].last_choke == "Y")
@@ -2638,7 +2638,8 @@
///////////////////////////////淇敼鎶ュ伐//////////////////////////////
//鍥炲啓瀵瑰簲鐨勬姤宸ヨ褰曞瓙琛ㄥ悎鏍兼暟閲忋�佷笉鑹暟閲忋�佹姤搴熸暟閲�
- sql = @"update TK_Wrk_RecordSub set report_qty=report_qty+@repair_qty,ng_qty=ng_qty+@ng_qty,bad_qty=bad_qty+@bad_qty
+ sql = @"update TK_Wrk_RecordSub set report_qty=report_qty+@repair_qty,ng_qty=ng_qty+@ng_qty,bad_qty=bad_qty+@bad_qty,
+ updatereportuser=@updatereportuser,updatereportdate=@updatereportdate
where m_id=@m_id and id=@id and style='B'";
list.Add(new
{
@@ -2649,7 +2650,9 @@
id = int.Parse(json[i].sbid),
repair_qty = decimal.Parse(json[i].report_qty),
ng_qty = decimal.Parse(json[i].ng_qty),
- bad_qty = decimal.Parse(json[i].bad_qty)
+ bad_qty = decimal.Parse(json[i].bad_qty),
+ updatereportuser = username,
+ updatereportdate = date
}
});
//鍥炲啓瀵瑰簲鐨勬姤宸ヨ褰曚富琛ㄥ悎鏍兼暟閲忋�佷笉鑹暟閲忋�佹姤搴熸暟閲�
@@ -2669,7 +2672,7 @@
}
});
//鍥炲啓涓嶈壇
- sql = @"update CSR_WorkRecord_Defect set defect_qty=defect_qty+@ng_qty
+ sql = @"update CSR_WorkRecord_Defect set defect_qty=defect_qty+@ng_qty,updatereportuser=@updatereportuser,updatereportdate=@updatereportdate
where wo_code=@wo_code and step_code=@step_code and record_id=@id and style='B'";
list.Add(new
{
@@ -2679,7 +2682,9 @@
ng_qty = decimal.Parse(json[i].ng_qty),
wo_code = json[i].wo_code,
step_code = json[i].step_code,
- id = int.Parse(json[i].id)
+ id = int.Parse(json[i].id),
+ updatereportuser = username,
+ updatereportdate = date
}
});
}
@@ -2717,6 +2722,83 @@
}
#endregion
+ #region[鐢熶骇绠$悊,淇敼鎶ュ伐瀹℃牳鎻愪氦]
+ public static ToMessage MesOrderStepVerifySeave(string username, List<UpdateProductReport> json)
+ {
+ var sql = "";
+ List<object> list = new List<object>();
+ try
+ {
+ string date = DateTime.Now.ToString(); //鑾峰彇绯荤粺鏃堕棿
+ list.Clear();
+
+ //寰幆json鏁版嵁
+ for (int i = 0; i < json.Count; i++)
+ {
+
+ ///////////////////////////////淇敼鎶ュ伐//////////////////////////////
+
+ //鍥炲啓瀵瑰簲鐨勬姤宸ヨ褰曞瓙琛ㄥ鏍哥姸鎬併�佸鏍镐汉銆佸鏍告椂闂�
+ sql = @"update TK_Wrk_RecordSub set verify=@verify,verifyuser=@verifyuser,verifydate=@verifydate
+ where m_id=@m_id and id=@id and style='B'";
+ list.Add(new
+ {
+ str = sql,
+ parm = new
+ {
+ m_id = int.Parse(json[i].id),
+ id = int.Parse(json[i].sbid),
+ verify="Y",
+ verifyuser = username,
+ verifydate = date
+ }
+ });
+ //鍥炲啓涓嶈壇
+ sql = @"update CSR_WorkRecord_Defect set verify=verify,verifyuser=@verifyuser,verifydate=@verifydate
+ where wo_code=@wo_code and step_code=@step_code and record_id=@id and style='B'";
+ list.Add(new
+ {
+ str = sql,
+ parm = new
+ {
+ wo_code = json[i].wo_code,
+ step_code = json[i].step_code,
+ id = int.Parse(json[i].id),
+ verify="Y",
+ verifyuser = username,
+ verifydate = date
+ }
+ });
+
+ }
+
+ bool aa = DapperHelper.DoTransaction(list);
+ if (aa)
+ {
+ mes.code = "200";
+ mes.count = 0;
+ mes.Message = "瀹℃牳鎶ュ伐鎴愬姛!";
+ mes.data = null;
+ }
+ else
+ {
+ mes.code = "300";
+ mes.count = 0;
+ mes.Message = "瀹℃牳鎶ュ伐澶辫触!";
+ mes.data = null;
+ }
+ }
+ catch (Exception e)
+ {
+ mes.code = "300";
+ mes.count = 0;
+ mes.Message = e.Message;
+ mes.data = null;
+ }
+ return mes;
+ }
+ #endregion
+
#region[MES宸ュ崟鎵归噺鍏抽棴鏌ヨ]
--
Gitblit v1.9.3