From 2c94ac81135dea89de381ba6985fc48fa3e800b6 Mon Sep 17 00:00:00 2001 From: duhe <226547893@qq.com> Date: 星期一, 29 一月 2024 13:31:50 +0800 Subject: [PATCH] 1 --- WebAPI/DLL/工资管理/ClsPay_OtherBalBill.cs | 105 ++ Model/项目管理/ClsPM_WorkReportWeekBillMain.cs | 25 WebAPI/Controllers/CJGL/Sc_ProcExchWorkBackBillController.cs | 53 + WebAPI/Controllers/工资管理/Pay_ProcPriceRequestBillController.cs | 68 + WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs | 110 ++ WebAPI/Controllers/CJGL/Sc_ProcExchSendWorkBillController.cs | 52 + Model/Model.csproj | 2 WebAPI/Controllers/CGGL/Cg_PORequestBillController.cs | 303 +++++- Model/项目管理/ClsPM_WorkReportWeekBillSub.cs | 11 WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs | 51 + WebAPI/Controllers/工资管理/Pay_ErrWorkTimesRequestBillController.cs | 68 + WebAPI/Controllers/CJGL/Cj_StationInBillController.cs | 88 + WebAPI/Controllers/品质管理/工序检验单/MES_ProcessCheckBill_PDAController.cs | 80 + WebAPI/Controllers/项目管理/工作周计划/PM_WorkTaskWeekBillController.cs | 390 +++++++++ WebAPI/Controllers/CJGL/Sc_ProcExchWWSendWorkBillController.cs | 443 ++++++++++ WebAPI/ListModels.cs | 11 WebAPI/Controllers/CJGL/Sc_ProcExchRecordBackBillController.cs | 80 + WebAPI/DLL/工资管理/ClsPay_WorkTimesBill.cs | 82 + WebAPI/Web.config | 6 DAL/DAL.csproj | 1 WebAPI/Controllers/CJGL/Cj_StationEntrustInBillController.cs | 80 + WebAPI/Controllers/工资管理/Pay_SingleBalBillController.cs | 68 + DAL/项目管理/ClsPM_WorkReportWeekBillMain.cs | 298 ++++++ WebAPI/Controllers/工资管理/Pay_GroupBalBillController.cs | 68 + 24 files changed, 2,372 insertions(+), 171 deletions(-) diff --git a/DAL/DAL.csproj b/DAL/DAL.csproj index 4edd66c..70fea56 100644 --- a/DAL/DAL.csproj +++ b/DAL/DAL.csproj @@ -775,6 +775,7 @@ <Compile Include="閿�鍞鐞哱鍗曡瘉绠$悊\ClsXs_CustomsSplitPackBill.cs" /> <Compile Include="閿�鍞鐞哱鍗曡瘉绠$悊\ClsXs_LadingBill.cs" /> <Compile Include="閿�鍞鐞哱鍗曡瘉绠$悊\ClsXs_ShippingAdviceBill.cs" /> + <Compile Include="椤圭洰绠$悊\ClsPM_WorkReportWeekBillMain.cs" /> <Compile Include="椤圭洰绠$悊\ClsPM_WorkTaskWeekBill.cs" /> <Compile Include="椤圭洰绠$悊\ClsPro_DesignBlueRequestBill.cs" /> <Compile Include="椤圭洰绠$悊\ClsPro_ProjectCheckBill.cs" /> diff --git "a/DAL/\351\241\271\347\233\256\347\256\241\347\220\206/ClsPM_WorkReportWeekBillMain.cs" "b/DAL/\351\241\271\347\233\256\347\256\241\347\220\206/ClsPM_WorkReportWeekBillMain.cs" new file mode 100644 index 0000000..23098f3 --- /dev/null +++ "b/DAL/\351\241\271\347\233\256\347\256\241\347\220\206/ClsPM_WorkReportWeekBillMain.cs" @@ -0,0 +1,298 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; +using System.Data; + +namespace DAL +{ + public class ClsPM_WorkReportWeekBillMain : DBUtility.ClsXt_BaseBill + { + public Model.ClsPM_WorkReportWeekBillMain omodel = new Model.ClsPM_WorkReportWeekBillMain(); + public List<Model.ClsPM_WorkReportWeekBillSub> DetailColl = new List<Model.ClsPM_WorkReportWeekBillSub>(); + + public ClsPM_WorkReportWeekBillMain() + { + base.MvarItemKeySub = "PM_WorkReportWeekBillSub"; + base.MvarItemKeySub2 = ""; + base.MvarItemKeySub3 = ""; + base.MvarItemKeySub4 = ""; + base.MvarItemKey= "PM_WorkReportWeekBillMain"; + base.MvarReportTitle="宸ヤ綔鍛ㄦ�荤粨"; + base.BillType="4757"; + base.HBillSubType = "4757"; + + } + + #region 鍥哄畾浠g爜 + #region 鏃犲弬鏋勯�犲嚱鏁� + ~ClsPM_WorkReportWeekBillMain() + { + DetailColl = null; + } + #endregion + #endregion + + #region 淇敼鍗曟嵁 + public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) + { + try + { + oCn.BeginTran(); + //鏇存柊涓昏〃 + string mainSql = "update PM_WorkReportWeekBillMain set " + + " HBillNo = '" + omodel.HBillNo + + "', HDate = '" + omodel.HDate + + "', HYear = " + omodel.HYear + + ", HPeriod = " + omodel.HPeriod + + ", HRemark = '" + omodel.HRemark + + "', HUpDater = '" + omodel.HUpDater + + "', HUpDateDate = getdate()" + + //=============================================================== + ", HOrgID = " + omodel.HOrgID + + ", HYear = " + omodel.HYear + + ", HWeek = " + omodel.HWeek + + ", HBeginDate = '" + omodel.HBeginDate + + "', HEndDate = '" + omodel.HEndDate + + "', HPlanEmpID = " + omodel.HReportEmpID + + " where HInterID = " + omodel.HInterID; + + //鍒犻櫎鍏宠仈 + DeleteRelation(ref sReturn, lngBillKey); + //鍒犻櫎瀛愯〃 + DeleteBillSub(lngBillKey); + + ////鎻掑叆瀛愯〃 + //omodel.HInterID = lngBillKey; + //foreach (Model.ClsPM_WorkTaskWeekBillSub oSub in DetailColl) + //{ + // string subSql = "insert into PM_WorkTaskWeekBillSub" + + // "(HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + + // ",HWeekDay,HSno,HProjectID,HProjectStageID,HTaskNote,HPlanTimes) " + + // " values(" + + // "" + omodel.HInterID.ToString() + + // "," + oSub.HEntryID.ToString() + + // ",'" + oSub.HCloseMan + + // "','" + oSub.HEntryCloseDate + + // "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + + // ",'" + oSub.HRemark + + // "'," + oSub.HSourceInterID + + // "," + oSub.HSourceEntryID + + // ",'" + oSub.HSourceBillNo + + // "','" + oSub.HSourceBillType + + // "'," + oSub.HRelationQty + + // "," + oSub.HRelationMoney + + // "," + oSub.HWeekDay + + // "," + oSub.HSno + + // "," + oSub.HProjectID + + // "," + oSub.HProjectStageID + + // ",'" + oSub.HTaskNote + + // "'," + oSub.HPlanTimes + + // ")"; + // oCn.RunProc(subSql); + //} + + sReturn = "淇敼鍗曟嵁鎴愬姛锛�"; + oCn.Commit(); + return true; + } + catch (Exception e) + { + sReturn = e.Message; + oCn.RollBack(); + throw (e); + } + } + #endregion + + #region 鏂板鍗曟嵁 + public override bool AddBill(ref string sReturn) + { + try + { + DataSet ds; + + + oCn.BeginTran(); + + //妫�鏌ヤ富琛ㄥ唴鐮佹槸鍚﹂噸澶嶏紝鑻ラ噸澶嶅垯閲嶆柊鐢熸垚骞剁户缁鏌ワ紝鐩村埌涓嶅啀閲嶅 + while (true) + { + ds = oCn.RunProcReturn("select * from PM_WorkReportWeekBillMain where HInterID = " + omodel.HInterID, "PM_WorkReportWeekBillMain"); + if(ds!=null && ds.Tables[0].Rows.Count > 0) + { + omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); + } + else + { + break; + } + } + + //鎻掑叆涓昏〃 + string mainSql = "insert into PM_WorkReportWeekBillMain" + + "(HYear,HPeriod,HBillType,HBillSubType,HInterID,HDate,HBillNo,HRemark,HMaker,HMakeDate" + + ",HOrgID,HWeek,HBeginDate,HEndDate,HReportEmpID,HPlanTimes,HUseTimes,HRelUseTimes,HDelayTasks,HFineTasks,HFinishRate,HWorkReport,HNextPlan,HWorkGain ) " + + "values(" + + "" + omodel.HYear.ToString() + + "," + omodel.HPeriod.ToString() + + ",'" + this.BillType + + "','" + this.HBillSubType + + "'," + omodel.HInterID + + ",'" + omodel.HDate + + "','" + omodel.HBillNo + + "','" + omodel.HRemark + + "','" + omodel.HMaker + + "','" + omodel.HMakeDate + + "'," + omodel.HOrgID + + "," + omodel.HWeek + + ",'" + omodel.HBeginDate + + "','" + omodel.HEndDate + + "'," + omodel.HReportEmpID + + "," + omodel.HPlanTimes + + "," + omodel.HUseTimes + + "," + omodel.HRelUseTimes + + "," + omodel.HDelayTasks + + "," + omodel.HFineTasks + + ",'" + omodel.HFinishRate+ + "','" + omodel.HWorkReport+ + "','" + omodel.HNextPlan+ + "','" + omodel.HWorkGain+ + "')"; + + oCn.RunProc(mainSql); + + ////鎻掑叆瀛愯〃 + //foreach (Model.ClsPM_WorkTaskWeekBillSub oSub in DetailColl) + //{ + // string subSql = "insert into PM_WorkTaskWeekBillSub" + + // "(HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + + // ",HWeekDay,HSno,HProjectID,HProjectStageID,HTaskNote,HPlanTimes) " + + // " values(" + + // "" + omodel.HInterID.ToString() + + // "," + oSub.HEntryID.ToString() + + // ",'" + oSub.HCloseMan + + // "','" + oSub.HEntryCloseDate + + // "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + + // ",'" + oSub.HRemark + + // "'," + oSub.HSourceInterID + + // "," + oSub.HSourceEntryID + + // ",'" + oSub.HSourceBillNo + + // "','" + oSub.HSourceBillType + + // "'," + oSub.HRelationQty + + // "," + oSub.HRelationMoney + + // "," + oSub.HWeekDay + + // "," + oSub.HSno + + // "," + oSub.HProjectID + + // "," + oSub.HProjectStageID + + // ",'" + oSub.HTaskNote + + // "'," + oSub.HPlanTimes + + // ")"; + // oCn.RunProc(subSql); + //} + sReturn = "鏂板鍗曟嵁鎴愬姛锛�"; + oCn.Commit(); + return true; + } + catch (Exception e) + { + sReturn = e.Message; + oCn.RollBack(); + throw (e); + } + } + #endregion + + #region 鏄剧ず鍗曟嵁 + //public override bool ShowBill(Int64 lngBillKey, ref string sReturn) + //{ + // try + // { + // //鏌ヨ涓昏〃 + // DataSet Ds ; + // Ds = oCn.RunProcReturn("select * from PM_WorkReportWeekBillMain Where HInterID = " + lngBillKey.ToString(), "PM_WorkReportWeekBillMain"); + // if(Ds.Tables[0].Rows.Count==0) + // { + // sReturn = "鍗曟嵁鏈壘鍒帮紒"; + // return false; + // } + + // //鍥哄畾璧嬪��=========================================== + // omodel.HYear = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HYear"]); + // omodel.HPeriod = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPeriod"]); + // omodel.HBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillType"]); + // omodel.HBillSubType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillSubType"]); + // omodel.HInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"]); + // omodel.HDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HDate"]); + // omodel.HBillNo = Ds.Tables[0].Rows[0]["HBillNo"].ToString().Trim(); + // omodel.HBillStatus = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HBillStatus"]); + // omodel.HCheckItemNowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNowID"]); + // omodel.HCheckItemNextID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNextID"]); + // omodel.HCheckFlowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckFlowID"]); + // omodel.HRemark = Ds.Tables[0].Rows[0]["HRemark"].ToString().Trim(); + // omodel.HBackDate = Ds.Tables[0].Rows[0]["HBackDate"].ToString().Trim(); + // omodel.HBacker = Ds.Tables[0].Rows[0]["HBacker"].ToString().Trim(); + // omodel.HCheckDate = Ds.Tables[0].Rows[0]["HCheckDate"].ToString().Trim(); + // omodel.HChecker = Ds.Tables[0].Rows[0]["HChecker"].ToString().Trim(); + // omodel.HMaker = Ds.Tables[0].Rows[0]["HMaker"].ToString().Trim(); + // omodel.HMakeDate = Ds.Tables[0].Rows[0]["HMakeDate"].ToString().Trim(); + // omodel.HUpDateDate = Ds.Tables[0].Rows[0]["HUpDateDate"].ToString().Trim(); + // omodel.HUpDater = Ds.Tables[0].Rows[0]["HUpDater"].ToString().Trim(); + // omodel.HCloseDate = Ds.Tables[0].Rows[0]["HCloseDate"].ToString().Trim(); + // omodel.HCloseMan = Ds.Tables[0].Rows[0]["HCloseMan"].ToString().Trim(); + // omodel.HCloseType = DBUtility.ClsPub.isBool(Ds.Tables[0].Rows[0]["HCloseType"]); + // omodel.HDeleteDate = Ds.Tables[0].Rows[0]["HDeleteDate"].ToString().Trim(); + // omodel.HDeleteMan = Ds.Tables[0].Rows[0]["HDeleteMan"].ToString().Trim(); + // //======================================================== + + // omodel.HOrgID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HOrgID"]); + // omodel.HWeek = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HWeek"]); + // omodel.HBeginDate = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBeginDate"]); + // omodel.HEndDate = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HEndDate"]); + // omodel.HPlanEmpID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPlanEmpID"]); + + // // + + // //寰幆 + // DataSet DsSub ; + // DsSub = oCn.RunProcReturn("select * from PM_WorkTaskWeekBillSub where HInterID = " + lngBillKey.ToString() + "order by HEntryID", "PM_WorkTaskWeekBillSub"); + // DetailColl.Clear();//娓呯┖ + // for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++) + // { + // Model.ClsPM_WorkTaskWeekBillSub oSub = new Model.ClsPM_WorkTaskWeekBillSub(); + // // 鍥哄畾璧嬪��=============================================== + // oSub.HInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HInterID"]); + // oSub.HEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HEntryID"]); + // oSub.HSourceInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceInterID"]); + // oSub.HSourceEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceEntryID"]); + // oSub.HSourceBillType = DsSub.Tables[0].Rows[i]["HSourceBillType"].ToString().Trim(); + // oSub.HSourceBillNo = DsSub.Tables[0].Rows[i]["HSourceBillNo"].ToString().Trim(); + // oSub.HRelationQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationQty"]); + // oSub.HRelationMoney = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationMoney"]); + // oSub.HCloseMan = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HCloseMan"]); + // oSub.HCloseType = DBUtility.ClsPub.isBool(DsSub.Tables[0].Rows[i]["HCloseType"]); + // oSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DsSub.Tables[0].Rows[i]["HEntryCloseDate"]); + // oSub.HRemark = DsSub.Tables[0].Rows[i]["HRemark"].ToString().Trim(); + // //=================================================== + // oSub.HWeekDay = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HWeekDay"]); + // oSub.HSno = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSno"]); + // oSub.HProjectID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HProjectID"]); + // oSub.HProjectStageID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HProjectStageID"]); + // oSub.HTaskNote = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HTaskNote"]); + // oSub.HPlanTimes = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HPlanTimes"]); + + // DetailColl.Add(oSub); + // } + // sReturn = "鏄剧ず鍗曟嵁鎴愬姛锛�"; + // return true; + // } + // catch (Exception e) + // { + // sReturn = e.Message; + // throw (e); + // } + //} + #endregion + + } + +} diff --git a/Model/Model.csproj b/Model/Model.csproj index 7ebc379..ff54f58 100644 --- a/Model/Model.csproj +++ b/Model/Model.csproj @@ -970,6 +970,8 @@ <Compile Include="閿�鍞鐞哱鍗曡瘉绠$悊\ClsXs_LadingBillSub.cs" /> <Compile Include="閿�鍞鐞哱鍗曡瘉绠$悊\ClsXs_ShippingAdviceBillMain.cs" /> <Compile Include="閿�鍞鐞哱鍗曡瘉绠$悊\ClsXs_ShippingAdviceBillSub.cs" /> + <Compile Include="椤圭洰绠$悊\ClsPM_WorkReportWeekBillSub.cs" /> + <Compile Include="椤圭洰绠$悊\ClsPM_WorkReportWeekBillMain.cs" /> <Compile Include="椤圭洰绠$悊\ClsPM_WorkTaskWeekBillSub.cs" /> <Compile Include="椤圭洰绠$悊\ClsPM_WorkTaskWeekBillMain.cs" /> <Compile Include="椤圭洰绠$悊\ClsPro_DesignBlueRequestBillMain.cs" /> diff --git "a/Model/\351\241\271\347\233\256\347\256\241\347\220\206/ClsPM_WorkReportWeekBillMain.cs" "b/Model/\351\241\271\347\233\256\347\256\241\347\220\206/ClsPM_WorkReportWeekBillMain.cs" new file mode 100644 index 0000000..6a34841 --- /dev/null +++ "b/Model/\351\241\271\347\233\256\347\256\241\347\220\206/ClsPM_WorkReportWeekBillMain.cs" @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Model +{ + public class ClsPM_WorkReportWeekBillMain : DBUtility.ClsXt_BaseBillMain + { + public Int64 HOrgID; //int 组织 + public Int64 HYear; //int 年份 + public Int64 HWeek; //int 周 + public string HBeginDate; //datetime 开始日期 + public string HEndDate; //datetime 结束日期 + public Int64 HReportEmpID; //int 总结人 + public decimal HPlanTimes; // money --计划工时 + public decimal HUseTimes; // money --消耗工时 + public decimal HRelUseTimes; // money --有效工时 + public decimal HDelayTasks; // money --延期任务 + public decimal HFineTasks; // money --超前任务 + public decimal HFinishRate; // money --达成率 + public string HWorkReport; //varchar(1000) --工作总结 + public string HNextPlan; //varchar(1000) --主导项目的下一步计划 + public string HWorkGain; //varchar(1000) --工作心得 + } +} diff --git "a/Model/\351\241\271\347\233\256\347\256\241\347\220\206/ClsPM_WorkReportWeekBillSub.cs" "b/Model/\351\241\271\347\233\256\347\256\241\347\220\206/ClsPM_WorkReportWeekBillSub.cs" new file mode 100644 index 0000000..0222659 --- /dev/null +++ "b/Model/\351\241\271\347\233\256\347\256\241\347\220\206/ClsPM_WorkReportWeekBillSub.cs" @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Model +{ + public class ClsPM_WorkReportWeekBillSub : DBUtility.ClsXt_BaseBillMain + { + + } +} diff --git a/WebAPI/Controllers/CGGL/Cg_PORequestBillController.cs b/WebAPI/Controllers/CGGL/Cg_PORequestBillController.cs index 35d7f02..c9909e6 100644 --- a/WebAPI/Controllers/CGGL/Cg_PORequestBillController.cs +++ b/WebAPI/Controllers/CGGL/Cg_PORequestBillController.cs @@ -174,6 +174,26 @@ if ((OperationType == 1 || OperationType == 2) && ds.Tables[0].Rows.Count == 0)//鏂板 { + //淇濆瓨鍓嶆帶鍒�========================================= + ds = oCN.RunProcReturn("exec h_p_Cg_PORequestBill_BeforeSaveCtrl " + HInterID, "h_p_Cg_PORequestBill_BeforeSaveCtrl"); + + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨鍓嶅垽鏂け璐ワ紒"; + objJsonResult.data = null; + return objJsonResult; + } + if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); + objJsonResult.data = null; + return objJsonResult; + } + //========================================================= DataSet Ds; Int64 NewHInterID = 1; Ds = oCN.RunProcReturn("select MAX(HInterID)HInterID from Cg_PORequestBillMain", "Cg_PORequestBillMain"); @@ -303,13 +323,33 @@ oCN.RunProc(sql); } + //淇濆瓨鍚庢帶鍒�========================================= + ds = oCN.RunProcReturn("exec h_p_Cg_PORequestBill_AfterSaveCtrl " + HInterID, "h_p_Cg_PORequestBill_AfterSaveCtrl"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨鍚庡垽鏂け璐ワ紒"; + objJsonResult.data = null; + return objJsonResult; + } + if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); + objJsonResult.data = null; + return objJsonResult; + } + //========================================================= objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = null; objJsonResult.data = null; return objJsonResult; } + [Route("Cg_PORequestBill/Cg_PORequestBillSaveApi")] [HttpPost] public object Cg_PORequestBillSaveApi([FromBody] JObject sMainSub) @@ -481,6 +521,7 @@ [HttpGet] public object AuditCg_PORequestBill(string HInterID, int Type, string user) { + string sql = ""; try { //鍒ゆ柇鏄惁鏈夊鏍告潈闄� @@ -503,90 +544,94 @@ } ClsPub.CurUserName = user; + ds = oCN.RunProcReturn("select * from Cg_PORequestBillMain where HInterID = " + int.Parse(HInterID), "Cg_PORequestBillMain"); + string HBillNo = ""; + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); + } BillOld.MvarItemKey = "Cg_PORequestBillMain"; oCN.BeginTran();//寮�濮嬩簨鍔� //Type 1 瀹℃牳 2 鍙嶅鏍� if (Type == 1) { - //鍒ゆ柇鍗曟嵁鏄惁宸茬粡瀹℃牳 - DataSet ds; - string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; - ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); - if (ds == null || ds.Tables[0].Rows.Count == 0) + //瀹℃牳鍓嶆帶鍒� + sql = "exec h_p_Cg_PORequestBill_BeforeCheckCtrl " + int.Parse(HInterID) + ",'" + HBillNo + "','" + user + "'"; + ds = oCN.RunProcReturn(sql, "h_p_Cg_PORequestBill_BeforeCheckCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦紒"; + objJsonResult.count = 1; + objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:瀹℃牳鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴"; + objJsonResult.data = null; + return objJsonResult; + + } + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; objJsonResult.data = null; return objJsonResult; } - if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) + + if (!BillOld.CheckBill(int.Parse(HInterID), HBillNo, "h_p_Cg_PORequestBill_AfterCheckCtrl", user, ref ClsPub.sExeReturnInfo)) { - if (ds.Tables[0].Rows[0]["HCloseMan"] != null && ds.Tables[0].Rows[0]["HCloseMan"].ToString() != "") - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "鍗曟嵁宸插叧闂�!涓嶈兘鍐嶆瀹℃牳锛�"; - objJsonResult.data = null; - return objJsonResult; - } - if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "") - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘鍐嶆瀹℃牳锛�"; - objJsonResult.data = null; - return objJsonResult; - } - //瀹℃牳鍗曟嵁 - if (!BillOld.CheckBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) - { - objJsonResult.code = "0"; - objJsonResult.count = 1; - objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo; - objJsonResult.data = null; - return objJsonResult; - } + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; } } else { - //鍒ゆ柇鍗曟嵁鏄惁宸茬粡鍙嶅鏍� - DataSet ds; - string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; - ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); - if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) + //鍙嶅鏍稿墠鎺у埗 + sql = "exec h_p_Cg_PORequestBill_BeforeUnCheckCtrl " + int.Parse(HInterID) + ",'" + HBillNo + "','" + user + "'"; + ds = oCN.RunProcReturn(sql, "h_p_Cg_PORequestBill_BeforeUnCheckCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) { - if (ds.Tables[0].Rows[0]["HCloseMan"] != null && ds.Tables[0].Rows[0]["HCloseMan"].ToString() != "") - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "鍗曟嵁宸插叧闂�!涓嶈兘杩涜鍙嶅鏍革紒"; - objJsonResult.data = null; - return objJsonResult; - } - if (ds.Tables[0].Rows[0]["HChecker"] == null || ds.Tables[0].Rows[0]["HChecker"].ToString() == "") - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "鍗曟嵁鏈鏍�!涓嶉渶瑕佸弽瀹℃牳!"; - objJsonResult.data = null; - return objJsonResult; - } - //鍙嶅鏍稿崟鎹� - if (!BillOld.AbandonCheck(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) - { - objJsonResult.code = "0"; - objJsonResult.count = 1; - objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + ClsPub.sExeReturnInfo; - objJsonResult.data = null; - return objJsonResult; - } + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:鍙嶅鏍稿墠鍒ゆ柇澶辫触锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�"; + objJsonResult.data = null; + return objJsonResult; + + } + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; + objJsonResult.data = null; + return objJsonResult; + } + + if (BillOld.AbandonCheck(int.Parse(HInterID), HBillNo, "h_p_Cg_PORequestBill_AfterUnCheckCtrl", user, ref ClsPub.sExeReturnInfo)) + { + SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); + //DataSet DSet = oCn.RunProcReturn("exec h_p_Sc_ICMOBill_AbandonCheckCtrl " + int.Parse(HInterID), "h_p_Sc_ICMOBill_AbandonCheckCtrl"); + + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; } } - - oCN.Commit();//鎻愪氦浜嬪姟 objJsonResult.code = "0"; objJsonResult.count = 1; @@ -737,7 +782,135 @@ } #endregion + #region 閲囪喘鐢宠鍗� 浣滃簾/鍙嶄綔搴熷姛鑳� + [Route("Cg_PORequestBill/DropCg_PORequestBill")] + [HttpGet] + public object DropCg_PORequestBill(string HInterID, int Type, string user) + { + try + { + //鍒ゆ柇鏄惁鏈変綔搴熸潈闄� + if (!DBUtility.ClsPub.Security_Log("Cg_PORequestBill_Delete", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犳潈闄愪綔搴�!"; + objJsonResult.data = null; + return objJsonResult; + } + if (string.IsNullOrWhiteSpace(HInterID)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "HInterID涓虹┖锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + ClsPub.CurUserName = user; + BillOld.MvarItemKey = "Cg_PORequestBillMain"; + oCN.BeginTran();//寮�濮嬩簨鍔� + + //Type 1 浣滃簾 2 鍙嶄綔搴� + if (Type == 1) + { + //鍒ゆ柇鍗曟嵁鏄惁宸茬粡浣滃簾 + DataSet ds; + string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; + ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦紒"; + objJsonResult.data = null; + return objJsonResult; + } + if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) + { + if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘杩涜浣滃簾!"; + objJsonResult.data = null; + return objJsonResult; + } + if (ds.Tables[0].Rows[0]["HDeleteMan"] != null && ds.Tables[0].Rows[0]["HDeleteMan"].ToString() != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸蹭綔搴�!涓嶉渶瑕佸啀浣滃簾!"; + objJsonResult.data = null; + return objJsonResult; + } + //浣滃簾鍗曟嵁 + if (!BillOld.Cancelltion(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "浣滃簾澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; + } + } + } + else + { + //鍒ゆ柇鍗曟嵁鏄惁宸茬粡鍙嶄綔搴� + DataSet ds; + string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; + ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); + if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) + { + if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘杩涜浣滃簾!"; + objJsonResult.data = null; + return objJsonResult; + } + if (ds.Tables[0].Rows[0]["HDeleteMan"] == null || ds.Tables[0].Rows[0]["HDeleteMan"].ToString() == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁鏈綔搴�!涓嶉渶瑕佸啀鍙嶄綔搴�!"; + objJsonResult.data = null; + return objJsonResult; + } + //鍙嶄綔搴熷崟鎹� + if (!BillOld.AbandonCancelltion(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍙嶄綔搴熷け璐�!鍘熷洜:" + ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; + } + } + } + + oCN.Commit();//鎻愪氦浜嬪姟 + + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鎵ц鎴愬姛锛�"; + objJsonResult.data = null; + return objJsonResult; ; + + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鎵ц澶辫触锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion } } diff --git a/WebAPI/Controllers/CJGL/Cj_StationEntrustInBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationEntrustInBillController.cs index 98940fd..8085b07 100644 --- a/WebAPI/Controllers/CJGL/Cj_StationEntrustInBillController.cs +++ b/WebAPI/Controllers/CJGL/Cj_StationEntrustInBillController.cs @@ -785,6 +785,7 @@ string msg2 = "[" + sArray[0].ToString() + "]"; string user = sArray[1].ToString();//鐢ㄦ埛鍚� string OperationType = sArray[2].ToString();//绫诲瀷 + string msg_entry = sArray[3].ToString(); //鏄庣粏琛屼俊鎭� //鍒ゆ柇鏄惁鏈夌紪杈戞潈闄� if (!DBUtility.ClsPub.Security_Log("QC_FirstPieceCheckBill_Edit", 1, false, user)) @@ -795,6 +796,8 @@ objJsonResult.data = null; return objJsonResult; } + + DAL.ClsQC_FirstPieceCheckBill BillNew = new DAL.ClsQC_FirstPieceCheckBill(); List<Model.ClsQC_FirstPieceCheckBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_FirstPieceCheckBillMain>>(msg2); string BillType = "7505"; @@ -807,6 +810,7 @@ double HPeriod = DateTime.Now.Month; long HSourceID = list[0].HSourceID;//鐢熶骇璧勬簮 long HICMOInterID = list[0].HICMOInterID;//浠诲姟鍗旾D + long HICMOEntryID = list[0].HICMOEntryID;//浠诲姟鍗曞瓙ID string HICMOBillNo = list[0].HICMOBillNo;//浠诲姟鍗� string HProcExchBillNo = list[0].HProcExchBillNo;//鎸囧紩鍗� long HMaterID = list[0].HMaterID;//浜у搧ID @@ -814,6 +818,60 @@ long HProcID = list[0].HProcID;//宸ュ簭ID long HPRDORGID = list[0].HPRDORGID;//缁勭粐ID bool HLastResult = list[0].HLastResult;//璇曟牱缁撹 + + //琛ㄤ綋鏁版嵁 + List<Model.ClsQC_FirstPieceCheckBillSub> subList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_FirstPieceCheckBillSub>>(msg_entry); + for (int i = 0; i < subList.ToArray().Length; i++) + { + if (subList.ToArray().Length >= 0) + { + Model.ClsQC_FirstPieceCheckBillSub oSub = new Model.ClsQC_FirstPieceCheckBillSub(); + oSub.HEntryID = i + 1; + oSub.HRemark = ClsPub.isStrNull(subList[i].HRemark); + oSub.HSourceInterID = ClsPub.isLong(subList[i].HSourceInterID); + oSub.HSourceEntryID = ClsPub.isLong(subList[i].HSourceEntryID); + oSub.HSourceBillType = ClsPub.isStrNull(subList[i].HSourceBillType); + oSub.HSourceBillNo = ClsPub.isStrNull(subList[i].HSourceBillNo); + oSub.HRelationQty = DBUtility.ClsPub.isDoule(subList[i].HRelationQty); + oSub.HRelationMoney = DBUtility.ClsPub.isDoule(subList[i].HRelationMoney); + oSub.HCloseMan = DBUtility.ClsPub.isStrNull(subList[i].HCloseMan); + oSub.HCloseType = DBUtility.ClsPub.isBool(subList[i].HCloseType); + oSub.HQCCheckItemID = DBUtility.ClsPub.isLong(subList[i].HQCCheckItemID); + oSub.HQCStd = DBUtility.ClsPub.isStrNull(subList[i].HQCStd); + oSub.HResult = DBUtility.ClsPub.isStrNull(subList[i].HResult); + //oSub.HProcCheckTime = HDate; + //oSub.HBillNo_bak = DBUtility.ClsPub.isStrNull(mainList[0].HBillNo); + //oSub.HProcCheckEmp = ClsPub.isLong(mainList[0].HFirstCheckEmp); + oSub.HSampleSchemeID = DBUtility.ClsPub.isLong(subList[i].HSampleSchemeID); + oSub.HSampleQty = DBUtility.ClsPub.isLong(subList[i].HSampleQty); + oSub.HSampleDamageQty = DBUtility.ClsPub.isDoule(subList[i].HSampleDamageQty); + oSub.HAcceptQty = DBUtility.ClsPub.isLong(subList[i].HAcceptQty); + oSub.HRejectQty = DBUtility.ClsPub.isLong(subList[i].HRejectQty); + oSub.HSampleUnRightQty = DBUtility.ClsPub.isDoule(subList[i].HSampleUnRightQty); + oSub.HStatus = DBUtility.ClsPub.isStrNull(subList[i].HStatus); + oSub.HUnitID = DBUtility.ClsPub.isLong(subList[i].HUnitID); + oSub.HInspectVal = DBUtility.ClsPub.isStrNull(subList[i].HInspectVal); + oSub.HTargetVal = DBUtility.ClsPub.isStrNull(subList[i].HTargetVal); + oSub.HUpLimit = DBUtility.ClsPub.isStrNull(subList[i].HUpLimit); + oSub.HDownLimit = DBUtility.ClsPub.isStrNull(subList[i].HDownLimit); + oSub.HUpOffSet = DBUtility.ClsPub.isStrNull(subList[i].HUpOffSet); + oSub.HDownOffSet = DBUtility.ClsPub.isStrNull(subList[i].HDownOffSet); + oSub.HAnalysisMethod = DBUtility.ClsPub.isStrNull(subList[i].HAnalysisMethod); + oSub.HKeyInspect = DBUtility.ClsPub.isLong(subList[i].HKeyInspect); + oSub.HInspectInstruMentID = DBUtility.ClsPub.isLong(subList[i].HInspectInstruMentID); + oSub.HInspectResult = DBUtility.ClsPub.isStrNull(subList[i].HResult == "true" ? 1 : 0); + + BillNew.DetailColl.Add(oSub); + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犳槑缁嗚淇℃伅!"; + objJsonResult.data = null; + return objJsonResult; + } + } //鍗曟嵁瀹屾暣鎬у垽鏂� if (HProcExchBillNo == "") @@ -844,11 +902,29 @@ } oCN.RunProc("Insert Into QC_FirstPieceCheckBillMain " + "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate" + - ",HYear,HPeriod,HMaterID,HSourceID,HICMOInterID,HICMOBillNo,HProcExchBillNo" + + ",HYear,HPeriod,HMaterID,HSourceID,HICMOInterID,HICMOEntryID,HICMOBillNo,HProcExchBillNo" + ",HPRDORGID,HLastResult)" + " values('" + BillType + "','" + HBillSubType + "'," + HInterID + ",'" + HBillNo + "'," + HBillStatus + ",getdate(),'" + HMaker + "',getdate()" + - "," + HYear + "," + HPeriod + ",'" + HMaterID + "','" + HSourceID + "'," + HICMOInterID + ",'" + HICMOBillNo + "','" + HProcExchBillNo + "'" + + "," + HYear + "," + HPeriod + ",'" + HMaterID + "','" + HSourceID + "'," + HICMOInterID + "," + HICMOEntryID + ",'" + HICMOBillNo + "','" + HProcExchBillNo + "'" + "," + HPRDORGID + ",'" + HLastResult + "') "); + + //鎻掑叆瀛愯〃 + foreach (Model.ClsQC_FirstPieceCheckBillSub oSub in BillNew.DetailColl) + { + oCN.RunProc("Insert into QC_FirstPieceCheckBillSub " + + " (HInterID,HBillNo_bak,HEntryID" + + ",HRemark,HSourceInterID" + + ",HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + + ",HQCCheckItemID,HQCStd,HResult" + + ",HStatus,HUnitID,HKeyInspect,HAnalysisMethod,HInspectInstruMentID,HInspectResult" + + ") values(" + + HInterID.ToString() + ",'" + oSub.HBillNo_bak + "'," + oSub.HEntryID.ToString() + ",'" + oSub.HRemark + "'," + HICMOInterID.ToString() + + "," + HICMOEntryID.ToString() + ",'" + HICMOBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + + "," + oSub.HQCCheckItemID.ToString() + ",'" + oSub.HQCStd + "','" + oSub.HResult + "'" + + ",'" + oSub.HStatus + + "'," + oSub.HUnitID + "," + oSub.HKeyInspect + ",'" + oSub.HAnalysisMethod + "'," + oSub.HInspectInstruMentID + ",'" + oSub.HInspectResult + "'" + + ") "); + } } else { diff --git a/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs index 89276bf..4d54aa5 100644 --- a/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs +++ b/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs @@ -815,8 +815,31 @@ objJsonResult.data = null; return objJsonResult; } + + //瀹℃牳鍓嶆帶鍒� + string HBillNo = oBill.omodel.HBillNo; + string sql = "exec h_p_Sc_StationInBill_BeforeCheckCtrl " + HInterID + ",'" + HBillNo + "','" + CurUserName + "'"; + ds = oCN.RunProcReturn(sql, "h_p_Sc_StationInBill_BeforeCheckCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:瀹℃牳鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴"; + objJsonResult.data = null; + return objJsonResult; + + } + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; + objJsonResult.data = null; + return objJsonResult; + } + //瀹℃牳 - if (Cj_StationInBillCheckBill(HInterID,CurUserName, ref DBUtility.ClsPub.sExeReturnInfo)) + if (Cj_StationInBillCheckBill(HInterID, HBillNo, CurUserName, ref DBUtility.ClsPub.sExeReturnInfo)) { objJsonResult.code = "1"; objJsonResult.count = 1; @@ -845,7 +868,7 @@ } //瀹℃牳 - public bool Cj_StationInBillCheckBill(Int64 lngBillKey, string CurUserName, ref string sReturn) + public bool Cj_StationInBillCheckBill(Int64 lngBillKey,string HBillNo, string CurUserName, ref string sReturn) { try { @@ -873,6 +896,23 @@ else if (Pub_Class.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HFstProc"]) == "鏄�") { } + + //瀹℃牳鍚庢帶鍒� + string sql = "exec h_p_Sc_StationInBill_AfterCheckCtrl " + lngBillKey + ",'" + HBillNo + "','" + CurUserName + "'"; + ds = oCN.RunProcReturn(sql, "h_p_Sc_StationInBill_AfterCheckCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + sReturn = "瀹℃牳杩囩▼涓嚭閿欙紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴"; + oCN.RollBack(); + return false; + } + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + sReturn = ds.Tables[0].Rows[0]["HRemark"].ToString(); + oCN.RollBack(); + return false; + } + sReturn = sReturn + " 瀹℃牳鍔熻兘锛�"; oCN.Commit(); return true; @@ -949,8 +989,31 @@ objJsonResult.data = null; return objJsonResult; } + + //鍙嶅鏍稿墠鎺у埗 + string HBillNo = oBill.omodel.HBillNo; + string sql = "exec h_p_Sc_StationInBill_BeforeUnCheckCtrl " + HInterID + ",'" + HBillNo + "','" + CurUserName + "'"; + ds = oCN.RunProcReturn(sql, "h_p_Sc_StationInBill_BeforeUnCheckCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:鍙嶅鏍稿墠鍒ゆ柇澶辫触锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�"; + objJsonResult.data = null; + return objJsonResult; + + } + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; + objJsonResult.data = null; + return objJsonResult; + } + //鍙嶅鏍� - if (Cj_StationInBillAbandonCheckBill(HInterID, CurUserName, ref DBUtility.ClsPub.sExeReturnInfo)) + if (Cj_StationInBillAbandonCheckBill(HInterID, HBillNo, CurUserName, ref DBUtility.ClsPub.sExeReturnInfo)) { objJsonResult.code = "1"; objJsonResult.count = 1; @@ -978,7 +1041,7 @@ } //鍙嶅鏍� - public bool Cj_StationInBillAbandonCheckBill(Int64 lngBillKey, string CurUserName, ref string sReturn) + public bool Cj_StationInBillAbandonCheckBill(Int64 lngBillKey,string HBillNo, string CurUserName, ref string sReturn) { if (Cj_StationInBillisUse(lngBillKey, ref sReturn)) { @@ -1011,6 +1074,23 @@ else if (Pub_Class.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HFstProc"]) == "鏄�") { } + + //鍙嶅鏍稿悗鎺у埗 + string sql = "exec h_p_Sc_StationInBill_AfterUnCheckCtrl " + lngBillKey + ",'" + HBillNo + "','" + CurUserName + "'"; + ds = oCN.RunProcReturn(sql, "h_p_Sc_StationInBill_AfterUnCheckCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + sReturn = "鍙嶅鏍歌繃绋嬩腑鍑洪敊锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�"; + oCN.RollBack(); + return false; + } + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + sReturn = ds.Tables[0].Rows[0]["HRemark"].ToString(); + oCN.RollBack(); + return false; + } + sReturn = sReturn + "鍙嶅鏍稿姛鑳斤紒"; oCN.Commit(); return true; diff --git a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs index d89d13b..cbdddbd 100644 --- a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs +++ b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs @@ -2496,12 +2496,13 @@ } - var HBillNo = HInterID.Split(','); + var HInterIDs = HInterID.Split(','); + string[] HBillNo = new string[HInterIDs.Length]; DAL.ClsSc_StationOutBill oBill = new DAL.ClsSc_StationOutBill(); - for (int i = 0; i < HBillNo.Length; i++) + for (int i = 0; i < HInterIDs.Length; i++) { - if (HBillNo[i] == "0") + if (HInterIDs[i] == "0") { objJsonResult.code = "0"; objJsonResult.count = 0; @@ -2510,7 +2511,7 @@ return objJsonResult; } //鏌ョ湅鏄惁宸插鏍�,鍏抽棴,浣滃簾 - if (oBill.ShowBill(long.Parse(HBillNo[i]), ref DBUtility.ClsPub.sExeReturnInfo)) + if (oBill.ShowBill(long.Parse(HInterIDs[i]), ref DBUtility.ClsPub.sExeReturnInfo)) { if (oBill.omodel.HChecker.Trim() != "") { @@ -2520,6 +2521,7 @@ objJsonResult.data = null; return objJsonResult; } + HBillNo[i] = oBill.omodel.HBillNo; } else { @@ -2532,10 +2534,32 @@ } int j = 0; - for (int i = 0; i < HBillNo.Length; i++) + for (int i = 0; i < HInterIDs.Length; i++) { + //瀹℃牳鍓嶆帶鍒� + string sql = "exec h_p_Sc_StationOutBill_BeforeCheckCtrl " + HInterIDs[i] + ",'" + HBillNo[i] + "','" + CurUserName + "'"; + ds = oCN.RunProcReturn(sql, "h_p_Sc_StationOutBill_BeforeCheckCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:瀹℃牳鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴"; + objJsonResult.data = null; + return objJsonResult; + } + + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; + objJsonResult.data = null; + return objJsonResult; + } + + //瀹℃牳 - if (Cj_StationOutBillCheckBill(long.Parse(HBillNo[i]), CurUserName, oBill.omodel.HLastSubProc, ref DBUtility.ClsPub.sExeReturnInfo)) + if (Cj_StationOutBillCheckBill(long.Parse(HInterIDs[i]), HBillNo[i], CurUserName, oBill.omodel.HLastSubProc, ref DBUtility.ClsPub.sExeReturnInfo)) { j += 1; } @@ -2566,7 +2590,7 @@ } //瀹℃牳 - public bool Cj_StationOutBillCheckBill(Int64 lngBillKey, string CurUserName,bool HLastSubProc, ref string sReturn) + public bool Cj_StationOutBillCheckBill(Int64 lngBillKey, string HBillNo, string CurUserName,bool HLastSubProc, ref string sReturn) { try { @@ -2594,6 +2618,23 @@ else if (Pub_Class.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HFstProc"]) == "鏄�") { } + + //瀹℃牳鍚庢帶鍒� + string sql = "exec h_p_Sc_StationOutBill_AfterCheckCtrl " + lngBillKey + ",'" + HBillNo + "','" + CurUserName + "'"; + ds = oCN.RunProcReturn(sql, "h_p_Sc_StationOutBill_AfterCheckCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + sReturn = "瀹℃牳杩囩▼涓嚭閿欙紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴"; + oCN.RollBack(); + return false; + } + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + sReturn = ds.Tables[0].Rows[0]["HRemark"].ToString(); + oCN.RollBack(); + return false; + } + sReturn = sReturn + " 瀹℃牳鍔熻兘锛�"; oCN.Commit(); return true; @@ -2640,16 +2681,17 @@ } - var HBillNo = HInterID.Split(','); + var HInterIDs = HInterID.Split(','); + string[] HBillNo = new string[HInterIDs.Length]; DAL.ClsSc_StationOutBill oBill = new DAL.ClsSc_StationOutBill(); //鑾峰彇绯荤粺鍙傛暟 string Ret = ""; oSystemParameter.ShowBill(ref Ret); - for (int i = 0; i < HBillNo.Length; i++) + for (int i = 0; i < HInterIDs.Length; i++) { - if (long.Parse(HBillNo[i]) == 0) + if (long.Parse(HInterIDs[i]) == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; @@ -2659,7 +2701,7 @@ } //鏌ョ湅鏄惁宸插鏍�,鍏抽棴,浣滃簾 - if (oBill.ShowBill(long.Parse(HBillNo[i]), ref DBUtility.ClsPub.sExeReturnInfo)) + if (oBill.ShowBill(long.Parse(HInterIDs[i]), ref DBUtility.ClsPub.sExeReturnInfo)) { if (oBill.omodel.HChecker.Trim() == "") { @@ -2682,6 +2724,8 @@ return objJsonResult; } } + + HBillNo[i] = oBill.omodel.HBillNo; } else { @@ -2694,10 +2738,31 @@ } int j = 0; - for (int i = 0; i < HBillNo.Length; i++) + for (int i = 0; i < HInterIDs.Length; i++) { + //鍙嶅鏍稿墠鎺у埗 + string sql = "exec h_p_Sc_StationOutBill_BeforeUnCheckCtrl " + HInterIDs[i] + ",'" + HBillNo[i] + "','" + CurUserName + "'"; + ds = oCN.RunProcReturn(sql, "h_p_Sc_StationOutBill_BeforeUnCheckCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:鍙嶅鏍稿墠鍒ゆ柇澶辫触锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�"; + objJsonResult.data = null; + return objJsonResult; + + } + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; + objJsonResult.data = null; + return objJsonResult; + } + //鍙嶅鏍� - if (Cj_StationOutBillAbandonCheckBill(long.Parse(HBillNo[i]), CurUserName, oBill.omodel.HLastSubProc, ref DBUtility.ClsPub.sExeReturnInfo)) + if (Cj_StationOutBillAbandonCheckBill(long.Parse(HInterIDs[i]),HBillNo[i], CurUserName, oBill.omodel.HLastSubProc, ref DBUtility.ClsPub.sExeReturnInfo)) { j += 1; } @@ -2728,7 +2793,7 @@ } //鍙嶅鏍� - public bool Cj_StationOutBillAbandonCheckBill(Int64 lngBillKey, string CurUserName, bool HLastSubProc, ref string sReturn) + public bool Cj_StationOutBillAbandonCheckBill(Int64 lngBillKey,string HBillNo, string CurUserName, bool HLastSubProc, ref string sReturn) { if (Cj_StationInBillisUse(lngBillKey, ref sReturn)) { @@ -2761,6 +2826,23 @@ else if (Pub_Class.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HFstProc"]) == "鏄�") { } + + //鍙嶅鏍稿悗鎺у埗 + string sql = "exec h_p_Sc_StationOutBill_AfterUnCheckCtrl " + lngBillKey + ",'" + HBillNo + "','" + CurUserName + "'"; + ds = oCN.RunProcReturn(sql, "h_p_Sc_StationOutBill_AfterUnCheckCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + sReturn = "鍙嶅鏍歌繃绋嬩腑鍑洪敊锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�"; + oCN.RollBack(); + return false; + } + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + sReturn = ds.Tables[0].Rows[0]["HRemark"].ToString(); + oCN.RollBack(); + return false; + } + sReturn = sReturn + "鍙嶅鏍稿姛鑳斤紒"; oCN.Commit(); return true; diff --git a/WebAPI/Controllers/CJGL/Sc_ProcExchRecordBackBillController.cs b/WebAPI/Controllers/CJGL/Sc_ProcExchRecordBackBillController.cs index a02662f..8acac9f 100644 --- a/WebAPI/Controllers/CJGL/Sc_ProcExchRecordBackBillController.cs +++ b/WebAPI/Controllers/CJGL/Sc_ProcExchRecordBackBillController.cs @@ -334,6 +334,7 @@ objJsonResult.data = null; return objJsonResult; } + string HBillNo = ""; DataSet Ds = oCN.RunProcReturn("Select * from Sc_ProcExchRecordBackBillMain Where HInterID=" + HInterID, "Sc_ProcExchRecordBackBillMain"); if (Ds.Tables[0].Rows.Count > 0) @@ -346,6 +347,28 @@ objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘鍐嶆瀹℃牳"; + objJsonResult.data = null; + return objJsonResult; + } + + //瀹℃牳鍓嶆帶鍒� + HBillNo = Ds.Tables[0].Rows[0]["HBillNo"].ToString(); + string sql = "exec h_p_Sc_ProcExchRecordBackBill_BeforeCheckCtrl " + HInterID + ",'" + HBillNo + "','" + CurUserName + "'"; + Ds = oCN.RunProcReturn(sql, "h_p_Sc_ProcExchRecordBackBill_BeforeCheckCtrl"); + if (Ds == null || Ds.Tables.Count == 0 || Ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:瀹℃牳鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴"; + objJsonResult.data = null; + return objJsonResult; + + } + if (Ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + Ds.Tables[0].Rows[0]["HRemark"].ToString(); ; objJsonResult.data = null; return objJsonResult; } @@ -363,9 +386,30 @@ return objJsonResult; } + //鍙嶅鏍稿墠鎺у埗 + HBillNo = Ds.Tables[0].Rows[0]["HBillNo"].ToString(); + string sql = "exec h_p_Sc_ProcExchRecordBackBill_BeforeUnCheckCtrl " + HInterID + ",'" + HBillNo + "','" + CurUserName + "'"; + Ds = oCN.RunProcReturn(sql, "h_p_Sc_ProcExchRecordBackBill_BeforeUnCheckCtrl"); + if (Ds == null || Ds.Tables.Count == 0 || Ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:鍙嶅鏍稿墠鍒ゆ柇澶辫触锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�"; + objJsonResult.data = null; + return objJsonResult; + + } + if (Ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + Ds.Tables[0].Rows[0]["HRemark"].ToString(); ; + objJsonResult.data = null; + return objJsonResult; + } } //瀹℃牳 - if (Cj_StationInBillCheckBill(HInterID, num, CurUserName, ref DBUtility.ClsPub.sExeReturnInfo)) + if (Cj_StationInBillCheckBill(HInterID, HBillNo, num, CurUserName, ref DBUtility.ClsPub.sExeReturnInfo)) { objJsonResult.code = "1"; objJsonResult.count = 1; @@ -403,7 +447,7 @@ } //瀹℃牳 - public bool Cj_StationInBillCheckBill(Int64 HInterID, int num, string CurUserName, ref string sReturn) + public bool Cj_StationInBillCheckBill(Int64 HInterID,string HBillNo, int num, string CurUserName, ref string sReturn) { try { @@ -411,11 +455,43 @@ if (num == 1) { oCN.RunProc(" Update Sc_ProcExchRecordBackBillMain set HChecker='" + CurUserName + "',HBillStatus=2,HCheckDate=getdate() Where HInterID=" + HInterID.ToString()); + + //瀹℃牳鍚庢帶鍒� + string sql = "exec h_p_Sc_ProcExchRecordBackBill_AfterCheckCtrl " + HInterID + ",'" + HBillNo + "','" + CurUserName + "'"; + ds = oCN.RunProcReturn(sql, "h_p_Sc_ProcExchRecordBackBill_AfterCheckCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + sReturn = "瀹℃牳杩囩▼涓嚭閿欙紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴"; + oCN.RollBack(); + return false; + } + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + sReturn = ds.Tables[0].Rows[0]["HRemark"].ToString(); + oCN.RollBack(); + return false; + } } if (num == 2) { oCN.RunProc(" Update Sc_ProcExchRecordBackBillMain set HChecker='',HBillStatus=1,HCheckDate=null Where HInterID=" + HInterID.ToString()); + + //鍙嶅鏍稿悗鎺у埗 + string sql = "exec h_p_Sc_ProcExchRecordBackBill_AfterUnCheckCtrl " + HInterID + ",'" + HBillNo + "','" + CurUserName + "'"; + ds = oCN.RunProcReturn(sql, "h_p_Sc_ProcExchRecordBackBill_AfterUnCheckCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + sReturn = "鍙嶅鏍歌繃绋嬩腑鍑洪敊锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�"; + oCN.RollBack(); + return false; + } + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + sReturn = ds.Tables[0].Rows[0]["HRemark"].ToString(); + oCN.RollBack(); + return false; + } } oCN.Commit(); diff --git a/WebAPI/Controllers/CJGL/Sc_ProcExchSendWorkBillController.cs b/WebAPI/Controllers/CJGL/Sc_ProcExchSendWorkBillController.cs index b1163f9..381c87c 100644 --- a/WebAPI/Controllers/CJGL/Sc_ProcExchSendWorkBillController.cs +++ b/WebAPI/Controllers/CJGL/Sc_ProcExchSendWorkBillController.cs @@ -315,8 +315,31 @@ return objJsonResult; } } + + //瀹℃牳鍓嶆帶鍒� + string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); + sql = "exec h_p_Sc_ProcExchSendWorkBill_BeforeCheckCtrl " + int.Parse(HInterID) + ",'" + HBillNo + "','" + user + "'"; + ds = oCN.RunProcReturn(sql, "h_p_Sc_ProcExchSendWorkBill_BeforeCheckCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:瀹℃牳鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴"; + objJsonResult.data = null; + return objJsonResult; + + } + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; + objJsonResult.data = null; + return objJsonResult; + } + //瀹℃牳鍗曟嵁 - if (!BillOld.CheckBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) + if (!BillOld.CheckBill(Int64.Parse(HInterID), HBillNo, "h_p_Sc_ProcExchSendWorkBill_AfterCheckCtrl", user, ref ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; @@ -342,8 +365,31 @@ return objJsonResult; } } + + //鍙嶅鏍稿墠鎺у埗 + string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); + sql = "exec h_p_Sc_ProcExchSendWorkBill_BeforeUnCheckCtrl " + int.Parse(HInterID) + ",'" + HBillNo + "','" + user + "'"; + ds = oCN.RunProcReturn(sql, "h_p_Sc_ProcExchSendWorkBill_BeforeUnCheckCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:鍙嶅鏍稿墠鍒ゆ柇澶辫触锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�"; + objJsonResult.data = null; + return objJsonResult; + + } + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; + objJsonResult.data = null; + return objJsonResult; + } + //鍙嶅鏍稿崟鎹� - if (BillOld.AbandonCheck(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) + if (BillOld.AbandonCheck(Int64.Parse(HInterID), HBillNo, "h_p_Sc_ProcExchSendWorkBill_AfterUnCheckCtrl", user, ref ClsPub.sExeReturnInfo)) { //SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); //DataSet DSet = oCn.RunProcReturn("exec h_p_Sc_ICMOBill_AbandonCheckCtrl " + int.Parse(HInterID), "h_p_Sc_ICMOBill_AbandonCheckCtrl"); @@ -492,5 +538,7 @@ } #endregion + + } } \ No newline at end of file diff --git a/WebAPI/Controllers/CJGL/Sc_ProcExchWWSendWorkBillController.cs b/WebAPI/Controllers/CJGL/Sc_ProcExchWWSendWorkBillController.cs index eef40fe..de12efb 100644 --- a/WebAPI/Controllers/CJGL/Sc_ProcExchWWSendWorkBillController.cs +++ b/WebAPI/Controllers/CJGL/Sc_ProcExchWWSendWorkBillController.cs @@ -240,5 +240,448 @@ } //#endregion + #region 宸ュ簭濮斿娲惧伐鍗曞鏍�/鍙嶅鏍稿姛鑳� + [Route("WW_EntrustWorkOrderBill/CheckSWW_EntrustWorkOrderBill")] + [HttpGet] + public object CheckSWW_EntrustWorkOrderBill(string HInterID, int Type, string user) + { + try + { + //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄� 濮斿宸ュ簭娲惧伐鍗昣瀹℃牳 + if (!DBUtility.ClsPub.Security_Log("WW_EntrustProcSendWorkBill_Check", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犳潈闄愬鏍�!"; + objJsonResult.data = null; + return objJsonResult; + } + + if (string.IsNullOrWhiteSpace(HInterID)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "HInterID涓虹┖锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + ClsPub.CurUserName = user; + BillOld.MvarItemKey = "WW_EntrustWorkOrderBillMain"; + oCN.BeginTran();//寮�濮嬩簨鍔� + + //Type 1 瀹℃牳 2 鍙嶅鏍� + if (Type == 1) + { + //鍒ゆ柇鍗曟嵁鏄惁宸茬粡瀹℃牳 + DataSet ds; + string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; + ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); + if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) + { + if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶉渶瑕佸啀瀹℃牳!"; + objJsonResult.data = null; + return objJsonResult; + } + } + + //瀹℃牳鍓嶆帶鍒� + string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); + sql = "exec h_p_WW_EntrustWorkOrderBill_BeforeCheckCtrl " + int.Parse(HInterID) + ",'" + HBillNo + "','" + user + "'"; + ds = oCN.RunProcReturn(sql, "h_p_WW_EntrustWorkOrderBill_BeforeCheckCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:瀹℃牳鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴"; + objJsonResult.data = null; + return objJsonResult; + + } + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; + objJsonResult.data = null; + return objJsonResult; + } + + //瀹℃牳鍗曟嵁 + if (!BillOld.CheckBill(Int64.Parse(HInterID), HBillNo, "h_p_WW_EntrustWorkOrderBill_AfterCheckCtrl", user, ref ClsPub.sExeReturnInfo)) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; + } + } + else + { + //鍒ゆ柇鍗曟嵁鏄惁宸茬粡鍙嶅鏍� + DataSet ds; + string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; + ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); + if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) + { + if (ds.Tables[0].Rows[0]["HChecker"] == null || ds.Tables[0].Rows[0]["HChecker"].ToString() == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸插弽瀹℃牳!涓嶉渶瑕佸啀鍙嶅鏍�!"; + objJsonResult.data = null; + return objJsonResult; + } + } + + //鍙嶅鏍稿墠鎺у埗 + string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); + sql = "exec h_p_WW_EntrustWorkOrderBill_BeforeUnCheckCtrl " + int.Parse(HInterID) + ",'" + HBillNo + "','" + user + "'"; + ds = oCN.RunProcReturn(sql, "h_p_WW_EntrustWorkOrderBill_BeforeUnCheckCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:鍙嶅鏍稿墠鍒ゆ柇澶辫触锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�"; + objJsonResult.data = null; + return objJsonResult; + + } + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; + objJsonResult.data = null; + return objJsonResult; + } + + //鍙嶅鏍稿崟鎹� + if (BillOld.AbandonCheck(Int64.Parse(HInterID), HBillNo, "h_p_WW_EntrustWorkOrderBill_AfterUnCheckCtrl", user, ref ClsPub.sExeReturnInfo)) + { + + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; + } + } + + oCN.Commit();//鎻愪氦浜嬪姟 + + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鎵ц鎴愬姛锛�"; + objJsonResult.data = null; + return objJsonResult; ; + + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鎵ц澶辫触锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 宸ュ簭濮斿娲惧伐鍗� 鍏抽棴/鍙嶅叧闂姛鑳� + [Route("WW_EntrustWorkOrderBill/CloseWW_EntrustWorkOrderBill")] + [HttpGet] + public object CloseWW_EntrustWorkOrderBill(string HInterID, int Type, string user) + { + try + { + //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄� 濮斿宸ュ簭娲惧伐鍗昣鍏抽棴 + if (!DBUtility.ClsPub.Security_Log("WW_EntrustProcSendWorkBill_Close", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犳潈闄愬叧闂�!"; + objJsonResult.data = null; + return objJsonResult; + } + + if (string.IsNullOrWhiteSpace(HInterID)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "HInterID涓虹┖锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + ClsPub.CurUserName = user; + BillOld.MvarItemKey = "WW_EntrustWorkOrderBillMain"; + oCN.BeginTran();//寮�濮嬩簨鍔� + + //Type 1 鍏抽棴 2 鍙嶅叧闂� + if (Type == 1) + { + //鍒ゆ柇鍗曟嵁鏄惁宸茬粡鍏抽棴 + DataSet ds; + string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; + ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); + if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) + { + if (ds.Tables[0].Rows[0]["HCloseMan"] != null && ds.Tables[0].Rows[0]["HCloseMan"].ToString() != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸插叧闂�!涓嶉渶瑕佸啀鍏抽棴!"; + objJsonResult.data = null; + return objJsonResult; + } + } + //鍏抽棴鍗曟嵁 + if (!BillOld.CloseBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍏抽棴澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; + } + } + else + { + //鍒ゆ柇鍗曟嵁鏄惁宸茬粡鍙嶅叧闂� + DataSet ds; + string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; + ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); + if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) + { + if (ds.Tables[0].Rows[0]["HCloseMan"] == null || ds.Tables[0].Rows[0]["HCloseMan"].ToString() == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸插弽鍏抽棴!涓嶉渶瑕佸啀鍙嶅叧闂�!"; + objJsonResult.data = null; + return objJsonResult; + } + } + //鍙嶅叧闂崟鎹� + if (!BillOld.CancelClose(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍙嶅叧闂け璐�!鍘熷洜:" + ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; + } + } + + oCN.Commit();//鎻愪氦浜嬪姟 + + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鎵ц鎴愬姛锛�"; + objJsonResult.data = null; + return objJsonResult; ; + + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鎵ц澶辫触锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 宸ュ簭濮斿娲惧伐鍗� 浣滃簾/鍙嶄綔搴� + /// <summary> + /// </summary> + /// <param name="HInterID">鍗曟嵁ID</param> + /// <param name="IsAudit">浣滃簾(0),鍙嶄綔搴�(1)</param> + /// <param name="CurUserName">浣滃簾浜�</param> + /// <returns></returns> + [Route("WW_EntrustWorkOrderBill/DropWW_EntrustWorkOrderBill")] + [HttpGet] + public object DropWW_EntrustWorkOrderBill(int HInterID, int IsAudit, string CurUserName) + { + string ModRightNameCheck = "WW_EntrustProcSendWorkBill_Drop"; //濮斿宸ュ簭娲惧伐鍗昣浣滃簾 + DBUtility.ClsPub.CurUserName = CurUserName; + try + { + //妫�鏌ユ潈闄� + if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "浣滃簾澶辫触锛佹棤鏉冮檺锛�"; + objJsonResult.data = null; + return objJsonResult; + } + //HInterID鏁版嵁鍒ゆ柇 + if (HInterID <= 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "HInterID灏忎簬0锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + + ds = oCN.RunProcReturn("select * from WW_EntrustWorkOrderBillMain", "WW_EntrustWorkOrderBillMain"); + + //閽堝闇�瑕佽繘琛岀殑鎿嶄綔锛屾楠屽綋鍓嶅崟鎹殑鐘舵�佹槸鍚︽敮鎸侀渶瑕佽繘琛岀殑鎿嶄綔 + if (ds.Tables[0].Rows.Count>0) //鏍规嵁HInterID鑾峰彇璇ュ崟鎹殑鏁版嵁 + { + if (ds.Tables[0].Rows[0]["HChecker"].ToString() != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘杩涜浣滃簾锛�"; + objJsonResult.data = null; + return objJsonResult; + } + if (IsAudit == 0) //浣滃簾鍒ゆ柇 + { + if (ds.Tables[0].Rows[0]["HDeleteMan"].ToString() != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸蹭綔搴�!涓嶈兘鍐嶄綔搴燂紒"; + objJsonResult.data = null; + return objJsonResult; + } + } + if (IsAudit == 1) //鍙嶄綔搴熷垽鏂� + { + if (ds.Tables[0].Rows[0]["HDeleteMan"].ToString() == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁鏈綔搴�!涓嶉渶瑕佸弽浣滃簾锛�"; + objJsonResult.data = null; + return objJsonResult; + } + } + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; + } + + + //杩涜闇�瑕佽繘琛岀殑浣滃簾/鍙嶄綔搴熸搷浣� + if (IsAudit == 0) //浣滃簾鎻愪氦 + { + //浣滃簾鎻愪氦 + if (Cancelltion(HInterID, ref DBUtility.ClsPub.sExeReturnInfo) == true) + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "浣滃簾鎴愬姛"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "浣滃簾澶辫触!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; + } + } + if (IsAudit == 1) //鍙嶅叧闂彁浜� + { + //鍙嶅叧闂彁浜� + if (AbandonCancelltion(HInterID, ref DBUtility.ClsPub.sExeReturnInfo) == true) + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鍙嶄綔搴熸垚鍔�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍙嶄綔搴熷け璐�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; + } + } + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "浣滃簾澶辫触鎴栬�呭弽浣滃簾澶辫触锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + //浣滃簾 + public bool Cancelltion(Int64 lngBillKey, ref string sReturn) + { + try + { + string HDeleteMan = ClsPub.CurUserName; + string HDeleteDate = ClsPub.GetServerDate(-1); + oCN.RunProc(" Update WW_EntrustWorkOrderBillMain set HDeleteMan='" + HDeleteMan + "',HDeleteDate='" + HDeleteDate + "',HBillStatus=4 Where HInterID=" + lngBillKey.ToString()); + sReturn = ""; + return true; + } + catch (Exception e) + { + sReturn = e.Message; + throw (e); + } + } + + //鍙嶄綔搴� + public bool AbandonCancelltion(Int64 lngBillKey, ref string sReturn) + { + try + { + DataSet ds = oCN.RunProcReturn("select * from WW_EntrustWorkOrderBillMain where HInterID=" + lngBillKey.ToString(), "WW_EntrustWorkOrderBillMain"); + if (ds.Tables[0].Rows[0]["HCloseMan"].ToString() != "") + { + oCN.RunProc(" Update WW_EntrustWorkOrderBillMain set HDeleteMan='',HDeleteDate=null,HBillStatus=3 Where HInterID=" + lngBillKey.ToString()); + } + else if (ds.Tables[0].Rows[0]["HChecker"].ToString() != "") + { + oCN.RunProc(" Update WW_EntrustWorkOrderBillMain set HDeleteMan='',HDeleteDate=null,HBillStatus=2 Where HInterID=" + lngBillKey.ToString()); + } + else + { + oCN.RunProc(" Update WW_EntrustWorkOrderBillMain set HDeleteMan='',HDeleteDate=null,HBillStatus=1 Where HInterID=" + lngBillKey.ToString()); + } + sReturn = ""; + return true; + } + catch (Exception e) + { + sReturn = e.Message; + throw (e); + } + } + #endregion + } } \ No newline at end of file diff --git a/WebAPI/Controllers/CJGL/Sc_ProcExchWorkBackBillController.cs b/WebAPI/Controllers/CJGL/Sc_ProcExchWorkBackBillController.cs index efeae35..5448754 100644 --- a/WebAPI/Controllers/CJGL/Sc_ProcExchWorkBackBillController.cs +++ b/WebAPI/Controllers/CJGL/Sc_ProcExchWorkBackBillController.cs @@ -429,7 +429,7 @@ //} //#endregion - #region 宸ヨ壓璺嚎瀹℃牳/鍙嶅鏍稿姛鑳� + #region 宸ュ簭杩斿伐鐢宠鍗� 瀹℃牳/鍙嶅鏍稿姛鑳� [Route("Sc_ProcExchWorkBackBill/CheckSc_ProcExchWorkBackBill")] [HttpGet] public object CheckSc_ProcExchWorkBackBill(string HInterID, int Type, string user) @@ -477,8 +477,32 @@ return objJsonResult; } } + + + //瀹℃牳鍓嶆帶鍒� + string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); + sql = "exec h_p_Sc_ProcExchWorkBackBill_BeforeCheckCtrl " + int.Parse(HInterID) + ",'" + HBillNo + "','" + user + "'"; + ds = oCN.RunProcReturn(sql, "h_p_Sc_ProcExchWorkBackBill_BeforeCheckCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:瀹℃牳鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴"; + objJsonResult.data = null; + return objJsonResult; + + } + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; + objJsonResult.data = null; + return objJsonResult; + } + //瀹℃牳鍗曟嵁 - if (!BillOld.CheckBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) + if (!BillOld.CheckBill(Int64.Parse(HInterID), HBillNo, "h_p_Sc_ProcExchWorkBackBill_AfterCheckCtrl", user, ref ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; @@ -504,8 +528,31 @@ return objJsonResult; } } + + //鍙嶅鏍稿墠鎺у埗 + string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); + sql = "exec h_p_Sc_ProcExchWorkBackBill_BeforeUnCheckCtrl " + int.Parse(HInterID) + ",'" + HBillNo + "','" + user + "'"; + ds = oCN.RunProcReturn(sql, "h_p_Sc_ProcExchWorkBackBill_BeforeUnCheckCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:鍙嶅鏍稿墠鍒ゆ柇澶辫触锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�"; + objJsonResult.data = null; + return objJsonResult; + + } + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; + objJsonResult.data = null; + return objJsonResult; + } + //鍙嶅鏍稿崟鎹� - if (BillOld.AbandonCheck(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) + if (BillOld.AbandonCheck(Int64.Parse(HInterID), HBillNo, "h_p_Sc_ProcExchWorkBackBill_AfterUnCheckCtrl", user, ref ClsPub.sExeReturnInfo)) { //SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); //DataSet DSet = oCn.RunProcReturn("exec h_p_Sc_ICMOBill_AbandonCheckCtrl " + int.Parse(HInterID), "h_p_Sc_ICMOBill_AbandonCheckCtrl"); diff --git a/WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs b/WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs index c59a0d6..8360cc1 100644 --- a/WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs +++ b/WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs @@ -1386,8 +1386,32 @@ return objJsonResult; } } + + //瀹℃牳鍓嶆帶鍒� + string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); + sql = "exec h_p_Sc_ProcessExchangeBill_BeforeCheckCtrl " + int.Parse(HInterID) + ",'" + HBillNo + "','" + user + "'"; + ds = oCN.RunProcReturn(sql, "h_p_Sc_ProcessExchangeBill_BeforeCheckCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:瀹℃牳鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴"; + objJsonResult.data = null; + return objJsonResult; + + } + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; + objJsonResult.data = null; + return objJsonResult; + } + + //瀹℃牳鍗曟嵁 - if (!BillOld.CheckBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) + if (!BillOld.CheckBill(Int64.Parse(HInterID), HBillNo, "h_p_Sc_ProcessExchangeBill_AfterCheckCtrl", user, ref ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; @@ -1413,8 +1437,31 @@ return objJsonResult; } } + + //鍙嶅鏍稿墠鎺у埗 + string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); + sql = "exec h_p_Sc_ProcessExchangeBill_BeforeUnCheckCtrl " + int.Parse(HInterID) + ",'" + HBillNo + "','" + user + "'"; + ds = oCN.RunProcReturn(sql, "h_p_Sc_ProcessExchangeBill_BeforeUnCheckCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:鍙嶅鏍稿墠鍒ゆ柇澶辫触锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�"; + objJsonResult.data = null; + return objJsonResult; + + } + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; + objJsonResult.data = null; + return objJsonResult; + } + //鍙嶅鏍稿崟鎹� - if (BillOld.AbandonCheck(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) + if (BillOld.AbandonCheck(Int64.Parse(HInterID), HBillNo, "h_p_Sc_ProcessExchangeBill_AfterUnCheckCtrl", user, ref ClsPub.sExeReturnInfo)) { //SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); //DataSet DSet = oCn.RunProcReturn("exec h_p_Sc_ICMOBill_AbandonCheckCtrl " + int.Parse(HInterID), "h_p_Sc_ICMOBill_AbandonCheckCtrl"); diff --git "a/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\345\267\245\345\272\217\346\243\200\351\252\214\345\215\225/MES_ProcessCheckBill_PDAController.cs" "b/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\345\267\245\345\272\217\346\243\200\351\252\214\345\215\225/MES_ProcessCheckBill_PDAController.cs" index 0091e7f..feef7f9 100644 --- "a/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\345\267\245\345\272\217\346\243\200\351\252\214\345\215\225/MES_ProcessCheckBill_PDAController.cs" +++ "b/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\345\267\245\345\272\217\346\243\200\351\252\214\345\215\225/MES_ProcessCheckBill_PDAController.cs" @@ -34,6 +34,7 @@ string msg2 = "[" + sArray[0].ToString() + "]"; string user = sArray[1].ToString();//鐢ㄦ埛鍚� string OperationType = sArray[2].ToString();//绫诲瀷 + string msg_entry = sArray[3].ToString(); //鏄庣粏琛屼俊鎭� //鍒ゆ柇鏄惁鏈夌紪杈戞潈闄� if (!DBUtility.ClsPub.Security_Log("QC_ProcessCheckBill_Edit", 1, false, user)) @@ -44,6 +45,7 @@ objJsonResult.data = null; return objJsonResult; } + DAL.ClsQC_ProcessCheckBill BillNew = new DAL.ClsQC_ProcessCheckBill(); List<Model.ClsQC_ProcessCheckBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_ProcessCheckBillMain>>(msg2); string BillType = "7507"; @@ -56,6 +58,7 @@ double HPeriod = DateTime.Now.Month; long HSourceID = list[0].HSourceID;//鐢熶骇璧勬簮 long HICMOInterID = list[0].HICMOInterID;//浠诲姟鍗旾D + long HICMOEntryID = list[0].HICMOEntryID;//浠诲姟鍗曞瓙ID string HICMOBillNo = list[0].HICMOBillNo;//浠诲姟鍗� string HProcExchBillNo = list[0].HProcExchBillNo;//鎸囧紩鍗� long HMaterID = list[0].HMaterID;//浜у搧ID @@ -63,6 +66,61 @@ long HProcID = list[0].HProcID;//宸ュ簭ID long HPRDORGID = list[0].HPRDORGID;//缁勭粐ID bool HLastResult = list[0].HLastResult;//璇曟牱缁撹 + + //琛ㄤ綋鏁版嵁 + List<Model.ClsQC_ProcessCheckBillSub> subList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_ProcessCheckBillSub>>(msg_entry); + for (int i = 0; i < subList.ToArray().Length; i++) + { + if (subList.ToArray().Length >= 0) + { + Model.ClsQC_ProcessCheckBillSub oSub = new Model.ClsQC_ProcessCheckBillSub(); + oSub.HEntryID = i + 1; + oSub.HRemark = ClsPub.isStrNull(subList[i].HRemark); + oSub.HSourceInterID = ClsPub.isLong(subList[i].HSourceInterID); + oSub.HSourceEntryID = ClsPub.isLong(subList[i].HSourceEntryID); + oSub.HSourceBillType = ClsPub.isStrNull(subList[i].HSourceBillType); + oSub.HSourceBillNo = ClsPub.isStrNull(subList[i].HSourceBillNo); + oSub.HRelationQty = DBUtility.ClsPub.isDoule(subList[i].HRelationQty); + oSub.HRelationMoney = DBUtility.ClsPub.isDoule(subList[i].HRelationMoney); + oSub.HCloseMan = DBUtility.ClsPub.isStrNull(subList[i].HCloseMan); + oSub.HCloseType = DBUtility.ClsPub.isBool(subList[i].HCloseType); + oSub.HQCCheckItemID = DBUtility.ClsPub.isLong(subList[i].HQCCheckItemID); + oSub.HQCStd = DBUtility.ClsPub.isStrNull(subList[i].HQCStd); + oSub.HResult = DBUtility.ClsPub.isStrNull(subList[i].HResult); + oSub.HQCRelValue = DBUtility.ClsPub.isStrNull(subList[i].HQCRelValue); + //oSub.HProcCheckTime = HDate; + //oSub.HBillNo_bak = DBUtility.ClsPub.isStrNull(mainList[0].HBillNo); + //oSub.HProcCheckEmp = ClsPub.isLong(mainList[0].HFirstCheckEmp); + oSub.HSampleSchemeID = DBUtility.ClsPub.isLong(subList[i].HSampleSchemeID); + oSub.HSampleQty = DBUtility.ClsPub.isLong(subList[i].HSampleQty); + oSub.HSampleDamageQty = DBUtility.ClsPub.isDoule(subList[i].HSampleDamageQty); + oSub.HAcceptQty = DBUtility.ClsPub.isLong(subList[i].HAcceptQty); + oSub.HRejectQty = DBUtility.ClsPub.isLong(subList[i].HRejectQty); + oSub.HSampleUnRightQty = DBUtility.ClsPub.isDoule(subList[i].HSampleUnRightQty); + oSub.HStatus = DBUtility.ClsPub.isStrNull(subList[i].HStatus); + oSub.HUnitID = DBUtility.ClsPub.isLong(subList[i].HUnitID); + oSub.HInspectVal = DBUtility.ClsPub.isStrNull(subList[i].HInspectVal); + oSub.HTargetVal = DBUtility.ClsPub.isStrNull(subList[i].HTargetVal); + oSub.HUpLimit = DBUtility.ClsPub.isStrNull(subList[i].HUpLimit); + oSub.HDownLimit = DBUtility.ClsPub.isStrNull(subList[i].HDownLimit); + oSub.HUpOffSet = DBUtility.ClsPub.isStrNull(subList[i].HUpOffSet); + oSub.HDownOffSet = DBUtility.ClsPub.isStrNull(subList[i].HDownOffSet); + oSub.HAnalysisMethod = DBUtility.ClsPub.isStrNull(subList[i].HAnalysisMethod); + oSub.HKeyInspect = DBUtility.ClsPub.isLong(subList[i].HKeyInspect); + oSub.HInspectInstruMentID = DBUtility.ClsPub.isLong(subList[i].HInspectInstruMentID); + oSub.HInspectResult = DBUtility.ClsPub.isStrNull(subList[i].HResult == "true" ? 1 : 0); + + BillNew.DetailColl.Add(oSub); + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犳槑缁嗚淇℃伅!"; + objJsonResult.data = null; + return objJsonResult; + } + } //鍗曟嵁瀹屾暣鎬у垽鏂� if (HProcExchBillNo == "") @@ -93,11 +151,29 @@ } oCN.RunProc("Insert Into QC_ProcessCheckBillMain " + "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate" + - ",HYear,HPeriod,HMaterID,HSourceID,HICMOInterID,HICMOBillNo,HProcExchBillNo" + + ",HYear,HPeriod,HMaterID,HSourceID,HICMOInterID,HICMOEntryID,HICMOBillNo,HProcExchBillNo" + ",HPRDORGID,HLastResult)" + " values('" + BillType + "','" + HBillSubType + "'," + HInterID + ",'" + HBillNo + "'," + HBillStatus + ",getdate(),'" + HMaker + "',getdate()" + - "," + HYear + "," + HPeriod + ",'" + HMaterID + "','" + HSourceID + "'," + HICMOInterID + ",'" + HICMOBillNo + "','" + HProcExchBillNo + "'" + + "," + HYear + "," + HPeriod + ",'" + HMaterID + "','" + HSourceID + "'," + HICMOInterID + "," + HICMOEntryID + ",'" + HICMOBillNo + "','" + HProcExchBillNo + "'" + "," + HPRDORGID + ",'" + HLastResult + "') "); + + //鎻掑叆瀛愯〃 + foreach (Model.ClsQC_ProcessCheckBillSub oSub in BillNew.DetailColl) + { + oCN.RunProc("Insert into QC_ProcessCheckBillSub " + + " (HInterID,HBillNo_bak,HEntryID" + + ",HRemark,HSourceInterID" + + ",HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + + ",HQCCheckClassID,HQCCheckItemID,HQCStd,HQCRelValue,HResult" + + ",HProcCheckEmp,HProcCheckTime,HStatus,HUnitID,HKeyInspect,HAnalysisMethod,HInspectInstruMentID,HInspectResult" + + ") values(" + + HInterID.ToString() + ",'" + oSub.HBillNo_bak + "'," + oSub.HEntryID.ToString() + ",'" + oSub.HRemark + "'," + HICMOInterID.ToString() + + "," + HICMOEntryID.ToString() + ",'" + HICMOBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + + "," + oSub.HQCCheckClassID.ToString() + "," + oSub.HQCCheckItemID.ToString() + ",'" + oSub.HQCStd + "','" + oSub.HQCRelValue + "','" + oSub.HResult + "'" + + "," + oSub.HProcCheckEmp.ToString() + ",GETDATE()" + ",'" + oSub.HStatus + + "'," + oSub.HUnitID + "," + oSub.HKeyInspect + ",'" + oSub.HAnalysisMethod + "'," + oSub.HInspectInstruMentID + ",'" + oSub.HInspectResult + "'" + + ") "); + } } else { diff --git "a/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_ErrWorkTimesRequestBillController.cs" "b/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_ErrWorkTimesRequestBillController.cs" index 87789e0..6f4d10e 100644 --- "a/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_ErrWorkTimesRequestBillController.cs" +++ "b/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_ErrWorkTimesRequestBillController.cs" @@ -205,19 +205,27 @@ string HBackerDate = mainList[0].HBackerDate; string HBackRemark = mainList[0].HBackRemark; - - //if (OperationType == 2) - //{ - // ds = oCN.RunProcReturn("select * from PM_ProjectBillMain where HBillNo ='" + HBillNo + "'", "PM_ProjectBillMain"); - // if (ds.Tables[0].Rows.Count > 0) - // { - // objJsonResult.code = "0"; - // objJsonResult.count = 0; - // objJsonResult.Message = "鍗曟嵁鍙烽噸澶�,璇烽噸鏂拌緭鍏�!"; - // objJsonResult.data = null; - // return objJsonResult; - // } - //} + //淇濆瓨鍓嶆帶鍒� + DataSet BeforeDs = oCN.RunProcReturn("Exec h_p_Pay_ErrWorkTimesRequestBill_BeforeSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Pay_ErrWorkTimesRequestBill_BeforeSaveCtrl"); + if (BeforeDs == null || BeforeDs.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨鍓嶅垽鏂け璐ワ紒"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + if (DBUtility.ClsPub.isLong(BeforeDs.Tables[0].Rows[0]["HBack"]) == 1) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.isStrNull(BeforeDs.Tables[0].Rows[0]["HRemark"]); + objJsonResult.data = null; + return objJsonResult; + } + } ds = oCN.RunProcReturn("select * from Pay_ErrWorkTimesRequestBillMain where HInterID = " + HInterID + " and HBillNo = '" + HBillNo + "'", "Pay_ErrWorkTimesRequestBillMain"); @@ -300,11 +308,35 @@ return objJsonResult; } - objJsonResult.code = "1"; - objJsonResult.count = 1; - objJsonResult.Message = null; - objJsonResult.data = null; - return objJsonResult; + //淇濆瓨鍚庢帶鍒� + DataSet AfterDs = oCN.RunProcReturn("Exec h_p_Pay_ErrWorkTimesRequestBill_AfterSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Pay_ErrWorkTimesRequestBill_AfterSaveCtrl"); + if (AfterDs == null || AfterDs.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨鍚庡垽鏂け璐ワ紒"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + if (DBUtility.ClsPub.isLong(AfterDs.Tables[0].Rows[0]["HBack"]) == 1) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.isStrNull(AfterDs.Tables[0].Rows[0]["HRemark"]); + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = null; + objJsonResult.data = null; + return objJsonResult; + } + } } catch (Exception e) { diff --git "a/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_GroupBalBillController.cs" "b/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_GroupBalBillController.cs" index a908599..20bd648 100644 --- "a/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_GroupBalBillController.cs" +++ "b/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_GroupBalBillController.cs" @@ -553,19 +553,27 @@ string HBackerDate = mainList[0].HBackerDate; string HBackRemark = mainList[0].HBackRemark; - - //if (OperationType == 2) - //{ - // ds = oCN.RunProcReturn("select * from PM_ProjectBillMain where HBillNo ='" + HBillNo + "'", "PM_ProjectBillMain"); - // if (ds.Tables[0].Rows.Count > 0) - // { - // objJsonResult.code = "0"; - // objJsonResult.count = 0; - // objJsonResult.Message = "鍗曟嵁鍙烽噸澶�,璇烽噸鏂拌緭鍏�!"; - // objJsonResult.data = null; - // return objJsonResult; - // } - //} + //淇濆瓨鍓嶆帶鍒� + DataSet BeforeDs = oCN.RunProcReturn("Exec h_p_Pay_GroupBalBill_BeforeSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Pay_GroupBalBill_BeforeSaveCtrl"); + if (BeforeDs == null || BeforeDs.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨鍓嶅垽鏂け璐ワ紒"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + if (DBUtility.ClsPub.isLong(BeforeDs.Tables[0].Rows[0]["HBack"]) == 1) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.isStrNull(BeforeDs.Tables[0].Rows[0]["HRemark"]); + objJsonResult.data = null; + return objJsonResult; + } + } ds = oCN.RunProcReturn("select * from Pay_GroupBalBillMain where HInterID = " + HInterID + " and HBillNo = '" + HBillNo + "'", "Pay_GroupBalBillMain"); @@ -650,11 +658,35 @@ return objJsonResult; } - objJsonResult.code = "1"; - objJsonResult.count = 1; - objJsonResult.Message = null; - objJsonResult.data = null; - return objJsonResult; + //淇濆瓨鍚庢帶鍒� + DataSet AfterDs = oCN.RunProcReturn("Exec h_p_Pay_GroupBalBill_AfterSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Pay_GroupBalBill_AfterSaveCtrl"); + if (AfterDs == null || AfterDs.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨鍚庡垽鏂け璐ワ紒"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + if (DBUtility.ClsPub.isLong(AfterDs.Tables[0].Rows[0]["HBack"]) == 1) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.isStrNull(AfterDs.Tables[0].Rows[0]["HRemark"]); + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = null; + objJsonResult.data = null; + return objJsonResult; + } + } } catch (Exception e) { diff --git "a/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_ProcPriceRequestBillController.cs" "b/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_ProcPriceRequestBillController.cs" index 20dd9a9..301ebe4 100644 --- "a/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_ProcPriceRequestBillController.cs" +++ "b/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_ProcPriceRequestBillController.cs" @@ -186,19 +186,27 @@ string HBackerDate = mainList[0].HBackerDate; string HBackRemark = mainList[0].HBackRemark; - - //if (OperationType == 2) - //{ - // ds = oCN.RunProcReturn("select * from PM_ProjectBillMain where HBillNo ='" + HBillNo + "'", "PM_ProjectBillMain"); - // if (ds.Tables[0].Rows.Count > 0) - // { - // objJsonResult.code = "0"; - // objJsonResult.count = 0; - // objJsonResult.Message = "鍗曟嵁鍙烽噸澶�,璇烽噸鏂拌緭鍏�!"; - // objJsonResult.data = null; - // return objJsonResult; - // } - //} + //淇濆瓨鍓嶆帶鍒� + DataSet BeforeDs = oCN.RunProcReturn("Exec h_p_Pay_ProcPriceRequestBill_BeforeSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Pay_ProcPriceRequestBill_BeforeSaveCtrl"); + if (BeforeDs == null || BeforeDs.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨鍓嶅垽鏂け璐ワ紒"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + if (DBUtility.ClsPub.isLong(BeforeDs.Tables[0].Rows[0]["HBack"]) == 1) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.isStrNull(BeforeDs.Tables[0].Rows[0]["HRemark"]); + objJsonResult.data = null; + return objJsonResult; + } + } ds = oCN.RunProcReturn("select * from Pay_ProcPriceRequestBillMain where HInterID = " + HInterID + " and HBillNo = '" + HBillNo + "'", "Pay_ProcPriceRequestBillMain"); @@ -264,11 +272,35 @@ return objJsonResult; } - objJsonResult.code = "1"; - objJsonResult.count = 1; - objJsonResult.Message = null; - objJsonResult.data = null; - return objJsonResult; + //淇濆瓨鍚庢帶鍒� + DataSet AfterDs = oCN.RunProcReturn("Exec h_p_Pay_ProcPriceRequestBill_AfterSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Pay_ProcPriceRequestBill_AfterSaveCtrl"); + if (AfterDs == null || AfterDs.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨鍚庡垽鏂け璐ワ紒"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + if (DBUtility.ClsPub.isLong(AfterDs.Tables[0].Rows[0]["HBack"]) == 1) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.isStrNull(AfterDs.Tables[0].Rows[0]["HRemark"]); + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = null; + objJsonResult.data = null; + return objJsonResult; + } + } } catch (Exception e) { diff --git "a/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_SingleBalBillController.cs" "b/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_SingleBalBillController.cs" index db2e970..46c44f2 100644 --- "a/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_SingleBalBillController.cs" +++ "b/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_SingleBalBillController.cs" @@ -607,20 +607,28 @@ DateTime HMakerDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString()); string HUpdater = mainList[0].HUpdater; DateTime HUpdaterDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString()); - - //if (OperationType == 2) - //{ - // ds = oCN.RunProcReturn("select * from PM_ProjectStageBillMain where HBillNo ='" + HBillNo + "'", "PM_ProjectStageBill"); - // if (ds.Tables[0].Rows.Count > 0) - // { - // objJsonResult.code = "0"; - // objJsonResult.count = 0; - // objJsonResult.Message = "鍗曟嵁鍙烽噸澶�,璇烽噸鏂拌緭鍏�!"; - // objJsonResult.data = null; - // return objJsonResult; - // } - //} + //淇濆瓨鍓嶆帶鍒� + DataSet BeforeDs = oCN.RunProcReturn("Exec h_p_Pay_SingleBalBill_BeforeSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Pay_SingleBalBill_BeforeSaveCtrl"); + if (BeforeDs == null || BeforeDs.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨鍓嶅垽鏂け璐ワ紒"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + if (DBUtility.ClsPub.isLong(BeforeDs.Tables[0].Rows[0]["HBack"]) == 1) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.isStrNull(BeforeDs.Tables[0].Rows[0]["HRemark"]); + objJsonResult.data = null; + return objJsonResult; + } + } ds = oCN.RunProcReturn("select * from Pay_SingleBalBillMain where HInterID = " + HInterID + " and HBillNo = '" + HBillNo + "'", "Pay_SingleBalBillMain"); @@ -811,11 +819,35 @@ oCN.RunProc(sql); } - objJsonResult.code = "1"; - objJsonResult.count = 1; - objJsonResult.Message = null; - objJsonResult.data = null; - return objJsonResult; + //淇濆瓨鍚庢帶鍒� + DataSet AfterDs = oCN.RunProcReturn("Exec h_p_Pay_SingleBalBill_AfterSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Pay_SingleBalBill_AfterSaveCtrl"); + if (AfterDs == null || AfterDs.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨鍚庡垽鏂け璐ワ紒"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + if (DBUtility.ClsPub.isLong(AfterDs.Tables[0].Rows[0]["HBack"]) == 1) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.isStrNull(AfterDs.Tables[0].Rows[0]["HRemark"]); + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = null; + objJsonResult.data = null; + return objJsonResult; + } + } } #endregion diff --git "a/WebAPI/Controllers/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\344\275\234\345\221\250\350\256\241\345\210\222/PM_WorkTaskWeekBillController.cs" "b/WebAPI/Controllers/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\344\275\234\345\221\250\350\256\241\345\210\222/PM_WorkTaskWeekBillController.cs" index f2b849f..50485a6 100644 --- "a/WebAPI/Controllers/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\344\275\234\345\221\250\350\256\241\345\210\222/PM_WorkTaskWeekBillController.cs" +++ "b/WebAPI/Controllers/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\344\275\234\345\221\250\350\256\241\345\210\222/PM_WorkTaskWeekBillController.cs" @@ -20,6 +20,8 @@ public SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); public DAL.ClsPM_WorkTaskWeekBill BillNew0 = new DAL.ClsPM_WorkTaskWeekBill(); //宸ヤ綔鍛ㄨ鍒掑搴斿崟鎹被 public DAL.ClsPM_WorkTaskWeekBill BillOld0 = new DAL.ClsPM_WorkTaskWeekBill(); //宸ヤ綔鍛ㄨ鍒掑搴斿崟鎹被 + public DAL.ClsPM_WorkReportWeekBillMain BillNew = new DAL.ClsPM_WorkReportWeekBillMain(); //宸ヤ綔鍛ㄦ�荤粨瀵瑰簲鍗曟嵁绫� + public DAL.ClsPM_WorkReportWeekBillMain BillOld = new DAL.ClsPM_WorkReportWeekBillMain(); //宸ヤ綔鍛ㄦ�荤粨瀵瑰簲鍗曟嵁绫� #region 宸ヤ綔鍛ㄨ鍒� 瀛愯〃2-寰呮帓璁″垝 鏁版嵁鑾峰彇 @@ -880,5 +882,393 @@ } } #endregion + + #region 宸ヤ綔鍛ㄦ�荤粨 閫夋嫨鎬荤粨浜哄甫鍑哄伐鏃� + [Route("PM_WorkTaskWeekBill/PM_WorkReportWeekBillMainList")] + [HttpGet] + public object PM_WorkReportWeekBillMainList(string HOrgID,string user,string HYear,string HWeek,string HBeginDate,string HEndDate) + { + try + { + List<object> columnNameList = new List<object>(); + //鏌ョ湅鏉冮檺 + if (!DBUtility.ClsPub.Security_Log("PM_WorkReportWeekBillMain_Query", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒"; + objJsonResult.data = null; + return objJsonResult; + } + + + + string sql = "exec h_p_PM_WorkReportWeekBillMain "+ HOrgID+","+ user+","+ HYear+","+ HWeek+",'"+ HBeginDate + "','"+ HEndDate + "'"; + ds = oCn.RunProcReturn(sql, "h_p_PM_WorkReportWeekBillMain"); + + + //娣诲姞鍒楀悕 + foreach (DataColumn col in ds.Tables[0].Columns) + { + Type dataType = col.DataType; + string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; + columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 + } + + + + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏈幏鍙栧埌鐩稿叧鏁版嵁锛�"; + objJsonResult.data = null; + } + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鏌ヨ鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString(); + objJsonResult.data = null; + } + return objJsonResult; + } + #endregion + + + #region 宸ヤ綔鍛ㄦ�荤粨淇濆瓨/缂栬緫 + /// <summary> + /// 淇濆瓨鐢熶骇棰嗘枡鍗� + /// </summary> + /// <param name="msg"></param> + /// <returns></returns> + [Route("PM_WorkTaskWeekBill/SavePM_WorkReportWeekBillMain")] + [HttpPost] + public object SavePM_WorkReportWeekBillMain([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 refSav = sArray[1].ToString(); //鎿嶄綔鏂瑰紡鏁版嵁绫诲瀷 1娣诲姞 3淇敼 2 澶嶅埗 + string user = sArray[2].ToString();//鐢ㄦ埛鍚� + + string UserName = ""; + string s = ""; + ListModels oListModels = new ListModels(); + try + { + //淇濆瓨鏉冮檺 + if (!DBUtility.ClsPub.Security_Log_second("PM_WorkReportWeekBillMain_Add", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒"; + objJsonResult.data = null; + return objJsonResult; + } + + DAL.ClsPM_WorkReportWeekBillMain oBill = new DAL.ClsPM_WorkReportWeekBillMain(); + List<Model.ClsPM_WorkReportWeekBillMain> lsmain = new List<Model.ClsPM_WorkReportWeekBillMain>(); + msg2 = msg2.Replace("\\", ""); + msg2 = msg2.Replace("\n", ""); //\n + lsmain = oListModels.getObjectByJson_PM_WorkReportWeekBillMain(msg2); + foreach (Model.ClsPM_WorkReportWeekBillMain oItem in lsmain) + { + if (refSav == "Add") + { + //鍗曟嵁鍙锋槸鍚﹂噸澶� + if (BillNew.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, BillOld.omodel.HInterID)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁鍙烽噸澶嶏紒涓嶅厑璁镐繚瀛橈紒"; + objJsonResult.data = 1; + return objJsonResult; + } + } + if (refSav == "Update") + { + if (BillOld.ShowBill(oItem.HInterID, ref s) == false) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "姝ゅ崟鎹湁璇紒"; + objJsonResult.data = 1; + return objJsonResult; + } + //鍒ゆ柇鏄惁鍙紪杈� + if (BillOld.omodel.HChecker != "" && BillOld.omodel.HChecker != null) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "姝ゅ崟鎹凡缁忚瀹℃牳锛屼笉鍏佽淇敼锛�"; + objJsonResult.data = 1; + return objJsonResult; + } + if (BillOld.omodel.HBillStatus > 1) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "姝ゅ崟鎹浜庝笉鍙紪杈戠姸鎬侊紝涓嶅厑璁镐慨鏀癸紒"; + objJsonResult.data = 1; + return objJsonResult; + } + if (!DBUtility.Xt_BaseBillFun.Fun_AllowEditBill(BillOld, ref s)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = s + "锛屼笉鍏佽淇敼"; + objJsonResult.data = 1; + return objJsonResult; + } + } + UserName = oItem.HMaker; //鍒跺崟浜� + oItem.HBillType = "4757"; + oItem.HBillSubType = "4757"; + + //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")); + + if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佹病鏈夊崟鎹棩鏈燂紝鏃犳硶淇濆瓨锛�"; + objJsonResult.data = 1; + return objJsonResult; + } + oBill.omodel = oItem; + } + + //淇濆瓨 + //淇濆瓨瀹屾瘯鍚庡鐞� + bool bResult; + if (refSav == "Add") + { + + bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); + } + else if (refSav == "Update") + { + bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); + } + else + { + bResult = false; + } + if (bResult) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "淇濆瓨鎴愬姛锛�"; + //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 宸ヤ綔鍛ㄦ�荤粨 瀹℃牳/鍙嶅鏍稿姛鑳� + [Route("PM_WorkTaskWeekBill/CheckPM_WorkReportWeekBillMain")] + [HttpGet] + public object CheckSc_ICMOReportBill(string HInterID, int IsAudit, string user) + { + try + { + //瀹℃牳鏉冮檺 + if (!DBUtility.ClsPub.Security_Log_second("PM_WorkReportWeekBillMain_Check", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + var ds = oCn.RunProcReturn("select * from PM_WorkReportWeekBillMain where HInterID=" + HInterID, "PM_WorkReportWeekBillMain"); + if (ds.Tables[0].Rows.Count > 0) + { + if (IsAudit == 0) //瀹℃牳鍒ゆ柇 + { + if (ds.Tables[0].Rows[0]["HChecker"].ToString() != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘鍐嶆瀹℃牳锛�"; + objJsonResult.data = null; + return objJsonResult; + } + } + if (IsAudit == 1) //鍙嶅鏍稿垽鏂� + { + if (ds.Tables[0].Rows[0]["HChecker"].ToString() == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁鏈鏍�!涓嶉渶瑕佸弽瀹℃牳!"; + objJsonResult.data = null; + return objJsonResult; + } + } + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!"; + objJsonResult.data = null; + return objJsonResult; + } + + oCn.BeginTran(); + + if (IsAudit == 0) //瀹℃牳鍒ゆ柇 + { + oCn.RunProc("update PM_WorkReportWeekBillMain set HChecker='" + user + "',HCheckDate=getdate() where HInterID=" + HInterID); + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "瀹℃牳鎴愬姛"; + objJsonResult.data = null; + } + if (IsAudit == 1) //鍙嶅鏍稿垽鏂� + { + oCn.RunProc("update PM_WorkReportWeekBillMain set HChecker='',HCheckDate=null where HInterID=" + HInterID); + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鍙嶅鏍告垚鍔�"; + objJsonResult.data = null; + } + oCn.Commit(); + + return objJsonResult; + } + catch (Exception e) + { + oCn.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "瀹℃牳澶辫触鎴栬�呭弽瀹℃牳澶辫触锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + + } + #endregion + + #region 宸ヤ綔鍛ㄦ�荤粨 鍏抽棴/鍙嶅叧闂姛鑳� + [Route("PM_WorkTaskWeekBill/ClosePM_WorkReportWeekBillMain")] + [HttpGet] + public object ClosePM_WorkReportWeekBillMain(string HInterID, int IsAudit, string user) + { + try + { + //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄� + if (!DBUtility.ClsPub.Security_Log("PM_WorkReportWeekBillMain_Close", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犳潈闄愬叧闂�!"; + objJsonResult.data = null; + return objJsonResult; + } + + + var ds = oCn.RunProcReturn("select * from PM_WorkReportWeekBillMain where HInterID=" + HInterID, "PM_WorkReportWeekBillMain"); + if (ds.Tables[0].Rows.Count > 0) + { + if (IsAudit == 0) //鍏抽棴鍒ゆ柇 + { + if (ds.Tables[0].Rows[0]["HCloseMan"].ToString() != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸插叧闂�!涓嶈兘鍐嶆鍏抽棴锛�"; + objJsonResult.data = null; + return objJsonResult; + } + } + if (IsAudit == 1) //鍙嶅叧闂垽鏂� + { + if (ds.Tables[0].Rows[0]["HCloseMan"].ToString() == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁鏈叧闂�!涓嶉渶瑕佸弽鍏抽棴!"; + objJsonResult.data = null; + return objJsonResult; + } + } + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!"; + objJsonResult.data = null; + return objJsonResult; + } + + oCn.BeginTran(); + + if (IsAudit == 0) //瀹℃牳鍒ゆ柇 + { + oCn.RunProc("update PM_WorkReportWeekBillMain set HChecker='" + user + "',HCheckDate=getdate() where HInterID=" + HInterID); + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "瀹℃牳鎴愬姛"; + objJsonResult.data = null; + } + if (IsAudit == 1) //鍙嶅鏍稿垽鏂� + { + oCn.RunProc("update PM_WorkReportWeekBillMain set HChecker='',HCheckDate=null where HInterID=" + HInterID); + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鍙嶅鏍告垚鍔�"; + objJsonResult.data = null; + } + oCn.Commit(); + + return objJsonResult; + + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鎵ц澶辫触锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion } } diff --git "a/WebAPI/DLL/\345\267\245\350\265\204\347\256\241\347\220\206/ClsPay_OtherBalBill.cs" "b/WebAPI/DLL/\345\267\245\350\265\204\347\256\241\347\220\206/ClsPay_OtherBalBill.cs" index 047a231..3a5fe30 100644 --- "a/WebAPI/DLL/\345\267\245\350\265\204\347\256\241\347\220\206/ClsPay_OtherBalBill.cs" +++ "b/WebAPI/DLL/\345\267\245\350\265\204\347\256\241\347\220\206/ClsPay_OtherBalBill.cs" @@ -31,6 +31,87 @@ } #endregion 鑷畾涔夋柟娉� + + + //淇濆瓨鍓嶆帶鍒� + public bool BeforeSave(Int64 HInterID, string HBillNo, Int64 OperationType, ref string sReturn) + { + try + { + DataSet Ds = oCn.RunProcReturn("Exec h_p_Pay_OtherBalBill_BeforeSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Pay_OtherBalBill_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_Pay_OtherBalBill_AfterSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Pay_OtherBalBill_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 bool CheckStockQty(long HMaterID, long HWhID, string sBatchNo) + { + try + { + //鏌ヨ涓昏〃 + DataSet Ds; + Ds = oCn.RunProcReturn("Select 鍗虫椂搴撳瓨 from h_v_KF_ICInventoryList Where HMaterID=" + HMaterID.ToString() + " and HWHID=" + HWhID.ToString() + " and 鎵规='" + sBatchNo + "'", "h_v_KF_ICInventoryList"); + if (Ds.Tables[0].Rows.Count == 0) + { + return false; + } + //鍒ゆ柇鏄惁璐熷簱瀛樻垨0搴撳瓨 + if (DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0][0]) <= 0) + { + return false; + } + return true; + } + catch (Exception e) + { + throw (e); + } + } + + //淇敼鍗曟嵁 public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) { @@ -38,6 +119,12 @@ { // oCn.BeginTran(); + //淇濆瓨鍓嶆帶鍒� + if(!BeforeSave(lngBillKey, omodel.HBillNo,2, ref sReturn)) + { + oCn.RollBack(); + return false; + } //鏇存柊涓昏〃 oCn.RunProc("UpDate Pay_OtherBalBillMain set " + " HBillNo='" + omodel.HBillNo + "'" + //鍥哄畾璧嬪��=============== @@ -94,6 +181,12 @@ // return false; // } //} + //淇濆瓨鍚庢帶鍒� + if (!AfterSave(lngBillKey, omodel.HBillNo, 2, ref sReturn)) + { + oCn.RollBack(); + return false; + } sReturn = "淇敼鍗曟嵁鎴愬姛锛�"; oCn.Commit(); return true; @@ -114,6 +207,12 @@ omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� oCn.BeginTran(); + //淇濆瓨鍓嶆帶鍒� + if (!BeforeSave(omodel.HInterID, omodel.HBillNo, 1, ref sReturn)) + { + oCn.RollBack(); + return false; + } //涓昏〃 oCn.RunProc("Insert Into Pay_OtherBalBillMain " + "(HBillType,HBillSubType,HInterID,HBillNo,HDate" + @@ -159,6 +258,12 @@ // } //} // + //淇濆瓨鍚庢帶鍒� + if (!AfterSave(omodel.HInterID, omodel.HBillNo, 1, ref sReturn)) + { + oCn.RollBack(); + return false; + } sReturn = "鏂板鍗曟嵁鎴愬姛锛�"; oCn.Commit(); return true; diff --git "a/WebAPI/DLL/\345\267\245\350\265\204\347\256\241\347\220\206/ClsPay_WorkTimesBill.cs" "b/WebAPI/DLL/\345\267\245\350\265\204\347\256\241\347\220\206/ClsPay_WorkTimesBill.cs" index 2267225..4b1389a 100644 --- "a/WebAPI/DLL/\345\267\245\350\265\204\347\256\241\347\220\206/ClsPay_WorkTimesBill.cs" +++ "b/WebAPI/DLL/\345\267\245\350\265\204\347\256\241\347\220\206/ClsPay_WorkTimesBill.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_Pay_WorkTimesBill_BeforeSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Pay_WorkTimesBill_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_Pay_WorkTimesBill_AfterSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Pay_WorkTimesBill_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 Pay_WorkTimesBillMain set " + " HBillNo='" + omodel.HBillNo + "'" + //鍥哄畾璧嬪��=============== @@ -89,6 +151,12 @@ // return false; // } //} + //淇濆瓨鍚庢帶鍒� + if (!AfterSave(lngBillKey, omodel.HBillNo, 2, ref sReturn)) + { + oCn.RollBack(); + return false; + } sReturn = "淇敼鍗曟嵁鎴愬姛锛�"; oCn.Commit(); return true; @@ -109,6 +177,12 @@ omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� oCn.BeginTran(); + //淇濆瓨鍓嶆帶鍒� + if (!BeforeSave(omodel.HInterID, omodel.HBillNo, 1, ref sReturn)) + { + oCn.RollBack(); + return false; + } //涓昏〃 oCn.RunProc("Insert Into Pay_WorkTimesBillMain " + "(HBillType,HBillSubType,HInterID,HBillNo,HDate" + @@ -151,6 +225,12 @@ // } //} // + //淇濆瓨鍚庢帶鍒� + if (!AfterSave(omodel.HInterID, omodel.HBillNo, 1, ref sReturn)) + { + oCn.RollBack(); + return false; + } sReturn = "鏂板鍗曟嵁鎴愬姛锛�"; oCn.Commit(); return true; diff --git a/WebAPI/ListModels.cs b/WebAPI/ListModels.cs index bda891c..4aa0bae 100644 --- a/WebAPI/ListModels.cs +++ b/WebAPI/ListModels.cs @@ -999,6 +999,17 @@ List<Models.ClsGy_StockCheckItemBill> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsGy_StockCheckItemBill>>(jsonString); return list; } + /// <summary> + /// 澶勭悊鏂板鍛ㄦ�荤粨琛ㄧ殑json + /// </summary> + /// <param name="jsonString"></param> + /// <returns></returns> + public List<Model.ClsPM_WorkReportWeekBillMain> getObjectByJson_PM_WorkReportWeekBillMain(string jsonString) + { + jsonString = "[" + jsonString.ToString() + "]"; + List<Model.ClsPM_WorkReportWeekBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsPM_WorkReportWeekBillMain>>(jsonString); + return list; + } /// <summary> /// 澶勭悊鏂板妯″叿淇濆吇璁板綍琛ㄤ富琛ㄧ殑json diff --git a/WebAPI/Web.config b/WebAPI/Web.config index ad3f89b..1c3fe28 100644 --- a/WebAPI/Web.config +++ b/WebAPI/Web.config @@ -22,7 +22,7 @@ <!--<add key="FileIP" value="http://localhost:8082/LuBaoAPI"/>--> <!--<add key="FileIP" value="http://localhost:8080/" />--> <!--<add key="sUrl" value="http://183.129.128.86:9090/WEBS-WMSTest/WebService1.asmx"/> --> - <!--<add key="sUrl" value="http://192.168.63.20/WEBS-WMS/WebService1.asmx"/>--><!--棰滃彴寮忔満--> + <add key="sUrl" value="http://192.168.63.53/WEBS-WMS/WebService1.asmx"/><!--棰滃彴寮忔満--> <!--<add key="sUrl" value="http://60.190.4.42:9003/WebService/WebService1.asmx" /> 澶忓疂--> <!--<add key="sUrl" value="http://60.190.4.42:9003/WebService/WebService1.asmx" /> --> <!--<add key="sUrl" value="http://10.10.130.181/WEBS-WMS/WebService1.asmx"/> 鍗氭棩绉戞妧--> @@ -34,7 +34,9 @@ <!--<add key="sUrl" value="http://192.168.80.90:9090/WEBS-WMS/WebService1.asmx"/> 瀹夌憺鏈嶅姟鍣�--> <!--<add key="sUrl" value="http://47.96.97.237/WEBS-WMS/WebService1.asmx"/> --> <!--娴嬭瘯鏈嶅姟鍣�--> <!--<add key="sUrl" value="http://localhost:8082/WEBS/WebService1.asmx"/> 鏈湴--> - <add key="sUrl" value="http://192.168.56.1:81/web/WebService1.asmx"/> <!--闄堥洴闈欐湰鍦伴厤缃�--> + <!--<add key="sUrl" value="http://192.168.56.1:81/web/WebService1.asmx"/>--> <!--闄堥洴闈欐湰鍦伴厤缃�--> + <!--<add key="sUrl" value="http://192.168.1.57:8082/WEBS-WMS/WebService1.asmx"/>--> <!--涔濊彵--> + <!--<add key="sUrl" value="http://192.168.60.12/WEBS-WMS/WebService1.asmx"/>--> <!--涓帶--> <add key="webpages:Version" value="3.0.0.0" /> <add key="webpages:Enabled" value="false" /> <add key="ClientValidationEnabled" value="true" /> -- Gitblit v1.9.1