From 9ae6aa786445d49dc3e93ead5a8ee4b92006304e Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期一, 07 八月 2023 08:08:15 +0800
Subject: [PATCH] 1
---
WebAPI/Controllers/SCGL/日计划管理/JIT_DayPlanPlatFormBillController.cs | 116 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 113 insertions(+), 3 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 3e81c3e..263957f 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"
@@ -8,6 +8,7 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System.Diagnostics;
+using System.Threading;
namespace WebAPI.Controllers.SCGL.鏃ヨ鍒掔鐞�
{
@@ -221,14 +222,16 @@
" HMaterID, HMaterName, HMaterModel, HUnitID, HSeOrderBillQty," +
" HOrderNeedQty, HSplitQty, HDayPlanSumQty,HPlanBeginDate," +
"HSeOrderBillNo,HICMOBillType,HSourceStockInQty,HLeftPlanQty,HOrderLev,HPreparatDate," +
- "HMainSourceInterID,HMainSourceEntryID,HICMOInterID_Sec,HICMOEntryID_Sec,HPlanQty)values" +
+ "HMainSourceInterID,HMainSourceEntryID,HICMOInterID_Sec,HICMOEntryID_Sec,HPlanQty" +
+ ",HICMOInterID,HICMOEntryID)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},{HPlanQty})";
+ $"{HMainSourceInterID},{HMainSourceEntryID},{HMainSourceInterID},{HMainSourceEntryID},{HPlanQty}," +
+ $"{HMainSourceInterID},{HMainSourceEntryID})";
//LogService.Write("sql:" + sql);
//涓昏〃
@@ -242,6 +245,13 @@
var HICMOEntrySEQ = list[i]["鐢熶骇璁㈠崟鏄庣粏琛屽彿"].ToString();
var HSourceID = list[i]["HSourceID"].ToString();
var HYX = list[i]["浼樺厛绾�"].ToString();
+ var HWorkQty = list[i]["灏忔椂浜ц兘"].ToString();
+ var HProdTimes = list[i]["鐢熶骇鍛ㄦ湡"].ToString();
+ var HReadyTimes = list[i]["寮�宸ヤ綑閲�"].ToString();
+ var HLastBeginDate = list[i]["鏈�杩熷紑宸ユ棩鏈�"].ToString();
+ var HLastEndDate = list[i]["鏈�杩熷畬宸ユ棩鏈�"].ToString();
+ var HOrderNeedQty = list[i]["璁㈠崟闇�姹傛暟閲�"].ToString();
+ var HOrderCommitDate = list[i]["璁㈠崟浜よ揣鏈�"].ToString();
if (HSourceID == "" || HSourceID == "0")
{
@@ -273,7 +283,10 @@
return objJsonResult;
}
- oCN.RunProc($"update Sc_WorkBillSortBillMain set HSourceID={(HSourceID == "" ? 0.ToString() : HSourceID)},HYX={HYX} where HInterID={list[i]["hmainid"].ToString()} and HBillNo='{list[i]["鍗曟嵁鍙�"].ToString()}'");
+ oCN.RunProc($"update Sc_WorkBillSortBillMain set HSourceID={(HSourceID == "" ? 0.ToString() : HSourceID)},HYX={HYX}" +
+ $",HWorkQty={HWorkQty},HProdTimes={HProdTimes},HReadyTimes={HReadyTimes},HLastBeginDate='{HLastBeginDate}'" +
+ $",HLastEndDate='{HLastEndDate}',HOrderNeedQty={HOrderNeedQty},HOrderCommitDate='{HOrderCommitDate}'" +
+ $" where HInterID={list[i]["hmainid"].ToString()} and HBillNo='{list[i]["鍗曟嵁鍙�"].ToString()}'");
}
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)}'");
@@ -2588,5 +2601,102 @@
}
#endregion
+ #region 鐢熶骇鏃ヨ鍒掑钩鍙� 鏁版嵁鍑嗗 璁剧疆浠诲姟鍗曠浉鍏充俊鎭�
+ [Route("JIT_DayPlanPlatFormBill/ReadyData")]
+ [HttpGet]
+ public object ReadyData(string HICOMNum)
+ {
+ try
+ {
+ var list = HICOMNum.Split(',');
+ DataTable dt = new DataTable("date");
+ dt.Columns.Add("HICMOInterID", typeof(string));
+ dt.Columns.Add("HICMOEntryID", typeof(string));
+ dt.Columns.Add("灏忔椂浜ц兘", typeof(string));
+ dt.Columns.Add("鐢熶骇鍛ㄦ湡", typeof(decimal));
+ dt.Columns.Add("寮�宸ヤ綑閲�", typeof(decimal));
+ dt.Columns.Add("鏈�杩熷紑宸ユ棩鏈�", typeof(DateTime));
+ dt.Columns.Add("鏈�杩熷畬宸ユ棩鏈�", typeof(DateTime));
+ dt.Columns.Add("璁㈠崟闇�姹傛暟閲�", typeof(decimal));
+ dt.Columns.Add("璁㈠崟浜よ揣鏈�", typeof(DateTime));
+
+ for (int i = 0; i < list.Length; i++)
+ {
+ string HICMOInterID = list[i].Split(';')[0].ToString();
+ string HICMOEntryID = list[i].Split(';')[1].ToString();
+
+ Thread.Sleep(100);
+ ds = oCN.RunProcReturn("exec h_p_Sc_GetInfoByICMOBillNo " + HICMOInterID+","+ HICMOEntryID, "h_p_Sc_GetInfoByICMOBillNo");
+ if (ds == null || ds.Tables[0].Rows.Count == 0)
+ {
+
+ }
+ else
+ {
+ DataRow dr = dt.NewRow();
+ dr["灏忔椂浜ц兘"] = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[0]["浜ц兘"]);
+ dr["鐢熶骇鍛ㄦ湡"] = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[0]["鐢熶骇鍛ㄦ湡"]);
+ dr["寮�宸ヤ綑閲�"] = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[0]["寮�宸ヤ綑閲�"]);
+ dr["鏈�杩熷紑宸ユ棩鏈�"] = DBUtility.ClsPub.isDate(ds.Tables[0].Rows[0]["鏈�杩熷紑宸ユ棩鏈�"]);
+ dr["鏈�杩熷畬宸ユ棩鏈�"] = DBUtility.ClsPub.isDate(ds.Tables[0].Rows[0]["鏈�杩熷畬宸ユ棩鏈�"]);
+ dr["璁㈠崟闇�姹傛暟閲�"] = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[0]["璁㈠崟闇�姹傛暟"]);
+ dr["璁㈠崟浜よ揣鏈�"] = DBUtility.ClsPub.isDate(ds.Tables[0].Rows[0]["璁㈠崟浜よ揣鏈�"]);
+ dr["HICMOInterID"] = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[0]["HICMOInterID"]);
+ dr["HICMOEntryID"] = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[0]["HICMOEntryID"]);
+ dt.Rows.Add(dr);
+ }
+ }
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = dt;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 缂烘枡鍒嗘瀽鎶ヨ〃
+ public class MaterialShorAnalysis
+ {
+ public int? HORGID;
+ public DateTime HBEGINDATE;
+ public DateTime HENDDATE;
+ }
+ [Route("JIT_DayPlanPlatFormBill/MaterialShorAnalysisReport")]
+ [HttpGet]
+ public object MaterialShorAnalysisReport(string sWhere)
+ {
+ try
+ {
+ MaterialShorAnalysis Report = JsonConvert.DeserializeObject<MaterialShorAnalysis>(sWhere);
+
+ ds = oCN.RunProcReturn($"exec h_p_JIT_MaterialShorAnalysisReportList {Report.HORGID},'{Report.HBEGINDATE}','{Report.HENDDATE}' ", "h_p_JIT_PODemandPlanBill_ReportList");
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[0];
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
}
}
\ No newline at end of file
--
Gitblit v1.9.1