From 2a1c73ffedfbdb08d8aa016987f413de7911dfe4 Mon Sep 17 00:00:00 2001
From: yl <ykxkd@outlook.com>
Date: 星期五, 18 十一月 2022 15:29:45 +0800
Subject: [PATCH] 修改报工接口修改

---
 VueWebApi/DLL/DAL/ProductionManagementDAL.cs |   40 ++++++++++++++++++----------------------
 1 files changed, 18 insertions(+), 22 deletions(-)

diff --git a/VueWebApi/DLL/DAL/ProductionManagementDAL.cs b/VueWebApi/DLL/DAL/ProductionManagementDAL.cs
index 3949ff3..d774f08 100644
--- a/VueWebApi/DLL/DAL/ProductionManagementDAL.cs
+++ b/VueWebApi/DLL/DAL/ProductionManagementDAL.cs
@@ -2351,22 +2351,16 @@
 
 
         #region[鐢熶骇绠$悊,淇敼鎶ュ伐鏁版嵁鏌ヨ鎺ュ彛]
-        public static ToMessage MesOrderStepVerifySearch(string reporttype, string wo_code, string partnumber, string partname, string partspec, string reportuser, string reportdateopendate, string reportdateclosedate, int startNum, int endNum, string prop, string order)
+        public static ToMessage MesOrderStepVerifySearch(string verify, string wo_code, string partnumber, string partname, string partspec, string reportuser, string reportdateopendate, string reportdateclosedate, int startNum, int endNum, string prop, string order)
         {
             var dynamicParams = new DynamicParameters();
             string search = "";
             try
             {
-                if (reporttype != "" && reporttype != null)
+                if (verify != "" && verify != null)
                 {
-                    if (reporttype == "BZ")
-                    {
-                        search += "and AA.usergroup_code<>''";
-                    }
-                    else
-                    {
-                        search += "and AA.usergroup_code='' ";
-                    }
+                    search += "and AA.verify=@verify ";
+                    dynamicParams.Add("@verify", verify);
                 }
                 if (wo_code != "" && wo_code != null)
                 {
@@ -2411,7 +2405,7 @@
                 var sql = @"select *  from(
                             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   
+                            B.report_date,B.report_qty,B.ng_qty,B.bad_qty,B.verify,B.bad_money 
                             from TK_Wrk_Record A
                             inner join TK_Wrk_RecordSub B on A.id=B.m_id
                             left join TK_Wrk_Man M on A.wo_code=M.wo_code
@@ -2635,7 +2629,7 @@
                         ///////////////////////////////淇敼鎶ュ伐//////////////////////////////
 
                         //鍥炲啓瀵瑰簲鐨勬姤宸ヨ褰曞瓙琛ㄥ悎鏍兼暟閲忋�佷笉鑹暟閲忋�佹姤搴熸暟閲�
-                        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,bad_money=bad_money+@bad_money,
                                 updatereportuser=@updatereportuser,updatereportdate=@updatereportdate
                                 where  m_id=@m_id and id=@id and style='B'";
                         list.Add(new
@@ -2645,9 +2639,10 @@
                             {
                                 m_id = int.Parse(json[i].id),
                                 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),
+                                repair_qty = decimal.Parse(json[i].report_dvalue),
+                                ng_qty = decimal.Parse(json[i].ng_dvalue),
+                                bad_qty = decimal.Parse(json[i].bad_dvalue),
+                                bad_money = decimal.Parse(json[i].badmoney_dvalue),
                                 updatereportuser = username,
                                 updatereportdate = date
                             }
@@ -2660,9 +2655,9 @@
                             str = sql,
                             parm = new
                             {
-                                good_qty = decimal.Parse(json[i].report_qty),
-                                ng_qty = decimal.Parse(json[i].ng_qty),
-                                bad_qty = decimal.Parse(json[i].bad_qty),
+                                good_qty = decimal.Parse(json[i].report_dvalue),
+                                ng_qty = decimal.Parse(json[i].ng_dvalue),
+                                bad_qty = decimal.Parse(json[i].bad_dvalue),
                                 wo_code = json[i].wo_code,
                                 step_code = json[i].step_code,
                                 id = int.Parse(json[i].id)
@@ -2676,7 +2671,7 @@
                             str = sql,
                             parm = new
                             {
-                                ng_qty = decimal.Parse(json[i].ng_qty),
+                                ng_qty = decimal.Parse(json[i].ng_dvalue),
                                 wo_code = json[i].wo_code,
                                 step_code = json[i].step_code,
                                 id = int.Parse(json[i].id),
@@ -2768,9 +2763,9 @@
                     });
                     //鍐欏叆鎶ュ伐璁板綍瀹℃牳琛�
                     sql = @"insert into  TK_WorkRecord_Verify(report_id,report_sbid,wo_code,partnumber,task_qty,wkshp_code,eqp_code,route_code,
-                            step_seq,step_code,flw_type,first_choke,last_choke,unprice,usergroup_code,usercode,report_date,report_qty,report_dvalue,ng_qty,ng_dvalue,bad_qty,bad_dvalue,bad_money) 
+                            step_seq,step_code,flw_type,first_choke,last_choke,unprice,usergroup_code,usercode,report_date,report_qty,report_dvalue,ng_qty,ng_dvalue,bad_qty,bad_dvalue,bad_money,badmoney_dvalue) 
                             values(@report_id,@report_sbid,@wo_code,@partnumber,@task_qty,@wkshp_code,@eqp_code,@route_code,
-                            @step_seq,@step_code,@flw_type,@first_choke,@last_choke,@unprice,@usergroup_code,@usercode,@report_date,@report_qty,@report_dvalue,@ng_qty,@ng_dvalue,@bad_qty,@bad_dvalue,@bad_money)";
+                            @step_seq,@step_code,@flw_type,@first_choke,@last_choke,@unprice,@usergroup_code,@usercode,@report_date,@report_qty,@report_dvalue,@ng_qty,@ng_dvalue,@bad_qty,@bad_dvalue,@bad_money,@badmoney_dvalue)";
                     list.Add(new
                     {
                         str = sql,
@@ -2799,7 +2794,8 @@
                             ng_dvalue=json[i].ng_dvalue.ToString(),
                             bad_qty=json[i].bad_qty.ToString(),
                             bad_dvalue=json[i].bad_dvalue.ToString(),
-                            bad_money=json[i].bad_money.ToString()
+                            bad_money=json[i].bad_money.ToString(),
+                            badmoney_dvalue= json[i].badmoney_dvalue.ToString()
                         }
                     });
                 }

--
Gitblit v1.9.3