From e84dcdff61f7d19dc901ef071828af7ada996a37 Mon Sep 17 00:00:00 2001
From: yl <ykxkd@outlook.com>
Date: 星期一, 06 三月 2023 18:50:01 +0800
Subject: [PATCH] 报废补单查询单据接口增加报废数量大于0控制
---
VueWebApi/DLL/DAL/KanBanManagerentDAL.cs | 30 ++++++++++++++++--------------
1 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/VueWebApi/DLL/DAL/KanBanManagerentDAL.cs b/VueWebApi/DLL/DAL/KanBanManagerentDAL.cs
index 0bcb82e..e47f525 100644
--- a/VueWebApi/DLL/DAL/KanBanManagerentDAL.cs
+++ b/VueWebApi/DLL/DAL/KanBanManagerentDAL.cs
@@ -677,20 +677,22 @@
try
{
//瀵屽皵杈捐溅闂磋川閲忔暟瀛楀寲鐪嬫澘,涓嶈壇鏄庣粏(鍙栬川妫�宸ュ簭,鎸変骇绾跨粺璁�)
- sql = @"select row_number() over(order by MM.lm_date,MM.wo_code) as RowNum,MM.lm_date,MM.wo_code,A.materiel_code,MM.step_code,T.stepname,A.good_qty as report_qty,A.ng_qty,
- defect_name=( STUFF(( SELECT ',' + B.name
- FROM CSR_WorkRecord_Defect N
- inner join TDefect B on N.defect_code=B.code
- where record_id=MM.record_id
- FOR
- XML PATH('')
- ), 1, 1, '') )
- from CSR_WorkRecord_Defect as MM
- inner join TK_Wrk_Record A on MM.record_id=a.id
- inner join TK_Wrk_Step S on A.wo_code=S.wo_code and A.step_code=S.step_code
- inner join TStep T on MM.step_code=T.stepcode
- where MM.step_code=@StepCode and MM.style='B' and A.style='B' and A.ng_qty>0 and S.status<>'CLOSED'
- group by MM.lm_date,MM.record_id,MM.wo_code,A.materiel_code,MM.step_code,T.stepname,A.good_qty,A.ng_qty";
+ sql = @"select row_number() over(order by MM.lm_date,MM.wo_code) as RowNum,MM.lm_date,A.eqp_code,E.name as eqp_name,MM.wo_code,A.materiel_code,M.partname,MM.step_code,T.stepname,A.good_qty as report_qty,A.ng_qty,
+ defect_name=( STUFF(( SELECT ',' + B.name
+ FROM CSR_WorkRecord_Defect N
+ inner join TDefect B on N.defect_code=B.code
+ where record_id=MM.record_id
+ FOR
+ XML PATH('')
+ ), 1, 1, '') )
+ from CSR_WorkRecord_Defect as MM
+ inner join TK_Wrk_Record A on MM.record_id=a.id
+ inner join TK_Wrk_Step S on A.wo_code=S.wo_code and A.step_code=S.step_code
+ inner join TStep T on MM.step_code=T.stepcode
+ inner join TEqpInfo E on A.eqp_code=E.code
+ inner join TMateriel_Info M on A.materiel_code=M.partcode
+ where MM.step_code=@StepCode and MM.style='B' and A.style='B' and A.ng_qty>0 and S.status<>'CLOSED'
+ group by MM.lm_date,MM.record_id,A.eqp_code,E.name,MM.wo_code,A.materiel_code,M.partname,MM.step_code,T.stepname,A.good_qty,A.ng_qty";
dynamicParams.Add("@StepCode", StepCode);
var data = DapperHelper.selectdata(sql, dynamicParams);
mes.code = "200";
--
Gitblit v1.9.3