From 89759d9f7c3e92876d960ed8e7469e624f0f7f45 Mon Sep 17 00:00:00 2001
From: yxj <yxj@hz-kingdee.com>
Date: 星期五, 28 十一月 2025 16:58:50 +0800
Subject: [PATCH] 新增器具入库申请单、器具领用申请单、器具领用出库单模块所需调用方法,器具调拨申请单模块相关调用方法优化
---
Model/生产管理/模具管理/ClsSc_MouldOutRequestBillSub.cs | 35
DAL/生产管理/模具管理/ClsSc_MouldMoveStockRequestBill.cs | 3
Model/生产管理/模具管理/ClsSc_MouldOutRequestBillMain.cs | 26
WebAPI/Controllers/MJGL/Sc_MouldInRequestBillController.cs | 796 +++++++++++++
Model/Model.csproj | 4
WebAPI/Controllers/MJGL/Sc_MouldProdOutBillController.cs | 855 ++++++++++++++
WebAPI/Controllers/MJGL/Sc_MouldOutRequestBillController.cs | 796 +++++++++++++
WebAPI/Controllers/Sc_MouldRepairInBillListController.cs | 4
WebAPI/Controllers/条码管理/MouldController.cs | 2
Model/生产管理/模具管理/ClsSc_MouldInRequestBillMain.cs | 22
DAL/生产管理/模具管理/ClsSc_MouldInRequestBill.cs | 352 ++++++
DAL/DAL.csproj | 2
DAL/生产管理/模具管理/ClsSc_MouldOutRequestBill.cs | 360 ++++++
WebAPI/Controllers/MJGL/Sc_MouldMoveStockRequestBillController.cs | 26
DAL/生产管理/模具管理/ClsSc_MouldProdOutBill.cs | 100 +
Model/生产管理/模具管理/ClsSc_MouldProdOutBillSub.cs | 12
WebAPI/WebAPI.csproj | 3
Model/生产管理/模具管理/ClsSc_MouldInRequestBillSub.cs | 35
WebAPI/Controllers/Sc_MouldController.cs | 4
19 files changed, 3,403 insertions(+), 34 deletions(-)
diff --git a/DAL/DAL.csproj b/DAL/DAL.csproj
index e0ab2c5..634f637 100644
--- a/DAL/DAL.csproj
+++ b/DAL/DAL.csproj
@@ -108,6 +108,8 @@
<Compile Include="鐢熶骇绠$悊\瀹㈡埛鏍囩\ClsSc_CustomerTagInfo.cs" />
<Compile Include="鐢熶骇绠$悊\鎺掍骇瑙i攣鐢宠鍗昞ClsJIT_UnLockRequestBill.cs" />
<Compile Include="鐢熶骇绠$悊\鎺掍骇閿佸畾鐢宠鍗昞ClsJIT_LockRequestBill.cs" />
+ <Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsSc_MouldOutRequestBill.cs" />
+ <Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsSc_MouldInRequestBill.cs" />
<Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsSc_MouldMoveStockRequestBill.cs" />
<Compile Include="鐢熶骇绠$悊\璁惧绠$悊\ClsSb_EquipPatrolCheckPlanBill.cs" />
<Compile Include="鐢熶骇绠$悊\璁惧绠$悊\ClsSb_EquipPatrolCheckBill.cs" />
diff --git "a/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldInRequestBill.cs" "b/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldInRequestBill.cs"
new file mode 100644
index 0000000..a2095d2
--- /dev/null
+++ "b/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldInRequestBill.cs"
@@ -0,0 +1,352 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Data;
+
+namespace DAL
+{
+ public class ClsSc_MouldInRequestBill:DBUtility.ClsXt_BaseBill
+ {
+ public Model.ClsSc_MouldInRequestBillMain omodel = new Model.ClsSc_MouldInRequestBillMain();
+ public List<Model.ClsSc_MouldInRequestBillSub> DetailColl = new List<Model.ClsSc_MouldInRequestBillSub>();
+
+ public ClsSc_MouldInRequestBill()
+ {
+ base.MvarItemKeySub = "Sc_MouldInRequestBillSub";
+ base.MvarItemKeySub2 = "";
+ base.MvarItemKeySub3 = "";
+ base.MvarItemKeySub4 = "";
+ base.MvarItemKey="Sc_MouldInRequestBillMain";
+ base.MvarReportTitle= "鍣ㄥ叿鍏ュ簱鐢宠鍗�";
+ base.BillType= "3851";
+ base.HBillSubType = "3851";
+
+ }
+
+ #region 鍥哄畾浠g爜
+
+ ~ClsSc_MouldInRequestBill()
+ {
+ DetailColl = null;
+ }
+
+ #endregion 鑷畾涔夋柟娉�
+
+ //淇濆瓨鍓嶆帶鍒�
+ public bool BeforeSave(Int64 HInterID, string HBillNo, Int64 OperationType, ref string sReturn)
+ {
+ try
+ {
+ DataSet Ds = oCn.RunProcReturn("Exec h_p_Sc_MouldInRequestBill_BeforeSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Sc_MouldInRequestBill_BeforeSaveCtrl");
+ if (Ds == null || Ds.Tables[0].Rows.Count == 0)
+ {
+ sReturn = "淇濆瓨鍓嶅垽鏂け璐ワ紒";
+ return false;
+ }
+ else
+ {
+ if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HBack"]) == 1)
+ {
+ sReturn = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]);
+ return false;
+ }
+ }
+ return true;
+ }
+ catch (Exception e)
+ {
+ throw (e);
+ }
+ }
+
+ //淇濆瓨鍚庢帶鍒�
+ public bool AfterSave(Int64 HInterID, string HBillNo, Int64 OperationType, ref string sReturn)
+ {
+ try
+ {
+ DataSet Ds = oCn.RunProcReturn("Exec h_p_Sc_MouldInRequestBill_AfterSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Sc_MouldInRequestBill_AfterSaveCtrl");
+ if (Ds == null || Ds.Tables[0].Rows.Count == 0)
+ {
+ sReturn = "淇濆瓨鍚庡垽鏂け璐ワ紒";
+ return false;
+ }
+ else
+ {
+ if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HBack"]) == 1)
+ {
+ sReturn = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]);
+ return false;
+ }
+ }
+ return true;
+ }
+ catch (Exception e)
+ {
+ throw (e);
+ }
+ }
+
+ //淇敼鍗曟嵁
+ public override bool ModifyBill(Int64 lngBillKey, ref string sReturn)
+ {
+ try
+ {
+ oCn.BeginTran();
+ //淇濆瓨鍓嶆帶鍒�
+ if (!BeforeSave(lngBillKey, omodel.HBillNo, 2, ref sReturn))
+ {
+ oCn.RollBack();
+ return false;
+ }
+ //鏇存柊涓昏〃
+ oCn.RunProc("UpDate Sc_MouldInRequestBillMain set " +
+ " HBillNo='" + omodel.HBillNo + "'" + //鍥哄畾璧嬪��===============
+ ",HDate='" + omodel.HDate + "'" +
+ ",HYear='" + omodel.HYear.ToString() + "'" +
+ ",HPeriod='" + omodel.HPeriod.ToString() + "'" +
+ ",HRemark='" + omodel.HRemark + "'" +
+ ",HUpDater='" + DBUtility.ClsPub.CurUserName + "'" +
+ ",HUpDateDate=getdate()" +
+ //========================================
+ ",HSupTypeID=" + omodel.HSupTypeID.ToString() +
+ ",HSupID=" + omodel.HSupID.ToString() +
+ ",HDeptID=" + omodel.HDeptID.ToString() +
+ ",HWHID=" + omodel.HWHID.ToString() +
+ ",HEmpID=" + omodel.HEmpID.ToString() +
+ ",HMangerID=" + omodel.HMangerID.ToString() +
+ ",HSecManagerID=" + omodel.HSecManagerID.ToString() +
+ ",HKeeperID=" + omodel.HKeeperID.ToString() +
+ ",HExplanation='" + omodel.HExplanation + "'" +
+ ",HInnerBillNo='" + omodel.HInnerBillNo + "'" +
+ ",HStockOrgID=" + omodel.HSTOCKORGID.ToString() +
+ " where HInterID=" + lngBillKey.ToString());
+ //鍒犻櫎鍏宠仈
+ DeleteRelation(ref sReturn, lngBillKey);
+ //鍒犻櫎瀛愯〃
+ DeleteBillSub(lngBillKey);
+ //鎻掑叆瀛愯〃
+ omodel.HInterID = lngBillKey;
+ foreach (Model.ClsSc_MouldInRequestBillSub oSub in DetailColl)
+ {
+ oCn.RunProc("Insert into Sc_MouldInRequestBillSub " +
+ " (HInterID,HEntryID,HRemark,HRelationQty,HRelationMoney" +
+ ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType" +
+ ",HMaterID,HPropertyID,HSecUnitID,HSecUnitRate,HUnitID,HQtyMust" +
+ ",HQty,HPrice,HMoney,HWHID,HSPID" +
+ ",HSEQ,HERPInterID,HERPEntryID,HSTOCKSTATUSID" +
+ ",HPOOrderInterID,HPOOrderEntryID,HPOOrderBillNo,HSeOrderInterID,HSeOrderEntryID,HSeOrderBillNo" +
+ ",HICMOInterID,HICMOEntryID,HICMOBillNo,HSTOCKORGID,HOWNERID,HOWNERTYPEID" +
+ ") values("
+ + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HRemark + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
+ "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'" +
+ "," + oSub.HMaterID.ToString() + "," + oSub.HPropertyID.ToString() + "," + oSub.HSecUnitID.ToString() + "," + oSub.HSecUnitRate.ToString() + "," + oSub.HUnitID.ToString() + "," + oSub.HQtyMust.ToString() +
+ "," + oSub.HQty.ToString() + "," + oSub.HPrice.ToString() + "," + oSub.HMoney.ToString() + "," + oSub.HWHID.ToString() + "," + oSub.HSPID.ToString() +
+ "," + oSub.HSEQ.ToString() + "," + oSub.HERPInterID.ToString() + "," + oSub.HERPEntryID.ToString() + "," + oSub.HSTOCKSTATUSID.ToString() +
+ "," + oSub.HPOOrderInterID.ToString() + "," + oSub.HPOOrderEntryID.ToString() + ",'" + oSub.HPOOrderBillNo + "'," + oSub.HSeOrderInterID.ToString() + "," + oSub.HSeOrderEntryID.ToString() + ",'" + oSub.HSeOrderBillNo + "'" +
+ "," + oSub.HICMOInterID.ToString() + "," + oSub.HICMOEntryID.ToString() + ",'" + oSub.HICMOBillNo + "'," + oSub.HStockOrgID.ToString() + "," + oSub.HOWNERID.ToString() + ",'" + oSub.HOWNERTYPEID + "'" +
+ ") ");
+ }
+ //淇濆瓨鍚庢帶鍒�
+ if (!AfterSave(lngBillKey, omodel.HBillNo, 2, ref sReturn))
+ {
+ oCn.RollBack();
+ return false;
+ }
+ sReturn = "鍗曟嵁鍙凤細" + omodel.HBillNo + " 淇敼鎴愬姛锛�";
+ oCn.Commit();
+ return true;
+ }
+ catch (Exception e)
+ {
+ sReturn = e.Message;
+ oCn.RollBack();
+ throw (e);
+ }
+ }
+
+ //鏂板鍗曟嵁
+ public override bool AddBill(ref string sReturn)
+ {
+ try
+ {
+ //寰楀埌mainid
+ omodel.HInterID = DBUtility.ClsPub.CreateBillID_Prod(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
+ oCn.BeginTran();
+ //淇濆瓨鍓嶆帶鍒�
+ if (!BeforeSave(omodel.HInterID, omodel.HBillNo, 1, ref sReturn))
+ {
+ oCn.RollBack();
+ return false;
+ }
+ //涓昏〃
+ oCn.RunProc("Insert Into Sc_MouldInRequestBillMain " +
+ "(HBillType,HBillSubType,HInterID,HBillNo,HDate" +
+ ",HYear,HPeriod,HRemark,HMaker,HMakeDate" +
+ ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType" +
+ ",HSupTypeID,HSupID,HDeptID,HWHID" +
+ ",HEmpID,HMangerID,HSecManagerID,HKeeperID,HExplanation" +
+ ",HInnerBillNo,HStockOrgID" +
+ ") " +
+ " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate.ToShortDateString() + "'" +
+ ", " + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" +
+ ", " + omodel.HMainSourceInterID.ToString() + "," + omodel.HMainSourceEntryID.ToString() + ",'" + omodel.HMainSourceBillNo + "','" + omodel.HMainSourceBillType + "'" +
+ ", " + omodel.HSupTypeID.ToString() + "," + omodel.HSupID.ToString() + "," + omodel.HDeptID.ToString() + "," + omodel.HWHID.ToString() +
+ ", " + omodel.HEmpID.ToString() + "," + omodel.HMangerID.ToString() + "," + omodel.HSecManagerID.ToString() + "," + omodel.HKeeperID.ToString() + ",'" + omodel.HExplanation + "'" +
+ ",'" + omodel.HInnerBillNo + "'," + omodel.HSTOCKORGID.ToString() +
+ ") ");
+ //鎻掑叆瀛愯〃
+ foreach (Model.ClsSc_MouldInRequestBillSub oSub in DetailColl)
+ {
+ oCn.RunProc("Insert into Sc_MouldInRequestBillSub " +
+ " (HInterID,HEntryID,HRemark,HRelationQty,HRelationMoney" +
+ ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType" +
+ ",HMaterID,HPropertyID,HSecUnitID,HSecUnitRate,HUnitID,HQtyMust" +
+ ",HQty,HPrice,HMoney,HWHID,HSPID" +
+ ",HSEQ,HERPInterID,HERPEntryID,HSTOCKSTATUSID" +
+ ",HPOOrderInterID,HPOOrderEntryID,HPOOrderBillNo,HSeOrderInterID,HSeOrderEntryID,HSeOrderBillNo" +
+ ",HICMOInterID,HICMOEntryID,HICMOBillNo,HSTOCKORGID,HOWNERID,HOWNERTYPEID" +
+ ") values("
+ + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HRemark + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
+ "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'" +
+ "," + oSub.HMaterID.ToString() + "," + oSub.HPropertyID.ToString() + "," + oSub.HSecUnitID.ToString() + "," + oSub.HSecUnitRate.ToString() + "," + oSub.HUnitID.ToString() + "," + oSub.HQtyMust.ToString() +
+ "," + oSub.HQty.ToString() + "," + oSub.HPrice.ToString() + "," + oSub.HMoney.ToString() + "," + oSub.HWHID.ToString() + "," + oSub.HSPID.ToString() +
+ "," + oSub.HSEQ.ToString() + "," + oSub.HERPInterID.ToString() + "," + oSub.HERPEntryID.ToString() + "," + oSub.HSTOCKSTATUSID.ToString() +
+ "," + oSub.HPOOrderInterID.ToString() + "," + oSub.HPOOrderEntryID.ToString() + ",'" + oSub.HPOOrderBillNo + "'," + oSub.HSeOrderInterID.ToString() + "," + oSub.HSeOrderEntryID.ToString() + ",'" + oSub.HSeOrderBillNo + "'" +
+ "," + oSub.HICMOInterID.ToString() + "," + oSub.HICMOEntryID.ToString() + ",'" + oSub.HICMOBillNo + "'," + oSub.HStockOrgID.ToString() + "," + oSub.HOWNERID.ToString() + ",'" + oSub.HOWNERTYPEID + "'" +
+ ") ");
+ }
+ //淇濆瓨鍚庢帶鍒�
+ if (!AfterSave(omodel.HInterID, omodel.HBillNo, 1, ref sReturn))
+ {
+ oCn.RollBack();
+ return false;
+ }
+ sReturn = "鍗曟嵁鍙凤細" + omodel.HBillNo + " 鏂板鎴愬姛锛�";
+ oCn.Commit();
+ return true;
+ }
+ catch (Exception e)
+ {
+ sReturn = e.Message;
+ oCn.RollBack();
+ throw (e);
+ }
+ }
+
+ //鏄剧ず鍗曟嵁
+ public override bool ShowBill(Int64 lngBillKey, ref string sReturn)
+ {
+ try
+ {
+ //鏌ヨ涓昏〃
+ DataSet Ds;
+ Ds = oCn.RunProcReturn("Select * from Sc_MouldInRequestBillMain Where HInterID=" + lngBillKey.ToString(), "Sc_MouldInRequestBillMain");
+ 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.HSupTypeID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSupTypeID"]);
+ omodel.HSupID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSupID"]);
+ omodel.HDeptID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HDeptID"]);
+ omodel.HWHID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HWHID"]);
+ omodel.HEmpID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HEmpID"]);
+ omodel.HMangerID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HMangerID"]);
+ omodel.HSecManagerID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSecManagerID"]);
+ omodel.HKeeperID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HKeeperID"]);
+ omodel.HExplanation = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HExplanation"]);
+ omodel.HInnerBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HInnerBillNo"]);
+ omodel.HSTOCKORGID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HStockOrgID"]);
+
+ //寰幆
+ DataSet DsSub;
+ DsSub = oCn.RunProcReturn("Select * from Sc_MouldInRequestBillSub Where HInterID=" + lngBillKey.ToString() + "order by HEntryID", "Sc_MouldInRequestBillSub");
+ DetailColl.Clear();//娓呯┖
+ for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++)
+ {
+ Model.ClsSc_MouldInRequestBillSub oSub = new Model.ClsSc_MouldInRequestBillSub();
+ // 鍥哄畾璧嬪��===============================================
+ oSub.HInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HInterID"]);
+ oSub.HEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HEntryID"]);
+ oSub.HBillNo_bak = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HBillNo_bak"]);
+ 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.HMaterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HMaterID"]);
+ oSub.HPropertyID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HPropertyID"]);
+ oSub.HSecUnitID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSecUnitID"]);
+ oSub.HSecUnitRate = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HSecUnitRate"]);
+ oSub.HUnitID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HUnitID"]);
+ oSub.HQtyMust = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HQtyMust"]);
+ oSub.HQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HQty"]);
+ oSub.HPrice = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HPrice"]);
+ oSub.HMoney = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HMoney"]);
+ oSub.HWHID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HWHID"]);
+ oSub.HSPID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSPID"]);
+ oSub.HERPInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HERPInterID"]);
+ oSub.HERPEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HERPEntryID"]);
+ oSub.HPOOrderInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HPOOrderInterID"]);
+ oSub.HPOOrderEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HPOOrderEntryID"]);
+ oSub.HPOOrderBillNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HPOOrderBillNo"]);
+ oSub.HSeOrderInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSeOrderInterID"]);
+ oSub.HSeOrderEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSeOrderEntryID"]);
+ oSub.HSeOrderBillNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HSeOrderBillNo"]);
+ oSub.HICMOInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HICMOInterID"]);
+ oSub.HICMOEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HICMOEntryID"]);
+ oSub.HICMOBillNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HICMOBillNo"]);
+ oSub.HStockOrgID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HStockOrgID"]);
+ oSub.HOWNERID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HOWNERID"]);
+ oSub.HOWNERTYPEID = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HOWNERTYPEID"]);
+ oSub.HSEQ = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSEQ"]);
+ oSub.HSTOCKSTATUSID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSTOCKSTATUSID"]);
+ DetailColl.Add(oSub);
+ }
+ sReturn = "鏄剧ず鍗曟嵁鎴愬姛锛�";
+ return true;
+ }
+ catch (Exception e)
+ {
+ sReturn = e.Message;
+ throw (e);
+ }
+ }
+
+
+ }
+
+}
diff --git "a/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldMoveStockRequestBill.cs" "b/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldMoveStockRequestBill.cs"
index 8b6e58c..602ec30 100644
--- "a/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldMoveStockRequestBill.cs"
+++ "b/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldMoveStockRequestBill.cs"
@@ -181,8 +181,7 @@
try
{
//寰楀埌mainid
- omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
- //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
+ omodel.HInterID = DBUtility.ClsPub.CreateBillID_Prod(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
oCn.BeginTran();
//淇濆瓨鍓嶆帶鍒�
if (!BeforeSave(omodel.HInterID, omodel.HBillNo, 1, ref sReturn))
diff --git "a/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldOutRequestBill.cs" "b/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldOutRequestBill.cs"
new file mode 100644
index 0000000..a74cc3a
--- /dev/null
+++ "b/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldOutRequestBill.cs"
@@ -0,0 +1,360 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Data;
+
+namespace DAL
+{
+ public class ClsSc_MouldOutRequestBill:DBUtility.ClsXt_BaseBill
+ {
+ public Model.ClsSc_MouldOutRequestBillMain omodel = new Model.ClsSc_MouldOutRequestBillMain();
+ public List<Model.ClsSc_MouldOutRequestBillSub> DetailColl = new List<Model.ClsSc_MouldOutRequestBillSub>();
+
+ public ClsSc_MouldOutRequestBill()
+ {
+ base.MvarItemKeySub = "Sc_MouldOutRequestBillSub";
+ base.MvarItemKeySub2 = "";
+ base.MvarItemKeySub3 = "";
+ base.MvarItemKeySub4 = "";
+ base.MvarItemKey="Sc_MouldOutRequestBillMain";
+ base.MvarReportTitle= "鍣ㄥ叿鍑哄簱鐢宠鍗�";
+ base.BillType= "3849";
+ base.HBillSubType = "3849";
+
+ }
+
+ #region 鍥哄畾浠g爜
+
+ ~ClsSc_MouldOutRequestBill()
+ {
+ DetailColl = null;
+ }
+
+ #endregion 鑷畾涔夋柟娉�
+
+ //淇濆瓨鍓嶆帶鍒�
+ public bool BeforeSave(Int64 HInterID, string HBillNo, Int64 OperationType, ref string sReturn)
+ {
+ try
+ {
+ DataSet Ds = oCn.RunProcReturn("Exec h_p_Sc_MouldOutRequestBill_BeforeSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Sc_MouldOutRequestBill_BeforeSaveCtrl");
+ if (Ds == null || Ds.Tables[0].Rows.Count == 0)
+ {
+ sReturn = "淇濆瓨鍓嶅垽鏂け璐ワ紒";
+ return false;
+ }
+ else
+ {
+ if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HBack"]) == 1)
+ {
+ sReturn = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]);
+ return false;
+ }
+ }
+ return true;
+ }
+ catch (Exception e)
+ {
+ throw (e);
+ }
+ }
+
+ //淇濆瓨鍚庢帶鍒�
+ public bool AfterSave(Int64 HInterID, string HBillNo, Int64 OperationType, ref string sReturn)
+ {
+ try
+ {
+ DataSet Ds = oCn.RunProcReturn("Exec h_p_Sc_MouldOutRequestBill_AfterSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Sc_MouldOutRequestBill_AfterSaveCtrl");
+ if (Ds == null || Ds.Tables[0].Rows.Count == 0)
+ {
+ sReturn = "淇濆瓨鍚庡垽鏂け璐ワ紒";
+ return false;
+ }
+ else
+ {
+ if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HBack"]) == 1)
+ {
+ sReturn = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]);
+ return false;
+ }
+ }
+ return true;
+ }
+ catch (Exception e)
+ {
+ throw (e);
+ }
+ }
+
+ //淇敼鍗曟嵁
+ public override bool ModifyBill(Int64 lngBillKey, ref string sReturn)
+ {
+ try
+ {
+ oCn.BeginTran();
+ //淇濆瓨鍓嶆帶鍒�
+ if (!BeforeSave(lngBillKey, omodel.HBillNo, 2, ref sReturn))
+ {
+ oCn.RollBack();
+ return false;
+ }
+ //鏇存柊涓昏〃
+ oCn.RunProc("UpDate Sc_MouldOutRequestBillMain set " +
+ " HBillNo='" + omodel.HBillNo + "'" + //鍥哄畾璧嬪��===============
+ ",HDate='" + omodel.HDate + "'" +
+ ",HYear='" + omodel.HYear.ToString() + "'" +
+ ",HPeriod='" + omodel.HPeriod.ToString() + "'" +
+ ",HRemark='" + omodel.HRemark + "'" +
+ ",HUpDater='" + DBUtility.ClsPub.CurUserName + "'" +
+ ",HUpDateDate=getdate()" +
+ //========================================
+ ",HSupTypeID=" + omodel.HSupTypeID.ToString() +
+ ",HSupID=" + omodel.HSupID.ToString() +
+ ",HDeptID=" + omodel.HDeptID.ToString() +
+ ",HWHID=" + omodel.HWHID.ToString() +
+ ",HEmpID=" + omodel.HEmpID.ToString() +
+ ",HMangerID=" + omodel.HMangerID.ToString() +
+ ",HSecManagerID=" + omodel.HSecManagerID.ToString() +
+ ",HKeeperID=" + omodel.HKeeperID.ToString() +
+ ",HExplanation='" + omodel.HExplanation + "'" +
+ ",HInnerBillNo='" + omodel.HInnerBillNo + "'" +
+ ",HStockOrgID=" + omodel.HSTOCKORGID.ToString() +
+ ",HERPInterID=" + omodel.HERPInterID.ToString() +
+ ",HERPBillType='" + omodel.HERPBillType + "'" +
+ ",HOWNERTYPEIDHEAD='" + omodel.HOWNERTYPEIDHEAD + "'" +
+ ",HBIZTYPE='" + omodel.HBIZTYPE + "'" +
+ " where HInterID=" + lngBillKey.ToString());
+ //鍒犻櫎鍏宠仈
+ DeleteRelation(ref sReturn, lngBillKey);
+ //鍒犻櫎瀛愯〃
+ DeleteBillSub(lngBillKey);
+ //鎻掑叆瀛愯〃
+ omodel.HInterID = lngBillKey;
+ foreach (Model.ClsSc_MouldOutRequestBillSub oSub in DetailColl)
+ {
+ oCn.RunProc("Insert into Sc_MouldOutRequestBillSub " +
+ " (HInterID,HEntryID,HRemark,HRelationQty,HRelationMoney" +
+ ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType" +
+ ",HMaterID,HPropertyID,HSecUnitID,HSecUnitRate,HUnitID,HQtyMust" +
+ ",HQty,HPrice,HMoney,HWHID,HSPID" +
+ ",HSEQ,HERPInterID,HERPEntryID,HSTOCKSTATUSID" +
+ ",HPOOrderInterID,HPOOrderEntryID,HPOOrderBillNo,HSeOrderInterID,HSeOrderEntryID,HSeOrderBillNo" +
+ ",HICMOInterID,HICMOEntryID,HICMOBillNo,HSTOCKORGID,HOWNERID,HOWNERTYPEID" +
+ ") values("
+ + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HRemark + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
+ "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'" +
+ "," + oSub.HMaterID.ToString() + "," + oSub.HPropertyID.ToString() + "," + oSub.HSecUnitID.ToString() + "," + oSub.HSecUnitRate.ToString() + "," + oSub.HUnitID.ToString() + "," + oSub.HQtyMust.ToString() +
+ "," + oSub.HQty.ToString() + "," + oSub.HPrice.ToString() + "," + oSub.HMoney.ToString() + "," + oSub.HWHID.ToString() + "," + oSub.HSPID.ToString() +
+ "," + oSub.HSEQ.ToString() + "," + oSub.HERPInterID.ToString() + "," + oSub.HERPEntryID.ToString() + "," + oSub.HSTOCKSTATUSID.ToString() +
+ "," + oSub.HPOOrderInterID.ToString() + "," + oSub.HPOOrderEntryID.ToString() + ",'" + oSub.HPOOrderBillNo + "'," + oSub.HSeOrderInterID.ToString() + "," + oSub.HSeOrderEntryID.ToString() + ",'" + oSub.HSeOrderBillNo + "'" +
+ "," + oSub.HICMOInterID.ToString() + "," + oSub.HICMOEntryID.ToString() + ",'" + oSub.HICMOBillNo + "'," + oSub.HStockOrgID.ToString() + "," + oSub.HOWNERID.ToString() + ",'" + oSub.HOWNERTYPEID + "'" +
+ ") ");
+ }
+ //淇濆瓨鍚庢帶鍒�
+ if (!AfterSave(lngBillKey, omodel.HBillNo, 2, ref sReturn))
+ {
+ oCn.RollBack();
+ return false;
+ }
+ sReturn = "鍗曟嵁鍙凤細" + omodel.HBillNo + " 淇敼鎴愬姛锛�";
+ oCn.Commit();
+ return true;
+ }
+ catch (Exception e)
+ {
+ sReturn = e.Message;
+ oCn.RollBack();
+ throw (e);
+ }
+ }
+
+ //鏂板鍗曟嵁
+ public override bool AddBill(ref string sReturn)
+ {
+ try
+ {
+ //寰楀埌mainid
+ omodel.HInterID = DBUtility.ClsPub.CreateBillID_Prod(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
+ oCn.BeginTran();
+ //淇濆瓨鍓嶆帶鍒�
+ if (!BeforeSave(omodel.HInterID, omodel.HBillNo, 1, ref sReturn))
+ {
+ oCn.RollBack();
+ return false;
+ }
+ //涓昏〃
+ oCn.RunProc("Insert Into Sc_MouldOutRequestBillMain " +
+ "(HBillType,HBillSubType,HInterID,HBillNo,HDate" +
+ ",HYear,HPeriod,HRemark,HMaker,HMakeDate" +
+ ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType" +
+ ",HSupTypeID,HSupID,HDeptID,HWHID" +
+ ",HEmpID,HMangerID,HSecManagerID,HKeeperID,HExplanation" +
+ ",HInnerBillNo,HStockOrgID,HERPInterID,HERPBillType,HOWNERTYPEIDHEAD,HBIZTYPE" +
+ ") " +
+ " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate.ToShortDateString() + "'" +
+ ", " + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" +
+ ", " + omodel.HMainSourceInterID.ToString() + "," + omodel.HMainSourceEntryID.ToString() + ",'" + omodel.HMainSourceBillNo + "','" + omodel.HMainSourceBillType + "'" +
+ ", " + omodel.HSupTypeID.ToString() + "," + omodel.HSupID.ToString() + "," + omodel.HDeptID.ToString() + "," + omodel.HWHID.ToString() +
+ ", " + omodel.HEmpID.ToString() + "," + omodel.HMangerID.ToString() + "," + omodel.HSecManagerID.ToString() + "," + omodel.HKeeperID.ToString() + ",'" + omodel.HExplanation + "'" +
+ ",'" + omodel.HInnerBillNo + "'," + omodel.HSTOCKORGID.ToString() + "," + omodel.HERPInterID.ToString() + ",'" + omodel.HERPBillType + "','" + omodel.HOWNERTYPEIDHEAD + "','" + omodel.HBIZTYPE + "'" +
+ ") ");
+ //鎻掑叆瀛愯〃
+ foreach (Model.ClsSc_MouldOutRequestBillSub oSub in DetailColl)
+ {
+ oCn.RunProc("Insert into Sc_MouldOutRequestBillSub " +
+ " (HInterID,HEntryID,HRemark,HRelationQty,HRelationMoney" +
+ ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType" +
+ ",HMaterID,HPropertyID,HSecUnitID,HSecUnitRate,HUnitID,HQtyMust" +
+ ",HQty,HPrice,HMoney,HWHID,HSPID" +
+ ",HSEQ,HERPInterID,HERPEntryID,HSTOCKSTATUSID" +
+ ",HPOOrderInterID,HPOOrderEntryID,HPOOrderBillNo,HSeOrderInterID,HSeOrderEntryID,HSeOrderBillNo" +
+ ",HICMOInterID,HICMOEntryID,HICMOBillNo,HSTOCKORGID,HOWNERID,HOWNERTYPEID" +
+ ") values("
+ + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HRemark + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
+ "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'" +
+ "," + oSub.HMaterID.ToString() + "," + oSub.HPropertyID.ToString() + "," + oSub.HSecUnitID.ToString() + "," + oSub.HSecUnitRate.ToString() + "," + oSub.HUnitID.ToString() + "," + oSub.HQtyMust.ToString() +
+ "," + oSub.HQty.ToString() + "," + oSub.HPrice.ToString() + "," + oSub.HMoney.ToString() + "," + oSub.HWHID.ToString() + "," + oSub.HSPID.ToString() +
+ "," + oSub.HSEQ.ToString() + "," + oSub.HERPInterID.ToString() + "," + oSub.HERPEntryID.ToString() + "," + oSub.HSTOCKSTATUSID.ToString() +
+ "," + oSub.HPOOrderInterID.ToString() + "," + oSub.HPOOrderEntryID.ToString() + ",'" + oSub.HPOOrderBillNo + "'," + oSub.HSeOrderInterID.ToString() + "," + oSub.HSeOrderEntryID.ToString() + ",'" + oSub.HSeOrderBillNo + "'" +
+ "," + oSub.HICMOInterID.ToString() + "," + oSub.HICMOEntryID.ToString() + ",'" + oSub.HICMOBillNo + "'," + oSub.HStockOrgID.ToString() + "," + oSub.HOWNERID.ToString() + ",'" + oSub.HOWNERTYPEID + "'" +
+ ") ");
+ }
+ //淇濆瓨鍚庢帶鍒�
+ if (!AfterSave(omodel.HInterID, omodel.HBillNo, 1, ref sReturn))
+ {
+ oCn.RollBack();
+ return false;
+ }
+ sReturn = "鍗曟嵁鍙凤細" + omodel.HBillNo + " 鏂板鎴愬姛锛�";
+ oCn.Commit();
+ return true;
+ }
+ catch (Exception e)
+ {
+ sReturn = e.Message;
+ oCn.RollBack();
+ throw (e);
+ }
+ }
+
+ //鏄剧ず鍗曟嵁
+ public override bool ShowBill(Int64 lngBillKey, ref string sReturn)
+ {
+ try
+ {
+ //鏌ヨ涓昏〃
+ DataSet Ds;
+ Ds = oCn.RunProcReturn("Select * from Sc_MouldOutRequestBillMain Where HInterID=" + lngBillKey.ToString(), "Sc_MouldOutRequestBillMain");
+ 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.HSupTypeID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSupTypeID"]);
+ omodel.HSupID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSupID"]);
+ omodel.HDeptID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HDeptID"]);
+ omodel.HWHID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HWHID"]);
+ omodel.HEmpID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HEmpID"]);
+ omodel.HMangerID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HMangerID"]);
+ omodel.HSecManagerID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSecManagerID"]);
+ omodel.HKeeperID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HKeeperID"]);
+ omodel.HExplanation = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HExplanation"]);
+ omodel.HInnerBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HInnerBillNo"]);
+ omodel.HSTOCKORGID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HStockOrgID"]);
+ omodel.HERPInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HERPInterID"]);
+ omodel.HERPBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HERPBillType"]);
+ omodel.HOWNERTYPEIDHEAD = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HOWNERTYPEIDHEAD"]);
+ omodel.HBIZTYPE = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBIZTYPE"]);
+
+ //寰幆
+ DataSet DsSub;
+ DsSub = oCn.RunProcReturn("Select * from Sc_MouldOutRequestBillSub Where HInterID=" + lngBillKey.ToString() + "order by HEntryID", "Sc_MouldOutRequestBillSub");
+ DetailColl.Clear();//娓呯┖
+ for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++)
+ {
+ Model.ClsSc_MouldOutRequestBillSub oSub = new Model.ClsSc_MouldOutRequestBillSub();
+ // 鍥哄畾璧嬪��===============================================
+ oSub.HInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HInterID"]);
+ oSub.HEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HEntryID"]);
+ oSub.HBillNo_bak = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HBillNo_bak"]);
+ 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.HMaterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HMaterID"]);
+ oSub.HPropertyID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HPropertyID"]);
+ oSub.HSecUnitID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSecUnitID"]);
+ oSub.HSecUnitRate = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HSecUnitRate"]);
+ oSub.HUnitID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HUnitID"]);
+ oSub.HQtyMust = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HQtyMust"]);
+ oSub.HQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HQty"]);
+ oSub.HPrice = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HPrice"]);
+ oSub.HMoney = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HMoney"]);
+ oSub.HWHID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HWHID"]);
+ oSub.HSPID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSPID"]);
+ oSub.HERPInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HERPInterID"]);
+ oSub.HERPEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HERPEntryID"]);
+ oSub.HPOOrderInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HPOOrderInterID"]);
+ oSub.HPOOrderEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HPOOrderEntryID"]);
+ oSub.HPOOrderBillNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HPOOrderBillNo"]);
+ oSub.HSeOrderInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSeOrderInterID"]);
+ oSub.HSeOrderEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSeOrderEntryID"]);
+ oSub.HSeOrderBillNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HSeOrderBillNo"]);
+ oSub.HICMOInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HICMOInterID"]);
+ oSub.HICMOEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HICMOEntryID"]);
+ oSub.HICMOBillNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HICMOBillNo"]);
+ oSub.HStockOrgID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HStockOrgID"]);
+ oSub.HOWNERID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HOWNERID"]);
+ oSub.HOWNERTYPEID = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HOWNERTYPEID"]);
+ oSub.HSEQ = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSEQ"]);
+ oSub.HSTOCKSTATUSID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSTOCKSTATUSID"]);
+ DetailColl.Add(oSub);
+ }
+ sReturn = "鏄剧ず鍗曟嵁鎴愬姛锛�";
+ return true;
+ }
+ catch (Exception e)
+ {
+ sReturn = e.Message;
+ throw (e);
+ }
+ }
+
+
+ }
+
+}
diff --git "a/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldProdOutBill.cs" "b/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldProdOutBill.cs"
index 8cf3e26..2dd3190 100644
--- "a/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldProdOutBill.cs"
+++ "b/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldProdOutBill.cs"
@@ -8,7 +8,7 @@
public class ClsSc_MouldProdOutBill:DBUtility.ClsXt_BaseBill
{
public Model.ClsSc_MouldProdOutBillMain omodel = new Model.ClsSc_MouldProdOutBillMain();
- public List<Model.ClsSc_MouldStockBillSub> DetailColl = new List<Model.ClsSc_MouldStockBillSub>();
+ public List<Model.ClsSc_MouldProdOutBillSub> DetailColl = new List<Model.ClsSc_MouldProdOutBillSub>();
public ClsSc_MouldProdOutBill()
{
@@ -30,7 +30,7 @@
DetailColl = null;
}
- #endregion 鑷畾涔夋柟娉�
+ #endregion
//淇濆瓨鍓嶆帶鍒�
public bool BeforeSave(Int64 HInterID, string HBillNo, Int64 HSecManagerID, Int64 HKeeperID, Int64 HSupID, Int64 OperationType, ref string sReturn)
@@ -86,12 +86,43 @@
}
}
+ //鍒犻櫎鍏宠仈锛堟洿鏂版簮鍗曞叧鑱旀暟閲忥級
+ public override void DeleteRelation(ref string sReturn, Int64 lngBillKey)
+ {
+ try
+ {
+ if (DetailColl[0].HSourceBillType == "3849") //鍣ㄥ叿棰嗙敤鐢宠鍗�
+ {
+ oCn.RunProc("exec h_p_Sc_UpDateRelation_MouldOutRequestToMouldProdOut_Del " + lngBillKey.ToString());
+ }
+ }
+ catch (Exception e)
+ {
+ throw (e);
+ }
+ }
+
+ //鏂板鍏宠仈锛堟洿鏂版簮鍗曞叧鑱旀暟閲忥級
+ public override void AddNewRelation(ref string sReturn, Int64 lngBillKey)
+ {
+ try
+ {
+ if (DetailColl[0].HSourceBillType == "3849") //鍣ㄥ叿棰嗙敤鐢宠鍗�
+ {
+ oCn.RunProc("exec h_p_Sc_UpDateRelation_MouldOutRequestToMouldProdOut_Add " + lngBillKey.ToString());
+ }
+ }
+ catch (Exception e)
+ {
+ throw (e);
+ }
+ }
+
//淇敼鍗曟嵁
public override bool ModifyBill(Int64 lngBillKey, ref string sReturn)
{
try
{
- //
oCn.BeginTran();
//淇濆瓨鍓嶆帶鍒�
if (!BeforeSave(lngBillKey, omodel.HBillNo, omodel.HSecManagerID, omodel.HKeeperID, omodel.HSupID, 2, ref sReturn))
@@ -109,8 +140,8 @@
",HUpDater='" + DBUtility.ClsPub.CurUserName + "'" +
",HUpDateDate=getdate()" +
//========================================
- ",HSupID=" + omodel.HSupID.ToString() +
",HSupTypeID=" + omodel.HSupTypeID.ToString() +
+ ",HSupID=" + omodel.HSupID.ToString() +
",HEmpID=" + omodel.HEmpID.ToString() +
",HManagerID=" + omodel.HManagerID.ToString() +
",HSecManagerID=" + omodel.HSecManagerID.ToString() +
@@ -129,7 +160,7 @@
DeleteBillSub(lngBillKey);
//鎻掑叆瀛愯〃
omodel.HInterID = lngBillKey;
- foreach (Model.ClsSc_MouldStockBillSub oSub in DetailColl)
+ foreach (Model.ClsSc_MouldProdOutBillSub oSub in DetailColl)
{
oCn.RunProc("Insert into Sc_MouldStockBillSub " +
" (HInterID,HEntryID,HRemark,HRelationQty,HRelationMoney" +
@@ -140,6 +171,8 @@
",HSPID,HSCSPID,HSPGroupID,HBarCode,HCorrespondentTypeID,HCorrespondentID" +
",HPOOrderInterID,HPOOrderEntryID,HPOOrderBillNo,HSeOrderInterID,HSeOrderEntryID,HSeOrderBillNo" +
",HStockOrgID,HOWNERID,HOtherOrgID,HOWNERTYPEID" +
+ ",HNewModel,HWallThickness,HHardness,HLastProdModel,HDiameter,HBackFlag" +
+ ",HMouldType,HInitModel,HInitDesignLife,HLifeUnitID,HNowModel,HNowLife" +
") values("
+ omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HRemark + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
"," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'" +
@@ -149,8 +182,12 @@
"," + oSub.HSPID.ToString() + "," + oSub.HSCSPID.ToString() + "," + oSub.HSPGroupID.ToString() + ",'" + oSub.HBarCode + "'," + oSub.HCorrespondentTypeID.ToString() + "," + oSub.HCorrespondentID.ToString() +
"," + oSub.HPOOrderInterID.ToString() + "," + oSub.HPOOrderEntryID.ToString() + ",'" + oSub.HPOOrderBillNo + "'," + oSub.HSeOrderInterID.ToString() + "," + oSub.HSeOrderEntryID.ToString() + ",'" + oSub.HSeOrderBillNo + "'" +
"," + oSub.HStockOrgID.ToString() + "," + oSub.HOWNERID.ToString() + "," + oSub.HOtherOrgID.ToString() + ",'" + oSub.HOWNERTYPEID + "'" +
+ ",'" + oSub.HNewModel + "','" + oSub.HWallThickness + "','" + oSub.HHardness + "','" + oSub.HLastProdModel + "','" + oSub.HDiameter + "','" + oSub.HBackFlag + "'" +
+ "," + oSub.HMouldType.ToString() + ",'" + oSub.HInitModel + "'," + oSub.HInitDesignLife.ToString() + "," + oSub.HLifeUnitID.ToString() + ",'" + oSub.HNowModel + "'," + oSub.HNowLife.ToString() +
") ");
}
+ //鏂板鍏宠仈锛堟洿鏂版簮鍗曞叧鑱旀暟閲忥級
+ AddNewRelation(ref sReturn, omodel.HInterID);
//淇濆瓨鍚庢帶鍒�
if (!AfterSave(lngBillKey, omodel.HBillNo, 2, ref sReturn))
{
@@ -185,29 +222,32 @@
{
omodel.HInterID = DBUtility.ClsPub.CreateBillID_Prod(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
}
+
+ oCn.BeginTran();
//淇濆瓨鍓嶆帶鍒�
if (!BeforeSave(omodel.HInterID, omodel.HBillNo, omodel.HSecManagerID, omodel.HKeeperID, omodel.HSupID, 1, ref sReturn))
{
+ oCn.RollBack();
return false;
}
-
- oCn.BeginTran();
//涓昏〃
oCn.RunProc("Insert Into Sc_MouldStockBillMain " +
"(HBillType,HBillSubType,HInterID,HBillNo,HDate" +
",HYear,HPeriod,HRemark,HMaker,HMakeDate" +
+ ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType" +
",HSupID,HSupTypeID,HEmpID,HManagerID,HSecManagerID" +
",HKeeperID,HDeptID,HWHID,HSCWHID,HRedBlueFlag" +
",HExplanation,HInnerBillNo,HStockOrgID" +
") " +
" values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate.ToShortDateString() + "'" +
", " + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" +
+ ", " + omodel.HMainSourceInterID.ToString() + "," + omodel.HMainSourceEntryID.ToString() + ",'" + omodel.HMainSourceBillNo + "','" + omodel.HMainSourceBillType + "'" +
", " + omodel.HSupID.ToString() + "," + omodel.HSupTypeID.ToString() + "," + omodel.HEmpID.ToString() + "," + omodel.HManagerID.ToString() + "," + omodel.HSecManagerID.ToString()+
", " + omodel.HKeeperID.ToString() + "," + omodel.HDeptID.ToString() + "," + omodel.HWHID.ToString() + "," + omodel.HSCWHID.ToString() + "," + DBUtility.ClsPub.BoolToString(omodel.HRedBlueFlag) +
",'" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "'," + omodel.HSTOCKORGID.ToString() +
") ");
//鎻掑叆瀛愯〃
- foreach (Model.ClsSc_MouldStockBillSub oSub in DetailColl)
+ foreach (Model.ClsSc_MouldProdOutBillSub oSub in DetailColl)
{
oCn.RunProc("Insert into Sc_MouldStockBillSub " +
" (HInterID,HEntryID,HRemark,HRelationQty,HRelationMoney" +
@@ -218,6 +258,8 @@
",HSPID,HSCSPID,HSPGroupID,HBarCode,HCorrespondentTypeID,HCorrespondentID" +
",HPOOrderInterID,HPOOrderEntryID,HPOOrderBillNo,HSeOrderInterID,HSeOrderEntryID,HSeOrderBillNo" +
",HStockOrgID,HOWNERID,HOtherOrgID,HOWNERTYPEID" +
+ ",HNewModel,HWallThickness,HHardness,HLastProdModel,HDiameter,HBackFlag" +
+ ",HMouldType,HInitModel,HInitDesignLife,HLifeUnitID,HNowModel,HNowLife" +
") values("
+ omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HRemark + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
"," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'" +
@@ -227,8 +269,12 @@
"," + oSub.HSPID.ToString() + "," + oSub.HSCSPID.ToString() + "," + oSub.HSPGroupID.ToString() + ",'" + oSub.HBarCode + "'," + oSub.HCorrespondentTypeID.ToString() + "," + oSub.HCorrespondentID.ToString() +
"," + oSub.HPOOrderInterID.ToString() + "," + oSub.HPOOrderEntryID.ToString() + ",'" + oSub.HPOOrderBillNo + "'," + oSub.HSeOrderInterID.ToString() + "," + oSub.HSeOrderEntryID.ToString() + ",'" + oSub.HSeOrderBillNo + "'" +
"," + oSub.HStockOrgID.ToString() + "," + oSub.HOWNERID.ToString() + "," + oSub.HOtherOrgID.ToString() + ",'" + oSub.HOWNERTYPEID + "'" +
+ ",'" + oSub.HNewModel + "','" + oSub.HWallThickness + "','" + oSub.HHardness + "','" + oSub.HLastProdModel + "','" + oSub.HDiameter + "','" + oSub.HBackFlag + "'" +
+ "," + oSub.HMouldType.ToString() + ",'" + oSub.HInitModel + "'," + oSub.HInitDesignLife.ToString() + "," + oSub.HLifeUnitID.ToString() + ",'" + oSub.HNowModel + "'," + oSub.HNowLife.ToString() +
") ");
}
+ //鏂板鍏宠仈锛堟洿鏂版簮鍗曞叧鑱旀暟閲忥級
+ AddNewRelation(ref sReturn, omodel.HInterID);
//淇濆瓨鍚庢帶鍒�
if (!AfterSave(omodel.HInterID, omodel.HBillNo, 1, ref sReturn))
{
@@ -332,6 +378,7 @@
omodel.HDeleteDate = Ds.Tables[0].Rows[0]["HDeleteDate"].ToString().Trim();
omodel.HDeleteMan = Ds.Tables[0].Rows[0]["HDeleteMan"].ToString().Trim();
//========================================================
+ omodel.HSupTypeID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSupTypeID"]);
omodel.HSupID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSupID"]);
omodel.HWHID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HWHID"]);
omodel.HSCWHID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSCWHID"]);
@@ -343,16 +390,15 @@
omodel.HExplanation = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HExplanation"]);
omodel.HInnerBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HInnerBillNo"]);
omodel.HRedBlueFlag = DBUtility.ClsPub.isBool(Ds.Tables[0].Rows[0]["HRedBlueFlag"]);
-
- //
-
+ omodel.HSTOCKORGID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HStockOrgID"]);
+
//寰幆
DataSet DsSub ;
DsSub = oCn.RunProcReturn("Select * from Sc_MouldStockBillSub Where HInterID=" + lngBillKey.ToString() + " order by HEntryID ", "Sc_MouldStockBillSub");
DetailColl.Clear();//娓呯┖
for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++)
{
- Model.ClsSc_MouldStockBillSub oSub = new Model.ClsSc_MouldStockBillSub();
+ Model.ClsSc_MouldProdOutBillSub oSub = new Model.ClsSc_MouldProdOutBillSub();
// 鍥哄畾璧嬪��===============================================
oSub.HInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HInterID"]);
oSub.HEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HEntryID"]);
@@ -372,25 +418,47 @@
oSub.HSecUnitID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSecUnitID"]);
oSub.HSecUnitRate = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HSecUnitRate"]);
oSub.HUnitID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HUnitID"]);
+ oSub.HBatchNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HBatchNo"]);
oSub.HQtyMust = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HQtyMust"]);
+ oSub.HQtyRel = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HQtyRel"]);
oSub.HQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HQty"]);
oSub.HPrice = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HPrice"]);
oSub.HMoney = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HMoney"]);
+ oSub.HDesignLife = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HDesignLife"]);
+ oSub.HLeaveLife = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HLeaveLife"]);
+ oSub.HUseLife = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HUseLife"]);
+ oSub.HUseLifeQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HUseLifeQty"]);
+ oSub.HNewLifeQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HNewLifeQty"]);
oSub.HWHID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HWHID"]);
oSub.HSCWHID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSCWHID"]);
oSub.HSPID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSPID"]);
oSub.HSCSPID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSCSPID"]);
oSub.HSPGroupID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSPGroupID"]);
- oSub.HBatchNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HBatchNo"]);
- oSub.HDesignLife = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HDesignLife"]);
- oSub.HLeaveLife = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HLeaveLife"]);
- oSub.HUseLife = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HUseLife"]);
+ oSub.HBarCode = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HBarCode"]);
+ oSub.HCorrespondentTypeID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HCorrespondentTypeID"]);
+ oSub.HCorrespondentID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HCorrespondentID"]);
oSub.HPOOrderInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HPOOrderInterID"]);
oSub.HPOOrderEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HPOOrderEntryID"]);
oSub.HPOOrderBillNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HPOOrderBillNo"]);
oSub.HSeOrderInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSeOrderInterID"]);
oSub.HSeOrderEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSeOrderEntryID"]);
oSub.HSeOrderBillNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HSeOrderBillNo"]);
+ oSub.HStockOrgID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSTOCKORGID"]);
+ oSub.HOWNERID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HOWNERID"]);
+ oSub.HOtherOrgID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HOtherOrgID"]);
+ oSub.HOWNERTYPEID = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HOWNERTYPEID"]);
+ oSub.HNewModel = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HNewModel"]);
+ oSub.HWallThickness = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HWallThickness"]);
+ oSub.HHardness = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HHardness"]);
+ oSub.HLastProdModel = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HLastProdModel"]);
+ oSub.HDiameter = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HDiameter"]);
+ oSub.HBackFlag = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HBackFlag"]);
+ oSub.HMouldType = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HMouldType"]);
+ oSub.HInitModel = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HInitModel"]);
+ oSub.HInitDesignLife = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HInitDesignLife"]);
+ oSub.HLifeUnitID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HLifeUnitID"]);
+ oSub.HNowModel = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HNowModel"]);
+ oSub.HNowLife = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HNowLife"]);
DetailColl.Add(oSub);
}
sReturn = "鏄剧ず鍗曟嵁鎴愬姛锛�";
diff --git a/Model/Model.csproj b/Model/Model.csproj
index 0a8a4e4..37a4fff 100644
--- a/Model/Model.csproj
+++ b/Model/Model.csproj
@@ -179,8 +179,12 @@
<Compile Include="鐢熶骇绠$悊\鎺掍骇瑙i攣鐢宠鍗昞ClsJIT_UnLockRequestBillSub.cs" />
<Compile Include="鐢熶骇绠$悊\鎺掍骇閿佸畾鐢宠鍗昞ClsJIT_LockRequestBillMain.cs" />
<Compile Include="鐢熶骇绠$悊\鎺掍骇閿佸畾鐢宠鍗昞ClsJIT_LockRequestBillSub.cs" />
+ <Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsSc_MouldOutRequestBillSub.cs" />
+ <Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsSc_MouldOutRequestBillMain.cs" />
<Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsSc_MouldMaintainPlanBillSub_Plan.cs" />
+ <Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsSc_MouldInRequestBillMain.cs" />
<Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsSc_MouldMoveStockRequestBillMain.cs" />
+ <Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsSc_MouldInRequestBillSub.cs" />
<Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsSc_MouldMoveStockRequestBillSub.cs" />
<Compile Include="鐢熶骇绠$悊\鐢熶骇棰嗘枡\ClsKf_ProductReceiveMaterialBillMain.cs" />
<Compile Include="鐢熶骇绠$悊\鐢熶骇棰嗘枡\ClsKf_ProductReceiveMaterialBillSub.cs" />
diff --git "a/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldInRequestBillMain.cs" "b/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldInRequestBillMain.cs"
new file mode 100644
index 0000000..49ebf32
--- /dev/null
+++ "b/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldInRequestBillMain.cs"
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Model
+{
+ public class ClsSc_MouldInRequestBillMain : DBUtility.ClsXt_BaseBillMain
+ {
+ public Int64 HPrintQty; // int --打印次数
+ public Int64 HSupID; // int --往来单位
+ public Int64 HSupTypeID; // int --往来类型
+ public Int64 HDeptID; // int --部门
+ public Int64 HWHID; // int --仓库
+ public Int64 HEmpID; // int --业务员
+ public Int64 HMangerID; // int --主管
+ public Int64 HSecManagerID; // int --验收
+ public Int64 HKeeperID; // int --保管员
+ public string HExplanation; // varchar(200) --摘要
+ public string HInnerBillNo; // varchar(50) --内部单据号
+
+ }
+}
diff --git "a/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldInRequestBillSub.cs" "b/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldInRequestBillSub.cs"
new file mode 100644
index 0000000..b1d8d7f
--- /dev/null
+++ "b/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldInRequestBillSub.cs"
@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Model
+{
+ public class ClsSc_MouldInRequestBillSub : DBUtility.ClsXt_BaseBillSub
+ {
+ public Int64 HMaterID; // int --模具ID
+ public Int64 HPropertyID; // int --辅助属性
+ public Int64 HSecUnitID; // int --辅助计量单位
+ public Single HSecUnitRate; // money --换算率
+ public Int64 HUnitID; // int --计量单位
+ public double HQtyMust; // dec(18,8) --应收数量
+ public double HQty; // dec(18,8) --申请数量
+ public double HPrice; // dec(18,8) --单价
+ public double HMoney; // dec(18,8) --金额
+ public Int64 HWHID; // int --仓库
+ public Int64 HSPID; // int --仓位
+ public Int64 HERPInterID;
+ public Int64 HERPEntryID;
+ public Int64 HPOOrderInterID; // int --采购订单主ID
+ public Int64 HPOOrderEntryID; // int --采购订单子ID
+ public string HPOOrderBillNo; // varchar(50) --采购订单号
+ public Int64 HSeOrderInterID; // int --销售订单主ID
+ public Int64 HSeOrderEntryID; // int --销售订单子ID
+ public string HSeOrderBillNo; // varchar(50) --销售订单号
+ public Int64 HICMOInterID; // int --生产订单主ID
+ public Int64 HICMOEntryID; // int --生产订单子ID
+ public string HICMOBillNo; // varchar(100) --生产订单号
+ public Int64 HSEQ; // int --序号
+ public Int64 HSTOCKSTATUSID; // int --库存状态
+
+ }
+}
diff --git "a/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldOutRequestBillMain.cs" "b/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldOutRequestBillMain.cs"
new file mode 100644
index 0000000..9632e99
--- /dev/null
+++ "b/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldOutRequestBillMain.cs"
@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Model
+{
+ public class ClsSc_MouldOutRequestBillMain : DBUtility.ClsXt_BaseBillMain
+ {
+ public Int64 HPrintQty; // int --打印次数
+ public Int64 HSupID; // int --往来单位
+ public Int64 HSupTypeID; // int --往来类型
+ public Int64 HDeptID; // int --部门
+ public Int64 HWHID; // int --仓库
+ public Int64 HEmpID; // int --业务员
+ public Int64 HMangerID; // int --主管
+ public Int64 HSecManagerID; // int --验收
+ public Int64 HKeeperID; // int --保管员
+ public string HExplanation; // varchar(200) --摘要
+ public string HInnerBillNo; // varchar(50) --内部单据号
+ public Int64 HERPInterID; // int --ERP主内码
+ public string HERPBillType; // varchar(100) --ERP单据类型
+ public string HOWNERTYPEIDHEAD; // varchar(50) --货主类型
+ public string HBIZTYPE; // varchar(50) --业务类型
+
+ }
+}
diff --git "a/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldOutRequestBillSub.cs" "b/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldOutRequestBillSub.cs"
new file mode 100644
index 0000000..baea94d
--- /dev/null
+++ "b/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldOutRequestBillSub.cs"
@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Model
+{
+ public class ClsSc_MouldOutRequestBillSub : DBUtility.ClsXt_BaseBillSub
+ {
+ public Int64 HMaterID; // int --模具ID
+ public Int64 HPropertyID; // int --辅助属性
+ public Int64 HSecUnitID; // int --辅助计量单位
+ public Single HSecUnitRate; // money --换算率
+ public Int64 HUnitID; // int --计量单位
+ public double HQtyMust; // dec(18,8) --应收数量
+ public double HQty; // dec(18,8) --申请数量
+ public double HPrice; // dec(18,8) --单价
+ public double HMoney; // dec(18,8) --金额
+ public Int64 HWHID; // int --仓库
+ public Int64 HSPID; // int --仓位
+ public Int64 HERPInterID;
+ public Int64 HERPEntryID;
+ public Int64 HPOOrderInterID; // int --采购订单主ID
+ public Int64 HPOOrderEntryID; // int --采购订单子ID
+ public string HPOOrderBillNo; // varchar(50) --采购订单号
+ public Int64 HSeOrderInterID; // int --销售订单主ID
+ public Int64 HSeOrderEntryID; // int --销售订单子ID
+ public string HSeOrderBillNo; // varchar(50) --销售订单号
+ public Int64 HICMOInterID; // int --生产订单主ID
+ public Int64 HICMOEntryID; // int --生产订单子ID
+ public string HICMOBillNo; // varchar(100) --生产订单号
+ public Int64 HSEQ; // int --序号
+ public Int64 HSTOCKSTATUSID; // int --库存状态
+
+ }
+}
diff --git "a/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldProdOutBillSub.cs" "b/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldProdOutBillSub.cs"
index 7396e9d..0792b6c 100644
--- "a/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldProdOutBillSub.cs"
+++ "b/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldProdOutBillSub.cs"
@@ -39,5 +39,17 @@
public string HBarCode;
public Int64 HCorrespondentTypeID; // int --往来单位类型(1 供应商、2 客户、 3 车间部门)
public Int64 HCorrespondentID; // int --往来单位内码
+ public string HNewModel;
+ public string HWallThickness;
+ public string HHardness;
+ public string HLastProdModel;
+ public string HDiameter;
+ public string HBackFlag;
+ public Int64 HMouldType;
+ public string HInitModel;
+ public Single HInitDesignLife;
+ public Int64 HLifeUnitID;
+ public string HNowModel;
+ public double HNowLife;
}
}
diff --git a/WebAPI/Controllers/MJGL/Sc_MouldInRequestBillController.cs b/WebAPI/Controllers/MJGL/Sc_MouldInRequestBillController.cs
new file mode 100644
index 0000000..cf1393a
--- /dev/null
+++ b/WebAPI/Controllers/MJGL/Sc_MouldInRequestBillController.cs
@@ -0,0 +1,796 @@
+锘縰sing Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using Pub_Class;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Web.Http;
+using WebAPI.Models;
+using System.Windows.Forms;
+using SyntacticSugar.constant;
+namespace WebAPI.Controllers
+{
+
+ public class Sc_MouldInRequestBillController : ApiController
+ {
+ public DBUtility.ClsPub.Enum_BillStatus BillStatus;
+ public const string ModName = "3851"; //鍗曟嵁绫诲瀷
+ public const string ModCaption = "鍣ㄥ叿鍏ュ簱鐢宠鍗�"; //鍗曟嵁鍚嶇О
+ public const string ModRightName = "Sc_MouldInRequestBill";
+ public const string ModRightNameList = ModRightName + "List"; //鍒楄〃
+ public const string ModRightNameEdit = ModRightName + "_Edit"; //缂栬緫
+ public const string ModRightNameCheck = ModRightName + "_Check"; //瀹℃牳
+ public const string ModRightNameClose = ModRightName + "_Close"; //鍏抽棴
+ public const string ModRightNameDelete = ModRightName + "_Delete"; //浣滃簾
+ public const string ModRightNameDrop = ModRightName + "_Drop"; //鍒犻櫎
+ public DataSet ds = new DataSet();
+ private json objJsonResult = new json();
+ SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+ public DAL.ClsSc_MouldInRequestBill oBill = new DAL.ClsSc_MouldInRequestBill();
+
+
+ #region 鍣ㄥ叿鍏ュ簱鐢宠鍗曞垎椤靛垪琛�
+ [Route("Sc_MouldInRequestBillController/page")]
+ [HttpGet]
+ public json Sc_MouldInRequestBillPage(string sWhere, string user, int page, int size, string Type)
+ {
+ try
+ {
+ List<object> columnNameList = new List<object>();
+ //鍒楄〃杩涘叆鏃跺垽鏂潈闄愶紝閫夋簮鍗曡繘鍏ヤ笉鍒ゆ柇鏉冮檺
+ if (Type == ModName)
+ {
+ if (!DBUtility.ClsPub.Security_Log(ModRightNameList, 3, false, user))
+ {
+ objJsonResult.code = CodeConstant.FAIL;
+ objJsonResult.count = CountConstant.FAIL;
+ objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ sWhere = sWhere.Replace("'", "''");
+ if (sWhere == null || sWhere.Equals(""))
+ {
+ ds = oCn.RunProcReturn("exec h_p_Sc_MouldInRequestBillList " + page + "," + size + ",'','" + Type + "'", "h_p_Sc_MouldInRequestBillList");
+ }
+ else
+ {
+ ds = oCn.RunProcReturn("exec h_p_Sc_MouldInRequestBillList " + page + "," + size + ",'" + sWhere + "','" + Type + "'", "h_p_Sc_MouldInRequestBillList");
+ }
+
+ //娣诲姞鍒楀悕
+ foreach (DataColumn col in ds.Tables[0].Columns)
+ {
+ Type dataType = col.DataType;
+ string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+ columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+ }
+
+ objJsonResult.code = CodeConstant.SUCCEED;
+ objJsonResult.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
+ objJsonResult.Message = "鎴愬姛锛�";
+ objJsonResult.list = columnNameList;
+ objJsonResult.data = ds.Tables[0];
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = CodeConstant.FAIL;
+ objJsonResult.count = CountConstant.FAIL;
+ objJsonResult.Message = "鏌ヨ鍒楄〃淇℃伅澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 鍣ㄥ叿鍏ュ簱鐢宠鍗� 鍒犻櫎
+ /// <summary>
+ /// 鍒犻櫎鍣ㄥ叿鍏ュ簱鐢宠鍗�
+ /// </summary>
+ /// <returns></returns>
+ [Route("Sc_MouldInRequestBillController/GetSc_MouldInRequestBill_Delete_Json")]
+ [HttpGet]
+ public object GetSc_MouldInRequestBill_Delete_Json(Int64 HInterID, string HMaker)
+ {
+ try
+ {
+ //鍒ゆ柇鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log(ModRightNameDrop, 3, false, HMaker))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡鍒犻櫎鍔熻兘鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ //鍒ゆ柇瀛樺湪鎬�
+ if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo))
+ {
+ //鍒犻櫎鍓嶆帶鍒�
+ DataSet BeforeDs = oCn.RunProcReturn("Exec h_p_Sc_MouldInRequestBill_BeforeDelCtrl " + HInterID.ToString() + ",'" + HMaker + "'", "h_p_Sc_MouldInRequestBill_BeforeDelCtrl");
+ 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;
+ }
+ }
+ //鍒犻櫎鍗曟嵁锛堝寘鍚垹闄ゅ悗鎺у埗銆佸啓鍏ユ棩蹇楋級
+ if (!oBill.DeleteBill(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Sc_MouldInRequestBill_AfterDelCtrl", HMaker, ref ClsPub.sExeReturnInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍒犻櫎鍣ㄥ叿鍏ュ簱鐢宠鍗曟垚鍔燂紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏈煡璇㈠埌璇ュ櫒鍏峰叆搴撶敵璇峰崟锛岃鍒锋柊鏁版嵁鍚庨噸鏂伴�夋嫨锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎鍣ㄥ叿鍏ュ簱鐢宠鍗曞け璐ワ紒" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 鍣ㄥ叿鍏ュ簱鐢宠鍗� 瀹℃牳/鍙嶅鏍�
+ /// <summary>
+ /// 瀹℃牳/鍙嶅鏍稿櫒鍏峰叆搴撶敵璇峰崟
+ /// </summary>
+ /// <param name="HInterID">鍗曟嵁ID</param>
+ /// <param name="Type">瀹℃牳(1),鍙嶅鏍�(2)</param>
+ /// <param name="HMaker">瀹℃牳浜�</param>
+ /// <returns></returns>
+ [Route("Sc_MouldInRequestBillController/GetSc_MouldInRequestBill_Check_Json")]
+ [HttpGet]
+ public object GetSc_MouldInRequestBill_Check_Json(Int64 HInterID, int Type, string HMaker)
+ {
+ try
+ {
+ //鍒ゆ柇鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 3, false, HMaker))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡瀹℃牳/鍙嶅鏍稿姛鑳芥潈闄�,璇蜂笌绠$悊鍛樿仈绯伙紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ //鍒ゆ柇瀛樺湪鎬�
+ if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo))
+ {
+ //Type 1 瀹℃牳 2 鍙嶅鏍�
+ if (Type == 1)
+ {
+ if (oBill.omodel.HChecker.Trim() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸插鏍革紝涓嶈兘鍐嶆瀹℃牳锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (oBill.omodel.HCloseMan.Trim() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸插叧闂紝涓嶈兘鍐嶆瀹℃牳锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (oBill.omodel.HDeleteMan.Trim() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸蹭綔搴燂紝涓嶈兘鍐嶆瀹℃牳锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //瀹℃牳鍓嶆帶鍒�
+ DataSet BeforeDs = oCn.RunProcReturn("Exec h_p_Sc_MouldInRequestBill_BeforeCheckCtrl " + HInterID.ToString() + ",'" + HMaker + "'", "h_p_Sc_MouldInRequestBill_BeforeCheckCtrl");
+ 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;
+ }
+ }
+ //瀹℃牳鍗曟嵁
+ if (!oBill.CheckBill(HInterID, oBill.omodel.HBillNo, "h_p_Sc_MouldInRequestBill_AfterCheckCtrl", HMaker, ref ClsPub.sExeReturnInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍗曟嵁鍙凤細" + oBill.omodel.HBillNo + " 瀹℃牳鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult; ;
+ }
+ }
+ else
+ {
+ if (oBill.omodel.HChecker.Trim() == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鏈鏍革紝涓嶉渶瑕佸弽瀹℃牳锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //鍙嶅鏍稿墠鎺у埗
+ DataSet BeforeDs = oCn.RunProcReturn("Exec h_p_Sc_MouldInRequestBill_BeforeUnCheckCtrl " + HInterID.ToString() + ",'" + HMaker + "'", "h_p_Sc_MouldInRequestBill_BeforeUnCheckCtrl");
+ 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;
+ }
+ }
+
+ //鍙嶅鏍稿崟鎹�
+ if (!oBill.AbandonCheck(HInterID, oBill.omodel.HBillNo, "h_p_Sc_MouldInRequestBill_AfterUnCheckCtrl", HMaker, ref ClsPub.sExeReturnInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍗曟嵁鍙凤細" + oBill.omodel.HBillNo + " 鍙嶅鏍告垚鍔燂紒";
+ objJsonResult.data = null;
+ return objJsonResult; ;
+ }
+ }
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏈煡璇㈠埌璇ュ櫒鍏峰叆搴撶敵璇峰崟锛岃鍒锋柊鏁版嵁鍚庨噸鏂伴�夋嫨锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳鎴栧弽瀹℃牳鍣ㄥ叿鍏ュ簱鐢宠鍗曞け璐ワ紒" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 鍣ㄥ叿鍏ュ簱鐢宠鍗� 鎵归噺瀹℃牳
+ /// <summary>
+ /// 鎵归噺瀹℃牳/鍙嶅鏍稿櫒鍏峰叆搴撶敵璇峰崟
+ /// </summary>
+ /// <param name="HInterID">鍗曟嵁ID</param>
+ /// <param name="Type">瀹℃牳(1),鍙嶅鏍�(2)</param>
+ /// <param name="HMaker">瀹℃牳浜�</param>
+ /// <returns></returns>
+ [Route("Sc_MouldInRequestBillController/CheckAll")]
+ [HttpGet]
+ public object CheckAll(string ids, int Type, string HMaker)
+ {
+ try
+ {
+ //澶勭悊瀛楃涓�
+ if (!string.IsNullOrEmpty(ids))
+ {
+ long[] idArray = Array.ConvertAll(ids.Split(','), long.Parse);
+ // 澶勭悊idArray...
+ oCn.BeginTran();
+ for (int i = 0; i < idArray.Length; i++)
+ {
+ objJsonResult = (json)GetSc_MouldInRequestBill_Check_Json(idArray[i], Type, HMaker);//瀹℃牳鎵ц
+ if (objJsonResult.count == 0)
+ {
+ oCn.RollBack();
+ objJsonResult.Message += "绗�" + (i + 1) + "琛屽嚭鐜伴棶棰樻棤娉曠户缁畬鎴�";
+ return objJsonResult;
+ }
+ }
+ oCn.Commit();
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "璇烽�夋嫨姝g‘琛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ objJsonResult.code = CodeConstant.SUCCEED;
+ objJsonResult.count = CountConstant.SUCCEED;
+ objJsonResult.Message = "鎵ц鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ oCn.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳鎴栧弽瀹℃牳鍣ㄥ叿鍏ュ簱鐢宠鍗曞け璐ワ紒" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 鍣ㄥ叿鍏ュ簱鐢宠鍗� 鍏抽棴/鍙嶅叧闂�
+ /// <summary>
+ /// 鍏抽棴/鍙嶅叧闂櫒鍏峰叆搴撶敵璇峰崟
+ /// </summary>
+ /// <param name="HInterID">鍗曟嵁ID</param>
+ /// <param name="Type">鍏抽棴(1),鍙嶅叧闂�(2)</param>
+ /// <param name="HMaker">鍏抽棴浜�</param>
+ /// <returns></returns>
+ [Route("Sc_MouldInRequestBillController/GetSc_MouldInRequestBill_Close_Json")]
+ [HttpGet]
+ public object GetSc_MouldInRequestBill_Close_Json(Int64 HInterID, int Type, string HMaker)
+ {
+ try
+ {
+ //鍒ゆ柇鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log(ModRightNameClose, 3, false, HMaker))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡鍏抽棴/鍙嶅叧闂姛鑳芥潈闄�,璇蜂笌绠$悊鍛樿仈绯伙紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ //鍒ゆ柇瀛樺湪鎬�
+ if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo))
+ {
+ //Type 1 鍏抽棴 2 鍙嶅叧闂�
+ if (Type == 1)
+ {
+ if (oBill.omodel.HCloseMan.Trim() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸插叧闂紝涓嶈兘鍐嶆鍏抽棴锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //鍏抽棴鍗曟嵁
+ if (!oBill.CloseBill(HInterID, oBill.omodel.HBillNo, HMaker, ref ClsPub.sExeReturnInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍏抽棴澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍗曟嵁鍙凤細" + oBill.omodel.HBillNo + " 鍏抽棴鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult; ;
+ }
+ }
+ else
+ {
+ if (oBill.omodel.HCloseMan.Trim() == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鏈叧闂紝涓嶉渶瑕佸弽鍏抽棴锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //鍙嶅叧闂崟鎹�
+ if (!oBill.CancelClose(HInterID, oBill.omodel.HBillNo, HMaker, ref ClsPub.sExeReturnInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍙嶅叧闂け璐�!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍗曟嵁鍙凤細" + oBill.omodel.HBillNo + " 鍙嶅叧闂垚鍔燂紒";
+ objJsonResult.data = null;
+ return objJsonResult; ;
+ }
+ }
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏈煡璇㈠埌璇ュ櫒鍏峰叆搴撶敵璇峰崟锛岃鍒锋柊鏁版嵁鍚庨噸鏂伴�夋嫨锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍏抽棴鎴栧弽鍏抽棴鍣ㄥ叿鍏ュ簱鐢宠鍗曞け璐ワ紒" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 鍣ㄥ叿鍏ュ簱鐢宠鍗� 浣滃簾/鍙嶄綔搴�
+ /// <summary>
+ /// 浣滃簾/鍙嶄綔搴� 鍣ㄥ叿鍏ュ簱鐢宠鍗�
+ /// </summary>
+ /// <param name="HInterID">鍗曟嵁ID</param>
+ /// <param name="Type">浣滃簾(1),鍙嶄綔搴�(2)</param>
+ /// <param name="HMaker">浣滃簾浜�</param>
+ /// <returns></returns>
+ [Route("Sc_MouldInRequestBillController/GetSc_MouldInRequestBill_Cancelltion_Json")]
+ [HttpGet]
+ public object GetSc_MouldInRequestBill_Cancelltion_Json(Int64 HInterID, int Type, string HMaker)
+ {
+ try
+ {
+ //鍒ゆ柇鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log(ModRightNameDelete, 3, false, HMaker))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡浣滃簾/鍙嶄綔搴熷姛鑳芥潈闄�,璇蜂笌绠$悊鍛樿仈绯伙紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ //鍒ゆ柇瀛樺湪鎬�
+ if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo))
+ {
+ //Type 1 浣滃簾 2 鍙嶄綔搴�
+ if (Type == 1)
+ {
+ if (oBill.omodel.HDeleteMan.Trim() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸蹭綔搴燂紝涓嶈兘鍐嶆浣滃簾锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //浣滃簾鍗曟嵁
+ if (!oBill.Cancelltion(HInterID, oBill.omodel.HBillNo, HMaker, ref ClsPub.sExeReturnInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "浣滃簾澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍗曟嵁鍙凤細" + oBill.omodel.HBillNo + " 浣滃簾鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult; ;
+ }
+ }
+ else
+ {
+ if (oBill.omodel.HDeleteMan.Trim() == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鏈綔搴燂紝涓嶉渶瑕佸弽浣滃簾锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //鍙嶄綔搴熷崟鎹�
+ if (!oBill.AbandonCancelltion(HInterID, oBill.omodel.HBillNo, HMaker, ref ClsPub.sExeReturnInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍙嶄綔搴熷け璐�!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍗曟嵁鍙凤細" + oBill.omodel.HBillNo + " 鍙嶄綔搴熸垚鍔燂紒";
+ objJsonResult.data = null;
+ return objJsonResult; ;
+ }
+ }
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏈煡璇㈠埌璇ュ櫒鍏峰叆搴撶敵璇峰崟锛岃鍒锋柊鏁版嵁鍚庨噸鏂伴�夋嫨锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "浣滃簾鎴栧弽浣滃簾鍣ㄥ叿鍏ュ簱鐢宠鍗曞け璐ワ紒" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 鍣ㄥ叿鍏ュ簱鐢宠鍗曟ā鍧� 浠庡垪琛ㄩ�変腑鎵撳紑鍗曟嵁锛岃繑鍥炲崟鎹俊鎭椂璋冪敤
+ /// <summary>
+ /// 鍣ㄥ叿鍏ュ簱鐢宠鍗曠紪杈戞椂锛屾牴鎹崟鎹甀D鑾峰彇鍗曟嵁淇℃伅
+ /// </summary>
+ /// <returns></returns>
+ [Route("Sc_MouldInRequestBillController/GetSc_MouldInRequestBill_Json")]
+ [HttpGet]
+ public object GetSc_MouldInRequestBill_Json(Int64 HInterID, string HMaker)
+ {
+ try
+ {
+ //鍒ゆ柇鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log(ModRightNameEdit, 3, false, HMaker))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡缂栬緫鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ //杩斿洖鍒楄〃淇℃伅
+ ds = oCn.RunProcReturn("exec h_p_Sc_MouldInRequestBill_EditInit " + HInterID, "h_p_Sc_MouldInRequestBill_EditInit");
+ if (ds == null || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏈煡璇㈠埌璇ュ櫒鍏峰叆搴撶敵璇峰崟锛岃鍒锋柊鏁版嵁鍚庨噸鏂伴�夋嫨锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鎴愬姛锛�";
+ objJsonResult.data = ds.Tables[0];
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "杩斿洖鍣ㄥ叿鍏ュ簱鐢宠鍗曚俊鎭け璐ワ紒" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 鍣ㄥ叿鍏ュ簱鐢宠鍗� 淇濆瓨
+ /// <summary>
+ /// 鍣ㄥ叿鍏ュ簱鐢宠鍗曚繚瀛�
+ /// </summary>
+ [Route("Sc_MouldInRequestBillController/GetSc_MouldInRequestBill_Save_Json")]
+ [HttpPost]
+ public object GetSc_MouldInRequestBill_Save_Json([FromBody] JObject sMainSub)
+ {
+ var _value = sMainSub["sMainSub"].ToString();
+ string msg1 = _value.ToString();
+ string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+ string sMainStr = sArray[0].ToString(); //涓昏〃鏁版嵁
+ string sSubStr = sArray[1].ToString(); //瀛愯〃鏁版嵁
+ string OperationType = sArray[2].ToString(); //鎿嶄綔绫诲瀷锛�1鏂板銆�2缂栬緫锛�
+ string HMaker = sArray[3].ToString(); //鍒跺崟浜�
+ try
+ {
+ //鍒ゆ柇鏉冮檺
+ if (OperationType == "1")
+ {
+ BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew;
+ //鍒ゆ柇鏂板鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log(ModRightName, 1, false, HMaker))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡鏂板鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ else
+ {
+ BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_Modify;
+ //鍒ゆ柇缂栬緫鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log(ModRightNameEdit, 1, false, HMaker))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡缂栬緫鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ //琛ㄥご璧嬪��
+ sMainStr = sMainStr.Replace("\\", "");
+ sMainStr = sMainStr.Replace("\n", "");
+ sMainStr = "[" + sMainStr.ToString() + "]";
+ List<Model.ClsSc_MouldInRequestBillMain> lsmain = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldInRequestBillMain>>(sMainStr);
+ foreach (Model.ClsSc_MouldInRequestBillMain oItem in lsmain)
+ {
+ //鍗曟嵁鍙锋槸鍚﹂噸澶�
+ if (oBill.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, oItem.HInterID))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鍙烽噸澶嶏紒涓嶅厑璁镐繚瀛橈紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //鍒ゆ柇浼氳鏈熸槸鍚﹀悎鐞�
+ string s = "";
+ int sYear = 0;
+ int sPeriod = 0;
+ if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(oItem.HDate, ref sYear, ref sPeriod, ref s) == false)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = s;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ oItem.HYear = sYear;
+ oItem.HPeriod = sPeriod;
+ DBUtility.ClsPub.CurUserName = oItem.HMaker;
+ oBill.omodel = oItem;
+ }
+ //琛ㄤ綋璧嬪��
+ //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆�
+ sSubStr = sSubStr.Substring(1, sSubStr.Length - 2);
+ sSubStr = sSubStr.Replace("\\", "");
+ sSubStr = sSubStr.Replace("\n", "");
+ sSubStr = "[" + sSubStr.ToString() + "]";
+ List<Model.ClsSc_MouldInRequestBillSub> ls = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldInRequestBillSub>>(sSubStr);
+ int i = 0;
+ foreach (Model.ClsSc_MouldInRequestBillSub oItemSub in ls)
+ {
+ i++;
+ oItemSub.HEntryID = i;
+ oBill.DetailColl.Add(oItemSub);
+ }
+
+ //淇濆瓨
+ bool bResult;
+ if (OperationType == "1") //鏂板淇濆瓨
+ {
+ bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+ }
+ else //缂栬緫淇濆瓨
+ {
+ bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+ }
+
+ if (bResult)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; //鎴愬姛锛�
+ objJsonResult.data = null;
+ objJsonResult.HInterID = oBill.omodel.HInterID.ToString(); //杩斿洖涓籌D
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.Message;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ #endregion
+
+
+
+
+ }
+}
\ No newline at end of file
diff --git a/WebAPI/Controllers/MJGL/Sc_MouldMoveStockRequestBillController.cs b/WebAPI/Controllers/MJGL/Sc_MouldMoveStockRequestBillController.cs
index cf9543e..257d96e 100644
--- a/WebAPI/Controllers/MJGL/Sc_MouldMoveStockRequestBillController.cs
+++ b/WebAPI/Controllers/MJGL/Sc_MouldMoveStockRequestBillController.cs
@@ -34,29 +34,32 @@
#region 鍣ㄥ叿璋冩嫧鐢宠鍗曞垎椤靛垪琛�
[Route("Sc_MouldMoveStockRequestBillController/page")]
[HttpGet]
- public json Sc_MouldMoveStockRequestBillPage(string sWhere, string user, int page, int size)
+ public json Sc_MouldMoveStockRequestBillPage(string sWhere, string user, int page, int size, string Type)
{
try
{
List<object> columnNameList = new List<object>();
- //鍒ゆ柇鏉冮檺
- if (!DBUtility.ClsPub.Security_Log(ModRightNameList, 3, false, user))
+ //鍒楄〃杩涘叆鏃跺垽鏂潈闄愶紝閫夋簮鍗曡繘鍏ヤ笉鍒ゆ柇鏉冮檺
+ if (Type == ModName)
{
- objJsonResult.code = CodeConstant.FAIL;
- objJsonResult.count = CountConstant.FAIL;
- objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒";
- objJsonResult.data = null;
- return objJsonResult;
+ if (!DBUtility.ClsPub.Security_Log(ModRightNameList, 3, false, user))
+ {
+ objJsonResult.code = CodeConstant.FAIL;
+ objJsonResult.count = CountConstant.FAIL;
+ objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
}
sWhere = sWhere.Replace("'", "''");
if (sWhere == null || sWhere.Equals(""))
{
- ds = oCn.RunProcReturn("exec h_p_Sc_MouldMoveStockRequestBillList " + page + "," + size + ",''", "h_p_Sc_MouldMoveStockRequestBillList");
+ ds = oCn.RunProcReturn("exec h_p_Sc_MouldMoveStockRequestBillList " + page + "," + size + ",'','" + Type + "'", "h_p_Sc_MouldMoveStockRequestBillList");
}
else
{
- ds = oCn.RunProcReturn("exec h_p_Sc_MouldMoveStockRequestBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_Sc_MouldMoveStockRequestBillList");
+ ds = oCn.RunProcReturn("exec h_p_Sc_MouldMoveStockRequestBillList " + page + "," + size + ",'" + sWhere + "','" + Type + "'", "h_p_Sc_MouldMoveStockRequestBillList");
}
//娣诲姞鍒楀悕
@@ -716,7 +719,7 @@
string s = "";
int sYear = 0;
int sPeriod = 0;
- if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod_Pay(oItem.HDate, ref sYear, ref sPeriod, ref s) == false)
+ if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(oItem.HDate, ref sYear, ref sPeriod, ref s) == false)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
@@ -762,6 +765,7 @@
objJsonResult.count = 1;
objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; //鎴愬姛锛�
objJsonResult.data = null;
+ objJsonResult.HInterID = oBill.omodel.HInterID.ToString(); //杩斿洖涓籌D
return objJsonResult;
}
else
diff --git a/WebAPI/Controllers/MJGL/Sc_MouldOutRequestBillController.cs b/WebAPI/Controllers/MJGL/Sc_MouldOutRequestBillController.cs
new file mode 100644
index 0000000..a4cee17
--- /dev/null
+++ b/WebAPI/Controllers/MJGL/Sc_MouldOutRequestBillController.cs
@@ -0,0 +1,796 @@
+锘縰sing Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using Pub_Class;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Web.Http;
+using WebAPI.Models;
+using System.Windows.Forms;
+using SyntacticSugar.constant;
+namespace WebAPI.Controllers
+{
+
+ public class Sc_MouldOutRequestBillController : ApiController
+ {
+ public DBUtility.ClsPub.Enum_BillStatus BillStatus;
+ public const string ModName = "3849"; //鍗曟嵁绫诲瀷
+ public const string ModCaption = "鍣ㄥ叿鍑哄簱鐢宠鍗�"; //鍗曟嵁鍚嶇О
+ public const string ModRightName = "Sc_MouldOutRequestBill";
+ public const string ModRightNameList = ModRightName + "List"; //鍒楄〃
+ public const string ModRightNameEdit = ModRightName + "_Edit"; //缂栬緫
+ public const string ModRightNameCheck = ModRightName + "_Check"; //瀹℃牳
+ public const string ModRightNameClose = ModRightName + "_Close"; //鍏抽棴
+ public const string ModRightNameDelete = ModRightName + "_Delete"; //浣滃簾
+ public const string ModRightNameDrop = ModRightName + "_Drop"; //鍒犻櫎
+ public DataSet ds = new DataSet();
+ private json objJsonResult = new json();
+ SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+ public DAL.ClsSc_MouldOutRequestBill oBill = new DAL.ClsSc_MouldOutRequestBill();
+
+
+ #region 鍣ㄥ叿鍑哄簱鐢宠鍗曞垎椤靛垪琛�
+ [Route("Sc_MouldOutRequestBillController/page")]
+ [HttpGet]
+ public json Sc_MouldOutRequestBillPage(string sWhere, string user, int page, int size, string Type)
+ {
+ try
+ {
+ List<object> columnNameList = new List<object>();
+ //鍒楄〃杩涘叆鏃跺垽鏂潈闄愶紝閫夋簮鍗曡繘鍏ヤ笉鍒ゆ柇鏉冮檺
+ if(Type== ModName)
+ {
+ if (!DBUtility.ClsPub.Security_Log(ModRightNameList, 3, false, user))
+ {
+ objJsonResult.code = CodeConstant.FAIL;
+ objJsonResult.count = CountConstant.FAIL;
+ objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ sWhere = sWhere.Replace("'", "''");
+ if (sWhere == null || sWhere.Equals(""))
+ {
+ ds = oCn.RunProcReturn("exec h_p_Sc_MouldOutRequestBillList " + page + "," + size + ",'','" + Type + "'", "h_p_Sc_MouldOutRequestBillList");
+ }
+ else
+ {
+ ds = oCn.RunProcReturn("exec h_p_Sc_MouldOutRequestBillList " + page + "," + size + ",'" + sWhere + "','" + Type + "'", "h_p_Sc_MouldOutRequestBillList");
+ }
+
+ //娣诲姞鍒楀悕
+ foreach (DataColumn col in ds.Tables[0].Columns)
+ {
+ Type dataType = col.DataType;
+ string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+ columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+ }
+
+ objJsonResult.code = CodeConstant.SUCCEED;
+ objJsonResult.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
+ objJsonResult.Message = "鎴愬姛锛�";
+ objJsonResult.list = columnNameList;
+ objJsonResult.data = ds.Tables[0];
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = CodeConstant.FAIL;
+ objJsonResult.count = CountConstant.FAIL;
+ objJsonResult.Message = "鏌ヨ鍒楄〃淇℃伅澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 鍣ㄥ叿鍑哄簱鐢宠鍗� 鍒犻櫎
+ /// <summary>
+ /// 鍒犻櫎鍣ㄥ叿鍑哄簱鐢宠鍗�
+ /// </summary>
+ /// <returns></returns>
+ [Route("Sc_MouldOutRequestBillController/GetSc_MouldOutRequestBill_Delete_Json")]
+ [HttpGet]
+ public object GetSc_MouldOutRequestBill_Delete_Json(Int64 HInterID, string HMaker)
+ {
+ try
+ {
+ //鍒ゆ柇鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log(ModRightNameDrop, 3, false, HMaker))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡鍒犻櫎鍔熻兘鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ //鍒ゆ柇瀛樺湪鎬�
+ if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo))
+ {
+ //鍒犻櫎鍓嶆帶鍒�
+ DataSet BeforeDs = oCn.RunProcReturn("Exec h_p_Sc_MouldOutRequestBill_BeforeDelCtrl " + HInterID.ToString() + ",'" + HMaker + "'", "h_p_Sc_MouldOutRequestBill_BeforeDelCtrl");
+ 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;
+ }
+ }
+ //鍒犻櫎鍗曟嵁锛堝寘鍚垹闄ゅ悗鎺у埗銆佸啓鍏ユ棩蹇楋級
+ if (!oBill.DeleteBill(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Sc_MouldOutRequestBill_AfterDelCtrl", HMaker, ref ClsPub.sExeReturnInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍒犻櫎鍣ㄥ叿鍑哄簱鐢宠鍗曟垚鍔燂紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏈煡璇㈠埌璇ュ櫒鍏峰嚭搴撶敵璇峰崟锛岃鍒锋柊鏁版嵁鍚庨噸鏂伴�夋嫨锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎鍣ㄥ叿鍑哄簱鐢宠鍗曞け璐ワ紒" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 鍣ㄥ叿鍑哄簱鐢宠鍗� 瀹℃牳/鍙嶅鏍�
+ /// <summary>
+ /// 瀹℃牳/鍙嶅鏍稿櫒鍏峰嚭搴撶敵璇峰崟
+ /// </summary>
+ /// <param name="HInterID">鍗曟嵁ID</param>
+ /// <param name="Type">瀹℃牳(1),鍙嶅鏍�(2)</param>
+ /// <param name="HMaker">瀹℃牳浜�</param>
+ /// <returns></returns>
+ [Route("Sc_MouldOutRequestBillController/GetSc_MouldOutRequestBill_Check_Json")]
+ [HttpGet]
+ public object GetSc_MouldOutRequestBill_Check_Json(Int64 HInterID, int Type, string HMaker)
+ {
+ try
+ {
+ //鍒ゆ柇鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 3, false, HMaker))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡瀹℃牳/鍙嶅鏍稿姛鑳芥潈闄�,璇蜂笌绠$悊鍛樿仈绯伙紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ //鍒ゆ柇瀛樺湪鎬�
+ if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo))
+ {
+ //Type 1 瀹℃牳 2 鍙嶅鏍�
+ if (Type == 1)
+ {
+ if (oBill.omodel.HChecker.Trim() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸插鏍革紝涓嶈兘鍐嶆瀹℃牳锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (oBill.omodel.HCloseMan.Trim() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸插叧闂紝涓嶈兘鍐嶆瀹℃牳锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (oBill.omodel.HDeleteMan.Trim() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸蹭綔搴燂紝涓嶈兘鍐嶆瀹℃牳锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //瀹℃牳鍓嶆帶鍒�
+ DataSet BeforeDs = oCn.RunProcReturn("Exec h_p_Sc_MouldOutRequestBill_BeforeCheckCtrl " + HInterID.ToString() + ",'" + HMaker + "'", "h_p_Sc_MouldOutRequestBill_BeforeCheckCtrl");
+ 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;
+ }
+ }
+ //瀹℃牳鍗曟嵁
+ if (!oBill.CheckBill(HInterID, oBill.omodel.HBillNo, "h_p_Sc_MouldOutRequestBill_AfterCheckCtrl", HMaker, ref ClsPub.sExeReturnInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍗曟嵁鍙凤細" + oBill.omodel.HBillNo + " 瀹℃牳鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult; ;
+ }
+ }
+ else
+ {
+ if (oBill.omodel.HChecker.Trim() == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鏈鏍革紝涓嶉渶瑕佸弽瀹℃牳锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //鍙嶅鏍稿墠鎺у埗
+ DataSet BeforeDs = oCn.RunProcReturn("Exec h_p_Sc_MouldOutRequestBill_BeforeUnCheckCtrl " + HInterID.ToString() + ",'" + HMaker + "'", "h_p_Sc_MouldOutRequestBill_BeforeUnCheckCtrl");
+ 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;
+ }
+ }
+
+ //鍙嶅鏍稿崟鎹�
+ if (!oBill.AbandonCheck(HInterID, oBill.omodel.HBillNo, "h_p_Sc_MouldOutRequestBill_AfterUnCheckCtrl", HMaker, ref ClsPub.sExeReturnInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍗曟嵁鍙凤細" + oBill.omodel.HBillNo + " 鍙嶅鏍告垚鍔燂紒";
+ objJsonResult.data = null;
+ return objJsonResult; ;
+ }
+ }
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏈煡璇㈠埌璇ュ櫒鍏峰嚭搴撶敵璇峰崟锛岃鍒锋柊鏁版嵁鍚庨噸鏂伴�夋嫨锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳鎴栧弽瀹℃牳鍣ㄥ叿鍑哄簱鐢宠鍗曞け璐ワ紒" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 鍣ㄥ叿鍑哄簱鐢宠鍗� 鎵归噺瀹℃牳
+ /// <summary>
+ /// 鎵归噺瀹℃牳/鍙嶅鏍稿櫒鍏峰嚭搴撶敵璇峰崟
+ /// </summary>
+ /// <param name="HInterID">鍗曟嵁ID</param>
+ /// <param name="Type">瀹℃牳(1),鍙嶅鏍�(2)</param>
+ /// <param name="HMaker">瀹℃牳浜�</param>
+ /// <returns></returns>
+ [Route("Sc_MouldOutRequestBillController/CheckAll")]
+ [HttpGet]
+ public object CheckAll(string ids, int Type, string HMaker)
+ {
+ try
+ {
+ //澶勭悊瀛楃涓�
+ if (!string.IsNullOrEmpty(ids))
+ {
+ long[] idArray = Array.ConvertAll(ids.Split(','), long.Parse);
+ // 澶勭悊idArray...
+ oCn.BeginTran();
+ for (int i = 0; i < idArray.Length; i++)
+ {
+ objJsonResult = (json)GetSc_MouldOutRequestBill_Check_Json(idArray[i], Type, HMaker);//瀹℃牳鎵ц
+ if (objJsonResult.count == 0)
+ {
+ oCn.RollBack();
+ objJsonResult.Message += "绗�" + (i + 1) + "琛屽嚭鐜伴棶棰樻棤娉曠户缁畬鎴�";
+ return objJsonResult;
+ }
+ }
+ oCn.Commit();
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "璇烽�夋嫨姝g‘琛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ objJsonResult.code = CodeConstant.SUCCEED;
+ objJsonResult.count = CountConstant.SUCCEED;
+ objJsonResult.Message = "鎵ц鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ oCn.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳鎴栧弽瀹℃牳鍣ㄥ叿鍑哄簱鐢宠鍗曞け璐ワ紒" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 鍣ㄥ叿鍑哄簱鐢宠鍗� 鍏抽棴/鍙嶅叧闂�
+ /// <summary>
+ /// 鍏抽棴/鍙嶅叧闂櫒鍏峰嚭搴撶敵璇峰崟
+ /// </summary>
+ /// <param name="HInterID">鍗曟嵁ID</param>
+ /// <param name="Type">鍏抽棴(1),鍙嶅叧闂�(2)</param>
+ /// <param name="HMaker">鍏抽棴浜�</param>
+ /// <returns></returns>
+ [Route("Sc_MouldOutRequestBillController/GetSc_MouldOutRequestBill_Close_Json")]
+ [HttpGet]
+ public object GetSc_MouldOutRequestBill_Close_Json(Int64 HInterID, int Type, string HMaker)
+ {
+ try
+ {
+ //鍒ゆ柇鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log(ModRightNameClose, 3, false, HMaker))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡鍏抽棴/鍙嶅叧闂姛鑳芥潈闄�,璇蜂笌绠$悊鍛樿仈绯伙紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ //鍒ゆ柇瀛樺湪鎬�
+ if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo))
+ {
+ //Type 1 鍏抽棴 2 鍙嶅叧闂�
+ if (Type == 1)
+ {
+ if (oBill.omodel.HCloseMan.Trim() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸插叧闂紝涓嶈兘鍐嶆鍏抽棴锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //鍏抽棴鍗曟嵁
+ if (!oBill.CloseBill(HInterID, oBill.omodel.HBillNo, HMaker, ref ClsPub.sExeReturnInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍏抽棴澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍗曟嵁鍙凤細" + oBill.omodel.HBillNo + " 鍏抽棴鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult; ;
+ }
+ }
+ else
+ {
+ if (oBill.omodel.HCloseMan.Trim() == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鏈叧闂紝涓嶉渶瑕佸弽鍏抽棴锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //鍙嶅叧闂崟鎹�
+ if (!oBill.CancelClose(HInterID, oBill.omodel.HBillNo, HMaker, ref ClsPub.sExeReturnInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍙嶅叧闂け璐�!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍗曟嵁鍙凤細" + oBill.omodel.HBillNo + " 鍙嶅叧闂垚鍔燂紒";
+ objJsonResult.data = null;
+ return objJsonResult; ;
+ }
+ }
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏈煡璇㈠埌璇ュ櫒鍏峰嚭搴撶敵璇峰崟锛岃鍒锋柊鏁版嵁鍚庨噸鏂伴�夋嫨锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍏抽棴鎴栧弽鍏抽棴鍣ㄥ叿鍑哄簱鐢宠鍗曞け璐ワ紒" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 鍣ㄥ叿鍑哄簱鐢宠鍗� 浣滃簾/鍙嶄綔搴�
+ /// <summary>
+ /// 浣滃簾/鍙嶄綔搴� 鍣ㄥ叿鍑哄簱鐢宠鍗�
+ /// </summary>
+ /// <param name="HInterID">鍗曟嵁ID</param>
+ /// <param name="Type">浣滃簾(1),鍙嶄綔搴�(2)</param>
+ /// <param name="HMaker">浣滃簾浜�</param>
+ /// <returns></returns>
+ [Route("Sc_MouldOutRequestBillController/GetSc_MouldOutRequestBill_Cancelltion_Json")]
+ [HttpGet]
+ public object GetSc_MouldOutRequestBill_Cancelltion_Json(Int64 HInterID, int Type, string HMaker)
+ {
+ try
+ {
+ //鍒ゆ柇鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log(ModRightNameDelete, 3, false, HMaker))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡浣滃簾/鍙嶄綔搴熷姛鑳芥潈闄�,璇蜂笌绠$悊鍛樿仈绯伙紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ //鍒ゆ柇瀛樺湪鎬�
+ if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo))
+ {
+ //Type 1 浣滃簾 2 鍙嶄綔搴�
+ if (Type == 1)
+ {
+ if (oBill.omodel.HDeleteMan.Trim() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸蹭綔搴燂紝涓嶈兘鍐嶆浣滃簾锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //浣滃簾鍗曟嵁
+ if (!oBill.Cancelltion(HInterID, oBill.omodel.HBillNo, HMaker, ref ClsPub.sExeReturnInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "浣滃簾澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍗曟嵁鍙凤細" + oBill.omodel.HBillNo + " 浣滃簾鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult; ;
+ }
+ }
+ else
+ {
+ if (oBill.omodel.HDeleteMan.Trim() == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鏈綔搴燂紝涓嶉渶瑕佸弽浣滃簾锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //鍙嶄綔搴熷崟鎹�
+ if (!oBill.AbandonCancelltion(HInterID, oBill.omodel.HBillNo, HMaker, ref ClsPub.sExeReturnInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍙嶄綔搴熷け璐�!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍗曟嵁鍙凤細" + oBill.omodel.HBillNo + " 鍙嶄綔搴熸垚鍔燂紒";
+ objJsonResult.data = null;
+ return objJsonResult; ;
+ }
+ }
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏈煡璇㈠埌璇ュ櫒鍏峰嚭搴撶敵璇峰崟锛岃鍒锋柊鏁版嵁鍚庨噸鏂伴�夋嫨锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "浣滃簾鎴栧弽浣滃簾鍣ㄥ叿鍑哄簱鐢宠鍗曞け璐ワ紒" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 鍣ㄥ叿鍑哄簱鐢宠鍗曟ā鍧� 浠庡垪琛ㄩ�変腑鎵撳紑鍗曟嵁锛岃繑鍥炲崟鎹俊鎭椂璋冪敤
+ /// <summary>
+ /// 鍣ㄥ叿鍑哄簱鐢宠鍗曠紪杈戞椂锛屾牴鎹崟鎹甀D鑾峰彇鍗曟嵁淇℃伅
+ /// </summary>
+ /// <returns></returns>
+ [Route("Sc_MouldOutRequestBillController/GetSc_MouldOutRequestBill_Json")]
+ [HttpGet]
+ public object GetSc_MouldOutRequestBill_Json(Int64 HInterID, string HMaker)
+ {
+ try
+ {
+ //鍒ゆ柇鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log(ModRightNameEdit, 3, false, HMaker))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡缂栬緫鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ //杩斿洖鍒楄〃淇℃伅
+ ds = oCn.RunProcReturn("exec h_p_Sc_MouldOutRequestBill_EditInit " + HInterID, "h_p_Sc_MouldOutRequestBill_EditInit");
+ if (ds == null || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏈煡璇㈠埌璇ュ櫒鍏峰嚭搴撶敵璇峰崟锛岃鍒锋柊鏁版嵁鍚庨噸鏂伴�夋嫨锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鎴愬姛锛�";
+ objJsonResult.data = ds.Tables[0];
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "杩斿洖鍣ㄥ叿鍑哄簱鐢宠鍗曚俊鎭け璐ワ紒" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 鍣ㄥ叿鍑哄簱鐢宠鍗� 淇濆瓨
+ /// <summary>
+ /// 鍣ㄥ叿鍑哄簱鐢宠鍗曚繚瀛�
+ /// </summary>
+ [Route("Sc_MouldOutRequestBillController/GetSc_MouldOutRequestBill_Save_Json")]
+ [HttpPost]
+ public object GetSc_MouldOutRequestBill_Save_Json([FromBody] JObject sMainSub)
+ {
+ var _value = sMainSub["sMainSub"].ToString();
+ string msg1 = _value.ToString();
+ string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+ string sMainStr = sArray[0].ToString(); //涓昏〃鏁版嵁
+ string sSubStr = sArray[1].ToString(); //瀛愯〃鏁版嵁
+ string OperationType = sArray[2].ToString(); //鎿嶄綔绫诲瀷锛�1鏂板銆�2缂栬緫锛�
+ string HMaker = sArray[3].ToString(); //鍒跺崟浜�
+ try
+ {
+ //鍒ゆ柇鏉冮檺
+ if (OperationType == "1")
+ {
+ BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew;
+ //鍒ゆ柇鏂板鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log(ModRightName, 1, false, HMaker))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡鏂板鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ else
+ {
+ BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_Modify;
+ //鍒ゆ柇缂栬緫鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log(ModRightNameEdit, 1, false, HMaker))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡缂栬緫鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ //琛ㄥご璧嬪��
+ sMainStr = sMainStr.Replace("\\", "");
+ sMainStr = sMainStr.Replace("\n", "");
+ sMainStr = "[" + sMainStr.ToString() + "]";
+ List<Model.ClsSc_MouldOutRequestBillMain> lsmain = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldOutRequestBillMain>>(sMainStr);
+ foreach (Model.ClsSc_MouldOutRequestBillMain oItem in lsmain)
+ {
+ //鍗曟嵁鍙锋槸鍚﹂噸澶�
+ if (oBill.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, oItem.HInterID))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鍙烽噸澶嶏紒涓嶅厑璁镐繚瀛橈紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //鍒ゆ柇浼氳鏈熸槸鍚﹀悎鐞�
+ string s = "";
+ int sYear = 0;
+ int sPeriod = 0;
+ if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(oItem.HDate, ref sYear, ref sPeriod, ref s) == false)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = s;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ oItem.HYear = sYear;
+ oItem.HPeriod = sPeriod;
+ DBUtility.ClsPub.CurUserName = oItem.HMaker;
+ oBill.omodel = oItem;
+ }
+ //琛ㄤ綋璧嬪��
+ //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆�
+ sSubStr = sSubStr.Substring(1, sSubStr.Length - 2);
+ sSubStr = sSubStr.Replace("\\", "");
+ sSubStr = sSubStr.Replace("\n", "");
+ sSubStr = "[" + sSubStr.ToString() + "]";
+ List<Model.ClsSc_MouldOutRequestBillSub> ls = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldOutRequestBillSub>>(sSubStr);
+ int i = 0;
+ foreach (Model.ClsSc_MouldOutRequestBillSub oItemSub in ls)
+ {
+ i++;
+ oItemSub.HEntryID = i;
+ oBill.DetailColl.Add(oItemSub);
+ }
+
+ //淇濆瓨
+ bool bResult;
+ if (OperationType == "1") //鏂板淇濆瓨
+ {
+ bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+ }
+ else //缂栬緫淇濆瓨
+ {
+ bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+ }
+
+ if (bResult)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; //鎴愬姛锛�
+ objJsonResult.data = null;
+ objJsonResult.HInterID = oBill.omodel.HInterID.ToString(); //杩斿洖涓籌D
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.Message;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ #endregion
+
+
+
+
+ }
+}
\ No newline at end of file
diff --git a/WebAPI/Controllers/MJGL/Sc_MouldProdOutBillController.cs b/WebAPI/Controllers/MJGL/Sc_MouldProdOutBillController.cs
new file mode 100644
index 0000000..bbe2115
--- /dev/null
+++ b/WebAPI/Controllers/MJGL/Sc_MouldProdOutBillController.cs
@@ -0,0 +1,855 @@
+锘縰sing Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using Pub_Class;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Web.Http;
+using WebAPI.Models;
+using System.Windows.Forms;
+using SyntacticSugar.constant;
+namespace WebAPI.Controllers
+{
+
+ public class Sc_MouldProdOutBillController : ApiController
+ {
+ public DBUtility.ClsPub.Enum_BillStatus BillStatus;
+ public const string ModName = "3802"; //鍗曟嵁绫诲瀷
+ public const string ModCaption = "鍣ㄥ叿棰嗙敤鍑哄簱鍗�"; //鍗曟嵁鍚嶇О
+ public const string ModRightName = "Sc_MouldProdOutBill";
+ public const string ModRightNameList = ModRightName + "List"; //鍒楄〃
+ public const string ModRightNameEdit = ModRightName + "_Edit"; //缂栬緫
+ public const string ModRightNameCheck = ModRightName + "_Check"; //瀹℃牳
+ public const string ModRightNameClose = ModRightName + "_Close"; //鍏抽棴
+ public const string ModRightNameDelete = ModRightName + "_Delete"; //浣滃簾
+ public const string ModRightNameDrop = ModRightName + "_Drop"; //鍒犻櫎
+ public DataSet ds = new DataSet();
+ private json objJsonResult = new json();
+ SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+ public DAL.ClsSc_MouldProdOutBill oBill = new DAL.ClsSc_MouldProdOutBill();
+
+
+ #region 鍣ㄥ叿棰嗙敤鍑哄簱鍗曞垎椤靛垪琛�
+ [Route("Sc_MouldProdOutBillController/page")]
+ [HttpGet]
+ public json Sc_MouldProdOutBillPage(string sWhere, string user, int page, int size, string Type)
+ {
+ try
+ {
+ List<object> columnNameList = new List<object>();
+ //鍒楄〃杩涘叆鏃跺垽鏂潈闄愶紝閫夋簮鍗曡繘鍏ヤ笉鍒ゆ柇鏉冮檺
+ if (Type == ModName)
+ {
+ if (!DBUtility.ClsPub.Security_Log(ModRightNameList, 3, false, user))
+ {
+ objJsonResult.code = CodeConstant.FAIL;
+ objJsonResult.count = CountConstant.FAIL;
+ objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ sWhere = sWhere.Replace("'", "''");
+ if (sWhere == null || sWhere.Equals(""))
+ {
+ ds = oCn.RunProcReturn("exec h_p_Sc_MouldProdOutBillList " + page + "," + size + ",'','" + Type + "'", "h_p_Sc_MouldProdOutBillList");
+ }
+ else
+ {
+ ds = oCn.RunProcReturn("exec h_p_Sc_MouldProdOutBillList " + page + "," + size + ",'" + sWhere + "','" + Type + "'", "h_p_Sc_MouldProdOutBillList");
+ }
+
+ //娣诲姞鍒楀悕
+ foreach (DataColumn col in ds.Tables[0].Columns)
+ {
+ Type dataType = col.DataType;
+ string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+ columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+ }
+
+ objJsonResult.code = CodeConstant.SUCCEED;
+ objJsonResult.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
+ objJsonResult.Message = "鎴愬姛锛�";
+ objJsonResult.list = columnNameList;
+ objJsonResult.data = ds.Tables[0];
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = CodeConstant.FAIL;
+ objJsonResult.count = CountConstant.FAIL;
+ objJsonResult.Message = "鏌ヨ鍒楄〃淇℃伅澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 鍣ㄥ叿棰嗙敤鍑哄簱鍗� 鍒犻櫎
+ /// <summary>
+ /// 鍒犻櫎鍣ㄥ叿棰嗙敤鍑哄簱鍗�
+ /// </summary>
+ /// <returns></returns>
+ [Route("Sc_MouldProdOutBillController/GetSc_MouldProdOutBill_Delete_Json")]
+ [HttpGet]
+ public object GetSc_MouldProdOutBill_Delete_Json(Int64 HInterID, string HMaker)
+ {
+ try
+ {
+ //鍒ゆ柇鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log(ModRightNameDrop, 3, false, HMaker))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡鍒犻櫎鍔熻兘鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ //鍒ゆ柇瀛樺湪鎬�
+ if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo))
+ {
+ //鍒犻櫎鍓嶆帶鍒�
+ DataSet BeforeDs = oCn.RunProcReturn("Exec h_p_Sc_MouldProdOutBill_BeforeDelCtrl " + HInterID.ToString() + ",'" + oBill.omodel.HBillNo + "','" + HMaker + "'", "h_p_Sc_MouldProdOutBill_BeforeDelCtrl");
+ 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;
+ }
+ }
+ //鍒犻櫎鍗曟嵁锛堝寘鍚垹闄ゅ悗鎺у埗銆佸啓鍏ユ棩蹇楋級
+ if (!oBill.DeleteBill(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Sc_MouldProdOutBill_AfterDelCtrl", HMaker, ref ClsPub.sExeReturnInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍒犻櫎鍣ㄥ叿棰嗙敤鍑哄簱鍗曟垚鍔燂紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏈煡璇㈠埌璇ュ櫒鍏烽鐢ㄥ嚭搴撳崟锛岃鍒锋柊鏁版嵁鍚庨噸鏂伴�夋嫨锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎鍣ㄥ叿棰嗙敤鍑哄簱鍗曞け璐ワ紒" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 鍣ㄥ叿棰嗙敤鍑哄簱鍗� 瀹℃牳/鍙嶅鏍�
+ /// <summary>
+ /// 瀹℃牳/鍙嶅鏍稿櫒鍏烽鐢ㄥ嚭搴撳崟
+ /// </summary>
+ /// <param name="HInterID">鍗曟嵁ID</param>
+ /// <param name="Type">瀹℃牳(1),鍙嶅鏍�(2)</param>
+ /// <param name="HMaker">瀹℃牳浜�</param>
+ /// <returns></returns>
+ [Route("Sc_MouldProdOutBillController/GetSc_MouldProdOutBill_Check_Json")]
+ [HttpGet]
+ public object GetSc_MouldProdOutBill_Check_Json(Int64 HInterID, int Type, string HMaker)
+ {
+ try
+ {
+ //鍒ゆ柇鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 3, false, HMaker))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡瀹℃牳/鍙嶅鏍稿姛鑳芥潈闄�,璇蜂笌绠$悊鍛樿仈绯伙紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ //鍒ゆ柇瀛樺湪鎬�
+ if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo))
+ {
+ //Type 1 瀹℃牳 2 鍙嶅鏍�
+ if (Type == 1)
+ {
+ if (oBill.omodel.HChecker.Trim() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸插鏍革紝涓嶈兘鍐嶆瀹℃牳锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (oBill.omodel.HCloseMan.Trim() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸插叧闂紝涓嶈兘鍐嶆瀹℃牳锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (oBill.omodel.HDeleteMan.Trim() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸蹭綔搴燂紝涓嶈兘鍐嶆瀹℃牳锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //瀹℃牳鍓嶆帶鍒�
+ DataSet BeforeDs = oCn.RunProcReturn("Exec h_p_Sc_MouldProdOutBill_BeforeCheckCtrl " + HInterID.ToString() + ",'" + oBill.omodel.HBillNo + "','" + HMaker + "'", "h_p_Sc_MouldProdOutBill_BeforeCheckCtrl");
+ 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;
+ }
+ }
+ //瀹℃牳鍗曟嵁
+ if (!oBill.CheckBill(HInterID, oBill.omodel.HBillNo, "h_p_Sc_MouldProdOutBill_AfterCheckCtrl", HMaker, ref ClsPub.sExeReturnInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍗曟嵁鍙凤細" + oBill.omodel.HBillNo + " 瀹℃牳鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult; ;
+ }
+ }
+ else
+ {
+ if (oBill.omodel.HChecker.Trim() == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鏈鏍革紝涓嶉渶瑕佸弽瀹℃牳锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //鍙嶅鏍稿墠鎺у埗
+ DataSet BeforeDs = oCn.RunProcReturn("Exec h_p_Sc_MouldProdOutBill_BeforeUnCheckCtrl " + HInterID.ToString() + ",'" + oBill.omodel.HBillNo + "','" + HMaker + "'", "h_p_Sc_MouldProdOutBill_BeforeUnCheckCtrl");
+ 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;
+ }
+ }
+
+ //鍙嶅鏍稿崟鎹�
+ if (!oBill.AbandonCheck(HInterID, oBill.omodel.HBillNo, "h_p_Sc_MouldProdOutBill_AfterUnCheckCtrl", HMaker, ref ClsPub.sExeReturnInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍗曟嵁鍙凤細" + oBill.omodel.HBillNo + " 鍙嶅鏍告垚鍔燂紒";
+ objJsonResult.data = null;
+ return objJsonResult; ;
+ }
+ }
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏈煡璇㈠埌璇ュ櫒鍏烽鐢ㄥ嚭搴撳崟锛岃鍒锋柊鏁版嵁鍚庨噸鏂伴�夋嫨锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳鎴栧弽瀹℃牳鍣ㄥ叿棰嗙敤鍑哄簱鍗曞け璐ワ紒" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 鍣ㄥ叿棰嗙敤鍑哄簱鍗� 鎵归噺瀹℃牳
+ /// <summary>
+ /// 鎵归噺瀹℃牳/鍙嶅鏍稿櫒鍏烽鐢ㄥ嚭搴撳崟
+ /// </summary>
+ /// <param name="HInterID">鍗曟嵁ID</param>
+ /// <param name="Type">瀹℃牳(1),鍙嶅鏍�(2)</param>
+ /// <param name="HMaker">瀹℃牳浜�</param>
+ /// <returns></returns>
+ [Route("Sc_MouldProdOutBillController/CheckAll")]
+ [HttpGet]
+ public object CheckAll(string ids, int Type, string HMaker)
+ {
+ try
+ {
+ //澶勭悊瀛楃涓�
+ if (!string.IsNullOrEmpty(ids))
+ {
+ long[] idArray = Array.ConvertAll(ids.Split(','), long.Parse);
+ // 澶勭悊idArray...
+ oCn.BeginTran();
+ for (int i = 0; i < idArray.Length; i++)
+ {
+ objJsonResult = (json)GetSc_MouldProdOutBill_Check_Json(idArray[i], Type, HMaker);//瀹℃牳鎵ц
+ if (objJsonResult.count == 0)
+ {
+ oCn.RollBack();
+ objJsonResult.Message += "绗�" + (i + 1) + "琛屽嚭鐜伴棶棰樻棤娉曠户缁畬鎴�";
+ return objJsonResult;
+ }
+ }
+ oCn.Commit();
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "璇烽�夋嫨姝g‘琛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ objJsonResult.code = CodeConstant.SUCCEED;
+ objJsonResult.count = CountConstant.SUCCEED;
+ objJsonResult.Message = "鎵ц鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ oCn.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳鎴栧弽瀹℃牳鍣ㄥ叿棰嗙敤鍑哄簱鍗曞け璐ワ紒" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 鍣ㄥ叿棰嗙敤鍑哄簱鍗� 鍏抽棴/鍙嶅叧闂�
+ /// <summary>
+ /// 鍏抽棴/鍙嶅叧闂櫒鍏烽鐢ㄥ嚭搴撳崟
+ /// </summary>
+ /// <param name="HInterID">鍗曟嵁ID</param>
+ /// <param name="Type">鍏抽棴(1),鍙嶅叧闂�(2)</param>
+ /// <param name="HMaker">鍏抽棴浜�</param>
+ /// <returns></returns>
+ [Route("Sc_MouldProdOutBillController/GetSc_MouldProdOutBill_Close_Json")]
+ [HttpGet]
+ public object GetSc_MouldProdOutBill_Close_Json(Int64 HInterID, int Type, string HMaker)
+ {
+ try
+ {
+ //鍒ゆ柇鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log(ModRightNameClose, 3, false, HMaker))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡鍏抽棴/鍙嶅叧闂姛鑳芥潈闄�,璇蜂笌绠$悊鍛樿仈绯伙紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ //鍒ゆ柇瀛樺湪鎬�
+ if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo))
+ {
+ //Type 1 鍏抽棴 2 鍙嶅叧闂�
+ if (Type == 1)
+ {
+ if (oBill.omodel.HCloseMan.Trim() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸插叧闂紝涓嶈兘鍐嶆鍏抽棴锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //鍏抽棴鍗曟嵁
+ if (!oBill.CloseBill(HInterID, oBill.omodel.HBillNo, HMaker, ref ClsPub.sExeReturnInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍏抽棴澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍗曟嵁鍙凤細" + oBill.omodel.HBillNo + " 鍏抽棴鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult; ;
+ }
+ }
+ else
+ {
+ if (oBill.omodel.HCloseMan.Trim() == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鏈叧闂紝涓嶉渶瑕佸弽鍏抽棴锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //鍙嶅叧闂崟鎹�
+ if (!oBill.CancelClose(HInterID, oBill.omodel.HBillNo, HMaker, ref ClsPub.sExeReturnInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍙嶅叧闂け璐�!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍗曟嵁鍙凤細" + oBill.omodel.HBillNo + " 鍙嶅叧闂垚鍔燂紒";
+ objJsonResult.data = null;
+ return objJsonResult; ;
+ }
+ }
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏈煡璇㈠埌璇ュ櫒鍏烽鐢ㄥ嚭搴撳崟锛岃鍒锋柊鏁版嵁鍚庨噸鏂伴�夋嫨锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍏抽棴鎴栧弽鍏抽棴鍣ㄥ叿棰嗙敤鍑哄簱鍗曞け璐ワ紒" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 鍣ㄥ叿棰嗙敤鍑哄簱鍗� 浣滃簾/鍙嶄綔搴�
+ /// <summary>
+ /// 浣滃簾/鍙嶄綔搴� 鍣ㄥ叿棰嗙敤鍑哄簱鍗�
+ /// </summary>
+ /// <param name="HInterID">鍗曟嵁ID</param>
+ /// <param name="Type">浣滃簾(1),鍙嶄綔搴�(2)</param>
+ /// <param name="HMaker">浣滃簾浜�</param>
+ /// <returns></returns>
+ [Route("Sc_MouldProdOutBillController/GetSc_MouldProdOutBill_Cancelltion_Json")]
+ [HttpGet]
+ public object GetSc_MouldProdOutBill_Cancelltion_Json(Int64 HInterID, int Type, string HMaker)
+ {
+ try
+ {
+ //鍒ゆ柇鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log(ModRightNameDelete, 3, false, HMaker))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡浣滃簾/鍙嶄綔搴熷姛鑳芥潈闄�,璇蜂笌绠$悊鍛樿仈绯伙紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ //鍒ゆ柇瀛樺湪鎬�
+ if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo))
+ {
+ //Type 1 浣滃簾 2 鍙嶄綔搴�
+ if (Type == 1)
+ {
+ if (oBill.omodel.HDeleteMan.Trim() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸蹭綔搴燂紝涓嶈兘鍐嶆浣滃簾锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //浣滃簾鍗曟嵁
+ if (!oBill.Cancelltion(HInterID, oBill.omodel.HBillNo, HMaker, ref ClsPub.sExeReturnInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "浣滃簾澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍗曟嵁鍙凤細" + oBill.omodel.HBillNo + " 浣滃簾鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult; ;
+ }
+ }
+ else
+ {
+ if (oBill.omodel.HDeleteMan.Trim() == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鏈綔搴燂紝涓嶉渶瑕佸弽浣滃簾锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //鍙嶄綔搴熷崟鎹�
+ if (!oBill.AbandonCancelltion(HInterID, oBill.omodel.HBillNo, HMaker, ref ClsPub.sExeReturnInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍙嶄綔搴熷け璐�!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍗曟嵁鍙凤細" + oBill.omodel.HBillNo + " 鍙嶄綔搴熸垚鍔燂紒";
+ objJsonResult.data = null;
+ return objJsonResult; ;
+ }
+ }
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏈煡璇㈠埌璇ュ櫒鍏烽鐢ㄥ嚭搴撳崟锛岃鍒锋柊鏁版嵁鍚庨噸鏂伴�夋嫨锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "浣滃簾鎴栧弽浣滃簾鍣ㄥ叿棰嗙敤鍑哄簱鍗曞け璐ワ紒" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 鍣ㄥ叿棰嗙敤鍑哄簱鍗曟ā鍧� 浠庡垪琛ㄩ�変腑鎵撳紑鍗曟嵁锛岃繑鍥炲崟鎹俊鎭椂璋冪敤
+ /// <summary>
+ /// 鍣ㄥ叿棰嗙敤鍑哄簱鍗曠紪杈戞椂锛屾牴鎹崟鎹甀D鑾峰彇鍗曟嵁淇℃伅
+ /// </summary>
+ /// <returns></returns>
+ [Route("Sc_MouldProdOutBillController/GetSc_MouldProdOutBill_Json")]
+ [HttpGet]
+ public object GetSc_MouldProdOutBill_Json(Int64 HInterID, string HMaker)
+ {
+ List<object> list = new List<object>();
+ try
+ {
+ //鍒ゆ柇鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log(ModRightNameEdit, 3, false, HMaker))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡缂栬緫鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ //杩斿洖鍒楄〃淇℃伅
+ ds = oCn.RunProcReturn("exec h_p_Sc_MouldStockBill_EditInit " + HInterID, "h_p_Sc_MouldStockBill_EditInit");
+ if (ds == null || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏈煡璇㈠埌璇ュ櫒鍏烽鐢ㄥ嚭搴撳崟锛岃鍒锋柊鏁版嵁鍚庨噸鏂伴�夋嫨锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ list.Add(ds.Tables[0]);
+ list.Add(ds.Tables[1]);
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鎴愬姛锛�";
+ objJsonResult.data = list;
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "杩斿洖鍣ㄥ叿棰嗙敤鍑哄簱鍗曚俊鎭け璐ワ紒" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 鍣ㄥ叿棰嗙敤鍑哄簱鍗� 淇濆瓨
+ /// <summary>
+ /// 鍣ㄥ叿棰嗙敤鍑哄簱鍗曚繚瀛�
+ /// </summary>
+ [Route("Sc_MouldProdOutBillController/GetSc_MouldProdOutBill_Save_Json")]
+ [HttpPost]
+ public object GetSc_MouldProdOutBill_Save_Json([FromBody] JObject sMainSub)
+ {
+ var _value = sMainSub["sMainSub"].ToString();
+ string msg1 = _value.ToString();
+ string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+ string sMainStr = sArray[0].ToString(); //涓昏〃鏁版嵁
+ string sSubStr = sArray[1].ToString(); //瀛愯〃鏁版嵁
+ string OperationType = sArray[2].ToString(); //鎿嶄綔绫诲瀷锛�1鏂板銆�2缂栬緫锛�
+ string HMaker = sArray[3].ToString(); //鍒跺崟浜�
+ try
+ {
+ //鍒ゆ柇鏉冮檺
+ if (OperationType == "1")
+ {
+ BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew;
+ //鍒ゆ柇鏂板鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log(ModRightName, 1, false, HMaker))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡鏂板鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ else
+ {
+ BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_Modify;
+ //鍒ゆ柇缂栬緫鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log(ModRightNameEdit, 1, false, HMaker))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡缂栬緫鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ //琛ㄥご璧嬪��
+ sMainStr = sMainStr.Replace("\\", "");
+ sMainStr = sMainStr.Replace("\n", "");
+ sMainStr = "[" + sMainStr.ToString() + "]";
+ List<Model.ClsSc_MouldProdOutBillMain> lsmain = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldProdOutBillMain>>(sMainStr);
+ foreach (Model.ClsSc_MouldProdOutBillMain oItem in lsmain)
+ {
+ //鍗曟嵁鍙锋槸鍚﹂噸澶�
+ if (oBill.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, oItem.HInterID))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鍙烽噸澶嶏紒涓嶅厑璁镐繚瀛橈紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //鍒ゆ柇浼氳鏈熸槸鍚﹀悎鐞�
+ string s = "";
+ int sYear = 0;
+ int sPeriod = 0;
+ if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(oItem.HDate, ref sYear, ref sPeriod, ref s) == false)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = s;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ oItem.HYear = sYear;
+ oItem.HPeriod = sPeriod;
+ DBUtility.ClsPub.CurUserName = oItem.HMaker;
+ oBill.omodel = oItem;
+ }
+ //琛ㄤ綋璧嬪��
+ //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆�
+ sSubStr = sSubStr.Substring(1, sSubStr.Length - 2);
+ sSubStr = sSubStr.Replace("\\", "");
+ sSubStr = sSubStr.Replace("\n", "");
+ sSubStr = "[" + sSubStr.ToString() + "]";
+ List<Model.ClsSc_MouldProdOutBillSub> ls = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldProdOutBillSub>>(sSubStr);
+ int i = 0;
+ foreach (Model.ClsSc_MouldProdOutBillSub oItemSub in ls)
+ {
+ i++;
+ oItemSub.HEntryID = i;
+ oBill.DetailColl.Add(oItemSub);
+ }
+
+ //淇濆瓨
+ bool bResult;
+ if (OperationType == "1") //鏂板淇濆瓨
+ {
+ bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+ }
+ else //缂栬緫淇濆瓨
+ {
+ bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+ }
+
+ if (bResult)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; //鎴愬姛锛�
+ objJsonResult.data = null;
+ objJsonResult.HInterID = oBill.omodel.HInterID.ToString(); //杩斿洖涓籌D
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.Message;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ #endregion
+
+ #region 鍣ㄥ叿棰嗙敤鍑哄簱鍗� 杩斿洖婧愬崟鏁版嵁
+ /// <summary>
+ /// 杩斿洖婧愬崟鏁版嵁
+ /// </summary>
+ /// <returns></returns>
+ [Route("Sc_MouldProdOutBillController/GetSourceBill_MouldProdOut_Json")]
+ [HttpGet]
+ public object GetSourceBill_MouldProdOut_Json(Int64 HInterID, Int64 HEntryID, string HBillType)
+ {
+ try
+ {
+ string sViewName = "";
+ //鍣ㄥ叿棰嗙敤鐢宠鍗�
+ if (HBillType== "3849")
+ {
+ sViewName = "h_p_Sc_MouldOutRequestBill_Source_MouldProdOut";
+ }
+
+ if (sViewName == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "涓嶆敮鎸佽婧愬崟绫诲瀷锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ ds = oCn.RunProcReturn("exec " + sViewName + " " + HInterID.ToString() + "," + HEntryID.ToString(), sViewName);
+ if (ds == null || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏈煡璇㈠埌婧愬崟淇℃伅锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鎴愬姛锛�";
+ objJsonResult.data = ds.Tables[0];
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鑾峰彇婧愬崟淇℃伅澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+
+
+
+ }
+}
\ No newline at end of file
diff --git a/WebAPI/Controllers/Sc_MouldController.cs b/WebAPI/Controllers/Sc_MouldController.cs
index 4f9248d..f367f72 100644
--- a/WebAPI/Controllers/Sc_MouldController.cs
+++ b/WebAPI/Controllers/Sc_MouldController.cs
@@ -829,8 +829,8 @@
BillNew.omodel.HExplanation = mainList[0].HExplanation;
BillNew.omodel.HInnerBillNo = mainList[0].HInnerBillNo;
BillNew.omodel.HRedBlueFlag = mainList[0].HRedBlueFlag;
- BillNew.DetailColl = new List<Model.ClsSc_MouldStockBillSub>();
- Model.ClsSc_MouldStockBillSub oSub = new Model.ClsSc_MouldStockBillSub();
+ BillNew.DetailColl = new List<Model.ClsSc_MouldProdOutBillSub>();
+ Model.ClsSc_MouldProdOutBillSub oSub = new Model.ClsSc_MouldProdOutBillSub();
oSub.HInterID = mainList[0].HInterID;
oSub.HEntryID = 1;
diff --git a/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs b/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
index 6078231..16a5dc1 100644
--- a/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
+++ b/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
@@ -12652,9 +12652,9 @@
sSubStr = sSubStr.Replace("\\", "");
sSubStr = sSubStr.Replace("\n", "");
sSubStr = "[" + sSubStr.ToString() + "]";
- List<Model.ClsSc_MouldStockBillSub> ls = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldStockBillSub>>(sSubStr);
+ List<Model.ClsSc_MouldProdOutBillSub> ls = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldProdOutBillSub>>(sSubStr);
int i = 0;
- foreach (Model.ClsSc_MouldStockBillSub oItemSub in ls)
+ foreach (Model.ClsSc_MouldProdOutBillSub oItemSub in ls)
{
i++;
oItemSub.HEntryID = i;
diff --git "a/WebAPI/Controllers/\346\235\241\347\240\201\347\256\241\347\220\206/MouldController.cs" "b/WebAPI/Controllers/\346\235\241\347\240\201\347\256\241\347\220\206/MouldController.cs"
index 366aa5c..8aa23fb 100644
--- "a/WebAPI/Controllers/\346\235\241\347\240\201\347\256\241\347\220\206/MouldController.cs"
+++ "b/WebAPI/Controllers/\346\235\241\347\240\201\347\256\241\347\220\206/MouldController.cs"
@@ -633,7 +633,7 @@
{
for (int i = 0; i <= ds.Tables[0].Rows.Count - 1; i++)
{
- Model.ClsSc_MouldStockBillSub oSub = new Model.ClsSc_MouldStockBillSub();
+ Model.ClsSc_MouldProdOutBillSub oSub = new Model.ClsSc_MouldProdOutBillSub();
//鍥哄畾璧嬪��========================================
oSub.HEntryID = i + 1;
oSub.HRemark = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[i]["HRemark"]);
diff --git a/WebAPI/WebAPI.csproj b/WebAPI/WebAPI.csproj
index dfd7c42..827dd62 100644
--- a/WebAPI/WebAPI.csproj
+++ b/WebAPI/WebAPI.csproj
@@ -449,6 +449,9 @@
<Compile Include="Controllers\CJGL\Sc_OEEReportController.cs" />
<Compile Include="Controllers\CKGL\TMZD\Gy_BarCodeBillListController.cs" />
<Compile Include="Controllers\JHGL\Gy_SourceMouldBillController.cs" />
+ <Compile Include="Controllers\MJGL\Sc_MouldProdOutBillController.cs" />
+ <Compile Include="Controllers\MJGL\Sc_MouldOutRequestBillController.cs" />
+ <Compile Include="Controllers\MJGL\Sc_MouldInRequestBillController.cs" />
<Compile Include="Controllers\MJGL\Sc_MouldMoveStockRequestBillController.cs" />
<Compile Include="Controllers\SBGL\Sb_EquipPatrolCheckRuleBillController.cs" />
<Compile Include="Controllers\SBGL\Sb_EquipPatrolCheckPlanBillController.cs" />
--
Gitblit v1.9.1