From 8dca4525e644e06117969e7dd3184912055d0d3d Mon Sep 17 00:00:00 2001
From: yxj <yxj@hz-kingdee.com>
Date: 星期五, 15 九月 2023 15:48:49 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
---
WebAPI/Models/ClsKf_MateOutBillMain.cs | 24 +++
WebAPI/DLL/ClsKf_MateOutBill.cs | 279 +++++++++++++++++++++++++++++++++++++--
WebAPI/Controllers/仓存管理/领料发货/Kf_MateOutBillController.cs | 54 +++++++
WebAPI/Controllers/项目管理/项目阶段/Gy_ProjectStageController.cs | 51 +++++--
WebAPI/Models/ClsKf_MateOutBillSub.cs | 2
5 files changed, 378 insertions(+), 32 deletions(-)
diff --git "a/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\351\242\206\346\226\231\345\217\221\350\264\247/Kf_MateOutBillController.cs" "b/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\351\242\206\346\226\231\345\217\221\350\264\247/Kf_MateOutBillController.cs"
index 10da004..cba29cf 100644
--- "a/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\351\242\206\346\226\231\345\217\221\350\264\247/Kf_MateOutBillController.cs"
+++ "b/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\351\242\206\346\226\231\345\217\221\350\264\247/Kf_MateOutBillController.cs"
@@ -403,7 +403,7 @@
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
if (sqlWhere == null || sqlWhere.Equals(""))
{
- ds = oCN.RunProcReturn(string.Format(@"select HMaterID ,鐗╂枡浠g爜 HMaterCode ,鐗╂枡鍚嶇О HMaterName,瑙勬牸鍨嬪彿 HMaterSpec,HUnitID,璁¢噺鍗曚綅浠g爜 HUnitCode,璁¢噺鍗曚綅 HUnitName,搴旀敹鏁伴噺 HQtyMust,瀹炴敹鏁伴噺 HQty,鍗曚环 HPrice,閲戦 HMoney,HWHID,棰嗘枡浠撳簱浠g爜 HWHCode,棰嗘枡浠撳簱 HWHName,琛ㄤ綋澶囨敞 HRemark
+ ds = oCN.RunProcReturn(string.Format(@"select HMaterID ,鐗╂枡浠g爜 HMaterCode ,鐗╂枡鍚嶇О HMaterName,鐗╂枡鍒嗙被 HMaterRuleType,瑙勬牸鍨嬪彿 HMaterSpec,鐢ㄩ噺 HRate,HUnitID,璁¢噺鍗曚綅浠g爜 HUnitCode,璁¢噺鍗曚綅 HUnitName,搴旀敹鏁伴噺 HQtyMust,瀹炴敹鏁伴噺 HQty,鍗曚环 HPrice,閲戦 HMoney,HWHID,棰嗘枡浠撳簱浠g爜 HWHCode,棰嗘枡浠撳簱 HWHName,琛ㄤ綋澶囨敞 HRemark
from h_v_IF_MateOutBillList"), "H_V_IF_MATEOUTBILLLIST");
}
@@ -411,7 +411,7 @@
{
//string sql1 = "select HRepairCheckID,HRepairCheckContent,HManagerID,HRemark from Sc_MouldRepairCheckBillSub where 1 = 1 ";
- string sql1 = string.Format(@"select HMaterID ,鐗╂枡浠g爜 HMaterCode ,鐗╂枡鍚嶇О HMaterName,瑙勬牸鍨嬪彿 HMaterSpec,HUnitID,璁¢噺鍗曚綅浠g爜 HUnitCode,璁¢噺鍗曚綅 HUnitName,搴旀敹鏁伴噺 HQtyMust,瀹炴敹鏁伴噺 HQty,鍗曚环 HPrice,閲戦 HMoney,HWHID,棰嗘枡浠撳簱浠g爜 HWHCode,棰嗘枡浠撳簱 HWHName,琛ㄤ綋澶囨敞 HRemark
+ string sql1 = string.Format(@"select HMaterID ,鐗╂枡浠g爜 HMaterCode ,鐗╂枡鍚嶇О HMaterName,鐗╂枡鍒嗙被 HMaterRuleType,瑙勬牸鍨嬪彿 HMaterSpec,鐢ㄩ噺 HRate, HUnitID,璁¢噺鍗曚綅浠g爜 HUnitCode,璁¢噺鍗曚綅 HUnitName,搴旀敹鏁伴噺 HQtyMust,瀹炴敹鏁伴噺 HQty,鍗曚环 HPrice,閲戦 HMoney,HWHID,棰嗘枡浠撳簱浠g爜 HWHCode,棰嗘枡浠撳簱 HWHName,琛ㄤ綋澶囨敞 HRemark
from h_v_IF_MateOutBillList WHERE 1=1");
string sql = sql1 + sqlWhere;
ds = oCN.RunProcReturn(sql, "H_V_IF_MATEOUTBILLLIST");
@@ -457,6 +457,8 @@
string msg3 = sArray[1].ToString();
string refSav = sArray[2].ToString();
string msg4 = sArray[3].ToString();
+
+ DBUtility.ClsPub.CurUserName = msg4;
string UserName = "";
string s = "";
@@ -636,6 +638,54 @@
}
#endregion
+ #region 鏍规嵁宸ヨ壓鍗曞彿(宸ュ簭娴佽浆鍗″彿)鑾峰彇淇℃伅
+ [Route("Kf_MateOutBill/getMainDataByHProcExchBillNo")]
+ [HttpGet]
+ public ApiResult<DataSet> getMainDataByHProcExchBillNo(string HProcExchBillNo)
+ {
+ if (string.IsNullOrEmpty(HProcExchBillNo))
+ return new ApiResult<DataSet> { code = -1, msg = "宸ヨ壓鍗曞彿涓嶈兘涓虹┖" };
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+
+ string sql = "select top(1) " +
+ "a.HICMOInterID,a.HICMOEntryID,a.HICMOBillNo,a.HInterID HProcExchInterID,a.HMaterID,m1.HName HMaterName,a.HMaterModel HModel,a.HMaterModel2 HModel2,a.HCusID,c1.HName HCusName,a.HWeight" +
+ " from Sc_ProcessExchangeBillMain AS a " +
+ " LEFT OUTER JOIN Gy_Material AS m1 on a.HMaterID = m1.HItemID " +
+ " LEFT OUTER JOIN Gy_Customer AS c1 on a.HCusID = c1.HItemID " +
+ " where a.HBillNo = '" + HProcExchBillNo + "'";
+
+ var dataSet = oCN.RunProcReturn(sql, "h_v_Sc_ProcessExchangeBillList");
+
+
+ if (dataSet == null || dataSet.Tables[0].Rows.Count == 0)
+ return new ApiResult<DataSet> { code = -1, msg = "涓嶅瓨鍦ㄥ崟鍙�" };
+
+ return new ApiResult<DataSet> { code = 1, msg = "鏌ヨ鎴愬姛", data = dataSet };
+ }
+ #endregion
+
+ #region 鏍规嵁鐗╂枡鍐呯爜鑾峰彇鐗╂枡淇℃伅
+ [Route("Kf_MateOutBill/getMaterialByMaterID")]
+ [HttpGet]
+ public ApiResult<DataTable> getMaterialByMaterID(Int64 HMaterID)
+ {
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+
+ string sql = "select a.HItemID HMaterID,a.HNumber HMaterNumber,a.HName HMaterName,a.HMaterRuleType,a.HModel HMaterModel,a.HUnitID, b.HNumber HUnitNumber, b.HName HUnitName" +
+ " from Gy_Material AS a " +
+ " LEFT OUTER JOIN Gy_Unit AS b on a.HUnitID = b.HItemID " +
+ " where a.HItemID =" + HMaterID;
+
+ var dataSet = oCN.RunProcReturn(sql, "Gy_Material");
+
+
+ if (dataSet == null || dataSet.Tables[0].Rows.Count == 0)
+ return new ApiResult<DataTable> { code = -1, msg = "涓嶅瓨鍦ㄨ鐗╂枡" };
+
+ return new ApiResult<DataTable> { code = 1, msg = "鏌ヨ鎴愬姛", data = dataSet.Tables[0] };
+ }
+ #endregion
+
#region 鍣ㄥ叿閲囪喘鍏ュ簱鍗曞鏍�/鍙嶅鏍�
[Route("Sc_MouldProdInHouseBill/AuditMouldProdInHouseBill")]
[HttpGet]
diff --git "a/WebAPI/Controllers/\351\241\271\347\233\256\347\256\241\347\220\206/\351\241\271\347\233\256\351\230\266\346\256\265/Gy_ProjectStageController.cs" "b/WebAPI/Controllers/\351\241\271\347\233\256\347\256\241\347\220\206/\351\241\271\347\233\256\351\230\266\346\256\265/Gy_ProjectStageController.cs"
index e2a1b2b..9bf78e5 100644
--- "a/WebAPI/Controllers/\351\241\271\347\233\256\347\256\241\347\220\206/\351\241\271\347\233\256\351\230\266\346\256\265/Gy_ProjectStageController.cs"
+++ "b/WebAPI/Controllers/\351\241\271\347\233\256\347\256\241\347\220\206/\351\241\271\347\233\256\351\230\266\346\256\265/Gy_ProjectStageController.cs"
@@ -1426,10 +1426,8 @@
public int HInterID;
public string HBillNo;
public string HDate;
- public int HProID;
+ public int HProjectID;
public string HProNumber;
- public string HMainSourceBillNo;
- public string HMainSourceBillType;
public int HProjectStageID;
public string HProjectStageName;
public string HStageNote;
@@ -1445,6 +1443,12 @@
public int HOrgID;
public string HRemark;
public string HMaker;
+
+ public int HMainSourceInterID;
+ public int HMainSourceEntryID;
+ public string HMainSourceBillNo;
+ public string HMainSourceBillType;
+
public string HUpdater;
public string HChecker;
public string HMakerDate;
@@ -1559,10 +1563,8 @@
int HInterID = mainList[0].HInterID;
string HBillNo = mainList[0].HBillNo;
string HDate = mainList[0].HDate;
- int HProID = mainList[0].HProID;
+ int HProjectID = mainList[0].HProjectID;
string HProNumber = mainList[0].HProNumber;
- string HMainSourceBillNo = mainList[0].HMainSourceBillNo;
- string HMainSourceBillType = mainList[0].HMainSourceBillType;
int HProjectStageID = mainList[0].HProjectStageID;
string HStageNote = mainList[0].HStageNote;
string HRelationGoods = mainList[0].HRelationGoods;
@@ -1575,6 +1577,12 @@
double HRate = mainList[0].HRate;
int HOrgID = mainList[0].HOrgID;
string HRemark = mainList[0].HRemark;
+
+ int HMainSourceInterID = mainList[0].HMainSourceInterID;
+ int HMainSourceEntryID = mainList[0].HMainSourceEntryID;
+ string HMainSourceBillNo = mainList[0].HMainSourceBillNo;
+ string HMainSourceBillType = mainList[0].HMainSourceBillType;
+
string HMaker = mainList[0].HMaker;
string HMakerDate = mainList[0].HMakerDate;
string HUpdater = mainList[0].HUpdater;
@@ -1600,7 +1608,7 @@
{
string sql = "insert into PM_ProjectReportBillMain" +
"(HYear,HPeriod,HBillType,HBillSubType,HInterID,HDate,HBillNo,HBillStatus,HRemark,HMaker,HMakeDate" +
- ",HProNumber,HProjectStageID,HStageNote,HRelationGoods,HIsKey,HReportEmpID,HReportNote,HReportGoods,HReceiveEmp,HCopyEmp,HRate,HOrgID) " +
+ ",HProjectID,HProNumber,HProjectStageID,HStageNote,HRelationGoods,HIsKey,HReportEmpID,HReportNote,HReportGoods,HReceiveEmp,HCopyEmp,HRate,HOrgID,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType) " +
"values(" +
"" + HYear +
"," + HPeriod +
@@ -1613,7 +1621,8 @@
",'" + HRemark +
"','" + HMaker +
"','" + HMakerDate +
- "','" + HProNumber +
+ "'," + HProjectID +
+ ",'" + HProNumber +
"'," + HProjectStageID +
",'" + HStageNote +
"','" + HRelationGoods +
@@ -1625,7 +1634,11 @@
"','" + HCopyEmp +
"'," + HRate +
"," + HOrgID +
- ")";
+ "," + HMainSourceInterID +
+ "," + HMainSourceEntryID +
+ ",'" + HMainSourceBillNo +
+ "','" + HMainSourceBillType +
+ "')";
//涓昏〃
oCN.RunProc(sql);
@@ -1645,7 +1658,8 @@
",HRemark = '" + HRemark +
"',HUpdater = '" + HUpdater +
"',HUpdateDate = '" + HUpdaterDate +
- "',HProNumber = '" + HProNumber +
+ "',HProjectID = " + HProjectID +
+ ",HProNumber = '" + HProNumber +
"',HProjectStageID = " + HProjectStageID +
",HStageNote = '" + HStageNote +
"',HRelationGoods = '" + HRelationGoods +
@@ -1657,7 +1671,11 @@
"',HCopyEmp = '" + HCopyEmp +
"',HRate = " + HRate +
",HOrgID = " + HOrgID +
- " where HInterID = " + HInterID;
+ ",HMainSourceInterID = " + HMainSourceInterID +
+ ",HMainSourceEntryID = " + HMainSourceEntryID +
+ ",HMainSourceBillNo = '" + HMainSourceBillNo +
+ "',HMainSourceBillType = '" + HMainSourceBillType +
+ "' where HInterID = " + HInterID;
oCN.RunProc(sql);
@@ -1670,7 +1688,7 @@
{
string sql = "insert into PM_ProjectReportBillMain" +
"(HYear,HPeriod,HBillType,HBillSubType,HInterID,HDate,HBillNo,HBillStatus,HRemark,HMaker,HMakeDate" +
- ",HProNumber,HProjectStageID,HStageNote,HRelationGoods,HIsKey,HReportEmpID,HReportNote,HReportGoods,HReceiveEmp,HCopyEmp,HRate,HOrgID,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillType,HMainSourceBillNo) " +
+ ",HProjectID,HProNumber,HProjectStageID,HStageNote,HRelationGoods,HIsKey,HReportEmpID,HReportNote,HReportGoods,HReceiveEmp,HCopyEmp,HRate,HOrgID,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillType,HMainSourceBillNo) " +
"values(" +
"" + HYear +
"," + HPeriod +
@@ -1683,7 +1701,8 @@
",'" + HRemark +
"','" + HMaker +
"','" + HMakerDate +
- "','" + HProNumber +
+ "'," + HProjectID +
+ ",'" + HProNumber +
"'," + HProjectStageID +
",'" + HStageNote +
"','" + HRelationGoods +
@@ -1695,8 +1714,8 @@
"','" + HCopyEmp +
"'," + HRate +
"," + HOrgID +
- "," + HProID +
- "," + HProjectStageID +
+ "," + HMainSourceInterID +
+ "," + HMainSourceEntryID +
",'" + HMainSourceBillType +
"','" + HMainSourceBillNo +
"')";
@@ -1707,7 +1726,7 @@
oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + HComputerName + "','" + "鏂板椤圭洰闃舵姹囨姤锛�" + HBillNo + "','LMES-椤圭洰闃舵姹囨姤妯″潡','" + DBUtility.ClsPub.IPAddress + "','鏂板鍗曟嵁'", ref DBUtility.ClsPub.sExeReturnInfo);
}
//淇濆瓨瀛愯〃
- objJsonResult = AddBillSub_ProjectReportBill(msg3, HInterID, HBillNo, OperationType,HProID, HProjectStageID, HMainSourceBillType, HMainSourceBillNo);
+ objJsonResult = AddBillSub_ProjectReportBill(msg3, HInterID, HBillNo, OperationType,HMainSourceInterID, HMainSourceEntryID, HMainSourceBillType, HMainSourceBillNo);
if (objJsonResult.code == "0")
{
diff --git a/WebAPI/DLL/ClsKf_MateOutBill.cs b/WebAPI/DLL/ClsKf_MateOutBill.cs
index 8deba8f..4a1f4a4 100644
--- a/WebAPI/DLL/ClsKf_MateOutBill.cs
+++ b/WebAPI/DLL/ClsKf_MateOutBill.cs
@@ -39,8 +39,8 @@
{
//
oCn.BeginTran();
- //鏇存柊涓昏〃
- oCn.RunProc("UpDate Kf_ICStockBillMain set " +
+
+ string mainSql = "UpDate Kf_ICStockBillMain set " +
" HBillNo='" + omodel.HBillNo + "'" + //鍥哄畾璧嬪��===============
",HDate='" + omodel.HDate + "'" +
",HYear='" + omodel.HYear.ToString() + "'" +
@@ -60,16 +60,75 @@
",HExplanation='" + omodel.HExplanation + "'" +
",HInnerBillNo='" + omodel.HInnerBillNo + "'" +
",HRedBlueFlag=" + DBUtility.ClsPub.BoolToString(omodel.HRedBlueFlag) +
- " where HInterID=" + lngBillKey.ToString());
+ " where HInterID=" + lngBillKey.ToString();
+
+
+ //鍒ゆ柇浣跨敤瀹㈡埛锛屾牴鎹鎴疯繘琛屼釜鎬у寲璋冩暣
+ Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
+ string sErrMsg = "";
+ oSystemParameter.ShowBill(ref sErrMsg);
+ if (oSystemParameter.omodel.WMS_CampanyName == "") //涔斾竴瀹㈡埛
+ {
+ mainSql = "UpDate Kf_ICStockBillMain set " +
+ " HBillNo='" + omodel.HBillNo +
+ "',HDate='" + omodel.HDate +
+ "',HYear='" + omodel.HYear.ToString() +
+ "',HPeriod='" + omodel.HPeriod.ToString() +
+ "',HRemark='" + omodel.HRemark +
+ "',HUpDater='" + DBUtility.ClsPub.CurUserName +
+ "',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() +
+ ",HExplanation='" + omodel.HExplanation +
+ "',HInnerBillNo='" + omodel.HInnerBillNo +
+ "',HRedBlueFlag=" + DBUtility.ClsPub.BoolToString(omodel.HRedBlueFlag) +
+
+ ",HICMOInterID=" + omodel.HICMOInterID +
+ ",HICMOEntryID=" + omodel.HICMOEntryID +
+ ",HICMOBillNo='" + omodel.HICMOBillNo +
+ "',HProcExchInterID=" + omodel.HProcExchInterID +
+ ",HProcExchEntryID=" + omodel.HProcExchEntryID +
+ ",HProcExchBillNo='" + omodel.HProcExchBillNo +
+ "',HMaterID=" + omodel.HMaterID +
+ ",HMaterName='" + omodel.HMaterName +
+ "',HVerNo='" + omodel.HVerNo +
+ "',HModel='" + omodel.HModel +
+ "',HModel2='" + omodel.HModel2 +
+ "',HPieceQty='" + omodel.HPieceQty +
+ "',HCusID=" + omodel.HCusID +
+ ",HWeight=" + omodel.HWeight +
+ ",HLong=" + omodel.HLong +
+ ",HSingleWeight=" + omodel.HSingleWeigth +
+ ",HMaterSumWeight=" + omodel.HMaterSumWeight +
+ ",HMaterEmpID=" + omodel.HMaterEmpID +
+ ",HMachineSpeed=" + omodel.HMachineSpeed +
+ ",HWaterRush=" + omodel.HWaterRush +
+ ",HWaterQty=" + omodel.HWaterQty +
+ ",HWaterRate=" + omodel.HWaterRate +
+ " where HInterID=" + lngBillKey.ToString();
+ }
+ //鏇存柊涓昏〃
+ oCn.RunProc(mainSql);
+
+
//鍒犻櫎鍏宠仈
DeleteRelation(ref sReturn, lngBillKey);
//鍒犻櫎瀛愯〃
DeleteBillSub(lngBillKey);
+
+
//鎻掑叆瀛愯〃
omodel.HInterID = lngBillKey;
foreach (Models.ClsKf_MateOutBillSub oSub in DetailColl)
{
- oCn.RunProc("Insert into Kf_ICStockBillSub " +
+ string subSql = "Insert into Kf_ICStockBillSub " +
" (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
",HMaterID,HPropertyID,HSecUnitID,HSecUnitRate,HUnitID,HQtyMust" +
@@ -83,7 +142,52 @@
"," + oSub.HQty.ToString() + "," + oSub.HPrice.ToString() + "," + oSub.HMoney.ToString() + "," + oSub.HWHID.ToString() + "," + oSub.HSCWHID.ToString() + "," + oSub.HSPID.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 + "'" +
- ") ");
+ ") ";
+
+ if (oSystemParameter.omodel.WMS_CampanyName == "") //涔斾竴瀹㈡埛
+ {
+ subSql = "Insert into Kf_ICStockBillSub" +
+ "(HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney,HMaterID,HPropertyID,HSecUnitID,HSecUnitRate,HUnitID,HQtyMust" +
+ ",HRate,HQty,HPrice,HMoney,HWHID,HSCWHID,HSPID,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.HRate.ToString() +
+ "," + oSub.HQty.ToString() +
+ "," + oSub.HPrice.ToString() +
+ "," + oSub.HMoney.ToString() +
+ "," + oSub.HWHID.ToString() +
+ "," + oSub.HSCWHID.ToString() +
+ "," + oSub.HSPID.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 +
+ "') ";
+ }
+
+ oCn.RunProc(subSql);
}
//
//foreach (Model.ClsKf_MateOutBillSub oSub in DetailColl)
@@ -115,7 +219,7 @@
{
//寰楀埌mainid
omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
- omodel.HBillNo = DBUtility.ClsPub.CreateBillCode(BillType, ref DBUtility.ClsPub.sExeReturnInfo, true);
+ //omodel.HBillNo = DBUtility.ClsPub.CreateBillCode(BillType, ref DBUtility.ClsPub.sExeReturnInfo, true);
//鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
if (IsExistBillNo(ref DBUtility.ClsPub.sExeReturnInfo, omodel.HBillNo, Pub_Class.ClsPub.Enum_BillStatus.BillStatus_AddNew, omodel.HInterID))
{
@@ -127,22 +231,86 @@
}
//
oCn.BeginTran();
- //涓昏〃
- oCn.RunProc("Insert Into Kf_ICStockBillMain " +
+
+ string mainSql = "Insert Into Kf_ICStockBillMain " +
"(HBillType,HBillSubType,HInterID,HBillNo,HDate" +
",HYear,HPeriod,HRemark,HMaker,HMakeDate" +
",HSupID,HWHID,HSCWHID,HEmpID,HManagerID,HSecManagerID" +
",HKeeperID,HDeptID,HExplanation,HInnerBillNo,HRedBlueFlag" +
") " +
- " values('" + this.BillType + "','" + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" +
+ " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" +
", " + 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) +
- ") ");
+ ") ";
+
+
+ //鍒ゆ柇浣跨敤瀹㈡埛锛屾牴鎹鎴疯繘琛屼釜鎬у寲璋冩暣
+ Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
+ string sErrMsg = "";
+ oSystemParameter.ShowBill(ref sErrMsg);
+ if (oSystemParameter.omodel.WMS_CampanyName == "") //涔斾竴瀹㈡埛
+ {
+ mainSql = "Insert Into Kf_ICStockBillMain" +
+ "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HYear,HPeriod,HRemark,HMainSourceInterID,HMainSourceBillNo,HMainSourceBillType,HMaker,HMakeDate,HSupID,HWHID,HSCWHID,HEmpID,HManagerID,HSecManagerID,HKeeperID,HDeptID,HExplanation,HInnerBillNo,HRedBlueFlag" +
+ ",HICMOInterID,HICMOEntryID,HICMOBillNo,HProcExchInterID,HProcExchEntryID,HProcExchBillNo,HMaterID,HMaterName,HVerNo,HModel,HModel2,HPieceQty,HCusID,HWeight,HLong,HSingleWeight,HMaterSumWeight,HMaterEmpID" +
+ ",HMachineSpeed,HWaterRush,HWaterQty,HWaterRate) " +
+ " values(" +
+ "'" + this.BillType +
+ "','" + this.HBillSubType +
+ "'," + omodel.HInterID.ToString() +
+ ",'" + omodel.HBillNo +
+ "','" + omodel.HDate +
+ "'," + omodel.HYear.ToString() +
+ "," + omodel.HPeriod.ToString() +
+ ",'" + omodel.HRemark +
+ "'," + omodel.HProcExchInterID +
+ ",'" + omodel.HProcExchBillNo +
+ "','" + "3772" +
+ "','" + 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) +
+ "," + omodel.HICMOInterID +
+ "," + omodel.HICMOEntryID +
+ ",'" + omodel.HICMOBillNo +
+ "'," + omodel.HProcExchInterID +
+ "," + omodel.HProcExchEntryID +
+ ",'" + omodel.HProcExchBillNo +
+ "'," + omodel.HMaterID +
+ ",'" + omodel.HMaterName +
+ "','" + omodel.HVerNo +
+ "','" + omodel.HModel +
+ "','" + omodel.HModel2 +
+ "','" + omodel.HPieceQty +
+ "'," + omodel.HCusID +
+ "," + omodel.HWeight +
+ "," + omodel.HLong +
+ "," + omodel.HSingleWeigth +
+ "," + omodel.HMaterSumWeight +
+ "," + omodel.HMaterEmpID +
+ "," + omodel.HMachineSpeed +
+ "," + omodel.HWaterRush +
+ "," + omodel.HWaterQty +
+ "," + omodel.HWaterRate +
+ ")";
+ }
+
+ //涓昏〃
+ oCn.RunProc(mainSql);
//鎻掑叆瀛愯〃
foreach (Models.ClsKf_MateOutBillSub oSub in DetailColl)
{
- oCn.RunProc("Insert into Kf_ICStockBillSub " +
+ string subSql = "Insert into Kf_ICStockBillSub " +
" (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
",HMaterID,HPropertyID,HSecUnitID,HSecUnitRate,HUnitID,HQtyMust" +
@@ -156,7 +324,51 @@
"," + oSub.HQty.ToString() + "," + oSub.HPrice.ToString() + "," + oSub.HMoney.ToString() + "," + oSub.HWHID.ToString() + "," + oSub.HSCWHID.ToString() + "," + oSub.HSPID.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 + "'" +
- ") ");
+ ") ";
+
+ if (oSystemParameter.omodel.WMS_CampanyName == "") //涔斾竴瀹㈡埛
+ {
+ subSql = "Insert into Kf_ICStockBillSub" +
+ "(HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney,HMaterID,HPropertyID,HSecUnitID,HSecUnitRate,HUnitID,HQtyMust" +
+ ",HRate,HQty,HPrice,HMoney,HWHID,HSCWHID,HSPID,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.HRate.ToString() +
+ "," + oSub.HQty.ToString() +
+ "," + oSub.HPrice.ToString() +
+ "," + oSub.HMoney.ToString() +
+ "," + oSub.HWHID.ToString() +
+ "," + oSub.HSCWHID.ToString() +
+ "," + oSub.HSPID.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 +
+ "') ";
+ }
+ oCn.RunProc(subSql);
}
//
//foreach (Model.ClsKf_MateOutBillSub oSub in DetailColl)
@@ -233,8 +445,41 @@
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"]);
- //
-
+
+
+ //鍒ゆ柇浣跨敤瀹㈡埛锛屾牴鎹鎴疯繘琛屼釜鎬у寲璋冩暣
+ Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
+ string sErrMsg = "";
+ oSystemParameter.ShowBill(ref sErrMsg);
+ if (oSystemParameter.omodel.WMS_CampanyName == "") //涔斾竴瀹㈡埛
+ {
+ omodel.HICMOInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HICMOInterID"]);
+ omodel.HICMOEntryID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HICMOEntryID"]);
+ omodel.HICMOBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HICMOBillNo"]);
+ omodel.HProcExchInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HProcExchInterID"]);
+ omodel.HProcExchEntryID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HProcExchEntryID"]);
+ omodel.HProcExchBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HProcExchBillNo"]);
+ omodel.HMaterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HMaterID"]);
+ omodel.HMaterName = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HMaterName"]);
+ omodel.HVerNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HVerNo"]);
+ omodel.HModel = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HModel"]);
+ omodel.HModel2 = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HModel2"]);
+ omodel.HPieceQty = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HPieceQty"]);
+ omodel.HCusID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCusID"]);
+ omodel.HWeight = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HWeight"]);
+ omodel.HLong = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HLong"]);
+ omodel.HSingleWeigth = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HSingleWeight"]);
+ omodel.HMaterSumWeight = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HMaterSumWeight"]);
+ omodel.HMaterEmpID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HMaterEmpID"]);
+
+ omodel.HMachineSpeed = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HMachineSpeed"]);
+ omodel.HWaterRush = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HWaterRush"]);
+ omodel.HWaterQty = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HWaterQty"]);
+ omodel.HWaterRate = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HWaterRate"]);
+ }
+
+ //
+
//寰幆
DataSet DsSub ;
DsSub = oCn.RunProcReturn("Select * from Kf_ICStockBillSub Where HInterID=" + lngBillKey.ToString(), "Kf_ICStockBillSub");
@@ -277,6 +522,12 @@
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"]);
+
+ if (oSystemParameter.omodel.WMS_CampanyName == "") //涔斾竴瀹㈡埛
+ {
+ oSub.HRate = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[0]["HRate"]);
+ }
+
DetailColl.Add(oSub);
}
sReturn = "鏄剧ず鍗曟嵁鎴愬姛锛�";
diff --git a/WebAPI/Models/ClsKf_MateOutBillMain.cs b/WebAPI/Models/ClsKf_MateOutBillMain.cs
index f5b43d1..d8defbb 100644
--- a/WebAPI/Models/ClsKf_MateOutBillMain.cs
+++ b/WebAPI/Models/ClsKf_MateOutBillMain.cs
@@ -17,5 +17,29 @@
public string HExplanation;// varchar(200) --摘要
public string HInnerBillNo;// varchar(50) --内部单据号
public bool HRedBlueFlag;// bit --红蓝单
+
+ public Int64 HICMOInterID; //int --任务单内码
+ public Int64 HICMOEntryID; //int --任务单子内码
+ public string HICMOBillNo; //int --任务单号
+ public Int64 HProcExchInterID; //int --工序流转卡内码
+ public Int64 HProcExchEntryID; //int --工序流转卡子内码
+ public string HProcExchBillNo; //int --工序流转卡号
+ public Int64 HMaterID; //int --主产品内码
+ public string HMaterName; //varchar(100) --颜色
+ public string HVerNo; //varchar(50) --花版号
+ public string HModel; //varchar(100) --规格型号1
+ public string HModel2; //varchar(100) --规格型号2
+ public string HPieceQty; //varchar(20) --只数
+ public Int64 HCusID; //int --客户
+ public double HWeight; //dec(18,8) --重量
+ public double HLong; //dec(18,8) --米数
+ public double HSingleWeigth; //dec(18,8) --单桶重量
+ public double HMaterSumWeight; //dec(18,8) --总浆重量
+ public Int64 HMaterEmpID; //int --打浆人
+
+ public double HMachineSpeed; //dec(18,8) --机速
+ public double HWaterRush; //dec(18,8) --水冲
+ public double HWaterQty; //dec(18,8) --水量
+ public double HWaterRate; //dec(18,8) --水比
}
}
diff --git a/WebAPI/Models/ClsKf_MateOutBillSub.cs b/WebAPI/Models/ClsKf_MateOutBillSub.cs
index 6799a63..8f35bfc 100644
--- a/WebAPI/Models/ClsKf_MateOutBillSub.cs
+++ b/WebAPI/Models/ClsKf_MateOutBillSub.cs
@@ -30,5 +30,7 @@
public Int64 HSeOrderEntryID;// int --销售订单子内码
public string HSeOrderBillNo;// varchar(50) --销售订单号
+ public double HRate; //money --用量
+
}
}
--
Gitblit v1.9.1