From 6428622684b73f474eacd95cbaff5b613d3687fe Mon Sep 17 00:00:00 2001
From: zrg <z1873@LAPTOP-EAVL132E>
Date: 星期一, 09 三月 2026 22:52:27 +0800
Subject: [PATCH] 优化模具寿命趋势入 解决模具保养记录编辑报错,优化华舟检验单扫码获取方法
---
WebAPI/Controllers/Sc_MouldRepairInBillListController.cs | 530 ++++++++++++++++++++++++++++++++++++++++++++++++----------
1 files changed, 438 insertions(+), 92 deletions(-)
diff --git a/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs b/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
index e21742b..f19046f 100644
--- a/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
+++ b/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
@@ -768,15 +768,15 @@
{
try
{
-
Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere);
-
string HBeginDate = dic["HBeginDate"].ToString();//寮�濮嬫棩鏈�
string HEndDate = dic["HEndDate"].ToString();//缁撴潫鏃ユ湡
string HMouldNo = dic["HMouldNo"].ToString();//妯″叿缂栫爜
string HName = dic["HName"].ToString();//妯″叿鍚嶇О
- ds = oCN.RunProcReturn("exec h_P_Sc_MouldLifeUsePicReport '" + HBeginDate + "'," + HEndDate + ",'" + HMouldNo + "','" + HName + "'", "h_P_Sc_MouldLifeUsePicReport");
+ LogService.Write("exec h_P_Sc_MouldLifeUsePicReport '" + HBeginDate + "','" + HEndDate + "','" + HMouldNo + "','" + HName + "'");
+
+ ds = oCN.RunProcReturn("exec h_P_Sc_MouldLifeUsePicReport '" + HBeginDate + "','" + HEndDate + "','" + HMouldNo + "','" + HName + "'", "h_P_Sc_MouldLifeUsePicReport");
List<object> columnNameList = new List<object>();
//娣诲姞鍒楀悕
foreach (DataColumn col in ds.Tables[0].Columns)
@@ -791,7 +791,6 @@
objJsonResult.data = ds.Tables[0];
objJsonResult.list = columnNameList;
return objJsonResult;
- //}
}
catch (Exception e)
{
@@ -6058,6 +6057,7 @@
ListModels oListModels = new ListModels();
try
{
+ string sErrMsg = "";
if (!DBUtility.ClsPub.Security_Log("Sc_MouldConkBookBill_Edit", 1, false, msg4))
{
objJsonResult.code = "0";
@@ -6083,6 +6083,17 @@
//oItem.HInnerBillNo = ""; // --鍐呴儴鍗曟嵁鍙�
oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd"));
+ if(oSystemParameter.ShowBill(ref sErrMsg) == true)
+ {
+ // if(oSystemParameter.omodel.WMS_CampanyName == "鍗庤垷")
+ // {
+ // oItem.HRepairManID = oItem.HEmpID;
+ // }else
+ // {
+ oItem.HRepairManID = 0;
+ // }
+ }
+
if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "")
{
objJsonResult.code = "0";
@@ -6290,19 +6301,20 @@
//==================================================================================
bool IsDete = oBill.DeleteBill(lngBillKey, oBill.omodel.HBillNo, "h_p_Sc_MouldConkBookBill_AfterDelCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo);
- if (IsDete)
+
+ var oDelDs = oCn.RunProcReturn($"exec h_p_Sc_MouldConkBookBill_AfterDelCtrl {lngBillKey},{oBill.omodel.HBillNo}, {user}, {oBill.omodel.HMouldID}", "h_p_Sc_MouldConkBookBill_AfterDelCtrl");
+ if (!IsDete || oDelDs == null)
{
objJsonResult.code = "0";
- objJsonResult.count = 1;
+ objJsonResult.count = 0;
objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;
objJsonResult.data = null;
return objJsonResult;
}
else
{
-
objJsonResult.code = "0";
- objJsonResult.count = 0;
+ objJsonResult.count = 1;
objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;
objJsonResult.data = null;
return objJsonResult;
@@ -7522,22 +7534,10 @@
oItem.HBillType = "3819";
oItem.HBillSubType = "3819";
- //oItem.HInterID =0;
- //oItem.HBillNo = "";
oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --鏃ユ湡
oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
- //oItem.HMakeDate = "";
- //oItem.HYear = "";
- //oItem.HPeriod = "";
- //oItem.HRemark = "";
- //oItem.HCycleUnit = "";
- //oItem.HCheckCycle = "";
- //oItem.HBeginDate = "";
- //oItem.HEndDate = "";
- //oItem.HInnerBillNo = "";
- //oItem.HExplanation = "";
- //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo);
+
if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "")
{
objJsonResult.code = "0";
@@ -7580,7 +7580,6 @@
bool bResult;
if (oBill.omodel.HInterID == 0)
{
- // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
}
else
@@ -7592,7 +7591,121 @@
objJsonResult.code = "0";
objJsonResult.count = 1;
objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
- //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo;
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString();
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 妯″叿淇濆吇璁板綍琛� 淇濆瓨/缂栬緫APP
+ /// <summary>
+ /// 淇濆瓨妯″叿缁翠慨鍗�
+ /// </summary>
+ /// <param name="msg"></param>
+ /// <returns></returns>
+ [Route("Sc_MouldMaintainBill/SaveGetMouldMaintainBillListAPP")]
+ [HttpPost]
+ public object SaveGetMouldMaintainBillListAPP([FromBody] JObject msg)
+ {
+ var _value = msg["msg"].ToString();
+ string msg1 = _value.ToString();
+ string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+ string msg2 = sArray[0].ToString();
+ string msg3 = sArray[1].ToString();
+ string msg5 = sArray[2].ToString();
+
+ string UserName = "";
+ ListModels oListModels = new ListModels();
+ try
+ {
+ if (!DBUtility.ClsPub.Security_Log("Sc_MouldMaintainBill_Edit", 1, false, msg5))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ DAL.ClsSc_MouldMaintainBill oBill = new DAL.ClsSc_MouldMaintainBill();
+ List<Model.ClsSc_MouldMaintainBillMain> lsmain = new List<Model.ClsSc_MouldMaintainBillMain>();
+ msg2 = msg2.Replace("\\", "");
+ msg2 = msg2.Replace("\n", ""); //\n
+ lsmain = oListModels.getObjectByJson_Sc_MouldMaintainBillMain(msg2);
+ foreach (Model.ClsSc_MouldMaintainBillMain oItem in lsmain)
+ {
+ UserName = oItem.HMaker; //鍒跺崟浜�
+ DBUtility.ClsPub.CurUserName = UserName;
+ oItem.HBillType = "3819";
+ oItem.HBillSubType = "3819";
+
+ oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --鏃ユ湡
+ oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
+
+
+ if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佹病鏈夊崟鎹棩鏈燂紝鏃犳硶淇濆瓨锛�";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ oBill.omodel = oItem;
+ }
+ //淇濆吇椤硅〃浣撴暟鎹�
+ //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆�
+ msg3 = msg3.Substring(1, msg3.Length - 2);
+ msg3 = msg3.Replace("\\", "");
+ msg3 = msg3.Replace("\n", ""); //\n
+ List<Model.ClsSc_MouldMaintainRuleBillSub_Item> ls = new List<Model.ClsSc_MouldMaintainRuleBillSub_Item>();
+ ls = oListModels.getObjectByJson_Sc_MouldMaintainRuleBillSub_Item(msg3);
+ int i = 0;
+ foreach (Model.ClsSc_MouldMaintainRuleBillSub_Item oItemSub in ls)
+ {
+
+ i++;
+ oItemSub.HEntryID = i;
+ oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
+ oItemSub.HSourceInterID = 0; // 婧愬崟涓诲唴鐮�
+ oItemSub.HSourceEntryID = 0; //婧愬崟瀛愬唴鐮�
+ oBill.DetailCol.Add(oItemSub);
+
+ }
+
+ //淇濆瓨
+ //淇濆瓨瀹屾瘯鍚庡鐞�
+ bool bResult;
+ if (oBill.omodel.HInterID == 0)
+ {
+ bResult = oBill.AddBill_APP(ref DBUtility.ClsPub.sExeReturnInfo);
+ }
+ else
+ {
+ bResult = oBill.ModifyBill_APP(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+ }
+ if (bResult)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
objJsonResult.data = 1;
return objJsonResult;
}
@@ -8257,7 +8370,6 @@
string msg2 = sArray[0].ToString();
string msg3 = sArray[1].ToString();
string msg4 = sArray[2].ToString();
- //string msg5 = sArray[3].ToString();
string UserName = "";
ListModels oListModels = new ListModels();
@@ -8279,28 +8391,14 @@
lsmain = oListModels.getObjectByJson_Sc_MouldDotCheckBillMain(msg2);
foreach (Model.ClsSc_MouldDotCheckBillMain oItem in lsmain)
{
- //oItem.HMaker = "";
UserName = oItem.HMaker; //鍒跺崟浜�
oItem.HMaker = msg4;
oItem.HBillType = "3821";
oItem.HBillSubType = "3821";
- //oItem.HInterID =0;
- //oItem.HBillNo = "";
oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --鏃ユ湡
oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
- //oItem.HMakeDate = "";
- //oItem.HYear = "";
- //oItem.HPeriod = "";
- //oItem.HRemark = "";
- //oItem.HCycleUnit = "";
- //oItem.HCheckCycle = "";
- //oItem.HBeginDate = "";
- //oItem.HEndDate = "";
- //oItem.HInnerBillNo = "";
- //oItem.HExplanation = "";
- //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo);
if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "")
{
objJsonResult.code = "0";
@@ -8316,7 +8414,6 @@
msg3 = msg3.Substring(1, msg3.Length - 2);
msg3 = msg3.Replace("\\", "");
msg3 = msg3.Replace("\n", ""); //\n
- //msg2 = msg2.Replace("'", "鈥�");
List<Model.ClsSc_MouldDotCheckBillSub> ls = new List<Model.ClsSc_MouldDotCheckBillSub>();
ls = oListModels.getObjectByJson_Sc_MouldDotCheckBillSub(msg3);
int i = 0;
@@ -8325,57 +8422,26 @@
i++;
oItemSub.HEntryID = i;
- //oItemSub.HCloseMan = ""; //琛屽叧闂�
+
oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
oItemSub.HCloseType = false; //鍏抽棴绫诲瀷
- //oItemSub.HRemark = ""; //澶囨敞
+
oItemSub.HSourceInterID = 0; // 婧愬崟涓诲唴鐮�
oItemSub.HSourceEntryID = 0; //婧愬崟瀛愬唴鐮�
- //oItemSub.HSourceBillNo = ""; //婧愬崟鍗曞彿
- //oItemSub.HSourceBillType = ""; //婧愬崟绫诲瀷
+
oItemSub.HRelationQty = 0; //鍏宠仈鏁伴噺
- //oItemSub.HRelationMoney = 0; //鍏宠仈閲戦
- //HMaterID = "";//閰嶄欢浠g爜
- //HUnitID = "";//鍗曚綅浠g爜
- //HQty = "";//瀹為檯鐢ㄩ噺
- //HQtyMust = "";//鍗曚綅鐢ㄩ噺
- //HRemark = "";//澶囨敞
+
oBill.DetailColl.Add(oItemSub);
}
- ////閰嶄欢椤硅〃浣撴暟鎹�
- ////鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆�
- //msg5 = msg5.Substring(1, msg5.Length - 2);
- //msg5 = msg5.Replace("\\", "");
- //msg5 = msg5.Replace("\n", ""); //\n
- // //msg2 = msg2.Replace("'", "鈥�");
- //List<Model.ClsSc_MouldDotCheckBillSub_Item> ls1 = new List<Model.ClsSc_MouldDotCheckBillSub_Item>();
- //ls1 = oListModels.getObjectByJson_Sc_MouldDotCheckBillSub_Item(msg5);
- //int j = 0;
- //foreach (Model.ClsSc_MouldDotCheckBillSub_Item oItemSub in ls1)
- //{
-
- // j++;
- // oItemSub.HEntryID = j;
- // //oItemSub.HCloseMan = ""; //琛屽叧闂�
- // oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
- // oItemSub.HCloseType = false; //鍏抽棴绫诲瀷
-
- // oItemSub.HSourceInterID = 0; // 婧愬崟涓诲唴鐮�
- // oItemSub.HSourceEntryID = 0; //婧愬崟瀛愬唴鐮�
-
- // oItemSub.HRelationQty = 0; //鍏宠仈鏁伴噺
- // oBill.DetailCol.Add(oItemSub);
- //}
//淇濆瓨
//淇濆瓨瀹屾瘯鍚庡鐞�
bool bResult;
if (oBill.omodel.HInterID == 0)
{
- // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
}
else
@@ -8387,7 +8453,128 @@
objJsonResult.code = "0";
objJsonResult.count = 1;
objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
- //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo;
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString();
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 妯″叿鐐规璁板綍琛� 淇濆瓨/缂栬緫APP
+ /// <summary>
+ /// 淇濆瓨妯″叿缁翠慨鍗�
+ /// </summary>
+ /// <param name="msg"></param>
+ /// <returns></returns>
+ [Route("Sc_MouldDotCheckBill/SaveGetMouldDotCheckBillListAPP")]
+ [HttpPost]
+ public object SaveGetMouldDotCheckBillListAPP([FromBody] JObject msg)
+ {
+ var _value = msg["msg"].ToString();
+ string msg1 = _value.ToString();
+ string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+ string msg2 = sArray[0].ToString();
+ string msg3 = sArray[1].ToString();
+ string msg4 = sArray[2].ToString();
+
+ string UserName = "";
+ ListModels oListModels = new ListModels();
+ try
+ {
+ if (!DBUtility.ClsPub.Security_Log("Sc_MouldDotCheckBill_Edit", 1, false, msg4))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ DAL.ClsSc_MouldDotCheckBill oBill = new DAL.ClsSc_MouldDotCheckBill();
+ List<Model.ClsSc_MouldDotCheckBillMain> lsmain = new List<Model.ClsSc_MouldDotCheckBillMain>();
+ msg2 = msg2.Replace("\\", "");
+ msg2 = msg2.Replace("\n", ""); //\n
+ lsmain = oListModels.getObjectByJson_Sc_MouldDotCheckBillMain(msg2);
+ foreach (Model.ClsSc_MouldDotCheckBillMain oItem in lsmain)
+ {
+ UserName = oItem.HMaker; //鍒跺崟浜�
+ oItem.HMaker = msg4;
+ oItem.HBillType = "3821";
+ oItem.HBillSubType = "3821";
+
+ oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --鏃ユ湡
+ oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
+
+ if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佹病鏈夊崟鎹棩鏈燂紝鏃犳硶淇濆瓨锛�";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ oBill.omodel = oItem;
+ }
+ //琛ㄤ綋鏁版嵁
+ //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆�
+ msg3 = msg3.Substring(1, msg3.Length - 2);
+ msg3 = msg3.Replace("\\", "");
+ msg3 = msg3.Replace("\n", ""); //\n
+ List<Model.ClsSc_MouldDotCheckBillSub> ls = new List<Model.ClsSc_MouldDotCheckBillSub>();
+ ls = oListModels.getObjectByJson_Sc_MouldDotCheckBillSub(msg3);
+ int i = 0;
+ foreach (Model.ClsSc_MouldDotCheckBillSub oItemSub in ls)
+ {
+
+ i++;
+ oItemSub.HEntryID = i;
+
+ oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
+ oItemSub.HCloseType = false; //鍏抽棴绫诲瀷
+
+ oItemSub.HSourceInterID = 0; // 婧愬崟涓诲唴鐮�
+ oItemSub.HSourceEntryID = 0; //婧愬崟瀛愬唴鐮�
+
+ oItemSub.HRelationQty = 0; //鍏宠仈鏁伴噺
+
+
+ oBill.DetailColl.Add(oItemSub);
+
+ }
+
+
+ //淇濆瓨
+ //淇濆瓨瀹屾瘯鍚庡鐞�
+ bool bResult;
+ if (oBill.omodel.HInterID == 0)
+ {
+ bResult = oBill.AddBill_APP(ref DBUtility.ClsPub.sExeReturnInfo);
+ }
+ else
+ {
+ bResult = oBill.ModifyBill_APP(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+ }
+ if (bResult)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
objJsonResult.data = 1;
return objJsonResult;
}
@@ -8448,7 +8635,7 @@
list.Add(ds.Tables[0]);
list.Add(ds1.Tables[0]);
- objJsonResult.code = "0";
+ objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
objJsonResult.data = ds.Tables[0];
@@ -8997,7 +9184,7 @@
return objJsonResult;
}
#endregion
-
+
#endregion
#region 妯″叿鐐规璁″垝琛�
@@ -9288,6 +9475,7 @@
public object CheckSc_MouldDotCheckPlanBill(string HInterID, int Type, string user)
{
DAL.ClsSc_MouldDotCheckPlanBill BillOld = new DAL.ClsSc_MouldDotCheckPlanBill();
+ oCN.BeginTran();//寮�濮嬩簨鍔�
try
{
//鍒ゆ柇鏄惁鏈夊鏍告潈闄�
@@ -9297,6 +9485,7 @@
objJsonResult.count = 0;
objJsonResult.Message = "鏃犳潈闄愬鏍�!";
objJsonResult.data = null;
+ oCN.RollBack();
return objJsonResult;
}
@@ -9306,11 +9495,11 @@
objJsonResult.count = 0;
objJsonResult.Message = "HInterID涓虹┖锛�";
objJsonResult.data = null;
+ oCN.RollBack();
return objJsonResult;
}
ClsPub.CurUserName = user;
- oCN.BeginTran();//寮�濮嬩簨鍔�
//鏌ョ湅鏄惁宸插鏍�,鍏抽棴,浣滃簾
if (BillOld.ShowBill(Convert.ToInt32(HInterID), ref DBUtility.ClsPub.sExeReturnInfo))
@@ -9321,6 +9510,7 @@
objJsonResult.count = 0;
objJsonResult.Message = "鍗曟嵁宸插叧闂�!涓嶈兘鍐嶆瀹℃牳锛�";
objJsonResult.data = null;
+ oCN.RollBack();
return objJsonResult;
}
if (BillOld.omodel.HDeleteMan.Trim() != "")
@@ -9329,6 +9519,7 @@
objJsonResult.count = 0;
objJsonResult.Message = "鍗曟嵁宸蹭綔搴�!涓嶈兘鍐嶆瀹℃牳锛�";
objJsonResult.data = null;
+ oCN.RollBack();
return objJsonResult;
}
if (Type == 1) //瀹℃牳鍒ゆ柇
@@ -9339,6 +9530,7 @@
objJsonResult.count = 0;
objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘鍐嶆瀹℃牳锛�";
objJsonResult.data = null;
+ oCN.RollBack();
return objJsonResult;
}
}
@@ -9350,6 +9542,7 @@
objJsonResult.count = 0;
objJsonResult.Message = "鍗曟嵁鏈鏍�!涓嶉渶瑕佸弽瀹℃牳!";
objJsonResult.data = null;
+ oCN.RollBack();
return objJsonResult;
}
}
@@ -9360,6 +9553,7 @@
objJsonResult.count = 0;
objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
objJsonResult.data = null;
+ oCN.RollBack();
return objJsonResult;
}
@@ -9372,7 +9566,7 @@
if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
{
objJsonResult.code = "0";
- objJsonResult.count = 1;
+ objJsonResult.count = 0;
objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:瀹℃牳鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
objJsonResult.data = null;
oCN.RollBack();
@@ -9382,7 +9576,7 @@
if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
{
objJsonResult.code = "0";
- objJsonResult.count = 1;
+ objJsonResult.count = 0;
objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
objJsonResult.data = null;
oCN.RollBack();
@@ -9393,14 +9587,12 @@
if (!BillOld.CheckBill(int.Parse(HInterID), BillOld.omodel.HBillNo, "h_p_Sc_MouldDotCheckPlanBill_AfterCheckCtrl", user, ref ClsPub.sExeReturnInfo))
{
objJsonResult.code = "0";
- objJsonResult.count = 1;
+ objJsonResult.count = 0;
objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo;
objJsonResult.data = null;
+ oCN.RollBack();
return objJsonResult;
}
-
- //鑷姩鐢熸垚鐐规璁″垝鍗�
- oCN.RunProc("exec h_p_Sc_MouldDotCheckPlan_Auto " + HInterID);
}
else
{
@@ -9410,18 +9602,20 @@
if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
{
objJsonResult.code = "0";
- objJsonResult.count = 1;
+ objJsonResult.count = 0;
objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:鍙嶅鏍稿墠鍒ゆ柇澶辫触锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�";
objJsonResult.data = null;
+ oCN.RollBack();
return objJsonResult;
}
if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
{
objJsonResult.code = "0";
- objJsonResult.count = 1;
+ objJsonResult.count = 0;
objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
objJsonResult.data = null;
+ oCN.RollBack();
return objJsonResult;
}
//===========================================================
@@ -9429,14 +9623,20 @@
if (!BillOld.AbandonCheck(int.Parse(HInterID), BillOld.omodel.HBillNo, "h_p_Sc_MouldDotCheckPlanBill_AfterUnCheckCtrl", user, ref ClsPub.sExeReturnInfo))
{
objJsonResult.code = "0";
- objJsonResult.count = 1;
+ objJsonResult.count = 0;
objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo;
objJsonResult.data = null;
+ oCN.RollBack();
return objJsonResult;
}
}
oCN.Commit();//鎻愪氦浜嬪姟
+ if (Type == 1)
+ {
+ // 鍦ㄦ彁浜や簨鍔″悗鍐嶅皾璇曠敓鎴愬櫒鍏风偣妫�璁″垝鍗� 棰勯槻姝婚攣
+ oCN.RunProc("exec h_p_Sc_MouldDotCheckPlan_Auto " + HInterID);
+ }
objJsonResult.code = "0";
objJsonResult.count = 1;
@@ -9447,6 +9647,7 @@
}
catch (Exception e)
{
+ oCN.RollBack();
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "鎵ц澶辫触锛�" + e.ToString();
@@ -10381,13 +10582,14 @@
return objJsonResult;
}
- sWhere = sWhere.Replace("'", "''");
+
if (sWhere == null || sWhere.Equals(""))
{
ds = oCN.RunProcReturn("exec h_p_Sc_MouldScrapOutHouseBillList " + page + "," + size + ",''", "h_p_Sc_MouldScrapOutHouseBillList");
}
else
- {
+ {
+ sWhere = sWhere.Replace("'", "''");
ds = oCN.RunProcReturn("exec h_p_Sc_MouldScrapOutHouseBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_Sc_MouldScrapOutHouseBillList");
}
@@ -10651,7 +10853,7 @@
public object SaveGetMouldScrapOutHouseBillList([FromBody] JObject msg)
{
DAL.ClsSc_MouldScrapOutBill oBill = new DAL.ClsSc_MouldScrapOutBill();
-
+ oCn.BeginTran();
var _value = msg["msg"].ToString();
string msg1 = _value.ToString();
string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
@@ -10663,6 +10865,7 @@
//缂栬緫鏉冮檺
if (!DBUtility.ClsPub.Security_Log("Sc_MouldScrapOutBill_Edit", 1, false, HMaker))
{
+ oCn.RollBack();
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡鏂板/缂栬緫鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒";
@@ -10687,6 +10890,7 @@
//鍗曟嵁鍙锋槸鍚﹂噸澶�
if (oBill.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, oItem.HInterID))
{
+ oCn.RollBack();
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "鍗曟嵁鍙烽噸澶嶏紒涓嶅厑璁镐繚瀛橈紒";
@@ -10699,6 +10903,7 @@
int sPeriod = 0;
if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(oItem.HDate, ref sYear, ref sPeriod, ref s) == false)
{
+ oCn.RollBack();
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = s;
@@ -10734,7 +10939,31 @@
//淇濆瓨
if (oBill.omodel.HInterID == 0) //鏂板淇濆瓨
{
- bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+
+ if (oSystemParameter.omodel.WMS_CampanyName == "娴疯瘹")
+ {
+
+ bResult = oBill.AddBillWithWebs(ref DBUtility.ClsPub.sExeReturnInfo, oCn);
+
+ if (bResult)
+ {
+ if (!setOutBill(msg,oBill.omodel.HInterID, ref DBUtility.ClsPub.sErrInfo))
+ {
+ oCn.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "閲戣澏鍗曟嵁淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sErrInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ }
+ else
+ {
+ bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+ }
+
+
if (oSystemParameter.omodel.WMS_CampanyName == "鍥涚淮灏�") //绯荤粺鍙傛暟 瀹㈡埛瀹氬埗鍖栧悕绉� 绌虹櫧涓洪�氱敤
{
@@ -10757,6 +10986,7 @@
}
else
{
+ oCn.RollBack();
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg;
@@ -10766,14 +10996,18 @@
if (bResult)
{
- objJsonResult.code = "0";
+ oCn.Commit();
+ objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; //鎴愬姛锛�
objJsonResult.data = null;
return objJsonResult;
+
+
}
else
{
+ oCn.RollBack();
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo;
@@ -10783,6 +11017,7 @@
}
catch (Exception e)
{
+ oCn.RollBack();
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.Message;
@@ -10790,6 +11025,63 @@
return objJsonResult;
}
}
+
+ public bool setOutBill([FromBody] JObject msg,long HInterID,ref string sErrInfo)
+ {
+ var _value = msg["msg"].ToString();
+ string msg1 = _value.ToString();
+ string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+ string sMainStr = sArray[0].ToString(); //涓昏〃鏁版嵁
+ string sSubStr = sArray[1].ToString(); //瀛愯〃鏁版嵁
+ string HMaker = sArray[2].ToString(); //鍒跺崟浜�
+ try
+ {
+ //List<Model.ClsKf_OtherOutBillMain> lsmain = new List<Model.ClsKf_OtherOutBillMain>();
+ ListModels oListModels = new ListModels();
+ sMainStr = sMainStr.Replace("\\", "");
+ sMainStr = sMainStr.Replace("\n", "");
+ sMainStr = "[" + sMainStr.ToString() + "]";
+ //lsmain = oListModels.getOtherOutBillMainByJson(sMainStr);
+ List<Model.ClsSc_MouldStockBillMain> lsmain = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldStockBillMain>>(sMainStr);
+ //lsmain[0].HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
+ //lsmain[0].HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));
+ string sSourceBillType = "3832";
+
+ WebAPI.WebS.ClsKf_OtherOutBillMain websLsmain = new WebS.ClsKf_OtherOutBillMain();
+ websLsmain.HInterID = HInterID;
+ websLsmain.HDate = lsmain[0].HDate;
+ websLsmain.HBillNo = lsmain[0].HBillNo;
+ websLsmain.HSupID = lsmain[0].HSupID;
+ websLsmain.HDeptID = lsmain[0].HDeptID;
+ websLsmain.HEmpID = lsmain[0].HKeeperID;
+ websLsmain.HKeeperID = lsmain[0].HKeeperID;
+ websLsmain.HSecManagerID = lsmain[0].HSecManagerID;
+ websLsmain.HRemark = lsmain[0].HRemark??"test";
+ websLsmain.HMaker = lsmain[0].HMaker;
+ websLsmain.HBillerID = 0;
+ websLsmain.HSTOCKORGID = 100038;
+ websLsmain.HOWNERID = 100038;
+ websLsmain.HBillType = "1206";//鍥哄畾鍊�
+ websLsmain.HBillSubType = "test";
+ WebS.WebService1 oWebs = new WebS.WebService1();
+ WebS.ClsXt_SystemParameterMain oSystemParameterMain = new WebS.ClsXt_SystemParameterMain();
+ if (oWebs.set_SaveOtherOutBill_New_haicheng(websLsmain, sSourceBillType, ref DBUtility.ClsPub.sErrInfo))
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+
+ }
+ catch (Exception e)
+ {
+ DBUtility.ClsPub.sErrInfo = "涓婁紶澶辫触锛�" + e.ToString();
+ return false;
+ }
+ }
+
#endregion
#region [妯″叿澶勭悊鍑哄簱鍗曞垹闄ゅ姛鑳絔
@@ -15866,6 +16158,60 @@
#endregion
+ #region 鍣ㄥ叿澶勭悊鍑哄簱鍗� 杩斿洖婧愬崟鏁版嵁
+ /// <summary>
+ /// 杩斿洖婧愬崟鏁版嵁
+ /// </summary>
+ /// <returns></returns>
+ [Route("Sc_MouldScrapOutHouseBill/GetSourceBill_MouldScrapOutHouse_Json")]
+ [HttpGet]
+ public object GetSourceBill_MouldScrapOutHouse_Json(Int64 HInterID, Int64 HEntryID, string HBillType)
+ {
+ try
+ {
+ string sViewName = "";
+ //鍣ㄥ叿棰嗙敤鐢宠鍗�
+ if (HBillType == "3823")
+ {
+ sViewName = "h_v_Sc_MouldScrapRequestBillList";
+ }
+ if (sViewName == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "涓嶆敮鎸佽婧愬崟绫诲瀷锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ ds = oCn.RunProcReturn("select * from h_v_Sc_MouldScrapRequestBillList where hmainid="+ HInterID.ToString()+ "and hsubid="+ HEntryID, "h_v_Sc_MouldScrapRequestBillList");
+ if (ds == null || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏈煡璇㈠埌婧愬崟淇℃伅锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鎴愬姛锛�";
+ objJsonResult.data = ds.Tables[0];
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鑾峰彇婧愬崟淇℃伅澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
}
}
\ No newline at end of file
--
Gitblit v1.9.1