From 85feb93b944f52051b5908452938cef4fe909fe8 Mon Sep 17 00:00:00 2001
From: yl <ykxkd@outlook.com>
Date: 星期六, 04 三月 2023 11:33:38 +0800
Subject: [PATCH] 1.工单派发选择工艺路线或选择生产车间时判断绑定条件接口开发
2.组织架构删除update改为delete
3.工艺路线新增else if改为if

---
 VueWebApi/obj/Release/VueWebApi.pdb                             |    0 
 VueWebApi/DLL/DAL/ProductModelDAL.cs                            |    2 
 VueWebApi/DLL/DAL/BasicSettingDAL.cs                            |    2 
 VueWebApi/obj/Release/Package/PackageTmp/bin/VueWebApi.dll      |    0 
 VueWebApi/obj/Release/VueWebApi.csproj.FileListAbsolute.txt     |    1 
 .vs/VueWebApi/v16/.suo                                          |    0 
 VueWebApi/DLL/BLL/ProductionManagementBLL.cs                    |    7 +++
 VueWebApi/bin/VueWebApi.dll                                     |    0 
 VueWebApi/DLL/DAL/ProductionManagementDAL.cs                    |   63 +++++++++++++++++++++++++++++++
 VueWebApi/Properties/PublishProfiles/FolderProfile1.pubxml.user |   10 ++--
 VueWebApi/bin/VueWebApi.xml                                     |    9 ++++
 VueWebApi/obj/Release/VueWebApi.csproj.AssemblyReference.cache  |    0 
 VueWebApi/obj/Release/Package/PackageTmp/bin/VueWebApi.pdb      |    0 
 VueWebApi/Controllers/ProductionManagementController.cs         |   17 ++++++++
 VueWebApi/obj/Release/VueWebApi.dll                             |    0 
 VueWebApi/obj/Release/Package/PackageTmp/bin/VueWebApi.xml      |    9 ++++
 VueWebApi/bin/VueWebApi.pdb                                     |    0 
 17 files changed, 113 insertions(+), 7 deletions(-)

diff --git a/.vs/VueWebApi/v16/.suo b/.vs/VueWebApi/v16/.suo
index ebec170..eb0fffd 100644
--- a/.vs/VueWebApi/v16/.suo
+++ b/.vs/VueWebApi/v16/.suo
Binary files differ
diff --git a/VueWebApi/Controllers/ProductionManagementController.cs b/VueWebApi/Controllers/ProductionManagementController.cs
index e46cdd8..a598b04 100644
--- a/VueWebApi/Controllers/ProductionManagementController.cs
+++ b/VueWebApi/Controllers/ProductionManagementController.cs
@@ -188,6 +188,23 @@
         }
         #endregion
 
+        #region[宸ュ崟娲惧彂閫夋嫨宸ヨ壓璺嚎鎴栭�夋嫨鐢熶骇杞﹂棿鏃跺垽鏂粦瀹氭潯浠禲
+        /// <summary>
+        /// 宸ュ崟娲惧彂閫夋嫨宸ヨ壓璺嚎鎴栭�夋嫨鐢熶骇杞﹂棿鏃跺垽鏂粦瀹氭潯浠�
+        /// </summary>
+        /// <param name="partcode">浜у搧缂栫爜</param>
+        /// <param name="routecode">宸ヨ壓璺嚎缂栫爜</param>
+        /// <param name="wkshopcode">杞﹂棿缂栫爜</param>
+        /// <returns></returns>
+        [Route(template: "SelectRouteOrWkshop")]
+        [HttpGet]
+        public HttpResponseMessage SelectRouteOrWkshop(string partcode, string routecode, string wkshopcode)
+        {
+            mes = ProductionManagementBLL.SelectRouteOrWkshop(partcode, routecode, wkshopcode);
+            return TJson.toJson(mes);
+        }
+        #endregion
+
         #region[MES宸ュ崟鏂板銆佺紪杈戞彁浜
         /// <summary>
         /// MES宸ュ崟鏂板銆佺紪杈戞彁浜�
diff --git a/VueWebApi/DLL/BLL/ProductionManagementBLL.cs b/VueWebApi/DLL/BLL/ProductionManagementBLL.cs
index 219618a..9b3d60c 100644
--- a/VueWebApi/DLL/BLL/ProductionManagementBLL.cs
+++ b/VueWebApi/DLL/BLL/ProductionManagementBLL.cs
@@ -62,6 +62,13 @@
         }
         #endregion
 
+        #region[宸ュ崟娲惧彂閫夋嫨宸ヨ壓璺嚎鎴栭�夋嫨鐢熶骇杞﹂棿鏃跺垽鏂粦瀹氭潯浠禲
+        public static ToMessage SelectRouteOrWkshop(string partcode, string routecode, string wkshopcode)
+        {
+            return ProductionManagementDAL.SelectRouteOrWkshop(partcode, routecode, wkshopcode);
+        }
+        #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)
         {
diff --git a/VueWebApi/DLL/DAL/BasicSettingDAL.cs b/VueWebApi/DLL/DAL/BasicSettingDAL.cs
index ab4eda0..282cd8f 100644
--- a/VueWebApi/DLL/DAL/BasicSettingDAL.cs
+++ b/VueWebApi/DLL/DAL/BasicSettingDAL.cs
@@ -244,7 +244,7 @@
                 }
                 else
                 {
-                    sql = @"update TOrganization set is_delete='1'  where id=@orgid";
+                    sql = @"delete TOrganization  where id=@orgid";
                     dynamicParams.Add(@"orgid", orgid);
                     cont = DapperHelper.SQL(sql, dynamicParams);
                     if (cont > 0)
diff --git a/VueWebApi/DLL/DAL/ProductModelDAL.cs b/VueWebApi/DLL/DAL/ProductModelDAL.cs
index 23b5cff..daea8e0 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";
                         }
diff --git a/VueWebApi/DLL/DAL/ProductionManagementDAL.cs b/VueWebApi/DLL/DAL/ProductionManagementDAL.cs
index d605892..3cd08fa 100644
--- a/VueWebApi/DLL/DAL/ProductionManagementDAL.cs
+++ b/VueWebApi/DLL/DAL/ProductionManagementDAL.cs
@@ -476,6 +476,69 @@
         }
         #endregion
 
+        #region[宸ュ崟娲惧彂閫夋嫨宸ヨ壓璺嚎鎴栭�夋嫨鐢熶骇杞﹂棿鏃跺垽鏂粦瀹氭潯浠禲
+        public static ToMessage SelectRouteOrWkshop(string partcode, string routecode, string wkshopcode)
+        {
+            string sql = "";
+            var dynamicParams = new DynamicParameters();
+            try
+            {
+                mes.code = "200";
+                mes.Message = "";
+                mes.data = null;
+                //鍒ゆ柇宸ヨ壓璺嚎瀵瑰簲宸ュ簭鏄惁閮芥湁鍏宠仈宸ヤ綔绔�
+                sql = @"select B.step_code,C.eqp_code 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";
+                dynamicParams.Add("@routecode", routecode);
+                var dtck = DapperHelper.selectdata(sql, dynamicParams);
+                for (int i = 0; i < dtck.Rows.Count; i++)
+                {
+                    if (dtck.Rows[i].IsNull("eqp_code"))
+                    {
+                        mes.code = "300";
+                        mes.count = 0;
+                        mes.Message = "褰撳墠宸ヨ壓璺嚎瀵瑰簲宸ュ簭銆�" + dtck.Rows[i]["step_code"].ToString() + "銆戯紝鏈叧鑱旇澶囷紝璇峰叧鑱旀墍鏈夊伐搴忓搴旇澶�!";
+                        mes.data = null;
+                        return mes;
+                    }
+                }
+                //鍒ゆ柇宸ヨ壓璺嚎瀵瑰簲宸ュ簭鍏宠仈鐨勫伐浣滅珯鏄惁鏈夎缃妭鎷嶅伐浠�
+                sql = @"select AA.step_code,AA.eqp_code,S.unprice  from (
+                        select A.code,B.step_code,C.eqp_code 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=@route_code
+                        ) as AA
+                        left join (select * from TPrteEqp_Stad   where materiel_code=@partcode and route_code=@route_code) as S on
+                        AA.code=S.route_code and AA.step_code=S.step_code and AA.eqp_code=S.eqp_code";
+                dynamicParams.Add("@partcode", partcode);
+                dynamicParams.Add("@route_code", routecode);
+                var dtc = DapperHelper.selectdata(sql, dynamicParams);
+                for (int i = 0; i < dtc.Rows.Count; i++)
+                {
+                    if (dtc.Rows[i].IsNull("unprice") || decimal.Parse(dtc.Rows[i]["unprice"].ToString()) == 0)
+                    {
+                        mes.code = "300";
+                        mes.count = 0;
+                        mes.Message = "鑺傛媿宸ヤ环涓細褰撳墠浜у搧銆�" + partcode + "銆戯紝瀵瑰簲宸ヨ壓璺嚎銆�" + routecode + "銆戞湭璁剧疆(鎴栨湭璁剧疆鍏�)鎴栧伐浠峰皬浜庣瓑浜�0!";
+                        mes.data = null;
+                        return mes;
+                    }
+                }
+            }
+            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)
         {
diff --git a/VueWebApi/Properties/PublishProfiles/FolderProfile1.pubxml.user b/VueWebApi/Properties/PublishProfiles/FolderProfile1.pubxml.user
index de15384..af320cf 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|2022-12-02T01:48:15.8632783Z;True|2022-12-02T09:39:45.8161756+08:00;True|2022-12-02T08:40:39.6638743+08:00;True|2022-12-01T14:57:53.4186199+08:00;True|2022-11-30T15:59:10.4273430+08:00;True|2022-11-30T14:04:20.4425530+08:00;True|2022-11-30T14:03:51.8326823+08:00;True|2022-11-30T13:26:46.0316090+08:00;True|2022-11-29T08:57:17.3697109+08:00;True|2022-11-23T14:06:03.8602775+08:00;True|2022-11-21T15:13:10.4385853+08:00;True|2022-11-16T10:29:41.2258924+08:00;True|2022-11-16T09:54:23.4213778+08:00;</History>
+    <History>True|2023-03-03T08:02:52.7528225Z;True|2023-02-20T19:50:29.9610176+08:00;True|2022-12-02T09:48:15.8632783+08:00;True|2022-12-02T09:39:45.8161756+08:00;True|2022-12-02T08:40:39.6638743+08:00;True|2022-12-01T14:57:53.4186199+08:00;True|2022-11-30T15:59:10.4273430+08:00;True|2022-11-30T14:04:20.4425530+08:00;True|2022-11-30T14:03:51.8326823+08:00;True|2022-11-30T13:26:46.0316090+08:00;True|2022-11-29T08:57:17.3697109+08:00;True|2022-11-23T14:06:03.8602775+08:00;True|2022-11-21T15:13:10.4385853+08:00;True|2022-11-16T10:29:41.2258924+08:00;True|2022-11-16T09:54:23.4213778+08:00;</History>
   </PropertyGroup>
   <ItemGroup>
     <File Include="Areas/HelpPage/HelpPage.css">
@@ -705,13 +705,13 @@
       <publishTime>12/24/2021 15:38:29</publishTime>
     </File>
     <File Include="bin/VueWebApi.dll">
-      <publishTime>12/02/2022 09:48:10</publishTime>
+      <publishTime>03/03/2023 16:02:38</publishTime>
     </File>
     <File Include="bin/VueWebApi.pdb">
-      <publishTime>12/02/2022 09:48:10</publishTime>
+      <publishTime>03/03/2023 16:02:38</publishTime>
     </File>
     <File Include="bin/VueWebApi.xml">
-      <publishTime>12/02/2022 09:48:09</publishTime>
+      <publishTime>03/03/2023 16:02:38</publishTime>
     </File>
     <File Include="bin/WebActivatorEx.dll">
       <publishTime>02/08/2013 16:42:28</publishTime>
@@ -1074,7 +1074,7 @@
       <publishTime>06/16/2022 13:39:23</publishTime>
     </File>
     <File Include="Web.config">
-      <publishTime>12/02/2022 09:48:15</publishTime>
+      <publishTime>03/03/2023 16:02:51</publishTime>
     </File>
   </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/VueWebApi/bin/VueWebApi.dll b/VueWebApi/bin/VueWebApi.dll
index 37a2449..119b0c6 100644
--- a/VueWebApi/bin/VueWebApi.dll
+++ b/VueWebApi/bin/VueWebApi.dll
Binary files differ
diff --git a/VueWebApi/bin/VueWebApi.pdb b/VueWebApi/bin/VueWebApi.pdb
index c008df7..a1c0d99 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 1525713..0549db7 100644
--- a/VueWebApi/bin/VueWebApi.xml
+++ b/VueWebApi/bin/VueWebApi.xml
@@ -1984,6 +1984,15 @@
             <param name="routecode">宸ヨ壓璺嚎缂栫爜</param>
             <returns></returns>
         </member>
+        <member name="M:VueWebApi.Controllers.ProductionManagementController.SelectRouteOrWkshop(System.String,System.String,System.String)">
+            <summary>
+            宸ュ崟娲惧彂閫夋嫨宸ヨ壓璺嚎鎴栭�夋嫨鐢熶骇杞﹂棿鏃跺垽鏂粦瀹氭潯浠�
+            </summary>
+            <param name="partcode">浜у搧缂栫爜</param>
+            <param name="routecode">宸ヨ壓璺嚎缂栫爜</param>
+            <param name="wkshopcode">杞﹂棿缂栫爜</param>
+            <returns></returns>
+        </member>
         <member name="M:VueWebApi.Controllers.ProductionManagementController.AddUpdateMesOrder(Newtonsoft.Json.Linq.JObject)">
             <summary>
             MES宸ュ崟鏂板銆佺紪杈戞彁浜�
diff --git a/VueWebApi/obj/Release/Package/PackageTmp/bin/VueWebApi.dll b/VueWebApi/obj/Release/Package/PackageTmp/bin/VueWebApi.dll
index 37a2449..119b0c6 100644
--- a/VueWebApi/obj/Release/Package/PackageTmp/bin/VueWebApi.dll
+++ b/VueWebApi/obj/Release/Package/PackageTmp/bin/VueWebApi.dll
Binary files differ
diff --git a/VueWebApi/obj/Release/Package/PackageTmp/bin/VueWebApi.pdb b/VueWebApi/obj/Release/Package/PackageTmp/bin/VueWebApi.pdb
index c008df7..a1c0d99 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 1525713..0549db7 100644
--- a/VueWebApi/obj/Release/Package/PackageTmp/bin/VueWebApi.xml
+++ b/VueWebApi/obj/Release/Package/PackageTmp/bin/VueWebApi.xml
@@ -1984,6 +1984,15 @@
             <param name="routecode">宸ヨ壓璺嚎缂栫爜</param>
             <returns></returns>
         </member>
+        <member name="M:VueWebApi.Controllers.ProductionManagementController.SelectRouteOrWkshop(System.String,System.String,System.String)">
+            <summary>
+            宸ュ崟娲惧彂閫夋嫨宸ヨ壓璺嚎鎴栭�夋嫨鐢熶骇杞﹂棿鏃跺垽鏂粦瀹氭潯浠�
+            </summary>
+            <param name="partcode">浜у搧缂栫爜</param>
+            <param name="routecode">宸ヨ壓璺嚎缂栫爜</param>
+            <param name="wkshopcode">杞﹂棿缂栫爜</param>
+            <returns></returns>
+        </member>
         <member name="M:VueWebApi.Controllers.ProductionManagementController.AddUpdateMesOrder(Newtonsoft.Json.Linq.JObject)">
             <summary>
             MES宸ュ崟鏂板銆佺紪杈戞彁浜�
diff --git a/VueWebApi/obj/Release/VueWebApi.csproj.AssemblyReference.cache b/VueWebApi/obj/Release/VueWebApi.csproj.AssemblyReference.cache
index 46b571b..ea91953 100644
--- a/VueWebApi/obj/Release/VueWebApi.csproj.AssemblyReference.cache
+++ b/VueWebApi/obj/Release/VueWebApi.csproj.AssemblyReference.cache
Binary files differ
diff --git a/VueWebApi/obj/Release/VueWebApi.csproj.FileListAbsolute.txt b/VueWebApi/obj/Release/VueWebApi.csproj.FileListAbsolute.txt
index 3597e89..83d83ba 100644
--- a/VueWebApi/obj/Release/VueWebApi.csproj.FileListAbsolute.txt
+++ b/VueWebApi/obj/Release/VueWebApi.csproj.FileListAbsolute.txt
@@ -845,6 +845,7 @@
 D:\鏂板嚡杩狹ES\MES椤圭洰\MES瀵屽皵杈綷VueWebApi\VueWebApi\bin\zh-Hans\System.Web.WebPages.resources.dll
 D:\鏂板嚡杩狹ES\MES椤圭洰\MES瀵屽皵杈綷VueWebApi\VueWebApi\bin\zh-Hans\System.Web.WebPages.Deployment.resources.dll
 D:\鏂板嚡杩狹ES\MES椤圭洰\MES瀵屽皵杈綷VueWebApi\VueWebApi\bin\zh-Hans\System.Web.WebPages.Razor.resources.dll
+D:\鏂板嚡杩狹ES\MES椤圭洰\MES瀵屽皵杈綷VueWebApi\VueWebApi\obj\Release\VueWebApi.csproj.AssemblyReference.cache
 D:\鏂板嚡杩狹ES\MES椤圭洰\MES瀵屽皵杈綷VueWebApi\VueWebApi\obj\Release\VueWebApi.csproj.CoreCompileInputs.cache
 D:\鏂板嚡杩狹ES\MES椤圭洰\MES瀵屽皵杈綷VueWebApi\VueWebApi\obj\Release\VueWebApi.csproj.CopyComplete
 D:\鏂板嚡杩狹ES\MES椤圭洰\MES瀵屽皵杈綷VueWebApi\VueWebApi\obj\Release\VueWebApi.dll
diff --git a/VueWebApi/obj/Release/VueWebApi.dll b/VueWebApi/obj/Release/VueWebApi.dll
index 37a2449..119b0c6 100644
--- a/VueWebApi/obj/Release/VueWebApi.dll
+++ b/VueWebApi/obj/Release/VueWebApi.dll
Binary files differ
diff --git a/VueWebApi/obj/Release/VueWebApi.pdb b/VueWebApi/obj/Release/VueWebApi.pdb
index c008df7..a1c0d99 100644
--- a/VueWebApi/obj/Release/VueWebApi.pdb
+++ b/VueWebApi/obj/Release/VueWebApi.pdb
Binary files differ

--
Gitblit v1.9.3