| WebAPI/Controllers/检验申请单/QC_RequestCheckBillController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| WebAPI/DLL/ClsQC_RequestCheckBill.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| WebAPI/ListModels.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| WebAPI/Models/ClsQC_RequestCheckBillMain.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| WebAPI/Models/ClsQC_RequestCheckBillSub.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| WebAPI/Properties/PublishProfiles/FolderProfile11.pubxml.user | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| WebAPI/WebAPI.csproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
WebAPI/Controllers/¼ìÑéÉêÇëµ¥/QC_RequestCheckBillController.cs
New file @@ -0,0 +1,876 @@ using 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; namespace WebAPI.Controllers { public class QC_RequestCheckBillController : ApiController { public DBUtility.ClsPub.Enum_BillStatus BillStatus; private json objJsonResult = new json(); public DataSet ds = new DataSet(); public SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); public DLL.ClsQC_RequestCheckBill BillNew0 = new DLL.ClsQC_RequestCheckBill(); public DLL.ClsQC_RequestCheckBill BillOld0 = new DLL.ClsQC_RequestCheckBill(); #region æ£éªç³è¯·åå表 [Route("QC_RequestCheckBill/GetRequestCheckBillList")] [HttpGet] public object GetRequestCheckBillList(string sWhere, string user) { try { List<object> columnNameList = new List<object>(); //夿æ¥è¯¢æé if (!DBUtility.ClsPub.Security_Log("QC_RequestCheckBill_Query", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ æ¥è¯¢æé!"; objJsonResult.data = null; return objJsonResult; } ds = oCn.RunProcReturn("select * from h_v_QC_RequestCheckBillList_Search " + sWhere + " order by æ¥æ desc, hmainid desc", "h_v_QC_RequestCheckBillList_Search"); 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)); } objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "Successï¼"; objJsonResult.data = ds.Tables[0]; objJsonResult.list = columnNameList; return objJsonResult; } catch (Exception ex) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "没æè¿åä»»ä½è®°å½ï¼" + ex.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #region æ£éªç³è¯·åå é¤ [Route("QC_RequestCheckBill/set_DeleteBill")] [HttpGet] public object set_DeleteBill(string HInterID, string user) { // ç¼è¾æéæ£æ¥ if (!DBUtility.ClsPub.Security_Log_second("QC_RequestCheckBill_Drop", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ å 餿éï¼"; objJsonResult.data = null; return objJsonResult; } Int64 lngBillKey = DBUtility.ClsPub.isLong(HInterID); if (lngBillKey == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®ID为空ï¼"; objJsonResult.data = null; return objJsonResult; } DLL.ClsQC_RequestCheckBill oBill = new DLL.ClsQC_RequestCheckBill(); if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) { if (oBill.omodel.HBillStatus > 1) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å½åå¤äºä¸è½å é¤ç¶æ,ä¸è½å é¤ï¼"; objJsonResult.data = null; return objJsonResult; } if (oBill.omodel.HChecker != "" && oBill.omodel.HChecker != null) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "忮已ç»å®¡æ ¸,ä¸è½å é¤ï¼"; objJsonResult.data = null; return objJsonResult; } string s = ""; if (!DBUtility.Xt_BaseBillFun.Fun_AllowDeleteBill(oBill, ref s)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = s + "ï¼ä¸å 许å é¤"; objJsonResult.data = null; return objJsonResult; } // ä¼è®¡æé´å¤æ int sYear = 0; int sPeriod = 0; DateTime HDate = DateTime.Now; if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false) { objJsonResult.Message = s; return objJsonResult; } bool IsDete = oBill.DeleteBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo); if (IsDete) { objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®æªæ¾å°"; objJsonResult.data = null; return objJsonResult; } } #endregion #region[æ£éªç³è¯·åç¼è¾æ¶è·åæ°æ®] [Route("QC_RequestCheckBill/GetRequestCheckBillDetail")] [HttpGet] public ApiResult<DataSet> QC_RequestCheckBillListCheckDetai(string HID) { if (string.IsNullOrEmpty(HID)) return new ApiResult<DataSet> { code = -1, msg = "IDä¸è½ä¸ºç©º" }; SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); var dataSet = oCN.RunProcReturn("select * from h_v_IF_RequestCheckBillList where hmainid= " + HID + " ", "h_v_Sc_MouldProdInHouseBillList"); if (dataSet == null || dataSet.Tables[0].Rows.Count == 0) return new ApiResult<DataSet> { code = -1, msg = "ä¸åå¨åå·" }; return new ApiResult<DataSet> { code = 1, msg = "æ¥è¯¢æå", data = dataSet }; } #endregion #region æ ¹æ®ç©æå ç è·åç©æä¿¡æ¯ [Route("QC_RequestCheckBill/getMaterialByMaterID")] [HttpGet] public ApiResult<DataTable> getMaterialByMaterID(Int64 HMaterID) { SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); string sql = "select a.HItemID HMaterID,a.HNumber HMaterNumber,a.HName HMaterName,a.HMaterRuleType,a.HModel HMaterModel,a.HUnitID, b.HNumber HUnitNumber, b.HName HUnitName, a.HMaterRuleExternType, a.HMaterRuleExternType1" + " from Gy_Material AS a " + " LEFT OUTER JOIN Gy_Unit AS b on a.HUnitID = b.HItemID " + " where a.HItemID =" + HMaterID; var dataSet = oCN.RunProcReturn(sql, "Gy_Material"); if (dataSet == null || dataSet.Tables[0].Rows.Count == 0) return new ApiResult<DataTable> { code = -1, msg = "ä¸åå¨è¯¥ç©æ" }; return new ApiResult<DataTable> { code = 1, msg = "æ¥è¯¢æå", data = dataSet.Tables[0] }; } #endregion #region æ£éªç³è¯·åå®¡æ ¸/åå®¡æ ¸ [Route("QC_RequestCheckBill/set_CheckBill")] [HttpGet] public object set_CheckBill(int HInterID, string CurUserName) { string ModRightNameCheck = "QC_RequestCheckBill_Check"; DBUtility.ClsPub.CurUserName = CurUserName; DLL.ClsQC_RequestCheckBill oBill = new DLL.ClsQC_RequestCheckBill(); try { // å®¡æ ¸æéæ£æ¥ if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼æ æéï¼"; objJsonResult.data = null; return objJsonResult; } // å®¡æ ¸å夿 string s = ""; if (!DBUtility.Xt_BaseBillFun.Fun_AllowCheckBill(oBill, ref s)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = s + "ï¼ä¸å è®¸å®¡æ ¸"; objJsonResult.data = null; return objJsonResult; } if (HInterID <= 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "HInterIDå°äº0ï¼"; objJsonResult.data = null; return objJsonResult; } // æ£æ¥åæ®ç¶æ if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo)) { if (oBill.omodel.HCloseMan.Trim() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å ³é!ä¸è½åæ¬¡å®¡æ ¸ï¼"; objJsonResult.data = null; return objJsonResult; } if (oBill.omodel.HDeleteMan.Trim() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "忮已ä½åº!ä¸è½åæ¬¡å®¡æ ¸ï¼"; objJsonResult.data = null; return objJsonResult; } if (oBill.omodel.HChecker.Trim() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½åæ¬¡å®¡æ ¸ï¼"; objJsonResult.data = null; return objJsonResult; } } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®ä¸åå¨!åå :" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } // ä¼è®¡æé´å¤æ int sYear = 0; int sPeriod = 0; DateTime HDate = DateTime.Now; if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false) { objJsonResult.Message = s; return objJsonResult; } // æ§è¡å®¡æ ¸ if (oBill.CheckBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo)) { objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "å®¡æ ¸æå"; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } [Route("QC_RequestCheckBill/set_AbandonCheck")] [HttpGet] public object set_AbandonCheck(int HInterID, string CurUserName) { string ModRightNameCheck = "QC_RequestCheckBill_Check"; DBUtility.ClsPub.CurUserName = CurUserName; DLL.ClsQC_RequestCheckBill oBill = new DLL.ClsQC_RequestCheckBill(); try { //æéæ£æ¥ if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åå®¡æ ¸å¤±è´¥ï¼æ æéï¼"; objJsonResult.data = null; return objJsonResult; } string s = ""; if (!DBUtility.Xt_BaseBillFun.Fun_AllowCheckBill(oBill, ref s)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = s + "ï¼ä¸å 许åå®¡æ ¸"; objJsonResult.data = null; return objJsonResult; } if (HInterID <= 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "HInterIDå°äº0ï¼"; objJsonResult.data = null; return objJsonResult; } // æ£æ¥åæ®ç¶æ if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo)) { if (oBill.omodel.HCloseMan.Trim() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å ³é!ä¸è½åå®¡æ ¸ï¼"; objJsonResult.data = null; return objJsonResult; } if (oBill.omodel.HDeleteMan.Trim() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "忮已ä½åº!ä¸è½åå®¡æ ¸ï¼"; objJsonResult.data = null; return objJsonResult; } if (oBill.omodel.HChecker.Trim() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®æªå®¡æ ¸!ä¸éè¦åå®¡æ ¸!"; objJsonResult.data = null; return objJsonResult; } } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®ä¸åå¨!åå :" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } // ä¼è®¡æé´å¤æ int sYear = 0; int sPeriod = 0; DateTime HDate = DateTime.Now; if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false) { objJsonResult.Message = s; return objJsonResult; } // æ§è¡åå®¡æ ¸ if (oBill.AbandonCheck(HInterID, ref DBUtility.ClsPub.sExeReturnInfo)) { objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "åå®¡æ ¸æå"; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åå®¡æ ¸å¤±è´¥!åå :" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åå®¡æ ¸å¤±è´¥ï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #region è´¨æ£ç³è¯·åä¿å/ç¼è¾ [Route("QC_RequestCheckBill/SaveRequestCheckBill")] [HttpPost] public object SaveRequestCheckBill([FromBody] JObject msg) { var _value = msg["msg"].ToString(); string msg1 = _value.ToString(); string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); string msg2 = sArray[0].ToString(); // ä¸»è¡¨æ°æ® string msg3 = sArray[1].ToString(); // åè¡¨æ°æ® string refSav = sArray[2].ToString(); // æä½ç±»å string msg4 = sArray[3].ToString(); // ç¨æ· DBUtility.ClsPub.CurUserName = msg4; string UserName = ""; string s = ""; ListModels oListModels = new ListModels(); try { // ç¼è¾æéæ£æ¥ if (!DBUtility.ClsPub.Security_Log_second("QC_RequestCheckBill_Edit", 1, false, msg4)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ ä¿åæéï¼"; objJsonResult.data = null; return objJsonResult; } DLL.ClsQC_RequestCheckBill oBill = new DLL.ClsQC_RequestCheckBill(); List<Models.ClsQC_RequestCheckBillMain> lsmain = new List<Models.ClsQC_RequestCheckBillMain>(); msg2 = msg2.Replace("\\", "").Replace("\n", ""); // éè¦å å®ç°è¿ä¸ªæ¹æ³ lsmain = oListModels.getObjectByJson_QC_RequestCheckBillMain1(msg2); foreach (Models.ClsQC_RequestCheckBillMain oItem in lsmain) { if (refSav == "Add") { // æ£æ¥åæ®å·æ¯å¦éå¤ if (BillNew0.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, BillOld0.omodel.HInterID)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·éå¤ï¼ä¸å 许ä¿åï¼"; objJsonResult.data = 1; return objJsonResult; } } if (refSav == "Update") { if (BillOld0.ShowBill(oItem.HInterID, ref s) == false) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¤åæ®æè¯¯ï¼"; objJsonResult.data = 1; return objJsonResult; } if (BillOld0.omodel.HChecker != "" && BillOld0.omodel.HChecker != null) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¤åæ®å·²ç»è¢«å®¡æ ¸ï¼ä¸å 许修æ¹ï¼"; objJsonResult.data = 1; return objJsonResult; } if (BillOld0.omodel.HBillStatus > 1) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¤åæ®å¤äºä¸å¯ç¼è¾ç¶æï¼ä¸å 许修æ¹ï¼"; objJsonResult.data = 1; return objJsonResult; } if (!DBUtility.Xt_BaseBillFun.Fun_AllowEditBill(BillOld0, ref s)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = s + "ï¼ä¸å 许修æ¹"; objJsonResult.data = 1; return objJsonResult; } } UserName = oItem.HMaker; oItem.HBillType = "7525"; // è´¨æ£ç³è¯·åç±»å oItem.HYear = DateTime.Now.Year; // ä¿®æ£ï¼ç´æ¥ä½¿ç¨intç±»å oItem.HPeriod = DateTime.Now.Month; // ä¿®æ£ï¼ç´æ¥ä½¿ç¨intç±»å oItem.HMakeDate = DateTime.Now; // ä¿®æ£ï¼ç´æ¥ä½¿ç¨DateTimeç±»å if (oItem.HDate == DateTime.MinValue) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿åå¤±è´¥ï¼æ²¡æåæ®æ¥æï¼æ æ³ä¿åï¼"; objJsonResult.data = 1; return objJsonResult; } oBill.omodel = oItem; } // å¤çåè¡¨æ°æ® msg3 = msg3.Substring(1, msg3.Length - 2); msg3 = msg3.Replace("\\", "").Replace("\n", ""); List<Models.ClsQC_RequestCheckBillSub> ls = new List<Models.ClsQC_RequestCheckBillSub>(); // éè¦å å®ç°è¿ä¸ªæ¹æ³ ls = oListModels.getObjectByJson_QC_RequestCheckBillSub(msg3); int i = 0; foreach (Models.ClsQC_RequestCheckBillSub oItemSub in ls) { i++; oItemSub.HEntryID = i; oItemSub.HEntryCloseDate = null; oItemSub.HCloseType = false; oItemSub.HSourceInterID = 0; oItemSub.HSourceEntryID = 0; oBill.DetailColl.Add(oItemSub); } // ä¼è®¡æé´å¤æ int sYear = 0; int sPeriod = 0; DateTime HDate = DateTime.Now; if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false) { objJsonResult.Message = s; return objJsonResult; } // æ§è¡ä¿å bool bResult; if (refSav == "Add") { bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); } else if (refSav == "Update") { bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); } else { bResult = false; } if (bResult) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "ä¿åæåï¼"; objJsonResult.data = 1; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = 1; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); objJsonResult.data = 1; return objJsonResult; } } #endregion #region è´¨æ£ç³è¯·åå ³é/åå ³é [Route("QC_RequestCheckBill/CloseRequestCheckBill")] [HttpGet] public object CloseRequestCheckBill(int HInterID, int IsAudit, string CurUserName) { string ModRightNameCheck = "QC_RequestCheckBill_Close"; DBUtility.ClsPub.CurUserName = CurUserName; try { //æéæ£æ¥ if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å ³éå¤±è´¥ï¼æ æéï¼"; objJsonResult.data = null; return objJsonResult; } if (HInterID <= 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "HInterIDå°äº0ï¼"; objJsonResult.data = null; return objJsonResult; } // ä¿®æ£ï¼ä½¿ç¨ DLL å½å空é´è䏿¯ DAL WebAPI.DLL.ClsQC_RequestCheckBill oBill = new WebAPI.DLL.ClsQC_RequestCheckBill(); // æ£æ¥åæ®ç¶æ if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo)) { if (oBill.omodel.HDeleteMan.Trim() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "忮已ä½åº!ä¸è½è¿è¡å ³éï¼"; objJsonResult.data = null; return objJsonResult; } if (oBill.omodel.HChecker.Trim() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®æªå®¡æ ¸!ä¸è½è¿è¡å ³éï¼"; objJsonResult.data = null; return objJsonResult; } if (IsAudit == 0 && oBill.omodel.HCloseMan.Trim() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å ³é!ä¸è½åæ¬¡å ³éï¼"; objJsonResult.data = null; return objJsonResult; } if (IsAudit == 1 && oBill.omodel.HCloseMan.Trim() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®æªå ³é!ä¸éè¦åå ³éï¼"; objJsonResult.data = null; return objJsonResult; } } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®ä¸åå¨!åå :" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } // æ§è¡æä½ if (IsAudit == 0) { if (oBill.CloseBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo)) { objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "å ³éæå"; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å ³é失败!åå :" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } else { if (oBill.CancelClose(HInterID, ref DBUtility.ClsPub.sExeReturnInfo)) { objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "åå ³éæå"; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åå ³é失败!åå :" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æä½å¤±è´¥ï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #region è´¨æ£ç³è¯·åä½åº/åä½åº [Route("QC_RequestCheckBill/DeleteRequestCheckBill")] [HttpGet] public object DeleteRequestCheckBill(int HInterID, int IsAudit, string CurUserName) { string ModRightNameCheck = "QC_RequestCheckBill_Delete"; DBUtility.ClsPub.CurUserName = CurUserName; try { //æéæ£æ¥ if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä½åºå¤±è´¥ï¼æ æéï¼"; objJsonResult.data = null; return objJsonResult; } if (HInterID <= 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "HInterIDå°äº0ï¼"; objJsonResult.data = null; return objJsonResult; } WebAPI.DLL.ClsQC_RequestCheckBill oBill = new WebAPI.DLL.ClsQC_RequestCheckBill(); // æ£æ¥åæ®ç¶æ if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo)) { if (oBill.omodel.HChecker.Trim() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½è¿è¡ä½åºï¼"; objJsonResult.data = null; return objJsonResult; } if (IsAudit == 0 && oBill.omodel.HDeleteMan.Trim() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "忮已ä½åº!ä¸è½åä½åºï¼"; objJsonResult.data = null; return objJsonResult; } if (IsAudit == 1 && oBill.omodel.HDeleteMan.Trim() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®æªä½åº!ä¸éè¦åä½åºï¼"; objJsonResult.data = null; return objJsonResult; } } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®ä¸åå¨!åå :" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } // æ§è¡æä½ if (IsAudit == 0) { if (oBill.Cancelltion(HInterID, ref DBUtility.ClsPub.sExeReturnInfo)) { objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "ä½åºæå"; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä½åºå¤±è´¥!åå :" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } else { if (oBill.AbandonCancelltion(HInterID, ref DBUtility.ClsPub.sExeReturnInfo)) { objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "åä½åºæå"; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åä½åºå¤±è´¥!åå :" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æä½å¤±è´¥ï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion } } WebAPI/DLL/ClsQC_RequestCheckBill.cs
New file @@ -0,0 +1,477 @@ using System; using System.Collections.Generic; using System.Data; using WebAPI.Models; namespace WebAPI.DLL { public class ClsQC_RequestCheckBill : DBUtility.ClsXt_BaseBill { public Models.ClsQC_RequestCheckBillMain omodel = new Models.ClsQC_RequestCheckBillMain(); public List<Models.ClsQC_RequestCheckBillSub> DetailColl = new List<Models.ClsQC_RequestCheckBillSub>(); public ClsQC_RequestCheckBill() { base.MvarItemKeySub = "QC_RequestCheckBillSub"; base.MvarItemKeySub2 = ""; base.MvarItemKeySub3 = ""; base.MvarItemKeySub4 = ""; base.MvarItemKey = "QC_RequestCheckBillMain"; base.MvarReportTitle = "æ£éªç³è¯·å"; base.BillType = "7525"; base.HBillSubType = "7525"; } #region åºå®ä»£ç ~ClsQC_RequestCheckBill() { DetailColl = null; } #endregion //ä¿®æ¹åæ® public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) { try { oCn.BeginTran(); string mainSql = "UpDate QC_RequestCheckBillMain set " + " HBillNo='" + omodel.HBillNo + "'" + ",HDate='" + omodel.HDate.ToString("yyyy-MM-dd HH:mm:ss") + "'" + ",HYear='" + omodel.HYear.ToString() + "'" + ",HPeriod='" + omodel.HPeriod.ToString() + "'" + ",HRemark='" + omodel.HRemark + "'" + ",HUpDater='" + DBUtility.ClsPub.CurUserName + "'" + ",HUpDateDate=getdate()" + ",HDeptID=" + omodel.HDeptID.ToString() + ",HBatchNo='" + omodel.HBatchNo + "'" + ",HCheckEmp=" + omodel.HCheckEmp.ToString() + ",HProcID=" + omodel.HProcID.ToString() + ",HGroupID=" + omodel.HGroupID.ToString() + ",HShiftsID=" + omodel.HShiftsID.ToString() + ",HTestType='" + omodel.HTestType + "'" + ",HSourceOrgID=" + omodel.HSourceOrgID.ToString() + ",HInspectOrgID=" + omodel.HInspectOrgID.ToString() + ",HSourceID=" + omodel.HSourceID.ToString() + ",HBackRemark='" + omodel.HBackRemark + "'" + " where HInterID=" + lngBillKey.ToString(); //æ´æ°ä¸»è¡¨ oCn.RunProc(mainSql); //å é¤å ³è DeleteRelation(ref sReturn, lngBillKey); //å é¤å表 DeleteBillSub(lngBillKey); //æå ¥å表 omodel.HInterID = (int)lngBillKey; foreach (Models.ClsQC_RequestCheckBillSub oSub in DetailColl) { string entryCloseDate = oSub.HEntryCloseDate.HasValue ? "'" + oSub.HEntryCloseDate.Value.ToString("yyyy-MM-dd HH:mm:ss") + "'" : "NULL"; string subSql = "Insert into QC_RequestCheckBillSub " + " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + ",HMaterID,HUnitID,HQty,HSampleDamageQty" + ") values(" + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "'," + entryCloseDate + "," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + "," + oSub.HMaterID.ToString() + "," + oSub.HUnitID.ToString() + "," + oSub.HQty.ToString() + "," + oSub.HSampleDamageQty.ToString() + ") "; oCn.RunProc(subSql); } sReturn = "ä¿®æ¹åæ®æåï¼"; oCn.Commit(); return true; } catch (Exception e) { sReturn = e.Message; oCn.RollBack(); throw; } } //æ°å¢åæ® public override bool AddBill(ref string sReturn) { try { //æ£æ¥åæ®å·åIDæ¯å¦éå¤ if (IsExistBillNo(ref DBUtility.ClsPub.sExeReturnInfo, omodel.HBillNo, Pub_Class.ClsPub.Enum_BillStatus.BillStatus_AddNew, omodel.HInterID)) { omodel.HBillNo = DBUtility.ClsPub.CreateBillCode(BillType, ref DBUtility.ClsPub.sExeReturnInfo, true); } if (IsExistMainID(ref DBUtility.ClsPub.sExeReturnInfo, omodel.HInterID, Pub_Class.ClsPub.Enum_BillStatus.BillStatus_AddNew)) { omodel.HInterID = (int)DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); } oCn.BeginTran(); string mainSql = "Insert Into QC_RequestCheckBillMain " + "(HBillType,HBillSubType,HInterID,HBillNo,HDate" + ",HYear,HPeriod,HRemark,HMaker,HMakeDate" + ",HBillStatus,HDeptID,HBatchNo,HCheckEmp,HProcID,HGroupID" + ",HShiftsID,HTestType,HSourceOrgID,HInspectOrgID,HSourceID" + ",HMainSourceBillType,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HBackRemark" + ") " + " values('" + this.BillType + "','" + omodel.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate.ToString("yyyy-MM-dd HH:mm:ss") + "'" + ", " + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" + ", 1" + ", " + omodel.HDeptID.ToString() + ",'" + omodel.HBatchNo + "'," + omodel.HCheckEmp.ToString() + "," + omodel.HProcID.ToString() + "," + omodel.HGroupID.ToString() + ", " + omodel.HShiftsID.ToString() + ",'" + omodel.HTestType + "'," + omodel.HSourceOrgID.ToString() + "," + omodel.HInspectOrgID.ToString() + "," + omodel.HSourceID.ToString() + ",'" + omodel.HMainSourceBillType + "'," + omodel.HMainSourceInterID.ToString() + "," + omodel.HMainSourceEntryID.ToString() + ",'" + omodel.HMainSourceBillNo + "','" + omodel.HBackRemark + "'" + ") "; //主表 oCn.RunProc(mainSql); //æå ¥å表 foreach (Models.ClsQC_RequestCheckBillSub oSub in DetailColl) { string entryCloseDate = oSub.HEntryCloseDate.HasValue ? "'" + oSub.HEntryCloseDate.Value.ToString("yyyy-MM-dd HH:mm:ss") + "'" : "NULL"; string subSql = "Insert into QC_RequestCheckBillSub " + " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + ",HMaterID,HUnitID,HQty,HSampleDamageQty" + ") values(" + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "'," + entryCloseDate + "," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + "," + oSub.HMaterID.ToString() + "," + oSub.HUnitID.ToString() + "," + oSub.HQty.ToString() + "," + oSub.HSampleDamageQty.ToString() + ") "; oCn.RunProc(subSql); } sReturn = "æ°å¢åæ®æåï¼"; oCn.Commit(); return true; } catch (Exception e) { sReturn = e.Message; oCn.RollBack(); throw; } } //æ¾ç¤ºåæ® public override bool ShowBill(Int64 lngBillKey, ref string sReturn) { try { //æ¥è¯¢ä¸»è¡¨ DataSet Ds = oCn.RunProcReturn("Select * from QC_RequestCheckBillMain Where HInterID=" + lngBillKey.ToString(), "QC_RequestCheckBillMain"); if (Ds.Tables[0].Rows.Count == 0) { sReturn = "åæ®æªæ¾å°ï¼"; return false; } //åºå®èµå¼ omodel.HYear = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HYear"]); omodel.HPeriod = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HPeriod"]); omodel.HBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillType"]); omodel.HBillSubType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillSubType"]); omodel.HInterID = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HInterID"]); omodel.HDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HDate"]); omodel.HBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillNo"]); omodel.HBillStatus = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HBillStatus"]); omodel.HCheckItemNowID = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HCheckItemNowID"]); omodel.HCheckItemNextID = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HCheckItemNextID"]); omodel.HCheckFlowID = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HCheckFlowID"]); omodel.HRemark = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]); omodel.HBacker = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBacker"]); omodel.HBackDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HBackDate"]); omodel.HBackRemark = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBackRemark"]); omodel.HChecker = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HChecker"]); omodel.HCheckDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HCheckDate"]); omodel.HMaker = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HMaker"]); omodel.HMakeDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HMakeDate"]); omodel.HUpDater = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HUpDater"]); omodel.HUpDateDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HUpDateDate"]); omodel.HCloseMan = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HCloseMan"]); omodel.HCloseDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HCloseDate"]); omodel.HCloseType = DBUtility.ClsPub.isBool(Ds.Tables[0].Rows[0]["HCloseType"]); omodel.HDeleteMan = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HDeleteMan"]); omodel.HDeleteDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HDeleteDate"]); omodel.HMainSourceBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HMainSourceBillType"]); omodel.HMainSourceInterID = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HMainSourceInterID"]); omodel.HMainSourceEntryID = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HMainSourceEntryID"]); omodel.HMainSourceBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HMainSourceBillNo"]); omodel.HPrintQty = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HPrintQty"]); //èªå®ä¹å段èµå¼ omodel.HSourceID = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HSourceID"]); omodel.HDeptID = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HDeptID"]); omodel.HBatchNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBatchNo"]); omodel.HCheckEmp = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HCheckEmp"]); omodel.HProcID = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HProcID"]); omodel.HGroupID = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HGroupID"]); omodel.HShiftsID = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HShiftsID"]); omodel.HTestType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HTestType"]); omodel.HSourceOrgID = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HSourceOrgID"]); omodel.HInspectOrgID = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HInspectOrgID"]); //æ¥è¯¢å表 DataSet DsSub = oCn.RunProcReturn("Select * from QC_RequestCheckBillSub Where HInterID=" + lngBillKey.ToString(), "QC_RequestCheckBillSub"); DetailColl.Clear(); for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++) { Models.ClsQC_RequestCheckBillSub oSub = new Models.ClsQC_RequestCheckBillSub(); oSub.HInterID = DBUtility.ClsPub.isInt(DsSub.Tables[0].Rows[i]["HInterID"]); oSub.HBillNo_bak = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HBillNo_bak"]); oSub.HEntryID = DBUtility.ClsPub.isInt(DsSub.Tables[0].Rows[i]["HEntryID"]); oSub.HSourceInterID = DBUtility.ClsPub.isInt(DsSub.Tables[0].Rows[i]["HSourceInterID"]); oSub.HSourceEntryID = DBUtility.ClsPub.isInt(DsSub.Tables[0].Rows[i]["HSourceEntryID"]); oSub.HSourceBillType = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HSourceBillType"]); oSub.HSourceBillNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HSourceBillNo"]); oSub.HRelationQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationQty"]); // ä½¿ç¨ isDoule oSub.HRelationMoney = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationMoney"]); oSub.HCloseMan = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HCloseMan"]); oSub.HCloseType = DBUtility.ClsPub.isBool(DsSub.Tables[0].Rows[i]["HCloseType"]); oSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DsSub.Tables[0].Rows[i]["HEntryCloseDate"]); oSub.HRemark = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HRemark"]); oSub.HMaterID = DBUtility.ClsPub.isInt(DsSub.Tables[0].Rows[i]["HMaterID"]); oSub.HUnitID = DBUtility.ClsPub.isInt(DsSub.Tables[0].Rows[i]["HUnitID"]); oSub.HQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HQty"]); oSub.HSampleDamageQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HSampleDamageQty"]); DetailColl.Add(oSub); } sReturn = "æ¾ç¤ºåæ®æåï¼"; return true; } catch (Exception e) { sReturn = e.Message; throw; } } //å é¤åæ® public override bool DeleteBill(Int64 lngBillKey, ref string sReturn) { try { oCn.BeginTran(); //æ£æ¥æ¯å¦å¯ä»¥å é¤ if (!CanDeleteBill(lngBillKey, ref sReturn)) { oCn.RollBack(); return false; } //å é¤å ³èè¡¨æ°æ® DeleteRelation(ref sReturn, lngBillKey); //å é¤å表 oCn.RunProc("DELETE FROM QC_RequestCheckBillSub WHERE HInterID = " + lngBillKey); //å é¤ä¸»è¡¨ oCn.RunProc("DELETE FROM QC_RequestCheckBillMain WHERE HInterID = " + lngBillKey); sReturn = "å é¤åæ®æåï¼"; oCn.Commit(); return true; } catch (Exception e) { sReturn = e.Message; oCn.RollBack(); throw; } } //æ£æ¥æ¯å¦å¯ä»¥å é¤ private bool CanDeleteBill(Int64 lngBillKey, ref string sReturn) { DataSet ds = oCn.RunProcReturn( "SELECT HBillStatus, HChecker FROM QC_RequestCheckBillMain WHERE HInterID = " + lngBillKey, "QC_RequestCheckBillMain"); if (ds.Tables[0].Rows.Count == 0) { sReturn = "åæ®ä¸åå¨ï¼"; return false; } int billStatus = DBUtility.ClsPub.isInt(ds.Tables[0].Rows[0]["HBillStatus"]); string checker = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HChecker"]); if (billStatus > 1) { sReturn = "åæ®å½åå¤äºä¸è½å é¤ç¶æï¼"; return false; } if (!string.IsNullOrEmpty(checker)) { sReturn = "忮已ç»å®¡æ ¸ï¼ä¸è½å é¤ï¼"; return false; } return true; } // 注æï¼ä»¥ä¸æ¹æ³éè¦æ£æ¥åºç±»æ¯å¦æ¯ virtual æ abstract // 妿åºç±»æ²¡æè¿äºæ¹æ³ï¼éè¦å é¤ææ·»å new å ³é®å // å®¡æ ¸åæ® public new bool CheckBill(Int64 lngBillKey, ref string sReturn) { try { string sql = "Update QC_RequestCheckBillMain " + " Set HChecker = '" + DBUtility.ClsPub.CurUserName + "', HCheckDate = getdate(), HBillStatus = 2 " + " Where HInterID = " + lngBillKey.ToString(); oCn.RunProc(sql); sReturn = "å®¡æ ¸åæ®æåï¼"; return true; } catch (Exception e) { sReturn = "å®¡æ ¸åæ®å¤±è´¥ï¼" + e.Message; return false; } } // åå®¡æ ¸åæ® public new bool AbandonCheck(Int64 lngBillKey, ref string sReturn) { try { string sql = "Update QC_RequestCheckBillMain " + " Set HChecker = '', HCheckDate = NULL, HBillStatus = 1 " + " Where HInterID = " + lngBillKey.ToString(); oCn.RunProc(sql); sReturn = "åå®¡æ ¸åæ®æåï¼"; return true; } catch (Exception e) { sReturn = "åå®¡æ ¸åæ®å¤±è´¥ï¼" + e.Message; return false; } } // å ³éåæ® public new bool CloseBill(Int64 lngBillKey, ref string sReturn) { try { string sql = "Update QC_RequestCheckBillMain " + " Set HCloseMan = '" + DBUtility.ClsPub.CurUserName + "', HCloseDate = getdate(), HBillStatus = 3 " + " Where HInterID = " + lngBillKey.ToString(); oCn.RunProc(sql); sReturn = "å ³éåæ®æåï¼"; return true; } catch (Exception e) { sReturn = "å ³éåæ®å¤±è´¥ï¼" + e.Message; return false; } } // åå ³éåæ® public new bool CancelClose(Int64 lngBillKey, ref string sReturn) { try { string sql = "Update QC_RequestCheckBillMain " + " Set HCloseMan = '', HCloseDate = NULL, HBillStatus = 2 " + " Where HInterID = " + lngBillKey.ToString(); oCn.RunProc(sql); sReturn = "åå ³éåæ®æåï¼"; return true; } catch (Exception e) { sReturn = "åå ³éåæ®å¤±è´¥ï¼" + e.Message; return false; } } // ä½åºåæ® public new bool Cancelltion(Int64 lngBillKey, ref string sReturn) { try { string sql = "Update QC_RequestCheckBillMain " + " Set HDeleteMan = '" + DBUtility.ClsPub.CurUserName + "', HDeleteDate = getdate(), HBillStatus = 4 " + " Where HInterID = " + lngBillKey.ToString(); oCn.RunProc(sql); sReturn = "ä½åºåæ®æåï¼"; return true; } catch (Exception e) { sReturn = "ä½åºåæ®å¤±è´¥ï¼" + e.Message; return false; } } // åä½åºåæ® public new bool AbandonCancelltion(Int64 lngBillKey, ref string sReturn) { try { string sql = "Update QC_RequestCheckBillMain " + " Set HDeleteMan = '', HDeleteDate = NULL, HBillStatus = 1 " + " Where HInterID = " + lngBillKey.ToString(); oCn.RunProc(sql); sReturn = "åä½åºåæ®æåï¼"; return true; } catch (Exception e) { sReturn = "åä½åºåæ®å¤±è´¥ï¼" + e.Message; return false; } } } } WebAPI/ListModels.cs
@@ -4342,10 +4342,44 @@ /// <summary> /// å°JSONå符串转æ¢ä¸ºè´¨æ£ç³è¯·åå表对象å表 /// </summary> /// <param name="jsonString">JSONå符串</param> /// <returns>è´¨æ£ç³è¯·åå表对象å表</returns> public List<Models.ClsQC_RequestCheckBillSub> getObjectByJson_QC_RequestCheckBillSub(string jsonString) { // 妿jsonStringå·²ç»æ¯æ°ç»æ ¼å¼ï¼ä»¥[å¼å¤´ï¼ä»¥]ç»å°¾ï¼ï¼å°±ä¸éè¦åå [] if (!jsonString.StartsWith("[") && !jsonString.EndsWith("]")) { jsonString = "[" + jsonString + "]"; } List<Models.ClsQC_RequestCheckBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsQC_RequestCheckBillSub>>(jsonString); return list; } /// <summary> /// å°JSONå符串转æ¢ä¸ºè´¨æ£ç³è¯·å主表对象å表 /// </summary> /// <param name="jsonString">JSONå符串</param> /// <returns>è´¨æ£ç³è¯·å主表对象å表</returns> public List<Models.ClsQC_RequestCheckBillMain> getObjectByJson_QC_RequestCheckBillMain1(string jsonString) { // 妿jsonStringå·²ç»æ¯æ°ç»æ ¼å¼ï¼ä»¥[å¼å¤´ï¼ä»¥]ç»å°¾ï¼ï¼å°±ä¸éè¦åå [] if (!jsonString.StartsWith("[") && !jsonString.EndsWith("]")) { jsonString = "[" + jsonString + "]"; } List<Models.ClsQC_RequestCheckBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsQC_RequestCheckBillMain>>(jsonString); return list; } /// <summary> /// /// </summary> /// <param name="jsonString"></param> /// <returns></returns> /// <returns></returns> public List<Models.ClsKf_ICStockBillMain> getObjectByJson_Kf_ICStockBillMain(string jsonString) { jsonString = "[" + jsonString.ToString() + "]"; WebAPI/Models/ClsQC_RequestCheckBillMain.cs
New file @@ -0,0 +1,52 @@ using System; namespace WebAPI.Models { public class ClsQC_RequestCheckBillMain { // åºç¡å段 public int HYear { get; set; } public int HPeriod { get; set; } public string HBillType { get; set; } public string HBillSubType { get; set; } public int HInterID { get; set; } public DateTime HDate { get; set; } public string HBillNo { get; set; } public int HBillStatus { get; set; } public int HCheckItemNowID { get; set; } public int HCheckItemNextID { get; set; } public int HCheckFlowID { get; set; } public string HRemark { get; set; } public string HBacker { get; set; } public DateTime? HBackDate { get; set; } public string HBackRemark { get; set; } public string HChecker { get; set; } public DateTime? HCheckDate { get; set; } public string HMaker { get; set; } public DateTime? HMakeDate { get; set; } public string HUpDater { get; set; } public DateTime? HUpDateDate { get; set; } public string HCloseMan { get; set; } public DateTime? HCloseDate { get; set; } public bool HCloseType { get; set; } public string HDeleteMan { get; set; } public DateTime? HDeleteDate { get; set; } public string HMainSourceBillType { get; set; } public int HMainSourceInterID { get; set; } public int HMainSourceEntryID { get; set; } public string HMainSourceBillNo { get; set; } public int HPrintQty { get; set; } // èªå®ä¹å段 public int HSourceID { get; set; } public int HDeptID { get; set; } public string HBatchNo { get; set; } public int HCheckEmp { get; set; } public int HProcID { get; set; } public int HGroupID { get; set; } public int HShiftsID { get; set; } public string HTestType { get; set; } public int HSourceOrgID { get; set; } public int HInspectOrgID { get; set; } } } WebAPI/Models/ClsQC_RequestCheckBillSub.cs
New file @@ -0,0 +1,32 @@ using System; namespace WebAPI.Models { public class ClsQC_RequestCheckBillSub { // ä¸»è¡¨å ³èåæ®µ public int HInterID { get; set; } public string HBillNo_bak { get; set; } public int HEntryID { get; set; } // ç¶æåæ®µ public string HCloseMan { get; set; } public DateTime? HEntryCloseDate { get; set; } public bool HCloseType { get; set; } public string HRemark { get; set; } // æºåå ³èåæ®µ public int HSourceInterID { get; set; } public int HSourceEntryID { get; set; } public string HSourceBillNo { get; set; } public string HSourceBillType { get; set; } public double HRelationQty { get; set; } // dec(18,8) å¯¹åº double public double HRelationMoney { get; set; } // dec(18,8) å¯¹åº double // èªå®ä¹å段 public int HMaterID { get; set; } public int HUnitID { get; set; } public double HQty { get; set; } // money å¯¹åº double public double HSampleDamageQty { get; set; } // dec(18,8) å¯¹åº double } } WebAPI/Properties/PublishProfiles/FolderProfile11.pubxml.user
@@ -5,7 +5,7 @@ <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <_PublishTargetUrl>D:\gz\ç½ç«åå¸\MES-WEB-API</_PublishTargetUrl> <History>True|2025-12-26T00:20:29.5411144Z;True|2025-12-26T08:16:26.6662581+08:00;False|2025-12-26T08:16:07.5700329+08:00;True|2025-12-25T17:07:24.9496892+08:00;True|2025-12-25T17:04:00.1314291+08:00;True|2025-12-25T16:53:07.6258358+08:00;True|2025-12-25T16:47:09.1816088+08:00;True|2025-12-25T11:23:19.3812293+08:00;True|2025-12-25T11:15:13.7273857+08:00;</History> <History>True|2025-12-29T08:07:54.9198175Z;True|2025-12-29T16:03:22.7326283+08:00;True|2025-12-29T14:48:43.2998704+08:00;True|2025-12-29T13:15:31.9190907+08:00;False|2025-12-29T13:14:50.6997009+08:00;False|2025-12-29T13:14:43.3747902+08:00;True|2025-12-29T11:23:10.8799366+08:00;True|2025-12-29T10:28:51.7449005+08:00;True|2025-12-29T10:16:49.3899978+08:00;True|2025-12-29T10:12:43.7936956+08:00;True|2025-12-29T10:11:56.0271637+08:00;True|2025-12-29T08:50:47.5622375+08:00;False|2025-12-29T08:50:28.9083964+08:00;True|2025-12-26T17:03:30.4685598+08:00;True|2025-12-26T15:03:24.1797813+08:00;True|2025-12-26T14:44:52.6944631+08:00;True|2025-12-26T14:39:46.7764533+08:00;True|2025-12-26T14:36:47.1612784+08:00;True|2025-12-26T14:32:05.2128659+08:00;True|2025-12-26T14:29:20.7607039+08:00;True|2025-12-26T08:47:33.3798643+08:00;True|2025-12-26T08:20:29.5411144+08:00;True|2025-12-26T08:16:26.6662581+08:00;False|2025-12-26T08:16:07.5700329+08:00;True|2025-12-25T17:07:24.9496892+08:00;True|2025-12-25T17:04:00.1314291+08:00;True|2025-12-25T16:53:07.6258358+08:00;True|2025-12-25T16:47:09.1816088+08:00;True|2025-12-25T11:23:19.3812293+08:00;True|2025-12-25T11:15:13.7273857+08:00;</History> </PropertyGroup> <ItemGroup> <File Include="apiapp.json"> @@ -294,13 +294,13 @@ <publishTime>11/24/2014 19:18:48</publishTime> </File> <File Include="bin/WebAPI.dll"> <publishTime>12/26/2025 08:20:24</publishTime> <publishTime>12/29/2025 16:07:50</publishTime> </File> <File Include="bin/WebAPI.pdb"> <publishTime>12/26/2025 08:20:24</publishTime> <publishTime>12/29/2025 16:07:50</publishTime> </File> <File Include="bin/WebAPI.XmlSerializers.dll"> <publishTime>12/26/2025 08:20:27</publishTime> <publishTime>12/29/2025 16:07:54</publishTime> </File> <File Include="bin/WebGrease.dll"> <publishTime>07/18/2013 01:03:52</publishTime> @@ -504,7 +504,7 @@ <publishTime>11/12/2025 10:43:47</publishTime> </File> <File Include="Web.config"> <publishTime>12/25/2025 11:15:12</publishTime> <publishTime>12/26/2025 08:47:33</publishTime> </File> </ItemGroup> </Project> WebAPI/WebAPI.csproj
@@ -670,10 +670,12 @@ <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_PlanImplementation_ReportController.cs" /> <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_PNLInfoTypeLevelController.cs" /> <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_ShelfLifeNearExpiryController.cs" /> <Compile Include="Controllers\æ£éªç³è¯·å\QC_RequestCheckBillController.cs" /> <Compile Include="Controllers\项ç®ç®¡ç\å·¥ç¨é¡¹ç®\PM_ProjectBill_WorkController.cs" /> <Compile Include="DLL\ClsGy_ItemMoney_Ctl.cs" /> <Compile Include="DLL\ClsSc_MESStopRestoreWorkBill.cs" /> <Compile Include="DLL\ClsSc_PackUnionBillBarCode_temp_Ctl.cs" /> <Compile Include="DLL\ClsQC_RequestCheckBill.cs" /> <Compile Include="Models\ClsGy_Billorigin.cs" /> <Compile Include="Models\ClsSc_MESStopRestoreWorkBillMain.cs" /> <Compile Include="Models\ClsSc_MESStopRestoreWorkBillSub.cs" /> @@ -938,6 +940,8 @@ <Compile Include="Models\SBGL\SBBB\Sb_EquipMentCollectionTechParam.cs" /> <Compile Include="Models\Sc_StationOutBillSub_Sup.cs" /> <Compile Include="Models\Gy_MateNumRelation_Sec.cs" /> <Compile Include="Models\ClsQC_RequestCheckBillMain.cs" /> <Compile Include="Models\ClsQC_RequestCheckBillSub.cs" /> <Compile Include="Models\Xs_SendGoodsPlanBillMain.cs" /> <Compile Include="Models\åºç¡èµæ\ClsGy_EmployeeSub.cs" /> <Compile Include="Models\åºç¡èµæ\Gy_ColorClass.cs" />