From 76a6a6c378c6511f988e0b71dbec5e9e05782dac Mon Sep 17 00:00:00 2001
From: jhz <jinghz@oceic.com>
Date: 星期日, 09 十月 2022 12:37:51 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
---
WebAPI/Controllers/SCGL/日计划管理/JIT_DayPlanPlatFormBillController.cs | 24 +++++++++++++++++++-----
1 files changed, 19 insertions(+), 5 deletions(-)
diff --git "a/WebAPI/Controllers/SCGL/\346\227\245\350\256\241\345\210\222\347\256\241\347\220\206/JIT_DayPlanPlatFormBillController.cs" "b/WebAPI/Controllers/SCGL/\346\227\245\350\256\241\345\210\222\347\256\241\347\220\206/JIT_DayPlanPlatFormBillController.cs"
index 1cdba47..8f3a078 100644
--- "a/WebAPI/Controllers/SCGL/\346\227\245\350\256\241\345\210\222\347\256\241\347\220\206/JIT_DayPlanPlatFormBillController.cs"
+++ "b/WebAPI/Controllers/SCGL/\346\227\245\350\256\241\345\210\222\347\256\241\347\220\206/JIT_DayPlanPlatFormBillController.cs"
@@ -41,7 +41,7 @@
omdelMian = JsonConvert.DeserializeObject<Sc_WorkBillSortBillMain>(sWhere);
ds = oCN.RunProcReturn($"exec h_p_JIT_Sc_WorkBillSortBill_Query '{omdelMian.HPlanBeginDate}',{(omdelMian.HProdORGID == null ? 0 : omdelMian.HProdORGID)},'{omdelMian.HSeOrderBillNo}'" +
- $",'{omdelMian.HPlanEndDate.AddDays(1).AddSeconds(-1)}',{omdelMian.HMaterID},'{omdelMian.HICMOBillNo}',{omdelMian.HWorkShopID}", "h_p_JIT_Sc_WorkBillSortBill_Query");
+ $",'{omdelMian.HPlanEndDate.AddDays(1)}',{omdelMian.HMaterID},'{omdelMian.HICMOBillNo}',{omdelMian.HWorkShopID}", "h_p_JIT_Sc_WorkBillSortBill_Query");
objJsonResult.code = "1";
objJsonResult.count = 1;
@@ -187,6 +187,7 @@
var HOrderLev = list[i]["璁㈠崟绛夌骇"].ToString();
var HMainSourceInterID = list[i]["婧愬崟涓诲唴鐮�"].ToString();
var HMainSourceEntryID = list[i]["婧愬崟瀛愬唴鐮�"].ToString();
+ var HPlanQty = list[i]["璁″垝鏁伴噺"].ToString();
if (HSourceID == "")
{
@@ -219,14 +220,14 @@
" HMaterID, HMaterName, HMaterModel, HUnitID, HSeOrderBillQty," +
" HOrderNeedQty, HSplitQty, HDayPlanSumQty,HPlanBeginDate," +
"HSeOrderBillNo,HICMOBillType,HSourceStockInQty,HLeftPlanQty,HOrderLev,HPreparatDate," +
- "HMainSourceInterID,HMainSourceEntryID)values" +
+ "HMainSourceInterID,HMainSourceEntryID,HICMOInterID_Sec,HICMOEntryID_Sec,HPlanQty)values" +
$"({HInterID},'{HBillNo}',{DateTime.Now.Year},{DateTime.Now.Month},'{BillType}'," +
$"'{BillType}',GETDATE(),1,'{user}',getdate(),'{HICMOBillNo}','{HOrderType}'," +
$"{(HICMOEntrySEQ == "" ? 0.ToString() : HICMOEntrySEQ)},{(HWorkShopID == "" ? 0.ToString() : HWorkShopID)},{(HSourceID == "" ? 0.ToString() : HSourceID)}, {(HYX == "" ? 0.ToString() : HYX)}, {(HProdORGID == "" ? 0.ToString() : HProdORGID)}," +
$" {(HMaterID == "" ? 0.ToString() : HMaterID)}, '{HMaterName}', '{HMaterModel}', {(HUnitID == "" ? 0.ToString() : HUnitID)}, {(HSeOrderBillQty == "" ? 0.ToString() : HSeOrderBillQty)}," +
$" 0, {(HSplitQty == "" ? 0.ToString() : HSplitQty)}, {(HDayPlanSumQty == "" ? 0.ToString() : HDayPlanSumQty)},'{HPlanBeginDate}'," +
$"'{HSeOrderBillNo}','{HICMOBillType}',{(HSourceStockInQty == "" ? 0.ToString() : HSourceStockInQty)},{(HLeftPlanQty == "" ? 0.ToString() : HLeftPlanQty)},'{HOrderLev}',getdate()," +
- $"{HMainSourceInterID},{HMainSourceEntryID})");
+ $"{HMainSourceInterID},{HMainSourceEntryID},{HMainSourceInterID},{HMainSourceEntryID},{HPlanQty})");
}
oCN.RunProc($"update Sc_WorkBillSortBillMain set HDayPlanSumQty={list[i]["鏃ヨ鍒掓暟閲忔�婚噺"].ToString()} where HInterID={(HInterID==0?int.Parse(list[i]["hmainid"].ToString()):HInterID)} and HBillNo='{(HBillNo==""?list[i]["鍗曟嵁鍙�"].ToString(): HBillNo)}'");
@@ -738,7 +739,7 @@
from
(
select sum(HSourceStockInQty)FCXStockInQty,HICMOEntryID_Sec FPRDMOENTYID from SC_WORKBILLSORTBILLMAIN a
---where a.HInterID IN ({0})
+where a.HInterID IN ({0})
group by HICMOEntryID_Sec
) a
join AIS20210811135644..T_PRD_PPBOM T1 on a.FPRDMOENTYID = t1.FMOENTRYID
@@ -1159,10 +1160,23 @@
{
try
{
-
+ DataSet dt = new DataSet();
oCN.RunProc("exec h_p_ICMOBillList_PrimarySubTable");
ds = oCN.RunProcReturn($"select * from ##ICMOBillList where 婧愬崟涓诲唴鐮� in({hmainid}) and 婧愬崟瀛愬唴鐮� in({HEntryID})", "##ICMOBillList");
+ for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
+ {
+ dt = oCN.RunProcReturn($"select * from h_v_JIT_Sc_WorkBillSortBillList where 婧愬崟涓诲唴鐮� in({ds.Tables[0].Rows[i]["婧愬崟涓诲唴鐮�"].ToString()}) and 婧愬崟瀛愬唴鐮� in({ds.Tables[0].Rows[i]["婧愬崟瀛愬唴鐮�"].ToString()})", "h_v_JIT_Sc_WorkBillSortBillList");
+ if (dt.Tables[0].Rows.Count > 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鐢熶骇鏄庣粏琛岄噸澶�,閲嶅鐨勭敓浜ц鍗曞彿:"+ ds.Tables[0].Rows[i]["鐢熶骇璁㈠崟鍙�"].ToString()+",鏄庣粏琛屽彿:"+ ds.Tables[0].Rows[i]["鐢熶骇璁㈠崟鏄庣粏琛屽彿"].ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess锛�";
--
Gitblit v1.9.1