From b81dec285551c7e90c5b13877466f54d9e32bd6a Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期四, 31 八月 2023 10:44:01 +0800
Subject: [PATCH] 对色记录 试样记录 删除 审核 查询
---
WebAPI/Controllers/SCGL/日计划管理/JIT_DayPlanPlatFormBillController.cs | 50 +++++++++++++++++++++++++++++++++++++++++---------
1 files changed, 41 insertions(+), 9 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 231d35d..2a7ef44 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"
@@ -300,12 +300,11 @@
{
SumCount += 1;
////淇濆瓨瀛愯〃
-
objJsonResult = AddBillSub(HInterID == 0 ? list[i]["hmainid"].ToString() : HInterID.ToString()
, HBillNo == "" ? list[i]["鍗曟嵁鍙�"].ToString() : HBillNo
, DateTime.Parse(DateTime.Now.AddDays(j).ToString("yyyy-MM-dd").ToString())
- , int.Parse(list[i][DateTime.Now.AddDays(j).ToString("yyyy-MM-dd")].ToString()));
-
+ , int.Parse(list[i][DateTime.Now.AddDays(j).ToString("yyyy-MM-dd")].ToString())
+ , list[i]);
if (objJsonResult.count == 1)
{
TrueCount += 1;
@@ -314,7 +313,7 @@
//涓昏〃鏈夋暟鎹� 瀛愯〃鏃犳暟鎹�
if (j == 30 && SumCount == 0 && HInterID != 0 && HBillNo != "")
{
- objJsonResult = AddBillSub(HInterID.ToString(), HBillNo, DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd").ToString()), 0);
+ objJsonResult = AddBillSub(HInterID.ToString(), HBillNo, DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd").ToString()), 0, list[i]);
}
}
}
@@ -347,11 +346,10 @@
}
}
- public json AddBillSub(string HInterID, string HBillNo, DateTime date, int HQTY)
+ public json AddBillSub(string HInterID, string HBillNo, DateTime date, int HQTY, Dictionary<string, string> dic)
{
//鑾峰彇琛ㄦ牸鏁版嵁
ds = oCN.RunProcReturn($"select * from h_v_JIT_Sc_WorkBillSortBillList where 鍗曟嵁鍙�='{HBillNo}'", "h_v_JIT_Sc_WorkBillSortBillList");
-
int count = 0;
if (ds.Tables[0].Rows.Count > 0)
{
@@ -360,7 +358,7 @@
{
if (DateTime.Parse(ds.Tables[0].Rows[i]["鏃ヨ鍒掔敓浜ф棩鏈�"].ToString()) == date)
{
- oCN.RunProc($"update Sc_WorkBillSortBillSub set HMasterDate='{date}',HQty={HQTY}" +
+ oCN.RunProc($"update Sc_WorkBillSortBillSub set HMasterDate='{date}',HQty={HQTY},HUseTimes={(dic["灏忔椂浜ц兘"]=="0"?0: HQTY / float.Parse(dic["灏忔椂浜ц兘"].ToString()))}" +
$" where HInterID={HInterID} and HEntryID={ds.Tables[0].Rows[i]["hsubid"].ToString()}");
count += 1;
}
@@ -371,9 +369,9 @@
{
//鎻掑叆瀛愯〃
oCN.RunProc("insert into Sc_WorkBillSortBillSub(HInterID,HSEQ," +
- "HMasterDate,HQty)" +
+ "HMasterDate,HQty,HUseTimes)" +
$"values({HInterID}, {(ds.Tables[0].Rows.Count + 1)}," +
- $" '{date}', {HQTY})");
+ $" '{date}', {HQTY},{(dic["灏忔椂浜ц兘"] == "0" ? 0 : HQTY / float.Parse(dic["灏忔椂浜ц兘"].ToString()))})");
}
objJsonResult.code = "1";
@@ -2664,5 +2662,39 @@
}
#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