From 164ed043c7dc88fd05074244c3951a9ccc0ceead Mon Sep 17 00:00:00 2001
From: yl <ykxkd@outlook.com>
Date: 星期三, 29 三月 2023 10:54:50 +0800
Subject: [PATCH] 车间看板取数修改、订单下达获取工单语句修改、生产工单手工创建获取单号接口
---
VueWebApi/obj/Release/VueWebApi.pdb | 0
VueWebApi/Controllers/KanBanManagerentController.cs | 30 +++++++
.vs/VueWebApi/v16/.suo | 0
VueWebApi/DLL/BLL/ProductionManagementBLL.cs | 7 +
VueWebApi/DLL/DAL/ProductionManagementDAL.cs | 30 +++++++
VueWebApi/Properties/PublishProfiles/FolderProfile1.pubxml.user | 10 +-
VueWebApi/DLL/BLL/KanBanManagerentBLL.cs | 15 +++
VueWebApi/bin/VueWebApi.xml | 13 +++
VueWebApi/obj/Release/Package/PackageTmp/bin/VueWebApi.pdb | 0
VueWebApi/Controllers/ProductionManagementController.cs | 14 +++
VueWebApi/DLL/DAL/KanBanManagerentDAL.cs | 82 ++++++++++++++++++++
VueWebApi/obj/Release/Package/PackageTmp/bin/VueWebApi.xml | 13 +++
VueWebApi/bin/VueWebApi.pdb | 0
13 files changed, 208 insertions(+), 6 deletions(-)
diff --git a/.vs/VueWebApi/v16/.suo b/.vs/VueWebApi/v16/.suo
index b2e4c4d..7ab03d0 100644
--- a/.vs/VueWebApi/v16/.suo
+++ b/.vs/VueWebApi/v16/.suo
Binary files differ
diff --git a/VueWebApi/Controllers/KanBanManagerentController.cs b/VueWebApi/Controllers/KanBanManagerentController.cs
index 908c0c9..c105476 100644
--- a/VueWebApi/Controllers/KanBanManagerentController.cs
+++ b/VueWebApi/Controllers/KanBanManagerentController.cs
@@ -210,5 +210,35 @@
return TJson.toJson(mes);
}
#endregion
+
+
+ #region[鑾辩杞﹂棿鐢熶骇鏁板瓧鍖栫湅鏉匡紝浜х嚎鏁版嵁]
+ /// <summary>
+ /// 鑾辩杞﹁溅闂寸敓浜ф暟瀛楀寲鐪嬫澘锛屼骇绾挎暟鎹�
+ /// </summary>
+ /// <param name="LineCode">浜х嚎缂栫爜</param>
+ /// <returns></returns>
+ [Route(template: "WkshpLineData")]
+ [HttpGet]
+ public HttpResponseMessage WkshpLineData(string LineCode)
+ {
+ mes = KanBanManagerentBLL.WkshpLineData(LineCode);
+ return TJson.toJson(mes);
+ }
+ #endregion
+
+ #region[鑾辩杞﹁溅闂寸敓浜ф暟瀛楀寲鐪嬫澘锛岀敓浜т俊鎭痌
+ /// <summary>
+ /// 鑾辩杞﹁溅闂寸敓浜ф暟瀛楀寲鐪嬫澘锛岀敓浜т俊鎭�
+ /// </summary>
+ /// <returns></returns>
+ [Route(template: "WkshpContentData")]
+ [HttpGet]
+ public HttpResponseMessage WkshpContentData()
+ {
+ mes = KanBanManagerentBLL.WkshpContentData();
+ return TJson.toJson(mes);
+ }
+ #endregion
}
}
diff --git a/VueWebApi/Controllers/ProductionManagementController.cs b/VueWebApi/Controllers/ProductionManagementController.cs
index 5473ebd..c5a8ca6 100644
--- a/VueWebApi/Controllers/ProductionManagementController.cs
+++ b/VueWebApi/Controllers/ProductionManagementController.cs
@@ -248,6 +248,20 @@
}
#endregion
+ #region[MES宸ュ崟鏂板銆佽幏鍙栧伐鍗曞彿]
+ /// <summary>
+ /// MES宸ュ崟鏂板銆佽幏鍙栧伐鍗曞彿
+ /// </summary>
+ /// <returns></returns>
+ [Route(template: "AddMesOrderCodeSearch")]
+ [HttpPost]
+ public HttpResponseMessage AddMesOrderCodeSearch()
+ {
+ mes = ProductionManagementBLL.AddMesOrderCodeSearch();
+ return TJson.toJson(mes);
+ }
+ #endregion
+
#region[MES宸ュ崟鏂板銆佺紪杈戞彁浜
/// <summary>
/// MES宸ュ崟鏂板銆佺紪杈戞彁浜�
diff --git a/VueWebApi/DLL/BLL/KanBanManagerentBLL.cs b/VueWebApi/DLL/BLL/KanBanManagerentBLL.cs
index ae503fe..4299609 100644
--- a/VueWebApi/DLL/BLL/KanBanManagerentBLL.cs
+++ b/VueWebApi/DLL/BLL/KanBanManagerentBLL.cs
@@ -105,5 +105,20 @@
return KanBanManagerentDAL.WkspReportNotice(shopcode);
}
#endregion
+
+
+ #region[鑾辩杞﹂棿鐢熶骇鏁板瓧鍖栫湅鏉匡紝浜х嚎鏁版嵁]
+ public static ToMessage WkshpLineData(string lineCode)
+ {
+ return KanBanManagerentDAL.WkshpLineData(lineCode);
+ }
+ #endregion
+
+ #region[鑾辩杞﹂棿鐢熶骇鏁板瓧鍖栫湅鏉匡紝鐢熶骇淇℃伅]
+ public static ToMessage WkshpContentData()
+ {
+ return KanBanManagerentDAL.WkshpContentData();
+ }
+ #endregion
}
}
\ No newline at end of file
diff --git a/VueWebApi/DLL/BLL/ProductionManagementBLL.cs b/VueWebApi/DLL/BLL/ProductionManagementBLL.cs
index db9e473..2740802 100644
--- a/VueWebApi/DLL/BLL/ProductionManagementBLL.cs
+++ b/VueWebApi/DLL/BLL/ProductionManagementBLL.cs
@@ -83,6 +83,13 @@
}
#endregion
+ #region[MES宸ュ崟鏂板銆佽幏鍙栧伐鍗曞彿]
+ public static ToMessage AddMesOrderCodeSearch()
+ {
+ return ProductionManagementDAL.AddMesOrderCodeSearch();
+ }
+ #endregion
+
#region[MES宸ュ崟鏂板銆佺紪杈戞彁浜
public static ToMessage AddUpdateMesOrder(string mesorderstus, string mesordercode,string sourceorder,string ordertype, string partcode, string mesqty, string routecode, string wkshopcode, string planstartdate, string planenddate, string orderlev, string username, string opertype,string is_aps,string bom_id)
{
diff --git a/VueWebApi/DLL/DAL/KanBanManagerentDAL.cs b/VueWebApi/DLL/DAL/KanBanManagerentDAL.cs
index 5e67faf..dc15fd9 100644
--- a/VueWebApi/DLL/DAL/KanBanManagerentDAL.cs
+++ b/VueWebApi/DLL/DAL/KanBanManagerentDAL.cs
@@ -451,6 +451,88 @@
return mes;
}
#endregion
+
+
+ #region[鑾辩杞﹂棿鐢熶骇鏁板瓧鍖栫湅鏉匡紝浜х嚎鏁版嵁]
+ public static ToMessage WkshpLineData(string lineCode)
+ {
+ string sql = "";
+ string search = "";
+ var dynamicParams = new DynamicParameters();
+ try
+ {
+ //鑾峰彇浜х嚎閿�鍞鍗曟姤宸ヤ俊鎭�,鎶ュ伐鏁伴噺>0 涓斿伐鍗曠姸鎬佷负闈炲叧闂姸鎬� 涓斿伐搴忎负鏈亾宸ュ簭 锛�--and (S.good_qty+S.ng_qty+S.bad_qty)<S.plan_qty)
+ //sql = @"select AA.saleOrderCode,AA.materiel_code,AA.partname,sum(AA.good_qty) as good_qty from (
+ // select distinct A.saleOrderCode,A.materiel_code,M.partname,isnull(S.good_qty,0) as good_qty
+ // from TKimp_Ewo A
+ // left join TK_Wrk_Man B on A.wo=B.m_po and A.materiel_code=B.materiel_code
+ // left join TK_Wrk_Step S on B.wo_code=S.wo_code and S.isend='Y'
+ // left join TFlw_Rteqp R on S.step_code=R.step_code
+ // left join TMateriel_Info M on A.materiel_code=M.partcode
+ // where A.saleOrderCode is not null and A.saleOrderCode<>''
+ // and R.eqp_code=@lineCode and B.status<>'CLOSED'
+ // ) as AA
+ // group by AA.saleOrderCode,AA.materiel_code,AA.partname";
+ sql = @"select AA.saleOrderCode,AA.materiel_code,AA.partname,sum(AA.good_qty) as good_qty from (
+ select distinct B.m_po as saleOrderCode,B.materiel_code,M.partname,isnull(S.good_qty,0) as good_qty
+ from TK_Wrk_Man B
+ left join TK_Wrk_Step S on B.wo_code=S.wo_code and S.isend='Y'
+ left join TK_Wrk_Record T on S.wo_code=T.wo_code
+ left join TMateriel_Info M on B.materiel_code=M.partcode
+ where T.eqp_code=@lineCode and B.status<>'CLOSED'
+ ) as AA
+ group by AA.saleOrderCode,AA.materiel_code,AA.partname";
+ dynamicParams.Add("@lineCode", lineCode);
+ var data = DapperHelper.selectdata(sql, dynamicParams);
+ mes.code = "200";
+ mes.Message = "鏌ヨ鎴愬姛!";
+ mes.data = data;
+ }
+ catch (Exception e)
+ {
+ mes.code = "300";
+ mes.count = 0;
+ mes.Message = e.Message;
+ mes.data = null;
+ }
+ return mes;
+ }
+ #endregion
+
+ #region[鑾辩杞﹂棿鐢熶骇鏁板瓧鍖栫湅鏉匡紝鐢熶骇淇℃伅]
+ public static ToMessage WkshpContentData()
+ {
+ string sql = "";
+ try
+ {
+ //鑾峰彇宸ュ崟鎶ュ伐淇℃伅,鎶ュ伐鏁伴噺>0 涓斿伐鍗曠姸鎬佷负闈炲叧闂姸鎬�
+ sql = @"select row_number() over(order by A.wo_code,B.seq) as RowNum,A.wo_code,E.name as eqp_name,M.partname,B.plan_qty,A.plan_startdate,A.plan_enddate,T.stepname,B.good_qty
+ from TK_Wrk_Man A
+ inner join TK_Wrk_Step B on A.wo_code=B.wo_code
+ inner join(
+ select wo_code,step_code,materiel_code,eqp_code, sum(good_qty) as good_qty
+ from TK_Wrk_Record where style='B' group by wo_code,step_code,materiel_code,eqp_code
+ ) as S on A.wo_code=S.wo_code and A.materiel_code=S.materiel_code and B.step_code=S.step_code
+ left join TStep T on B.step_code=T.stepcode
+ left join TMateriel_Info M on A.materiel_code=M.partcode
+ left join TEqpInfo E on S.eqp_code=E.code
+ where A.status<>'CLOSED'
+ order by A.wo_code,B.seq";
+ var data = DapperHelper.selecttable(sql);
+ mes.code = "200";
+ mes.Message = "鏌ヨ鎴愬姛!";
+ mes.data = data;
+ }
+ catch (Exception e)
+ {
+ mes.code = "300";
+ mes.count = 0;
+ mes.Message = e.Message;
+ mes.data = null;
+ }
+ return mes;
+ }
+ #endregion
}
}
diff --git a/VueWebApi/DLL/DAL/ProductionManagementDAL.cs b/VueWebApi/DLL/DAL/ProductionManagementDAL.cs
index a127401..745bc95 100644
--- a/VueWebApi/DLL/DAL/ProductionManagementDAL.cs
+++ b/VueWebApi/DLL/DAL/ProductionManagementDAL.cs
@@ -127,7 +127,8 @@
//鑾峰彇鏈�澶у崟鎹彿
if (i == 1) //棣栧崟鑾峰彇宸ュ崟鍙�
{
- sql = @"select isnull(max(substring(wo_code,charindex('_',wo_code)+1,len(wo_code)-charindex('_',wo_code))),0)+1 as worknumb from TK_Wrk_Man where m_po=@erpordercode";
+ sql = @"select isnull(max(cast(substring(wo_code,charindex('_',wo_code)+1,len(wo_code)-charindex('_',wo_code)) as numeric)),0)+1 as worknumb
+ from TK_Wrk_Man where m_po=@erpordercode";
dynamicParams.Add("@erpordercode", erpordercode);
var data = DapperHelper.selectdata(sql, dynamicParams);
num = Convert.ToInt32(data.Rows[0]["WORKNUMB"].ToString());
@@ -652,6 +653,33 @@
}
#endregion
+ #region[MES宸ュ崟鏂板銆佽幏鍙栧伐鍗曞彿]
+ public static ToMessage AddMesOrderCodeSearch()
+ {
+ string sql = "";
+ string wo_code = "";
+ var dynamicParams = new DynamicParameters();
+ try
+ {
+ //鑾峰彇鍗曟嵁鍙�
+ sql = @"SELECT 'SGPO'+CONVERT(varchar(12) , getdate(), 112 )+'_'+cast(isnull(max(cast(substring(wo_code,charindex('_',wo_code)+1,len(wo_code)-charindex('_',wo_code)) as numeric)),0)+1 as varchar) as numct
+ FROM TK_Wrk_Man where wo_code like '%SGPO%'";
+ var data = DapperHelper.selecttable(sql);
+ mes.code = "200";
+ mes.Message = "鏌ヨ鎴愬姛!";
+ mes.data = data.Rows[0]["numct"].ToString();
+ }
+ catch (Exception e)
+ {
+ mes.code = "300";
+ mes.count = 0;
+ mes.Message = e.Message;
+ mes.data = null;
+ }
+ return mes;
+ }
+ #endregion
+
#region[MES宸ュ崟鏂板銆佺紪杈戞彁浜
public static ToMessage AddUpdateMesOrder(string mesorderstus, string sourceorder, string ordertype, string mesordercode, string partcode, string mesqty, string routecode, string wkshopcode, string planstartdate, string planenddate, string orderlev, string username, string opertype, string is_aps, string bom_id)
{
diff --git a/VueWebApi/Properties/PublishProfiles/FolderProfile1.pubxml.user b/VueWebApi/Properties/PublishProfiles/FolderProfile1.pubxml.user
index fe87ac0..25d2d47 100644
--- a/VueWebApi/Properties/PublishProfiles/FolderProfile1.pubxml.user
+++ b/VueWebApi/Properties/PublishProfiles/FolderProfile1.pubxml.user
@@ -5,7 +5,7 @@
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<_PublishTargetUrl>D:\缃戠珯鍙戝竷\MES鑾辩</_PublishTargetUrl>
- <History>True|2023-03-13T02:44:20.6460094Z;True|2023-03-07T07:53:47.8742070+08:00;True|2023-03-06T16:28:52.5324366+08:00;True|2023-03-04T14:39:07.6196796+08:00;True|2023-03-04T11:14:42.4747638+08:00;True|2023-03-03T16:04:05.4168918+08:00;True|2023-02-27T14:08:22.9246071+08:00;</History>
+ <History>True|2023-03-27T05:39:23.4492384Z;True|2023-03-21T16:17:47.9913398+08:00;True|2023-03-13T10:44:20.6460094+08:00;True|2023-03-07T07:53:47.8742070+08:00;True|2023-03-06T16:28:52.5324366+08:00;True|2023-03-04T14:39:07.6196796+08:00;True|2023-03-04T11:14:42.4747638+08:00;True|2023-03-03T16:04:05.4168918+08:00;True|2023-02-27T14:08:22.9246071+08:00;</History>
</PropertyGroup>
<ItemGroup>
<File Include="Areas/HelpPage/HelpPage.css">
@@ -714,13 +714,13 @@
<publishTime>12/24/2021 15:38:29</publishTime>
</File>
<File Include="bin/VueWebApi.dll">
- <publishTime>03/13/2023 10:44:13</publishTime>
+ <publishTime>03/27/2023 13:39:16</publishTime>
</File>
<File Include="bin/VueWebApi.pdb">
- <publishTime>03/13/2023 10:44:13</publishTime>
+ <publishTime>03/27/2023 13:39:16</publishTime>
</File>
<File Include="bin/VueWebApi.xml">
- <publishTime>03/13/2023 10:44:13</publishTime>
+ <publishTime>03/27/2023 13:39:16</publishTime>
</File>
<File Include="bin/WebActivatorEx.dll">
<publishTime>02/08/2013 16:42:28</publishTime>
@@ -1098,7 +1098,7 @@
<publishTime>06/16/2022 13:39:23</publishTime>
</File>
<File Include="Web.config">
- <publishTime>03/13/2023 10:44:20</publishTime>
+ <publishTime>03/27/2023 13:39:22</publishTime>
</File>
</ItemGroup>
</Project>
\ No newline at end of file
diff --git a/VueWebApi/bin/VueWebApi.pdb b/VueWebApi/bin/VueWebApi.pdb
index cd27bdf..d3b56f5 100644
--- a/VueWebApi/bin/VueWebApi.pdb
+++ b/VueWebApi/bin/VueWebApi.pdb
Binary files differ
diff --git a/VueWebApi/bin/VueWebApi.xml b/VueWebApi/bin/VueWebApi.xml
index 0053758..1ab2659 100644
--- a/VueWebApi/bin/VueWebApi.xml
+++ b/VueWebApi/bin/VueWebApi.xml
@@ -2023,6 +2023,19 @@
<param name="shopcode">杞﹂棿缂栫爜</param>
<returns></returns>
</member>
+ <member name="M:VueWebApi.Controllers.KanBanManagerentController.WkshpLineData(System.String)">
+ <summary>
+ 鑾辩杞﹁溅闂寸敓浜ф暟瀛楀寲鐪嬫澘锛屼骇绾挎暟鎹�
+ </summary>
+ <param name="LineCode">浜х嚎缂栫爜</param>
+ <returns></returns>
+ </member>
+ <member name="M:VueWebApi.Controllers.KanBanManagerentController.WkshpContentData">
+ <summary>
+ 鑾辩杞﹁溅闂寸敓浜ф暟瀛楀寲鐪嬫澘锛岀敓浜т俊鎭�
+ </summary>
+ <returns></returns>
+ </member>
<member name="M:VueWebApi.Controllers.LoginController.LoginSave(System.String,System.String,System.String)">
<summary>
PC鐢ㄦ埛鐧诲綍
diff --git a/VueWebApi/obj/Release/Package/PackageTmp/bin/VueWebApi.pdb b/VueWebApi/obj/Release/Package/PackageTmp/bin/VueWebApi.pdb
index cd27bdf..d3b56f5 100644
--- a/VueWebApi/obj/Release/Package/PackageTmp/bin/VueWebApi.pdb
+++ b/VueWebApi/obj/Release/Package/PackageTmp/bin/VueWebApi.pdb
Binary files differ
diff --git a/VueWebApi/obj/Release/Package/PackageTmp/bin/VueWebApi.xml b/VueWebApi/obj/Release/Package/PackageTmp/bin/VueWebApi.xml
index 0053758..1ab2659 100644
--- a/VueWebApi/obj/Release/Package/PackageTmp/bin/VueWebApi.xml
+++ b/VueWebApi/obj/Release/Package/PackageTmp/bin/VueWebApi.xml
@@ -2023,6 +2023,19 @@
<param name="shopcode">杞﹂棿缂栫爜</param>
<returns></returns>
</member>
+ <member name="M:VueWebApi.Controllers.KanBanManagerentController.WkshpLineData(System.String)">
+ <summary>
+ 鑾辩杞﹁溅闂寸敓浜ф暟瀛楀寲鐪嬫澘锛屼骇绾挎暟鎹�
+ </summary>
+ <param name="LineCode">浜х嚎缂栫爜</param>
+ <returns></returns>
+ </member>
+ <member name="M:VueWebApi.Controllers.KanBanManagerentController.WkshpContentData">
+ <summary>
+ 鑾辩杞﹁溅闂寸敓浜ф暟瀛楀寲鐪嬫澘锛岀敓浜т俊鎭�
+ </summary>
+ <returns></returns>
+ </member>
<member name="M:VueWebApi.Controllers.LoginController.LoginSave(System.String,System.String,System.String)">
<summary>
PC鐢ㄦ埛鐧诲綍
diff --git a/VueWebApi/obj/Release/VueWebApi.pdb b/VueWebApi/obj/Release/VueWebApi.pdb
index cd27bdf..d3b56f5 100644
--- a/VueWebApi/obj/Release/VueWebApi.pdb
+++ b/VueWebApi/obj/Release/VueWebApi.pdb
Binary files differ
--
Gitblit v1.9.3