From 0a34481ece298f7dbefd4f51c4bf8fc785d0c716 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期一, 29 一月 2024 13:59:15 +0800
Subject: [PATCH] 收款单、应收退款单:编辑保存增加保存前/保存后控制
---
WebAPI/Controllers/XSGL/Kf_SellOutBillController.cs | 74 ++++++++++++++++++++++---------------
1 files changed, 44 insertions(+), 30 deletions(-)
diff --git a/WebAPI/Controllers/XSGL/Kf_SellOutBillController.cs b/WebAPI/Controllers/XSGL/Kf_SellOutBillController.cs
index 01a3641..6763b69 100644
--- a/WebAPI/Controllers/XSGL/Kf_SellOutBillController.cs
+++ b/WebAPI/Controllers/XSGL/Kf_SellOutBillController.cs
@@ -276,7 +276,6 @@
string user = sArray[2].ToString();
string OperationType = sArray[3].ToString();
- string UserName = "";
ListModels oListModels = new ListModels();
try
{
@@ -296,19 +295,9 @@
lsmain = oListModels.getSellOutBillMainByJson(msg2);
foreach (Model.ClsKf_SellOutBillMain oItem in lsmain)
{
- //oItem.HMaker = "";
- UserName = oItem.HMaker;
- oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd"));
- oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
- oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));
- oItem.HBillType = "1205";
- oItem.HBillSubType = "1205";
- oItem.HBillStatus = 0;
- oItem.HPeriod = 0;
oItem.HMaker = user;
- oItem.HMainSourceInterID = oItem.HInterID;
+ oItem.HUpDater = user;
- //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo);
if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "")
{
objJsonResult.code = "0";
@@ -324,50 +313,74 @@
msg3 = msg3.Substring(1, msg3.Length - 2);
msg3 = msg3.Replace("\\", "");
msg3 = msg3.Replace("\n", ""); //\n
- //msg2 = msg2.Replace("'", "鈥�");
List<Model.ClsKf_SellOutBillSub> ls = new List<Model.ClsKf_SellOutBillSub>();
ls = oListModels.getSellOutBillSubByJson(msg3);
int i = 0;
foreach (Model.ClsKf_SellOutBillSub oItemSub in ls)
{
i++;
-
oItemSub.HEntryID = i;
- //oItemSub.HSourceEntryID = 0;
- //oItemSub.HSourceInterID = 0;
- //oItemSub.HSourceBillNo = "";
- //oItemSub.HSourceBillType = "";
- oItemSub.HRelationQty = 0;
- oItemSub.HRelationMoney = 0;
-
-
- // DBUtility.ClsPub.isDate(DateTime.Now);
oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
oItemSub.HCloseType = false;
oItemSub.HCloseMan = "";
- //oItemSub.HRemark = "";
oBill.DetailColl.Add(oItemSub);
-
}
//淇濆瓨
//淇濆瓨瀹屾瘯鍚庡鐞�
bool bResult;
- if (Convert.ToInt32(OperationType) == 1)
+ if (Convert.ToInt32(OperationType) == 1) //鏂板淇濆瓨
{
- // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+ bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+ } else if(Convert.ToInt32(OperationType) == 4) //涓嬫帹淇濆瓨
+ {
bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
}
- else
+ else //缂栬緫淇濆瓨
{
+ string s = "";
+ if (BillOld.ShowBill(lsmain[0].HInterID, ref s) == false)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "姝ゅ崟鎹湁璇紒";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ //鍒ゆ柇鏄惁鍙紪杈�
+ if (BillOld.omodel.HChecker != "" && BillOld.omodel.HChecker != null)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "姝ゅ崟鎹凡缁忚瀹℃牳锛屼笉鍏佽淇敼锛�";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ if (BillOld.omodel.HBillStatus > 1)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "姝ゅ崟鎹浜庝笉鍙紪杈戠姸鎬侊紝涓嶅厑璁镐慨鏀癸紒";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ if (!DBUtility.Xt_BaseBillFun.Fun_AllowEditBill(BillOld, ref s))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = s + "锛屼笉鍏佽淇敼";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+
bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
}
+
if (bResult)
{
objJsonResult.code = "0";
objJsonResult.count = 1;
objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
- //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
objJsonResult.data = 1;
return objJsonResult;
}
@@ -398,7 +411,8 @@
{
try
{
- ds = oCN.RunProcReturn("select * from h_v_IF_SellOutBillList where hmainid=" + HInterID, "h_v_IF_SellOutBillList");
+ //ds = oCN.RunProcReturn("select * from h_v_IF_SellOutBillList where hmainid=" + HInterID, "h_v_IF_SellOutBillList");
+ ds = oCN.RunProcReturn("select * from h_v_IF_SellOutBillList_EditInit where hmainid=" + HInterID, "h_v_IF_SellOutBillList_EditInit");
if (ds == null || ds.Tables[0].Rows.Count == 0)
{
objJsonResult.code = "0";
--
Gitblit v1.9.1