WebAPI/Controllers/QC_ManagementController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Controllers/品质管理/工序检验单/QC_ProcessCheckBillController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Controllers/品质管理/首件检验单/QC_FirstPieceCheckBillController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
WebAPI/Controllers/QC_ManagementController.cs
@@ -8,12 +8,14 @@ using System.Collections.Generic; using System.Data; using Newtonsoft.Json.Linq; using Pub_Class; namespace WebAPI.Controllers { public class QC_ManagementController : ApiController { SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); public DAL.ClsQC_PatrolProcCheckBill BillOld = new DAL.ClsQC_PatrolProcCheckBill(); DataSet ds; #region é误è¿åæ¹æ³ @@ -269,6 +271,375 @@ return GetObjectJson(ds); } #region å·¡æ£è®°å½å å®¡æ ¸ åå®¡æ ¸ å ³é åå ³é ä½åº åä½åº /// <summary> /// å·¡æ£è®°å½å å®¡æ ¸ãåå®¡æ ¸ /// </summary> /// <param name="HInterID">åæ®ID</param> /// <param name="IsAudit">å®¡æ ¸(0),åå®¡æ ¸(1)</param> /// <param name="CurUserName">å®¡æ ¸äºº</param> /// <returns></returns> [Route("QC_Management/QC_PatrolProcCheckBillMainValue")] [HttpGet] public object QC_PatrolProcCheckBillMainValue(int HInterID, int IsAudit, string CurUserName) { try { //å®¡æ ¸æé if (!DBUtility.ClsPub.Security_Log_second("QC_PatrolProcCheckBill_Check", 1, false, CurUserName)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼æ æéï¼"; objJsonResult.data = null; return objJsonResult; } var ds = oCN.RunProcReturn("select * from QC_PatrolProcCheckBillMain where HInterID=" + HInterID, "QC_PatrolProcCheckBillMain"); if (ds.Tables[0].Rows.Count > 0) { if (IsAudit == 0) //å®¡æ ¸å¤æ { if (ds.Tables[0].Rows[0]["HChecker"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½åæ¬¡å®¡æ ¸ï¼"; objJsonResult.data = null; return objJsonResult; } } if (IsAudit == 1) //åå®¡æ ¸å¤æ { if (ds.Tables[0].Rows[0]["HChecker"].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) //å®¡æ ¸å¤æ { oCN.RunProc("update QC_PatrolProcCheckBillMain set HChecker='" + CurUserName + "',HCheckDate=getdate() where HInterID=" + HInterID); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "å®¡æ ¸æå"; objJsonResult.data = null; } if (IsAudit == 1) //åå®¡æ ¸å¤æ { oCN.RunProc("update QC_PatrolProcCheckBillMain set HChecker='',HCheckDate=null where HInterID=" + HInterID); 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; } } /// <summary> /// å·¡æ£è®°å½å å ³é åå ³é /// </summary> /// <param name="HInterID"></param> /// <param name="Type"></param> /// <param name="user"></param> /// <returns></returns> [Route("QC_Management/CloseQC_PatrolProcCheckBillMain")] [HttpGet] public object CloseQC_PatrolProcCheckBillMain(string HInterID, int Type, string user) { try { //夿æ¯å¦æå 餿é if (!DBUtility.ClsPub.Security_Log("QC_PatrolProcCheckBill_Close", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ æéå ³é!"; objJsonResult.data = null; return objJsonResult; } if (string.IsNullOrWhiteSpace(HInterID)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "HInterID为空ï¼"; objJsonResult.data = null; return objJsonResult; } ClsPub.CurUserName = user; BillOld.MvarItemKey = "QC_PatrolProcCheckBillMain"; oCN.BeginTran();//å¼å§äºå¡ //Type 1 å ³é 2 åå ³é if (Type == 1) { //夿忮æ¯å¦å·²ç»å ³é DataSet ds; string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); if (ds == null || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®ä¸åå¨ï¼"; objJsonResult.data = null; return objJsonResult; } if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["HDeleteMan"] != null && ds.Tables[0].Rows[0]["HDeleteMan"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "忮已ä½åº!ä¸è½è¿è¡å ³é!"; objJsonResult.data = null; return objJsonResult; } if (ds.Tables[0].Rows[0]["HCloseMan"] != null && ds.Tables[0].Rows[0]["HCloseMan"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å ³é!ä¸è½åæ¬¡å ³é!"; objJsonResult.data = null; return objJsonResult; } //å ³éåæ® if (!BillOld.CloseBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "å ³é失败!åå :" + ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } } else { //夿忮æ¯å¦å·²ç»åå ³é DataSet ds; string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["HDeleteMan"] != null && ds.Tables[0].Rows[0]["HDeleteMan"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "忮已ä½åº!ä¸è½è¿è¡å ³é!"; objJsonResult.data = null; return objJsonResult; } if (ds.Tables[0].Rows[0]["HCloseMan"] == null || ds.Tables[0].Rows[0]["HCloseMan"].ToString() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®æªå ³é!ä¸éè¦ååå ³é!"; objJsonResult.data = null; return objJsonResult; } //åå ³éåæ® if (!BillOld.CancelClose(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "åå ³é失败!åå :" + ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } } oCN.Commit();//æäº¤äºå¡ objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "æ§è¡æåï¼"; objJsonResult.data = null; return objJsonResult; ; } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ§è¡å¤±è´¥ï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } /// <summary> /// å·¡æ£è®°å½å ä½åº åä½åº /// </summary> /// <param name="HInterID"></param> /// <param name="Type"></param> /// <param name="user"></param> /// <returns></returns> [Route("QC_Management/DropQC_PatrolProcCheckBillMain")] [HttpGet] public object DropQC_PatrolProcCheckBillMain(string HInterID, int Type, string user) { try { //夿æ¯å¦æä½åºæé if (!DBUtility.ClsPub.Security_Log("QC_PatrolProcCheckBill_Drop", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ æéä½åº!"; objJsonResult.data = null; return objJsonResult; } if (string.IsNullOrWhiteSpace(HInterID)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "HInterID为空ï¼"; objJsonResult.data = null; return objJsonResult; } ClsPub.CurUserName = user; BillOld.MvarItemKey = "QC_PatrolProcCheckBillMain"; oCN.BeginTran();//å¼å§äºå¡ //Type 1 ä½åº 2 åä½åº if (Type == 1) { //夿忮æ¯å¦å·²ç»ä½åº DataSet ds; string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); if (ds == null || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®ä¸åå¨ï¼"; objJsonResult.data = null; return objJsonResult; } if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½è¿è¡ä½åº!"; objJsonResult.data = null; return objJsonResult; } if (ds.Tables[0].Rows[0]["HDeleteMan"] != null && ds.Tables[0].Rows[0]["HDeleteMan"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "忮已ä½åº!ä¸éè¦åä½åº!"; objJsonResult.data = null; return objJsonResult; } //ä½åºåæ® if (!BillOld.Cancelltion(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "ä½åºå¤±è´¥!åå :" + ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } } else { //夿忮æ¯å¦å·²ç»åä½åº DataSet ds; string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½è¿è¡ä½åº!"; objJsonResult.data = null; return objJsonResult; } if (ds.Tables[0].Rows[0]["HDeleteMan"] == null || ds.Tables[0].Rows[0]["HDeleteMan"].ToString() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®æªä½åº!ä¸éè¦ååä½åº!"; objJsonResult.data = null; return objJsonResult; } //åä½åºåæ® if (!BillOld.AbandonCancelltion(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "åä½åºå¤±è´¥!åå :" + ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } } oCN.Commit();//æäº¤äºå¡ objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "æ§è¡æåï¼"; objJsonResult.data = null; return objJsonResult; ; } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ§è¡å¤±è´¥ï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion /// <summary> /// æ£éªæ¹æ¡è·åä¿¡æ¯ WebAPI/Controllers/Æ·ÖʹÜÀí/¹¤Ðò¼ìÑéµ¥/QC_ProcessCheckBillController.cs
@@ -19,6 +19,7 @@ public DBUtility.ClsPub.Enum_BillStatus BillStatus; private json objJsonResult = new json(); SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); public DAL.ClsQC_ProcessCheckBill BillOld = new DAL.ClsQC_ProcessCheckBill(); DataSet ds; //è·åç³»ç»åæ° Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); @@ -125,6 +126,376 @@ } #endregion #region å·¥åºæ£éªå å®¡æ ¸ åå®¡æ ¸ å ³é åå ³é ä½åº åä½åº /// <summary> /// å·¥åºæ£éªå å®¡æ ¸ãåå®¡æ ¸ /// </summary> /// <param name="HInterID">åæ®ID</param> /// <param name="IsAudit">å®¡æ ¸(0),åå®¡æ ¸(1)</param> /// <param name="CurUserName">å®¡æ ¸äºº</param> /// <returns></returns> [Route("QC_ProcessCheckBill/QC_ProcessCheckBillMainValue")] [HttpGet] public object QC_ProcessCheckBillMainValue(int HInterID, int IsAudit, string CurUserName) { try { //å®¡æ ¸æé if (!DBUtility.ClsPub.Security_Log_second("QC_ProcessCheckBill_Check", 1, false, CurUserName)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼æ æéï¼"; objJsonResult.data = null; return objJsonResult; } var ds = oCN.RunProcReturn("select * from QC_ProcessCheckBillMain where HInterID=" + HInterID, "QC_ProcessCheckBillMain"); if (ds.Tables[0].Rows.Count > 0) { if (IsAudit == 0) //å®¡æ ¸å¤æ { if (ds.Tables[0].Rows[0]["HChecker"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½åæ¬¡å®¡æ ¸ï¼"; objJsonResult.data = null; return objJsonResult; } } if (IsAudit == 1) //åå®¡æ ¸å¤æ { if (ds.Tables[0].Rows[0]["HChecker"].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) //å®¡æ ¸å¤æ { oCN.RunProc("update QC_ProcessCheckBillMain set HChecker='" + CurUserName + "',HCheckDate=getdate() where HInterID=" + HInterID); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "å®¡æ ¸æå"; objJsonResult.data = null; } if (IsAudit == 1) //åå®¡æ ¸å¤æ { oCN.RunProc("update QC_ProcessCheckBillMain set HChecker='',HCheckDate=null where HInterID=" + HInterID); 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; } } /// <summary> /// å·¥åºæ£éªå å ³é åå ³é /// </summary> /// <param name="HInterID"></param> /// <param name="Type"></param> /// <param name="user"></param> /// <returns></returns> [Route("QC_ProcessCheckBill/CloseQC_ProcessCheckBillMain")] [HttpGet] public object CloseQC_ProcessCheckBillMain(string HInterID, int Type, string user) { try { //夿æ¯å¦æå 餿é if (!DBUtility.ClsPub.Security_Log("QC_ProcessCheckBill_Close", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ æéå ³é!"; objJsonResult.data = null; return objJsonResult; } if (string.IsNullOrWhiteSpace(HInterID)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "HInterID为空ï¼"; objJsonResult.data = null; return objJsonResult; } ClsPub.CurUserName = user; BillOld.MvarItemKey = "QC_ProcessCheckBillMain"; oCN.BeginTran();//å¼å§äºå¡ //Type 1 å ³é 2 åå ³é if (Type == 1) { //夿忮æ¯å¦å·²ç»å ³é DataSet ds; string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); if (ds == null || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®ä¸åå¨ï¼"; objJsonResult.data = null; return objJsonResult; } if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["HDeleteMan"] != null && ds.Tables[0].Rows[0]["HDeleteMan"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "忮已ä½åº!ä¸è½è¿è¡å ³é!"; objJsonResult.data = null; return objJsonResult; } if (ds.Tables[0].Rows[0]["HCloseMan"] != null && ds.Tables[0].Rows[0]["HCloseMan"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å ³é!ä¸è½åæ¬¡å ³é!"; objJsonResult.data = null; return objJsonResult; } //å ³éåæ® if (!BillOld.CloseBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "å ³é失败!åå :" + ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } } else { //夿忮æ¯å¦å·²ç»åå ³é DataSet ds; string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["HDeleteMan"] != null && ds.Tables[0].Rows[0]["HDeleteMan"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "忮已ä½åº!ä¸è½è¿è¡å ³é!"; objJsonResult.data = null; return objJsonResult; } if (ds.Tables[0].Rows[0]["HCloseMan"] == null || ds.Tables[0].Rows[0]["HCloseMan"].ToString() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®æªå ³é!ä¸éè¦ååå ³é!"; objJsonResult.data = null; return objJsonResult; } //åå ³éåæ® if (!BillOld.CancelClose(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "åå ³é失败!åå :" + ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } } oCN.Commit();//æäº¤äºå¡ objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "æ§è¡æåï¼"; objJsonResult.data = null; return objJsonResult; ; } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ§è¡å¤±è´¥ï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } /// <summary> /// å·¥åºæ£éªå ä½åº åä½åº /// </summary> /// <param name="HInterID"></param> /// <param name="Type"></param> /// <param name="user"></param> /// <returns></returns> [Route("QC_ProcessCheckBill/DropQC_ProcessCheckBillMain")] [HttpGet] public object DropQC_ProcessCheckBillMain(string HInterID, int Type, string user) { try { //夿æ¯å¦æä½åºæé if (!DBUtility.ClsPub.Security_Log("QC_ProcessCheckBill_Drop", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ æéä½åº!"; objJsonResult.data = null; return objJsonResult; } if (string.IsNullOrWhiteSpace(HInterID)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "HInterID为空ï¼"; objJsonResult.data = null; return objJsonResult; } ClsPub.CurUserName = user; BillOld.MvarItemKey = "QC_ProcessCheckBillMain"; oCN.BeginTran();//å¼å§äºå¡ //Type 1 ä½åº 2 åä½åº if (Type == 1) { //夿忮æ¯å¦å·²ç»ä½åº DataSet ds; string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); if (ds == null || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®ä¸åå¨ï¼"; objJsonResult.data = null; return objJsonResult; } if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½è¿è¡ä½åº!"; objJsonResult.data = null; return objJsonResult; } if (ds.Tables[0].Rows[0]["HDeleteMan"] != null && ds.Tables[0].Rows[0]["HDeleteMan"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "忮已ä½åº!ä¸éè¦åä½åº!"; objJsonResult.data = null; return objJsonResult; } //ä½åºåæ® if (!BillOld.Cancelltion(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "ä½åºå¤±è´¥!åå :" + ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } } else { //夿忮æ¯å¦å·²ç»åä½åº DataSet ds; string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½è¿è¡ä½åº!"; objJsonResult.data = null; return objJsonResult; } if (ds.Tables[0].Rows[0]["HDeleteMan"] == null || ds.Tables[0].Rows[0]["HDeleteMan"].ToString() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®æªä½åº!ä¸éè¦ååä½åº!"; objJsonResult.data = null; return objJsonResult; } //åä½åºåæ® if (!BillOld.AbandonCancelltion(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "åä½åºå¤±è´¥!åå :" + ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } } oCN.Commit();//æäº¤äºå¡ objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "æ§è¡æåï¼"; objJsonResult.data = null; return objJsonResult; ; } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ§è¡å¤±è´¥ï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion /// <summary> /// è¿åå·¥åºæ£éªåå表 ///åæ°ï¼string sqlã WebAPI/Controllers/Æ·ÖʹÜÀí/Ê×¼þ¼ìÑéµ¥/QC_FirstPieceCheckBillController.cs
@@ -19,6 +19,7 @@ public DBUtility.ClsPub.Enum_BillStatus BillStatus; private json objJsonResult = new json(); SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); public DAL.ClsQC_FirstPieceCheckBill BillOld = new DAL.ClsQC_FirstPieceCheckBill(); DataSet ds; //è·åç³»ç»åæ° Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); @@ -323,6 +324,7 @@ } #endregion /// <summary> ///è¿åæ£éªå¼å表 /// </summary> @@ -378,6 +380,378 @@ } } #region é¦ä»¶æ£éªåç»´æ¤ å®¡æ ¸ åå®¡æ ¸ å ³é åå ³é ä½åº åä½åº /// <summary> /// é¦ä»¶æ£éªåç»´æ¤ å®¡æ ¸ãåå®¡æ ¸ /// </summary> /// <param name="HInterID">åæ®ID</param> /// <param name="IsAudit">å®¡æ ¸(0),åå®¡æ ¸(1)</param> /// <param name="CurUserName">å®¡æ ¸äºº</param> /// <returns></returns> [Route("QC_ValueTable/QC_FirstPieceCheckValue")] [HttpGet] public object QC_FirstPieceCheckValue(int HInterID, int IsAudit, string CurUserName) { try { //å®¡æ ¸æé if (!DBUtility.ClsPub.Security_Log_second("QC_FirstPieceCheckBill_Check", 1, false, CurUserName)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼æ æéï¼"; objJsonResult.data = null; return objJsonResult; } var ds = oCN.RunProcReturn("select * from QC_FirstPieceCheckBillMain where HInterID=" + HInterID, "QC_FirstPieceCheckBillMain"); if (ds.Tables[0].Rows.Count > 0) { if (IsAudit == 0) //å®¡æ ¸å¤æ { if (ds.Tables[0].Rows[0]["HChecker"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½åæ¬¡å®¡æ ¸ï¼"; objJsonResult.data = null; return objJsonResult; } } if (IsAudit == 1) //åå®¡æ ¸å¤æ { if (ds.Tables[0].Rows[0]["HChecker"].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) //å®¡æ ¸å¤æ { oCN.RunProc("update QC_FirstPieceCheckBillMain set HChecker='" + CurUserName + "',HCheckDate=getdate() where HInterID=" + HInterID); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "å®¡æ ¸æå"; objJsonResult.data = null; } if (IsAudit == 1) //åå®¡æ ¸å¤æ { oCN.RunProc("update QC_FirstPieceCheckBillMain set HChecker='',HCheckDate=null where HInterID=" + HInterID); 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; } } /// <summary> /// é¦ä»¶æ£éªåç»´æ¤ å ³é åå ³é /// </summary> /// <param name="HInterID"></param> /// <param name="Type"></param> /// <param name="user"></param> /// <returns></returns> [Route("QC_ValueTable/CloseQC_FirstPieceCheckBill")] [HttpGet] public object CloseQC_FirstPieceCheckBill(string HInterID, int Type, string user) { try { //夿æ¯å¦æå 餿é if (!DBUtility.ClsPub.Security_Log("QC_FirstPieceCheckBill_Close", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ æéå ³é!"; objJsonResult.data = null; return objJsonResult; } if (string.IsNullOrWhiteSpace(HInterID)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "HInterID为空ï¼"; objJsonResult.data = null; return objJsonResult; } ClsPub.CurUserName = user; BillOld.MvarItemKey = "QC_FirstPieceCheckBillMain"; oCN.BeginTran();//å¼å§äºå¡ //Type 1 å ³é 2 åå ³é if (Type == 1) { //夿忮æ¯å¦å·²ç»å ³é DataSet ds; string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); if (ds == null || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®ä¸åå¨ï¼"; objJsonResult.data = null; return objJsonResult; } if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["HDeleteMan"] != null && ds.Tables[0].Rows[0]["HDeleteMan"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "忮已ä½åº!ä¸è½è¿è¡å ³é!"; objJsonResult.data = null; return objJsonResult; } if (ds.Tables[0].Rows[0]["HCloseMan"] != null && ds.Tables[0].Rows[0]["HCloseMan"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å ³é!ä¸è½åæ¬¡å ³é!"; objJsonResult.data = null; return objJsonResult; } //å ³éåæ® if (!BillOld.CloseBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "å ³é失败!åå :" + ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } } else { //夿忮æ¯å¦å·²ç»åå ³é DataSet ds; string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["HDeleteMan"] != null && ds.Tables[0].Rows[0]["HDeleteMan"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "忮已ä½åº!ä¸è½è¿è¡å ³é!"; objJsonResult.data = null; return objJsonResult; } if (ds.Tables[0].Rows[0]["HCloseMan"] == null || ds.Tables[0].Rows[0]["HCloseMan"].ToString() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®æªå ³é!ä¸éè¦ååå ³é!"; objJsonResult.data = null; return objJsonResult; } //åå ³éåæ® if (!BillOld.CancelClose(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "åå ³é失败!åå :" + ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } } oCN.Commit();//æäº¤äºå¡ objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "æ§è¡æåï¼"; objJsonResult.data = null; return objJsonResult; ; } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ§è¡å¤±è´¥ï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } /// <summary> /// é¦ä»¶æ£éªåç»´æ¤ ä½åº åä½åº /// </summary> /// <param name="HInterID"></param> /// <param name="Type"></param> /// <param name="user"></param> /// <returns></returns> [Route("QC_ValueTable/DropQC_FirstPieceCheckBills")] [HttpGet] public object DropQC_FirstPieceCheckBills(string HInterID, int Type, string user) { try { //夿æ¯å¦æä½åºæé if (!DBUtility.ClsPub.Security_Log("QC_FirstPieceCheckBill_Drop", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ æéä½åº!"; objJsonResult.data = null; return objJsonResult; } if (string.IsNullOrWhiteSpace(HInterID)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "HInterID为空ï¼"; objJsonResult.data = null; return objJsonResult; } ClsPub.CurUserName = user; BillOld.MvarItemKey = "QC_FirstPieceCheckBillMain"; oCN.BeginTran();//å¼å§äºå¡ //Type 1 ä½åº 2 åä½åº if (Type == 1) { //夿忮æ¯å¦å·²ç»ä½åº DataSet ds; string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); if (ds == null || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®ä¸åå¨ï¼"; objJsonResult.data = null; return objJsonResult; } if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½è¿è¡ä½åº!"; objJsonResult.data = null; return objJsonResult; } if (ds.Tables[0].Rows[0]["HDeleteMan"] != null && ds.Tables[0].Rows[0]["HDeleteMan"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "忮已ä½åº!ä¸éè¦åä½åº!"; objJsonResult.data = null; return objJsonResult; } //ä½åºåæ® if (!BillOld.Cancelltion(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "ä½åºå¤±è´¥!åå :" + ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } } else { //夿忮æ¯å¦å·²ç»åä½åº DataSet ds; string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½è¿è¡ä½åº!"; objJsonResult.data = null; return objJsonResult; } if (ds.Tables[0].Rows[0]["HDeleteMan"] == null || ds.Tables[0].Rows[0]["HDeleteMan"].ToString() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®æªä½åº!ä¸éè¦ååä½åº!"; objJsonResult.data = null; return objJsonResult; } //åä½åºåæ® if (!BillOld.AbandonCancelltion(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "åä½åºå¤±è´¥!åå :" + ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } } oCN.Commit();//æäº¤äºå¡ objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "æ§è¡æåï¼"; objJsonResult.data = null; return objJsonResult; ; } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ§è¡å¤±è´¥ï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion /// <summary> /// é¦ä»¶æ£éªé»è¾å é¤åè½ /// </summary>