DAL/Éú²ú¹ÜÀí/Ä£¾ß¹ÜÀí/ClsSc_MouldConkBookBill.cs
@@ -29,8 +29,64 @@ { DetailColl = null; } #endregion èªå®ä¹æ¹æ³ //ä¿ååæ§å¶ public bool BeforeSave(Int64 HInterID, string HBillNo, Int64 OperationType, ref string sReturn) { try { DataSet Ds = oCn.RunProcReturn("Exec h_p_Sc_MouldConkBookBill_BeforeSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Sc_MouldConkBookBill_BeforeSaveCtrl"); if (Ds == null || Ds.Tables[0].Rows.Count == 0) { sReturn = "ä¿ååå¤æå¤±è´¥ï¼"; return false; } else { if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HBack"]) == 1) { sReturn = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]); return false; } } return true; } catch (Exception e) { throw (e); } } //ä¿ååæ§å¶ public bool AfterSave(Int64 HInterID, string HBillNo, Int64 OperationType, ref string sReturn) { try { DataSet Ds = oCn.RunProcReturn("Exec h_p_Sc_MouldConkBookBill_AfterSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Sc_MouldConkBookBill_AfterSaveCtrl"); if (Ds == null || Ds.Tables[0].Rows.Count == 0) { sReturn = "ä¿ååå¤æå¤±è´¥ï¼"; return false; } else { if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HBack"]) == 1) { sReturn = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]); return false; } } return true; } catch (Exception e) { throw (e); } } //ä¿®æ¹åæ® public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) { @@ -38,6 +94,12 @@ { // oCn.BeginTran(); //ä¿ååæ§å¶ if (!BeforeSave(lngBillKey, omodel.HBillNo, 2, ref sReturn)) { oCn.RollBack(); return false; } //æ´æ°ä¸»è¡¨ oCn.RunProc("UpDate Sc_MouldConkBookBillMain set " + " HBillNo='" + omodel.HBillNo + "'" + //åºå®èµå¼=============== @@ -90,19 +152,13 @@ "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + ") "); } // //foreach (Model.ClsSc_MouldConkBookBillSub oSub in DetailColl) //{ // Ds = oCn.RunProcReturn("exec h_p_Sc_MouldConkBookBill_Qty " + oSub.HICMOInterID, ""); // if (Ds.Tables[0].Rows.Count == 0) // return; // if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBool"]) == "Y") // { // sReturn = "æ±æ¥æ°éè¶ è¿è®¡åæ°éï¼ä¸å 许ä¿å"; // return false; // } //} sReturn = "ä¿®æ¹åæ®æåï¼"; //ä¿ååæ§å¶ if (!AfterSave(lngBillKey, omodel.HBillNo, 2, ref sReturn)) { oCn.RollBack(); return false; } sReturn = "åæ®å·ï¼" + omodel.HBillNo + " ä¿®æ¹æåï¼"; oCn.Commit(); return true; } @@ -120,7 +176,13 @@ { //å¾å°mainid omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); //è¥MAINDIéå¤åéæ°è·å //ä¿ååæ§å¶ if (!BeforeSave(omodel.HInterID, omodel.HBillNo, 1, ref sReturn)) { return false; } oCn.BeginTran(); //主表 oCn.RunProc("Insert Into Sc_MouldConkBookBillMain " + @@ -151,20 +213,13 @@ "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + ") "); } // //foreach (Model.ClsSc_MouldConkBookBillSub oSub in DetailColl) //{ // Ds = oCn.RunProcReturn("exec h_p_Sc_MouldConkBookBill_Qty " + oSub.HICMOInterID, ""); // if (Ds.Tables[0].Rows.Count == 0) // return; // if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBool"]) == "Y") // { // sReturn = "æ±æ¥æ°éè¶ è¿è®¡åæ°éï¼ä¸å 许ä¿å"; // return false; // } //} // sReturn = "æ°å¢åæ®æåï¼"; //ä¿ååæ§å¶ if (!AfterSave(omodel.HInterID, omodel.HBillNo, 1, ref sReturn)) { oCn.RollBack(); return false; } sReturn = "åæ®å·ï¼" + omodel.HBillNo + " æ°å¢æåï¼"; oCn.Commit(); return true; } DAL/Éú²ú¹ÜÀí/Ä£¾ß¹ÜÀí/ClsSc_MouldMaintainBill.cs
@@ -30,15 +30,75 @@ { DetailColl = null; } #endregion èªå®ä¹æ¹æ³ //ä¿ååæ§å¶ public bool BeforeSave(Int64 HInterID, string HBillNo, Int64 OperationType, ref string sReturn) { try { DataSet Ds = oCn.RunProcReturn("Exec h_p_Sc_MouldMaintainBill_BeforeSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Sc_MouldMaintainBill_BeforeSaveCtrl"); if (Ds == null || Ds.Tables[0].Rows.Count == 0) { sReturn = "ä¿ååå¤æå¤±è´¥ï¼"; return false; } else { if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HBack"]) == 1) { sReturn = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]); return false; } } return true; } catch (Exception e) { throw (e); } } //ä¿ååæ§å¶ public bool AfterSave(Int64 HInterID, string HBillNo, Int64 OperationType, ref string sReturn) { try { DataSet Ds = oCn.RunProcReturn("Exec h_p_Sc_MouldMaintainBill_AfterSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Sc_MouldMaintainBill_AfterSaveCtrl"); if (Ds == null || Ds.Tables[0].Rows.Count == 0) { sReturn = "ä¿ååå¤æå¤±è´¥ï¼"; return false; } else { if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HBack"]) == 1) { sReturn = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]); return false; } } return true; } catch (Exception e) { throw (e); } } //ä¿®æ¹åæ® public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) { try { // oCn.BeginTran(); //ä¿ååæ§å¶ if (!BeforeSave(lngBillKey, omodel.HBillNo, 2, ref sReturn)) { oCn.RollBack(); return false; } //æ´æ°ä¸»è¡¨ oCn.RunProc("UpDate Sc_MouldMaintainBillMain set " + " HBillNo='" + omodel.HBillNo + "'" + //åºå®èµå¼=============== @@ -111,19 +171,13 @@ "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + ") "); } // //foreach (Model.ClsSc_MouldMaintainBillSub oSub in DetailColl) //{ // Ds = oCn.RunProcReturn("exec h_p_Sc_MouldMaintainBill_Qty " + oSub.HICMOInterID, ""); // if (Ds.Tables[0].Rows.Count == 0) // return; // if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBool"]) == "Y") // { // sReturn = "æ±æ¥æ°éè¶ è¿è®¡åæ°éï¼ä¸å 许ä¿å"; // return false; // } //} sReturn = "ä¿®æ¹åæ®æåï¼"; //ä¿ååæ§å¶ if (!AfterSave(lngBillKey, omodel.HBillNo, 2, ref sReturn)) { oCn.RollBack(); return false; } sReturn = "åæ®å·ï¼" + omodel.HBillNo + " ä¿®æ¹æåï¼"; oCn.Commit(); return true; } @@ -141,7 +195,13 @@ { //å¾å°mainid omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); //è¥MAINDIéå¤åéæ°è·å //ä¿ååæ§å¶ if (!BeforeSave(omodel.HInterID, omodel.HBillNo, 1, ref sReturn)) { return false; } oCn.BeginTran(); //主表 oCn.RunProc("Insert Into Sc_MouldMaintainBillMain " + @@ -216,7 +276,14 @@ //ä¿å »å®æï¼åå设å¤ä¿å »è®¡ååå表æ¯å¦ç¹æ£æ è®° oCn.RunProc("exec h_p_Sc_MouldMaintain_AfterSaveCtrl " + omodel.HMouldMaintainPlanInterID + "," + omodel.HMouldMaintainPlanEntryID); sReturn = "æ°å¢åæ®æåï¼"; //ä¿ååæ§å¶ if (!AfterSave(omodel.HInterID, omodel.HBillNo, 1, ref sReturn)) { oCn.RollBack(); return false; } sReturn = "åæ®å·ï¼" + omodel.HBillNo + " æ°å¢æåï¼"; oCn.Commit(); return true; } DAL/Éú²ú¹ÜÀí/É豸¹ÜÀí/ClsSb_EquipBeginBillMain.cs
@@ -29,15 +29,75 @@ { DetailColl = null; } #endregion èªå®ä¹æ¹æ³ //ä¿ååæ§å¶ public bool BeforeSave(Int64 HInterID, string HBillNo, Int64 OperationType, ref string sReturn) { try { DataSet Ds = oCn.RunProcReturn("Exec h_p_Sb_EquipBeginBill_BeforeSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Sb_EquipBeginBill_BeforeSaveCtrl"); if (Ds == null || Ds.Tables[0].Rows.Count == 0) { sReturn = "ä¿ååå¤æå¤±è´¥ï¼"; return false; } else { if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HBack"]) == 1) { sReturn = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]); return false; } } return true; } catch (Exception e) { throw (e); } } //ä¿ååæ§å¶ public bool AfterSave(Int64 HInterID, string HBillNo, Int64 OperationType, ref string sReturn) { try { DataSet Ds = oCn.RunProcReturn("Exec h_p_Sb_EquipBeginBill_AfterSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Sb_EquipBeginBill_AfterSaveCtrl"); if (Ds == null || Ds.Tables[0].Rows.Count == 0) { sReturn = "ä¿ååå¤æå¤±è´¥ï¼"; return false; } else { if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HBack"]) == 1) { sReturn = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]); return false; } } return true; } catch (Exception e) { throw (e); } } //ä¿®æ¹åæ® public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) { try { oCn.BeginTran(); //ä¿ååæ§å¶ if (!BeforeSave(lngBillKey, omodel.HBillNo, 2, ref sReturn)) { oCn.RollBack(); return false; } //æ´æ°ä¸»è¡¨ oCn.RunProc("UpDate Sb_EquipBeginBillMain set " + " HBillNo='" + omodel.HBillNo + "'" + @@ -56,8 +116,14 @@ DeleteRelation(ref sReturn, lngBillKey); //å é¤å表 //DeleteBillSub(lngBillKey); sReturn = "ä¿®æ¹åæ®æåï¼"; //ä¿ååæ§å¶ if (!AfterSave(lngBillKey, omodel.HBillNo, 2, ref sReturn)) { oCn.RollBack(); return false; } sReturn = "åæ®å·ï¼" + omodel.HBillNo + " ä¿®æ¹æåï¼"; oCn.Commit(); return true; } @@ -91,6 +157,11 @@ break; } } //ä¿ååæ§å¶ if (!BeforeSave(omodel.HInterID, omodel.HBillNo, 1, ref sReturn)) { return false; } //主表 string mainSql = "insert into Sb_EquipBeginBillMain" + @@ -115,7 +186,13 @@ oCn.RunProc(mainSql); sReturn = "æ°å¢åæ®æåï¼"; //ä¿ååæ§å¶ if (!AfterSave(omodel.HInterID, omodel.HBillNo, 1, ref sReturn)) { oCn.RollBack(); return false; } sReturn = "åæ®å·ï¼" + omodel.HBillNo + " æ°å¢æåï¼"; oCn.Commit(); return true; } DAL/Éú²ú¹ÜÀí/É豸¹ÜÀí/ClsSb_EquipStopBillMain.cs
@@ -29,15 +29,75 @@ { DetailColl = null; } #endregion èªå®ä¹æ¹æ³ //ä¿ååæ§å¶ public bool BeforeSave(Int64 HInterID, string HBillNo, Int64 OperationType, ref string sReturn) { try { DataSet Ds = oCn.RunProcReturn("Exec h_p_Sb_EquipStopBill_BeforeSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Sb_EquipStopBill_BeforeSaveCtrl"); if (Ds == null || Ds.Tables[0].Rows.Count == 0) { sReturn = "ä¿ååå¤æå¤±è´¥ï¼"; return false; } else { if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HBack"]) == 1) { sReturn = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]); return false; } } return true; } catch (Exception e) { throw (e); } } //ä¿ååæ§å¶ public bool AfterSave(Int64 HInterID, string HBillNo, Int64 OperationType, ref string sReturn) { try { DataSet Ds = oCn.RunProcReturn("Exec h_p_Sb_EquipStopBill_AfterSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Sb_EquipStopBill_AfterSaveCtrl"); if (Ds == null || Ds.Tables[0].Rows.Count == 0) { sReturn = "ä¿ååå¤æå¤±è´¥ï¼"; return false; } else { if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HBack"]) == 1) { sReturn = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]); return false; } } return true; } catch (Exception e) { throw (e); } } //ä¿®æ¹åæ® public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) { try { oCn.BeginTran(); //ä¿ååæ§å¶ if (!BeforeSave(lngBillKey, omodel.HBillNo, 2, ref sReturn)) { oCn.RollBack(); return false; } //æ´æ°ä¸»è¡¨ oCn.RunProc("UpDate Sb_EquipStopBillMain set " + " HBillNo='" + omodel.HBillNo + "'" + @@ -57,8 +117,14 @@ DeleteRelation(ref sReturn, lngBillKey); //å é¤å表 //DeleteBillSub(lngBillKey); sReturn = "ä¿®æ¹åæ®æåï¼"; //ä¿ååæ§å¶ if (!AfterSave(lngBillKey, omodel.HBillNo, 2, ref sReturn)) { oCn.RollBack(); return false; } sReturn = "åæ®å·ï¼" + omodel.HBillNo + " ä¿®æ¹æåï¼"; oCn.Commit(); return true; } @@ -92,6 +158,11 @@ break; } } //ä¿ååæ§å¶ if (!BeforeSave(omodel.HInterID, omodel.HBillNo, 1, ref sReturn)) { return false; } //主表 string mainSql = "insert into Sb_EquipStopBillMain" + @@ -117,7 +188,13 @@ oCn.RunProc(mainSql); sReturn = "æ°å¢åæ®æåï¼"; //ä¿ååæ§å¶ if (!AfterSave(omodel.HInterID, omodel.HBillNo, 1, ref sReturn)) { oCn.RollBack(); return false; } sReturn = "åæ®å·ï¼" + omodel.HBillNo + " æ°å¢æåï¼"; oCn.Commit(); return true; } WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs
@@ -1170,7 +1170,7 @@ string sql = string.Format(@"select * from h_v_Sc_ProcessExchangeBillQuerySub"); ds = oCN.RunProcReturn(sql + " where hmainid=" + HInterID + " and åºç«å ³èæ°é=0 and cast(æµæ°´å· as int)>" + ds1 .Tables[0].Rows[0][0].ToString(), "h_v_Sc_ProcessExchangeBillQuerySub"); ds = oCN.RunProcReturn(sql + " where hmainid=" + HInterID + " and åºç«å ³èæ°é=0 and cast(æµæ°´å· as int)>" + ds1 .Tables[0].Rows[0][0].ToString()+ " order by cast(æµæ°´å· as int) ", "h_v_Sc_ProcessExchangeBillQuerySub"); if (float.Parse(ds.Tables[0].Rows[0]["è¿ç«å ³èæ°é"].ToString()) > 0) { @@ -1246,9 +1246,9 @@ objJsonResult.data = 1; return objJsonResult; } int num = oItem.HBillNo.Split('-').Length; oBill.omodel.HMaker = msg5; //å¶å人 oBill.omodel.HNo = DBUtility.ClsPub.isLong(oItem.HBillNo.Split('-')[1]); oBill.omodel.HNo = DBUtility.ClsPub.isLong(oItem.HBillNo.Split('-')[num - 1]); oBill.omodel.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); oBill.omodel.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month); oBill.omodel.HDate = oItem.HDate;// æ¥æ @@ -1312,7 +1312,6 @@ j++; } } //ä¿å //ä¿å宿¯åå¤ç WebAPI/Controllers/MJGL/Sc_MouldOtherOutBillController.cs
@@ -17,8 +17,10 @@ private json objJsonResult = new json(); public DataSet ds = new DataSet(); public WebServer webserver = new WebServer(); public SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); public SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); DAL.ClsSc_MouldOtherOutBill oBill = new DAL.ClsSc_MouldOtherOutBill(); public DAL.ClsSc_MouldScrapInBill BillNew0 = new DAL.ClsSc_MouldScrapInBill(); //æ¨¡å ·æ¥åºå ¥åºå¯¹åºåæ®ç±» public DAL.ClsSc_MouldScrapInBill BillOld0 = new DAL.ClsSc_MouldScrapInBill(); //æ¨¡å ·æ¥åºå ¥åºå¯¹åºåæ®ç±» @@ -203,7 +205,159 @@ } #endregion #region å ¶ä»åºåºåä¿å/ç¼è¾ #region å ¶ä»åºåºåä¿å/ç¼è¾ 20240702ä½åº /// <summary> /// ä¿åæ¨¡å ·é¢ç¨å /// </summary> /// <param name="msg"></param> /// <returns></returns> //[Route("Sc_MouldOtherOutBill/SaveGetMouldOtherOutBillList")] //[HttpPost] //public object SaveGetMouldOtherOutBillList([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 msg4 = sArray[2].ToString(); // string UserName = ""; // ListModels oListModels = new ListModels(); // try // { // //ç¼è¾æé // if (!DBUtility.ClsPub.Security_Log_second("Sc_MouldOtherOutBill_Edit", 1, false, msg4)) // { // objJsonResult.code = "0"; // objJsonResult.count = 0; // objJsonResult.Message = "æ ä¿åæéï¼"; // objJsonResult.data = null; // return objJsonResult; // } // DLL.ClsSc_MouldOtherOutBill oBill = new DLL.ClsSc_MouldOtherOutBill(); // List<Model.ClsSc_MouldOtherOutBillMain> lsmain = new List<Model.ClsSc_MouldOtherOutBillMain>(); // msg2 = msg2.Replace("\\", ""); // msg2 = msg2.Replace("\n", ""); //\n // lsmain = oListModels.getObjectByJson_Sc_MouldOtherOutBillMain(msg2); // foreach (Model.ClsSc_MouldOtherOutBillMain oItem in lsmain) // { // //oItem.HMaker = ""; // UserName = oItem.HMaker; //å¶å人 // oItem.HBillType = "3841"; // oItem.HBillSubType = "3841"; // //oItem.HBillNo = ""; //åæ®å· // //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --æ¥æ // //oItem.HInnerBillNo = ""; // --å é¨åæ®å· // oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); // oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); // //oItem.HEquipID = 0; //设å¤ID(Gy_EquipMent) // //oItem.HPeriod = 0; // //oItem.HCheckBeginDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); // --ç»´ä¿®æ¥æ // //oItem.HCheckResult = ""; //éªæ¶ç»è®º--(æ£å¸¸ï¼å¼å¸¸) // //oItem.HEmpID = 0; //éªæ¶äºº(Gy_Employee) // //oItem.HManagerID = 0; //è´è´£äºº(Gy_Employee) // //oItem.HDeptID = 0; //éªæ¶é¨é¨(Gy_Department) // //oItem.HExplanation = ""; //æè¦(æ éæè¿°) // //oItem.HRemark = ""; //夿³¨ // //oItem.HMainSourceInterID = oItem.HInterID; // //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); // if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") // { // 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("\\", ""); // msg3 = msg3.Replace("\n", ""); //\n // //msg2 = msg2.Replace("'", "â"); // List<Model.ClsSc_MouldStockBillSub> ls = new List<Model.ClsSc_MouldStockBillSub>(); // ls = oListModels.getObjectByJson_Gy_MouldStockBillSub(msg3); // int i = 0; // foreach (Model.ClsSc_MouldStockBillSub oItemSub in ls) // { // i++; // oItemSub.HEntryID = i; // //oItemSub.HRepairCheckID = 0; //éªæ¶é¡¹ç®ID // //oItemSub.HRepairCheckContent = ""; //éªæ¶å 容 // //oItemSub.HManagerID = 0; //è´è´£äººID // //oItemSub.HCloseMan = ""; //è¡å ³é // oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); // oItemSub.HCloseType = false; //å ³éç±»å // //oItemSub.HRemark = ""; //夿³¨ // oItemSub.HSourceInterID = 0; // æºå主å ç // oItemSub.HSourceEntryID = 0; //æºååå ç // //oItemSub.HSourceBillNo = ""; //æºååå· // //oItemSub.HSourceBillType = ""; //æºåç±»å // //oItemSub.HRelationQty = 0; //å ³èæ°é // //oItemSub.HRelationMoney = 0; //å ³èéé¢ // //oItemSub.HRepairID = 0; //ç»´ä¿®é¡¹ç® // //oItemSub.HRepairExplanation =""; //ç»´ä¿®è¦æ± // //oItemSub.HMoney = 0; //ç»´ä¿®è´¹ç¨ // oBill.DetailColl.Add(oItemSub); // } // //ä¿å // //ä¿å宿¯åå¤ç // bool bResult; // if (oBill.omodel.HInterID == 0) // { // // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); // string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'out','{oBill.omodel.HInterID.ToString()}' "); // oCn.RunProc(sql); // } // else // { // bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); // //ä¿®æ¹æå // //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID 1,{oBill.omodel.HInterID.ToString()},' ' "); // string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID "); // oCn.RunProc(sql); // } // if (bResult) // { // objJsonResult.code = "0"; // objJsonResult.count = 1; // objJsonResult.Message = "ä¿åæåï¼"; // //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); // 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 å ¶ä»åºåºåä¿å/ç¼è¾ 20240702 /// <summary> /// ä¿åæ¨¡å ·é¢ç¨å /// </summary> @@ -216,123 +370,121 @@ 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 msg4 = sArray[2].ToString(); string UserName = ""; ListModels oListModels = new ListModels(); string sMainStr = sArray[0].ToString(); //ä¸»è¡¨æ°æ® string sSubStr = sArray[1].ToString(); //åè¡¨æ°æ® string HMaker = sArray[2].ToString(); //å¶å人 try { //ç¼è¾æé if (!DBUtility.ClsPub.Security_Log_second("Sc_MouldOtherOutBill_Edit", 1, false, msg4)) if (!DBUtility.ClsPub.Security_Log("Sc_MouldOtherOutBill_Edit", 1, false, HMaker)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ ä¿åæéï¼"; objJsonResult.Message = "æ¨æ²¡æè¯¥æ¨¡åæ°å¢/ç¼è¾æé,请ä¸ç®¡çåèç³»ï¼"; objJsonResult.data = null; return objJsonResult; } //表头èµå¼ sMainStr = sMainStr.Replace("\\", ""); sMainStr = sMainStr.Replace("\n", ""); sMainStr = "[" + sMainStr.ToString() + "]"; List<Model.ClsSc_MouldStockBillMain> lsmain = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldStockBillMain>>(sMainStr); foreach (Model.ClsSc_MouldStockBillMain oItem in lsmain) { if (oItem.HInterID == 0) { BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew; } else { BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_Modify; } //忮巿¯å¦éå¤ if (oBill.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, oItem.HInterID)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·éå¤ï¼ä¸å 许ä¿åï¼"; objJsonResult.data = null; return objJsonResult; } //夿ä¼è®¡ææ¯å¦åç string s = ""; int sYear = 0; int sPeriod = 0; if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(oItem.HDate, ref sYear, ref sPeriod, ref s) == false) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = s; objJsonResult.data = null; return objJsonResult; } oItem.HYear = sYear; oItem.HPeriod = sPeriod; DBUtility.ClsPub.CurUserName = oItem.HMaker; oBill.omodel = oItem; } //表ä½èµå¼ //æ },{æ¥æåæ°ç» //廿ãåã sSubStr = sSubStr.Substring(1, sSubStr.Length - 2); sSubStr = sSubStr.Replace("\\", ""); sSubStr = sSubStr.Replace("\n", ""); sSubStr = "[" + sSubStr.ToString() + "]"; List<Model.ClsSc_MouldStockBillSub> ls = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldStockBillSub>>(sSubStr); int i = 0; foreach (Model.ClsSc_MouldStockBillSub oItemSub in ls) { i++; oItemSub.HEntryID = i; oBill.DetailColl.Add(oItemSub); } string sErrMsg = ""; bool bResult; //è·åç³»ç»åæ° if (oSystemParameter.ShowBill(ref sErrMsg) == true) { //ä¿å if (oBill.omodel.HInterID == 0) //æ°å¢ä¿å { bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); if (oSystemParameter.omodel.WMS_CampanyName == "åç»´å°") //ç³»ç»åæ° å®¢æ·å®å¶ååç§° 空ç½ä¸ºéç¨ { //ä¿®æ¹å¨å ·æ¡£æ¡ä½ç½® string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'out','{oBill.omodel.HInterID.ToString()}' "); oCn.RunProc(sql); } } else //ç¼è¾ä¿å { bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); if (oSystemParameter.omodel.WMS_CampanyName == "åç»´å°") //ç³»ç»åæ° å®¢æ·å®å¶ååç§° 空ç½ä¸ºéç¨ { //ä¿®æ¹å¨å ·æ¡£æ¡ä½ç½® string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID "); oCn.RunProc(sql); } } } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "è·åç³»ç»åæ°å¤±è´¥ï¼ " + sErrMsg; objJsonResult.data = null; return objJsonResult; } DLL.ClsSc_MouldOtherOutBill oBill = new DLL.ClsSc_MouldOtherOutBill(); List<Model.ClsSc_MouldOtherOutBillMain> lsmain = new List<Model.ClsSc_MouldOtherOutBillMain>(); msg2 = msg2.Replace("\\", ""); msg2 = msg2.Replace("\n", ""); //\n lsmain = oListModels.getObjectByJson_Sc_MouldOtherOutBillMain(msg2); foreach (Model.ClsSc_MouldOtherOutBillMain oItem in lsmain) { //oItem.HMaker = ""; UserName = oItem.HMaker; //å¶å人 oItem.HBillType = "3841"; oItem.HBillSubType = "3841"; //oItem.HBillNo = ""; //åæ®å· //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --æ¥æ //oItem.HInnerBillNo = ""; // --å é¨åæ®å· oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); //oItem.HEquipID = 0; //设å¤ID(Gy_EquipMent) //oItem.HPeriod = 0; //oItem.HCheckBeginDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); // --ç»´ä¿®æ¥æ //oItem.HCheckResult = ""; //éªæ¶ç»è®º--(æ£å¸¸ï¼å¼å¸¸) //oItem.HEmpID = 0; //éªæ¶äºº(Gy_Employee) //oItem.HManagerID = 0; //è´è´£äºº(Gy_Employee) //oItem.HDeptID = 0; //éªæ¶é¨é¨(Gy_Department) //oItem.HExplanation = ""; //æè¦(æ éæè¿°) //oItem.HRemark = ""; //夿³¨ //oItem.HMainSourceInterID = oItem.HInterID; //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") { 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("\\", ""); msg3 = msg3.Replace("\n", ""); //\n //msg2 = msg2.Replace("'", "â"); List<Model.ClsSc_MouldStockBillSub> ls = new List<Model.ClsSc_MouldStockBillSub>(); ls = oListModels.getObjectByJson_Gy_MouldStockBillSub(msg3); int i = 0; foreach (Model.ClsSc_MouldStockBillSub oItemSub in ls) { i++; oItemSub.HEntryID = i; //oItemSub.HRepairCheckID = 0; //éªæ¶é¡¹ç®ID //oItemSub.HRepairCheckContent = ""; //éªæ¶å 容 //oItemSub.HManagerID = 0; //è´è´£äººID //oItemSub.HCloseMan = ""; //è¡å ³é oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); oItemSub.HCloseType = false; //å ³éç±»å //oItemSub.HRemark = ""; //夿³¨ oItemSub.HSourceInterID = 0; // æºå主å ç oItemSub.HSourceEntryID = 0; //æºååå ç //oItemSub.HSourceBillNo = ""; //æºååå· //oItemSub.HSourceBillType = ""; //æºåç±»å //oItemSub.HRelationQty = 0; //å ³èæ°é //oItemSub.HRelationMoney = 0; //å ³èéé¢ //oItemSub.HRepairID = 0; //ç»´ä¿®é¡¹ç® //oItemSub.HRepairExplanation =""; //ç»´ä¿®è¦æ± //oItemSub.HMoney = 0; //ç»´ä¿®è´¹ç¨ oBill.DetailColl.Add(oItemSub); } //ä¿å //ä¿å宿¯åå¤ç bool bResult; if (oBill.omodel.HInterID == 0) { // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'out','{oBill.omodel.HInterID.ToString()}' "); oCn.RunProc(sql); } else { bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); //ä¿®æ¹æå //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID 1,{oBill.omodel.HInterID.ToString()},' ' "); string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID "); oCn.RunProc(sql); } if (bResult) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "ä¿åæåï¼"; //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); objJsonResult.data = 1; objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; //æåï¼ objJsonResult.data = null; return objJsonResult; } else @@ -340,7 +492,7 @@ objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = 1; objJsonResult.data = null; return objJsonResult; } } @@ -348,8 +500,8 @@ { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); objJsonResult.data = 1; objJsonResult.Message = "ä¿å失败ï¼" + e.Message; objJsonResult.data = null; return objJsonResult; } } WebAPI/Controllers/MJGL/Sc_MouldProdInBillController.cs
@@ -14,10 +14,23 @@ { public class Sc_MouldProdInBillController : ApiController { public DBUtility.ClsPub.Enum_BillStatus BillStatus;//åæ®ç¶æï¼æ°å¢ï¼ä¿®æ¹ï¼æµè§ï¼æ´æ°åä»·ï¼åæ´ï¼ private json objJsonResult = new json(); public DBUtility.ClsPub.Enum_BillStatus BillStatus; public const string ModName = "3801"; //åæ®ç±»å public const string ModCaption = "å¨å ·éè´å ¥åºå"; //åæ®åç§° public const string ModRightName = "Sc_MouldProdInBill"; public const string ModRightNameList = ModRightName + "List"; //å表 public const string ModRightNameEdit = ModRightName + "_Edit"; //ç¼è¾ public const string ModRightNameCheck = ModRightName + "_Check"; //å®¡æ ¸ public const string ModRightNameClose = ModRightName + "_Close"; //å ³é public const string ModRightNameDelete = ModRightName + "_Delete"; //ä½åº public const string ModRightNameDrop = ModRightName + "_Drop"; //å é¤ public const string ModRightNameMoney = ModRightName + "_Money"; //éé¢ public const string ModRightNameQty = ModRightName + "_Qty"; //æ°é public DataSet ds = new DataSet(); public SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); private json objJsonResult = new json(); SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); public DAL.ClsSc_MouldProdInBill oBill = new DAL.ClsSc_MouldProdInBill(); public DLL.ClsSc_MouldProdInBill BillNew0 = new DLL.ClsSc_MouldProdInBill(); //æ¨¡å ·æ¥åºå ¥åºå¯¹åºåæ®ç±» public DLL.ClsSc_MouldProdInBill BillOld0 = new DLL.ClsSc_MouldProdInBill(); //æ¨¡å ·æ¥åºå ¥åºå¯¹åºåæ®ç±» @@ -477,7 +490,219 @@ } #endregion #region æ¨¡å ·éè´å ¥åºåä¿å/ç¼è¾ #region æ¨¡å ·éè´å ¥åºåä¿å/ç¼è¾ 20240702ä½åº /// <summary> /// ä¿åæ¨¡å ·éè´å ¥åºå /// </summary> /// <param name="msg"></param> /// <returns></returns> //[Route("Sc_MouldProdInHouseBill/SaveGetMouldProdInHouseBillList")] //[HttpPost] //public object SaveGetMouldProdInHouseBillList([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(); // string UserName = ""; // string s = ""; // long mouldid; // ListModels oListModels = new ListModels(); // try // { // //ç¼è¾æé // if (!DBUtility.ClsPub.Security_Log_second("Sc_MouldProdInBill_Edit", 1, false, msg4)) // { // objJsonResult.code = "0"; // objJsonResult.count = 0; // objJsonResult.Message = "æ ä¿åæéï¼"; // objJsonResult.data = null; // return objJsonResult; // } // DLL.ClsSc_MouldProdInBill oBill = new DLL.ClsSc_MouldProdInBill(); // List<Models.ClsSc_MouldProdBillMain> lsmain = new List<Models.ClsSc_MouldProdBillMain>(); // msg2 = msg2.Replace("\\", ""); // msg2 = msg2.Replace("\n", ""); //\n // lsmain = oListModels.getObjectByJson_Gy_MouldProdInHouseBillMain(msg2); // foreach (Models.ClsSc_MouldProdBillMain 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; // } // } // //oItem.HMaker = ""; // UserName = oItem.HMaker; //å¶å人 // oItem.HBillType = "3801"; // oItem.HBillSubType = "3801"; // //oItem.HBillNo = ""; //åæ®å· // //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --æ¥æ // //oItem.HInnerBillNo = ""; // --å é¨åæ®å· // oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); // oItem.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month); // oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); // //oItem.HEquipID = 0; //设å¤ID(Gy_EquipMent) // //oItem.HPeriod = 0; // //oItem.HCheckBeginDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); // --ç»´ä¿®æ¥æ // //oItem.HCheckResult = ""; //éªæ¶ç»è®º--(æ£å¸¸ï¼å¼å¸¸) // //oItem.HEmpID = 0; //éªæ¶äºº(Gy_Employee) // //oItem.HManagerID = 0; //è´è´£äºº(Gy_Employee) // //oItem.HDeptID = 0; //éªæ¶é¨é¨(Gy_Department) // //oItem.HExplanation = ""; //æè¦(æ éæè¿°) // //oItem.HRemark = ""; //夿³¨ // //oItem.HMainSourceInterID = oItem.HInterID; // //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); // if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") // { // 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("\\", ""); // msg3 = msg3.Replace("\n", ""); //\n // //msg2 = msg2.Replace("'", "â"); // List<Models.ClsSc_MouldProdBillSub> ls = new List<Models.ClsSc_MouldProdBillSub>(); // ls = oListModels.getObjectByJson_Gy_MouldProdInHouseBillSub(msg3); // int i = 0; // foreach (Models.ClsSc_MouldProdBillSub oItemSub in ls) // { // i++; // oItemSub.HEntryID = i; // mouldid = oItemSub.HMaterID; // //oItemSub.HRepairCheckID = 0; //éªæ¶é¡¹ç®ID // //oItemSub.HRepairCheckContent = ""; //éªæ¶å 容 // //oItemSub.HManagerID = 0; //è´è´£äººID // //oItemSub.HCloseMan = ""; //è¡å ³é // oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); // oItemSub.HCloseType = false; //å ³éç±»å // //oItemSub.HRemark = ""; //夿³¨ // oItemSub.HSourceInterID = 0; // æºå主å ç // oItemSub.HSourceEntryID = 0; //æºååå ç // //oItemSub.HSourceBillNo = ""; //æºååå· // //oItemSub.HSourceBillType = ""; //æºåç±»å // //oItemSub.HRelationQty = 0; //å ³èæ°é // //oItemSub.HRelationMoney = 0; //å ³èéé¢ // //oItemSub.HRepairID = 0; //ç»´ä¿®é¡¹ç® // //oItemSub.HRepairExplanation =""; //ç»´ä¿®è¦æ± // //oItemSub.HMoney = 0; //ç»´ä¿®è´¹ç¨ // oBill.DetailColl.Add(oItemSub); // } // //ä¿å // //ä¿å宿¯åå¤ç // bool bResult; // if (oBill.omodel.HInterID == 0) // { // // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); // //ä¿®æ¹å¨å ·æ¡£æ¡ä½ç½® // string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'in','{oBill.omodel.HInterID.ToString()}' "); // DataSet db = oCn.RunProcReturn(sql, "h_p_Sc_MouldChangeFileStatus"); // if (db.Tables[0].Rows[0]["issuccess"].ToString() == "0") // { // objJsonResult.code = "0"; // objJsonResult.count = 0; // objJsonResult.Message = "å¨å ·ä½ç½®åæ¥å¤±è´¥ï¼"; // objJsonResult.data = 1; // return objJsonResult; // } // } // else // { // bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); // //ä¿®æ¹æå // //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID 1,{oBill.omodel.HInterID.ToString()},' ' "); // string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID "); // oCn.RunProc(sql); // } // if (bResult) // { // objJsonResult.code = "0"; // objJsonResult.count = 1; // objJsonResult.Message = "ä¿åæåï¼"; // //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); // 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 æ¨¡å ·éè´å ¥åºåä¿å/ç¼è¾ 20240702 /// <summary> /// ä¿åæ¨¡å ·éè´å ¥åºå /// </summary> @@ -490,183 +715,140 @@ 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(); string UserName = ""; string s = ""; long mouldid; ListModels oListModels = new ListModels(); string sMainStr = sArray[0].ToString(); //ä¸»è¡¨æ°æ® string sSubStr = sArray[1].ToString(); //åè¡¨æ°æ® string OperationType = sArray[2].ToString(); //æä½ç±»åï¼Addæ°å¢ãUpdateç¼è¾ï¼ string HMaker = sArray[3].ToString(); //å¶å人 try { //ç¼è¾æé if (!DBUtility.ClsPub.Security_Log_second("Sc_MouldProdInBill_Edit", 1, false, msg4)) //夿æé if (OperationType == "Add") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ ä¿åæéï¼"; objJsonResult.data = null; return objJsonResult; } DLL.ClsSc_MouldProdInBill oBill = new DLL.ClsSc_MouldProdInBill(); List<Models.ClsSc_MouldProdBillMain> lsmain = new List<Models.ClsSc_MouldProdBillMain>(); msg2 = msg2.Replace("\\", ""); msg2 = msg2.Replace("\n", ""); //\n lsmain = oListModels.getObjectByJson_Gy_MouldProdInHouseBillMain(msg2); foreach (Models.ClsSc_MouldProdBillMain 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; } } //oItem.HMaker = ""; UserName = oItem.HMaker; //å¶å人 oItem.HBillType = "3801"; oItem.HBillSubType = "3801"; //oItem.HBillNo = ""; //åæ®å· //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --æ¥æ //oItem.HInnerBillNo = ""; // --å é¨åæ®å· oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); oItem.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month); oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); //oItem.HEquipID = 0; //设å¤ID(Gy_EquipMent) //oItem.HPeriod = 0; //oItem.HCheckBeginDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); // --ç»´ä¿®æ¥æ //oItem.HCheckResult = ""; //éªæ¶ç»è®º--(æ£å¸¸ï¼å¼å¸¸) //oItem.HEmpID = 0; //éªæ¶äºº(Gy_Employee) //oItem.HManagerID = 0; //è´è´£äºº(Gy_Employee) //oItem.HDeptID = 0; //éªæ¶é¨é¨(Gy_Department) //oItem.HExplanation = ""; //æè¦(æ éæè¿°) //oItem.HRemark = ""; //夿³¨ //oItem.HMainSourceInterID = oItem.HInterID; //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew; //夿æ°å¢æé if (!DBUtility.ClsPub.Security_Log(ModRightName, 1, false, HMaker)) { 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("\\", ""); msg3 = msg3.Replace("\n", ""); //\n //msg2 = msg2.Replace("'", "â"); List<Models.ClsSc_MouldProdBillSub> ls = new List<Models.ClsSc_MouldProdBillSub>(); ls = oListModels.getObjectByJson_Gy_MouldProdInHouseBillSub(msg3); int i = 0; foreach (Models.ClsSc_MouldProdBillSub oItemSub in ls) { i++; oItemSub.HEntryID = i; mouldid = oItemSub.HMaterID; //oItemSub.HRepairCheckID = 0; //éªæ¶é¡¹ç®ID //oItemSub.HRepairCheckContent = ""; //éªæ¶å 容 //oItemSub.HManagerID = 0; //è´è´£äººID //oItemSub.HCloseMan = ""; //è¡å ³é oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); oItemSub.HCloseType = false; //å ³éç±»å //oItemSub.HRemark = ""; //夿³¨ oItemSub.HSourceInterID = 0; // æºå主å ç oItemSub.HSourceEntryID = 0; //æºååå ç //oItemSub.HSourceBillNo = ""; //æºååå· //oItemSub.HSourceBillType = ""; //æºåç±»å //oItemSub.HRelationQty = 0; //å ³èæ°é //oItemSub.HRelationMoney = 0; //å ³èéé¢ //oItemSub.HRepairID = 0; //ç»´ä¿®é¡¹ç® //oItemSub.HRepairExplanation =""; //ç»´ä¿®è¦æ± //oItemSub.HMoney = 0; //ç»´ä¿®è´¹ç¨ oBill.DetailColl.Add(oItemSub); } //ä¿å //ä¿å宿¯åå¤ç bool bResult; if (oBill.omodel.HInterID == 0) { // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); //ä¿®æ¹å¨å ·æ¡£æ¡ä½ç½® string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'in','{oBill.omodel.HInterID.ToString()}' "); DataSet db = oCn.RunProcReturn(sql, "h_p_Sc_MouldChangeFileStatus"); if (db.Tables[0].Rows[0]["issuccess"].ToString() == "0") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å¨å ·ä½ç½®åæ¥å¤±è´¥ï¼"; objJsonResult.data = 1; objJsonResult.Message = "æ¨æ²¡æè¯¥æ¨¡åæ°å¢æé,请ä¸ç®¡çåèç³»ï¼"; objJsonResult.data = null; return objJsonResult; } } else { bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); //ä¿®æ¹æå //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID 1,{oBill.omodel.HInterID.ToString()},' ' "); string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID "); oCn.RunProc(sql); BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_Modify; //夿ç¼è¾æé if (!DBUtility.ClsPub.Security_Log(ModRightNameEdit, 1, false, HMaker)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¨æ²¡æè¯¥æ¨¡åç¼è¾æé,请ä¸ç®¡çåèç³»ï¼"; objJsonResult.data = null; return objJsonResult; } } //表头èµå¼ sMainStr = sMainStr.Replace("\\", ""); sMainStr = sMainStr.Replace("\n", ""); sMainStr = "[" + sMainStr.ToString() + "]"; List<Model.ClsSc_MouldProdInBillMain> lsmain = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldProdInBillMain>>(sMainStr); foreach (Model.ClsSc_MouldProdInBillMain oItem in lsmain) { //忮巿¯å¦éå¤ if (oBill.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, oItem.HInterID)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·éå¤ï¼ä¸å 许ä¿åï¼"; objJsonResult.data = null; return objJsonResult; } //夿ä¼è®¡ææ¯å¦åç string s = ""; int sYear = 0; int sPeriod = 0; if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(oItem.HDate, ref sYear, ref sPeriod, ref s) == false) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = s; objJsonResult.data = null; return objJsonResult; } oItem.HYear = sYear; oItem.HPeriod = sPeriod; DBUtility.ClsPub.CurUserName = oItem.HMaker; oBill.omodel = oItem; } //表ä½èµå¼ //æ },{æ¥æåæ°ç» //廿ãåã sSubStr = sSubStr.Substring(1, sSubStr.Length - 2); sSubStr = sSubStr.Replace("\\", ""); sSubStr = sSubStr.Replace("\n", ""); sSubStr = "[" + sSubStr.ToString() + "]"; List<Model.ClsSc_MouldStockBillSub> ls = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldStockBillSub>>(sSubStr); int i = 0; foreach (Model.ClsSc_MouldStockBillSub oItemSub in ls) { i++; oItemSub.HEntryID = i; oBill.DetailColl.Add(oItemSub); } string sErrMsg = ""; bool bResult; //è·åç³»ç»åæ° if (oSystemParameter.ShowBill(ref sErrMsg) == true) { //ä¿å if (OperationType == "Add") //æ°å¢ä¿å { bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); if (oSystemParameter.omodel.WMS_CampanyName == "åç»´å°") //ç³»ç»åæ° å®¢æ·å®å¶ååç§° 空ç½ä¸ºéç¨ { //ä¿®æ¹å¨å ·æ¡£æ¡ä½ç½® string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'in','{oBill.omodel.HInterID.ToString()}' "); DataSet db = oCn.RunProcReturn(sql, "h_p_Sc_MouldChangeFileStatus"); if (db.Tables[0].Rows[0]["issuccess"].ToString() == "0") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å¨å ·ä½ç½®åæ¥å¤±è´¥ï¼"; objJsonResult.data = 1; return objJsonResult; } } } else //ç¼è¾ä¿å { bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); if (oSystemParameter.omodel.WMS_CampanyName == "åç»´å°") //ç³»ç»åæ° å®¢æ·å®å¶ååç§° 空ç½ä¸ºéç¨ { //ä¿®æ¹å¨å ·æ¡£æ¡ä½ç½® string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID "); oCn.RunProc(sql); } } } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "è·åç³»ç»åæ°å¤±è´¥ï¼ " + sErrMsg; objJsonResult.data = null; return objJsonResult; } if (bResult) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "ä¿åæåï¼"; //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); objJsonResult.data = 1; objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; //æåï¼ objJsonResult.data = null; return objJsonResult; } else @@ -674,7 +856,7 @@ objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = 1; objJsonResult.data = null; return objJsonResult; } } @@ -682,8 +864,8 @@ { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); objJsonResult.data = 1; objJsonResult.Message = "ä¿å失败ï¼" + e.Message; objJsonResult.data = null; return objJsonResult; } } @@ -772,5 +954,8 @@ } } #endregion } } WebAPI/Controllers/MJGL/Sc_MouldProdMoveBillListController.cs
@@ -18,6 +18,7 @@ public DataSet ds = new DataSet(); public WebServer webserver = new WebServer(); public SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); public DAL.ClsSc_MouldScrapInBill BillNew0 = new DAL.ClsSc_MouldScrapInBill(); //æ¨¡å ·æ¥åºå ¥åºå¯¹åºåæ®ç±» public DAL.ClsSc_MouldScrapInBill BillOld0 = new DAL.ClsSc_MouldScrapInBill(); //æ¨¡å ·æ¥åºå ¥åºå¯¹åºåæ®ç±» @@ -206,7 +207,157 @@ } #endregion #region å¨å ·ç´æ¥è°æ¨åä¿å/ç¼è¾ #region å¨å ·ç´æ¥è°æ¨åä¿å/ç¼è¾ 20240702ä½åº /// <summary> /// ä¿åæ¨¡å ·é¢ç¨å /// </summary> /// <param name="msg"></param> /// <returns></returns> //[Route("Sc_MouldProdMoveBill/SaveGetMouldProdMoveBillList")] //[HttpPost] //public object SaveGetMouldProdMoveBillList([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 msg4 = sArray[2].ToString(); // string UserName = ""; // ListModels oListModels = new ListModels(); // try // { // if (!DBUtility.ClsPub.Security_Log_second("Sc_MouldProdMoveBill_Edit", 1, false, msg4)) // { // objJsonResult.code = "0"; // objJsonResult.count = 0; // objJsonResult.Message = "没æä¿åæé"; // objJsonResult.data = null; // return objJsonResult; // } // DLL.ClsSc_MouldProdMoveBill oBill = new DLL.ClsSc_MouldProdMoveBill(); // List<Model.ClsSc_MouldProdMoveBillMain> lsmain = new List<Model.ClsSc_MouldProdMoveBillMain>(); // msg2 = msg2.Replace("\\", ""); // msg2 = msg2.Replace("\n", ""); //\n // lsmain = oListModels.getObjectByJson_Gy_MouldProdMoveBillMain(msg2); // foreach (Model.ClsSc_MouldProdMoveBillMain oItem in lsmain) // { // //oItem.HMaker = ""; // UserName = oItem.HMaker; //å¶å人 // oItem.HBillType = "3814"; // oItem.HBillSubType = "3814"; // //oItem.HBillNo = ""; //åæ®å· // //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --æ¥æ // //oItem.HInnerBillNo = ""; // --å é¨åæ®å· // oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); // oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); // //oItem.HEquipID = 0; //设å¤ID(Gy_EquipMent) // //oItem.HPeriod = 0; // //oItem.HCheckBeginDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); // --ç»´ä¿®æ¥æ // //oItem.HCheckResult = ""; //éªæ¶ç»è®º--(æ£å¸¸ï¼å¼å¸¸) // //oItem.HEmpID = 0; //éªæ¶äºº(Gy_Employee) // //oItem.HManagerID = 0; //è´è´£äºº(Gy_Employee) // //oItem.HDeptID = 0; //éªæ¶é¨é¨(Gy_Department) // //oItem.HExplanation = ""; //æè¦(æ éæè¿°) // //oItem.HRemark = ""; //夿³¨ // //oItem.HMainSourceInterID = oItem.HInterID; // //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); // if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") // { // 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("\\", ""); // msg3 = msg3.Replace("\n", ""); //\n // //msg2 = msg2.Replace("'", "â"); // List<Model.ClsSc_MouldStockBillSub> ls = new List<Model.ClsSc_MouldStockBillSub>(); // ls = oListModels.getObjectByJson_Gy_MouldStockBillSub(msg3); // int i = 0; // foreach (Model.ClsSc_MouldStockBillSub oItemSub in ls) // { // i++; // oItemSub.HEntryID = i; // //oItemSub.HRepairCheckID = 0; //éªæ¶é¡¹ç®ID // //oItemSub.HRepairCheckContent = ""; //éªæ¶å 容 // //oItemSub.HManagerID = 0; //è´è´£äººID // //oItemSub.HCloseMan = ""; //è¡å ³é // oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); // oItemSub.HCloseType = false; //å ³éç±»å // //oItemSub.HRemark = ""; //夿³¨ // oItemSub.HSourceInterID = 0; // æºå主å ç // oItemSub.HSourceEntryID = 0; //æºååå ç // //oItemSub.HSourceBillNo = ""; //æºååå· // //oItemSub.HSourceBillType = ""; //æºåç±»å // //oItemSub.HRelationQty = 0; //å ³èæ°é // //oItemSub.HRelationMoney = 0; //å ³èéé¢ // //oItemSub.HRepairID = 0; //ç»´ä¿®é¡¹ç® // //oItemSub.HRepairExplanation =""; //ç»´ä¿®è¦æ± // //oItemSub.HMoney = 0; //ç»´ä¿®è´¹ç¨ // oBill.DetailColl.Add(oItemSub); // } // //ä¿å // //ä¿å宿¯åå¤ç // bool bResult; // if (oBill.omodel.HInterID == 0) // { // // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); // string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'in','{oBill.omodel.HInterID.ToString()}' "); // oCn.RunProc(sql); // } // else // { // bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); // //ä¿®æ¹æå // //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID 1,{oBill.omodel.HInterID.ToString()},' ' "); // string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID "); // oCn.RunProc(sql); // } // if (bResult) // { // objJsonResult.code = "0"; // objJsonResult.count = 1; // objJsonResult.Message = "ä¿åæåï¼"; // //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); // 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 å¨å ·ç´æ¥è°æ¨åä¿å/ç¼è¾ 20240702 /// <summary> /// ä¿åæ¨¡å ·é¢ç¨å /// </summary> @@ -216,124 +367,126 @@ [HttpPost] public object SaveGetMouldProdMoveBillList([FromBody] JObject msg) { DAL.ClsSc_MouldProdMoveBill oBill = new DAL.ClsSc_MouldProdMoveBill(); 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 msg4 = sArray[2].ToString(); string UserName = ""; ListModels oListModels = new ListModels(); string sMainStr = sArray[0].ToString(); //ä¸»è¡¨æ°æ® string sSubStr = sArray[1].ToString(); //åè¡¨æ°æ® string HMaker = sArray[2].ToString(); //å¶å人 try { if (!DBUtility.ClsPub.Security_Log_second("Sc_MouldProdMoveBill_Edit", 1, false, msg4)) //夿æé if (!DBUtility.ClsPub.Security_Log("Sc_MouldProdMoveBill_Edit", 1, false, HMaker)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "没æä¿åæé"; objJsonResult.Message = "æ¨æ²¡æè¯¥æ¨¡åæ°å¢/ç¼è¾æé,请ä¸ç®¡çåèç³»ï¼"; objJsonResult.data = null; return objJsonResult; } //表头èµå¼ sMainStr = sMainStr.Replace("\\", ""); sMainStr = sMainStr.Replace("\n", ""); sMainStr = "[" + sMainStr.ToString() + "]"; List<Model.ClsSc_MouldProdMoveBillMain> lsmain = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldProdMoveBillMain>>(sMainStr); foreach (Model.ClsSc_MouldProdMoveBillMain oItem in lsmain) { if (oItem.HInterID == 0) { BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew; } else { BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_Modify; } //忮巿¯å¦éå¤ if (oBill.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, oItem.HInterID)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·éå¤ï¼ä¸å 许ä¿åï¼"; objJsonResult.data = null; return objJsonResult; } //夿ä¼è®¡ææ¯å¦åç string s = ""; int sYear = 0; int sPeriod = 0; if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(oItem.HDate, ref sYear, ref sPeriod, ref s) == false) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = s; objJsonResult.data = null; return objJsonResult; } oItem.HYear = sYear; oItem.HPeriod = sPeriod; DBUtility.ClsPub.CurUserName = oItem.HMaker; oBill.omodel = oItem; } //表ä½èµå¼ //æ },{æ¥æåæ°ç» //廿ãåã sSubStr = sSubStr.Substring(1, sSubStr.Length - 2); sSubStr = sSubStr.Replace("\\", ""); sSubStr = sSubStr.Replace("\n", ""); sSubStr = "[" + sSubStr.ToString() + "]"; List<Model.ClsSc_MouldProdMoveBillSub> ls = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldProdMoveBillSub>>(sSubStr); int i = 0; foreach (Model.ClsSc_MouldProdMoveBillSub oItemSub in ls) { i++; oItemSub.HEntryID = i; oBill.DetailColl.Add(oItemSub); } string sErrMsg = ""; bool bResult; //è·åç³»ç»åæ° if (oSystemParameter.ShowBill(ref sErrMsg) == true) { //ä¿å if (oBill.omodel.HInterID == 0) //æ°å¢ä¿å { bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); if (oSystemParameter.omodel.WMS_CampanyName == "åç»´å°") //ç³»ç»åæ° å®¢æ·å®å¶ååç§° 空ç½ä¸ºéç¨ { //ä¿®æ¹å¨å ·æ¡£æ¡ä½ç½® string sql1 = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'in','{oBill.omodel.HInterID.ToString()}' "); oCn.RunProc(sql1); } } else //ç¼è¾ä¿å { bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); if (oSystemParameter.omodel.WMS_CampanyName == "åç»´å°") //ç³»ç»åæ° å®¢æ·å®å¶ååç§° 空ç½ä¸ºéç¨ { //ä¿®æ¹å¨å ·æ¡£æ¡ä½ç½® string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID "); oCn.RunProc(sql); } } } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "è·åç³»ç»åæ°å¤±è´¥ï¼ " + sErrMsg; objJsonResult.data = null; return objJsonResult; } DLL.ClsSc_MouldProdMoveBill oBill = new DLL.ClsSc_MouldProdMoveBill(); List<Model.ClsSc_MouldProdMoveBillMain> lsmain = new List<Model.ClsSc_MouldProdMoveBillMain>(); msg2 = msg2.Replace("\\", ""); msg2 = msg2.Replace("\n", ""); //\n lsmain = oListModels.getObjectByJson_Gy_MouldProdMoveBillMain(msg2); foreach (Model.ClsSc_MouldProdMoveBillMain oItem in lsmain) { //oItem.HMaker = ""; UserName = oItem.HMaker; //å¶å人 oItem.HBillType = "3814"; oItem.HBillSubType = "3814"; //oItem.HBillNo = ""; //åæ®å· //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --æ¥æ //oItem.HInnerBillNo = ""; // --å é¨åæ®å· oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); //oItem.HEquipID = 0; //设å¤ID(Gy_EquipMent) //oItem.HPeriod = 0; //oItem.HCheckBeginDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); // --ç»´ä¿®æ¥æ //oItem.HCheckResult = ""; //éªæ¶ç»è®º--(æ£å¸¸ï¼å¼å¸¸) //oItem.HEmpID = 0; //éªæ¶äºº(Gy_Employee) //oItem.HManagerID = 0; //è´è´£äºº(Gy_Employee) //oItem.HDeptID = 0; //éªæ¶é¨é¨(Gy_Department) //oItem.HExplanation = ""; //æè¦(æ éæè¿°) //oItem.HRemark = ""; //夿³¨ //oItem.HMainSourceInterID = oItem.HInterID; //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") { 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("\\", ""); msg3 = msg3.Replace("\n", ""); //\n //msg2 = msg2.Replace("'", "â"); List<Model.ClsSc_MouldStockBillSub> ls = new List<Model.ClsSc_MouldStockBillSub>(); ls = oListModels.getObjectByJson_Gy_MouldStockBillSub(msg3); int i = 0; foreach (Model.ClsSc_MouldStockBillSub oItemSub in ls) { i++; oItemSub.HEntryID = i; //oItemSub.HRepairCheckID = 0; //éªæ¶é¡¹ç®ID //oItemSub.HRepairCheckContent = ""; //éªæ¶å 容 //oItemSub.HManagerID = 0; //è´è´£äººID //oItemSub.HCloseMan = ""; //è¡å ³é oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); oItemSub.HCloseType = false; //å ³éç±»å //oItemSub.HRemark = ""; //夿³¨ oItemSub.HSourceInterID = 0; // æºå主å ç oItemSub.HSourceEntryID = 0; //æºååå ç //oItemSub.HSourceBillNo = ""; //æºååå· //oItemSub.HSourceBillType = ""; //æºåç±»å //oItemSub.HRelationQty = 0; //å ³èæ°é //oItemSub.HRelationMoney = 0; //å ³èéé¢ //oItemSub.HRepairID = 0; //ç»´ä¿®é¡¹ç® //oItemSub.HRepairExplanation =""; //ç»´ä¿®è¦æ± //oItemSub.HMoney = 0; //ç»´ä¿®è´¹ç¨ oBill.DetailColl.Add(oItemSub); } //ä¿å //ä¿å宿¯åå¤ç bool bResult; if (oBill.omodel.HInterID == 0) { // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'in','{oBill.omodel.HInterID.ToString()}' "); oCn.RunProc(sql); } else { bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); //ä¿®æ¹æå //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID 1,{oBill.omodel.HInterID.ToString()},' ' "); string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID "); oCn.RunProc(sql); } if (bResult) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "ä¿åæåï¼"; //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); objJsonResult.data = 1; objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; //æåï¼ objJsonResult.data = null; return objJsonResult; } else @@ -341,7 +494,7 @@ objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = 1; objJsonResult.data = null; return objJsonResult; } } @@ -349,8 +502,8 @@ { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); objJsonResult.data = 1; objJsonResult.Message = "ä¿å失败ï¼" + e.Message; objJsonResult.data = null; return objJsonResult; } } WebAPI/Controllers/MJGL/Sc_MouldRepairOutBillController.cs
@@ -17,6 +17,8 @@ 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(); DAL.ClsSc_MouldRepairOutBill oBill = new DAL.ClsSc_MouldRepairOutBill(); public DLL.ClsSc_MouldRepairOutBill BillNew0 = new DLL.ClsSc_MouldRepairOutBill(); //æ¨¡å ·æ¹å¶åºåºå¯¹åºåæ®ç±» public DLL.ClsSc_MouldRepairOutBill BillOld0 = new DLL.ClsSc_MouldRepairOutBill(); //æ¨¡å ·æ¹å¶åºåºå¯¹åºåæ®ç±» @@ -172,7 +174,208 @@ #endregion #region æ¨¡å ·æ¹å¶åºåºä¿å/ç¼è¾ #region æ¨¡å ·æ¹å¶åºåºä¿å/ç¼è¾ 20240702ä½åº /// <summary> /// ä¿åæ¨¡å ·éè´å ¥åºå /// </summary> /// <param name="msg"></param> /// <returns></returns> //[Route("Sc_MouldRepairOutHouseBill/SaveGetMouldRepairOutHouseBillList")] //[HttpPost] //public object SaveGetMouldRepairOutHouseBillList([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(); // string UserName = ""; // string s = ""; // ListModels oListModels = new ListModels(); // try // { // //ç¼è¾æé // if (!DBUtility.ClsPub.Security_Log_second("Sc_MouldRepairOut_SingleBill_Edit", 1, false, msg4)) // { // objJsonResult.code = "0"; // objJsonResult.count = 0; // objJsonResult.Message = "æ ä¿åæéï¼"; // objJsonResult.data = null; // return objJsonResult; // } // DLL.ClsSc_MouldRepairOutBill oBill = new DLL.ClsSc_MouldRepairOutBill(); // List<Models.ClsSc_MouldRepairOutBillMain> lsmain = new List<Models.ClsSc_MouldRepairOutBillMain>(); // msg2 = msg2.Replace("\\", ""); // msg2 = msg2.Replace("\n", ""); //\n // lsmain = oListModels.getObjectByJson_Gy_MouldRepairOutHouseBillMain(msg2); // foreach (Models.ClsSc_MouldRepairOutBillMain 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; // } // } // //oItem.HMaker = ""; // UserName = oItem.HMaker; //å¶å人 // oItem.HBillType = "3825"; // oItem.HBillSubType = "3825"; // //oItem.HBillNo = ""; //åæ®å· // //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --æ¥æ // //oItem.HInnerBillNo = ""; // --å é¨åæ®å· // oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); // oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); // //oItem.HEquipID = 0; //设å¤ID(Gy_EquipMent) // //oItem.HPeriod = 0; // //oItem.HCheckBeginDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); // --ç»´ä¿®æ¥æ // //oItem.HCheckResult = ""; //éªæ¶ç»è®º--(æ£å¸¸ï¼å¼å¸¸) // //oItem.HEmpID = 0; //éªæ¶äºº(Gy_Employee) // //oItem.HManagerID = 0; //è´è´£äºº(Gy_Employee) // //oItem.HDeptID = 0; //éªæ¶é¨é¨(Gy_Department) // //oItem.HExplanation = ""; //æè¦(æ éæè¿°) // //oItem.HRemark = ""; //夿³¨ // //oItem.HMainSourceInterID = oItem.HInterID; // //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); // if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") // { // 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("\\", ""); // msg3 = msg3.Replace("\n", ""); //\n // //msg2 = msg2.Replace("'", "â"); // List<Models.ClsSc_MouldRepairOutBillSub> ls = new List<Models.ClsSc_MouldRepairOutBillSub>(); // ls = oListModels.getObjectByJson_Gy_MouldRepairOutHouseBillSub(msg3); // int i = 0; // foreach (Models.ClsSc_MouldRepairOutBillSub oItemSub in ls) // { // i++; // oItemSub.HEntryID = i; // //oItemSub.HRepairCheckID = 0; //éªæ¶é¡¹ç®ID // //oItemSub.HRepairCheckContent = ""; //éªæ¶å 容 // //oItemSub.HManagerID = 0; //è´è´£äººID // //oItemSub.HCloseMan = ""; //è¡å ³é // oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); // oItemSub.HCloseType = false; //å ³éç±»å // //oItemSub.HRemark = ""; //夿³¨ // oItemSub.HSourceInterID = 0; // æºå主å ç // oItemSub.HSourceEntryID = 0; //æºååå ç // //oItemSub.HSourceBillNo = ""; //æºååå· // //oItemSub.HSourceBillType = ""; //æºåç±»å // //oItemSub.HRelationQty = 0; //å ³èæ°é // //oItemSub.HRelationMoney = 0; //å ³èéé¢ // //oItemSub.HRepairID = 0; //ç»´ä¿®é¡¹ç® // //oItemSub.HRepairExplanation =""; //ç»´ä¿®è¦æ± // //oItemSub.HMoney = 0; //ç»´ä¿®è´¹ç¨ // oBill.DetailColl.Add(oItemSub); // } // //ä¿å // //ä¿å宿¯åå¤ç // bool bResult; // if (oBill.omodel.HInterID == 0) // { // // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); // string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'out',{oBill.omodel.HInterID.ToString()} "); // oCn.RunProc(sql); // } // else // { // bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); // //ä¿®æ¹æå // //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID 1,{oBill.omodel.HInterID.ToString()},' ' "); // string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID "); // oCn.RunProc(sql); // } // if (bResult) // { // objJsonResult.code = "0"; // objJsonResult.count = 1; // objJsonResult.Message = "ä¿åæåï¼"; // //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); // 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 æ¨¡å ·æ¹å¶åºåºä¿å/ç¼è¾ 20240702 /// <summary> /// ä¿åæ¨¡å ·éè´å ¥åºå /// </summary> @@ -185,172 +388,132 @@ 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(); string UserName = ""; string s = ""; ListModels oListModels = new ListModels(); string sMainStr = sArray[0].ToString(); //ä¸»è¡¨æ°æ® string sSubStr = sArray[1].ToString(); //åè¡¨æ°æ® string OperationType = sArray[2].ToString(); //æä½ç±»åï¼Addæ°å¢ãUpdateç¼è¾ï¼ string HMaker = sArray[3].ToString(); //å¶å人 try { //ç¼è¾æé if (!DBUtility.ClsPub.Security_Log_second("Sc_MouldRepairOut_SingleBill_Edit", 1, false, msg4)) //夿æé if (OperationType == "Add") { BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew; //夿æ°å¢æé if (!DBUtility.ClsPub.Security_Log("Sc_MouldRepairOut_SingleBill", 1, false, HMaker)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¨æ²¡æè¯¥æ¨¡åæ°å¢æé,请ä¸ç®¡çåèç³»ï¼"; objJsonResult.data = null; return objJsonResult; } } else { BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_Modify; //夿ç¼è¾æé if (!DBUtility.ClsPub.Security_Log("Sc_MouldRepairOut_SingleBill_Edit", 1, false, HMaker)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¨æ²¡æè¯¥æ¨¡åç¼è¾æé,请ä¸ç®¡çåèç³»ï¼"; objJsonResult.data = null; return objJsonResult; } } //表头èµå¼ sMainStr = sMainStr.Replace("\\", ""); sMainStr = sMainStr.Replace("\n", ""); sMainStr = "[" + sMainStr.ToString() + "]"; List<Model.ClsSc_MouldStockBillMain> lsmain = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldStockBillMain>>(sMainStr); foreach (Model.ClsSc_MouldStockBillMain oItem in lsmain) { //忮巿¯å¦éå¤ if (oBill.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, oItem.HInterID)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·éå¤ï¼ä¸å 许ä¿åï¼"; objJsonResult.data = null; return objJsonResult; } //夿ä¼è®¡ææ¯å¦åç string s = ""; int sYear = 0; int sPeriod = 0; if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(oItem.HDate, ref sYear, ref sPeriod, ref s) == false) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = s; objJsonResult.data = null; return objJsonResult; } oItem.HYear = sYear; oItem.HPeriod = sPeriod; DBUtility.ClsPub.CurUserName = oItem.HMaker; oBill.omodel = oItem; } //表ä½èµå¼ //æ },{æ¥æåæ°ç» //廿ãåã sSubStr = sSubStr.Substring(1, sSubStr.Length - 2); sSubStr = sSubStr.Replace("\\", ""); sSubStr = sSubStr.Replace("\n", ""); sSubStr = "[" + sSubStr.ToString() + "]"; List<Model.ClsSc_MouldStockBillSub> ls = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldStockBillSub>>(sSubStr); int i = 0; foreach (Model.ClsSc_MouldStockBillSub oItemSub in ls) { i++; oItemSub.HEntryID = i; oBill.DetailColl.Add(oItemSub); } string sErrMsg = ""; bool bResult; //è·åç³»ç»åæ° if (oSystemParameter.ShowBill(ref sErrMsg) == true) { //ä¿å if (OperationType == "Add") //æ°å¢ä¿å { bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); if (oSystemParameter.omodel.WMS_CampanyName == "åç»´å°") //ç³»ç»åæ° å®¢æ·å®å¶ååç§° 空ç½ä¸ºéç¨ { //ä¿®æ¹å¨å ·æ¡£æ¡ä½ç½® string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'out',{oBill.omodel.HInterID.ToString()} "); oCn.RunProc(sql); } } else //ç¼è¾ä¿å { bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); if (oSystemParameter.omodel.WMS_CampanyName == "åç»´å°") //ç³»ç»åæ° å®¢æ·å®å¶ååç§° 空ç½ä¸ºéç¨ { //ä¿®æ¹å¨å ·æ¡£æ¡ä½ç½® string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID "); oCn.RunProc(sql); } } } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ ä¿åæéï¼"; objJsonResult.Message = "è·åç³»ç»åæ°å¤±è´¥ï¼ " + sErrMsg; objJsonResult.data = null; return objJsonResult; } DLL.ClsSc_MouldRepairOutBill oBill = new DLL.ClsSc_MouldRepairOutBill(); List<Models.ClsSc_MouldRepairOutBillMain> lsmain = new List<Models.ClsSc_MouldRepairOutBillMain>(); msg2 = msg2.Replace("\\", ""); msg2 = msg2.Replace("\n", ""); //\n lsmain = oListModels.getObjectByJson_Gy_MouldRepairOutHouseBillMain(msg2); foreach (Models.ClsSc_MouldRepairOutBillMain 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; } } //oItem.HMaker = ""; UserName = oItem.HMaker; //å¶å人 oItem.HBillType = "3825"; oItem.HBillSubType = "3825"; //oItem.HBillNo = ""; //åæ®å· //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --æ¥æ //oItem.HInnerBillNo = ""; // --å é¨åæ®å· oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); //oItem.HEquipID = 0; //设å¤ID(Gy_EquipMent) //oItem.HPeriod = 0; //oItem.HCheckBeginDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); // --ç»´ä¿®æ¥æ //oItem.HCheckResult = ""; //éªæ¶ç»è®º--(æ£å¸¸ï¼å¼å¸¸) //oItem.HEmpID = 0; //éªæ¶äºº(Gy_Employee) //oItem.HManagerID = 0; //è´è´£äºº(Gy_Employee) //oItem.HDeptID = 0; //éªæ¶é¨é¨(Gy_Department) //oItem.HExplanation = ""; //æè¦(æ éæè¿°) //oItem.HRemark = ""; //夿³¨ //oItem.HMainSourceInterID = oItem.HInterID; //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") { 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("\\", ""); msg3 = msg3.Replace("\n", ""); //\n //msg2 = msg2.Replace("'", "â"); List<Models.ClsSc_MouldRepairOutBillSub> ls = new List<Models.ClsSc_MouldRepairOutBillSub>(); ls = oListModels.getObjectByJson_Gy_MouldRepairOutHouseBillSub(msg3); int i = 0; foreach (Models.ClsSc_MouldRepairOutBillSub oItemSub in ls) { i++; oItemSub.HEntryID = i; //oItemSub.HRepairCheckID = 0; //éªæ¶é¡¹ç®ID //oItemSub.HRepairCheckContent = ""; //éªæ¶å 容 //oItemSub.HManagerID = 0; //è´è´£äººID //oItemSub.HCloseMan = ""; //è¡å ³é oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); oItemSub.HCloseType = false; //å ³éç±»å //oItemSub.HRemark = ""; //夿³¨ oItemSub.HSourceInterID = 0; // æºå主å ç oItemSub.HSourceEntryID = 0; //æºååå ç //oItemSub.HSourceBillNo = ""; //æºååå· //oItemSub.HSourceBillType = ""; //æºåç±»å //oItemSub.HRelationQty = 0; //å ³èæ°é //oItemSub.HRelationMoney = 0; //å ³èéé¢ //oItemSub.HRepairID = 0; //ç»´ä¿®é¡¹ç® //oItemSub.HRepairExplanation =""; //ç»´ä¿®è¦æ± //oItemSub.HMoney = 0; //ç»´ä¿®è´¹ç¨ oBill.DetailColl.Add(oItemSub); } //ä¿å //ä¿å宿¯åå¤ç bool bResult; if (oBill.omodel.HInterID == 0) { // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'out',{oBill.omodel.HInterID.ToString()} "); oCn.RunProc(sql); } else { bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); //ä¿®æ¹æå //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID 1,{oBill.omodel.HInterID.ToString()},' ' "); string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID "); oCn.RunProc(sql); } if (bResult) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "ä¿åæåï¼"; //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); objJsonResult.data = 1; objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; //æåï¼ objJsonResult.data = null; return objJsonResult; } else @@ -358,7 +521,7 @@ objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = 1; objJsonResult.data = null; return objJsonResult; } } @@ -366,8 +529,8 @@ { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); objJsonResult.data = 1; objJsonResult.Message = "ä¿å失败ï¼" + e.Message; objJsonResult.data = null; return objJsonResult; } } WebAPI/Controllers/MJGL/Sc_MouldUpperBillController.cs
@@ -67,6 +67,70 @@ } #endregion #region 䏿¨¡å ä¿ååãä¿ååæ§å¶ //ä¿ååæ§å¶ public json BeforeSave_MouldUpperBill(Int64 HInterID, string HBillNo, Int64 OperationType) { DataSet BeforeSave = oCN.RunProcReturn("Exec h_p_Sc_MouldUpperBill_BeforeSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Sc_MouldUpperBill_BeforeSaveCtrl"); if (BeforeSave == null || BeforeSave.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿ååå¤æå¤±è´¥ï¼"; objJsonResult.data = null; return objJsonResult; } else if (DBUtility.ClsPub.isLong(BeforeSave.Tables[0].Rows[0]["HBack"]) == 1) { objJsonResult.code = "0"; objJsonResult.count = 0; //å¤±è´¥ï¼ objJsonResult.Message = DBUtility.ClsPub.isStrNull(BeforeSave.Tables[0].Rows[0]["HRemark"]); objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 1; //æåï¼ objJsonResult.Message = DBUtility.ClsPub.isStrNull(BeforeSave.Tables[0].Rows[0]["HRemark"]); objJsonResult.data = null; return objJsonResult; } } //ä¿ååæ§å¶ public json AfterSave_MouldUpperBill(Int64 HInterID, string HBillNo, Int64 OperationType) { DataSet AfterSave = oCN.RunProcReturn("Exec h_p_Sc_MouldUpperBill_AfterSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Sc_MouldUpperBill_AfterSaveCtrl"); if (AfterSave == null || AfterSave.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿ååå¤æå¤±è´¥ï¼"; objJsonResult.data = null; return objJsonResult; } else if (DBUtility.ClsPub.isLong(AfterSave.Tables[0].Rows[0]["HBack"]) == 1) { objJsonResult.code = "0"; objJsonResult.count = 0; //å¤±è´¥ï¼ objJsonResult.Message = DBUtility.ClsPub.isStrNull(AfterSave.Tables[0].Rows[0]["HRemark"]); objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 1; //æåï¼ objJsonResult.Message = DBUtility.ClsPub.isStrNull(AfterSave.Tables[0].Rows[0]["HRemark"]); objJsonResult.data = null; return objJsonResult; } } #endregion #region 䏿¨¡å æ°å¢ /// <summary> /// æ°å¢åæ®-ä¿åæé® @@ -136,6 +200,16 @@ if ((OperationType == 1) && ds.Tables[0].Rows.Count == 0)//æ°å¢ { //ä¿ååæ§å¶ objJsonResult = BeforeSave_MouldUpperBill(HInterID, HBillNo, 1); if (objJsonResult.count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = objJsonResult.Message; objJsonResult.data = null; return objJsonResult; } //主表 oCN.RunProc(@"Insert Into Sc_MouldUpperBillMain (HBillType,HBillStatus, HBillSubType, HInterID, HBillNo, HDate @@ -147,7 +221,18 @@ } else if (OperationType == 3 || ds.Tables[0].Rows.Count != 0) { //ä¿®æ¹ { //ä¿ååæ§å¶ objJsonResult = BeforeSave_MouldUpperBill(HInterID, HBillNo, 2); if (objJsonResult.count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = objJsonResult.Message; objJsonResult.data = null; return objJsonResult; } //ä¿®æ¹ oCN.RunProc("update Sc_MouldUpperBillMain set " + "HDate='" + HDate + "',HYear='" + HYear + "',HPeriod='" + HPeriod + "',HRemark='" + HRemark + "',hupdater='" + HMaker + @@ -157,7 +242,7 @@ oCN.RunProc("delete from Sc_MouldUpperBillSub where HInterID='" + HInterID + "'"); } //ä¿åå表 objJsonResult = AddBillSub(msg3, HInterID, HBillNo); objJsonResult = AddBillSub(msg3, HInterID, HBillNo, OperationType); if (objJsonResult.code == "0") { objJsonResult.code = "0"; @@ -183,7 +268,7 @@ } } public json AddBillSub(string msg3, long HInterID,string HBillNo) public json AddBillSub(string msg3, long HInterID,string HBillNo, Int64 OperationType) { List<ClsSc_MouldUpperBillSub> DetailColl = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsSc_MouldUpperBillSub>>(msg3); int i = 0; @@ -198,11 +283,34 @@ + HInterID + ",'"+ HBillNo + "'," + i + "," + oSub.HMouldID.ToString() + ",'" + oSub.HQty + "'," + oSub.HSourceID.ToString() + "," + oSub.HICMOInterID.ToString() + "," + oSub.HICMOEntryID.ToString()+",'"+ oSub.HICMOBillNo.ToString() + "') "); //å忍¡å ·ç¶æ oCN.RunProc("update Gy_MouldFileMain set HMouldStatus='é¢åº' where HInterID= " + oSub.HMouldID.ToString()); } if (OperationType == 1)//æ°å¢ { //ä¿ååæ§å¶ objJsonResult = AfterSave_MouldUpperBill(HInterID, HBillNo, 1); if (objJsonResult.count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = objJsonResult.Message; objJsonResult.data = null; return objJsonResult; } } else { //ä¿ååæ§å¶ objJsonResult = AfterSave_MouldUpperBill(HInterID, HBillNo, 2); if (objJsonResult.count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = objJsonResult.Message; objJsonResult.data = null; return objJsonResult; } } objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = null; @@ -749,6 +857,70 @@ } #endregion #region 䏿¨¡å ä¿ååãä¿ååæ§å¶ //ä¿ååæ§å¶ public json BeforeSave_MouldLowerBill(Int64 HInterID, string HBillNo, Int64 OperationType) { DataSet BeforeSave = oCN.RunProcReturn("Exec h_p_Sc_MouldLowerBill_BeforeSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Sc_MouldLowerBill_BeforeSaveCtrl"); if (BeforeSave == null || BeforeSave.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿ååå¤æå¤±è´¥ï¼"; objJsonResult.data = null; return objJsonResult; } else if (DBUtility.ClsPub.isLong(BeforeSave.Tables[0].Rows[0]["HBack"]) == 1) { objJsonResult.code = "0"; objJsonResult.count = 0; //å¤±è´¥ï¼ objJsonResult.Message = DBUtility.ClsPub.isStrNull(BeforeSave.Tables[0].Rows[0]["HRemark"]); objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 1; //æåï¼ objJsonResult.Message = DBUtility.ClsPub.isStrNull(BeforeSave.Tables[0].Rows[0]["HRemark"]); objJsonResult.data = null; return objJsonResult; } } //ä¿ååæ§å¶ public json AfterSave_MouldLowerBill(Int64 HInterID, string HBillNo, Int64 OperationType) { DataSet AfterSave = oCN.RunProcReturn("Exec h_p_Sc_MouldLowerBill_AfterSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Sc_MouldLowerBill_AfterSaveCtrl"); if (AfterSave == null || AfterSave.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿ååå¤æå¤±è´¥ï¼"; objJsonResult.data = null; return objJsonResult; } else if (DBUtility.ClsPub.isLong(AfterSave.Tables[0].Rows[0]["HBack"]) == 1) { objJsonResult.code = "0"; objJsonResult.count = 0; //å¤±è´¥ï¼ objJsonResult.Message = DBUtility.ClsPub.isStrNull(AfterSave.Tables[0].Rows[0]["HRemark"]); objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 1; //æåï¼ objJsonResult.Message = DBUtility.ClsPub.isStrNull(AfterSave.Tables[0].Rows[0]["HRemark"]); objJsonResult.data = null; return objJsonResult; } } #endregion #region 䏿¨¡å æ°å¢ /// <summary> /// æ°å¢åæ®-ä¿åæé® @@ -818,6 +990,16 @@ if ((OperationType == 1) && ds.Tables[0].Rows.Count == 0)//æ°å¢ { //ä¿ååæ§å¶ objJsonResult = BeforeSave_MouldLowerBill(HInterID, HBillNo, 1); if (objJsonResult.count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = objJsonResult.Message; objJsonResult.data = null; return objJsonResult; } //主表 oCN.RunProc(@"Insert Into Sc_MouldLowerBillMain (HBillType,HBillStatus, HBillSubType, HInterID, HBillNo, HDate @@ -829,7 +1011,18 @@ } else if (OperationType == 3 || ds.Tables[0].Rows.Count != 0) { //ä¿®æ¹ { //ä¿ååæ§å¶ objJsonResult = BeforeSave_MouldLowerBill(HInterID, HBillNo, 2); if (objJsonResult.count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = objJsonResult.Message; objJsonResult.data = null; return objJsonResult; } //ä¿®æ¹ oCN.RunProc("update Sc_MouldLowerBillMain set " + "HDate='" + HDate + "',HYear='" + HYear + "',HPeriod='" + HPeriod + "',HRemark='" + HRemark + "',hupdater='" + HMaker + @@ -839,7 +1032,7 @@ oCN.RunProc("delete from Sc_MouldLowerBillSub where HInterID='" + HInterID + "'"); } //ä¿åå表 objJsonResult = AddMouldLowerBill(msg3, HInterID, HBillNo); objJsonResult = AddMouldLowerBill(msg3, HInterID, HBillNo, OperationType); if (objJsonResult.code == "0") { objJsonResult.code = "0"; @@ -865,7 +1058,7 @@ } } public json AddMouldLowerBill(string msg3, long HInterID, string HBillNo) public json AddMouldLowerBill(string msg3, long HInterID, string HBillNo, Int64 OperationType) { List<ClsSc_MouldLowerBillSub> DetailColl = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsSc_MouldLowerBillSub>>(msg3); int i = 0; @@ -880,11 +1073,34 @@ + HInterID + ",'" + HBillNo + "'," + i + "," + oSub.HMouldID.ToString() + ",'" + oSub.HQty + "'," + oSub.HSourceID.ToString() + "," + oSub.HICMOInterID.ToString() + "," + oSub.HICMOEntryID.ToString() + ",'" + oSub.HICMOBillNo.ToString() + "') "); //å忍¡å ·ç¶æ oCN.RunProc("update Gy_MouldFileMain set HMouldStatus='å¨åº' where HInterID= " + oSub.HMouldID.ToString()); } if (OperationType == 1)//æ°å¢ { //ä¿ååæ§å¶ objJsonResult = AfterSave_MouldLowerBill(HInterID, HBillNo, 1); if (objJsonResult.count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = objJsonResult.Message; objJsonResult.data = null; return objJsonResult; } } else { //ä¿ååæ§å¶ objJsonResult = AfterSave_MouldLowerBill(HInterID, HBillNo, 2); if (objJsonResult.count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = objJsonResult.Message; objJsonResult.data = null; return objJsonResult; } } objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = null; @@ -1529,6 +1745,16 @@ if ((OperationType == 1) && ds.Tables[0].Rows.Count == 0)//æ°å¢ { //ä¿ååæ§å¶ objJsonResult = BeforeSave_MouldUpperBill(HInterID, HBillNo, 1); if (objJsonResult.count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = objJsonResult.Message; objJsonResult.data = null; return objJsonResult; } //主表 oCN.RunProc(@"Insert Into Sc_MouldUpperBillMain (HBillType,HBillStatus, HBillSubType, HInterID, HBillNo, HDate @@ -1540,7 +1766,18 @@ } else if (OperationType == 3 || ds.Tables[0].Rows.Count != 0) { //ä¿®æ¹ { //ä¿ååæ§å¶ objJsonResult = BeforeSave_MouldUpperBill(HInterID, HBillNo, 2); if (objJsonResult.count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = objJsonResult.Message; objJsonResult.data = null; return objJsonResult; } //ä¿®æ¹ oCN.RunProc("update Sc_MouldUpperBillMain set " + "HDate='" + HDate + "',HYear='" + HYear + "',HPeriod='" + HPeriod + "',HRemark='" + HRemark + "',hupdater='" + HMaker + @@ -1550,7 +1787,7 @@ oCN.RunProc("delete from Sc_MouldUpperBillSub where HInterID='" + HInterID + "'"); } //ä¿åå表 objJsonResult = AddBillSub_PDA(msg2, HInterID, HBillNo); objJsonResult = AddBillSub_PDA(msg2, HInterID, HBillNo, OperationType); if (objJsonResult.code == "0") { objJsonResult.code = "0"; @@ -1576,7 +1813,7 @@ } } public json AddBillSub_PDA(string msg2, long HInterID, string HBillNo) public json AddBillSub_PDA(string msg2, long HInterID, string HBillNo, Int64 OperationType) { List<ClsSc_MouldUpperBillSub> DetailColl = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsSc_MouldUpperBillSub>>(msg2); int i = 0; @@ -1594,11 +1831,34 @@ + "'," + oSub.HSourceID.ToString() + "," + oSub.HICMOInterID.ToString() + "," + oSub.HICMOEntryID.ToString() + ",'" + oSub.HICMOBillNo.ToString() + "','" + oSub.HProcExchBillNo.ToString() + "'," + oSub.HProcExchInterID.ToString() + "," + oSub.HProcExchEntryID.ToString() + ",'" + oSub.HScanDate.ToString() + "','" + oSub.HMouldNumber.ToString() + "') "); //å忍¡å ·ç¶æ oCN.RunProc("update Gy_MouldFileMain set HMouldStatus='é¢åº' where HInterID= "+ oSub.HMouldID.ToString()); } if (OperationType == 1)//æ°å¢ { //ä¿ååæ§å¶ objJsonResult = AfterSave_MouldUpperBill(HInterID, HBillNo, 1); if (objJsonResult.count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = objJsonResult.Message; objJsonResult.data = null; return objJsonResult; } } else { //ä¿ååæ§å¶ objJsonResult = AfterSave_MouldUpperBill(HInterID, HBillNo, 2); if (objJsonResult.count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = objJsonResult.Message; objJsonResult.data = null; return objJsonResult; } } objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = null; @@ -1676,6 +1936,16 @@ if ((OperationType == 1) && ds.Tables[0].Rows.Count == 0)//æ°å¢ { //ä¿ååæ§å¶ objJsonResult = BeforeSave_MouldLowerBill(HInterID, HBillNo, 1); if (objJsonResult.count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = objJsonResult.Message; objJsonResult.data = null; return objJsonResult; } //主表 oCN.RunProc(@"Insert Into Sc_MouldLowerBillMain (HBillType,HBillStatus, HBillSubType, HInterID, HBillNo, HDate @@ -1687,7 +1957,18 @@ } else if (OperationType == 3 || ds.Tables[0].Rows.Count != 0) { //ä¿®æ¹ { //ä¿ååæ§å¶ objJsonResult = BeforeSave_MouldLowerBill(HInterID, HBillNo, 2); if (objJsonResult.count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = objJsonResult.Message; objJsonResult.data = null; return objJsonResult; } //ä¿®æ¹ oCN.RunProc("update Sc_MouldLowerBillMain set " + "HDate='" + HDate + "',HYear='" + HYear + "',HPeriod='" + HPeriod + "',HRemark='" + HRemark + "',hupdater='" + HMaker + @@ -1697,7 +1978,7 @@ oCN.RunProc("delete from Sc_MouldLowerBillSub where HInterID='" + HInterID + "'"); } //ä¿åå表 objJsonResult = AddSc_MouldLowerBillSub_PDA(msg2, HInterID, HBillNo); objJsonResult = AddSc_MouldLowerBillSub_PDA(msg2, HInterID, HBillNo, OperationType); if (objJsonResult.code == "0") { objJsonResult.code = "0"; @@ -1723,7 +2004,7 @@ } } public json AddSc_MouldLowerBillSub_PDA(string msg2, long HInterID, string HBillNo) public json AddSc_MouldLowerBillSub_PDA(string msg2, long HInterID, string HBillNo, Int64 OperationType) { List<ClsSc_MouldLowerBillSub> DetailColl = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsSc_MouldLowerBillSub>>(msg2); int i = 0; @@ -1741,11 +2022,34 @@ + "'," + oSub.HSourceID.ToString() + "," + oSub.HICMOInterID.ToString() + "," + oSub.HICMOEntryID.ToString() + ",'" + oSub.HICMOBillNo.ToString() + "','" + oSub.HProcExchBillNo.ToString() + "'," + oSub.HProcExchInterID.ToString() + "," + oSub.HProcExchEntryID.ToString() + ",'" + oSub.HScanDate.ToString() + "','" + oSub.HMouldNumber.ToString() + "') "); //å忍¡å ·ç¶æ oCN.RunProc("update Gy_MouldFileMain set HMouldStatus='å¨åº' where HInterID= " + oSub.HMouldID.ToString()); } if (OperationType == 1)//æ°å¢ { //ä¿ååæ§å¶ objJsonResult = AfterSave_MouldLowerBill(HInterID, HBillNo, 1); if (objJsonResult.count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = objJsonResult.Message; objJsonResult.data = null; return objJsonResult; } } else { //ä¿ååæ§å¶ objJsonResult = AfterSave_MouldLowerBill(HInterID, HBillNo, 2); if (objJsonResult.count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = objJsonResult.Message; objJsonResult.data = null; return objJsonResult; } } objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = null; WebAPI/Controllers/Sc_CheckToolsRepairWorkBillListController.cs
@@ -18,6 +18,7 @@ public DataSet ds = new DataSet(); public SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); public WebServer webserver = new WebServer(); Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); public DAL.ClsSc_MouldScrapInBill BillNew0 = new DAL.ClsSc_MouldScrapInBill(); //æ¨¡å ·æ¥åºå ¥åºå¯¹åºåæ®ç±» public DAL.ClsSc_MouldScrapInBill BillOld0 = new DAL.ClsSc_MouldScrapInBill(); //æ¨¡å ·æ¥åºå ¥åºå¯¹åºåæ®ç±» @@ -4318,7 +4319,209 @@ } #endregion #region å¨å ·æ¹å¶å ¥åºåä¿å/ç¼è¾ #region å¨å ·æ¹å¶å ¥åºåä¿å/ç¼è¾ 20240702ä½åº /// <summary> /// ä¿åå¨å ·æ¹å¶å ¥åºå /// </summary> /// <param name="msg"></param> /// <returns></returns> //[Route("Sc_MouldRepairInBill/SaveGetMouldRepairInBillList")] //[HttpPost] //public object SaveGetMouldRepairInBillList([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(); // string UserName = ""; // string s = ""; // ListModels oListModels = new ListModels(); // try // { // //ç¼è¾æé // if (!DBUtility.ClsPub.Security_Log("Sc_MouldRepairIn_SingleBill_Edit", 1, false, msg4)) // { // objJsonResult.code = "0"; // objJsonResult.count = 0; // objJsonResult.Message = "æ ä¿åæéï¼"; // objJsonResult.data = null; // return objJsonResult; // } // DLL.ClsSc_MouldRepairInBill oBill = new DLL.ClsSc_MouldRepairInBill(); // List<Models.ClsSc_MouldRepairInBillMain> lsmain = new List<Models.ClsSc_MouldRepairInBillMain>(); // msg2 = msg2.Replace("\\", ""); // msg2 = msg2.Replace("\n", ""); //\n // lsmain = oListModels.getObjectByJson_Gy_MouldRepairInHouseBillMain(msg2); // foreach (Models.ClsSc_MouldRepairInBillMain oItem in lsmain) // { // if (refSav == "Add") // { // //忮巿¯å¦éå¤ // if (BillNew01.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 (BillOld01.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; // } // } // //oItem.HMaker = ""; // UserName = oItem.HMaker; //å¶å人 // oItem.HBillType = "3826"; // oItem.HBillSubType = "3826"; // //oItem.HBillNo = ""; //åæ®å· // //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --æ¥æ // //oItem.HInnerBillNo = ""; // --å é¨åæ®å· // oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); // oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); // //oItem.HEquipID = 0; //设å¤ID(Gy_EquipMent) // //oItem.HPeriod = 0; // //oItem.HCheckBeginDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); // --ç»´ä¿®æ¥æ // //oItem.HCheckResult = ""; //éªæ¶ç»è®º--(æ£å¸¸ï¼å¼å¸¸) // //oItem.HEmpID = 0; //éªæ¶äºº(Gy_Employee) // //oItem.HManagerID = 0; //è´è´£äºº(Gy_Employee) // //oItem.HDeptID = 0; //éªæ¶é¨é¨(Gy_Department) // //oItem.HExplanation = ""; //æè¦(æ éæè¿°) // //oItem.HRemark = ""; //夿³¨ // //oItem.HMainSourceInterID = oItem.HInterID; // //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); // if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") // { // 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("\\", ""); // msg3 = msg3.Replace("\n", ""); //\n // //msg2 = msg2.Replace("'", "â"); // List<Models.ClsSc_MouldRepairInBillSub> ls = new List<Models.ClsSc_MouldRepairInBillSub>(); // ls = oListModels.getObjectByJson_Gy_MouldRepairInHouseBillSub(msg3); // int i = 0; // foreach (Models.ClsSc_MouldRepairInBillSub oItemSub in ls) // { // i++; // oItemSub.HEntryID = i; // //oItemSub.HRepairCheckID = 0; //éªæ¶é¡¹ç®ID // //oItemSub.HRepairCheckContent = ""; //éªæ¶å 容 // //oItemSub.HManagerID = 0; //è´è´£äººID // //oItemSub.HCloseMan = ""; //è¡å ³é // oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); // oItemSub.HCloseType = false; //å ³éç±»å // //oItemSub.HRemark = ""; //夿³¨ // oItemSub.HSourceInterID = 0; // æºå主å ç // oItemSub.HSourceEntryID = 0; //æºååå ç // //oItemSub.HSourceBillNo = ""; //æºååå· // //oItemSub.HSourceBillType = ""; //æºåç±»å // //oItemSub.HRelationQty = 0; //å ³èæ°é // //oItemSub.HRelationMoney = 0; //å ³èéé¢ // //oItemSub.HRepairID = 0; //ç»´ä¿®é¡¹ç® // //oItemSub.HRepairExplanation =""; //ç»´ä¿®è¦æ± // //oItemSub.HMoney = 0; //ç»´ä¿®è´¹ç¨ // oBill.DetailColl.Add(oItemSub); // } // //ä¿å // //ä¿å宿¯åå¤ç // bool bResult; // if (oBill.omodel.HInterID == 0) // { // // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); // //ä¿åæå // string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'in','{oBill.omodel.HInterID.ToString()}' "); // oCn.RunProc(sql); // } // else // { // bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); // //ä¿®æ¹æå // //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID 1,{oBill.omodel.HInterID.ToString()},' ' "); // string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID "); // oCn.RunProc(sql); // } // if (bResult) // { // objJsonResult.code = "0"; // objJsonResult.count = 1; // objJsonResult.Message = "ä¿åæåï¼"; // //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); // 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 å¨å ·æ¹å¶å ¥åºåä¿å/ç¼è¾ 20240702 /// <summary> /// ä¿åå¨å ·æ¹å¶å ¥åºå /// </summary> @@ -4328,176 +4531,137 @@ [HttpPost] public object SaveGetMouldRepairInBillList([FromBody] JObject msg) { DAL.ClsSc_MouldRepairInBill oBill = new DAL.ClsSc_MouldRepairInBill(); 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(); string UserName = ""; string s = ""; ListModels oListModels = new ListModels(); string sMainStr = sArray[0].ToString(); //ä¸»è¡¨æ°æ® string sSubStr = sArray[1].ToString(); //åè¡¨æ°æ® string OperationType = sArray[2].ToString(); //æä½ç±»åï¼Addæ°å¢ãUpdateç¼è¾ï¼ string HMaker = sArray[3].ToString(); //å¶å人 try { //ç¼è¾æé if (!DBUtility.ClsPub.Security_Log("Sc_MouldRepairIn_SingleBill_Edit", 1, false, msg4)) //夿æé if (OperationType == "Add") { BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew; //夿æ°å¢æé if (!DBUtility.ClsPub.Security_Log("Sc_MouldRepairIn_SingleBill", 1, false, HMaker)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¨æ²¡æè¯¥æ¨¡åæ°å¢æé,请ä¸ç®¡çåèç³»ï¼"; objJsonResult.data = null; return objJsonResult; } } else { BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_Modify; //夿ç¼è¾æé if (!DBUtility.ClsPub.Security_Log("Sc_MouldRepairIn_SingleBill_Edit", 1, false, HMaker)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¨æ²¡æè¯¥æ¨¡åç¼è¾æé,请ä¸ç®¡çåèç³»ï¼"; objJsonResult.data = null; return objJsonResult; } } //表头èµå¼ sMainStr = sMainStr.Replace("\\", ""); sMainStr = sMainStr.Replace("\n", ""); sMainStr = "[" + sMainStr.ToString() + "]"; List<Model.ClsSc_MouldStockBillMain> lsmain = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldStockBillMain>>(sMainStr); foreach (Model.ClsSc_MouldStockBillMain oItem in lsmain) { //忮巿¯å¦éå¤ if (oBill.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, oItem.HInterID)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·éå¤ï¼ä¸å 许ä¿åï¼"; objJsonResult.data = null; return objJsonResult; } //夿ä¼è®¡ææ¯å¦åç string s = ""; int sYear = 0; int sPeriod = 0; if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(oItem.HDate, ref sYear, ref sPeriod, ref s) == false) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = s; objJsonResult.data = null; return objJsonResult; } oItem.HYear = sYear; oItem.HPeriod = sPeriod; DBUtility.ClsPub.CurUserName = oItem.HMaker; oBill.omodel = oItem; } //表ä½èµå¼ //æ },{æ¥æåæ°ç» //廿ãåã sSubStr = sSubStr.Substring(1, sSubStr.Length - 2); sSubStr = sSubStr.Replace("\\", ""); sSubStr = sSubStr.Replace("\n", ""); sSubStr = "[" + sSubStr.ToString() + "]"; List<Model.ClsSc_MouldStockBillSub> ls = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldStockBillSub>>(sSubStr); int i = 0; foreach (Model.ClsSc_MouldStockBillSub oItemSub in ls) { i++; oItemSub.HEntryID = i; oBill.DetailColl.Add(oItemSub); } string sErrMsg = ""; bool bResult; //è·åç³»ç»åæ° if (oSystemParameter.ShowBill(ref sErrMsg) == true) { //ä¿å if (OperationType == "Add") //æ°å¢ä¿å { bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); if (oSystemParameter.omodel.WMS_CampanyName == "åç»´å°") //ç³»ç»åæ° å®¢æ·å®å¶ååç§° 空ç½ä¸ºéç¨ { //ä¿®æ¹å¨å ·æ¡£æ¡ä½ç½® string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'in','{oBill.omodel.HInterID.ToString()}' "); oCn.RunProc(sql); } } else //ç¼è¾ä¿å { bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); if (oSystemParameter.omodel.WMS_CampanyName == "åç»´å°") //ç³»ç»åæ° å®¢æ·å®å¶ååç§° 空ç½ä¸ºéç¨ { //ä¿®æ¹å¨å ·æ¡£æ¡ä½ç½® string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID "); oCn.RunProc(sql); } } } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ ä¿åæéï¼"; objJsonResult.Message = "è·åç³»ç»åæ°å¤±è´¥ï¼ " + sErrMsg; objJsonResult.data = null; return objJsonResult; } DLL.ClsSc_MouldRepairInBill oBill = new DLL.ClsSc_MouldRepairInBill(); List<Models.ClsSc_MouldRepairInBillMain> lsmain = new List<Models.ClsSc_MouldRepairInBillMain>(); msg2 = msg2.Replace("\\", ""); msg2 = msg2.Replace("\n", ""); //\n lsmain = oListModels.getObjectByJson_Gy_MouldRepairInHouseBillMain(msg2); foreach (Models.ClsSc_MouldRepairInBillMain oItem in lsmain) { if (refSav == "Add") { //忮巿¯å¦éå¤ if (BillNew01.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 (BillOld01.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; } } //oItem.HMaker = ""; UserName = oItem.HMaker; //å¶å人 oItem.HBillType = "3826"; oItem.HBillSubType = "3826"; //oItem.HBillNo = ""; //åæ®å· //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --æ¥æ //oItem.HInnerBillNo = ""; // --å é¨åæ®å· oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); //oItem.HEquipID = 0; //设å¤ID(Gy_EquipMent) //oItem.HPeriod = 0; //oItem.HCheckBeginDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); // --ç»´ä¿®æ¥æ //oItem.HCheckResult = ""; //éªæ¶ç»è®º--(æ£å¸¸ï¼å¼å¸¸) //oItem.HEmpID = 0; //éªæ¶äºº(Gy_Employee) //oItem.HManagerID = 0; //è´è´£äºº(Gy_Employee) //oItem.HDeptID = 0; //éªæ¶é¨é¨(Gy_Department) //oItem.HExplanation = ""; //æè¦(æ éæè¿°) //oItem.HRemark = ""; //夿³¨ //oItem.HMainSourceInterID = oItem.HInterID; //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") { 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("\\", ""); msg3 = msg3.Replace("\n", ""); //\n //msg2 = msg2.Replace("'", "â"); List<Models.ClsSc_MouldRepairInBillSub> ls = new List<Models.ClsSc_MouldRepairInBillSub>(); ls = oListModels.getObjectByJson_Gy_MouldRepairInHouseBillSub(msg3); int i = 0; foreach (Models.ClsSc_MouldRepairInBillSub oItemSub in ls) { i++; oItemSub.HEntryID = i; //oItemSub.HRepairCheckID = 0; //éªæ¶é¡¹ç®ID //oItemSub.HRepairCheckContent = ""; //éªæ¶å 容 //oItemSub.HManagerID = 0; //è´è´£äººID //oItemSub.HCloseMan = ""; //è¡å ³é oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); oItemSub.HCloseType = false; //å ³éç±»å //oItemSub.HRemark = ""; //夿³¨ oItemSub.HSourceInterID = 0; // æºå主å ç oItemSub.HSourceEntryID = 0; //æºååå ç //oItemSub.HSourceBillNo = ""; //æºååå· //oItemSub.HSourceBillType = ""; //æºåç±»å //oItemSub.HRelationQty = 0; //å ³èæ°é //oItemSub.HRelationMoney = 0; //å ³èéé¢ //oItemSub.HRepairID = 0; //ç»´ä¿®é¡¹ç® //oItemSub.HRepairExplanation =""; //ç»´ä¿®è¦æ± //oItemSub.HMoney = 0; //ç»´ä¿®è´¹ç¨ oBill.DetailColl.Add(oItemSub); } //ä¿å //ä¿å宿¯åå¤ç bool bResult; if (oBill.omodel.HInterID == 0) { // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); //ä¿åæå string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'in','{oBill.omodel.HInterID.ToString()}' "); oCn.RunProc(sql); } else { bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); //ä¿®æ¹æå //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID 1,{oBill.omodel.HInterID.ToString()},' ' "); string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID "); oCn.RunProc(sql); } if (bResult) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "ä¿åæåï¼"; //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); objJsonResult.data = 1; objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; //æåï¼ objJsonResult.data = null; return objJsonResult; } else @@ -4505,7 +4669,7 @@ objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = 1; objJsonResult.data = null; return objJsonResult; } } @@ -4513,8 +4677,8 @@ { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); objJsonResult.data = 1; objJsonResult.Message = "ä¿å失败ï¼" + e.Message; objJsonResult.data = null; return objJsonResult; } } WebAPI/Controllers/Sc_MouldOtherInBillController.cs
@@ -18,6 +18,8 @@ public DataSet ds = new DataSet(); public WebServer webserver = new WebServer(); public SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); DAL.ClsSc_MouldOtherInBill oBill = new DAL.ClsSc_MouldOtherInBill(); public DAL.ClsSc_MouldScrapInBill BillNew0 = new DAL.ClsSc_MouldScrapInBill(); //æ¨¡å ·æ¥åºå ¥åºå¯¹åºåæ®ç±» public DAL.ClsSc_MouldScrapInBill BillOld0 = new DAL.ClsSc_MouldScrapInBill(); //æ¨¡å ·æ¥åºå ¥åºå¯¹åºåæ®ç±» @@ -202,7 +204,158 @@ } #endregion #region å¨å ·å ¶ä»å ¥åºåä¿å/ç¼è¾ #region å¨å ·å ¶ä»å ¥åºåä¿å/ç¼è¾ 20240702ä½åº /// <summary> /// ä¿åæ¨¡å ·é¢ç¨å /// </summary> /// <param name="msg"></param> /// <returns></returns> //[Route("Sc_MouldOtherInBill/SaveGetMouldOtherInBillList")] //[HttpPost] //public object SaveGetMouldOtherInBillList([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 msg4 = sArray[2].ToString(); // string UserName = ""; // ListModels oListModels = new ListModels(); // try // { // //ç¼è¾æé // if (!DBUtility.ClsPub.Security_Log("Sc_MouldOtherInBill_Edit", 1, false, msg4)) // { // objJsonResult.code = "0"; // objJsonResult.count = 0; // objJsonResult.Message = "æ ä¿åæéï¼"; // objJsonResult.data = null; // return objJsonResult; // } // DLL.ClsSc_MouldOtherInBill oBill = new DLL.ClsSc_MouldOtherInBill(); // List<Model.ClsSc_MouldOtherInBillMain> lsmain = new List<Model.ClsSc_MouldOtherInBillMain>(); // msg2 = msg2.Replace("\\", ""); // msg2 = msg2.Replace("\n", ""); //\n // lsmain = oListModels.getObjectByJson_Sc_MouldOtherInBillMain(msg2); // foreach (Model.ClsSc_MouldOtherInBillMain oItem in lsmain) // { // //oItem.HMaker = ""; // UserName = oItem.HMaker; //å¶å人 // oItem.HBillType = "3841"; // oItem.HBillSubType = "3841"; // //oItem.HBillNo = ""; //åæ®å· // //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --æ¥æ // //oItem.HInnerBillNo = ""; // --å é¨åæ®å· // oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); // oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); // //oItem.HEquipID = 0; //设å¤ID(Gy_EquipMent) // //oItem.HPeriod = 0; // //oItem.HCheckBeginDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); // --ç»´ä¿®æ¥æ // //oItem.HCheckResult = ""; //éªæ¶ç»è®º--(æ£å¸¸ï¼å¼å¸¸) // //oItem.HEmpID = 0; //éªæ¶äºº(Gy_Employee) // //oItem.HManagerID = 0; //è´è´£äºº(Gy_Employee) // //oItem.HDeptID = 0; //éªæ¶é¨é¨(Gy_Department) // //oItem.HExplanation = ""; //æè¦(æ éæè¿°) // //oItem.HRemark = ""; //夿³¨ // //oItem.HMainSourceInterID = oItem.HInterID; // //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); // if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") // { // 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("\\", ""); // msg3 = msg3.Replace("\n", ""); //\n // //msg2 = msg2.Replace("'", "â"); // List<Model.ClsSc_MouldStockBillSub> ls = new List<Model.ClsSc_MouldStockBillSub>(); // ls = oListModels.getObjectByJson_Gy_MouldStockBillSub(msg3); // int i = 0; // foreach (Model.ClsSc_MouldStockBillSub oItemSub in ls) // { // i++; // oItemSub.HEntryID = i; // //oItemSub.HRepairCheckID = 0; //éªæ¶é¡¹ç®ID // //oItemSub.HRepairCheckContent = ""; //éªæ¶å 容 // //oItemSub.HManagerID = 0; //è´è´£äººID // //oItemSub.HCloseMan = ""; //è¡å ³é // oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); // oItemSub.HCloseType = false; //å ³éç±»å // //oItemSub.HRemark = ""; //夿³¨ // oItemSub.HSourceInterID = 0; // æºå主å ç // oItemSub.HSourceEntryID = 0; //æºååå ç // //oItemSub.HSourceBillNo = ""; //æºååå· // //oItemSub.HSourceBillType = ""; //æºåç±»å // //oItemSub.HRelationQty = 0; //å ³èæ°é // //oItemSub.HRelationMoney = 0; //å ³èéé¢ // //oItemSub.HRepairID = 0; //ç»´ä¿®é¡¹ç® // //oItemSub.HRepairExplanation =""; //ç»´ä¿®è¦æ± // //oItemSub.HMoney = 0; //ç»´ä¿®è´¹ç¨ // oBill.DetailColl.Add(oItemSub); // } // //ä¿å // //ä¿å宿¯åå¤ç // bool bResult; // if (oBill.omodel.HInterID == 0) // { // // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); // string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'in','{oBill.omodel.HInterID.ToString()}' "); // oCn.RunProc(sql); // } // else // { // bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); // //ä¿®æ¹æå // //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID 1,{oBill.omodel.HInterID.ToString()},' ' "); // string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID "); // oCn.RunProc(sql); // } // if (bResult) // { // objJsonResult.code = "0"; // objJsonResult.count = 1; // objJsonResult.Message = "ä¿åæåï¼"; // //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); // 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 å¨å ·å ¶ä»å ¥åºåä¿å/ç¼è¾ 20240702 /// <summary> /// ä¿åæ¨¡å ·é¢ç¨å /// </summary> @@ -215,122 +368,121 @@ 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 msg4 = sArray[2].ToString(); string UserName = ""; ListModels oListModels = new ListModels(); string sMainStr = sArray[0].ToString(); //ä¸»è¡¨æ°æ® string sSubStr = sArray[1].ToString(); //åè¡¨æ°æ® string HMaker = sArray[2].ToString(); //å¶å人 try { //ç¼è¾æé if (!DBUtility.ClsPub.Security_Log("Sc_MouldOtherInBill_Edit", 1, false, msg4)) //夿æé if (!DBUtility.ClsPub.Security_Log("Sc_MouldOtherInBill_Edit", 1, false, HMaker)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ ä¿åæéï¼"; objJsonResult.Message = "æ¨æ²¡æè¯¥æ¨¡åæ°å¢/ç¼è¾æé,请ä¸ç®¡çåèç³»ï¼"; objJsonResult.data = null; return objJsonResult; } //表头èµå¼ sMainStr = sMainStr.Replace("\\", ""); sMainStr = sMainStr.Replace("\n", ""); sMainStr = "[" + sMainStr.ToString() + "]"; List<Model.ClsSc_MouldStockBillMain> lsmain = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldStockBillMain>>(sMainStr); foreach (Model.ClsSc_MouldStockBillMain oItem in lsmain) { if (oItem.HInterID == 0) { BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew; } else { BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_Modify; } //忮巿¯å¦éå¤ if (oBill.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, oItem.HInterID)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·éå¤ï¼ä¸å 许ä¿åï¼"; objJsonResult.data = null; return objJsonResult; } //夿ä¼è®¡ææ¯å¦åç string s = ""; int sYear = 0; int sPeriod = 0; if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(oItem.HDate, ref sYear, ref sPeriod, ref s) == false) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = s; objJsonResult.data = null; return objJsonResult; } oItem.HYear = sYear; oItem.HPeriod = sPeriod; DBUtility.ClsPub.CurUserName = oItem.HMaker; oBill.omodel = oItem; } //表ä½èµå¼ //æ },{æ¥æåæ°ç» //廿ãåã sSubStr = sSubStr.Substring(1, sSubStr.Length - 2); sSubStr = sSubStr.Replace("\\", ""); sSubStr = sSubStr.Replace("\n", ""); sSubStr = "[" + sSubStr.ToString() + "]"; List<Model.ClsSc_MouldStockBillSub> ls = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldStockBillSub>>(sSubStr); int i = 0; foreach (Model.ClsSc_MouldStockBillSub oItemSub in ls) { i++; oItemSub.HEntryID = i; oBill.DetailColl.Add(oItemSub); } string sErrMsg = ""; bool bResult; //è·åç³»ç»åæ° if (oSystemParameter.ShowBill(ref sErrMsg) == true) { //ä¿å if (oBill.omodel.HInterID == 0) //æ°å¢ä¿å { bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); if (oSystemParameter.omodel.WMS_CampanyName == "åç»´å°") //ç³»ç»åæ° å®¢æ·å®å¶ååç§° 空ç½ä¸ºéç¨ { //ä¿®æ¹å¨å ·æ¡£æ¡ä½ç½® string sql1 = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'in','{oBill.omodel.HInterID.ToString()}' "); oCn.RunProc(sql1); } } else //ç¼è¾ä¿å { bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); if (oSystemParameter.omodel.WMS_CampanyName == "åç»´å°") //ç³»ç»åæ° å®¢æ·å®å¶ååç§° 空ç½ä¸ºéç¨ { //ä¿®æ¹å¨å ·æ¡£æ¡ä½ç½® string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID "); oCn.RunProc(sql); } } } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "è·åç³»ç»åæ°å¤±è´¥ï¼ " + sErrMsg; objJsonResult.data = null; return objJsonResult; } DLL.ClsSc_MouldOtherInBill oBill = new DLL.ClsSc_MouldOtherInBill(); List<Model.ClsSc_MouldOtherInBillMain> lsmain = new List<Model.ClsSc_MouldOtherInBillMain>(); msg2 = msg2.Replace("\\", ""); msg2 = msg2.Replace("\n", ""); //\n lsmain = oListModels.getObjectByJson_Sc_MouldOtherInBillMain(msg2); foreach (Model.ClsSc_MouldOtherInBillMain oItem in lsmain) { //oItem.HMaker = ""; UserName = oItem.HMaker; //å¶å人 oItem.HBillType = "3841"; oItem.HBillSubType = "3841"; //oItem.HBillNo = ""; //åæ®å· //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --æ¥æ //oItem.HInnerBillNo = ""; // --å é¨åæ®å· oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); //oItem.HEquipID = 0; //设å¤ID(Gy_EquipMent) //oItem.HPeriod = 0; //oItem.HCheckBeginDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); // --ç»´ä¿®æ¥æ //oItem.HCheckResult = ""; //éªæ¶ç»è®º--(æ£å¸¸ï¼å¼å¸¸) //oItem.HEmpID = 0; //éªæ¶äºº(Gy_Employee) //oItem.HManagerID = 0; //è´è´£äºº(Gy_Employee) //oItem.HDeptID = 0; //éªæ¶é¨é¨(Gy_Department) //oItem.HExplanation = ""; //æè¦(æ éæè¿°) //oItem.HRemark = ""; //夿³¨ //oItem.HMainSourceInterID = oItem.HInterID; //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") { 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("\\", ""); msg3 = msg3.Replace("\n", ""); //\n //msg2 = msg2.Replace("'", "â"); List<Model.ClsSc_MouldStockBillSub> ls = new List<Model.ClsSc_MouldStockBillSub>(); ls = oListModels.getObjectByJson_Gy_MouldStockBillSub(msg3); int i = 0; foreach (Model.ClsSc_MouldStockBillSub oItemSub in ls) { i++; oItemSub.HEntryID = i; //oItemSub.HRepairCheckID = 0; //éªæ¶é¡¹ç®ID //oItemSub.HRepairCheckContent = ""; //éªæ¶å 容 //oItemSub.HManagerID = 0; //è´è´£äººID //oItemSub.HCloseMan = ""; //è¡å ³é oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); oItemSub.HCloseType = false; //å ³éç±»å //oItemSub.HRemark = ""; //夿³¨ oItemSub.HSourceInterID = 0; // æºå主å ç oItemSub.HSourceEntryID = 0; //æºååå ç //oItemSub.HSourceBillNo = ""; //æºååå· //oItemSub.HSourceBillType = ""; //æºåç±»å //oItemSub.HRelationQty = 0; //å ³èæ°é //oItemSub.HRelationMoney = 0; //å ³èéé¢ //oItemSub.HRepairID = 0; //ç»´ä¿®é¡¹ç® //oItemSub.HRepairExplanation =""; //ç»´ä¿®è¦æ± //oItemSub.HMoney = 0; //ç»´ä¿®è´¹ç¨ oBill.DetailColl.Add(oItemSub); } //ä¿å //ä¿å宿¯åå¤ç bool bResult; if (oBill.omodel.HInterID == 0) { // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'in','{oBill.omodel.HInterID.ToString()}' "); oCn.RunProc(sql); } else { bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); //ä¿®æ¹æå //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID 1,{oBill.omodel.HInterID.ToString()},' ' "); string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID "); oCn.RunProc(sql); } if (bResult) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "ä¿åæåï¼"; //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); objJsonResult.data = 1; objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; //æåï¼ objJsonResult.data = null; return objJsonResult; } else @@ -338,7 +490,7 @@ objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = 1; objJsonResult.data = null; return objJsonResult; } } @@ -346,8 +498,8 @@ { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); objJsonResult.data = 1; objJsonResult.Message = "ä¿å失败ï¼" + e.Message; objJsonResult.data = null; return objJsonResult; } } WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
@@ -22,6 +22,7 @@ public SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); public DAL.ClsSc_ICMOBill BillOld = new DAL.ClsSc_ICMOBill(); SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); public DAL.ClsSc_MouldScrapInBill BillNew0 = new DAL.ClsSc_MouldScrapInBill(); //æ¨¡å ·æ¥åºå ¥åºå¯¹åºåæ®ç±» public DAL.ClsSc_MouldScrapInBill BillOld0 = new DAL.ClsSc_MouldScrapInBill(); //æ¨¡å ·æ¥åºå ¥åºå¯¹åºåæ®ç±» @@ -6979,7 +6980,208 @@ } #endregion #region æ¨¡å ·æ¥åºå ¥åºåä¿å/ç¼è¾ #region æ¨¡å ·æ¥åºå ¥åºåä¿å/ç¼è¾ 20240702ä½åº /// <summary> /// ä¿åæ¨¡å ·æ¥åºå ¥åºå /// </summary> /// <param name="msg"></param> /// <returns></returns> //[Route("Sc_MouldScrapInHouseBill/SaveGetMouldScrapInHouseBillList")] //[HttpPost] //public object SaveGetMouldScrapInHouseBillList([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(); // string UserName = ""; // string s = ""; // ListModels oListModels = new ListModels(); // try // { // //ç¼è¾æé // if (!DBUtility.ClsPub.Security_Log("Sc_MouldScrapRequestBill_Edit", 1, false, msg4)) // { // objJsonResult.code = "0"; // objJsonResult.count = 0; // objJsonResult.Message = "æ ä¿åæéï¼"; // objJsonResult.data = null; // return objJsonResult; // } // DLL.ClsSc_MouldScrapInBill oBill = new DLL.ClsSc_MouldScrapInBill(); // List<Models.ClsSc_MouldStockBillMain> lsmain = new List<Models.ClsSc_MouldStockBillMain>(); // msg2 = msg2.Replace("\\", ""); // msg2 = msg2.Replace("\n", ""); //\n // lsmain = oListModels.getObjectByJson_Gy_MouldScrapInHouseBillMain(msg2); // foreach (Models.ClsSc_MouldStockBillMain 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; // } // } // //oItem.HMaker = ""; // UserName = oItem.HMaker; //å¶å人 // oItem.HBillType = "3831"; // oItem.HBillSubType = "3831"; // //oItem.HBillNo = ""; //åæ®å· // //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --æ¥æ // //oItem.HInnerBillNo = ""; // --å é¨åæ®å· // oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); // oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); // //oItem.HEquipID = 0; //设å¤ID(Gy_EquipMent) // //oItem.HPeriod = 0; // //oItem.HCheckBeginDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); // --ç»´ä¿®æ¥æ // //oItem.HCheckResult = ""; //éªæ¶ç»è®º--(æ£å¸¸ï¼å¼å¸¸) // //oItem.HEmpID = 0; //éªæ¶äºº(Gy_Employee) // //oItem.HManagerID = 0; //è´è´£äºº(Gy_Employee) // //oItem.HDeptID = 0; //éªæ¶é¨é¨(Gy_Department) // //oItem.HExplanation = ""; //æè¦(æ éæè¿°) // //oItem.HRemark = ""; //夿³¨ // //oItem.HMainSourceInterID = oItem.HInterID; // //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); // if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") // { // 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("\\", ""); // msg3 = msg3.Replace("\n", ""); //\n // //msg2 = msg2.Replace("'", "â"); // List<Models.ClsSc_MouldStockBillSub> ls = new List<Models.ClsSc_MouldStockBillSub>(); // ls = oListModels.getObjectByJson_Gy_MouldScrapInHouseBillSub(msg3); // int i = 0; // foreach (Models.ClsSc_MouldStockBillSub oItemSub in ls) // { // i++; // oItemSub.HEntryID = i; // //oItemSub.HRepairCheckID = 0; //éªæ¶é¡¹ç®ID // //oItemSub.HRepairCheckContent = ""; //éªæ¶å 容 // //oItemSub.HManagerID = 0; //è´è´£äººID // //oItemSub.HCloseMan = ""; //è¡å ³é // oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); // oItemSub.HCloseType = false; //å ³éç±»å // //oItemSub.HRemark = ""; //夿³¨ // oItemSub.HSourceInterID = 0; // æºå主å ç // oItemSub.HSourceEntryID = 0; //æºååå ç // //oItemSub.HSourceBillNo = ""; //æºååå· // //oItemSub.HSourceBillType = ""; //æºåç±»å // //oItemSub.HRelationQty = 0; //å ³èæ°é // //oItemSub.HRelationMoney = 0; //å ³èéé¢ // //oItemSub.HRepairID = 0; //ç»´ä¿®é¡¹ç® // //oItemSub.HRepairExplanation =""; //ç»´ä¿®è¦æ± // //oItemSub.HMoney = 0; //ç»´ä¿®è´¹ç¨ // oBill.DetailColl.Add(oItemSub); // } // //ä¿å // //ä¿å宿¯åå¤ç // bool bResult; // if (oBill.omodel.HInterID == 0) // { // // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); // string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'in','{oBill.omodel.HInterID.ToString()}' "); // oCn.RunProc(sql); // } // else // { // bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); // //ä¿®æ¹æå // //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID 1,{oBill.omodel.HInterID.ToString()},' ' "); // string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID "); // oCn.RunProc(sql); // } // if (bResult) // { // objJsonResult.code = "0"; // objJsonResult.count = 1; // objJsonResult.Message = "ä¿åæåï¼"; // //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); // 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 æ¨¡å ·æ¥åºå ¥åºåä¿å/ç¼è¾ 20240702 /// <summary> /// ä¿åæ¨¡å ·æ¥åºå ¥åºå /// </summary> @@ -6989,175 +7191,137 @@ [HttpPost] public object SaveGetMouldScrapInHouseBillList([FromBody] JObject msg) { DAL.ClsSc_MouldScrapInBill oBill = new DAL.ClsSc_MouldScrapInBill(); 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(); string UserName = ""; string s = ""; ListModels oListModels = new ListModels(); string sMainStr = sArray[0].ToString(); //ä¸»è¡¨æ°æ® string sSubStr = sArray[1].ToString(); //åè¡¨æ°æ® string OperationType = sArray[2].ToString(); //æä½ç±»åï¼Addæ°å¢ãUpdateç¼è¾ï¼ string HMaker = sArray[3].ToString(); //å¶å人 try { //ç¼è¾æé if (!DBUtility.ClsPub.Security_Log("Sc_MouldScrapRequestBill_Edit", 1, false, msg4)) //夿æé if (OperationType == "Add") { BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew; //夿æ°å¢æé if (!DBUtility.ClsPub.Security_Log("Sc_MouldScrapRequestBill", 1, false, HMaker)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¨æ²¡æè¯¥æ¨¡åæ°å¢æé,请ä¸ç®¡çåèç³»ï¼"; objJsonResult.data = null; return objJsonResult; } } else { BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_Modify; //夿ç¼è¾æé if (!DBUtility.ClsPub.Security_Log("Sc_MouldScrapRequestBill_Edit", 1, false, HMaker)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¨æ²¡æè¯¥æ¨¡åç¼è¾æé,请ä¸ç®¡çåèç³»ï¼"; objJsonResult.data = null; return objJsonResult; } } //表头èµå¼ sMainStr = sMainStr.Replace("\\", ""); sMainStr = sMainStr.Replace("\n", ""); sMainStr = "[" + sMainStr.ToString() + "]"; List<Model.ClsSc_MouldStockBillMain> lsmain = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldStockBillMain>>(sMainStr); foreach (Model.ClsSc_MouldStockBillMain oItem in lsmain) { //忮巿¯å¦éå¤ if (oBill.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, oItem.HInterID)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·éå¤ï¼ä¸å 许ä¿åï¼"; objJsonResult.data = null; return objJsonResult; } //夿ä¼è®¡ææ¯å¦åç string s = ""; int sYear = 0; int sPeriod = 0; if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(oItem.HDate, ref sYear, ref sPeriod, ref s) == false) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = s; objJsonResult.data = null; return objJsonResult; } oItem.HYear = sYear; oItem.HPeriod = sPeriod; DBUtility.ClsPub.CurUserName = oItem.HMaker; oBill.omodel = oItem; } //表ä½èµå¼ //æ },{æ¥æåæ°ç» //廿ãåã sSubStr = sSubStr.Substring(1, sSubStr.Length - 2); sSubStr = sSubStr.Replace("\\", ""); sSubStr = sSubStr.Replace("\n", ""); sSubStr = "[" + sSubStr.ToString() + "]"; List<Model.ClsSc_MouldStockBillSub> ls = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldStockBillSub>>(sSubStr); int i = 0; foreach (Model.ClsSc_MouldStockBillSub oItemSub in ls) { i++; oItemSub.HEntryID = i; oBill.DetailColl.Add(oItemSub); } string sErrMsg = ""; bool bResult; //è·åç³»ç»åæ° if (oSystemParameter.ShowBill(ref sErrMsg) == true) { //ä¿å if (OperationType == "Add") //æ°å¢ä¿å { bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); if (oSystemParameter.omodel.WMS_CampanyName == "åç»´å°") //ç³»ç»åæ° å®¢æ·å®å¶ååç§° 空ç½ä¸ºéç¨ { //ä¿®æ¹å¨å ·æ¡£æ¡ä½ç½® string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'in','{oBill.omodel.HInterID.ToString()}' "); oCn.RunProc(sql); } } else //ç¼è¾ä¿å { bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); if (oSystemParameter.omodel.WMS_CampanyName == "åç»´å°") //ç³»ç»åæ° å®¢æ·å®å¶ååç§° 空ç½ä¸ºéç¨ { //ä¿®æ¹å¨å ·æ¡£æ¡ä½ç½® string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID "); oCn.RunProc(sql); } } } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ ä¿åæéï¼"; objJsonResult.Message = "è·åç³»ç»åæ°å¤±è´¥ï¼ " + sErrMsg; objJsonResult.data = null; return objJsonResult; } DLL.ClsSc_MouldScrapInBill oBill = new DLL.ClsSc_MouldScrapInBill(); List<Models.ClsSc_MouldStockBillMain> lsmain = new List<Models.ClsSc_MouldStockBillMain>(); msg2 = msg2.Replace("\\", ""); msg2 = msg2.Replace("\n", ""); //\n lsmain = oListModels.getObjectByJson_Gy_MouldScrapInHouseBillMain(msg2); foreach (Models.ClsSc_MouldStockBillMain 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; } } //oItem.HMaker = ""; UserName = oItem.HMaker; //å¶å人 oItem.HBillType = "3831"; oItem.HBillSubType = "3831"; //oItem.HBillNo = ""; //åæ®å· //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --æ¥æ //oItem.HInnerBillNo = ""; // --å é¨åæ®å· oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); //oItem.HEquipID = 0; //设å¤ID(Gy_EquipMent) //oItem.HPeriod = 0; //oItem.HCheckBeginDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); // --ç»´ä¿®æ¥æ //oItem.HCheckResult = ""; //éªæ¶ç»è®º--(æ£å¸¸ï¼å¼å¸¸) //oItem.HEmpID = 0; //éªæ¶äºº(Gy_Employee) //oItem.HManagerID = 0; //è´è´£äºº(Gy_Employee) //oItem.HDeptID = 0; //éªæ¶é¨é¨(Gy_Department) //oItem.HExplanation = ""; //æè¦(æ éæè¿°) //oItem.HRemark = ""; //夿³¨ //oItem.HMainSourceInterID = oItem.HInterID; //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") { 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("\\", ""); msg3 = msg3.Replace("\n", ""); //\n //msg2 = msg2.Replace("'", "â"); List<Models.ClsSc_MouldStockBillSub> ls = new List<Models.ClsSc_MouldStockBillSub>(); ls = oListModels.getObjectByJson_Gy_MouldScrapInHouseBillSub(msg3); int i = 0; foreach (Models.ClsSc_MouldStockBillSub oItemSub in ls) { i++; oItemSub.HEntryID = i; //oItemSub.HRepairCheckID = 0; //éªæ¶é¡¹ç®ID //oItemSub.HRepairCheckContent = ""; //éªæ¶å 容 //oItemSub.HManagerID = 0; //è´è´£äººID //oItemSub.HCloseMan = ""; //è¡å ³é oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); oItemSub.HCloseType = false; //å ³éç±»å //oItemSub.HRemark = ""; //夿³¨ oItemSub.HSourceInterID = 0; // æºå主å ç oItemSub.HSourceEntryID = 0; //æºååå ç //oItemSub.HSourceBillNo = ""; //æºååå· //oItemSub.HSourceBillType = ""; //æºåç±»å //oItemSub.HRelationQty = 0; //å ³èæ°é //oItemSub.HRelationMoney = 0; //å ³èéé¢ //oItemSub.HRepairID = 0; //ç»´ä¿®é¡¹ç® //oItemSub.HRepairExplanation =""; //ç»´ä¿®è¦æ± //oItemSub.HMoney = 0; //ç»´ä¿®è´¹ç¨ oBill.DetailColl.Add(oItemSub); } //ä¿å //ä¿å宿¯åå¤ç bool bResult; if (oBill.omodel.HInterID == 0) { // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'in','{oBill.omodel.HInterID.ToString()}' "); oCn.RunProc(sql); } else { bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); //ä¿®æ¹æå //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID 1,{oBill.omodel.HInterID.ToString()},' ' "); string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID "); oCn.RunProc(sql); } if (bResult) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "ä¿åæåï¼"; //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); objJsonResult.data = 1; objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; //æåï¼ objJsonResult.data = null; return objJsonResult; } else @@ -7165,7 +7329,7 @@ objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = 1; objJsonResult.data = null; return objJsonResult; } } @@ -7173,8 +7337,8 @@ { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); objJsonResult.data = 1; objJsonResult.Message = "ä¿å失败ï¼" + e.Message; objJsonResult.data = null; return objJsonResult; } } @@ -7443,7 +7607,158 @@ } #endregion #region æ¨¡å ·å¤çåºåºåä¿å/ç¼è¾ #region æ¨¡å ·å¤çåºåºåä¿å/ç¼è¾ 20240702ä½åº /// <summary> /// ä¿åæ¨¡å ·å¤çåºåºå /// </summary> /// <param name="msg"></param> /// <returns></returns> //[Route("Sc_MouldScrapOutHouseBill/SaveGetMouldScrapOutHouseBillList")] //[HttpPost] //public object SaveGetMouldScrapOutHouseBillList([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 msg4 = sArray[2].ToString(); // string UserName = ""; // ListModels oListModels = new ListModels(); // try // { // //ç¼è¾æé // if (!DBUtility.ClsPub.Security_Log("Sc_MouldScrapOutBill_Edit", 1, false, msg4)) // { // objJsonResult.code = "0"; // objJsonResult.count = 0; // objJsonResult.Message = "æ ä¿åæéï¼"; // objJsonResult.data = null; // return objJsonResult; // } // DLL.ClsSc_MouldScrapOutBill oBill = new DLL.ClsSc_MouldScrapOutBill(); // List<Model.ClsSc_MouldStockBillMain> lsmain = new List<Model.ClsSc_MouldStockBillMain>(); // msg2 = msg2.Replace("\\", ""); // msg2 = msg2.Replace("\n", ""); //\n // lsmain = oListModels.getObjectByJson_Gy_MouldScrapOutHouseBillMain(msg2); // foreach (Model.ClsSc_MouldStockBillMain oItem in lsmain) // { // //oItem.HMaker = ""; // UserName = oItem.HMaker; //å¶å人 // oItem.HBillType = "3832"; // oItem.HBillSubType = "3832"; // //oItem.HBillNo = ""; //åæ®å· // //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --æ¥æ // //oItem.HInnerBillNo = ""; // --å é¨åæ®å· // oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); // oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); // //oItem.HEquipID = 0; //设å¤ID(Gy_EquipMent) // //oItem.HPeriod = 0; // //oItem.HCheckBeginDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); // --ç»´ä¿®æ¥æ // //oItem.HCheckResult = ""; //éªæ¶ç»è®º--(æ£å¸¸ï¼å¼å¸¸) // //oItem.HEmpID = 0; //éªæ¶äºº(Gy_Employee) // //oItem.HManagerID = 0; //è´è´£äºº(Gy_Employee) // //oItem.HDeptID = 0; //éªæ¶é¨é¨(Gy_Department) // //oItem.HExplanation = ""; //æè¦(æ éæè¿°) // //oItem.HRemark = ""; //夿³¨ // //oItem.HMainSourceInterID = oItem.HInterID; // //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); // if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") // { // 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("\\", ""); // msg3 = msg3.Replace("\n", ""); //\n // //msg2 = msg2.Replace("'", "â"); // List<Model.ClsSc_MouldStockBillSub> ls = new List<Model.ClsSc_MouldStockBillSub>(); // ls = oListModels.getObjectByJson_Gy_MouldScrapOutHouseBillSub(msg3); // int i = 0; // foreach (Model.ClsSc_MouldStockBillSub oItemSub in ls) // { // i++; // oItemSub.HEntryID = i; // //oItemSub.HRepairCheckID = 0; //éªæ¶é¡¹ç®ID // //oItemSub.HRepairCheckContent = ""; //éªæ¶å 容 // //oItemSub.HManagerID = 0; //è´è´£äººID // //oItemSub.HCloseMan = ""; //è¡å ³é // oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); // oItemSub.HCloseType = false; //å ³éç±»å // //oItemSub.HRemark = ""; //夿³¨ // oItemSub.HSourceInterID = 0; // æºå主å ç // oItemSub.HSourceEntryID = 0; //æºååå ç // //oItemSub.HSourceBillNo = ""; //æºååå· // //oItemSub.HSourceBillType = ""; //æºåç±»å // //oItemSub.HRelationQty = 0; //å ³èæ°é // //oItemSub.HRelationMoney = 0; //å ³èéé¢ // //oItemSub.HRepairID = 0; //ç»´ä¿®é¡¹ç® // //oItemSub.HRepairExplanation =""; //ç»´ä¿®è¦æ± // //oItemSub.HMoney = 0; //ç»´ä¿®è´¹ç¨ // oBill.DetailColl.Add(oItemSub); // } // //ä¿å // //ä¿å宿¯åå¤ç // bool bResult; // if (oBill.omodel.HInterID == 0) // { // // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); // string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'out','{oBill.omodel.HInterID.ToString()}' "); // oCn.RunProc(sql); // } // else // { // bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); // //ä¿®æ¹æå // //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID 1,{oBill.omodel.HInterID.ToString()},' ' "); // string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID "); // oCn.RunProc(sql); // } // if (bResult) // { // objJsonResult.code = "0"; // objJsonResult.count = 1; // objJsonResult.Message = "ä¿åæåï¼"; // //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); // 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 æ¨¡å ·å¤çåºåºåä¿å/ç¼è¾ 20240702 /// <summary> /// ä¿åæ¨¡å ·å¤çåºåºå /// </summary> @@ -7453,125 +7768,126 @@ [HttpPost] public object SaveGetMouldScrapOutHouseBillList([FromBody] JObject msg) { DAL.ClsSc_MouldScrapOutBill oBill = new DAL.ClsSc_MouldScrapOutBill(); 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 msg4 = sArray[2].ToString(); string UserName = ""; ListModels oListModels = new ListModels(); string sMainStr = sArray[0].ToString(); //ä¸»è¡¨æ°æ® string sSubStr = sArray[1].ToString(); //åè¡¨æ°æ® string HMaker = sArray[2].ToString(); //å¶å人 try { //ç¼è¾æé if (!DBUtility.ClsPub.Security_Log("Sc_MouldScrapOutBill_Edit", 1, false, msg4)) if (!DBUtility.ClsPub.Security_Log("Sc_MouldScrapOutBill_Edit", 1, false, HMaker)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ ä¿åæéï¼"; objJsonResult.Message = "æ¨æ²¡æè¯¥æ¨¡åæ°å¢/ç¼è¾æé,请ä¸ç®¡çåèç³»ï¼"; objJsonResult.data = null; return objJsonResult; } //表头èµå¼ sMainStr = sMainStr.Replace("\\", ""); sMainStr = sMainStr.Replace("\n", ""); sMainStr = "[" + sMainStr.ToString() + "]"; List<Model.ClsSc_MouldStockBillMain> lsmain = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldStockBillMain>>(sMainStr); foreach (Model.ClsSc_MouldStockBillMain oItem in lsmain) { if (oItem.HInterID == 0) { BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew; } else { BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_Modify; } //忮巿¯å¦éå¤ if (oBill.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, oItem.HInterID)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·éå¤ï¼ä¸å 许ä¿åï¼"; objJsonResult.data = null; return objJsonResult; } //夿ä¼è®¡ææ¯å¦åç string s = ""; int sYear = 0; int sPeriod = 0; if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(oItem.HDate, ref sYear, ref sPeriod, ref s) == false) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = s; objJsonResult.data = null; return objJsonResult; } oItem.HYear = sYear; oItem.HPeriod = sPeriod; DBUtility.ClsPub.CurUserName = oItem.HMaker; oBill.omodel = oItem; } //表ä½èµå¼ //æ },{æ¥æåæ°ç» //廿ãåã sSubStr = sSubStr.Substring(1, sSubStr.Length - 2); sSubStr = sSubStr.Replace("\\", ""); sSubStr = sSubStr.Replace("\n", ""); sSubStr = "[" + sSubStr.ToString() + "]"; List<Model.ClsSc_MouldStockBillSub> ls = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldStockBillSub>>(sSubStr); int i = 0; foreach (Model.ClsSc_MouldStockBillSub oItemSub in ls) { i++; oItemSub.HEntryID = i; oBill.DetailColl.Add(oItemSub); } string sErrMsg = ""; bool bResult; //è·åç³»ç»åæ° if (oSystemParameter.ShowBill(ref sErrMsg) == true) { //ä¿å if (oBill.omodel.HInterID == 0) //æ°å¢ä¿å { bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); if (oSystemParameter.omodel.WMS_CampanyName == "åç»´å°") //ç³»ç»åæ° å®¢æ·å®å¶ååç§° 空ç½ä¸ºéç¨ { //ä¿®æ¹å¨å ·æ¡£æ¡ä½ç½® string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'out','{oBill.omodel.HInterID.ToString()}' "); oCn.RunProc(sql); } } else //ç¼è¾ä¿å { bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); if (oSystemParameter.omodel.WMS_CampanyName == "åç»´å°") //ç³»ç»åæ° å®¢æ·å®å¶ååç§° 空ç½ä¸ºéç¨ { //ä¿®æ¹å¨å ·æ¡£æ¡ä½ç½® string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID "); oCn.RunProc(sql); } } } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "è·åç³»ç»åæ°å¤±è´¥ï¼ " + sErrMsg; objJsonResult.data = null; return objJsonResult; } DLL.ClsSc_MouldScrapOutBill oBill = new DLL.ClsSc_MouldScrapOutBill(); List<Model.ClsSc_MouldStockBillMain> lsmain = new List<Model.ClsSc_MouldStockBillMain>(); msg2 = msg2.Replace("\\", ""); msg2 = msg2.Replace("\n", ""); //\n lsmain = oListModels.getObjectByJson_Gy_MouldScrapOutHouseBillMain(msg2); foreach (Model.ClsSc_MouldStockBillMain oItem in lsmain) { //oItem.HMaker = ""; UserName = oItem.HMaker; //å¶å人 oItem.HBillType = "3832"; oItem.HBillSubType = "3832"; //oItem.HBillNo = ""; //åæ®å· //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --æ¥æ //oItem.HInnerBillNo = ""; // --å é¨åæ®å· oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); //oItem.HEquipID = 0; //设å¤ID(Gy_EquipMent) //oItem.HPeriod = 0; //oItem.HCheckBeginDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); // --ç»´ä¿®æ¥æ //oItem.HCheckResult = ""; //éªæ¶ç»è®º--(æ£å¸¸ï¼å¼å¸¸) //oItem.HEmpID = 0; //éªæ¶äºº(Gy_Employee) //oItem.HManagerID = 0; //è´è´£äºº(Gy_Employee) //oItem.HDeptID = 0; //éªæ¶é¨é¨(Gy_Department) //oItem.HExplanation = ""; //æè¦(æ éæè¿°) //oItem.HRemark = ""; //夿³¨ //oItem.HMainSourceInterID = oItem.HInterID; //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") { 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("\\", ""); msg3 = msg3.Replace("\n", ""); //\n //msg2 = msg2.Replace("'", "â"); List<Model.ClsSc_MouldStockBillSub> ls = new List<Model.ClsSc_MouldStockBillSub>(); ls = oListModels.getObjectByJson_Gy_MouldScrapOutHouseBillSub(msg3); int i = 0; foreach (Model.ClsSc_MouldStockBillSub oItemSub in ls) { i++; oItemSub.HEntryID = i; //oItemSub.HRepairCheckID = 0; //éªæ¶é¡¹ç®ID //oItemSub.HRepairCheckContent = ""; //éªæ¶å 容 //oItemSub.HManagerID = 0; //è´è´£äººID //oItemSub.HCloseMan = ""; //è¡å ³é oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); oItemSub.HCloseType = false; //å ³éç±»å //oItemSub.HRemark = ""; //夿³¨ oItemSub.HSourceInterID = 0; // æºå主å ç oItemSub.HSourceEntryID = 0; //æºååå ç //oItemSub.HSourceBillNo = ""; //æºååå· //oItemSub.HSourceBillType = ""; //æºåç±»å //oItemSub.HRelationQty = 0; //å ³èæ°é //oItemSub.HRelationMoney = 0; //å ³èéé¢ //oItemSub.HRepairID = 0; //ç»´ä¿®é¡¹ç® //oItemSub.HRepairExplanation =""; //ç»´ä¿®è¦æ± //oItemSub.HMoney = 0; //ç»´ä¿®è´¹ç¨ oBill.DetailColl.Add(oItemSub); } //ä¿å //ä¿å宿¯åå¤ç bool bResult; if (oBill.omodel.HInterID == 0) { // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'out','{oBill.omodel.HInterID.ToString()}' "); oCn.RunProc(sql); } else { bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); //ä¿®æ¹æå //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID 1,{oBill.omodel.HInterID.ToString()},' ' "); string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID "); oCn.RunProc(sql); } if (bResult) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "ä¿åæåï¼"; //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); objJsonResult.data = 1; objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; //æåï¼ objJsonResult.data = null; return objJsonResult; } else @@ -7579,7 +7895,7 @@ objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = 1; objJsonResult.data = null; return objJsonResult; } } @@ -7587,8 +7903,8 @@ { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); objJsonResult.data = 1; objJsonResult.Message = "ä¿å失败ï¼" + e.Message; objJsonResult.data = null; return objJsonResult; } } @@ -8035,7 +8351,159 @@ } #endregion #region æ¨¡å ·éåºåä¿å/ç¼è¾ #region æ¨¡å ·éåºåä¿å/ç¼è¾ 20240702ä½åº /// <summary> /// ä¿åæ¨¡å ·éåºå /// </summary> /// <param name="msg"></param> /// <returns></returns> //[Route("Sc_MouldProdBackBill/SaveGetMouldProdBackBillList")] //[HttpPost] //public object SaveGetMouldProdBackBillList([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 msg4 = sArray[2].ToString(); // string UserName = ""; // ListModels oListModels = new ListModels(); // try // { // if (!DBUtility.ClsPub.Security_Log("Sc_MouldProdBackBill_Edit", 1, false, msg4)) // { // objJsonResult.code = "0"; // objJsonResult.count = 0; // objJsonResult.Message = "没æä¿åæé"; // objJsonResult.data = null; // return objJsonResult; // } // DLL.ClsSc_MouldProdBackBill oBill = new DLL.ClsSc_MouldProdBackBill(); // List<Model.ClsSc_MouldProdBackBillMain> lsmain = new List<Model.ClsSc_MouldProdBackBillMain>(); // msg2 = msg2.Replace("\\", ""); // msg2 = msg2.Replace("\n", ""); //\n // lsmain = oListModels.getObjectByJson_Gy_MouldProdBackBillMain(msg2); // foreach (Model.ClsSc_MouldProdBackBillMain oItem in lsmain) // { // //oItem.HMaker = ""; // UserName = oItem.HMaker; //å¶å人 // oItem.HBillType = "3803"; // oItem.HBillSubType = "3803"; // //oItem.HBillNo = ""; //åæ®å· // //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --æ¥æ // //oItem.HInnerBillNo = ""; // --å é¨åæ®å· // oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); // oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); // //oItem.HEquipID = 0; //设å¤ID(Gy_EquipMent) // //oItem.HPeriod = 0; // //oItem.HCheckBeginDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); // --ç»´ä¿®æ¥æ // //oItem.HCheckResult = ""; //éªæ¶ç»è®º--(æ£å¸¸ï¼å¼å¸¸) // //oItem.HEmpID = 0; //éªæ¶äºº(Gy_Employee) // //oItem.HManagerID = 0; //è´è´£äºº(Gy_Employee) // //oItem.HDeptID = 0; //éªæ¶é¨é¨(Gy_Department) // //oItem.HExplanation = ""; //æè¦(æ éæè¿°) // //oItem.HRemark = ""; //夿³¨ // //oItem.HMainSourceInterID = oItem.HInterID; // //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); // if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") // { // 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("\\", ""); // msg3 = msg3.Replace("\n", ""); //\n // //msg2 = msg2.Replace("'", "â"); // List<Model.ClsSc_MouldProdBackBillSub> ls = new List<Model.ClsSc_MouldProdBackBillSub>(); // ls = oListModels.getObjectByJson_Gy_MouldProdBackBillSub(msg3); // int i = 0; // foreach (Model.ClsSc_MouldProdBackBillSub oItemSub in ls) // { // i++; // oItemSub.HEntryID = i; // //oItemSub.HRepairCheckID = 0; //éªæ¶é¡¹ç®ID // //oItemSub.HRepairCheckContent = ""; //éªæ¶å 容 // //oItemSub.HManagerID = 0; //è´è´£äººID // //oItemSub.HCloseMan = ""; //è¡å ³é // oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); // oItemSub.HCloseType = false; //å ³éç±»å // //oItemSub.HRemark = ""; //夿³¨ // oItemSub.HSourceInterID = 0; // æºå主å ç // oItemSub.HSourceEntryID = 0; //æºååå ç // //oItemSub.HSourceBillNo = ""; //æºååå· // //oItemSub.HSourceBillType = ""; //æºåç±»å // //oItemSub.HRelationQty = 0; //å ³èæ°é // //oItemSub.HRelationMoney = 0; //å ³èéé¢ // //oItemSub.HRepairID = 0; //ç»´ä¿®é¡¹ç® // //oItemSub.HRepairExplanation =""; //ç»´ä¿®è¦æ± // //oItemSub.HMoney = 0; //ç»´ä¿®è´¹ç¨ // oBill.DetailColl.Add(oItemSub); // } // //ä¿å // //ä¿å宿¯åå¤ç // bool bResult; // if (oBill.omodel.HInterID == 0) // { // // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); // string sql1 = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'in','{oBill.omodel.HInterID.ToString()}' "); // oCn.RunProc(sql1); // } // else // { // bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); // //ä¿®æ¹æå // //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID 1,{oBill.omodel.HInterID.ToString()},' ' "); // string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID "); // oCn.RunProc(sql); // } // if (bResult) // { // string sql =string.Format($"exec h_p_Sc_MouldProdBackBillList '{oBill.omodel.HBillNo}' ") ; // oCn.RunProc(sql); // objJsonResult.code = "0"; // objJsonResult.count = 1; // objJsonResult.Message = "ä¿åæåï¼"; // //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); // 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 æ¨¡å ·éåºåä¿å/ç¼è¾ 20240702 /// <summary> /// ä¿åæ¨¡å ·éåºå /// </summary> @@ -8045,126 +8513,127 @@ [HttpPost] public object SaveGetMouldProdBackBillList([FromBody] JObject msg) { DAL.ClsSc_MouldProdBackBill oBill = new DAL.ClsSc_MouldProdBackBill(); 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 msg4 = sArray[2].ToString(); string UserName = ""; ListModels oListModels = new ListModels(); string sMainStr = sArray[0].ToString(); //ä¸»è¡¨æ°æ® string sSubStr = sArray[1].ToString(); //åè¡¨æ°æ® string HMaker = sArray[2].ToString(); //å¶å人 try { if (!DBUtility.ClsPub.Security_Log("Sc_MouldProdBackBill_Edit", 1, false, msg4)) //夿æé if (!DBUtility.ClsPub.Security_Log("Sc_MouldProdBackBill_Edit", 1, false, HMaker)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "没æä¿åæé"; objJsonResult.Message = "æ¨æ²¡æè¯¥æ¨¡åæ°å¢/ç¼è¾æé,请ä¸ç®¡çåèç³»ï¼"; objJsonResult.data = null; return objJsonResult; } //表头èµå¼ sMainStr = sMainStr.Replace("\\", ""); sMainStr = sMainStr.Replace("\n", ""); sMainStr = "[" + sMainStr.ToString() + "]"; List<Model.ClsSc_MouldProdBackBillMain> lsmain = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldProdBackBillMain>>(sMainStr); foreach (Model.ClsSc_MouldProdBackBillMain oItem in lsmain) { if (oItem.HInterID == 0) { BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew; } else { BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_Modify; } //忮巿¯å¦éå¤ if (oBill.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, oItem.HInterID)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·éå¤ï¼ä¸å 许ä¿åï¼"; objJsonResult.data = null; return objJsonResult; } //夿ä¼è®¡ææ¯å¦åç string s = ""; int sYear = 0; int sPeriod = 0; if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(oItem.HDate, ref sYear, ref sPeriod, ref s) == false) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = s; objJsonResult.data = null; return objJsonResult; } oItem.HYear = sYear; oItem.HPeriod = sPeriod; DBUtility.ClsPub.CurUserName = oItem.HMaker; oBill.omodel = oItem; } //表ä½èµå¼ //æ },{æ¥æåæ°ç» //廿ãåã sSubStr = sSubStr.Substring(1, sSubStr.Length - 2); sSubStr = sSubStr.Replace("\\", ""); sSubStr = sSubStr.Replace("\n", ""); sSubStr = "[" + sSubStr.ToString() + "]"; List<Model.ClsSc_MouldStockBillSub> ls = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldStockBillSub>>(sSubStr); int i = 0; foreach (Model.ClsSc_MouldStockBillSub oItemSub in ls) { i++; oItemSub.HEntryID = i; oBill.DetailColl.Add(oItemSub); } string sErrMsg = ""; bool bResult; //è·åç³»ç»åæ° if (oSystemParameter.ShowBill(ref sErrMsg) == true) { //ä¿å if (oBill.omodel.HInterID == 0) //æ°å¢ä¿å { bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); if (oSystemParameter.omodel.WMS_CampanyName == "åç»´å°") //ç³»ç»åæ° å®¢æ·å®å¶ååç§° 空ç½ä¸ºéç¨ { //ä¿®æ¹å¨å ·æ¡£æ¡ä½ç½® string sql1 = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'in','{oBill.omodel.HInterID.ToString()}' "); oCn.RunProc(sql1); } } else //ç¼è¾ä¿å { bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); if (oSystemParameter.omodel.WMS_CampanyName == "åç»´å°") //ç³»ç»åæ° å®¢æ·å®å¶ååç§° 空ç½ä¸ºéç¨ { //ä¿®æ¹å¨å ·æ¡£æ¡ä½ç½® string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID "); oCn.RunProc(sql); } } } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "è·åç³»ç»åæ°å¤±è´¥ï¼ " + sErrMsg; objJsonResult.data = null; return objJsonResult; } DLL.ClsSc_MouldProdBackBill oBill = new DLL.ClsSc_MouldProdBackBill(); List<Model.ClsSc_MouldProdBackBillMain> lsmain = new List<Model.ClsSc_MouldProdBackBillMain>(); msg2 = msg2.Replace("\\", ""); msg2 = msg2.Replace("\n", ""); //\n lsmain = oListModels.getObjectByJson_Gy_MouldProdBackBillMain(msg2); foreach (Model.ClsSc_MouldProdBackBillMain oItem in lsmain) { //oItem.HMaker = ""; UserName = oItem.HMaker; //å¶å人 oItem.HBillType = "3803"; oItem.HBillSubType = "3803"; //oItem.HBillNo = ""; //åæ®å· //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --æ¥æ //oItem.HInnerBillNo = ""; // --å é¨åæ®å· oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); //oItem.HEquipID = 0; //设å¤ID(Gy_EquipMent) //oItem.HPeriod = 0; //oItem.HCheckBeginDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); // --ç»´ä¿®æ¥æ //oItem.HCheckResult = ""; //éªæ¶ç»è®º--(æ£å¸¸ï¼å¼å¸¸) //oItem.HEmpID = 0; //éªæ¶äºº(Gy_Employee) //oItem.HManagerID = 0; //è´è´£äºº(Gy_Employee) //oItem.HDeptID = 0; //éªæ¶é¨é¨(Gy_Department) //oItem.HExplanation = ""; //æè¦(æ éæè¿°) //oItem.HRemark = ""; //夿³¨ //oItem.HMainSourceInterID = oItem.HInterID; //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") { 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("\\", ""); msg3 = msg3.Replace("\n", ""); //\n //msg2 = msg2.Replace("'", "â"); List<Model.ClsSc_MouldProdBackBillSub> ls = new List<Model.ClsSc_MouldProdBackBillSub>(); ls = oListModels.getObjectByJson_Gy_MouldProdBackBillSub(msg3); int i = 0; foreach (Model.ClsSc_MouldProdBackBillSub oItemSub in ls) { i++; oItemSub.HEntryID = i; //oItemSub.HRepairCheckID = 0; //éªæ¶é¡¹ç®ID //oItemSub.HRepairCheckContent = ""; //éªæ¶å 容 //oItemSub.HManagerID = 0; //è´è´£äººID //oItemSub.HCloseMan = ""; //è¡å ³é oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); oItemSub.HCloseType = false; //å ³éç±»å //oItemSub.HRemark = ""; //夿³¨ oItemSub.HSourceInterID = 0; // æºå主å ç oItemSub.HSourceEntryID = 0; //æºååå ç //oItemSub.HSourceBillNo = ""; //æºååå· //oItemSub.HSourceBillType = ""; //æºåç±»å //oItemSub.HRelationQty = 0; //å ³èæ°é //oItemSub.HRelationMoney = 0; //å ³èéé¢ //oItemSub.HRepairID = 0; //ç»´ä¿®é¡¹ç® //oItemSub.HRepairExplanation =""; //ç»´ä¿®è¦æ± //oItemSub.HMoney = 0; //ç»´ä¿®è´¹ç¨ oBill.DetailColl.Add(oItemSub); } //ä¿å //ä¿å宿¯åå¤ç bool bResult; if (oBill.omodel.HInterID == 0) { // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); string sql1 = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'in','{oBill.omodel.HInterID.ToString()}' "); oCn.RunProc(sql1); } else { bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); //ä¿®æ¹æå //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID 1,{oBill.omodel.HInterID.ToString()},' ' "); string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID "); oCn.RunProc(sql); } if (bResult) { string sql =string.Format($"exec h_p_Sc_MouldProdBackBillList '{oBill.omodel.HBillNo}' ") ; oCn.RunProc(sql); string sql = string.Format($"exec h_p_Sc_MouldProdBackBillList '{oBill.omodel.HBillNo}' "); objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "ä¿åæåï¼"; //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); objJsonResult.data = 1; objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; //æåï¼ objJsonResult.data = null; return objJsonResult; } else @@ -8172,7 +8641,7 @@ objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = 1; objJsonResult.data = null; return objJsonResult; } } @@ -8180,8 +8649,8 @@ { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); objJsonResult.data = 1; objJsonResult.Message = "ä¿å失败ï¼" + e.Message; objJsonResult.data = null; return objJsonResult; } } @@ -8488,7 +8957,158 @@ } #endregion #region æ¨¡å ·é¢ç¨åä¿å/ç¼è¾ #region æ¨¡å ·é¢ç¨åä¿å/ç¼è¾ 20240702ä½åº /// <summary> /// ä¿åæ¨¡å ·é¢ç¨å /// </summary> /// <param name="msg"></param> /// <returns></returns> //[Route("Sc_MouldProdOutBill/SaveGetMouldProdOutBillList")] //[HttpPost] //public object SaveGetMouldProdOutBillList([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 msg4 = sArray[2].ToString(); // string UserName = ""; // ListModels oListModels = new ListModels(); // try // { // //模ååï¼åå ¥æ¥å¿ï¼æ¥éæ¡ï¼ç¨æ·å // if (!DBUtility.ClsPub.Security_Log("Sc_MouldProdOutBill_Edit", 1, false, msg4)) // { // objJsonResult.code = "0"; // objJsonResult.count = 0; // objJsonResult.Message = "没æä¿åæé"; // objJsonResult.data = null; // return objJsonResult; // } // DLL.ClsSc_MouldProdOutBill oBill = new DLL.ClsSc_MouldProdOutBill(); // List<Model.ClsSc_MouldProdOutBillMain> lsmain = new List<Model.ClsSc_MouldProdOutBillMain>(); // msg2 = msg2.Replace("\\", ""); // msg2 = msg2.Replace("\n", ""); //\n // lsmain = oListModels.getObjectByJson_Gy_MouldProdOutBillMain(msg2); // foreach (Model.ClsSc_MouldProdOutBillMain oItem in lsmain) // { // //oItem.HMaker = ""; // UserName = oItem.HMaker; //å¶å人 // oItem.HBillType = "3802"; // oItem.HBillSubType = "3802"; // //oItem.HBillNo = ""; //åæ®å· // //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --æ¥æ // //oItem.HInnerBillNo = ""; // --å é¨åæ®å· // oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); // oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); // //oItem.HEquipID = 0; //设å¤ID(Gy_EquipMent) // //oItem.HPeriod = 0; // //oItem.HCheckBeginDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); // --ç»´ä¿®æ¥æ // //oItem.HCheckResult = ""; //éªæ¶ç»è®º--(æ£å¸¸ï¼å¼å¸¸) // //oItem.HEmpID = 0; //éªæ¶äºº(Gy_Employee) // //oItem.HManagerID = 0; //è´è´£äºº(Gy_Employee) // //oItem.HDeptID = 0; //éªæ¶é¨é¨(Gy_Department) // //oItem.HExplanation = ""; //æè¦(æ éæè¿°) // //oItem.HRemark = ""; //夿³¨ // //oItem.HMainSourceInterID = oItem.HInterID; // //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); // if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") // { // 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("\\", ""); // msg3 = msg3.Replace("\n", ""); //\n // //msg2 = msg2.Replace("'", "â"); // List<Model.ClsSc_MouldStockBillSub> ls = new List<Model.ClsSc_MouldStockBillSub>(); // ls = oListModels.getObjectByJson_Gy_MouldStockBillSub(msg3); // int i = 0; // foreach (Model.ClsSc_MouldStockBillSub oItemSub in ls) // { // i++; // oItemSub.HEntryID = i; // //oItemSub.HRepairCheckID = 0; //éªæ¶é¡¹ç®ID // //oItemSub.HRepairCheckContent = ""; //éªæ¶å 容 // //oItemSub.HManagerID = 0; //è´è´£äººID // //oItemSub.HCloseMan = ""; //è¡å ³é // oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); // oItemSub.HCloseType = false; //å ³éç±»å // //oItemSub.HRemark = ""; //夿³¨ // oItemSub.HSourceInterID = 0; // æºå主å ç // oItemSub.HSourceEntryID = 0; //æºååå ç // //oItemSub.HSourceBillNo = ""; //æºååå· // //oItemSub.HSourceBillType = ""; //æºåç±»å // //oItemSub.HRelationQty = 0; //å ³èæ°é // //oItemSub.HRelationMoney = 0; //å ³èéé¢ // //oItemSub.HRepairID = 0; //ç»´ä¿®é¡¹ç® // //oItemSub.HRepairExplanation =""; //ç»´ä¿®è¦æ± // //oItemSub.HMoney = 0; //ç»´ä¿®è´¹ç¨ // oBill.DetailColl.Add(oItemSub); // } // //ä¿å // //ä¿å宿¯åå¤ç // bool bResult; // if (oBill.omodel.HInterID == 0) // { // // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); // string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'out','{oBill.omodel.HInterID.ToString()}' "); // oCn.RunProc(sql); // } // else // { // bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); // //ä¿®æ¹æå // //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID 1,{oBill.omodel.HInterID.ToString()},' ' "); // string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID "); // oCn.RunProc(sql); // } // if (bResult) // { // objJsonResult.code = "0"; // objJsonResult.count = 1; // objJsonResult.Message = "ä¿åæåï¼"; // //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); // 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 æ¨¡å ·é¢ç¨åä¿å/ç¼è¾ 20240702 /// <summary> /// ä¿åæ¨¡å ·é¢ç¨å /// </summary> @@ -8498,125 +9118,126 @@ [HttpPost] public object SaveGetMouldProdOutBillList([FromBody] JObject msg) { DAL.ClsSc_MouldProdOutBill oBill = new DAL.ClsSc_MouldProdOutBill(); 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 msg4 = sArray[2].ToString(); string UserName = ""; ListModels oListModels = new ListModels(); string sMainStr = sArray[0].ToString(); //ä¸»è¡¨æ°æ® string sSubStr = sArray[1].ToString(); //åè¡¨æ°æ® string HMaker = sArray[2].ToString(); //å¶å人 try { //模ååï¼åå ¥æ¥å¿ï¼æ¥éæ¡ï¼ç¨æ·å if (!DBUtility.ClsPub.Security_Log("Sc_MouldProdOutBill_Edit", 1, false, msg4)) if (!DBUtility.ClsPub.Security_Log("Sc_MouldProdOutBill_Edit", 1, false, HMaker)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "没æä¿åæé"; objJsonResult.Message = "æ¨æ²¡æè¯¥æ¨¡åæ°å¢/ç¼è¾æé,请ä¸ç®¡çåèç³»ï¼"; objJsonResult.data = null; return objJsonResult; } DLL.ClsSc_MouldProdOutBill oBill = new DLL.ClsSc_MouldProdOutBill(); List<Model.ClsSc_MouldProdOutBillMain> lsmain = new List<Model.ClsSc_MouldProdOutBillMain>(); msg2 = msg2.Replace("\\", ""); msg2 = msg2.Replace("\n", ""); //\n lsmain = oListModels.getObjectByJson_Gy_MouldProdOutBillMain(msg2); //表头èµå¼ sMainStr = sMainStr.Replace("\\", ""); sMainStr = sMainStr.Replace("\n", ""); sMainStr = "[" + sMainStr.ToString() + "]"; List<Model.ClsSc_MouldProdOutBillMain> lsmain = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldProdOutBillMain>>(sMainStr); foreach (Model.ClsSc_MouldProdOutBillMain oItem in lsmain) { //oItem.HMaker = ""; UserName = oItem.HMaker; //å¶å人 oItem.HBillType = "3802"; oItem.HBillSubType = "3802"; //oItem.HBillNo = ""; //åæ®å· //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --æ¥æ //oItem.HInnerBillNo = ""; // --å é¨åæ®å· oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); //oItem.HEquipID = 0; //设å¤ID(Gy_EquipMent) //oItem.HPeriod = 0; //oItem.HCheckBeginDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); // --ç»´ä¿®æ¥æ //oItem.HCheckResult = ""; //éªæ¶ç»è®º--(æ£å¸¸ï¼å¼å¸¸) //oItem.HEmpID = 0; //éªæ¶äºº(Gy_Employee) //oItem.HManagerID = 0; //è´è´£äºº(Gy_Employee) //oItem.HDeptID = 0; //éªæ¶é¨é¨(Gy_Department) //oItem.HExplanation = ""; //æè¦(æ éæè¿°) //oItem.HRemark = ""; //夿³¨ //oItem.HMainSourceInterID = oItem.HInterID; //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") if (oItem.HInterID == 0) { BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew; } else { BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_Modify; } //忮巿¯å¦éå¤ if (oBill.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, oItem.HInterID)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿åå¤±è´¥ï¼æ²¡æåæ®æ¥æï¼æ æ³ä¿åï¼"; objJsonResult.data = 1; objJsonResult.Message = "åæ®å·éå¤ï¼ä¸å 许ä¿åï¼"; objJsonResult.data = null; return objJsonResult; } //夿ä¼è®¡ææ¯å¦åç string s = ""; int sYear = 0; int sPeriod = 0; if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(oItem.HDate, ref sYear, ref sPeriod, ref s) == false) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = s; objJsonResult.data = null; return objJsonResult; } oItem.HYear = sYear; oItem.HPeriod = sPeriod; DBUtility.ClsPub.CurUserName = oItem.HMaker; oBill.omodel = oItem; } //è¡¨ä½æ°æ® //表ä½èµå¼ //æ },{æ¥æåæ°ç» //廿ãåã msg3 = msg3.Substring(1, msg3.Length - 2); msg3 = msg3.Replace("\\", ""); msg3 = msg3.Replace("\n", ""); //\n //msg2 = msg2.Replace("'", "â"); List<Model.ClsSc_MouldStockBillSub> ls = new List<Model.ClsSc_MouldStockBillSub>(); ls = oListModels.getObjectByJson_Gy_MouldStockBillSub(msg3); sSubStr = sSubStr.Substring(1, sSubStr.Length - 2); sSubStr = sSubStr.Replace("\\", ""); sSubStr = sSubStr.Replace("\n", ""); sSubStr = "[" + sSubStr.ToString() + "]"; List<Model.ClsSc_MouldStockBillSub> ls = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldStockBillSub>>(sSubStr); int i = 0; foreach (Model.ClsSc_MouldStockBillSub oItemSub in ls) { i++; oItemSub.HEntryID = i; //oItemSub.HRepairCheckID = 0; //éªæ¶é¡¹ç®ID //oItemSub.HRepairCheckContent = ""; //éªæ¶å 容 //oItemSub.HManagerID = 0; //è´è´£äººID //oItemSub.HCloseMan = ""; //è¡å ³é oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); oItemSub.HCloseType = false; //å ³éç±»å //oItemSub.HRemark = ""; //夿³¨ oItemSub.HSourceInterID = 0; // æºå主å ç oItemSub.HSourceEntryID = 0; //æºååå ç //oItemSub.HSourceBillNo = ""; //æºååå· //oItemSub.HSourceBillType = ""; //æºåç±»å //oItemSub.HRelationQty = 0; //å ³èæ°é //oItemSub.HRelationMoney = 0; //å ³èéé¢ //oItemSub.HRepairID = 0; //ç»´ä¿®é¡¹ç® //oItemSub.HRepairExplanation =""; //ç»´ä¿®è¦æ± //oItemSub.HMoney = 0; //ç»´ä¿®è´¹ç¨ oBill.DetailColl.Add(oItemSub); } //ä¿å //ä¿å宿¯åå¤ç string sErrMsg = ""; bool bResult; if (oBill.omodel.HInterID == 0) //è·åç³»ç»åæ° if (oSystemParameter.ShowBill(ref sErrMsg) == true) { // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'out','{oBill.omodel.HInterID.ToString()}' "); oCn.RunProc(sql); //ä¿å if (oBill.omodel.HInterID == 0) //æ°å¢ä¿å { bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); if (oSystemParameter.omodel.WMS_CampanyName == "åç»´å°") //ç³»ç»åæ° å®¢æ·å®å¶ååç§° 空ç½ä¸ºéç¨ { //ä¿®æ¹å¨å ·æ¡£æ¡ä½ç½® string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'out','{oBill.omodel.HInterID.ToString()}' "); oCn.RunProc(sql); } } else //ç¼è¾ä¿å { bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); if (oSystemParameter.omodel.WMS_CampanyName == "åç»´å°") //ç³»ç»åæ° å®¢æ·å®å¶ååç§° 空ç½ä¸ºéç¨ { //ä¿®æ¹å¨å ·æ¡£æ¡ä½ç½® string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID "); oCn.RunProc(sql); } } } else { bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); //ä¿®æ¹æå //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID 1,{oBill.omodel.HInterID.ToString()},' ' "); string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID "); oCn.RunProc(sql); objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "è·åç³»ç»åæ°å¤±è´¥ï¼ " + sErrMsg; objJsonResult.data = null; return objJsonResult; } if (bResult) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "ä¿åæåï¼"; //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); objJsonResult.data = 1; objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; //æåï¼ objJsonResult.data = null; return objJsonResult; } else @@ -8624,7 +9245,7 @@ objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = 1; objJsonResult.data = null; return objJsonResult; } } @@ -8632,8 +9253,8 @@ { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); objJsonResult.data = 1; objJsonResult.Message = "ä¿å失败ï¼" + e.Message; objJsonResult.data = null; return objJsonResult; } } WebAPI/DLL/ClsSb_EquipConkBookBill.cs
@@ -29,29 +29,74 @@ } #endregion èªå®ä¹æ¹æ³ //ä¿ååæ§å¶ public bool BeforeSave(Int64 HInterID, string HBillNo, string HBillNote, Int64 OperationType, ref string sReturn) { try { DataSet Ds = oCn.RunProcReturn("Exec h_p_Sb_EquipConkBookBill_BeforeSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "','" + HBillNote + "'," + OperationType.ToString(), "h_p_Sb_EquipConkBookBill_BeforeSaveCtrl"); if (Ds == null || Ds.Tables[0].Rows.Count == 0) { sReturn = "ä¿ååå¤æå¤±è´¥ï¼"; return false; } else { if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HBack"]) == 1) { sReturn = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]); return false; } } return true; } catch (Exception e) { throw (e); } } //ä¿ååæ§å¶ public bool AfterSave(Int64 HInterID, string HBillNo, Int64 OperationType, ref string sReturn) { try { DataSet Ds = oCn.RunProcReturn("Exec h_p_Sb_EquipConkBookBill_AfterSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Sb_EquipConkBookBill_AfterSaveCtrl"); if (Ds == null || Ds.Tables[0].Rows.Count == 0) { sReturn = "ä¿ååå¤æå¤±è´¥ï¼"; return false; } else { if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HBack"]) == 1) { sReturn = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]); return false; } } return true; } catch (Exception e) { throw (e); } } //ä¿®æ¹åæ® public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) { try { //ä¿ååæ§å¶========================================= string HBillNote = ""; DataSet ds = oCn.RunProcReturn("Exec h_p_Sb_EquipConkBookBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_Sb_EquipConkBookBill_BeforeSaveCtrl"); if (ds == null) { sReturn = "ä¿ååå¤æå¤±è´¥ï¼"; return false; } if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0") { sReturn = "ä¿å失败ï¼" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); return false; } //========================================================= // oCn.BeginTran(); //ä¿ååæ§å¶ string HBillNote = ""; if (!BeforeSave(lngBillKey, omodel.HBillNo, HBillNote, 2, ref sReturn)) { oCn.RollBack(); return false; } //æ´æ°ä¸»è¡¨ oCn.RunProc("UpDate Sb_EquipConkBookBillMain set " + " HBillNo='" + omodel.HBillNo + "'" + //åºå®èµå¼=============== @@ -89,24 +134,13 @@ "," + oSub.HConkReasonID.ToString() + ",'" + oSub.HConkExplanation + "'," + oSub.HManagerID.ToString() + ") "); } //=========================ä¿ååæ§å¶ DataSet ds2 = oCn.RunProcReturn("Exec h_p_Sb_EquipConkBookBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_Sb_EquipConkBookBill_AfterSaveCtrl"); if (ds2 == null) //ä¿ååæ§å¶ if (!AfterSave(lngBillKey, omodel.HBillNo, 2, ref sReturn)) { sReturn = "ä¿ååæ§å¶å¤æå¤±è´¥ï¼"; oCn.RollBack(); return false; } if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0") { sReturn = "ä¿å失败2ï¼" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]); oCn.RollBack(); return false; } //============================ sReturn = "ä¿®æ¹åæ®æåï¼"; sReturn = "åæ®å·ï¼" + omodel.HBillNo + " ä¿®æ¹æåï¼"; oCn.Commit(); return true; } @@ -125,24 +159,13 @@ //å¾å°mainid omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); //ä¿ååæ§å¶========================================= //ä¿ååæ§å¶ string HBillNote = ""; DataSet ds = oCn.RunProcReturn("Exec h_p_Sb_EquipConkBookBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_Sb_EquipConkBookBill_BeforeSaveCtrl"); if (ds == null) if (!BeforeSave(omodel.HInterID, omodel.HBillNo, HBillNote, 1, ref sReturn)) { sReturn = "ä¿ååå¤æå¤±è´¥ï¼"; return false; } if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0") { sReturn = "ä¿å失败ï¼" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); return false; } //========================================================= //è¥MAINDIéå¤åéæ°è·å oCn.BeginTran(); //主表 oCn.RunProc("Insert Into Sb_EquipConkBookBillMain" + @@ -169,25 +192,13 @@ "," + oSub.HConkReasonID.ToString() + "," + oSub.HManagerID.ToString() + ",'" + oSub.HConkExplanation + "'" + ") "); } //=========================ä¿ååæ§å¶ DataSet ds2 = oCn.RunProcReturn("Exec h_p_Sb_EquipConkBookBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_Sb_EquipConkBookBill_AfterSaveCtrl"); if (ds2 == null) //ä¿ååæ§å¶ if (!AfterSave(omodel.HInterID, omodel.HBillNo, 1, ref sReturn)) { sReturn = "ä¿ååæ§å¶å¤æå¤±è´¥ï¼"; oCn.RollBack(); return false; } if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0") { sReturn = "ä¿å失败2ï¼" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]); oCn.RollBack(); return false; } //============================ sReturn = "æ°å¢åæ®æåï¼"; sReturn = "åæ®å·ï¼" + omodel.HBillNo + " æ°å¢æåï¼"; oCn.Commit(); return true; } WebAPI/DLL/ClsSc_MESBeginWorkBill.cs
@@ -30,15 +30,75 @@ { DetailColl = null; } #endregion èªå®ä¹æ¹æ³ //ä¿ååæ§å¶ public bool BeforeSave(Int64 HInterID, Int64 HICMOInterID, Int64 HICMOEntryID, string HICMOBillNo, Int64 OperationType, ref string sReturn) { try { DataSet Ds = oCn.RunProcReturn("Exec h_p_Sc_MESBeginWorkBill_BeforeSaveCtrl " + HInterID.ToString() + "," + HICMOInterID.ToString() + "," + HICMOEntryID.ToString() + ",'" + HICMOBillNo + "'," + OperationType.ToString(), "h_p_Sc_MESBeginWorkBill_BeforeSaveCtrl"); if (Ds == null || Ds.Tables[0].Rows.Count == 0) { sReturn = "ä¿ååå¤æå¤±è´¥ï¼"; return false; } else { if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HBack"]) == 1) { sReturn = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]); return false; } } return true; } catch (Exception e) { throw (e); } } //ä¿ååæ§å¶ public bool AfterSave(Int64 HInterID, Int64 HICMOInterID, Int64 HICMOEntryID, string HICMOBillNo, Int64 OperationType, ref string sReturn) { try { DataSet Ds = oCn.RunProcReturn("Exec h_p_Sc_MESBeginWorkBill_AfterSaveCtrl " + HInterID.ToString() + "," + HICMOInterID.ToString() + "," + HICMOEntryID.ToString() + ",'" + HICMOBillNo + "'," + OperationType.ToString(), "h_p_Sc_MESBeginWorkBill_AfterSaveCtrl"); if (Ds == null || Ds.Tables[0].Rows.Count == 0) { sReturn = "ä¿ååå¤æå¤±è´¥ï¼"; return false; } else { if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HBack"]) == 1) { sReturn = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]); return false; } } return true; } catch (Exception e) { throw (e); } } //ä¿®æ¹åæ® public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) { try { // oCn.BeginTran(); //ä¿ååæ§å¶ if (!BeforeSave(lngBillKey, omodel.HICMOInterID, omodel.HICMOEntryID, omodel.HICMOBillNo, 2, ref sReturn)) { oCn.RollBack(); return false; } //æ´æ°ä¸»è¡¨ oCn.RunProc("UpDate Sc_MESBeginWorkBillMain set " + " HBillNo='" + omodel.HBillNo + "'" + //åºå®èµå¼=============== @@ -136,7 +196,14 @@ // return false; // } //} sReturn = "ä¿®æ¹åæ®æåï¼"; //ä¿ååæ§å¶ if (!AfterSave(lngBillKey, omodel.HICMOInterID, omodel.HICMOEntryID, omodel.HICMOBillNo, 2, ref sReturn)) { oCn.RollBack(); return false; } sReturn = "åæ®å·ï¼" + omodel.HBillNo + " ä¿®æ¹æåï¼"; oCn.Commit(); return true; } @@ -157,16 +224,12 @@ omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); //è¥MAINDIéå¤åéæ°è·å oCn.BeginTran(); //ä¿ååæ§å¶========================================= ds = oCn.RunProcReturn("exec h_p_Sc_MESBeginWorkBill_BeforeSaveCtrl " + omodel.HInterID + "," + omodel.HICMOInterID + "," + omodel.HICMOEntryID + ",'" + omodel.HICMOBillNo + "'", "h_p_Sc_MESBeginWorkBill_BeforeSaveCtrl"); if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "1") //ä¿ååæ§å¶ if (!BeforeSave(omodel.HInterID, omodel.HICMOInterID, omodel.HICMOEntryID, omodel.HICMOBillNo, 1, ref sReturn)) { sReturn = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); oCn.RollBack(); return false; } //========================================================= //主表 oCn.RunProc("Insert Into Sc_MESBeginWorkBillMain " + "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate" + @@ -201,16 +264,12 @@ return false; } //ä¿ååæ§å¶========================================= ds = oCn.RunProcReturn("exec h_p_Sc_MESBeginWorkBill_AfterSaveCtrl " + omodel.HInterID + "," + omodel.HICMOInterID + "," + omodel.HICMOEntryID + ",'" + omodel.HICMOBillNo + "'", "h_p_Sc_MESBeginWorkBill_AfterSaveCtrl"); if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "1") //ä¿ååæ§å¶ if (!AfterSave(omodel.HInterID, omodel.HICMOInterID, omodel.HICMOEntryID, omodel.HICMOBillNo, 1, ref sReturn)) { sReturn = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); oCn.RollBack(); return false; } //========================================================= //è·åæè¿ç䏿¨¡å æå·¥åè·æ¨¡å ·è¿è¡ç»å® ds = oCn.RunProcReturn(@"select HICMOInterID,HICMOEntryID,HSourceInterID,HSourceEntryID,HSourceID from Sc_ICMOBillStatus_Tmp where HInterID=" + omodel.HMainSourceInterID.ToString(), "Sc_ICMOBillStatus_Tmp"); WebAPI/DLL/ClsSc_MESEndWorkBill.cs
@@ -29,16 +29,76 @@ { DetailColl = null; } #endregion èªå®ä¹æ¹æ³ //ä¿ååæ§å¶ public bool BeforeSave(Int64 HInterID, Int64 HICMOInterID, Int64 HICMOEntryID, string HICMOBillNo, Int64 OperationType, ref string sReturn) { try { DataSet Ds = oCn.RunProcReturn("Exec h_p_Sc_MESEndWorkBill_BeforeSaveCtrl " + HInterID.ToString() + "," + HICMOInterID.ToString() + "," + HICMOEntryID.ToString() + ",'" + HICMOBillNo + "'," + OperationType.ToString(), "h_p_Sc_MESEndWorkBill_BeforeSaveCtrl"); if (Ds == null || Ds.Tables[0].Rows.Count == 0) { sReturn = "ä¿ååå¤æå¤±è´¥ï¼"; return false; } else { if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HBack"]) == 1) { sReturn = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]); return false; } } return true; } catch (Exception e) { throw (e); } } //ä¿ååæ§å¶ public bool AfterSave(Int64 HInterID, Int64 HICMOInterID, Int64 HICMOEntryID, string HICMOBillNo, Int64 OperationType, ref string sReturn) { try { DataSet Ds = oCn.RunProcReturn("Exec h_p_Sc_MESEndWorkBill_AfterSaveCtrl " + HInterID.ToString() + "," + HICMOInterID.ToString() + "," + HICMOEntryID.ToString() + ",'" + HICMOBillNo + "'," + OperationType.ToString(), "h_p_Sc_MESEndWorkBill_AfterSaveCtrl"); if (Ds == null || Ds.Tables[0].Rows.Count == 0) { sReturn = "ä¿ååå¤æå¤±è´¥ï¼"; return false; } else { if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HBack"]) == 1) { sReturn = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]); return false; } } return true; } catch (Exception e) { throw (e); } } //ä¿®æ¹åæ® public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) { try { // oCn.BeginTran(); //ä¿ååæ§å¶ if (!BeforeSave(lngBillKey, omodel.HICMOInterID, omodel.HICMOEntryID, omodel.HICMOBillNo, 2, ref sReturn)) { oCn.RollBack(); return false; } //æ´æ°ä¸»è¡¨ oCn.RunProc("UpDate Sc_MESEndWorkBillMain set " + " HBillNo='" + omodel.HBillNo + "'" + //åºå®èµå¼=============== @@ -142,7 +202,14 @@ // return false; // } //} sReturn = "ä¿®æ¹åæ®æåï¼"; //ä¿ååæ§å¶ if (!AfterSave(lngBillKey, omodel.HICMOInterID, omodel.HICMOEntryID, omodel.HICMOBillNo, 2, ref sReturn)) { oCn.RollBack(); return false; } sReturn = "åæ®å·ï¼" + omodel.HBillNo + " ä¿®æ¹æåï¼"; oCn.Commit(); return true; } @@ -163,16 +230,12 @@ omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); //è¥MAINDIéå¤åéæ°è·å oCn.BeginTran(); //ä¿ååæ§å¶========================================= ds = oCn.RunProcReturn("exec h_p_Sc_MESEndWorkBill_BeforeSaveCtrl " + omodel.HInterID + "," + omodel.HICMOInterID + "," + omodel.HICMOEntryID + ",'" + omodel.HICMOBillNo + "'", "h_p_Sc_MESEndWorkBill_BeforeSaveCtrl"); if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "1") //ä¿ååæ§å¶ if (!BeforeSave(omodel.HInterID, omodel.HICMOInterID, omodel.HICMOEntryID, omodel.HICMOBillNo, 1, ref sReturn)) { sReturn = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); oCn.RollBack(); return false; } //========================================================= //主表 oCn.RunProc("Insert Into Sc_MESEndWorkBillMain " + "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate" + @@ -210,16 +273,12 @@ return false; } //ä¿ååæ§å¶========================================= ds = oCn.RunProcReturn("exec h_p_Sc_MESEndWorkBill_AfterSaveCtrl " + omodel.HInterID + "," + omodel.HICMOInterID + "," + omodel.HICMOEntryID + ",'" + omodel.HICMOBillNo + "'", "h_p_Sc_MESEndWorkBill_AfterSaveCtrl"); if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "1") //ä¿ååæ§å¶ if (!AfterSave(omodel.HInterID, omodel.HICMOInterID, omodel.HICMOEntryID, omodel.HICMOBillNo, 1, ref sReturn)) { sReturn = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); oCn.RollBack(); return false; } //========================================================= sReturn = omodel.HInterID.ToString(); oCn.Commit(); WebAPI/DLL/ClsSc_MESStopWorkBill.cs
@@ -29,15 +29,75 @@ { DetailColl = null; } #endregion èªå®ä¹æ¹æ³ //ä¿ååæ§å¶ public bool BeforeSave(Int64 HInterID, Int64 HICMOInterID, Int64 HICMOEntryID, string HICMOBillNo, Int64 OperationType, ref string sReturn) { try { DataSet Ds = oCn.RunProcReturn("Exec h_p_Sc_MESStopWorkBill_BeforeSaveCtrl " + HInterID.ToString() + "," + HICMOInterID.ToString() + "," + HICMOEntryID.ToString() + ",'" + HICMOBillNo + "'," + OperationType.ToString(), "h_p_Sc_MESStopWorkBill_BeforeSaveCtrl"); if (Ds == null || Ds.Tables[0].Rows.Count == 0) { sReturn = "ä¿ååå¤æå¤±è´¥ï¼"; return false; } else { if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HBack"]) == 1) { sReturn = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]); return false; } } return true; } catch (Exception e) { throw (e); } } //ä¿ååæ§å¶ public bool AfterSave(Int64 HInterID, Int64 HICMOInterID, Int64 HICMOEntryID, string HICMOBillNo, Int64 OperationType, ref string sReturn) { try { DataSet Ds = oCn.RunProcReturn("Exec h_p_Sc_MESStopWorkBill_AfterSaveCtrl " + HInterID.ToString() + "," + HICMOInterID.ToString() + "," + HICMOEntryID.ToString() + ",'" + HICMOBillNo + "'," + OperationType.ToString(), "h_p_Sc_MESStopWorkBill_AfterSaveCtrl"); if (Ds == null || Ds.Tables[0].Rows.Count == 0) { sReturn = "ä¿ååå¤æå¤±è´¥ï¼"; return false; } else { if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HBack"]) == 1) { sReturn = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]); return false; } } return true; } catch (Exception e) { throw (e); } } //ä¿®æ¹åæ® public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) { try { // oCn.BeginTran(); //ä¿ååæ§å¶ if (!BeforeSave(lngBillKey, omodel.HICMOInterID, omodel.HICMOEntryID, omodel.HICMOBillNo, 2, ref sReturn)) { oCn.RollBack(); return false; } //æ´æ°ä¸»è¡¨ oCn.RunProc("UpDate Sc_MESStopWorkBillMain set " + " HBillNo='" + omodel.HBillNo + "'" + //åºå®èµå¼=============== @@ -138,7 +198,14 @@ // return false; // } //} sReturn = "ä¿®æ¹åæ®æåï¼"; //ä¿ååæ§å¶ if (!AfterSave(lngBillKey, omodel.HICMOInterID, omodel.HICMOEntryID, omodel.HICMOBillNo, 2, ref sReturn)) { oCn.RollBack(); return false; } sReturn = "åæ®å·ï¼" + omodel.HBillNo + " ä¿®æ¹æåï¼"; oCn.Commit(); return true; } @@ -159,16 +226,12 @@ omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); //è¥MAINDIéå¤åéæ°è·å oCn.BeginTran(); //ä¿ååæ§å¶========================================= ds = oCn.RunProcReturn("exec h_p_Sc_MESStopWorkBill_BeforeSaveCtrl " + omodel.HInterID + "," + omodel.HICMOInterID + "," + omodel.HICMOEntryID + ",'" + omodel.HICMOBillNo + "'", "h_p_Sc_MESStopWorkBill_BeforeSaveCtrl"); if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "1") //ä¿ååæ§å¶ if (!BeforeSave(omodel.HInterID, omodel.HICMOInterID, omodel.HICMOEntryID, omodel.HICMOBillNo, 1, ref sReturn)) { sReturn = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); oCn.RollBack(); return false; } //========================================================= //主表 oCn.RunProc("Insert Into Sc_MESStopWorkBillMain " + "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate" + @@ -203,16 +266,12 @@ return false; } //ä¿ååæ§å¶========================================= ds = oCn.RunProcReturn("exec h_p_Sc_MESStopWorkBill_AfterSaveCtrl " + omodel.HInterID + "," + omodel.HICMOInterID + "," + omodel.HICMOEntryID + ",'" + omodel.HICMOBillNo + "'", "h_p_Sc_MESStopWorkBill_AfterSaveCtrl"); if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "1") //ä¿ååæ§å¶ if (!AfterSave(omodel.HInterID, omodel.HICMOInterID, omodel.HICMOEntryID, omodel.HICMOBillNo, 1, ref sReturn)) { sReturn = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); oCn.RollBack(); return false; } //========================================================= sReturn = omodel.HInterID.ToString(); oCn.Commit();