From 78ccddadb87e0d4dd7f74733a031393395db2869 Mon Sep 17 00:00:00 2001
From: yl <ykxkd@outlook.com>
Date: 星期三, 29 五月 2024 14:38:39 +0800
Subject: [PATCH] nothing
---
VueWebApi/DLL/DAL/ProductModelDAL.cs | 52 +++++++++++++++++++++++++++++++++++++++++++---------
1 files changed, 43 insertions(+), 9 deletions(-)
diff --git a/VueWebApi/DLL/DAL/ProductModelDAL.cs b/VueWebApi/DLL/DAL/ProductModelDAL.cs
index 3e0e867..ec553e1 100644
--- a/VueWebApi/DLL/DAL/ProductModelDAL.cs
+++ b/VueWebApi/DLL/DAL/ProductModelDAL.cs
@@ -1286,7 +1286,7 @@
{
is_firststep = "Y";
}
- else if (Convert.ToInt32(json.Data.Rows[i]["SEQ"].ToString()) == json.Data.Rows.Count) //鏄惁鏈亾宸ュ簭
+ if (Convert.ToInt32(json.Data.Rows[i]["SEQ"].ToString()) == json.Data.Rows.Count) //鏄惁鏈亾宸ュ簭
{
is_laststep = "Y";
}
@@ -1577,6 +1577,9 @@
list.Add(new { str = sql_1, parm = new { stepcode = stepcode } });
//淇敼宸ュ簭琛ㄥ叧鑱斿伐浣滅珯鏍囪瘑
sql_1 = @"update TStep set is_eqp='N' where stepcode=@stepcode";
+ list.Add(new { str = sql_1, parm = new { stepcode = stepcode } });
+ //鍒犻櫎璁惧鑺傛媿宸ヤ环琛�
+ sql_1 = @"delete TPrteEqp_Stad where step_code=@stepcode";
list.Add(new { str = sql_1, parm = new { stepcode = stepcode } });
}
}
@@ -2079,18 +2082,35 @@
if (steptype == "Z") //鑷埗宸ュ簭
{
total = 0; //鎬绘潯鏁�
+ //sql = @"select B.code as eqpcode,B.name as eqpname,B.wksp_code,T.org_name as wksp_name,A.eqp_value,A.stand_value,A.cavity_qty,A.unprice
+ // from (
+ // select materiel_code, eqp_code,eqp_value,stand_value,cavity_qty,unprice from TPrteEqp_Stad
+ // where materiel_code=@partcode and route_code=@routecode and step_code=@stepcode
+ // union all
+ // select @partcode as materiel_code,eqp_code,'0' as eqp_value,'0' as stand_value,'0' as cavity_qty,'0' as unprice
+ // from TFlw_Rteqp where step_code=@stepcode and style='E' and @partcode+eqp_code+step_code not in(select materiel_code+eqp_code+step_code from TPrteEqp_Stad)
+ // ) A
+ // left join TEqpInfo B on A.eqp_code=B.code
+ // left join TOrganization T on B.wksp_code=T.org_code
+ // left join TMateriel_Info C on A.materiel_code=C.partcode
+ // where B.is_delete<>'1' and T.is_delete<>'1' and C.is_delete<>'1' ";
+
sql = @"select B.code as eqpcode,B.name as eqpname,B.wksp_code,T.org_name as wksp_name,A.eqp_value,A.stand_value,A.cavity_qty,A.unprice
from (
select materiel_code, eqp_code,eqp_value,stand_value,cavity_qty,unprice from TPrteEqp_Stad
where materiel_code=@partcode and route_code=@routecode and step_code=@stepcode
union all
- select @partcode as materiel_code,eqp_code,'0' as eqp_value,'0' as stand_value,'0' as cavity_qty,'0' as unprice
- from TFlw_Rteqp where step_code=@stepcode and style='E' and @partcode+eqp_code+step_code not in(select materiel_code+eqp_code+step_code from TPrteEqp_Stad)
+ select @partcode as materiel_code,C.eqp_code,'0' as eqp_value,'0' as stand_value,'0' as cavity_qty,'0' as unprice
+ from TFlw_Rout A
+ inner join TFlw_Rtdt B on A.code=B.rout_code
+ left join TFlw_Rteqp C on B.step_code=C.step_code
+ where A.code=@routecode and B.step_code=@stepcode and style='E' and @partcode+A.code+C.eqp_code+B.step_code
+ not in(select materiel_code+route_code+eqp_code+step_code from TPrteEqp_Stad where materiel_code=@partcode and route_code=@routecode and step_code=@stepcode)
) A
left join TEqpInfo B on A.eqp_code=B.code
left join TOrganization T on B.wksp_code=T.org_code
left join TMateriel_Info C on A.materiel_code=C.partcode
- where B.is_delete<>'1' and T.is_delete<>'1' and C.is_delete<>'1' ";
+ where B.is_delete<>'1' and T.is_delete<>'1' and C.is_delete<>'1'";
dynamicParams.Add("@partcode", partcode);
dynamicParams.Add("@routecode", routecode);
dynamicParams.Add("@stepcode", stepcode);
@@ -2098,13 +2118,27 @@
else //澶栧崗宸ュ簭
{
total = 0; //鎬绘潯鏁�
- sql = @"select B.code as eqpcode,B.name as eqpname,'' as wksp_code,'' as wksp_name,A.eqp_value,A.stand_value,A.cavity_qty,A.unprice
+ //sql = @"select B.code as eqpcode,B.name as eqpname,'' as wksp_code,'' as wksp_name,A.eqp_value,A.stand_value,A.cavity_qty,A.unprice
+ // from (
+ // select materiel_code, eqp_code,eqp_value,stand_value,cavity_qty,unprice from TPrteEqp_Stad
+ // where materiel_code=@partcode and route_code=@routecode and step_code=@stepcode
+ // union all
+ // select @partcode as materiel_code,eqp_code,'0' as eqp_value,'0' as stand_value,'0' as cavity_qty,'0' as unprice
+ // from TFlw_Rteqp where step_code=@stepcode and style='W' and @partcode+eqp_code+step_code not in(select materiel_code+eqp_code+step_code from TPrteEqp_Stad)
+ // ) A
+ // left join TCustomer B on A.eqp_code=B.code
+ // where B.is_delete<>'1'";
+ sql = @"select B.code as eqpcode,B.name as eqpname,'' as wksp_code,'' as wksp_name,A.eqp_value,A.stand_value,A.cavity_qty,A.unprice
from (
select materiel_code, eqp_code,eqp_value,stand_value,cavity_qty,unprice from TPrteEqp_Stad
where materiel_code=@partcode and route_code=@routecode and step_code=@stepcode
union all
- select @partcode as materiel_code,eqp_code,'0' as eqp_value,'0' as stand_value,'0' as cavity_qty,'0' as unprice
- from TFlw_Rteqp where step_code=@stepcode and style='W' and @partcode+eqp_code+step_code not in(select materiel_code+eqp_code+step_code from TPrteEqp_Stad)
+ select @partcode as materiel_code,C.eqp_code,'0' as eqp_value,'0' as stand_value,'0' as cavity_qty,'0' as unprice
+ from TFlw_Rout A
+ inner join TFlw_Rtdt B on A.code=B.rout_code
+ left join TFlw_Rteqp C on B.step_code=C.step_code
+ where A.code=@routecode and B.step_code=@stepcode and style='W' and @partcode+A.code+C.eqp_code+B.step_code
+ not in(select materiel_code+route_code+eqp_code+step_code from TPrteEqp_Stad where materiel_code=@partcode and route_code=@routecode and step_code=@stepcode)
) A
left join TCustomer B on A.eqp_code=B.code
where B.is_delete<>'1'";
@@ -2138,7 +2172,7 @@
{
if (partcode != "" && partcode != null)
{
- search += "and AA.materiel_code=@partcode ";
+ search += "and AA.partcode=@partcode ";
dynamicParams.Add("@partcode", partcode);
}
if (routecode != "" && routecode != null)
@@ -2148,7 +2182,7 @@
}
if (stepcode != "" && stepcode != null)
{
- search += "and AA.step_code=@stepcode ";
+ search += "and AA.stepcode=@stepcode ";
dynamicParams.Add("@stepcode", stepcode);
}
if (eqpcode != "" && eqpcode != null)
--
Gitblit v1.9.3