From 32c0daf9a78039004bb6c39d578f7734f13d54b1 Mon Sep 17 00:00:00 2001
From: yl <ykxkd@outlook.com>
Date: 星期二, 10 十月 2023 10:54:47 +0800
Subject: [PATCH] 1.工单派发校验工价,工价未提前设置或设置部分,如果开关关闭时,不校验是否未设置 或者未设置全,工价复制表中都会写入,没有设置的工价就默认0 如果开关打开就必须要设置工价

---
 VueWebApi/Controllers/DeviceManagerController.cs |  264 ++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 253 insertions(+), 11 deletions(-)

diff --git a/VueWebApi/Controllers/DeviceManagerController.cs b/VueWebApi/Controllers/DeviceManagerController.cs
index 4874412..78b82a2 100644
--- a/VueWebApi/Controllers/DeviceManagerController.cs
+++ b/VueWebApi/Controllers/DeviceManagerController.cs
@@ -180,7 +180,9 @@
         [HttpGet]
         public HttpResponseMessage WorkShopSelect()
         {
-            mes = DeviceManagerBLL.WorkShopSelect();
+            var stu_torgcode = HttpContext.Current.Request.Cookies["stu_torgcode"].Value.ToString(); //鎵�灞炵粍缁�
+            var description = HttpContext.Current.Request.Cookies["description"].Value.ToString(); //鎵�灞炵粍缁囩被鍨�
+            mes = DeviceManagerBLL.WorkShopSelect(stu_torgcode, description);
             return TJson.toJson(mes);
         }
         #endregion
@@ -219,9 +221,11 @@
         [HttpGet]
         public HttpResponseMessage DeviceMangerSearch(string DeviceCode = null, string DeviceName = null, string Status = null, string WorkShop = null,string DeviceType=null,string DeviceGroup=null,int page = 0, int rows = 0, string prop = null, string order = null)
         {
+            var stu_torgcode = HttpContext.Current.Request.Cookies["stu_torgcode"].Value.ToString(); //鎵�灞炵粍缁�
+            var description = HttpContext.Current.Request.Cookies["description"].Value.ToString(); //鎵�灞炵粍缁囩被鍨�
             int startNum = rows * (page - 1) + 1;  //璧峰璁板綍rowNum
             int endNum = rows * page;   //缁撴潫璁板綍 rowNum
-            mes = DeviceManagerBLL.DeviceMangerSearch(DeviceCode, DeviceName, Status, WorkShop, DeviceType, DeviceGroup, startNum, endNum, prop, order);
+            mes = DeviceManagerBLL.DeviceMangerSearch(stu_torgcode, description,DeviceCode, DeviceName, Status, WorkShop, DeviceType, DeviceGroup, startNum, endNum, prop, order);
             return TJson.toJson(mes);
         }
         #endregion
@@ -413,9 +417,11 @@
         [HttpGet]
         public HttpResponseMessage DeviceCheckStandArdSearch(int page, int rows, string prop, string order,string checkstandcode = null, string checkstandname = null, string checkcontr = null)
         {
+            var stu_torgcode = HttpContext.Current.Request.Cookies["stu_torgcode"].Value.ToString(); //鎵�灞炵粍缁�
+            var stu_torgtypecode = HttpContext.Current.Request.Cookies["description"].Value.ToString(); //鎵�灞炵粍缁囩被鍨�
             int startNum = rows * (page - 1) + 1;  //璧峰璁板綍rowNum
             int endNum = rows * page;   //缁撴潫璁板綍 rowNum
-            mes = DeviceManagerBLL.DeviceCheckStandArdSearch(checkstandcode, checkstandname, checkcontr, startNum, endNum, prop, order);
+            mes = DeviceManagerBLL.DeviceCheckStandArdSearch(stu_torgcode, stu_torgtypecode,checkstandcode, checkstandname, checkcontr, startNum, endNum, prop, order);
             return TJson.toJson(mes);
         }
         #endregion
@@ -491,7 +497,9 @@
         [HttpGet]
         public HttpResponseMessage DeviceCheckStanedAssociationEqp(string checkstand_code)
         {
-            mes = DeviceManagerBLL.DeviceCheckStanedAssociationEqp(checkstand_code);
+            var stu_torgcode = HttpContext.Current.Request.Cookies["stu_torgcode"].Value.ToString(); //鎵�灞炵粍缁�
+            var description = HttpContext.Current.Request.Cookies["description"].Value.ToString(); //鎵�灞炵粍缁囩被鍨�
+            mes = DeviceManagerBLL.DeviceCheckStanedAssociationEqp(stu_torgcode, description,checkstand_code);
             return TJson.toJson(mes);
         }
         #endregion
@@ -507,8 +515,10 @@
         [HttpPost]
         public HttpResponseMessage SaveDeviceCheckStanedAssociationEqp(string checkstand_code, List<ObjectData> json)
         {
+            var stu_torgcode = HttpContext.Current.Request.Cookies["stu_torgcode"].Value.ToString(); //鎵�灞炵粍缁�
+            var stu_torgtypecode = HttpContext.Current.Request.Cookies["description"].Value.ToString(); //鎵�灞炵粍缁囩被鍨�
             var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //鎿嶄綔浜哄憳
-            mes = DeviceManagerBLL.SaveDeviceCheckStanedAssociationEqp(checkstand_code, username, json);
+            mes = DeviceManagerBLL.SaveDeviceCheckStanedAssociationEqp(stu_torgcode, stu_torgtypecode,checkstand_code, username, json);
             return TJson.toJson(mes);
         }
         #endregion
@@ -531,9 +541,11 @@
         [HttpGet]
         public HttpResponseMessage DeviceRepairStandArdSearch(int page, int rows, string prop, string order,string repairstandcode = null, string repairstandname = null, string repairstanddescr = null)
         {
+            var stu_torgcode = HttpContext.Current.Request.Cookies["stu_torgcode"].Value.ToString(); //鎵�灞炵粍缁�
+            var stu_torgtypecode = HttpContext.Current.Request.Cookies["description"].Value.ToString(); //鎵�灞炵粍缁囩被鍨�
             int startNum = rows * (page - 1) + 1;  //璧峰璁板綍rowNum
             int endNum = rows * page;   //缁撴潫璁板綍 rowNum
-            mes = DeviceManagerBLL.DeviceRepairStandArdSearch(repairstandcode, repairstandname, repairstanddescr, startNum, endNum, prop, order);
+            mes = DeviceManagerBLL.DeviceRepairStandArdSearch(stu_torgcode, stu_torgtypecode,repairstandcode, repairstandname, repairstanddescr, startNum, endNum, prop, order);
             return TJson.toJson(mes);
         }
         #endregion
@@ -609,7 +621,9 @@
         [HttpGet]
         public HttpResponseMessage DeviceRepairStanedAssociationEqp(string repairstand_code)
         {
-            mes = DeviceManagerBLL.DeviceRepairStanedAssociationEqp(repairstand_code);
+            var stu_torgcode = HttpContext.Current.Request.Cookies["stu_torgcode"].Value.ToString(); //鎵�灞炵粍缁�
+            var description = HttpContext.Current.Request.Cookies["description"].Value.ToString(); //鎵�灞炵粍缁囩被鍨�
+            mes = DeviceManagerBLL.DeviceRepairStanedAssociationEqp(stu_torgcode, description,repairstand_code);
             return TJson.toJson(mes);
         }
         #endregion
@@ -625,8 +639,10 @@
         [HttpPost]
         public HttpResponseMessage SaveDeviceRepairStanedAssociationEqp(string repairstand_code, List<ObjectData> json)
         {
+            var stu_torgcode = HttpContext.Current.Request.Cookies["stu_torgcode"].Value.ToString(); //鎵�灞炵粍缁�
+            var stu_torgtypecode = HttpContext.Current.Request.Cookies["description"].Value.ToString(); //鎵�灞炵粍缁囩被鍨�
             var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //鎿嶄綔浜哄憳
-            mes = DeviceManagerBLL.SaveDeviceRepairStanedAssociationEqp(repairstand_code, username, json);
+            mes = DeviceManagerBLL.SaveDeviceRepairStanedAssociationEqp(stu_torgcode, stu_torgtypecode, repairstand_code, username, json);
             return TJson.toJson(mes);
         }
         #endregion
@@ -651,6 +667,8 @@
         [HttpGet]
         public HttpResponseMessage DeviceCheckTakeSearch(int page, int rows, string prop, string order, string wkshopcode = null, string eqpcode = null, string eqpname = null,string stanedname=null,string checkuser=null,string checkdate=null)
         {
+            var stu_torgcode = HttpContext.Current.Request.Cookies["stu_torgcode"].Value.ToString(); //鎵�灞炵粍缁�
+            var description = HttpContext.Current.Request.Cookies["description"].Value.ToString(); //鎵�灞炵粍缁囩被鍨�
             string checkopendate = "";  //鐐规寮�濮嬫椂闂�
             string checkclosedate = "";    //鐐规缁撴潫鏃堕棿
             if (checkdate != "" && checkdate != null)
@@ -660,14 +678,14 @@
             }
             int startNum = rows * (page - 1) + 1;  //璧峰璁板綍rowNum
             int endNum = rows * page;   //缁撴潫璁板綍 rowNum
-            mes = DeviceManagerBLL.DeviceCheckTakeSearch(wkshopcode, eqpcode, eqpname, stanedname, checkuser, checkopendate, checkclosedate, startNum, endNum, prop, order);
+            mes = DeviceManagerBLL.DeviceCheckTakeSearch(stu_torgcode, description,wkshopcode, eqpcode, eqpname, stanedname, checkuser, checkopendate, checkclosedate, startNum, endNum, prop, order);
             return TJson.toJson(mes);
         }
         #endregion
 
-        #region[璁惧淇濆吇璁板綍鏄庣粏鏌ヨ]
+        #region[璁惧鐐规璁板綍鏄庣粏鏌ヨ]
         /// <summary>
-        /// 璁惧淇濆吇璁板綍鏄庣粏鏌ヨ
+        /// 璁惧鐐规璁板綍鏄庣粏鏌ヨ
         /// </summary>
         /// <param name="djwo">璁惧鐐规鍗曞彿</param>
         /// <returns></returns>
@@ -680,5 +698,229 @@
         }
         #endregion
 
+        #region[璁惧鐐规璁板綍瀵煎嚭]
+        /// <summary>
+        /// 璁惧鐐规璁板綍瀵煎嚭
+        /// </summary>
+        /// <param name="wkshopcode">杞﹂棿缂栫爜</param>
+        /// <param name="eqpcode">璁惧缂栧彿</param>
+        /// <param name="eqpname">璁惧鍚嶇О</param>
+        /// <param name="stanedname">鏍囧噯鍚嶇О</param>
+        /// <param name="checkuser">鐐规浜哄憳</param>
+        /// <param name="checkdate">鐐规鏃堕棿</param>
+        /// <returns></returns>
+        [Route(template: "DeviceCheckTakeOutExcel")]
+        [HttpGet]
+        public HttpResponseMessage DeviceCheckTakeOutExcel(string wkshopcode = null, string eqpcode = null, string eqpname = null, string stanedname = null, string checkuser = null, string checkdate = null)
+        {
+            var stu_torgcode = HttpContext.Current.Request.Cookies["stu_torgcode"].Value.ToString(); //鎵�灞炵粍缁�
+            var description = HttpContext.Current.Request.Cookies["description"].Value.ToString(); //鎵�灞炵粍缁囩被鍨�
+            string checkopendate = "";  //鐐规寮�濮嬫椂闂�
+            string checkclosedate = "";    //鐐规缁撴潫鏃堕棿
+            if (checkdate != "" && checkdate != null)
+            {
+                checkopendate = checkdate.Split('~')[0].ToString();
+                checkclosedate = checkdate.Split('~')[1].ToString();
+            }
+            mes = DeviceManagerBLL.DeviceCheckTakeOutExcel(stu_torgcode, description,wkshopcode, eqpcode, eqpname, stanedname, checkuser, checkopendate, checkclosedate);
+            return TJson.toJson(mes);
+        }
+        #endregion
+
+
+        #region[璁惧淇濆吇璁板綍鏌ヨ]
+        /// <summary>
+        /// 璁惧淇濆吇璁板綍鏌ヨ
+        /// </summary>
+        /// <param name="wkshopcode">杞﹂棿缂栫爜</param>
+        /// <param name="eqpcode">璁惧缂栧彿</param>
+        /// <param name="eqpname">璁惧鍚嶇О</param>
+        /// <param name="stanedname">鏍囧噯鍚嶇О</param>
+        /// <param name="repairuser">淇濆吇浜哄憳</param>
+        /// <param name="repairdate">淇濆吇鏃堕棿</param>
+        /// <param name="repairresult">淇濆吇缁撴灉</param>
+        /// <param name="page">椤电爜</param>
+        /// <param name="rows">姣忛〉鏄剧ず鏉℃暟</param>
+        /// <param name="prop">鎺掑簭瀛楁</param>
+        /// <param name="order">鎺掑簭瑙勫垯</param>
+        /// <returns></returns>
+        [Route(template: "DeviceRepairTakeSearch")]
+        [HttpGet]
+        public HttpResponseMessage DeviceRepairTakeSearch(int page, int rows, string prop, string order, string wkshopcode = null, string eqpcode = null, string eqpname = null, string stanedname = null, string repairuser = null, string repairdate = null,string repairresult=null)
+        {
+            var stu_torgcode = HttpContext.Current.Request.Cookies["stu_torgcode"].Value.ToString(); //鎵�灞炵粍缁�
+            var description = HttpContext.Current.Request.Cookies["description"].Value.ToString(); //鎵�灞炵粍缁囩被鍨�
+            string repairopendate = "";  //鐐规寮�濮嬫椂闂�
+            string repairclosedate = "";    //鐐规缁撴潫鏃堕棿
+            if (repairdate != "" && repairdate != null)
+            {
+                repairopendate = repairdate.Split('~')[0].ToString();
+                repairclosedate = repairdate.Split('~')[1].ToString();
+            }
+            int startNum = rows * (page - 1) + 1;  //璧峰璁板綍rowNum
+            int endNum = rows * page;   //缁撴潫璁板綍 rowNum
+            mes = DeviceManagerBLL.DeviceRepairTakeSearch(stu_torgcode, description, wkshopcode, eqpcode, eqpname, stanedname, repairuser, repairopendate, repairclosedate, repairresult, startNum, endNum, prop, order);
+            return TJson.toJson(mes);
+        }
+        #endregion
+
+        #region[璁惧淇濆吇璁板綍鏄庣粏鏌ヨ]
+        /// <summary>
+        /// 璁惧淇濆吇璁板綍鏄庣粏鏌ヨ
+        /// </summary>
+        /// <param name="bywo">璁惧淇濆吇鍗曞彿</param>
+        /// <returns></returns>
+        [Route(template: "DeviceRepairSubTakeSearch")]
+        [HttpGet]
+        public HttpResponseMessage DeviceRepairSubTakeSearch(string bywo)
+        {
+            mes = DeviceManagerBLL.DeviceRepairSubTakeSearch(bywo);
+            return TJson.toJson(mes);
+        }
+        #endregion
+
+        #region[璁惧淇濆吇璁板綍瀵煎嚭]
+        /// <summary>
+        /// 璁惧淇濆吇璁板綍瀵煎嚭
+        /// </summary>
+        /// <param name="wkshopcode">杞﹂棿缂栫爜</param>
+        /// <param name="eqpcode">璁惧缂栧彿</param>
+        /// <param name="eqpname">璁惧鍚嶇О</param>
+        /// <param name="stanedname">鏍囧噯鍚嶇О</param>
+        /// <param name="repairuser">淇濆吇浜哄憳</param>
+        /// <param name="repairdate">淇濆吇鏃堕棿</param>
+        /// <param name="repairresult">淇濆吇缁撴灉</param>
+        /// <returns></returns>
+        [Route(template: "DeviceRepairTakeOutExcel")]
+        [HttpGet]
+        public HttpResponseMessage DeviceRepairTakeOutExcel(string wkshopcode = null, string eqpcode = null, string eqpname = null, string stanedname = null, string repairuser = null, string repairdate = null, string repairresult = null)
+        {
+            var stu_torgcode = HttpContext.Current.Request.Cookies["stu_torgcode"].Value.ToString(); //鎵�灞炵粍缁�
+            var description = HttpContext.Current.Request.Cookies["description"].Value.ToString(); //鎵�灞炵粍缁囩被鍨�
+            string repairopendate = "";  //鐐规寮�濮嬫椂闂�
+            string repairclosedate = "";    //鐐规缁撴潫鏃堕棿
+            if (repairdate != "" && repairdate != null)
+            {
+                repairopendate = repairdate.Split('~')[0].ToString();
+                repairclosedate = repairdate.Split('~')[1].ToString();
+            }
+            mes = DeviceManagerBLL.DeviceRepairTakeOutExcel(stu_torgcode, description,wkshopcode, eqpcode, eqpname, stanedname, repairuser, repairopendate, repairclosedate, repairresult);
+            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="wkshopcode">杞﹂棿缂栫爜</param>
+        /// <param name="eqpcode">璁惧缂栫爜</param>
+        /// <param name="eqpname">璁惧鍚嶇О</param>
+        /// <param name="reportuser">鎶ヤ慨浜哄憳</param>
+        /// <param name="repairuser">缁翠慨浜哄憳</param>
+        /// <param name="vrifcatuser">楠岃瘉浜哄憳</param>
+        /// <param name="reportdate">鎶ヤ慨鏃堕棿</param>
+        /// <param name="repairdate">缁翠慨鏃堕棿</param>
+        /// <param name="vrifcatdate">楠岃瘉鏃堕棿</param>
+        /// <returns></returns>
+        [Route(template: "DeviceUpdateSearch")]
+        [HttpGet]
+        public HttpResponseMessage DeviceUpdateSearch(int page, int rows, string prop, string order, string wkshopcode = null, string eqpcode = null, string eqpname = null, string reportuser = null, string repairuser = null,string vrifcatuser=null, string reportdate = null, string repairdate = null,string vrifcatdate=null)
+        {
+            var stu_torgcode = HttpContext.Current.Request.Cookies["stu_torgcode"].Value.ToString(); //鎵�灞炵粍缁�
+            var description = HttpContext.Current.Request.Cookies["description"].Value.ToString(); //鎵�灞炵粍缁囩被鍨�
+            string reportopendate = "";  //鎶ヤ慨寮�濮嬫椂闂�
+            string reportclosedate = "";  //鎶ヤ慨缁撴潫鏃堕棿
+            string repairopendate = "";  //缁翠慨寮�濮嬫椂闂�
+            string repairclosedate = "";  //缁翠慨缁撴潫鏃堕棿
+            string vrifcatopendate = "";  //缁翠慨楠岃瘉寮�濮嬫椂闂�
+            string vrifcatclosedate = "";  //缁翠慨楠岃瘉缁撴潫鏃堕棿
+            if (reportdate != "" && reportdate != null)
+            {
+                reportopendate = reportdate.Split('~')[0].ToString();
+                reportclosedate = reportdate.Split('~')[1].ToString();
+            }
+            if (repairdate != "" && repairdate != null)
+            {
+                repairopendate = repairdate.Split('~')[0].ToString();
+                repairclosedate = repairdate.Split('~')[1].ToString();
+            }
+            if (vrifcatdate != "" && vrifcatdate != null)
+            {
+                vrifcatopendate = vrifcatdate.Split('~')[0].ToString();
+                vrifcatclosedate = vrifcatdate.Split('~')[1].ToString();
+            }
+            int startNum = rows * (page - 1) + 1;  //璧峰璁板綍rowNum
+            int endNum = rows * page;   //缁撴潫璁板綍 rowNum
+            mes = DeviceManagerBLL.DeviceUpdateSearch(stu_torgcode, description,wkshopcode, eqpcode, eqpname, reportuser, repairuser, vrifcatuser, reportopendate, reportclosedate, repairopendate, repairclosedate, vrifcatopendate, vrifcatclosedate, startNum, endNum, prop, order);
+            return TJson.toJson(mes);
+        }
+        #endregion
+
+        #region[璁惧缁翠慨璁板綍鏄庣粏鏌ヨ]
+        /// <summary>
+        /// 璁惧缁翠慨璁板綍鏄庣粏鏌ヨ
+        /// </summary>
+        /// <param name="repair_code">璁惧缁翠慨鍗曞彿</param>
+        /// <returns></returns>
+        [Route(template: "DeviceUpdateSubSearch")]
+        [HttpGet]
+        public HttpResponseMessage DeviceUpdateSubSearch(string repair_code)
+        {
+            mes = DeviceManagerBLL.DeviceUpdateSubSearch(repair_code);
+            return TJson.toJson(mes);
+        }
+        #endregion
+
+        #region[璁惧缁翠慨璁板綍瀵煎嚭]
+        /// <summary>
+        /// 璁惧缁翠慨璁板綍瀵煎嚭
+        /// </summary>
+        /// <param name="wkshopcode">杞﹂棿缂栫爜</param>
+        /// <param name="eqpcode">璁惧缂栫爜</param>
+        /// <param name="eqpname">璁惧鍚嶇О</param>
+        /// <param name="reportuser">鎶ヤ慨浜哄憳</param>
+        /// <param name="repairuser">缁翠慨浜哄憳</param>
+        /// <param name="vrifcatuser">楠岃瘉浜哄憳</param>
+        /// <param name="reportdate">鎶ヤ慨鏃堕棿</param>
+        /// <param name="repairdate">缁翠慨鏃堕棿</param>
+        /// <param name="vrifcatdate">楠岃瘉鏃堕棿</param>
+        /// <returns></returns>
+        [Route(template: "DeviceUpdateOutExcel")]
+        [HttpGet]
+        public HttpResponseMessage DeviceUpdateOutExcel(string wkshopcode = null, string eqpcode = null, string eqpname = null, string reportuser = null, string repairuser = null, string vrifcatuser = null, string reportdate = null, string repairdate = null, string vrifcatdate = null)
+        {
+            var stu_torgcode = HttpContext.Current.Request.Cookies["stu_torgcode"].Value.ToString(); //鎵�灞炵粍缁�
+            var description = HttpContext.Current.Request.Cookies["description"].Value.ToString(); //鎵�灞炵粍缁囩被鍨�
+            string reportopendate = "";  //鎶ヤ慨寮�濮嬫椂闂�
+            string reportclosedate = "";  //鎶ヤ慨缁撴潫鏃堕棿
+            string repairopendate = "";  //缁翠慨寮�濮嬫椂闂�
+            string repairclosedate = "";  //缁翠慨缁撴潫鏃堕棿
+            string vrifcatopendate = "";  //缁翠慨楠岃瘉寮�濮嬫椂闂�
+            string vrifcatclosedate = "";  //缁翠慨楠岃瘉缁撴潫鏃堕棿
+            if (reportdate != "" && reportdate != null)
+            {
+                reportopendate = reportdate.Split('~')[0].ToString();
+                reportclosedate = reportdate.Split('~')[1].ToString();
+            }
+            if (repairdate != "" && repairdate != null)
+            {
+                repairopendate = repairdate.Split('~')[0].ToString();
+                repairclosedate = repairdate.Split('~')[1].ToString();
+            }
+            if (vrifcatdate != "" && vrifcatdate != null)
+            {
+                vrifcatopendate = vrifcatdate.Split('~')[0].ToString();
+                vrifcatclosedate = vrifcatdate.Split('~')[1].ToString();
+            }
+            mes = DeviceManagerBLL.DeviceUpdateOutExcel(stu_torgcode, description,wkshopcode, eqpcode, eqpname, reportuser, repairuser, vrifcatuser, reportopendate, reportclosedate, repairopendate, repairclosedate, vrifcatopendate, vrifcatclosedate);
+            return TJson.toJson(mes);
+        }
+        #endregion
     }
 }

--
Gitblit v1.9.3