From 4de907c1acf35bc433ca036e48f5ff3b91090d60 Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期五, 24 五月 2024 14:26:31 +0800
Subject: [PATCH] 1
---
WebAPI/Controllers/SCGL/日计划管理/JIT_Cg_PODemandPlanBillController.cs | 117 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 115 insertions(+), 2 deletions(-)
diff --git "a/WebAPI/Controllers/SCGL/\346\227\245\350\256\241\345\210\222\347\256\241\347\220\206/JIT_Cg_PODemandPlanBillController.cs" "b/WebAPI/Controllers/SCGL/\346\227\245\350\256\241\345\210\222\347\256\241\347\220\206/JIT_Cg_PODemandPlanBillController.cs"
index 9c8ec8e..49ee536 100644
--- "a/WebAPI/Controllers/SCGL/\346\227\245\350\256\241\345\210\222\347\256\241\347\220\206/JIT_Cg_PODemandPlanBillController.cs"
+++ "b/WebAPI/Controllers/SCGL/\346\227\245\350\256\241\345\210\222\347\256\241\347\220\206/JIT_Cg_PODemandPlanBillController.cs"
@@ -7,6 +7,7 @@
using System.Web.Http;
using WebAPI.Models;
using Newtonsoft.Json;
+using DBUtility;
namespace WebAPI.Controllers.SCGL
{
@@ -18,6 +19,7 @@
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
JIT_Cg_PODemandPlanBillMain omdelMian = new JIT_Cg_PODemandPlanBillMain();
List<JIT_Cg_PODemandPlanBillSub> omodelsub = new List<JIT_Cg_PODemandPlanBillSub>();
+ public DAL.ClsSc_ICMOBill BillOld = new DAL.ClsSc_ICMOBill();
#region 鎻愭枡璁″垝鍗� 鍒楄〃
[Route("JIT_Cg_PODemandPlanBill/JIT_Cg_PODemandPlanBillList")]
@@ -260,6 +262,117 @@
}
#endregion
+ #region 鎻愭枡璁″垝鍗� 瀹℃牳/鍙嶅鏍稿姛鑳�
+ [Route("JIT_Cg_PODemandPlanBill/CheckPODemandPlanBillList")]
+ [HttpGet]
+ public object CheckPODemandPlanBillList(string HInterID, int Type, string user)
+ {
+ try
+ {
+ //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄�
+ if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Check", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎻愭枡璁″垝鍗曟棤鏉冮檺瀹℃牳!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+
+ if (string.IsNullOrWhiteSpace(HInterID))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "HInterID涓虹┖锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ ClsPub.CurUserName = user;
+ BillOld.MvarItemKey = "JIT_Cg_PODemandPlanBillMain";
+ oCN.BeginTran();//寮�濮嬩簨鍔�
+
+ //Type 1 瀹℃牳 2 鍙嶅鏍�
+ if (Type == 1)
+ {
+ //鍒ゆ柇鍗曟嵁鏄惁宸茬粡瀹℃牳
+ DataSet ds;
+ string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID;
+ ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey);
+ if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
+ {
+ if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶉渶瑕佸啀瀹℃牳!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ //瀹℃牳鍗曟嵁
+ if (!BillOld.CheckBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ else
+ {
+ //鍒ゆ柇鍗曟嵁鏄惁宸茬粡鍙嶅鏍�
+ DataSet ds;
+ string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID;
+ ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey);
+ if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
+ {
+ if (ds.Tables[0].Rows[0]["HChecker"] == null || ds.Tables[0].Rows[0]["HChecker"].ToString() == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸插弽瀹℃牳!涓嶉渶瑕佸啀鍙嶅鏍�!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ //鍙嶅鏍稿崟鎹�
+ if (BillOld.AbandonCheck(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
+ {
+
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ oCN.Commit();//鎻愪氦浜嬪姟
+
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鎵ц鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult; ;
+
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎵ц澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
#region 鎻愭枡璁″垝鍗� 鍏抽棴
[Route("JIT_Cg_PODemandPlanBill/ClosePODemandPlanBillList")]
[HttpGet]
@@ -433,7 +546,7 @@
#region 鎻愭枡璁″垝鍗� 鎻愭枡璁″垝鎶ヨ〃
[Route("JIT_Cg_PODemandPlanBill/ReportPODemandPlanBillList_S")]
[HttpGet]
- public object ReportPODemandPlanBillList_S(string sWhere, string user)
+ public object ReportPODemandPlanBillList_S(string sWhere, string user,string HBEGINDATE,string HENDDATE)
{
try
{
@@ -447,7 +560,7 @@
return objJsonResult;
}
- ds = oCN.RunProcReturn($"exec h_p_JIT_PODemandPlanBill_S_ReportList '{sWhere.ToString()}' ", "h_p_JIT_PODemandPlanBill_S_ReportList");
+ ds = oCN.RunProcReturn($"exec h_p_JIT_PODemandPlanBill_S_ReportList '{sWhere.ToString()}','{HBEGINDATE}','{HENDDATE}' ", "h_p_JIT_PODemandPlanBill_S_ReportList");
objJsonResult.code = "1";
objJsonResult.count = 1;
--
Gitblit v1.9.1