From 25212e2bb6447e8128b92c69c62b6a91ce8a576c Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期五, 24 五月 2024 13:33:51 +0800
Subject: [PATCH] 1
---
DAL/生产管理/模具管理/ClsSc_MouldProdInBill.cs | 224 +++++++++++++++++++++++++++++++++++++------------------
1 files changed, 151 insertions(+), 73 deletions(-)
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_MouldProdInBill.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_MouldProdInBill.cs"
index 17f750a..16ec0f0 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_MouldProdInBill.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_MouldProdInBill.cs"
@@ -17,9 +17,9 @@
base.MvarItemKeySub3 = "";
base.MvarItemKeySub4 = "";
base.MvarItemKey="Sc_MouldStockBillMain";
- base.MvarReportTitle = "妯″叿鍏ュ簱鍗�";
- base.BillType="3795";
- base.HBillSubType = "3795";
+ base.MvarReportTitle = "妯″叿閲囪喘鍏ュ簱鍗�";
+ base.BillType="3801";
+ base.HBillSubType = "3801";
}
@@ -29,8 +29,63 @@
{
DetailColl = null;
}
-
+
#endregion 鑷畾涔夋柟娉�
+
+ //淇濆瓨鍓嶆帶鍒�
+ public bool BeforeSave(Int64 HInterID, string HBillNo, Int64 HSecManagerID, Int64 HKeeperID, Int64 HSupID, Int64 OperationType, ref string sReturn)
+ {
+ try
+ {
+ DataSet Ds = oCn.RunProcReturn("Exec h_p_Sc_MouldProdInBill_BeforeSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + HSecManagerID.ToString() + "," + HKeeperID.ToString() + "," + HSupID.ToString() + "," + OperationType.ToString(), "h_p_Sc_MouldProdInBill_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_MouldProdInBill_AfterSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Sc_MouldProdInBill_AfterSaveCtrl");
+ if (Ds == null || Ds.Tables[0].Rows.Count == 0)
+ {
+ sReturn = "淇濆瓨鍚庡垽鏂け璐ワ紒";
+ return false;
+ }
+ else
+ {
+ if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HBack"]) == 1)
+ {
+ sReturn = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]);
+ return false;
+ }
+ }
+ return true;
+ }
+ catch (Exception e)
+ {
+ throw (e);
+ }
+ }
+
//淇敼鍗曟嵁
public override bool ModifyBill(Int64 lngBillKey, ref string sReturn)
{
@@ -38,6 +93,12 @@
{
//
oCn.BeginTran();
+ //淇濆瓨鍓嶆帶鍒�
+ if (!BeforeSave(lngBillKey, omodel.HBillNo, omodel.HSecManagerID, omodel.HKeeperID, omodel.HSupID, 2, ref sReturn))
+ {
+ oCn.RollBack();
+ return false;
+ }
//鏇存柊涓昏〃
oCn.RunProc("UpDate Sc_MouldStockBillMain set " +
" HBillNo='" + omodel.HBillNo + "'" + //鍥哄畾璧嬪��===============
@@ -49,16 +110,17 @@
",HUpDateDate=getdate()" +
//========================================
",HSupID=" + omodel.HSupID.ToString() +
- ",HWHID=" + omodel.HWHID.ToString() +
- ",HSCWHID=" + omodel.HSCWHID.ToString() +
",HEmpID=" + omodel.HEmpID.ToString() +
",HManagerID=" + omodel.HManagerID.ToString() +
",HSecManagerID=" + omodel.HSecManagerID.ToString() +
",HKeeperID=" + omodel.HKeeperID.ToString() +
",HDeptID=" + omodel.HDeptID.ToString() +
+ ",HWHID=" + omodel.HWHID.ToString() +
+ ",HSCWHID=" + omodel.HSCWHID.ToString() +
",HExplanation='" + omodel.HExplanation + "'" +
- ",HInnerBillNo='" + omodel.HInnerBillNo + "'" +
+ ",HInnerBillNo='" + omodel.HInnerBillNo + "'" +
",HRedBlueFlag=" + DBUtility.ClsPub.BoolToString(omodel.HRedBlueFlag) +
+ ",HStockOrgID=" + omodel.HSTOCKORGID.ToString() +
" where HInterID=" + lngBillKey.ToString());
//鍒犻櫎鍏宠仈
DeleteRelation(ref sReturn, lngBillKey);
@@ -69,36 +131,32 @@
foreach (Model.ClsSc_MouldStockBillSub oSub in DetailColl)
{
oCn.RunProc("Insert into Sc_MouldStockBillSub " +
- " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
- ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
- ",HMaterID,HPropertyID,HSecUnitID,HSecUnitRate,HUnitID,HQtyMust" +
- ",HQty,HPrice,HMoney,HWHID,HSCWHID,HSPID" +
- ",HDesignLife,HLeaveLife,HUseLife" +
- ",HSCSPID,HSPGroupID,HBatchNo,HPOOrderInterID,HPOOrderEntryID,HPOOrderBillNo" +
- ",HSeOrderInterID,HSeOrderEntryID,HSeOrderBillNo" +
+ " (HInterID,HEntryID,HRemark,HRelationQty,HRelationMoney" +
+ ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType" +
+ ",HMaterID,HPropertyID,HSecUnitID,HSecUnitRate,HUnitID,HBatchNo" +
+ ",HQtyMust,HQtyRel,HQty,HPrice,HMoney,HDesignLife" +
+ ",HLeaveLife,HUseLife,HUseLifeQty,HNewLifeQty,HWHID,HSCWHID" +
+ ",HSPID,HSCSPID,HSPGroupID,HBarCode,HCorrespondentTypeID,HCorrespondentID" +
+ ",HPOOrderInterID,HPOOrderEntryID,HPOOrderBillNo,HSeOrderInterID,HSeOrderEntryID,HSeOrderBillNo" +
+ ",HStockOrgID,HOWNERID,HOtherOrgID,HOWNERTYPEID" +
") values("
- + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" +
- "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
- "," + oSub.HMaterID.ToString() + "," + oSub.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.HSCWHID.ToString() + "," + oSub.HSPID.ToString() +
- "," + oSub.HDesignLife.ToString() + "," + oSub.HLeaveLife.ToString() + "," + oSub.HUseLife.ToString() +
- "," + oSub.HSCSPID.ToString() + "," + oSub.HSPGroupID.ToString() + ",'" + oSub.HBatchNo + "'," + oSub.HPOOrderInterID.ToString() + "," + oSub.HPOOrderEntryID.ToString() + ",'" + oSub.HPOOrderBillNo + "'" +
- "," + oSub.HSeOrderInterID.ToString() + "," + oSub.HSeOrderEntryID.ToString() + ",'" + oSub.HSeOrderBillNo + "'"+
+ + 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.HBatchNo + "'" +
+ "," + oSub.HQtyMust.ToString() + "," + oSub.HQtyRel.ToString() + "," + oSub.HQty.ToString() + "," + oSub.HPrice.ToString() + "," + oSub.HMoney.ToString() + "," + oSub.HDesignLife.ToString() +
+ "," + oSub.HLeaveLife.ToString() + "," + oSub.HUseLife.ToString() + "," + oSub.HUseLifeQty.ToString() + "," + oSub.HNewLifeQty.ToString() + "," + oSub.HWHID.ToString() + "," + oSub.HSCWHID.ToString() +
+ "," + 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 + "'" +
") ");
}
- //
- //foreach (Model.ClsSc_MouldProdInBillSub oSub in DetailColl)
- //{
- // Ds = oCn.RunProcReturn("exec h_p_Sc_MouldProdInBill_Qty " + oSub.HICMOInterID, "");
- // if (Ds.Tables[0].Rows.Count == 0)
- // return;
- // if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBool"]) == "Y")
- // {
- // sReturn = "姹囨姤鏁伴噺瓒呰繃璁″垝鏁伴噺锛佷笉鍏佽淇濆瓨";
- // return false;
- // }
- //}
- sReturn = "淇敼鍗曟嵁鎴愬姛锛�";
+ //淇濆瓨鍚庢帶鍒�
+ if (!AfterSave(lngBillKey, omodel.HBillNo, 2, ref sReturn))
+ {
+ oCn.RollBack();
+ return false;
+ }
+ sReturn = "鍗曟嵁鍙凤細" + omodel.HBillNo + " 淇敼鎴愬姛锛�";
oCn.Commit();
return true;
}
@@ -114,59 +172,79 @@
{
try
{
+ //鑾峰彇绯荤粺鍙傛暟
+ Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
+ if (oSystemParameter.ShowBillByOrgID(omodel.HSTOCKORGID, ref sReturn) == false)
+ {
+ sReturn = "鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sReturn;
+ return false;
+ }
//寰楀埌mainid
- omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
- //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
+ if (omodel.HInterID == 0)
+ {
+ omodel.HInterID = DBUtility.ClsPub.CreateBillID_Prod(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
+ }
+ //淇濆瓨鍓嶆帶鍒�
+ if (!BeforeSave(omodel.HInterID, omodel.HBillNo, omodel.HSecManagerID, omodel.HKeeperID, omodel.HSupID, 1, ref sReturn))
+ {
+ return false;
+ }
+
oCn.BeginTran();
//涓昏〃
oCn.RunProc("Insert Into Sc_MouldStockBillMain " +
"(HBillType,HBillSubType,HInterID,HBillNo,HDate" +
",HYear,HPeriod,HRemark,HMaker,HMakeDate" +
- ",HSupID,HWHID,HSCWHID,HEmpID,HManagerID,HSecManagerID" +
- ",HKeeperID,HDeptID,HExplanation,HInnerBillNo,HRedBlueFlag" +
- ",HProcID"+
+ ",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 + "'" +
+ " 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.HSupID.ToString() + "," + omodel.HWHID.ToString() + "," + omodel.HSCWHID.ToString() + "," + omodel.HEmpID.ToString() + "," + omodel.HManagerID.ToString() + "," + omodel.HSecManagerID.ToString() +
- ", " + omodel.HKeeperID.ToString() + "," + omodel.HDeptID.ToString() + ",'" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "'," + DBUtility.ClsPub.BoolToString(omodel.HRedBlueFlag) +
- ","+ '0' +
+ ", " + 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)
{
oCn.RunProc("Insert into Sc_MouldStockBillSub " +
- " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
- ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
- ",HMaterID,HPropertyID,HSecUnitID,HSecUnitRate,HUnitID,HQtyMust" +
- ",HQty,HPrice,HMoney,HWHID,HSCWHID,HSPID" +
- ",HDesignLife,HLeaveLife,HUseLife" +
- ",HSCSPID,HSPGroupID,HBatchNo,HPOOrderInterID,HPOOrderEntryID,HPOOrderBillNo" +
- ",HSeOrderInterID,HSeOrderEntryID,HSeOrderBillNo" +
- ") values("
- + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" +
- "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
- "," + oSub.HMaterID.ToString() + "," + oSub.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.HSCWHID.ToString() + "," + oSub.HSPID.ToString() +
- "," + oSub.HDesignLife.ToString() + "," + oSub.HLeaveLife.ToString() + "," + oSub.HUseLife.ToString() +
- "," + oSub.HSCSPID.ToString() + "," + oSub.HSPGroupID.ToString() + ",'" + oSub.HBatchNo + "'," + oSub.HPOOrderInterID.ToString() + "," + oSub.HPOOrderEntryID.ToString() + ",'" + oSub.HPOOrderBillNo + "'" +
- "," + oSub.HSeOrderInterID.ToString() + "," + oSub.HSeOrderEntryID.ToString() + ",'" + oSub.HSeOrderBillNo + "'" +
- ") ");
+ " (HInterID,HEntryID,HRemark,HRelationQty,HRelationMoney" +
+ ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType" +
+ ",HMaterID,HPropertyID,HSecUnitID,HSecUnitRate,HUnitID,HBatchNo" +
+ ",HQtyMust,HQtyRel,HQty,HPrice,HMoney,HDesignLife" +
+ ",HLeaveLife,HUseLife,HUseLifeQty,HNewLifeQty,HWHID,HSCWHID" +
+ ",HSPID,HSCSPID,HSPGroupID,HBarCode,HCorrespondentTypeID,HCorrespondentID" +
+ ",HPOOrderInterID,HPOOrderEntryID,HPOOrderBillNo,HSeOrderInterID,HSeOrderEntryID,HSeOrderBillNo" +
+ ",HStockOrgID,HOWNERID,HOtherOrgID,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.HBatchNo + "'" +
+ "," + oSub.HQtyMust.ToString() + "," + oSub.HQtyRel.ToString() + "," + oSub.HQty.ToString() + "," + oSub.HPrice.ToString() + "," + oSub.HMoney.ToString() + "," + oSub.HDesignLife.ToString() +
+ "," + oSub.HLeaveLife.ToString() + "," + oSub.HUseLife.ToString() + "," + oSub.HUseLifeQty.ToString() + "," + oSub.HNewLifeQty.ToString() + "," + oSub.HWHID.ToString() + "," + oSub.HSCWHID.ToString() +
+ "," + 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 + "'" +
+ ") ");
}
-
- //foreach (Model.ClsSc_MouldProdInBillSub oSub in DetailColl)
- //{
- // Ds = oCn.RunProcReturn("exec h_p_Sc_MouldProdInBill_Qty " + oSub.HICMOInterID, "");
- // if (Ds.Tables[0].Rows.Count == 0)
- // return;
- // if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBool"]) == "Y")
- // {
- // sReturn = "姹囨姤鏁伴噺瓒呰繃璁″垝鏁伴噺锛佷笉鍏佽淇濆瓨";
- // return false;
- // }
- //}
- //
- sReturn = "鏂板鍗曟嵁鎴愬姛锛�";
+ //淇濆瓨鍚庢帶鍒�
+ if (!AfterSave(omodel.HInterID, omodel.HBillNo, 1, ref sReturn))
+ {
+ oCn.RollBack();
+ return false;
+ }
+
+ if (oSystemParameter.omodel.Sc_MouldProdInBill_AutoCheck.ToUpper() == "Y") //绯荤粺鍙傛暟 鑷姩瀹℃牳
+ {
+ //瀹℃牳鍗曟嵁
+ oCn.RunProc("Update Sc_MouldStockBillMain Set HChecker='" + DBUtility.ClsPub.CurUserName + "',HCheckDate=getdate(),HBillStatus=2 where HInterID= " + omodel.HInterID.ToString());
+ sReturn = "鍗曟嵁鍙凤細" + omodel.HBillNo + " 鏂板瀹℃牳鎴愬姛锛�";
+ }
+ else
+ {
+ sReturn = "鍗曟嵁鍙凤細" + omodel.HBillNo + " 鏂板鎴愬姛锛�";
+ }
oCn.Commit();
return true;
}
--
Gitblit v1.9.1