From 01c5f10d8e452f78b1a970cf878ea61316eda0da Mon Sep 17 00:00:00 2001
From: yl <ykxkd@outlook.com>
Date: 星期三, 29 三月 2023 10:57:14 +0800
Subject: [PATCH] 订单下达生成工单语句修改、生产工单手工创建生成单据号接口

---
 VueWebApi/Controllers/ProductionManagementController.cs |  518 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 506 insertions(+), 12 deletions(-)

diff --git a/VueWebApi/Controllers/ProductionManagementController.cs b/VueWebApi/Controllers/ProductionManagementController.cs
index 883048c..17b04f9 100644
--- a/VueWebApi/Controllers/ProductionManagementController.cs
+++ b/VueWebApi/Controllers/ProductionManagementController.cs
@@ -2,11 +2,13 @@
 using Newtonsoft.Json.Linq;
 using System;
 using System.Collections.Generic;
+using System.Data;
 using System.Linq;
 using System.Net;
 using System.Net.Http;
 using System.Web;
 using System.Web.Http;
+using System.Web.Script.Serialization;
 using VueWebApi.DLL.BLL;
 using VueWebApi.Models;
 using VueWebApi.Tools;
@@ -76,6 +78,7 @@
         [HttpPost]
         public HttpResponseMessage MarkSaveErpOrder([FromBody] JObject obj)
         {
+            string erporderid = obj["erporderid"].ToString(); //璁㈠崟id
             string erpordercode = obj["erpordercode"].ToString(); //璁㈠崟缂栧彿
             string partcode = obj["partcode"].ToString(); //浜у搧缂栫爜
             string wkshopcode = obj["wkshopcode"].ToString(); //杞﹂棿缂栫爜
@@ -85,7 +88,7 @@
             string ordernum = obj["ordernum"].ToString(); //涓嬪崟鍗曟暟
             string relse_qty = obj["relse_qty"].ToString(); //宸蹭笅鍗曟暟閲�
             var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //鎿嶄綔浜哄憳
-            mes = ProductionManagementBLL.MarkSaveErpOrder(erpordercode, partcode, wkshopcode, warehousecode, erpqty, markqty, ordernum, relse_qty, username);
+            mes = ProductionManagementBLL.MarkSaveErpOrder(erporderid,erpordercode, partcode, wkshopcode, warehousecode, erpqty, markqty, ordernum, relse_qty, username);
             return TJson.toJson(mes);
         }
         #endregion
@@ -94,15 +97,16 @@
         /// <summary>
         /// ERP璁㈠崟鍏抽棴
         /// </summary>
+        /// <param name="erporderid">璁㈠崟id</param>
         /// <param name="erpordercode">璁㈠崟鍙�</param>
         /// <returns></returns>
         [Route(template: "ClosedErpOrder")]
         [HttpPost]
-        public HttpResponseMessage ClosedErpOrder(string erpordercode)
+        public HttpResponseMessage ClosedErpOrder(string erporderid, string erpordercode)
         {
             //var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //鎿嶄綔浜哄憳
             var username = "Admin";
-            mes = ProductionManagementBLL.ClosedErpOrder(erpordercode, username);
+            mes = ProductionManagementBLL.ClosedErpOrder(erporderid,erpordercode, username);
             return TJson.toJson(mes);
         }
         #endregion
@@ -115,6 +119,8 @@
         /// </summary>
         /// <param name="mesorderstus">宸ュ崟鐘舵�佺爜</param>
         /// <param name="mesordercode">宸ュ崟缂栧彿</param>
+        /// <param name="sourceorder">婧愬崟鍗曞彿</param>
+        /// <param name="ordertype">鍗曟嵁绫诲瀷</param>
         /// <param name="partcode">浜у搧缂栫爜</param>
         /// <param name="partname">浜у搧鍚嶇О</param>
         /// <param name="partspec">浜у搧瑙勬牸</param>
@@ -127,11 +133,38 @@
         /// <returns></returns>
         [Route(template: "MesOrderSearch")]
         [HttpGet]
-        public HttpResponseMessage MesOrderSearch(string mesorderstus = null, string mesordercode = null, string partcode = null, string partname = null, string partspec = null, string creatuser = null, string createdate = null, int page = 0, int rows = 0, string prop = null, string order = null)
+        public HttpResponseMessage MesOrderSearch(string mesorderstus = null, string mesordercode = null,string sourceorder=null,string ordertype=null, string partcode = null, string partname = null, string partspec = null, string creatuser = null, string createdate = null, int page = 0, int rows = 0, string prop = null, string order = null)
         {
             int startNum = rows * (page - 1) + 1;  //璧峰璁板綍rowNum
             int endNum = rows * page;   //缁撴潫璁板綍 rowNum
-            mes = ProductionManagementBLL.MesOrderSearch(mesorderstus, mesordercode, partcode, partname, partspec, startNum, creatuser, createdate, endNum, prop, order);
+            mes = ProductionManagementBLL.MesOrderSearch(mesorderstus, mesordercode, sourceorder, ordertype, partcode, partname, partspec, startNum, creatuser, createdate, endNum, prop, order);
+            return TJson.toJson(mes);
+        }
+        #endregion
+
+        #region[MES鎶ュ簾琛ュ崟宸ュ崟鏌ヨ]
+        /// <summary>
+        /// MES鎶ュ簾琛ュ崟宸ュ崟鏌ヨ
+        /// </summary>
+        /// <param name="mesordercode">宸ュ崟缂栧彿</param>
+        /// <param name="sourceorder">婧愬崟鍗曞彿</param>
+        /// <param name="partcode">浜у搧缂栫爜</param>
+        /// <param name="partname">浜у搧鍚嶇О</param>
+        /// <param name="partspec">浜у搧瑙勬牸</param>
+        /// <param name="creatuser">鍒涘缓浜哄憳</param>
+        /// <param name="createdate">鍒涘缓鏃堕棿</param>
+        /// <param name="page">椤电爜</param>
+        /// <param name="rows">姣忛〉鏄剧ず鏉℃暟</param>
+        /// <param name="prop">鎺掑簭瀛楁</param>
+        /// <param name="order">鎺掑簭瑙勫垯</param>
+        /// <returns></returns>
+        [Route(template: "MesBadOrderSearch")]
+        [HttpGet]
+        public HttpResponseMessage MesBadOrderSearch(int page, int rows, string prop, string order, string mesordercode = null, string sourceorder = null, string partcode = null, string partname = null, string partspec = null, string creatuser = null, string createdate = null)
+        {
+            int startNum = rows * (page - 1) + 1;  //璧峰璁板綍rowNum
+            int endNum = rows * page;   //缁撴潫璁板綍 rowNum
+            mes = ProductionManagementBLL.MesBadOrderSearch(mesordercode, sourceorder, partcode, partname, partspec, startNum, creatuser, createdate, endNum, prop, order);
             return TJson.toJson(mes);
         }
         #endregion
@@ -182,6 +215,37 @@
         }
         #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宸ュ崟鏂板銆佽幏鍙栧伐鍗曞彿
+        /// </summary>
+        /// <returns></returns>
+        [Route(template: "AddMesOrderCodeSearch")]
+        [HttpPost]
+        public HttpResponseMessage AddMesOrderCodeSearch()
+        {
+            mes = ProductionManagementBLL.AddMesOrderCodeSearch();
+            return TJson.toJson(mes);
+        }
+        #endregion
+
         #region[MES宸ュ崟鏂板銆佺紪杈戞彁浜
         /// <summary>
         /// MES宸ュ崟鏂板銆佺紪杈戞彁浜�
@@ -193,6 +257,8 @@
         public HttpResponseMessage AddUpdateMesOrder([FromBody] JObject obj)
         {
             string mesorderstus = obj["mesorderstus"].ToString();    //宸ュ崟鐘舵�佺爜
+            string sourceorder = obj["sourceorder"].ToString();    //婧愬崟缂栧彿
+            string ordertype = obj["ordertype"].ToString();       //宸ュ崟绫诲瀷
             string mesordercode = obj["mesordercode"].ToString(); //宸ュ崟缂栧彿
             string partcode = obj["partcode"].ToString(); //浜у搧缂栫爜
             string mesqty = obj["mesqty"].ToString(); //宸ュ崟鏁伴噺
@@ -203,7 +269,7 @@
             string orderlev = obj["orderlev"].ToString(); //宸ュ崟绛夌骇
             string opertype = obj["OperType"].ToString();  //鎿嶄綔绫诲瀷
             var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //鎿嶄綔浜哄憳
-            mes = ProductionManagementBLL.AddUpdateMesOrder(mesorderstus, mesordercode, partcode, mesqty, routecode, wkshopcode, planstartdate, planenddate, orderlev, username, opertype);
+            mes = ProductionManagementBLL.AddUpdateMesOrder(mesorderstus, sourceorder, ordertype, mesordercode, partcode, mesqty, routecode, wkshopcode, planstartdate, planenddate, orderlev, username, opertype);
             return TJson.toJson(mes);
         }
         #endregion
@@ -212,15 +278,16 @@
         /// <summary>
         /// MES宸ュ崟鍒犻櫎
         /// </summary>
+        /// <param name="souceid">婧愬崟宸ュ崟</param>
         /// <param name="wocode">宸ュ崟缂栧彿</param>
         /// <param name="m_po">璁㈠崟缂栧彿</param>
         /// <param name="orderqty">宸ュ崟鏁伴噺</param>
         /// <returns></returns>
         [Route(template: "DeleteMesOrder")]
         [HttpPost]
-        public HttpResponseMessage DeleteMesOrder(string wocode, string m_po, string orderqty)
+        public HttpResponseMessage DeleteMesOrder(string souceid, string wocode, string m_po, string orderqty)
         {
-            mes = ProductionManagementBLL.DeleteMesOrder(wocode, m_po, orderqty);
+            mes = ProductionManagementBLL.DeleteMesOrder(souceid, wocode, m_po, orderqty);
             return TJson.toJson(mes);
         }
         #endregion
@@ -236,7 +303,8 @@
         [HttpPost]
         public HttpResponseMessage ClosedMesOrder(string wocode, string m_po)
         {
-            mes = ProductionManagementBLL.ClosedMesOrder(wocode, m_po);
+            var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //鎿嶄綔浜哄憳
+            mes = ProductionManagementBLL.ClosedMesOrder(username,wocode, m_po);
             return TJson.toJson(mes);
         }
         #endregion
@@ -252,6 +320,23 @@
         public HttpResponseMessage SearchWorkStep(string wo_code)
         {
             mes = ProductionManagementBLL.SearchWorkStep(wo_code);
+            return TJson.toJson(mes);
+        }
+        #endregion
+
+        #region[MES宸ュ崟宸ュ簭浠诲姟鏌ョ湅SOP,鑾峰彇SOP鏂囦欢涓嬫媺鍒楄〃]
+        /// <summary>
+        /// MES宸ュ崟宸ュ簭浠诲姟鏌ョ湅SOP,鑾峰彇SOP鏂囦欢涓嬫媺鍒楄〃
+        /// </summary>
+        /// <param name="partcode">浜у搧缂栫爜</param>
+        /// <param name="routecode">宸ヨ壓璺嚎缂栫爜</param>
+        /// <param name="stepcode">宸ュ簭缂栫爜</param>
+        /// <returns></returns>
+        [Route(template: "SearchWorkStepSopList")]
+        [HttpGet]
+        public HttpResponseMessage SearchWorkStepSopList(string partcode,string routecode,string stepcode)
+        {
+            mes = ProductionManagementBLL.SearchWorkStepSopList(partcode, routecode, stepcode);
             return TJson.toJson(mes);
         }
         #endregion
@@ -296,6 +381,42 @@
             int startNum = rows * (page - 1) + 1;  //璧峰璁板綍rowNum
             int endNum = rows * page;   //缁撴潫璁板綍 rowNum
             mes = ProductionManagementBLL.MesOrderWxStepSearch(orderstepqrcode, startNum, endNum, prop, order);
+            return TJson.toJson(mes);
+        }
+        #endregion
+
+        #region[鐢熶骇寮�鎶ュ伐鎵爜鑾峰彇宸ュ崟瀵瑰簲宸ュ簭浠诲姟(涓嶈壇)]
+        /// <summary>
+        /// 鐢熶骇寮�鎶ュ伐鎵爜鑾峰彇宸ュ崟瀵瑰簲宸ュ簭浠诲姟(涓嶈壇)
+        /// </summary>
+        /// <param name="orderstepqrcode">鎵弿鐨勪簩缁寸爜淇℃伅</param>
+        /// <param name="page">椤电爜</param>
+        /// <param name="rows">姣忛〉鏄剧ず鏉℃暟</param>
+        /// <param name="prop">鎺掑簭瀛楁</param>
+        /// <param name="order">鎺掑簭瑙勫垯(榛樿鎸夌収璁″垝寮�宸ユ椂闂存搴�)</param>
+        /// <returns></returns>
+        [Route(template: "MesOrderNgStepSearch")]
+        [HttpGet]
+        public HttpResponseMessage MesOrderNgStepSearch(string orderstepqrcode = null, int page = 0, int rows = 0, string prop = null, string order = null)
+        {
+            int startNum = rows * (page - 1) + 1;  //璧峰璁板綍rowNum
+            int endNum = rows * page;   //缁撴潫璁板綍 rowNum
+            mes = ProductionManagementBLL.MesOrderNgStepSearch(orderstepqrcode, startNum, endNum, prop, order);
+            return TJson.toJson(mes);
+        }
+        #endregion
+
+        #region[鐢熶骇寮�鎶ュ伐鎵爜鑾峰彇宸ュ崟瀵瑰簲宸ュ簭浠诲姟(涓嶈壇鏄庣粏)]
+        /// <summary>
+        /// 鐢熶骇寮�鎶ュ伐鎵爜鑾峰彇宸ュ崟瀵瑰簲宸ュ簭浠诲姟(涓嶈壇鏄庣粏)
+        /// </summary>
+        /// <param name="orderstepqrcode">鎵弿鐨勪簩缁寸爜淇℃伅</param>
+        /// <returns></returns>
+        [Route(template: "MesOrderNgSubStepSearch")]
+        [HttpGet]
+        public HttpResponseMessage MesOrderNgSubStepSearch(string orderstepqrcode)
+        {
+            mes = ProductionManagementBLL.MesOrderNgSubStepSearch(orderstepqrcode);
             return TJson.toJson(mes);
         }
         #endregion
@@ -451,8 +572,9 @@
             string reportqty = obj["reportqty"].ToString(); //鎶ュ伐宸ユ暟閲�
             string ngqty = obj["ngqty"].ToString(); //涓嶈壇鏁伴噺
             string badcode = obj["badcode"].ToString(); //涓嶈壇鍘熷洜缂栫爜
+            string remarks = obj["remarks"].ToString(); //澶囨敞
             var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //鎿嶄綔浜哄憳
-            mes = ProductionManagementBLL.SavaMesOrderStepReport(mesordercode, partcode, stepseq, stepcode, eqpcode, usergroupcode, reportuser, taskqty, startqty, reportqty, ngqty, badcode, username);
+            mes = ProductionManagementBLL.SavaMesOrderStepReport(mesordercode, partcode, stepseq, stepcode, eqpcode, usergroupcode, reportuser, taskqty, startqty, reportqty, ngqty, badcode, remarks, username);
             return TJson.toJson(mes);
         }
         #endregion
@@ -501,8 +623,25 @@
             string sqty = obj["sqty"].ToString(); //鏀舵枡鏁伴噺
             string ngqty = obj["ngqty"].ToString(); //涓嶈壇鏁伴噺
             string badcode = obj["badcode"].ToString(); //涓嶈壇鍘熷洜缂栫爜
+            string remarks = obj["remarks"].ToString(); //澶囨敞
             var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //鎿嶄綔浜哄憳
-            mes = ProductionManagementBLL.SavaMesOrderStepIn(mesordercode, partcode, stepseq, stepcode, wxcode, inuser, taskqty, sqty, ngqty, badcode, username);
+            mes = ProductionManagementBLL.SavaMesOrderStepIn(mesordercode, partcode, stepseq, stepcode, wxcode, inuser, taskqty, sqty, ngqty, badcode, remarks, username);
+            return TJson.toJson(mes);
+        }
+        #endregion
+
+        #region[涓嶈壇澶勭悊,鎻愪氦]
+        /// <summary>
+        /// 涓嶈壇澶勭悊,鎻愪氦
+        /// </summary>
+        /// <param name="username">澶勭悊浜哄憳缂栫爜</param>
+        /// <param name="json">鎻愪氦鏁版嵁</param>
+        /// <returns></returns>
+        [Route(template: "EditOrderNgStepSeave")]
+        [HttpPost]
+        public HttpResponseMessage EditOrderNgStepSeave(string username, ReportDefectHandle json)
+        {
+            mes = ProductionManagementBLL.EditOrderNgStepSeave(json, username);
             return TJson.toJson(mes);
         }
         #endregion
@@ -569,13 +708,368 @@
             string checktypecode = obj["checktypecode"].ToString(); //妫�楠岀被鍨嬬紪鐮�
             string checkresult = obj["checkresult"].ToString(); //妫�楠岀粨鏋�
             string checkdescr = obj["checkdescr"].ToString(); //妫�楠屾弿杩�
+            string checkqty = obj["checkqty"].ToString(); //妫�楠屾暟閲�
             string data = obj["data"].ToString();
             List<StepCheck> json = Newtonsoft.Json.JsonConvert.DeserializeObject<List<StepCheck>>(data);
             var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //鎿嶄綔浜哄憳
-            mes = ProductionManagementBLL.SaveMesOrderStepCheckItem(mesordercode, partcode, stepcode, checkstanedcode, checkusercode, checktypecode, checkresult, checkdescr, username,json);
+            mes = ProductionManagementBLL.SaveMesOrderStepCheckItem(mesordercode, partcode, stepcode, checkstanedcode, checkusercode, checktypecode, checkresult, checkdescr, checkqty, username,json);
             return TJson.toJson(mes);
         }
         #endregion
 
+
+        #region[鐢熶骇绠$悊,淇敼鎶ュ伐鏁版嵁鏌ヨ鎺ュ彛]
+        /// <summary>
+        /// 鐢熶骇绠$悊,淇敼鎶ュ伐鏁版嵁鏌ヨ鎺ュ彛
+        /// </summary>
+        /// <param name="verify">瀹℃牳鐘舵��</param>
+        /// <param name="wo_code">宸ュ崟缂栧彿</param>
+        /// <param name="partnumber">浜у搧缂栫爜</param>
+        /// <param name="partname">浜у搧鍚嶇О</param>
+        /// <param name="partspec">浜у搧瑙勬牸</param>
+        /// <param name="reportuser">鎶ュ伐浜哄憳</param>
+        /// <param name="reportdate">鎶ュ伐鏃堕棿</param>
+        /// <param name="page">椤电爜</param>
+        /// <param name="rows">姣忛〉鏉℃暟</param>
+        /// <param name="prop">鎺掑簭瀛楁</param>
+        /// <param name="order">鎺掑簭瑙勫垯</param>
+        /// <returns></returns>
+        [Route(template: "MesOrderStepVerifySearch")]
+        [HttpGet]
+        public HttpResponseMessage MesOrderStepVerifySearch(string verify=null, string wo_code=null,string partnumber=null,string partname=null,string partspec=null,string reportuser=null,string reportdate=null, int page = 0, int rows = 0, string prop = null, string order = null)
+        {
+            string reportdateopendate = "";  //鏀舵枡寮�濮嬫椂闂�
+            string reportdateclosedate = "";    //鏀舵枡缁撴潫鏃堕棿
+            if (reportdate != "" && reportdate != null)
+            {
+                reportdateopendate = reportdate.Split('~')[0].ToString();
+                reportdateclosedate = reportdate.Split('~')[1].ToString();
+            }
+            int startNum = rows * (page - 1) + 1;  //璧峰璁板綍rowNum
+            int endNum = rows * page;   //缁撴潫璁板綍 rowNum
+            mes = ProductionManagementBLL.MesOrderStepVerifySearch(verify, wo_code,partnumber,partname,partspec,reportuser,reportdateopendate,reportdateclosedate, startNum, endNum, prop, order);
+            return TJson.toJson(mes);
+        }
+        #endregion
+
+        #region[鐢熶骇绠$悊,淇敼鎶ュ伐鏁版嵁鎻愪氦]
+        /// <summary>
+        /// 鐢熶骇绠$悊,淇敼鎶ュ伐鏁版嵁鎻愪氦
+        /// </summary>
+        /// <param name="json">鎻愪氦鏁版嵁</param>
+        /// <returns></returns>
+        [Route(template: "MesOrderStepUpdateSeave")]
+        [HttpPost]
+        public HttpResponseMessage MesOrderStepUpdateSeave(List<UpdateProductReport> json)
+        {
+            var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //鎿嶄綔浜哄憳
+            mes = ProductionManagementBLL.MesOrderStepUpdateSeave(username, json);
+            return TJson.toJson(mes);
+        }
+        #endregion
+
+        #region[鐢熶骇绠$悊,淇敼鎶ュ伐瀹℃牳鎻愪氦]
+        /// <summary>
+        /// 鐢熶骇绠$悊,淇敼鎶ュ伐瀹℃牳鎻愪氦
+        /// </summary>
+        /// <param name="json">鎻愪氦鏁版嵁</param>
+        /// <returns></returns>
+        [Route(template: "MesOrderStepVerifySeave")]
+        [HttpPost]
+        public HttpResponseMessage MesOrderStepVerifySeave(List<UpdateProductReport> json)
+        {
+            var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //鎿嶄綔浜哄憳
+            mes = ProductionManagementBLL.MesOrderStepVerifySeave(username, json);
+            return TJson.toJson(mes);
+        }
+        #endregion
+
+        #region[鐢熶骇绠$悊,淇敼鎶ュ伐鍙嶅鏍告彁浜
+        /// <summary>
+        /// 鐢熶骇绠$悊,淇敼鎶ュ伐鍙嶅鏍告彁浜�
+        /// </summary>
+        /// <param name="json">鎻愪氦鏁版嵁</param>
+        /// <returns></returns>
+        [Route(template: "MesOrderStepNoVerifySeave")]
+        [HttpPost]
+        public HttpResponseMessage MesOrderStepNoVerifySeave(List<UpdateProductReport> json)
+        {
+            var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //鎿嶄綔浜哄憳
+            mes = ProductionManagementBLL.MesOrderStepNoVerifySeave(username, json);
+            return TJson.toJson(mes);
+        }
+        #endregion
+
+        #region[鐢熶骇绠$悊,鍒犻櫎鎶ュ伐璁板綍]
+        /// <summary>
+        /// 鐢熶骇绠$悊,鍒犻櫎鎶ュ伐璁板綍
+        /// </summary>
+        /// <param name="json">鎻愪氦鏁版嵁</param>
+        /// <returns></returns>
+        [Route(template: "MesOrderStepDeleteSeave")]
+        [HttpPost]
+        public HttpResponseMessage MesOrderStepDeleteSeave(List<UpdateProductReport> json)
+        {
+            var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //鎿嶄綔浜哄憳
+            mes = ProductionManagementBLL.MesOrderStepDeleteSeave(username, json);
+            return TJson.toJson(mes);
+        }
+        #endregion
+
+
+
+
+
+        #region[MES宸ュ崟鎵归噺鍏抽棴鏌ヨ]
+        /// <summary>
+        /// MES宸ュ崟鏌ヨ
+        /// </summary>
+        /// <param name="mesorderstus">宸ュ崟鐘舵�佺爜</param>
+        /// <param name="mesordercode">宸ュ崟缂栧彿</param>
+        /// <param name="sourceorder">婧愬崟鍗曞彿</param>
+        /// <param name="ordertype">鍗曟嵁绫诲瀷</param>
+        /// <param name="partcode">浜у搧缂栫爜</param>
+        /// <param name="partname">浜у搧鍚嶇О</param>
+        /// <param name="partspec">浜у搧瑙勬牸</param>
+        /// <param name="creatuser">鍒涘缓浜哄憳</param>
+        /// <param name="createdate">鍒涘缓鏃堕棿</param>
+        /// <param name="page">椤电爜</param>
+        /// <param name="rows">姣忛〉鏄剧ず鏉℃暟</param>
+        /// <param name="prop">鎺掑簭瀛楁</param>
+        /// <param name="order">鎺掑簭瑙勫垯</param>
+        /// <returns></returns>
+        [Route(template: "MesOrderBitchClosedSearch")]
+        [HttpGet]
+        public HttpResponseMessage MesOrderBitchClosedSearch(string mesorderstus = null, string mesordercode = null, string sourceorder = null, string ordertype = null, string partcode = null, string partname = null, string partspec = null, string creatuser = null, string createdate = null, int page = 0, int rows = 0, string prop = null, string order = null)
+        {
+            int startNum = rows * (page - 1) + 1;  //璧峰璁板綍rowNum
+            int endNum = rows * page;   //缁撴潫璁板綍 rowNum
+            mes = ProductionManagementBLL.MesOrderBitchClosedSearch(mesorderstus, mesordercode, sourceorder, ordertype, partcode, partname, partspec, startNum, creatuser, createdate, endNum, prop, order);
+            return TJson.toJson(mes);
+        }
+        #endregion
+
+        #region[MES宸ュ崟鎵归噺鍏抽棴鎻愪氦]
+        /// <summary>
+        /// MES宸ュ崟鎵归噺鍏抽棴鎻愪氦
+        /// </summary>
+        /// <param name="dt">宸ュ崟鍙锋暟缁勫璞�</param>
+        /// <returns></returns>
+        [Route(template: "MesOrderBitchClosedSeave")]
+        [HttpPost]
+        public HttpResponseMessage MesOrderBitchClosedSeave(DataTable dt)
+        {
+            
+            var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //鎿嶄綔浜哄憳
+            mes = ProductionManagementBLL.MesOrderBitchClosedSeave(username, dt);
+            return TJson.toJson(mes);
+        }
+        #endregion
+
+        #region[MES宸ュ崟鎵归噺鍙嶅叧闂璢
+        /// <summary>
+        /// MES宸ュ崟鎵归噺鍙嶅叧闂�
+        /// </summary>
+        /// <param name="dt">宸ュ崟鍙锋暟缁勫璞�</param>
+        /// <returns></returns>
+        [Route(template: "MesOrderBitchAntiClosedSeave")]
+        [HttpPost]
+        public HttpResponseMessage MesOrderBitchAntiClosedSeave(DataTable dt)
+        {
+
+            var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //鎿嶄綔浜哄憳
+            mes = ProductionManagementBLL.MesOrderBitchAntiClosedSeave(username, dt);
+            return TJson.toJson(mes);
+        }
+        #endregion
+
+
+        #region[浜ц兘瑙勫垝鏌ヨ]
+        /// <summary>
+        /// 浜ц兘瑙勫垝鏌ヨ
+        /// </summary>
+        /// <param name="page">椤电爜</param>
+        /// <param name="rows">椤垫暟</param>
+        /// <param name="prop">鎺掑簭瀛楁</param>
+        /// <param name="order">鎺掑簭瑙勫垯</param>
+        /// <param name="workshop">杞﹂棿缂栫爜</param>
+        /// <param name="devicetype">鐢熶骇鍗曞厓</param>
+        /// <param name="stustype">鏈夋晥鐘舵��</param>
+        /// <returns></returns>
+        [Route(template: "CapacityPlanningSearch")]
+        [HttpGet]
+        public HttpResponseMessage CapacityPlanningSearch(int page, int rows, string prop, string order,string workshop = null, string devicetype = null, string stustype = null)
+        {
+            int startNum = rows * (page - 1) + 1;  //璧峰璁板綍rowNum
+            int endNum = rows * page;   //缁撴潫璁板綍 rowNum
+            mes = ProductionManagementBLL.CapacityPlanningSearch(workshop, devicetype, stustype, startNum, endNum, prop, order);
+            return TJson.toJson(mes);
+        }
+        #endregion
+
+        #region[浜ц兘瑙勫垝榛樿鏂规淇濆瓨鎻愪氦]
+        /// <summary>
+        /// 浜ц兘瑙勫垝榛樿鏂规淇濆瓨鎻愪氦
+        /// </summary>
+        /// <param name="captplanid">浜ц兘瑙勫垝(鐢熶骇璧勬簮)id</param>
+        /// <param name="wkshopcode">杞﹂棿缂栫爜</param>
+        /// <param name="capunitcode">鐢熶骇鍗曞厓缂栫爜</param>
+        /// <param name="capsetupcode">榛樿鏂规缂栫爜</param>
+        /// <param name="captplantype">璧勬簮绫诲瀷</param>
+        /// <returns></returns>
+        [Route(template: "CapacityPlanSubmit")]
+        [HttpPost]
+        public HttpResponseMessage CapacityPlanSubmit(string wkshopcode, string capunitcode,string captplanid=null,string capsetupcode=null,string captplantype=null)
+        {
+            string type = ""; //鎻愪氦绫诲瀷
+            if (captplanid == "" || captplanid == null)
+            {
+                type = "Add";
+            }
+            else
+            {
+                type = "Update";
+            }
+            var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //鎿嶄綔浜哄憳
+            mes = ProductionManagementBLL.CapacityPlanSubmit(type,captplanid,wkshopcode,capunitcode,capsetupcode, captplantype,username);
+            return TJson.toJson(mes);
+        }
+        #endregion
+
+        #region[浜ц兘瑙勫垝鐐瑰嚮鏃ュ巻缁勪欢鏌ユ壘宸插叧鑱旂殑鏃ユ湡鏂规]
+        /// <summary>
+        /// 浜ц兘瑙勫垝鐐瑰嚮鏃ュ巻缁勪欢鏌ユ壘宸插叧鑱旂殑鏃ユ湡鏂规
+        /// </summary>
+        /// <param name="captplanid">浜ц兘瑙勫垝(鐢熶骇璧勬簮)id</param>
+        /// <returns></returns>
+        [Route(template: "CapacityPlanningCalendar")]
+        [HttpGet]
+        public HttpResponseMessage CapacityPlanningCalendar(string captplanid)
+        {
+            mes = ProductionManagementBLL.CapacityPlanningCalendar(captplanid);
+            return TJson.toJson(mes);
+        }
+        #endregion
+
+        #region[浜ц兘瑙勫垝鏃ュ巻鍙屽嚮鏃跺甫鍑哄搴旂殑鏂规]
+        /// <summary>
+        /// 浜ц兘瑙勫垝鏃ュ巻鍙屽嚮鏃跺甫鍑哄搴旂殑鏂规
+        /// </summary>
+        /// <param name="captplanid">浜ц兘瑙勫垝(鐢熶骇璧勬簮)id</param>
+        /// <param name="datetime">鍙屽嚮閫変腑鐨勬棩鏈�</param>
+        /// <returns></returns>
+        [Route(template: "CapacityPlanningOnclickSelect")]
+        [HttpGet]
+        public HttpResponseMessage CapacityPlanningOnclickSelect(string captplanid,string datetime)
+        {
+            mes = ProductionManagementBLL.CapacityPlanningOnclickSelect(captplanid, datetime);
+            return TJson.toJson(mes);
+        }
+        #endregion
+
+        #region[浜ц兘瑙勫垝宸ヤ綔鏃ュ巻閫夋嫨鎻愪氦]
+        /// <summary>
+        /// 浜ц兘瑙勫垝宸ヤ綔鏃ュ巻閫夋嫨鎻愪氦
+        /// </summary>
+        /// <returns></returns>
+        [Route(template: "CapacityPlanningGivePlanSubmit")]
+        [HttpPost]
+        public HttpResponseMessage CapacityPlanningGivePlanSubmit()
+        {
+            string wkshopcode = HttpContext.Current.Request["wkshopcode"].ToString();//杞﹂棿缂栫爜
+            string capunitcode = HttpContext.Current.Request["capunitcode"].ToString();//鐢熶骇鍗曞厓缂栫爜
+            string captplanid = HttpContext.Current.Request["captplanid"].ToString(); //浜ц兘瑙勫垝(鐢熶骇璧勬簮)鍒楄〃id
+            string capsetupcode = HttpContext.Current.Request["capsetupcode"].ToString(); //榛樿鏂规缂栫爜
+            string captplantype = HttpContext.Current.Request["captplantype"].ToString(); //璧勬簮绫诲瀷
+            string worklist = HttpContext.Current.Request["worklist"].ToString();  //宸ヤ綔鏃ュ巻鏁版嵁闆�
+            JavaScriptSerializer Serializer = new JavaScriptSerializer();
+            List<CapaPlan> objs = Serializer.Deserialize<List<CapaPlan>>(worklist);
+            string type = ""; //鎻愪氦绫诲瀷
+            if (captplanid == "" || captplanid == null)
+            {
+                type = "Add";
+            }
+            else
+            {
+                type = "Update";
+            }
+            var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //鎿嶄綔浜哄憳
+            mes = ProductionManagementBLL.CapacityPlanningGivePlanSubmit(captplanid, wkshopcode, capunitcode, capsetupcode, captplantype, objs,type, username);
+            return TJson.toJson(mes);
+        }
+        #endregion
+
+
+        #region[鑷姩鎺掔▼宸ュ崟鏌ヨ]
+        /// <summary>
+        /// 鑷姩鎺掔▼宸ュ崟鏌ヨ
+        /// </summary>
+        /// <param name="page">椤电爜</param>
+        /// <param name="rows">姣忛〉鏉℃暟</param>
+        /// <param name="prop">鎺掑簭瀛楁</param>
+        /// <param name="order">鎺掑簭瑙勫垯</param>
+        /// <param name="workshop">杞﹂棿缂栫爜</param>
+        /// <param name="wocode">鐢熶骇宸ュ崟鍙�</param>
+        /// <param name="partcode">鐗╂枡缂栫爜</param>
+        /// <param name="partname">鐗╂枡鍚嶇О</param>
+        /// <returns></returns>
+        [Route(template: "AdvancedSchedulingSearch")]
+        [HttpGet]
+        public HttpResponseMessage AdvancedSchedulingSearch(int page, int rows, string prop, string order, string workshop = null, string wocode = null, string partcode = null,string partname=null)
+        {
+            int startNum = rows * (page - 1) + 1;  //璧峰璁板綍rowNum
+            int endNum = rows * page;   //缁撴潫璁板綍 rowNum
+            mes = ProductionManagementBLL.AdvancedSchedulingSearch(workshop, wocode, partcode, partname, startNum, endNum, prop, order);
+            return TJson.toJson(mes);
+        }
+        #endregion
+
+        #region[楂樼骇鎺掔▼鐐瑰嚮宸ュ崟浠诲姟甯﹀嚭鐡堕宸ュ簭璁惧銆佸凡鎺掔▼浠诲姟鏁版嵁]
+        /// <summary>
+        /// 楂樼骇鎺掔▼鐐瑰嚮宸ュ崟浠诲姟甯﹀嚭鐡堕宸ュ簭璁惧銆佸凡鎺掔▼浠诲姟鏁版嵁
+        /// </summary>
+        /// <param name="wocode">宸ュ崟缂栧彿</param>
+        /// <param name="wkshpcode">杞﹂棿缂栫爜</param>
+        /// <param name="partcode">鐗╂枡缂栫爜</param>
+        /// <param name="botproccode">鐡堕宸ュ簭缂栫爜(棣栭亾宸ュ簭)</param>
+        /// <param name="startdate">寮�濮嬫棩鏈�</param>
+        /// <param name="enddate">缁撴潫鏃ユ湡</param>
+        /// <returns></returns>
+        [Route(template: "OnclickAdvancedSchedulingDevice")]
+        [HttpGet]
+        public HttpResponseMessage OnclickAdvancedSchedulingDevice(string wocode,string wkshpcode,string partcode,string botproccode,string startdate,string enddate)
+        {
+            List<AdvancedSchedulingDevice> list = new List<AdvancedSchedulingDevice>();
+            List<AdvancedSchedAlready> list1 = new List<AdvancedSchedAlready>();
+            list = ProductionManagementBLL.OnclickAdvancedSchedulingDevice(wocode, wkshpcode, partcode, startdate, enddate, ref mes); //鎺掍骇璁惧淇℃伅
+            DataTable dt = ProductionManagementBLL.AlreadyScheduling(wocode, wkshpcode, partcode, botproccode, startdate, enddate);   //璁惧宸叉帓绋嬩俊鎭�
+
+            Dictionary<object, object> dList = new Dictionary<object, object>();
+            dList.Add("rus", mes);
+            dList.Add("rows", list);
+            dList.Add("Cont", dt);
+            return TJson.toJson(dList);
+        }
+        #endregion
+
+        #region[鎺掔▼鏁版嵁鎻愪氦]
+        /// <summary>
+        /// 鎺掔▼鏁版嵁鎻愪氦
+        /// </summary>
+        /// <returns></returns>
+        [Route(template: "SubmitAlreadyScheduling")]
+        [HttpPost]
+        public HttpResponseMessage SubmitAlreadyScheduling()
+        {
+            var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //鎿嶄綔浜哄憳
+            string wocode = HttpContext.Current.Request["wocode"].ToString();//宸ュ崟缂栧彿
+            string botprocecode = HttpContext.Current.Request["botprocecode"].ToString(); //鐡堕宸ュ簭缂栫爜
+            string json = HttpContext.Current.Request["json"].ToString(); //鎺掔▼鎻愪氦鏁版嵁
+            JavaScriptSerializer Serializer = new JavaScriptSerializer();
+            List<AlreadyScheduling> objs = Serializer.Deserialize<List<AlreadyScheduling>>(json);
+            mes = ProductionManagementBLL.SubmitAlreadyScheduling(username, wocode, botprocecode, objs);
+            return TJson.toJson(mes);
+        }
+        #endregion
     }
 }

--
Gitblit v1.9.3