From b108f7e025924e871288ac6286f03f2fdc341a35 Mon Sep 17 00:00:00 2001
From: llj <132905093+newwwwwwtree@users.noreply.github.com>
Date: 星期一, 18 八月 2025 12:53:18 +0800
Subject: [PATCH] 不良报表根据需求更改;根据表结构,增加层级列表页面、维护页面。(新增、编辑、删除、审核、禁用、列设置、按钮设置、导出)
---
WebAPI/Controllers/基础资料/基础资料/Gy_PNLInfoTypeLevelController.cs | 1142 +++++++++++++++++++++++++++++++++++++++++++++++++++
WebAPI/Controllers/华远datamapping/Gy_BarCodeReportController.cs | 92 +++
WebAPI/Models/ClsGy_PNLTypeLevel.cs | 17
WebAPI/WebAPI.csproj.user | 6
WebAPI/Controllers/WebAPIController.cs | 1
WebAPI/WebAPI.csproj | 3
6 files changed, 1,241 insertions(+), 20 deletions(-)
diff --git a/WebAPI/Controllers/WebAPIController.cs b/WebAPI/Controllers/WebAPIController.cs
index ab5325f..ed70dd5 100644
--- a/WebAPI/Controllers/WebAPIController.cs
+++ b/WebAPI/Controllers/WebAPIController.cs
@@ -22120,6 +22120,7 @@
}
}
+
}
}
diff --git "a/WebAPI/Controllers/\345\215\216\350\277\234datamapping/Gy_BarCodeReportController.cs" "b/WebAPI/Controllers/\345\215\216\350\277\234datamapping/Gy_BarCodeReportController.cs"
index 27b1b5c..48d9b01 100644
--- "a/WebAPI/Controllers/\345\215\216\350\277\234datamapping/Gy_BarCodeReportController.cs"
+++ "b/WebAPI/Controllers/\345\215\216\350\277\234datamapping/Gy_BarCodeReportController.cs"
@@ -81,7 +81,7 @@
#endregion
- #region 涓嶈壇鍘熷洜鏌ヨ
+ #region 琛ㄦ牸鏌ヨ
[Route("Gy_BarCodeReportController/GetBadReason_proc")]
[HttpGet]
public object GetBadReason_proc(string sWhere, string user)
@@ -99,22 +99,32 @@
List<object> columnNameList = new List<object>();
- ds = oCN.RunProcReturn("exec h_p_QC_BarCodeBadReasonReport '" + HBeginDate + "','" + HEndDate + "','" + Station + "','" + MaterialNo + "','" + LotNo + "'", "h_p_QC_BarCodeBadReasonReport");
+ ds = oCN.RunProcReturn("exec h_p_QC_BarCodeReasonTable '" + HBeginDate + "','" + HEndDate + "','" + Station + "','" + MaterialNo + "','" + LotNo + "'", "h_p_QC_BarCodeReasonTable");
- //娣诲姞鍒楀悕
+ //if (ds == null || ds.Tables.Count == 0)
+ //{
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "鏈煡璇㈠埌鏁版嵁锛�";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ //}
+ //娣诲姞鍒楀悕1
foreach (DataColumn col in ds.Tables[0].Columns)
- {
- Type dataType = col.DataType;
- string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
- columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
- }
-
- objJsonResult.code = "1";
- objJsonResult.count = 1;
- objJsonResult.Message = "Sucess锛�";
- objJsonResult.data = ds.Tables;
- objJsonResult.list = columnNameList;
- return objJsonResult;
+ {
+ Type dataType = col.DataType;
+ string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+ columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+ }
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables;
+ objJsonResult.list = columnNameList;
+ return objJsonResult;
+
+
+
}
catch (Exception e)
{
@@ -127,7 +137,7 @@
}
#endregion
- #region 涓嶈壇鐜囨煡璇�
+ #region 鏌辩姸鍥炬煡璇�
[Route("Gy_BarCodeReportController/GetBadReasonTotal_proc")]
[HttpGet]
public object GetBadReasonTotal_proc(string sWhere, string user)
@@ -139,12 +149,13 @@
string HBeginDate = dic["HBeginDate"].ToString();
string HEndDate = dic["HEndDate"].ToString();
+ string Station = dic["Station"].ToString();//绔欏彴
string MaterialNo = dic["MaterialNo"].ToString();//鏂欏彿
string LotNo = dic["LotNo"].ToString();//鎵规鍙�
List<object> columnNameList = new List<object>();
- ds = oCN.RunProcReturn("exec h_p_QC_BarCodeReasonTotalReport '" + HBeginDate + "','" + HEndDate + "','" + "','" + MaterialNo + "','" + LotNo + "'", "h_p_QC_BarCodeBadReasonReport");
+ ds = oCN.RunProcReturn("exec h_p_QC_BarCodeReasonTotalReport '" + HBeginDate + "','" + HEndDate + "','" +Station + "','" + MaterialNo + "','" + LotNo + "'", "h_p_QC_BarCodeBadReasonReport");
//娣诲姞鍒楀悕
foreach (DataColumn col in ds.Tables[0].Columns)
@@ -172,5 +183,52 @@
}
#endregion
+ #region pie鍥�
+ [Route("Gy_BarCodeReportController/GetBadReason_pie")]
+ [HttpGet]
+ public object GetBadReason_pie(string sWhere, string user)
+ {
+ try
+ {
+ Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere);
+
+
+ string HBeginDate = dic["HBeginDate"].ToString();
+ string HEndDate = dic["HEndDate"].ToString();
+ string Station = dic["Station"].ToString();//绔欏彴
+ string MaterialNo = dic["MaterialNo"].ToString();//鏂欏彿
+ string LotNo = dic["LotNo"].ToString();//鎵规鍙�
+
+ List<object> columnNameList = new List<object>();
+
+ ds = oCN.RunProcReturn("exec h_p_QC_BarCodeBadReasonReport_pie '" + HBeginDate + "','" + HEndDate + "','" + Station + "','" + MaterialNo + "','" + LotNo + "'", "h_p_QC_BarCodeBadReasonReport_pie");
+
+ //娣诲姞鍒楀悕
+ foreach (DataColumn col in ds.Tables[0].Columns)
+ {
+ Type dataType = col.DataType;
+ string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+ columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+ }
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[0];
+ objJsonResult.list = columnNameList;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+
}
}
\ No newline at end of file
diff --git "a/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_PNLInfoTypeLevelController.cs" "b/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_PNLInfoTypeLevelController.cs"
new file mode 100644
index 0000000..d586e60
--- /dev/null
+++ "b/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_PNLInfoTypeLevelController.cs"
@@ -0,0 +1,1142 @@
+锘縰sing DBUtility;
+using Newtonsoft.Json;
+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.Http;
+using WebAPI.Models;
+using System.Web;
+//using WebAPI.Controllers.SCGL.鏃ヨ鍒掔鐞�;
+using System.IO;
+
+namespace WebAPI.Controllers.鍩虹璧勬枡.鍩虹璧勬枡
+{
+ public class Gy_PNLInfoTypeLevelController : ApiController
+ {
+ public DBUtility.ClsPub.Enum_BillStatus BillStatus;
+
+ private json objJsonResult = new json();
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ DataSet ds;
+ Models.ClsGy_DotCheck oDept = new Models.ClsGy_DotCheck();
+ Models.ClsGy_DotCheck oDeptHlp = new Models.ClsGy_DotCheck();
+
+ #region 灞傜骇鍒楄〃鏁版嵁
+ [Route("Gy_PNLInfoTypeLevelController/GetPNLInfoTypeLevel")]
+ [HttpGet]
+ public object GetPNLInfoTypeLevel(string sWhere, string user)
+ {
+ try
+ {
+ List<object> columnNameList = new List<object>();
+ if (!DBUtility.ClsPub.Security_Log("Gy_PNLInfoTypeLevel", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "娌℃湁鏌ョ湅鏉冮檺";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ ds = oCN.RunProcReturn("select * from h_v_Gy_PNLInfoTypeSub where 1=1 " + sWhere + " order by 灞傜骇浠g爜", "h_v_Gy_PNLInfoTypeSub");
+
+ //娣诲姞鍒楀悕
+ foreach (DataColumn col in ds.Tables[0].Columns)
+ {
+ Type dataType = col.DataType;
+ string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+ columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+ }
+
+ //if (ds.Tables[0].Rows.Count != 0 || ds != null)
+ //{
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[0];
+ objJsonResult.list = columnNameList;
+ return objJsonResult;
+ //}
+ //else
+ //{
+ //objJsonResult.code = "0";
+ //objJsonResult.count = 0;
+ //objJsonResult.Message = "鏃犳暟鎹�";
+ //objJsonResult.data = null;
+ //return objJsonResult;
+ //}
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 灞傜骇椤圭洰鍒犻櫎
+ [Route("Gy_PNLInfoTypeLevelController/DeleteType")]
+ [HttpGet]
+ public object DeleteType(long HInterID, string User)
+ {
+
+ try
+ {
+ if (!DBUtility.ClsPub.Security_Log("Gy_PNLInfoTypeLevel_Delete", 1, false, User))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "娌℃湁鍒犻櫎鏉冮檺";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ ds = oCN.RunProcReturn("Select * from Gy_PNLInfoTypeSub Where HInterID='" + HInterID + "'", "Gy_PNLInfoTypeSub", ref DBUtility.ClsPub.sExeReturnInfo);
+ if (ds.Tables[0].Rows.Count != 0)
+ {
+ oCN.BeginTran();
+
+ //鍒犻櫎鍓嶆帶鍒�=========================================
+ //ds = oCN.RunProcReturn("Exec h_p_Gy_DotCheck_BeforeDelCtrl " + HInterID + ",'" + User + "'", "h_p_Gy_DotCheck_BeforeDelCtrl");
+ //if (ds == null)
+ //{
+ // oCN.RollBack();
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "鍒犻櫎鍓嶅垽鏂け璐ワ紒";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ //}
+ //if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+ //{
+ // oCN.RollBack();
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "鍒犻櫎澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ //}
+ //=========================================================
+
+ ds = oCN.RunProcReturn("Delete from Gy_PNLInfoTypeSub Where HInterID='" + HInterID + "'", "Gy_PNLInfoTypeSub", ref DBUtility.ClsPub.sExeReturnInfo);
+
+
+ //鍒犻櫎鍚庢帶鍒�=========================================
+ //DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_DotCheck_AfterDelCtrl " + HInterID + ",'" + User + "'", "h_p_Gy_DotCheck_AfterDelCtrl");
+ //if (ds2 == null)
+ //{
+ // oCN.RollBack();
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "鍒犻櫎鍚庡垽鏂け璐ワ紒";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ //}
+ //if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+ //{
+ // oCN.RollBack();
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "鍒犻櫎澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ //}
+ //=========================================================
+
+ oCN.Commit();
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍒犻櫎鎴愬姛";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 淇敼灞傜骇鑾峰彇缁戝畾鏁版嵁
+ [Route("Gy_PNLInfoTypeLevelController/EditType")]
+ [HttpGet]
+ public object EditType(long HInterID)
+ {
+ try
+ {
+ ds = oCN.RunProcReturn("select * from Gy_PNLInfoTypeSub where HInterID=" + HInterID, "Gy_PNLInfoTypeSub");
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "";
+ objJsonResult.data = ds.Tables[0];
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 鐐规椤圭洰淇敼淇濆瓨
+ [Route("Gy_PNLInfoTypeLevelController/EditBill")]
+ [HttpPost]
+ public object EditBill([FromBody] JObject msg)
+ {
+
+ try
+ {
+ var _value = msg["msg"].ToString();
+ string msg3 = _value.ToString();
+ //string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+ //string msg1 = sArray[0].ToString();
+ //string msg2 = sArray[1].ToString();
+ string msg2 = msg3.ToString();
+
+ //鍙嶅簭鍒楀寲
+ msg2 = "[" + msg2.ToString() + "]";
+ List<Models.ClsGy_PNLTypeLevel> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsGy_PNLTypeLevel>>(msg2);
+
+ int HNumber = list[0].HInterID;
+ int HEntryID = list[0].HEntryID;
+ string HPageIndex = list[0].HPageIndex;
+ string HColorStr = list[0].HColorStr;
+ string HLayerNo = list[0].HLayerNo;
+
+ //鍒ゆ柇鏉冮檺
+ //if (!ClsPub.Security_Log("Gy_DotCheck_Edit", 1, false, msg3))
+ //{
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "娌℃湁鎵惧埌璇ュ姛鑳芥ā鍧楋紒";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ //}
+
+ //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
+ oCN.BeginTran();
+
+
+ ////淇濆瓨鍓嶆帶鍒�=========================================
+ //DataSet ds = oCN.RunProcReturn("Exec h_p_Gy_DotCheck_BeforeSaveCtrl " + msg3 + ",'1'", "h_p_Gy_DotCheck_BeforeSaveCtrl");
+ //if (ds == null)
+ //{
+ // oCN.RollBack();
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "淇濆瓨鍓嶅垽鏂け璐ワ紒";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ //}
+ //if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+ //{
+ // oCN.RollBack();
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ //}
+ //=========================================================
+
+ //涓昏〃
+ oCN.RunProc("Update Gy_PNLInfoTypeSub set " +
+ "HPageIndex='" + HPageIndex + "'" +
+ ", HColorStr='" + HColorStr + "'" +
+ ", HLayerNo='" + HLayerNo + "'" +
+ " Where HInterID='" + HNumber + "'",
+ ref DBUtility.ClsPub.sExeReturnInfo);
+ //淇敼瀛愰」鐩唬鐮�
+ //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_RepairCheck,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo);
+
+ //淇濆瓨鍚庢帶鍒�=========================================
+ //DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_DotCheck_AfterSaveCtrl " + msg3 + ",'1'", "h_p_Gy_DotCheck_AfterSaveCtrl");
+ //if (ds2 == null)
+ //{
+ // oCN.RollBack();
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "淇濆瓨鍚庡垽鏂け璐ワ紒";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+
+ //}
+ //if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+ //{
+ // oCN.RollBack();
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ //}
+ //=========================================================
+
+ oCN.Commit();
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "淇敼鎴愬姛锛�";
+ //objJsonResult.data = null;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.Message;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 灞傜骇椤圭洰鏂板淇濆瓨
+ [Route("Gy_PNLInfoTypeLevelController/AddBill")]
+ [HttpPost]
+ public object AddBill([FromBody] JObject msg)
+ {
+ try
+ {
+ var _value = msg["msg"].ToString();
+ string msg3 = _value.ToString();
+ //string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+ //string msg1 = sArray[0].ToString();
+ //string msg2 = sArray[1].ToString();
+ string msg2 = msg3.ToString();
+
+ //鍙嶅簭鍒楀寲
+ msg2 = "[" + msg2.ToString() + "]";
+
+ List<Models.ClsGy_PNLTypeLevel> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsGy_PNLTypeLevel>>(msg2);
+
+ int HNumber = list[0].HInterID;
+ int HEntryID = list[0].HEntryID;
+ string HPageIndex = list[0].HPageIndex;
+ string HColorStr = list[0].HColorStr;
+ string HLayerNo = list[0].HLayerNo;
+
+ //鍒ゆ柇鏉冮檺
+ //if (!ClsPub.Security_Log("Gy_DotCheck_Edit", 1, false, msg3))
+ //{
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "娌℃湁鎵惧埌璇ュ姛鑳芥ā鍧楋紒";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ //}
+ //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
+ oCN.BeginTran();
+
+ //淇濆瓨鍓嶆帶鍒�=========================================
+ //DataSet ds = oCN.RunProcReturn("Exec h_p_Gy_DotCheck_BeforeSaveCtrl " + msg3 + ",'1'", "h_p_Gy_DotCheck_BeforeSaveCtrl");
+ //if (ds == null)
+ //{
+ // oCN.RollBack();
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "淇濆瓨鍓嶅垽鏂け璐ワ紒";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ //}
+ //if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+ //{
+ // oCN.RollBack();
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ //}
+ //=========================================================
+
+ //涓昏〃
+ oCN.RunProc("Insert into Gy_PNLInfoTypeSub " +
+ " (HInterID,HEntryID,HPageIndex,HColorStr,HLayerNo" +
+ " ) " +
+ " Values(" + HNumber + "," + HEntryID + ",'" + HPageIndex + "','" + HColorStr + "','" +
+ HLayerNo + "')", ref DBUtility.ClsPub.sExeReturnInfo);
+ //淇敼涓婄骇涓洪潪鏈骇浠g爜
+ //oCN.RunProc("Update Gy_MouldType set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
+
+ //淇濆瓨鍚庢帶鍒�=========================================
+ //DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_DotCheck_AfterSaveCtrl " + msg3 + ",'1'", "h_p_Gy_DotCheck_AfterSaveCtrl");
+ //if (ds2 == null)
+ //{
+ // oCN.RollBack();
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "淇濆瓨鍚庡垽鏂け璐ワ紒";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+
+ //}
+ //if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+ //{
+ // oCN.RollBack();
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ //}
+ //=========================================================
+
+ oCN.Commit();
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鏂板鎴愬姛锛�";
+ //objJsonResult.data = null;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.Message;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 灞傜骇鍒楄〃 鏍戠姸鍥� 鐐瑰嚮鍒嗙被鏌ヨ
+ public class TreeModel
+ {
+ public string id { get; set; }
+ public string title { get; set; }
+ public List<TreeModel> children = new List<TreeModel>();
+ }
+ [Route("Gy_PNLInfoTypeLevelController/TreeGetList")]
+ [HttpGet]
+ public object TreeGetList(string sWhere, string user)
+ {
+ try
+ {
+
+ ds = oCN.RunProcReturn("select HInterID,HName from Gy_PNLInfoType", "Gy_PNLInfoType");
+
+ List<TreeModel> treeModels = new List<TreeModel>();
+ TreeModel first = new TreeModel();
+ first.id = "0";
+ first.title = "灞傜骇椤圭洰鍒嗙被璁剧疆";
+ treeModels.Add(first);
+
+ foreach (DataRow row in ds.Tables[0].Rows)
+ {
+ var strLen = row["HInterID"].ToString().Split('.');
+ if (strLen.Length == 1)
+ {
+ TreeModel tree = new TreeModel();
+ tree.id = row["HInterID"].ToString();
+ tree.title = row["HName"].ToString();
+ treeModels[0].children.Add(tree);
+ }
+ }
+ //digui(ds.Tables[0], treeModels[0].children, 2);
+
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = Newtonsoft.Json.JsonConvert.SerializeObject(treeModels);
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ #endregion
+
+ //#region 鐐规椤圭洰鏂囦欢涓婁紶
+ //[Route("Gy_DotCheck/Gy_DotCheck_Excel")]
+ //[HttpPost]
+ //public object Gy_DotCheck_Excel()
+ //{
+ // try
+ // {
+ // //鑾峰彇鏂囦欢鍚嶇О
+ // var file = HttpContext.Current.Request.Files[0];
+ // //鑾峰彇鏂囦欢鐗╃悊璺緞
+ // string ExcelPath = HttpContext.Current.Server.MapPath("~/" + file.FileName);
+ // //淇濆瓨鏂囦欢
+ // file.SaveAs(ExcelPath);
+
+ // NpoiHelper np = new NpoiHelper();
+ // DataSet ExcelDs = np.ReadExcel(ExcelPath, 1, 1, "0");
+
+ // //鍒犻櫎鏂囦欢
+ // File.Delete(ExcelPath);
+
+ // //鍒涘缓涓存椂琛�
+ // DataTable tb2 = new DataTable("dt2");
+
+ // //娣诲姞鍒楀悕
+ // for (int i = 0; i < ExcelDs.Tables[0].Columns.Count; i++)
+ // {
+ // tb2.Columns.Add(ExcelDs.Tables[0].Rows[0][i].ToString());
+ // }
+
+ // //妯℃澘缂哄皯鍒� 浣嗛渶瑕佷粠鏁版嵁搴撲腑鏌ヨ鍑烘潵鏄剧ず鍦ㄩ〉闈㈢殑瀛楁
+ // tb2.Columns.Add("HOrgID", typeof(Int32));//缁勭粐ID
+ // tb2.Columns.Add("HDotCheckItemClassID", typeof(Int32));//鐐规椤圭洰鍒嗙被ID
+
+ // //娣诲姞鏁版嵁
+ // for (int i = 1; i < ExcelDs.Tables[0].Rows.Count; i++)
+ // {
+ // DataRow row = tb2.NewRow();
+ // for (int j = 0; j < ExcelDs.Tables[0].Columns.Count; j++)
+ // {
+ // row[j] = ExcelDs.Tables[0].Rows[i][j].ToString();
+ // }
+ // tb2.Rows.Add(row);
+ // }
+
+
+ // var error = "";
+
+ // //鏌ヨ宸ヤ綔涓績娌℃湁鐨勫垪
+ // if (!tb2.Columns.Contains("缁勭粐浠g爜"))
+ // error += "娌℃湁鎵惧埌銆愮粍缁囦唬鐮併�戠殑鏍囬,";
+
+ // if (!tb2.Columns.Contains("缁勭粐鍚嶇О"))
+ // error += "娌℃湁鎵惧埌銆愮粍缁囧悕绉般�戠殑鏍囬,";
+
+ // if (!tb2.Columns.Contains("鐐规椤圭洰浠g爜"))
+ // error += "娌℃湁鎵惧埌銆愮偣妫�椤圭洰浠g爜銆戠殑鏍囬,";
+
+ // if (!tb2.Columns.Contains("鐐规椤圭洰鍚嶇О"))
+ // error += "娌℃湁鎵惧埌銆愮偣妫�椤圭洰鍚嶇О銆戠殑鏍囬,";
+
+ // if (!tb2.Columns.Contains("鐐规椤圭洰鍒嗙被浠g爜"))
+ // error += "娌℃湁鎵惧埌銆愮偣妫�椤圭洰鍒嗙被浠g爜銆戠殑鏍囬,";
+
+ // if (!tb2.Columns.Contains("鐐规椤圭洰鍒嗙被鍚嶇О"))
+ // error += "娌℃湁鎵惧埌銆愮偣妫�椤圭洰鍒嗙被鍚嶇О銆戠殑鏍囬,";
+
+
+ // if (error.Length > 0)
+ // {
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = $"Excel妯℃澘瀛樺湪閿欒,{error}\r\n";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ // }
+
+ // for (int i = 0; i <= tb2.Rows.Count - 1; i++)
+ // {
+
+ // string HORGNumber = "";
+ // string HORGName = "";
+ // string HDotCheckNum = "";
+ // string HDotCheckName = "";
+ // string HDotCheckItemClassNum = "";
+ // string HDotCheckItemClassName = "";
+
+ // HORGNumber = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["缁勭粐浠g爜"].ToString());
+ // HORGName = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["缁勭粐鍚嶇О"].ToString());
+ // HDotCheckNum = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["鐐规椤圭洰浠g爜"].ToString());
+ // HDotCheckName = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["鐐规椤圭洰鍚嶇О"].ToString());
+ // HDotCheckItemClassNum = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["鐐规椤圭洰鍒嗙被浠g爜"].ToString());
+ // HDotCheckItemClassName = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["鐐规椤圭洰鍒嗙被鍚嶇О"].ToString());
+
+ // //妫�鏌ョ粍缁�
+ // int index = i + 1;
+
+ // if (HORGNumber != "")
+ // {
+
+
+ // //鏌ヨ缁勭粐
+ // ds = oCN.RunProcReturn("select * from Xt_ORGANIZATIONS where HNumber='" + HORGNumber + "' and Hname='" + HORGName + "'", "Xt_ORGANIZATIONS");
+
+ // if (ds.Tables[0].Rows.Count == 0)
+ // {
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "绗�" + index + "琛�,缁勭粐涓嶅瓨鍦紒";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ // }
+ // else
+ // {
+ // tb2.Rows[i]["HOrgID"] = ds.Tables[0].Rows[0]["HItemID"].ToString();
+ // }
+ // string HORGid = ds.Tables[0].Rows[0]["HItemID"].ToString();
+
+
+ // //鏌ヨ鐐规椤圭洰鍒嗙被
+ // ds = oCN.RunProcReturn("select * from Gy_DotCheckItemClass where HNumber='" + HDotCheckItemClassNum + "' and HUSEORGID=" + HORGid + "", "Gy_Department");
+
+ // if (ds.Tables[0].Rows.Count == 0)
+ // {
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "绗�" + index + "琛�,璇�" + HORGName + "缁勭粐,鐐规椤圭洰鍒嗙被:" + HDotCheckItemClassName + ",涓嶅瓨鍦紒";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ // }
+ // else
+ // {
+ // tb2.Rows[i]["HDotCheckItemClassID"] = ds.Tables[0].Rows[0]["HItemID"].ToString();
+ // }
+
+ // //鐐规椤圭洰鍚嶇О
+ // if (HDotCheckName == "")
+ // {
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "绗�" + index + "琛�,鐐规椤圭洰鍚嶇О涓嶈兘涓虹┖锛�";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ // }
+
+ // //鐐规椤圭洰浠g爜
+ // if (HDotCheckNum == "")
+ // {
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "绗�" + index + "琛�,鐐规椤圭洰浠g爜涓嶈兘涓虹┖锛�";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ // }
+ // }
+ // else
+ // {
+ // objJsonResult.code = "1";
+ // objJsonResult.count = 1;
+ // objJsonResult.Message = "绗�" + index + "琛�,缁勭粐浠g爜涓虹┖";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ // }
+ // }
+
+ // objJsonResult.code = "1";
+ // objJsonResult.count = 1;
+ // objJsonResult.Message = error;
+ // objJsonResult.data = tb2;
+ // return objJsonResult;
+ // }
+ // catch (Exception e)
+ // {
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "Exception锛�" + e.ToString();
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ // }
+ //}
+ //#endregion
+
+ #region 鐐规椤圭洰 瀵煎叆(淇濆瓨)
+ [Route("Gy_DotCheck/Gy_DotCheck_btnSave")]
+ [HttpPost]
+ public object Gy_DotCheck_btnSave([FromBody] JObject sMainSub)
+ {
+ var _value = sMainSub["sMainSub"].ToString();
+ string msg1 = _value.ToString();
+ string[] sArray = msg1.Split(new string[] { "&鍜�" }, StringSplitOptions.RemoveEmptyEntries);
+ string msg2 = sArray[0].ToString();
+ string user = sArray[1].ToString();
+ try
+ {
+ if (!DBUtility.ClsPub.Security_Log("Gy_DotCheck_Edit", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ List<object> Excel = Newtonsoft.Json.JsonConvert.DeserializeObject<List<object>>(msg2);
+ List<Dictionary<string, string>> list = new List<Dictionary<string, string>>();
+
+ foreach (JObject item in Excel)
+ {
+ Dictionary<string, string> dic = new Dictionary<string, string>();
+ foreach (var itm in item.Properties())
+ {
+ dic.Add(itm.Name, itm.Value.ToString());
+ }
+ list.Add(dic);
+ }
+
+ oCN.BeginTran();
+ int i = 1;
+ foreach (Dictionary<string, string> item in list)
+ {
+ string HOrgID = item["HOrgID"].ToString();//缁勭粐ID
+ string HDotCheckItemClassID = item["HDotCheckItemClassID"].ToString();//鐐规椤圭洰鍒嗙被ID
+ string HDotCheckItemClassName = item["鐐规椤圭洰鍒嗙被浠g爜"].ToString();
+ string HDotCheckItemClassNum = item["鐐规椤圭洰鍒嗙被鍚嶇О"].ToString();
+ string HDotCheckName = item["鐐规椤圭洰鍚嶇О"].ToString();
+ string HDotCheckNum = item["鐐规椤圭洰浠g爜"].ToString();
+ string sShortNumber;
+ sShortNumber = DBUtility.ClsPub.GetShortNumber(HDotCheckNum);//鐭唬鐮�
+ if (sShortNumber.Trim() == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佺煭浠g爜涓虹┖锛�";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ int HEndFlag = 1;//鏈骇鏍囧織
+ int HLevel = DBUtility.ClsPub.GetLevel(HDotCheckNum); //绛夌骇
+
+
+ if (!DBUtility.ClsPub.AllowNumber(HDotCheckNum.Trim()))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷腑涓嶈兘鍑虹幇杩炵画鈥�.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+
+ ds = oCN.RunProcReturn("select * from Gy_DotCheck where HNumber='" + HDotCheckNum + "'", "Gy_DotCheck");
+
+ if (ds.Tables[0].Rows.Count == 0)
+ {
+
+ string sql = "insert into Gy_DotCheck(HName,HNumber,HDotCheckItemClassID,HUSEORGID,HCREATEORGID,HShortNumber,HEndFlag,HLevel,HParentID,HStopflag,HRemark,HHelpCode)" +
+ $"values('{HDotCheckName}', '{HDotCheckNum}',{HDotCheckItemClassID}, {HOrgID},{HOrgID}, '{sShortNumber}', {HEndFlag},{HLevel},0,0,'','')";
+ oCN.RunProc(sql);
+ }
+ else
+ {
+ oCN.RunProc(" update Gy_DotCheck set HDotCheckItemClassID=" + HDotCheckItemClassID + " where HNumber='" + HDotCheckNum + "'");
+ }
+
+ i++;
+ }
+
+ oCN.Commit();
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "瀵煎叆鎴愬姛!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ LogService.Write(e);
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 鐐规椤圭洰瀹℃牳銆佸弽瀹℃牳
+ /// <summary>
+ ///
+ /// </summary>
+ /// <param name="HInterID">鍗曟嵁ID</param>
+ /// <param name="IsAudit">瀹℃牳(0),鍙嶅鏍�(1)</param>
+ /// <param name="CurUserName">瀹℃牳浜�</param>
+ /// <returns></returns>
+ [Route("Gy_PNLInfoTypeLevelController/AuditGy_DotCheck")]
+ [HttpGet]
+ public object AuditGy_DotCheck(int HInterID, int IsAudit, string CurUserName)
+ {
+ try
+ {
+ //瀹℃牳鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log_second("Gy_PNLInfoTypeLevel_Check", 1, false, CurUserName))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ var ds = oCN.RunProcReturn("select * from Gy_PNLInfoType where HItemID=" + HInterID, "Gy_PNLInfoTypeSub ");
+ if (ds.Tables[0].Rows.Count > 0)
+ {
+ if (IsAudit == 0) //瀹℃牳鍒ゆ柇
+ {
+ if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘鍐嶆瀹℃牳锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ if (IsAudit == 1) //鍙嶅鏍稿垽鏂�
+ {
+ if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鏈鏍�!涓嶉渶瑕佸弽瀹℃牳!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+
+
+ oCN.BeginTran();
+
+ if (IsAudit == 0) //瀹℃牳鍒ゆ柇
+ {
+ //瀹℃牳鍓嶆帶鍒�=========================================
+ ds = oCN.RunProcReturn("Exec h_p_Gy_PNLInfoType_BeforeCheckCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_PNLInfoType_BeforeCheckCtrl");
+ if (ds == null)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳鍓嶅垽鏂け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
+
+ oCN.RunProc("update Gy_PNLInfoType set HCheckEmp='" + CurUserName + "',HCheckTime=getdate() where HInterID=" + HInterID);
+
+ //瀹℃牳鍚庢帶鍒�=========================================
+ DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_PNLInfoType_AfterCheckCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_PNLInfoType_AfterCheckCtrl");
+ if (ds2 == null)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳鍚庡垽鏂け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "瀹℃牳鎴愬姛";
+ objJsonResult.data = null;
+ }
+ if (IsAudit == 1) //鍙嶅鏍稿垽鏂�
+ {
+ //鍙嶅鏍稿墠鎺у埗=========================================
+ ds = oCN.RunProcReturn("Exec h_p_Gy_PNLInfoType_BeforeUnCheckCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_PNLInfoType_BeforeUnCheckCtrl");
+ if (ds == null)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳鍓嶅垽鏂け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
+
+ oCN.RunProc("update Gy_PNLInfoType set HCheckEmp='',HCheckTime=null where HInterID=" + HInterID);
+
+
+ //鍙嶅鏍稿悗鎺у埗=========================================
+ DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_PNLInfoType_AfterUnCheckCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_PNLInfoType_AfterUnCheckCtrl");
+ if (ds2 == null)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳鍚庡垽鏂け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
+
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍙嶅鏍告垚鍔�";
+ objJsonResult.data = null;
+ }
+
+
+
+ oCN.Commit();
+
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳澶辫触鎴栬�呭弽瀹℃牳澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 鐐规椤圭洰绂佺敤銆佸弽绂佺敤
+ /// <summary>
+ ///
+ /// </summary>
+ /// <param name="HInterID">鍗曟嵁ID</param>
+ /// <param name="IsStop">绂佺敤(0),鍙嶇鐢�(1)</param>
+ /// <param name="CurUserName">瀹℃牳浜�</param>
+ /// <returns></returns>
+ [Route("Gy_PNLInfoTypeLevelController/StopGy_DotCheck")]
+ [HttpGet]
+ public object StopGy_DotCheck(int HInterID, int IsStop, string CurUserName)
+ {
+ try
+ {
+ //绂佺敤鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log_second("Gy_PNLInfoTypeLevel_Stop", 1, false, CurUserName))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绂佺敤澶辫触锛佹棤鏉冮檺锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ var ds = oCN.RunProcReturn("select * from Gy_PNLInfoType where HInterID=" + HInterID, "Gy_PNLInfoType");
+ if (ds.Tables[0].Rows.Count > 0)
+ {
+ if (IsStop == 0) //绂佺敤鍒ゆ柇
+ {
+ if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸茬鐢�!涓嶈兘鍐嶆绂佺敤锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ if (IsStop == 1) //鍙嶇鐢ㄥ垽鏂�
+ {
+ if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鏈鐢�!涓嶉渶瑕佸弽绂佺敤!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ oCN.BeginTran();
+
+ if (IsStop == 0) //绂佺敤鍒ゆ柇
+ {
+ //绂佺敤鍓嶆帶鍒�=========================================
+ ds = oCN.RunProcReturn("Exec h_p_Gy_PNLInfoType_BeforeStopCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_PNLInfoType_BeforeStopCtrl");
+ if (ds == null)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绂佺敤鍓嶅垽鏂け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绂佺敤澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
+
+ oCN.RunProc("update Gy_PNLInfoType set HStopEmp='" + CurUserName + "',HStopTime=getdate() where HInterID=" + HInterID);
+
+ //绂佺敤鍚庢帶鍒�=========================================
+ DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_PNLInfoType_AFTERStopCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_PNLInfoType_AFTERStopCtrl");
+ if (ds2 == null)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绂佺敤鍚庡垽鏂け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绂佺敤澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "绂佺敤鎴愬姛";
+ objJsonResult.data = null;
+ }
+ if (IsStop == 1) //鍙嶇鐢ㄥ垽鏂�
+ {
+ //鍙嶇鐢ㄥ墠鎺у埗=========================================
+ ds = oCN.RunProcReturn("Exec h_p_Gy_PNLInfoType_BeforeUnStopCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_PNLInfoType_BeforeUnStopCtrl");
+ if (ds == null)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绂佺敤鍓嶅垽鏂け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绂佺敤澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
+
+ oCN.RunProc("update Gy_PNLInfoType set HStopEmp='',HStopTime=null where HInterID=" + HInterID);
+
+
+ //鍙嶇鐢ㄥ悗鎺у埗=========================================
+ DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_PNLInfoType_AfterUnStop " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_PNLInfoType_AfterUnStop");
+ if (ds2 == null)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绂佺敤鍚庡垽鏂け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绂佺敤澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍙嶇鐢ㄦ垚鍔�";
+ objJsonResult.data = null;
+ }
+ oCN.Commit();
+
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绂佺敤澶辫触鎴栬�呭弽绂佺敤澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+ }
+}
diff --git a/WebAPI/Models/ClsGy_PNLTypeLevel.cs b/WebAPI/Models/ClsGy_PNLTypeLevel.cs
new file mode 100644
index 0000000..9728a85
--- /dev/null
+++ b/WebAPI/Models/ClsGy_PNLTypeLevel.cs
@@ -0,0 +1,17 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+
+namespace WebAPI.Models
+{
+ public class ClsGy_PNLTypeLevel : DBUtility.ClsGy_Base_Ctl
+ {
+ public int HInterID;
+ public int HEntryID;
+ public string HPageIndex;
+ public string HColorStr;
+ public string HLayerNo;
+
+ }
+}
\ No newline at end of file
diff --git a/WebAPI/WebAPI.csproj b/WebAPI/WebAPI.csproj
index a275b16..591ec52 100644
--- a/WebAPI/WebAPI.csproj
+++ b/WebAPI/WebAPI.csproj
@@ -635,6 +635,7 @@
<Compile Include="Controllers\鍩虹璧勬枡\鍩虹璧勬枡\Gy_PaymentConditionListBillController.cs" />
<Compile Include="Controllers\鍩虹璧勬枡\鍩虹璧勬枡\Gy_DisposeWayController.cs" />
<Compile Include="Controllers\鍗庤繙datamapping\Gy_PNLInfoController.cs" />
+ <Compile Include="Controllers\鍩虹璧勬枡\鍩虹璧勬枡\Gy_PNLInfoTypeLevelController.cs" />
<Compile Include="Controllers\椤圭洰绠$悊\宸ョ▼椤圭洰\PM_ProjectBill_WorkController.cs" />
<Compile Include="Models\ClsGy_PNLInfoSub.cs" />
<Compile Include="Controllers\鍩虹璧勬枡\鍩虹璧勬枡\Gy_ProcMulController.cs" />
@@ -862,6 +863,7 @@
<Compile Include="Models\ClsGy_BarCodeBill_Set_Temp.cs" />
<Compile Include="Models\ClsGy_PatrolCheck.cs" />
<Compile Include="Models\ClsGy_PNLInfo.cs" />
+ <Compile Include="Models\ClsGy_PNLTypeLevel.cs" />
<Compile Include="Models\ClsGy_Supplier_Link.cs" />
<Compile Include="Models\ClsGy_Supplier_PayPlan.cs" />
<Compile Include="Models\ClsGy_MouldFileBillSub_DotCheckRule.cs" />
@@ -1219,6 +1221,7 @@
<Folder Include="Views\Gy_Operator\" />
<Folder Include="Views\Gy_PackType\" />
<Folder Include="Views\Gy_PaymentConditionListBill\" />
+ <Folder Include="Views\Gy_PNLInfoTypeLevel\" />
<Folder Include="Views\Gy_RateType\" />
<Folder Include="Views\Gy_RecConditionBill\" />
<Folder Include="Views\Gy_RepairCheckClass\" />
diff --git a/WebAPI/WebAPI.csproj.user b/WebAPI/WebAPI.csproj.user
index 451601d..8ef8251 100644
--- a/WebAPI/WebAPI.csproj.user
+++ b/WebAPI/WebAPI.csproj.user
@@ -3,7 +3,7 @@
<PropertyGroup>
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<NameOfLastUsedPublishProfile>C:\Users\86130\Desktop\鏅轰簯杩堟�漒MES-WEB-API\WebAPI\Properties\PublishProfiles\FolderProfilewtt.pubxml</NameOfLastUsedPublishProfile>
- <NameOfLastUsedPublishProfile>D:\缃戠珯鍙戝竷\鍚庣浠g爜\MES-WEB-API\MES-WEB-API\WebAPI\Properties\PublishProfiles\FolderProfile1.pubxml</NameOfLastUsedPublishProfile>
+ <NameOfLastUsedPublishProfile>D:\GitHub\MES-WEB-API\WebAPI\Properties\PublishProfiles\FolderProfile14.pubxml</NameOfLastUsedPublishProfile>
<UseIISExpress>true</UseIISExpress>
<Use64BitIISExpress />
<IISExpressSSLPort />
@@ -11,8 +11,8 @@
<IISExpressWindowsAuthentication>disabled</IISExpressWindowsAuthentication>
<IISExpressUseClassicPipelineMode>false</IISExpressUseClassicPipelineMode>
<UseGlobalApplicationHostFile />
- <Controller_SelectedScaffolderID>ApiControllerEmptyScaffolder</Controller_SelectedScaffolderID>
- <Controller_SelectedScaffolderCategoryPath>root/Common/Web API</Controller_SelectedScaffolderCategoryPath>
+ <Controller_SelectedScaffolderID>MvcControllerEmptyScaffolder</Controller_SelectedScaffolderID>
+ <Controller_SelectedScaffolderCategoryPath>root/Common/MVC/Controller</Controller_SelectedScaffolderCategoryPath>
<WebStackScaffolding_ControllerDialogWidth>600</WebStackScaffolding_ControllerDialogWidth>
<WebStackScaffolding_IsLayoutPageSelected>True</WebStackScaffolding_IsLayoutPageSelected>
<WebStackScaffolding_IsPartialViewSelected>False</WebStackScaffolding_IsPartialViewSelected>
--
Gitblit v1.9.1