From 22431386b2f13aa6bd30b9444974e98a3e8d7e01 Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期五, 20 九月 2024 09:50:04 +0800
Subject: [PATCH] 关键件绑定,物料新增编辑,流转卡
---
WebAPI/Controllers/CJGL/Cj_SendGoodsBillController.cs | 109 ++++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 105 insertions(+), 4 deletions(-)
diff --git a/WebAPI/Controllers/CJGL/Cj_SendGoodsBillController.cs b/WebAPI/Controllers/CJGL/Cj_SendGoodsBillController.cs
index 1b98793..a34dd50 100644
--- a/WebAPI/Controllers/CJGL/Cj_SendGoodsBillController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_SendGoodsBillController.cs
@@ -30,6 +30,7 @@
public string MaterialName { get; set; }
public string MaterialModel { get; set; }
public string Arbitrarily { get; set; }
+ public string HBillStatus { get; set; }
public int? HOrgID;
}
@@ -61,10 +62,8 @@
//鍙嶅簭鍒楀寲浼犻�掔殑鍊�
JIT_SendGoodsBill com = JsonConvert.DeserializeObject<JIT_SendGoodsBill>(sWhere.ToString());
- oCN.RunProc($"exec h_p_JIT_DeptCheckGoodsBillList_Query '{com.HBeginDate}','{com.HEndDate.AddDays(1).AddSeconds(-1)}','{com.HBillNo}','{com.HDeptName}'," +
- $"'{com.MaterialCode}','{com.MaterialName}','{com.MaterialModel}','{com.HOrgID}'");
-
- ds = oCN.RunProcReturn("select * from ##h_p_JIT_DeptCheckGoodsBillList_Query where 1=1 " + com.Arbitrarily + "", "##h_p_JIT_DeptCheckGoodsBillList_Query");
+ ds = oCN.RunProcReturn($"exec h_p_JIT_DeptCheckGoodsBillList_Query '{com.HBeginDate}','{com.HEndDate.AddDays(1).AddSeconds(-1)}','{com.HBillNo}','{com.HDeptName}'," +
+ $"'{com.MaterialCode}','{com.MaterialName}','{com.MaterialModel}','{com.HOrgID}','{com.HBillStatus}'", "h_p_JIT_DeptCheckGoodsBillList_Query");
objJsonResult.code = "1";
objJsonResult.count = 1;
@@ -118,5 +117,107 @@
}
}
#endregion
+
+ #region 杞﹂棿鏀舵枡鍒楄〃 鎾ら攢纭鏀舵枡
+ [Route("Cj_SendGoodsBill/DeptCheckGoodsBillList_revoke")]
+ [HttpGet]
+ public object DeptCheckGoodsBillList_revoke(string HInterID, string HEntryID, string User)
+ {
+ try
+ {
+ //鏌ョ湅鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log("JIT_SendGoodsBill_Check", 1, false, User))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犲鏍告潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ oCN.RunProc($"update JIT_SendGoodsBillMain set HChecker='' ,HCheckDate=null,HBillStatus=1 where HInterID='{HInterID}'");
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "宸插畬鎴愭挙閿�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 杞﹂棿鏀舵枡鍒楄〃 鍒犻櫎
+ [Route("Cj_SendGoodsBill/DeleteBill")]
+ [HttpGet]
+ public object DeleteBill(string HInterID,string HEntryID, string User)
+ {
+ try
+ {
+ DataSet dataset = new DataSet();
+ //鑾峰彇杞﹂棿閰嶉�佸崟鎹暟鎹�
+ dataset = oCN.RunProcReturn($"select * from JIT_SendGoodsBillMain a inner join JIT_SendGoodsBillSub b on a.HInterID = b.HInterID where a.HInterID={HInterID} and HEntryID={HEntryID} ", "JIT_SendGoodsBillMain");
+
+ var HQty = double.Parse(dataset.Tables[0].Rows[0]["HQty"].ToString());
+
+ //鑾峰彇鎷f枡閰嶉�佸崟鐨勬暟鎹�
+ ds = oCN.RunProcReturn($"select * from JIT_ComplementGoodsBillMain a inner join JIT_ComplementGoodsBillSub b on a.HInterID = b.HInterID where a.HInterID={(dataset.Tables[0].Rows[0]["HMainSourceInterID"].ToString())} and b.HMaterID={(dataset.Tables[0].Rows[0]["HMaterID"].ToString())} and b.HWHID={(dataset.Tables[0].Rows[0]["HWHID"].ToString())} ", "JIT_ComplementGoodsBillMain");
+
+ //鑾峰彇鎷f枡閰嶉�佸崟_LK琛� 鏁版嵁
+ ds = oCN.RunProcReturn($"select * from JIT_ComplementGoodsBillSub_LK where HInterID={(ds.Tables[0].Rows[0]["HInterID"].ToString())} and HSendQTY<>0 order by HSendQTY", "JIT_SendGoodsBillMain");
+
+ for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
+ {
+ var HSendQTY = double.Parse(ds.Tables[0].Rows[i]["HSendQTY"].ToString());
+
+ //淇敼璋冩嫧鏁伴噺
+ oCN.RunProc($"update JIT_ComplementGoodsBillSub_LK set HSendQTY=HSendQTY-{(HSendQTY > HQty ? HQty : HSendQTY)} where HInterID={ds.Tables[0].Rows[i]["HInterID"].ToString()} and HEntryID={ds.Tables[0].Rows[i]["HEntryID"].ToString()} ");
+
+ HQty -= HSendQTY;
+ if (HQty <= 0)
+ {
+ break;
+ }
+ }
+
+ dataset = oCN.RunProcReturn($"select * from JIT_SendGoodsBillMain a inner join JIT_SendGoodsBillSub b on a.HInterID = b.HInterID where a.HInterID={HInterID} ", "JIT_SendGoodsBillMain");
+
+ //鍒犻櫎鏁版嵁
+ if (dataset.Tables[0].Rows.Count != 1)
+ {
+ oCN.RunProc($"delete from JIT_SendGoodsBillSub where HInterID='{HInterID}' and HEntryID={HEntryID} ");
+ }
+ else
+ {
+
+ oCN.RunProc($"delete from JIT_SendGoodsBillMain where HInterID='{HInterID}'");
+ oCN.RunProc($"delete from JIT_SendGoodsBillSub where HInterID='{HInterID}' and HEntryID={HEntryID} ");
+ }
+
+
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "宸插畬鎴愬垹闄�";
+ objJsonResult.data = null;
+ 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