From 4f23c4da3c004c530fda95bf21294b786918f12b Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期五, 28 七月 2023 18:06:40 +0800
Subject: [PATCH] 工资计算模块
---
WebAPI/Controllers/Sc_ProcessMangementController.cs | 161 +++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 149 insertions(+), 12 deletions(-)
diff --git a/WebAPI/Controllers/Sc_ProcessMangementController.cs b/WebAPI/Controllers/Sc_ProcessMangementController.cs
index 2d82cff..26f021c 100644
--- a/WebAPI/Controllers/Sc_ProcessMangementController.cs
+++ b/WebAPI/Controllers/Sc_ProcessMangementController.cs
@@ -21,7 +21,7 @@
private json objJsonResult = new json();
Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
-
+ public DAL.ClsSc_ICMOBill BillOld = new DAL.ClsSc_ICMOBill();
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
DataSet ds;
@@ -686,6 +686,16 @@
//
//DataSet ds1 = oCN.RunProcReturn("select * from h_v_TOERPProcduct_LastProc where HLastProc = '鏄�' and hbillno='" + BillNo.ToString() + "'", "h_v_TOERPProcduct_LastProc");
DataSet ds1 = oCN.RunProcReturn("exec h_p_TOERPProcduct_LastProc '" + BillNo + "'", "h_p_TOERPProcduct_LastProc");
+
+ if (ds1 == null || ds1.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏈壘鍒板搴旂殑鏈湴鎴栭噾铦朵簯鐢熶骇姹囨姤鍗曡褰�;1.鏈煡璇㈠埌瀵瑰簲鐨勭敓浜ф眹鎶ュ崟锛�2.璇风‘淇濆綋鍓嶅伐搴忔槸鏈亾宸ュ簭3.姹囨姤鍗曞搴旂殑鍏ュ簱鏁伴噺宸叉弧 璇峰湪閲戣澏浜戞煡鐪嬪叆搴撹褰曪紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
DataRow dr1 = ds1.Tables[0].Rows[0];
if (double.Parse(dr1[0].ToString()) <= 0)
{
@@ -702,23 +712,40 @@
{
if (oSystemParameter.omodel.WMS_CampanyName == "鐟炰笌绁�")
{
+
+ //鍒ゆ柇閲戣澏浜戞槸鍚﹀凡缁忔湁鍏ュ簱鐨勬暟鎹�
+ ds = oCN.RunProcReturn($@"select * from AIS20220308151944..T_PRD_INSTOCK where FBILLNO='{BillNo}'", "T_PRD_INSTOCK");
+
+ if (ds.Tables[0].Rows.Count > 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "褰撳墠鍑虹珯鍗曞彿宸插叆搴�,璇蜂笉瑕侀噸鏂板叆搴�!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
//鍒ゆ柇閲戣澏浜戠敓浜ф眹鎶ュ崟 鏁伴噺 鏄惁 澶т簬 鏈亾鍑虹珯鏁伴噺
- ds = oCN.RunProcReturn($@"select sum(FFinishQty)-(select HQty from Sc_StationOutBillMain where HBillNo='{BillNo}')
+ ds = oCN.RunProcReturn($@"select sum(FFinishQty)-sum(FSTOCKINQUASELQTY)-(select HQty from Sc_StationOutBillMain where HBillNo='{BillNo}')
from AIS20220308151944..T_PRD_MORPT rpt3
left join AIS20220308151944..T_PRD_MORPTENTRY rpt2 on rpt3.FID = rpt2.FID
+ left join AIS20220308151944..T_PRD_MORPTENTRY_A rpt1 on rpt2.FID = rpt1.FID
where F_bsv_Text=(select HProcExchBillNo from Sc_StationOutBillMain where HBillNo='{BillNo}')", "SumCount");
+
+ if (double.Parse(ds.Tables[0].Rows[0][0].ToString()) < 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "閲戣澏浜戞眹鎶ユ暟閲忓皬浜庢湰鍦板嚭绔欐暟閲�!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
}
}
- if (double.Parse(ds.Tables[0].Rows[0][0].ToString()) < 0) {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "閲戣澏浜戞眹鎶ユ暟閲忓皬浜庢湰鍦板嚭绔欐暟閲�!";
- objJsonResult.data = null;
- return objJsonResult;
- }
+
JObject model = new JObject();
@@ -1048,7 +1075,7 @@
FentityModel.Add("FSrcInterId", item["HSourceInterID"].ToString());//
FentityModel.Add("FBasePrdRealQty", item["鏁伴噺"].ToString());//
FentityModel.Add("FIsFinished", "false");//
- FentityModel.Add("FStockStatusId", new JObject() { ["FNumber"] = "KCZT08_SYS" }); //
+ FentityModel.Add("FStockStatusId", new JObject() { ["FNumber"] = "KCZT001" }); //
FentityModel.Add("FSrcEntrySeq", item["HSourceSeQ"].ToString());// 婧愬崟鍒嗗綍琛屽彿
FentityModel.Add("FMOMAINENTRYID", item["HMOEntryID"].ToString());//
FentityModel.Add("FKeeperTypeId", "BD_KeeperOrg");
@@ -1188,7 +1215,7 @@
Int64 HSourceEntryID, string HSourceBillNo, string user,
Int64 HWHID, Int64 HSPID, Int64 HSupID, Int64 HKeeperID,
Int64 HMaterID, string HSourceBillType, Int64 HSLInterID,
- Int64 HSLEntryID, string HSLBillNo, Int64 HSLSeQ, string HBillNo, Int64 HInterID)
+ Int64 HSLEntryID, string HSLBillNo, Int64 HSLSeQ, string HBillNo, Int64 HInterID, string HBatchNo)
{
try
{
@@ -1283,6 +1310,7 @@
FentityModel.Add("FBaseAcceptQty", HRightQty.ToString());//鍩烘湰鍗曚綅鎺ユ敹鏁�
FentityModel.Add("FCurrency", new JObject() { ["Fnumber"] = "PRE001" });//甯佸埆
FentityModel.Add("FIsSplitRow ", false);// 鏄惁鎷嗗垎琛�
+ FentityModel.Add("FLot", new JObject() { ["Fnumber"] = HBatchNo.ToString() });//鎵瑰彿
JArray Fentity2 = new JArray();
JObject FentityModel2 = new JObject();
@@ -1418,7 +1446,7 @@
return objJsonResult;
}
}
-
+
@@ -2973,6 +3001,115 @@
}
#endregion
+
+ #region 涓嶈壇鍝佸鐞嗗崟鍏抽棴/鍙嶅叧闂姛鑳�
+ [Route("Sc_ProcessMangement/CloseSc_ProcessMangement")]
+ [HttpGet]
+ public object CloseSc_ProcessMangement(string HInterID, int Type, string user)
+ {
+ try
+ {
+ //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄�
+ if (!DBUtility.ClsPub.Security_Log("QC_NoPassProdCheckBill_Close", 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 = "QC_NoPassProdCheckBillMain";
+ 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]["HCloseMan"] != null && ds.Tables[0].Rows[0]["HCloseMan"].ToString() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸插叧闂�!涓嶉渶瑕佸啀鍏抽棴!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ //鍏抽棴鍗曟嵁
+ if (!BillOld.CloseBill(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]["HCloseMan"] == null || ds.Tables[0].Rows[0]["HCloseMan"].ToString() == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸插弽鍏抽棴!涓嶉渶瑕佸啀鍙嶅叧闂�!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ //鍙嶅叧闂崟鎹�
+ if (!BillOld.CancelClose(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
+ {
+ 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
+
+
+
/// <summary>
/// PDA宸ュ簭姹囨姤鍗曚繚瀛�
/// </summary>
--
Gitblit v1.9.1