From c81d254683929d9f3599694783c68499431a336b Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期五, 26 七月 2024 10:30:38 +0800
Subject: [PATCH] 条码自动生成:断线重连时间间隔为5秒
---
WebAPI/Controllers/Sc_MouldRepairInBillListController.cs | 2595 ++++++++++++++++++++++++++++++++++++++++++++++++----------
1 files changed, 2,117 insertions(+), 478 deletions(-)
diff --git a/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs b/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
index 8d0d376..d59bf75 100644
--- a/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
+++ b/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
@@ -22,6 +22,7 @@
public SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
public DAL.ClsSc_ICMOBill BillOld = new DAL.ClsSc_ICMOBill();
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
public DAL.ClsSc_MouldScrapInBill BillNew0 = new DAL.ClsSc_MouldScrapInBill(); //妯″叿鎶ュ簾鍏ュ簱瀵瑰簲鍗曟嵁绫�
public DAL.ClsSc_MouldScrapInBill BillOld0 = new DAL.ClsSc_MouldScrapInBill(); //妯″叿鎶ュ簾鍏ュ簱瀵瑰簲鍗曟嵁绫�
@@ -425,6 +426,7 @@
{
try
{
+ List<object> columnNameList = new List<object>();
if (!DBUtility.ClsPub.Security_Log("Sc_MouldMaintainPlanBillList", 1, false, user))
{
objJsonResult.code = "0";
@@ -436,12 +438,21 @@
ds = Sc_MouldMaintainPlanBillList_s(sWhere);
+ //娣诲姞鍒楀悕
+ foreach (DataColumn col in ds.Tables[0].Columns)
+ {
+ Type dataType = col.DataType;
+ string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+ columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+ }
+
//if (ds.Tables[0].Rows.Count != 0 || ds != null)
//{
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess锛�";
objJsonResult.data = ds.Tables[0];
+ objJsonResult.list = columnNameList;
return objJsonResult;
//}
//else
@@ -1020,6 +1031,17 @@
oBill.DetailColl.Add(oItemSub);
}
+
+ //杩涜 浼氳鏈熼棿 缁撹处 鐨勫垽鏂拰鎺у埗
+ int sYear = 0;
+ int sPeriod = 0;
+ DateTime HDate = DateTime.Now;
+ if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false)
+ {
+ objJsonResult.Message = s;
+ return objJsonResult;
+ }
+
//淇濆瓨
//淇濆瓨瀹屾瘯鍚庡鐞�
bool bResult;
@@ -1163,12 +1185,20 @@
return objJsonResult;
}
+ //杩涜 浼氳鏈熼棿 缁撹处 鐨勫垽鏂拰鎺у埗
+ string s = "";
+ int sYear = 0;
+ int sPeriod = 0;
+ DateTime HDate = DateTime.Now;
+ if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false)
+ {
+ objJsonResult.Message = s;
+ return objJsonResult;
+ }
ClsPub.CurUserName = user;
BillOld.MvarItemKey = "Kf_ICStockBillMain";
oCN.BeginTran();//寮�濮嬩簨鍔�
-
-
//Type 1 瀹℃牳 2 鍙嶅鏍�
if (Type == 1)
@@ -1215,6 +1245,8 @@
}
//==================================================================================
+ //鏇存柊鍙婃椂搴撳瓨琛� 鍑忓皯璋冨叆搴撳瓨,澧炲姞璋冨嚭搴撳瓨
+ ds = oCN.RunProcReturn("exec h_KF_UPDateICinventory_Move '"+ oBill.omodel.HInterID + "','"+ oBill.omodel.HBillType+ "','1'", "h_KF_UPDateICinventory_Move");
//瀹℃牳鍗曟嵁
if (!oBill.CheckBill(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Kf_MoveStockBill_AfterCheckCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true)
@@ -1267,6 +1299,8 @@
}
//===========================================================
+ //鏇存柊鍙婃椂搴撳瓨琛� 澧炲姞璋冨叆搴撳瓨,鍑忓皯璋冨嚭搴撳瓨
+ ds = oCN.RunProcReturn("exec h_KF_UPDateICinventory_Move '" + oBill.omodel.HInterID + "','" + oBill.omodel.HBillType + "','2'", "h_KF_UPDateICinventory_Move");
//鍙嶅鏍稿崟鎹�
if (oBill.AbandonCheck(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Kf_MoveStockBill_AfterUnCheckCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true)
@@ -1550,6 +1584,7 @@
{
try
{
+ List<object> columnNameList = new List<object>(); //瀹氫箟澹版槑鍙橀噺 锛屾妸閫氳繃 new List<object>()鍒涘缓鐨� 瀹炰緥锛岃祴鍊肩粰鍙橀噺
//鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
if (!DBUtility.ClsPub.Security_Log("Kf_MoveStockBillQuery", 1, false, user))
{
@@ -1569,11 +1604,18 @@
string sql = "select * from h_v_IF_MoveStockBillList where 1=1 " + sWhere+ "order by hmainid desc";
ds = oCN.RunProcReturn(sql, "h_v_IF_MoveStockBillList");
}
+ foreach (DataColumn col in ds.Tables[0].Columns)//閬嶅巻ds涓涓�涓〃锛圱ables[0]锛夌殑鎵�鏈夊垪锛圕olumns锛夋瘡娆″惊鐜腑锛宑ol鍙橀噺浼氭寔鏈夊綋鍓嶅垪鐨勫紩鐢�
+ {
+ Type dataType = col.DataType; //鑾峰彇褰撳墠鏁版嵁绫诲瀷浼犲叆 鑷畾涔夊彉閲廳atadataType
+ string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; //瀛楃涓叉嫾鎺� // 灏嗗垪鍚嶅拰鏁版嵁绫诲瀷淇℃伅鎷兼帴鎴愪竴涓狫SON鏍煎紡鐨勫瓧绗︿覆
+ columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+ }
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess锛�";
objJsonResult.data = ds.Tables[0];
+ objJsonResult.list = columnNameList;
return objJsonResult;
}
@@ -1629,6 +1671,16 @@
return objJsonResult;
}
//==================================================================================
+
+ //杩涜 浼氳鏈熼棿 缁撹处 鐨勫垽鏂拰鎺у埗
+ int sYear = 0;
+ int sPeriod = 0;
+ DateTime HDate = DateTime.Now;
+ if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false)
+ {
+ objJsonResult.Message = s;
+ return objJsonResult;
+ }
oCN.BeginTran();
@@ -1732,6 +1784,7 @@
{
try
{
+ List<object> columnNameList = new List<object>(); //瀹氫箟澹版槑鍙橀噺 锛屾妸閫氳繃 new List<object>()鍒涘缓鐨� 瀹炰緥锛岃祴鍊肩粰鍙橀噺
//鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
if (!DBUtility.ClsPub.Security_Log("Kf_SellOutBillQuery", 1, false, user))
{
@@ -1743,6 +1796,12 @@
}
ds = Sc_GetSellOutBillList(sWhere);
+ foreach (DataColumn col in ds.Tables[0].Columns)//閬嶅巻ds涓涓�涓〃锛圱ables[0]锛夌殑鎵�鏈夊垪锛圕olumns锛夋瘡娆″惊鐜腑锛宑ol鍙橀噺浼氭寔鏈夊綋鍓嶅垪鐨勫紩鐢�
+ {
+ Type dataType = col.DataType; //鑾峰彇褰撳墠鏁版嵁绫诲瀷浼犲叆 鑷畾涔夊彉閲廳atadataType
+ string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; //瀛楃涓叉嫾鎺� // 灏嗗垪鍚嶅拰鏁版嵁绫诲瀷淇℃伅鎷兼帴鎴愪竴涓狫SON鏍煎紡鐨勫瓧绗︿覆
+ columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+ }
//if (ds.Tables[0].Rows.Count != 0 || ds != null)
//{
@@ -1750,6 +1809,7 @@
objJsonResult.count = 1;
objJsonResult.Message = "Sucess锛�";
objJsonResult.data = ds.Tables[0];
+ objJsonResult.list = columnNameList;
return objJsonResult;
//}
//else
@@ -1817,7 +1877,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;
return objJsonResult;
@@ -1826,13 +1886,22 @@
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;
return objJsonResult;
}
//==================================================================================
+ //杩涜 浼氳鏈熼棿 缁撹处 鐨勫垽鏂拰鎺у埗
+ int sYear = 0;
+ int sPeriod = 0;
+ DateTime HDate = DateTime.Now;
+ if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false)
+ {
+ objJsonResult.Message = s;
+ return objJsonResult;
+ }
oCN.BeginTran();
//閿�鍞嚭搴撳垹闄ゅ洖濉攢鍞鍗曞叧鑱旀暟閲�
@@ -1855,7 +1924,7 @@
{
s = "鍒犻櫎鍚庡垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
objJsonResult.code = "0";
- objJsonResult.count = 1;
+ objJsonResult.count = 0;
objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + s;
objJsonResult.data = null;
oCN.RollBack();
@@ -1865,7 +1934,7 @@
{
s = ds.Tables[0].Rows[0]["HRemark"].ToString();
objJsonResult.code = "0";
- objJsonResult.count = 1;
+ objJsonResult.count = 0;
objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + s;
objJsonResult.data = null;
oCN.RollBack();
@@ -2041,6 +2110,17 @@
oBill.DetailColl.Add(oItemSub);
}
+
+ //杩涜 浼氳鏈熼棿 缁撹处 鐨勫垽鏂拰鎺у埗
+ int sYear = 0;
+ int sPeriod = 0;
+ DateTime HDate = DateTime.Now;
+ if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false)
+ {
+ objJsonResult.Message = s;
+ return objJsonResult;
+ }
+
//淇濆瓨
//淇濆瓨瀹屾瘯鍚庡鐞�
bool bResult;
@@ -2137,6 +2217,7 @@
{
try
{
+ List<object> columnNameList = new List<object>(); //瀹氫箟澹版槑鍙橀噺 锛屾妸閫氳繃 new List<object>()鍒涘缓鐨� 瀹炰緥锛岃祴鍊肩粰鍙橀噺
//鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
if (!DBUtility.ClsPub.Security_Log("Kf_OtherOutBillQuery", 1, false, user))
{
@@ -2156,13 +2237,21 @@
string sql = "select * from h_v_Kf_OtherOutBillList where 1 = 1 " + sWhere+ " order by hmainid desc";
ds = oCN.RunProcReturn(sql, "h_v_Kf_OtherOutBillList");
}
-
+ foreach (DataColumn col in ds.Tables[0].Columns)//閬嶅巻ds涓涓�涓〃锛圱ables[0]锛夌殑鎵�鏈夊垪锛圕olumns锛夋瘡娆″惊鐜腑锛宑ol鍙橀噺浼氭寔鏈夊綋鍓嶅垪鐨勫紩鐢�
+ {
+ Type dataType = col.DataType; //鑾峰彇褰撳墠鏁版嵁绫诲瀷浼犲叆 鑷畾涔夊彉閲廳atadataType
+ string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; //瀛楃涓叉嫾鎺� // 灏嗗垪鍚嶅拰鏁版嵁绫诲瀷淇℃伅鎷兼帴鎴愪竴涓狫SON鏍煎紡鐨勫瓧绗︿覆
+ columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+ }
//if (ds.Tables[0].Rows.Count != 0 || ds != null)
+
+
//{
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess锛�";
- objJsonResult.data = ds.Tables[0];
+ objJsonResult.data = ds.Tables[0];//浠g爜灏嗙涓�涓狣ataTable锛堢储寮曚负0锛夎祴鍊肩粰objJsonResult鐨刣ata灞炴��
+ objJsonResult.list = columnNameList;//灏哻olumnNameList璧嬪�肩粰objJsonResult鐨刲ist灞炴��
return objJsonResult;
//}
//else
@@ -2244,6 +2333,17 @@
return objJsonResult;
}
//==================================================================================
+
+ //杩涜 浼氳鏈熼棿 缁撹处 鐨勫垽鏂拰鎺у埗
+ int sYear = 0;
+ int sPeriod = 0;
+ DateTime HDate = DateTime.Now;
+ if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false)
+ {
+ objJsonResult.Message = s;
+ return objJsonResult;
+ }
+
oCN.BeginTran();
oCN.RunProc("Delete From Kf_ICStockBillMain where HInterID = " + HInterID);
@@ -2350,6 +2450,17 @@
objJsonResult.count = 0;
objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ //杩涜 浼氳鏈熼棿 缁撹处 鐨勫垽鏂拰鎺у埗
+ string s = "";
+ int sYear = 0;
+ int sPeriod = 0;
+ DateTime HDate = DateTime.Now;
+ if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false)
+ {
+ objJsonResult.Message = s;
return objJsonResult;
}
@@ -2999,6 +3110,17 @@
oBill.DetailColl.Add(oItemSub);
}
+
+ //杩涜 浼氳鏈熼棿 缁撹处 鐨勫垽鏂拰鎺у埗
+ int sYear = 0;
+ int sPeriod = 0;
+ DateTime HDate = DateTime.Now;
+ if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false)
+ {
+ objJsonResult.Message = s;
+ return objJsonResult;
+ }
+
//淇濆瓨
//淇濆瓨瀹屾瘯鍚庡鐞�
bool bResult;
@@ -3142,6 +3264,16 @@
return objJsonResult;
}
+ //杩涜 浼氳鏈熼棿 缁撹处 鐨勫垽鏂拰鎺у埗
+ string s = "";
+ int sYear = 0;
+ int sPeriod = 0;
+ DateTime HDate = DateTime.Now;
+ if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false)
+ {
+ objJsonResult.Message = s;
+ return objJsonResult;
+ }
ClsPub.CurUserName = user;
BillOld.MvarItemKey = "Kf_ICStockBillMain";
@@ -3194,7 +3326,6 @@
}
//==================================================================================
-
//瀹℃牳鍗曟嵁
if (!oBill.CheckBill(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Kf_ICStockBill_AfterCheckCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true)
{
@@ -3245,7 +3376,6 @@
return objJsonResult;
}
//===========================================================
-
//鍙嶅鏍稿崟鎹�
if (oBill.AbandonCheck(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Kf_ICStockBill_AfterUnCheckCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true)
@@ -3538,6 +3668,7 @@
{
try
{
+ List<object> columnNameList = new List<object>(); //瀹氫箟澹版槑鍙橀噺 锛屾妸閫氳繃 new List<object>()鍒涘缓鐨� 瀹炰緥锛岃祴鍊肩粰鍙橀噺
//鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
if (!DBUtility.ClsPub.Security_Log("Kf_OtherInBillQuery", 1, false, user))
{
@@ -3557,13 +3688,19 @@
string sql = "select * from h_v_Kf_OtherInBillList where 1 = 1 " + sWhere+ " order by hmainid desc";
ds = oCN.RunProcReturn(sql, "h_v_Kf_OtherInBillList");
}
-
+ foreach (DataColumn col in ds.Tables[0].Columns)//閬嶅巻ds涓涓�涓〃锛圱ables[0]锛夌殑鎵�鏈夊垪锛圕olumns锛夋瘡娆″惊鐜腑锛宑ol鍙橀噺浼氭寔鏈夊綋鍓嶅垪鐨勫紩鐢�
+ {
+ Type dataType = col.DataType; //鑾峰彇褰撳墠鏁版嵁绫诲瀷浼犲叆 鑷畾涔夊彉閲廳atadataType
+ string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; //瀛楃涓叉嫾鎺� // 灏嗗垪鍚嶅拰鏁版嵁绫诲瀷淇℃伅鎷兼帴鎴愪竴涓狫SON鏍煎紡鐨勫瓧绗︿覆
+ columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+ }
//if (ds.Tables[0].Rows.Count != 0 || ds != null)
//{
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess锛�";
- objJsonResult.data = ds.Tables[0];
+ objJsonResult.data = ds.Tables[0];//浠g爜灏嗙涓�涓狣ataTable锛堢储寮曚负0锛夎祴鍊肩粰objJsonResult鐨刣ata灞炴��
+ objJsonResult.list = columnNameList;//灏哻olumnNameList璧嬪�肩粰objJsonResult鐨刲ist灞炴��
return objJsonResult;
//}
//else
@@ -3658,7 +3795,15 @@
}
//==================================================================================
-
+ //杩涜 浼氳鏈熼棿 缁撹处 鐨勫垽鏂拰鎺у埗
+ int sYear = 0;
+ int sPeriod = 0;
+ DateTime HDate = DateTime.Now;
+ if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false)
+ {
+ objJsonResult.Message = s;
+ return objJsonResult;
+ }
oCN.BeginTran();
@@ -3722,6 +3867,7 @@
{
try
{
+ List<object> columnNameList = new List<object>(); //瀹氫箟澹版槑鍙橀噺 锛屾妸閫氳繃 new List<object>()鍒涘缓鐨� 瀹炰緥锛岃祴鍊肩粰鍙橀噺
//鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
if (!DBUtility.ClsPub.Security_Log("Kf_EntrustInBillQuery", 1, false, user))
{
@@ -3740,13 +3886,20 @@
string sql = "select * from h_v_Kf_EntrustInBillList where 1 = 1 " + sWhere+ " order by hmainid desc";
ds = oCN.RunProcReturn(sql, "h_v_Kf_EntrustInBillList");
}
+ foreach (DataColumn col in ds.Tables[0].Columns)//閬嶅巻ds涓涓�涓〃锛圱ables[0]锛夌殑鎵�鏈夊垪锛圕olumns锛夋瘡娆″惊鐜腑锛宑ol鍙橀噺浼氭寔鏈夊綋鍓嶅垪鐨勫紩鐢�
+ {
+ Type dataType = col.DataType; //鑾峰彇褰撳墠鏁版嵁绫诲瀷浼犲叆 鑷畾涔夊彉閲廳atadataType
+ string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; //瀛楃涓叉嫾鎺� // 灏嗗垪鍚嶅拰鏁版嵁绫诲瀷淇℃伅鎷兼帴鎴愪竴涓狫SON鏍煎紡鐨勫瓧绗︿覆
+ columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+ }
//if (ds.Tables[0].Rows.Count != 0 || ds != null)
//{
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess锛�";
- objJsonResult.data = ds.Tables[0];
+ objJsonResult.data = ds.Tables[0];//浠g爜灏嗙涓�涓狣ataTable锛堢储寮曚负0锛夎祴鍊肩粰objJsonResult鐨刣ata灞炴��
+ objJsonResult.list = columnNameList;//灏哻olumnNameList璧嬪�肩粰objJsonResult鐨刲ist灞炴��
return objJsonResult;
//}
//else
@@ -3839,7 +3992,7 @@
foreach (Model.ClsSb_MouldRepairWorkBillMain oItem in lsmain)
{
//oItem.HMaker = "";
- UserName = oItem.HMaker; //鍒跺崟浜�
+ UserName = msg4; //鍒跺崟浜�
oItem.HBillType = "3807";
oItem.HBillSubType = "3807";
//oItem.HBillNo = ""; //鍗曟嵁鍙�
@@ -4486,7 +4639,7 @@
{
//ds = oCN.RunProcReturn("select HRepairCheckID,HRepairCheckContent,HManagerID,HRemark from Sc_MouldRepairCheckBillSub", "Sc_MouldRepairCheckBillSub");
- ds = oCN.RunProcReturn("select HRepairCheckID,楠屾敹椤圭洰浠g爜 HRepairCheckCode,楠屾敹椤圭洰 HRepairCheckName,楠屾敹鍐呭 HRepairCheckContent,HManagerSonID HManagerID,瀛愯礋璐d汉浠g爜 HManagerCode,瀛愯礋璐d汉 HManagerName,澶囨敞 HRemark from h_v_Sc_MouldRepairCheckBillList_Edit", "h_v_Sc_MouldRepairCheckBillList_Edit");
+ ds = oCN.RunProcReturn("select * from h_v_Sc_MouldRepairCheckBillList_Edit", "h_v_Sc_MouldRepairCheckBillList_Edit");
objJsonResult.code = "0";
objJsonResult.count = 1;
@@ -4497,7 +4650,7 @@
{
//string sql1 = "select HRepairCheckID,HRepairCheckContent,HManagerID,HRemark from Sc_MouldRepairCheckBillSub where 1 = 1 ";
- string sql1 = "select HRepairCheckID,楠屾敹椤圭洰浠g爜 HRepairCheckCode,楠屾敹椤圭洰 HRepairCheckName,楠屾敹鍐呭 HRepairCheckContent,HManagerSonID HManagerID,瀛愯礋璐d汉浠g爜 HManagerCode,瀛愯礋璐d汉 HManagerName,澶囨敞 HRemark from h_v_Sc_MouldRepairCheckBillList_Edit where 1 = 1 ";
+ string sql1 = "select * from h_v_Sc_MouldRepairCheckBillList_Edit where 1 = 1 ";
string sql = sql1 + sqlWhere;
ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldRepairCheckBillList_Edit");
@@ -4638,7 +4791,7 @@
foreach (Model.ClsSc_MouldConkBookBillMain oItem in lsmain)
{
//oItem.HMaker = "";
- UserName = oItem.HMaker; //鍒跺崟浜�
+ UserName = msg4; //鍒跺崟浜�
DBUtility.ClsPub.CurUserName = UserName;
oItem.HBillType = "3815";
oItem.HBillSubType = "3815";
@@ -4925,6 +5078,7 @@
DAL.ClsSc_MouldMaintainPlanBill oBill = new DAL.ClsSc_MouldMaintainPlanBill();
List<Model.ClsSc_MouldMaintainPlanBillMain> lsmain = new List<Model.ClsSc_MouldMaintainPlanBillMain>();
+
msg2 = msg2.Replace("\\", "");
msg2 = msg2.Replace("\n", ""); //\n
lsmain = oListModels.getObjectByJson_Gy_MouldMaintainPlanBillMain(msg2);
@@ -4934,6 +5088,8 @@
UserName = oItem.HMaker; //鍒跺崟浜�
oItem.HBillType = "3818";
oItem.HBillSubType = "3818";
+ oItem.HMainSourceInterID = oItem.HMouldMaintainRuleID;
+ oItem.HMainSourceBillNo = oItem.HMouldMaintainRuleNo;
//oItem.HInterID =0;
//oItem.HBillNo = "";
@@ -5091,7 +5247,7 @@
{
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
//鑾峰彇淇濆吇椤圭洰缂栬緫鏁版嵁
- string sql = "select 淇濆吇椤圭洰ID HMaintainItemID, 淇濆吇椤圭洰浠g爜 HMaintainItemNumber,淇濆吇椤圭洰 HMaintainItem,淇濆吇閮ㄤ綅 HMaintainPart,鍏蜂綋瑕佹眰 HClaim,璐熻矗浜篒D,璐熻矗浜轰唬鐮� HManagerNumber,璐熻矗浜哄悕绉� HManagerName,瀛愬娉�2 HRemark,HMouldMaintainRuleID,HEquipDotCheckNo from h_v_Sc_MouldMaintainPlanBillSub_Item where 1 = 1 " + sqlWhere + "";
+ string sql = "select 淇濆吇椤圭洰ID HMaintainItemID, 淇濆吇椤圭洰浠g爜 HMaintainItemNumber,淇濆吇椤圭洰 HMaintainItem,淇濆吇閮ㄤ綅 HMaintainPart,鍏蜂綋瑕佹眰 HClaim,璐熻矗浜篒D HManagerID,璐熻矗浜轰唬鐮� HManagerNumber,璐熻矗浜哄悕绉� HManagerName,瀛愬娉�2 HRemark,HMouldMaintainRuleID,HEquipDotCheckNo from h_v_Sc_MouldMaintainPlanBillSub_Item where 1 = 1 " + sqlWhere + "";
ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldMaintainPlanBillSub_Item");
//鑾峰彇閰嶄欢椤圭洰缂栬緫鏁版嵁
@@ -5117,6 +5273,55 @@
return objJsonResult;
}
#endregion
+
+ #region[鍣ㄥ叿淇濆吇璁板綍琛紝閫変繚鍏昏鍒掕幏鍙栦繚鍏昏鍒掓竻鍗曚俊鎭痌
+ [Route("Sc_MouldMaintainPlanBill/Sc_MouldMaintainPlanBill_PlanList")]
+ [HttpGet]
+ public object Sc_MouldMaintainPlanBill_PlanList(string HInterID, string HDate)
+ {
+ DataSet ds, ds1;
+ try
+ {
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+
+ List<DataTable> tableList = new List<DataTable>();
+
+ //鑾峰彇淇濆吇椤圭洰
+ ds = oCN.RunProcReturn("exec h_p_Sc_MouldMaintain_GetPlanList " + HInterID + ",'" + HDate + "'", "h_p_Sc_MouldMaintain_GetPlanList");
+
+ //鑾峰彇閰嶄欢椤圭洰缂栬緫鏁版嵁
+ string sql1 = "select 閰嶄欢ID HMaterID, 閰嶄欢浠g爜 HMaterNumber,閰嶄欢鍚嶇О HMaterName,鍗曚綅ID HUnitID,璁¢噺鍗曚綅浠g爜 HUnitNumber,璁¢噺鍗曚綅鍚嶇О HUnitName,鐢ㄩ噺 HQty,鏍囧噯鐢ㄩ噺 HQtyMust,瀛愬娉�1 HRemark,瑙勬牸鍨嬪彿 HMaterSpec from h_v_Sc_MouldMaintainPlanBillSub where hmainid = " + HInterID + "";
+ ds1 = oCN.RunProcReturn(sql1, "h_v_Sc_MouldMaintainPlanBillSub");
+
+ tableList.Add(ds.Tables[0]);
+ tableList.Add(ds1.Tables[0]);
+
+ if (ds.Tables[0].Rows.Count != 0 || ds != null)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+ objJsonResult.data = tableList;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "娌℃湁鏌ヨ鍒版暟鎹俊鎭紒";
+ objJsonResult.data = tableList;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍙戠敓寮傚父锛屾病鏈夎繑鍥炰换浣曡鍒掞紒" + e.ToString();
+ objJsonResult.data = null;
+ }
+ return objJsonResult;
+ }
+ #endregion
+
#region [妯″叿淇濆吇璁″垝鍗曞垹闄ゅ姛鑳絔
/// <summary>
/// 妯″叿缁翠慨鍗曞垹闄ゅ姛鑳�
@@ -5421,6 +5626,142 @@
}
#endregion
+ #region 妯″叿淇濆吇璁板綍琛� 淇濆瓨/缂栬緫PDA
+ /// <summary>
+ /// 淇濆瓨妯″叿缁翠慨鍗�
+ /// </summary>
+ /// <param name="msg"></param>
+ /// <returns></returns>
+ [Route("Sc_MouldMaintainBill/SaveGetMouldMaintainBillListPDA")]
+ [HttpPost]
+ public object SaveGetMouldMaintainBillListPDA([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.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";
+ 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
+ //msg2 = msg2.Replace("'", "鈥�");
+ 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.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; //鍏宠仈鏁伴噺
+ 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
+ {
+ 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;
+ }
+ 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[妯″叿淇濆吇璁板綍琛ㄧ紪杈戞椂鑾峰彇琛ㄥご鏁版嵁]
[Route("Sc_MouldMaintainBill/Sc_MouldMaintainBillListCheckDetai")]
[HttpGet]
@@ -5496,7 +5837,7 @@
}
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
//鑾峰彇淇濆吇椤圭洰缂栬緫鏁版嵁
- string sql = "select HMaintainItemID, 淇濆吇椤圭洰浠g爜 HMaintainItemNumber,淇濆吇椤圭洰鍚嶇О HMaintainItem,淇濆吇閮ㄤ綅 HMaintainPart,鍏蜂綋瑕佹眰 HClaim,HManagerID,璐熻矗浜轰唬鐮� HManagerNumber,璐熻矗浜� HManagerName,琛ㄤ綋澶囨敞 HRemark from h_v_Sc_MouldMaintainBillListItem where 1 = 1 " + Swhere + "";
+ string sql = "select HMaintainItemID, 淇濆吇椤圭洰浠g爜 HMaintainItemNumber,淇濆吇椤圭洰鍚嶇О HMaintainItem,淇濆吇閮ㄤ綅 HMaintainPart,鍏蜂綋瑕佹眰 HClaim,HManagerID,璐熻矗浜轰唬鐮� HManagerNumber,璐熻矗浜� HManagerName,琛ㄤ綋澶囨敞 HRemark,淇濆吇缁撴灉 HMaintainResult from h_v_Sc_MouldMaintainBillListItem where 1 = 1 " + Swhere + "";
ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldMaintainBillListItem");
//鑾峰彇閰嶄欢椤圭洰缂栬緫鏁版嵁
string sql1 = "select HMaterID, 閰嶄欢浠g爜 HMaterNumber,閰嶄欢鍚嶇О HMaterName,瑙勬牸鍨嬪彿 HMaterSpec,HUnitID,鍗曚綅浠g爜 HUnitNumber,鍗曚綅鍚嶇О HUnitName,瀹為檯鐢ㄩ噺 HQty,鏍囧噯鐢ㄩ噺 HQtyMust,HManagerID,璐熻矗浜轰唬鐮� HManagerNumber,璐熻矗浜� HManagerName,琛ㄤ綋澶囨敞 HRemark from h_v_Sc_MouldMaintainBillList where 1 = 1 " + Swhere + "";
@@ -5567,9 +5908,54 @@
return objJsonResult;
}
- bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
- if (IsDete)
+ //=========================================Begin 鍒犻櫎鍓嶆帶鍒� Begin=========================================
+ string sql1 = "exec h_p_Sc_MouldMaintainBill_BeforeDelCtrl " + HInterID + "," + user;
+ ds = oCN.RunProcReturn(sql1, "h_p_Sc_MouldMaintainBill_BeforeDelCtrl");
+ if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
{
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:鍒犻櫎鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //===========================================End 鍒犻櫎鍓嶆帶鍒� End===========================================
+
+ bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+
+ //=========================================Begin 鍒犻櫎鍚庢帶鍒� Begin=========================================
+ string sql2 = "exec h_p_Sc_MouldMaintainBill_AfterDelCtrl " + HInterID + "," + user;
+ ds = oCN.RunProcReturn(sql2, "h_p_Sc_MouldMaintainBill_AfterDelCtrl");
+ if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:鍒犻櫎鍚庡垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //===========================================End 鍒犻櫎鍚庢帶鍒� End===========================================
+
+ if (IsDete)
+ {
objJsonResult.code = "0";
objJsonResult.count = 1;
objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;
@@ -5591,6 +5977,160 @@
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "鍗曟嵁鏈壘鍒�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 妯″叿淇濆吇璁板綍鍗曞鏍�/鍙嶅鏍稿姛鑳�
+ [Route("Sc_MouldMaintainBill/CheckSc_MouldMaintainBill")]
+ [HttpGet]
+ public object CheckSc_MouldMaintainBill(string HInterID, int Type, string user, string HBillSubType)
+ {
+ DAL.ClsSc_MouldMaintainBill BillOld = new DAL.ClsSc_MouldMaintainBill();
+ try
+ {
+ //鍒ゆ柇鏄惁鏈夊鏍告潈闄�
+ if (!DBUtility.ClsPub.Security_Log("Sc_MouldMaintainBill_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 = "Sc_MouldMaintainBillMain";
+ 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;
+ }
+ }
+
+ //瀹℃牳鍓嶆帶鍒�
+ string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString();
+ sql = "exec h_p_Sc_MouldMaintainBill_BeforeCheckCtrl " + int.Parse(HInterID) + ",'" + HBillNo + "','" + user + "'";
+ ds = oCN.RunProcReturn(sql, "h_p_Sc_MouldMaintainBill_BeforeCheckCtrl");
+ if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:瀹℃牳鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
+ objJsonResult.data = null;
+ return objJsonResult;
+
+ }
+ if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+
+ //瀹℃牳鍗曟嵁
+ if (!BillOld.CheckBill(Int64.Parse(HInterID), HBillNo, "h_p_Sc_MouldMaintainBill_AfterCheckCtrl", user, 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;
+ }
+ }
+
+ //鍙嶅鏍稿墠鎺у埗
+ string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString();
+ sql = "exec h_p_Sc_MouldMaintainBill_BeforeUnCheckCtrl " + int.Parse(HInterID) + ",'" + HBillNo + "','" + user + "'";
+ ds = oCN.RunProcReturn(sql, "h_p_Sc_MouldMaintainBill_BeforeUnCheckCtrl");
+ if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:鍙嶅鏍稿墠鍒ゆ柇澶辫触锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�";
+ objJsonResult.data = null;
+ return objJsonResult;
+
+ }
+ if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ //鍙嶅鏍稿崟鎹�
+ if (!BillOld.AbandonCheck(Int64.Parse(HInterID), HBillNo, "h_p_Sc_MouldMaintainBill_AfterUnCheckCtrl", user, 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;
}
@@ -6241,6 +6781,124 @@
}
#endregion
+ #region 鍣ㄥ叿鐐规璁″垝鍗曞鏍�/鍙嶅鏍稿姛鑳�
+ [Route("Sc_MouldDotCheckPlanBill/CheckSc_MouldDotCheckPlanBill")]
+ [HttpGet]
+ public object CheckSc_MouldDotCheckPlanBill(string HInterID, int Type, string user)
+ {
+ DAL.ClsSc_MouldDotCheckPlanBill BillOld = new DAL.ClsSc_MouldDotCheckPlanBill();
+ try
+ {
+ //鍒ゆ柇鏄惁鏈夊鏍告潈闄�
+ if (!DBUtility.ClsPub.Security_Log("Sc_MouldDotCheckPlanBill_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;
+ oCN.BeginTran();//寮�濮嬩簨鍔�
+
+ //Type 1 瀹℃牳 2 鍙嶅鏍�
+ if (Type == 1)
+ {
+ if (!BillOld.CheckBill(int.Parse(HInterID), ref ClsPub.sExeReturnInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //鑷姩鐢熸垚鐐规璁″垝鍗�
+ oCN.RunProc("exec h_p_Sc_MouldDotCheckPlan_Auto " + HInterID);
+ }
+ else
+ {
+ if (BillOld.AbandonCheck(int.Parse(HInterID), ref ClsPub.sExeReturnInfo))
+ {
+ SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+ }
+ 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("Sc_MouldDotCheckPlanBill/GetPlanList")]
+ [HttpGet]
+ public object GetPlanList_Check(string sqlWhere)
+ {
+ DataSet ds;
+ try
+ {
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ if (sqlWhere == null || sqlWhere.Equals(""))
+ {
+ ds = oCN.RunProcReturn("select * from h_v_Sc_MouldDotCheckPlanList", "h_v_Sc_MouldDotCheckPlanList");
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+ objJsonResult.data = ds.Tables[0];
+ }
+ else
+ {
+ string sql1 = "select * from h_v_Sc_MouldDotCheckPlanList where 1 = 1 ";
+ string sql = sql1 + sqlWhere;
+ ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldDotCheckPlanList");
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+ objJsonResult.data = ds.Tables[0];
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁″垝锛�" + e.ToString();
+ objJsonResult.data = null;
+ }
+ return objJsonResult;
+ }
+ #endregion
#endregion
@@ -6260,7 +6918,7 @@
return objJsonResult;
}
//寰楀埌淇℃伅
- ds = oCN.RunProcReturn("select top 1 * from Gy_MouldFileMain where HNumber= '" + HBarCode + "'", "Gy_MouldFileMain");
+ ds = oCN.RunProcReturn("select top 1 * from Gy_MouldFileMain where HBarCode= '" + HBarCode + "'", "Gy_MouldFileMain");
//鍐欏叆淇℃伅
if (ds == null || ds.Tables[0].Rows.Count == 0)
{
@@ -6362,7 +7020,208 @@
}
#endregion
- #region 妯″叿鎶ュ簾鍏ュ簱鍗曚繚瀛�/缂栬緫
+ #region 妯″叿鎶ュ簾鍏ュ簱鍗曚繚瀛�/缂栬緫 20240702浣滃簾
+ /// <summary>
+ /// 淇濆瓨妯″叿鎶ュ簾鍏ュ簱鍗�
+ /// </summary>
+ /// <param name="msg"></param>
+ /// <returns></returns>
+ //[Route("Sc_MouldScrapInHouseBill/SaveGetMouldScrapInHouseBillList")]
+ //[HttpPost]
+ //public object SaveGetMouldScrapInHouseBillList([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 refSav = sArray[2].ToString();
+ // string msg4 = sArray[3].ToString();
+
+ // string UserName = "";
+ // string s = "";
+ // ListModels oListModels = new ListModels();
+ // try
+ // {
+ // //缂栬緫鏉冮檺
+ // if (!DBUtility.ClsPub.Security_Log("Sc_MouldScrapRequestBill_Edit", 1, false, msg4))
+ // {
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ // }
+
+ // DLL.ClsSc_MouldScrapInBill oBill = new DLL.ClsSc_MouldScrapInBill();
+ // List<Models.ClsSc_MouldStockBillMain> lsmain = new List<Models.ClsSc_MouldStockBillMain>();
+ // msg2 = msg2.Replace("\\", "");
+ // msg2 = msg2.Replace("\n", ""); //\n
+ // lsmain = oListModels.getObjectByJson_Gy_MouldScrapInHouseBillMain(msg2);
+ // foreach (Models.ClsSc_MouldStockBillMain oItem in lsmain)
+ // {
+ // if (refSav == "Add")
+ // {
+ // //鍗曟嵁鍙锋槸鍚﹂噸澶�
+ // if (BillNew0.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, BillOld0.omodel.HInterID))
+ // {
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "鍗曟嵁鍙烽噸澶嶏紒涓嶅厑璁镐繚瀛橈紒";
+ // objJsonResult.data = 1;
+ // return objJsonResult;
+ // }
+ // }
+ // if (refSav == "Update")
+ // {
+ // if (BillOld0.ShowBill(oItem.HInterID, ref s) == false)
+ // {
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "姝ゅ崟鎹湁璇紒";
+ // objJsonResult.data = 1;
+ // return objJsonResult;
+ // }
+ // //鍒ゆ柇鏄惁鍙紪杈�
+ // if (BillOld0.omodel.HChecker != "" && BillOld0.omodel.HChecker != null)
+ // {
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "姝ゅ崟鎹凡缁忚瀹℃牳锛屼笉鍏佽淇敼锛�";
+ // objJsonResult.data = 1;
+ // return objJsonResult;
+ // }
+ // if (BillOld0.omodel.HBillStatus > 1)
+ // {
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "姝ゅ崟鎹浜庝笉鍙紪杈戠姸鎬侊紝涓嶅厑璁镐慨鏀癸紒";
+ // objJsonResult.data = 1;
+ // return objJsonResult;
+ // }
+ // if (!DBUtility.Xt_BaseBillFun.Fun_AllowEditBill(BillOld0, ref s))
+ // {
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = s + "锛屼笉鍏佽淇敼";
+ // objJsonResult.data = 1;
+ // return objJsonResult;
+ // }
+ // }
+ // //oItem.HMaker = "";
+ // UserName = oItem.HMaker; //鍒跺崟浜�
+ // oItem.HBillType = "3831";
+ // oItem.HBillSubType = "3831";
+ // //oItem.HBillNo = ""; //鍗曟嵁鍙�
+ // //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --鏃ユ湡
+ // //oItem.HInnerBillNo = ""; // --鍐呴儴鍗曟嵁鍙�
+ // oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
+ // oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd"));
+ // //oItem.HEquipID = 0; //璁惧ID(Gy_EquipMent)
+ // //oItem.HPeriod = 0;
+ // //oItem.HCheckBeginDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); // --缁翠慨鏃ユ湡
+ // //oItem.HCheckResult = ""; //楠屾敹缁撹--(姝e父锛屽紓甯�)
+ // //oItem.HEmpID = 0; //楠屾敹浜�(Gy_Employee)
+ // //oItem.HManagerID = 0; //璐熻矗浜�(Gy_Employee)
+ // //oItem.HDeptID = 0; //楠屾敹閮ㄩ棬(Gy_Department)
+ // //oItem.HExplanation = ""; //鎽樿(鏁呴殰鎻忚堪)
+ // //oItem.HRemark = ""; //澶囨敞
+
+ // //oItem.HMainSourceInterID = oItem.HInterID;
+
+ // //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo);
+ // 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
+ // //msg2 = msg2.Replace("'", "鈥�");
+ // List<Models.ClsSc_MouldStockBillSub> ls = new List<Models.ClsSc_MouldStockBillSub>();
+ // ls = oListModels.getObjectByJson_Gy_MouldScrapInHouseBillSub(msg3);
+ // int i = 0;
+ // foreach (Models.ClsSc_MouldStockBillSub oItemSub in ls)
+ // {
+
+ // i++;
+ // oItemSub.HEntryID = i;
+
+ // //oItemSub.HRepairCheckID = 0; //楠屾敹椤圭洰ID
+ // //oItemSub.HRepairCheckContent = ""; //楠屾敹鍐呭
+ // //oItemSub.HManagerID = 0; //璐熻矗浜篒D
+ // //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; //鍏宠仈閲戦
+ // //oItemSub.HRepairID = 0; //缁翠慨椤圭洰
+ // //oItemSub.HRepairExplanation =""; //缁翠慨瑕佹眰
+ // //oItemSub.HMoney = 0; //缁翠慨璐圭敤
+ // oBill.DetailColl.Add(oItemSub);
+
+ // }
+ // //淇濆瓨
+ // //淇濆瓨瀹屾瘯鍚庡鐞�
+ // bool bResult;
+ // if (oBill.omodel.HInterID == 0)
+ // {
+ // // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+ // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+ // string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'in','{oBill.omodel.HInterID.ToString()}' ");
+ // oCn.RunProc(sql);
+ // }
+ // else
+ // {
+ // bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+ // //淇敼鎴愬姛
+ // //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID 1,{oBill.omodel.HInterID.ToString()},' ' ");
+ // string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID ");
+ // oCn.RunProc(sql);
+ // }
+ // if (bResult)
+ // {
+ // 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 妯″叿鎶ュ簾鍏ュ簱鍗曚繚瀛�/缂栬緫 20240702
/// <summary>
/// 淇濆瓨妯″叿鎶ュ簾鍏ュ簱鍗�
/// </summary>
@@ -6372,175 +7231,137 @@
[HttpPost]
public object SaveGetMouldScrapInHouseBillList([FromBody] JObject msg)
{
+ DAL.ClsSc_MouldScrapInBill oBill = new DAL.ClsSc_MouldScrapInBill();
+
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 refSav = sArray[2].ToString();
- string msg4 = sArray[3].ToString();
-
- string UserName = "";
- string s = "";
- ListModels oListModels = new ListModels();
+ string sMainStr = sArray[0].ToString(); //涓昏〃鏁版嵁
+ string sSubStr = sArray[1].ToString(); //瀛愯〃鏁版嵁
+ string OperationType = sArray[2].ToString(); //鎿嶄綔绫诲瀷锛圓dd鏂板銆乁pdate缂栬緫锛�
+ string HMaker = sArray[3].ToString(); //鍒跺崟浜�
try
{
- //缂栬緫鏉冮檺
- if (!DBUtility.ClsPub.Security_Log("Sc_MouldScrapRequestBill_Edit", 1, false, msg4))
+ //鍒ゆ柇鏉冮檺
+ if (OperationType == "Add")
+ {
+ BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew;
+ //鍒ゆ柇鏂板鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log("Sc_MouldScrapRequestBill", 1, false, HMaker))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡鏂板鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ else
+ {
+ BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_Modify;
+ //鍒ゆ柇缂栬緫鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log("Sc_MouldScrapRequestBill_Edit", 1, false, HMaker))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡缂栬緫鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ //琛ㄥご璧嬪��
+ sMainStr = sMainStr.Replace("\\", "");
+ sMainStr = sMainStr.Replace("\n", "");
+ sMainStr = "[" + sMainStr.ToString() + "]";
+ List<Model.ClsSc_MouldStockBillMain> lsmain = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldStockBillMain>>(sMainStr);
+ foreach (Model.ClsSc_MouldStockBillMain oItem in lsmain)
+ {
+ //鍗曟嵁鍙锋槸鍚﹂噸澶�
+ if (oBill.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, oItem.HInterID))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鍙烽噸澶嶏紒涓嶅厑璁镐繚瀛橈紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //鍒ゆ柇浼氳鏈熸槸鍚﹀悎鐞�
+ string s = "";
+ int sYear = 0;
+ int sPeriod = 0;
+ if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(oItem.HDate, ref sYear, ref sPeriod, ref s) == false)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = s;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ oItem.HYear = sYear;
+ oItem.HPeriod = sPeriod;
+ DBUtility.ClsPub.CurUserName = oItem.HMaker;
+ oBill.omodel = oItem;
+ }
+ //琛ㄤ綋璧嬪��
+ //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆�
+ sSubStr = sSubStr.Substring(1, sSubStr.Length - 2);
+ sSubStr = sSubStr.Replace("\\", "");
+ sSubStr = sSubStr.Replace("\n", "");
+ sSubStr = "[" + sSubStr.ToString() + "]";
+ List<Model.ClsSc_MouldStockBillSub> ls = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldStockBillSub>>(sSubStr);
+ int i = 0;
+ foreach (Model.ClsSc_MouldStockBillSub oItemSub in ls)
+ {
+ i++;
+ oItemSub.HEntryID = i;
+ oBill.DetailColl.Add(oItemSub);
+ }
+
+ string sErrMsg = "";
+ bool bResult;
+ //鑾峰彇绯荤粺鍙傛暟
+ if (oSystemParameter.ShowBill(ref sErrMsg) == true)
+ {
+ //淇濆瓨
+ if (OperationType == "Add") //鏂板淇濆瓨
+ {
+ bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+
+ if (oSystemParameter.omodel.WMS_CampanyName == "鍥涚淮灏�") //绯荤粺鍙傛暟 瀹㈡埛瀹氬埗鍖栧悕绉� 绌虹櫧涓洪�氱敤
+ {
+ //淇敼鍣ㄥ叿妗f浣嶇疆
+ string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'in','{oBill.omodel.HInterID.ToString()}' ");
+ oCn.RunProc(sql);
+ }
+ }
+ else //缂栬緫淇濆瓨
+ {
+ bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+
+ if (oSystemParameter.omodel.WMS_CampanyName == "鍥涚淮灏�") //绯荤粺鍙傛暟 瀹㈡埛瀹氬埗鍖栧悕绉� 绌虹櫧涓洪�氱敤
+ {
+ //淇敼鍣ㄥ叿妗f浣嶇疆
+ string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID ");
+ oCn.RunProc(sql);
+ }
+ }
+ }
+ else
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒";
+ objJsonResult.Message = "鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg;
objJsonResult.data = null;
return objJsonResult;
}
- DLL.ClsSc_MouldScrapInBill oBill = new DLL.ClsSc_MouldScrapInBill();
- List<Models.ClsSc_MouldStockBillMain> lsmain = new List<Models.ClsSc_MouldStockBillMain>();
- msg2 = msg2.Replace("\\", "");
- msg2 = msg2.Replace("\n", ""); //\n
- lsmain = oListModels.getObjectByJson_Gy_MouldScrapInHouseBillMain(msg2);
- foreach (Models.ClsSc_MouldStockBillMain oItem in lsmain)
- {
- if (refSav == "Add")
- {
- //鍗曟嵁鍙锋槸鍚﹂噸澶�
- if (BillNew0.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, BillOld0.omodel.HInterID))
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "鍗曟嵁鍙烽噸澶嶏紒涓嶅厑璁镐繚瀛橈紒";
- objJsonResult.data = 1;
- return objJsonResult;
- }
- }
- if (refSav == "Update")
- {
- if (BillOld0.ShowBill(oItem.HInterID, ref s) == false)
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "姝ゅ崟鎹湁璇紒";
- objJsonResult.data = 1;
- return objJsonResult;
- }
- //鍒ゆ柇鏄惁鍙紪杈�
- if (BillOld0.omodel.HChecker != "" && BillOld0.omodel.HChecker != null)
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "姝ゅ崟鎹凡缁忚瀹℃牳锛屼笉鍏佽淇敼锛�";
- objJsonResult.data = 1;
- return objJsonResult;
- }
- if (BillOld0.omodel.HBillStatus > 1)
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "姝ゅ崟鎹浜庝笉鍙紪杈戠姸鎬侊紝涓嶅厑璁镐慨鏀癸紒";
- objJsonResult.data = 1;
- return objJsonResult;
- }
- if (!DBUtility.Xt_BaseBillFun.Fun_AllowEditBill(BillOld0, ref s))
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = s + "锛屼笉鍏佽淇敼";
- objJsonResult.data = 1;
- return objJsonResult;
- }
- }
- //oItem.HMaker = "";
- UserName = oItem.HMaker; //鍒跺崟浜�
- oItem.HBillType = "3831";
- oItem.HBillSubType = "3831";
- //oItem.HBillNo = ""; //鍗曟嵁鍙�
- //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --鏃ユ湡
- //oItem.HInnerBillNo = ""; // --鍐呴儴鍗曟嵁鍙�
- oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
- oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd"));
- //oItem.HEquipID = 0; //璁惧ID(Gy_EquipMent)
- //oItem.HPeriod = 0;
- //oItem.HCheckBeginDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); // --缁翠慨鏃ユ湡
- //oItem.HCheckResult = ""; //楠屾敹缁撹--(姝e父锛屽紓甯�)
- //oItem.HEmpID = 0; //楠屾敹浜�(Gy_Employee)
- //oItem.HManagerID = 0; //璐熻矗浜�(Gy_Employee)
- //oItem.HDeptID = 0; //楠屾敹閮ㄩ棬(Gy_Department)
- //oItem.HExplanation = ""; //鎽樿(鏁呴殰鎻忚堪)
- //oItem.HRemark = ""; //澶囨敞
-
- //oItem.HMainSourceInterID = oItem.HInterID;
-
- //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo);
- 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
- //msg2 = msg2.Replace("'", "鈥�");
- List<Models.ClsSc_MouldStockBillSub> ls = new List<Models.ClsSc_MouldStockBillSub>();
- ls = oListModels.getObjectByJson_Gy_MouldScrapInHouseBillSub(msg3);
- int i = 0;
- foreach (Models.ClsSc_MouldStockBillSub oItemSub in ls)
- {
-
- i++;
- oItemSub.HEntryID = i;
-
- //oItemSub.HRepairCheckID = 0; //楠屾敹椤圭洰ID
- //oItemSub.HRepairCheckContent = ""; //楠屾敹鍐呭
- //oItemSub.HManagerID = 0; //璐熻矗浜篒D
- //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; //鍏宠仈閲戦
- //oItemSub.HRepairID = 0; //缁翠慨椤圭洰
- //oItemSub.HRepairExplanation =""; //缁翠慨瑕佹眰
- //oItemSub.HMoney = 0; //缁翠慨璐圭敤
- oBill.DetailColl.Add(oItemSub);
-
- }
- //淇濆瓨
- //淇濆瓨瀹屾瘯鍚庡鐞�
- bool bResult;
- if (oBill.omodel.HInterID == 0)
- {
- // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
- bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
- string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'in','{oBill.omodel.HInterID.ToString()}' ");
- oCn.RunProc(sql);
- }
- else
- {
- bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
- //淇敼鎴愬姛
- //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID 1,{oBill.omodel.HInterID.ToString()},' ' ");
- string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID ");
- oCn.RunProc(sql);
- }
if (bResult)
{
objJsonResult.code = "0";
objJsonResult.count = 1;
- objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
- //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
- objJsonResult.data = 1;
+ objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; //鎴愬姛锛�
+ objJsonResult.data = null;
return objJsonResult;
}
else
@@ -6548,7 +7369,7 @@
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo;
- objJsonResult.data = 1;
+ objJsonResult.data = null;
return objJsonResult;
}
}
@@ -6556,8 +7377,8 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString();
- objJsonResult.data = 1;
+ objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.Message;
+ objJsonResult.data = null;
return objJsonResult;
}
}
@@ -6826,7 +7647,158 @@
}
#endregion
- #region 妯″叿澶勭悊鍑哄簱鍗曚繚瀛�/缂栬緫
+ #region 妯″叿澶勭悊鍑哄簱鍗曚繚瀛�/缂栬緫 20240702浣滃簾
+ /// <summary>
+ /// 淇濆瓨妯″叿澶勭悊鍑哄簱鍗�
+ /// </summary>
+ /// <param name="msg"></param>
+ /// <returns></returns>
+ //[Route("Sc_MouldScrapOutHouseBill/SaveGetMouldScrapOutHouseBillList")]
+ //[HttpPost]
+ //public object SaveGetMouldScrapOutHouseBillList([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_MouldScrapOutBill_Edit", 1, false, msg4))
+ // {
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ // }
+
+ // DLL.ClsSc_MouldScrapOutBill oBill = new DLL.ClsSc_MouldScrapOutBill();
+ // List<Model.ClsSc_MouldStockBillMain> lsmain = new List<Model.ClsSc_MouldStockBillMain>();
+ // msg2 = msg2.Replace("\\", "");
+ // msg2 = msg2.Replace("\n", ""); //\n
+ // lsmain = oListModels.getObjectByJson_Gy_MouldScrapOutHouseBillMain(msg2);
+ // foreach (Model.ClsSc_MouldStockBillMain oItem in lsmain)
+ // {
+ // //oItem.HMaker = "";
+ // UserName = oItem.HMaker; //鍒跺崟浜�
+ // oItem.HBillType = "3832";
+ // oItem.HBillSubType = "3832";
+ // //oItem.HBillNo = ""; //鍗曟嵁鍙�
+ // //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --鏃ユ湡
+ // //oItem.HInnerBillNo = ""; // --鍐呴儴鍗曟嵁鍙�
+ // oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
+ // oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd"));
+ // //oItem.HEquipID = 0; //璁惧ID(Gy_EquipMent)
+ // //oItem.HPeriod = 0;
+ // //oItem.HCheckBeginDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); // --缁翠慨鏃ユ湡
+ // //oItem.HCheckResult = ""; //楠屾敹缁撹--(姝e父锛屽紓甯�)
+ // //oItem.HEmpID = 0; //楠屾敹浜�(Gy_Employee)
+ // //oItem.HManagerID = 0; //璐熻矗浜�(Gy_Employee)
+ // //oItem.HDeptID = 0; //楠屾敹閮ㄩ棬(Gy_Department)
+ // //oItem.HExplanation = ""; //鎽樿(鏁呴殰鎻忚堪)
+ // //oItem.HRemark = ""; //澶囨敞
+
+ // //oItem.HMainSourceInterID = oItem.HInterID;
+
+ // //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo);
+ // 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
+ // //msg2 = msg2.Replace("'", "鈥�");
+ // List<Model.ClsSc_MouldStockBillSub> ls = new List<Model.ClsSc_MouldStockBillSub>();
+ // ls = oListModels.getObjectByJson_Gy_MouldScrapOutHouseBillSub(msg3);
+ // int i = 0;
+ // foreach (Model.ClsSc_MouldStockBillSub oItemSub in ls)
+ // {
+
+ // i++;
+ // oItemSub.HEntryID = i;
+
+ // //oItemSub.HRepairCheckID = 0; //楠屾敹椤圭洰ID
+ // //oItemSub.HRepairCheckContent = ""; //楠屾敹鍐呭
+ // //oItemSub.HManagerID = 0; //璐熻矗浜篒D
+ // //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; //鍏宠仈閲戦
+ // //oItemSub.HRepairID = 0; //缁翠慨椤圭洰
+ // //oItemSub.HRepairExplanation =""; //缁翠慨瑕佹眰
+ // //oItemSub.HMoney = 0; //缁翠慨璐圭敤
+ // oBill.DetailColl.Add(oItemSub);
+
+ // }
+ // //淇濆瓨
+ // //淇濆瓨瀹屾瘯鍚庡鐞�
+ // bool bResult;
+ // if (oBill.omodel.HInterID == 0)
+ // {
+ // // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+ // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+ // string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'out','{oBill.omodel.HInterID.ToString()}' ");
+ // oCn.RunProc(sql);
+ // }
+ // else
+ // {
+ // bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+ // //淇敼鎴愬姛
+ // //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID 1,{oBill.omodel.HInterID.ToString()},' ' ");
+ // string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID ");
+ // oCn.RunProc(sql);
+ // }
+ // if (bResult)
+ // {
+ // 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 妯″叿澶勭悊鍑哄簱鍗曚繚瀛�/缂栬緫 20240702
/// <summary>
/// 淇濆瓨妯″叿澶勭悊鍑哄簱鍗�
/// </summary>
@@ -6836,125 +7808,126 @@
[HttpPost]
public object SaveGetMouldScrapOutHouseBillList([FromBody] JObject msg)
{
+ DAL.ClsSc_MouldScrapOutBill oBill = new DAL.ClsSc_MouldScrapOutBill();
+
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();
+ string sMainStr = sArray[0].ToString(); //涓昏〃鏁版嵁
+ string sSubStr = sArray[1].ToString(); //瀛愯〃鏁版嵁
+ string HMaker = sArray[2].ToString(); //鍒跺崟浜�
try
{
//缂栬緫鏉冮檺
- if (!DBUtility.ClsPub.Security_Log("Sc_MouldScrapOutBill_Edit", 1, false, msg4))
+ if (!DBUtility.ClsPub.Security_Log("Sc_MouldScrapOutBill_Edit", 1, false, HMaker))
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒";
+ objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡鏂板/缂栬緫鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //琛ㄥご璧嬪��
+ sMainStr = sMainStr.Replace("\\", "");
+ sMainStr = sMainStr.Replace("\n", "");
+ sMainStr = "[" + sMainStr.ToString() + "]";
+ List<Model.ClsSc_MouldStockBillMain> lsmain = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldStockBillMain>>(sMainStr);
+ foreach (Model.ClsSc_MouldStockBillMain oItem in lsmain)
+ {
+ if (oItem.HInterID == 0)
+ {
+ BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew;
+ }
+ else
+ {
+ BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_Modify;
+ }
+ //鍗曟嵁鍙锋槸鍚﹂噸澶�
+ if (oBill.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, oItem.HInterID))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鍙烽噸澶嶏紒涓嶅厑璁镐繚瀛橈紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //鍒ゆ柇浼氳鏈熸槸鍚﹀悎鐞�
+ string s = "";
+ int sYear = 0;
+ int sPeriod = 0;
+ if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(oItem.HDate, ref sYear, ref sPeriod, ref s) == false)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = s;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ oItem.HYear = sYear;
+ oItem.HPeriod = sPeriod;
+ DBUtility.ClsPub.CurUserName = oItem.HMaker;
+ oBill.omodel = oItem;
+ }
+ //琛ㄤ綋璧嬪��
+ //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆�
+ sSubStr = sSubStr.Substring(1, sSubStr.Length - 2);
+ sSubStr = sSubStr.Replace("\\", "");
+ sSubStr = sSubStr.Replace("\n", "");
+ sSubStr = "[" + sSubStr.ToString() + "]";
+ List<Model.ClsSc_MouldStockBillSub> ls = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldStockBillSub>>(sSubStr);
+ int i = 0;
+ foreach (Model.ClsSc_MouldStockBillSub oItemSub in ls)
+ {
+ i++;
+ oItemSub.HEntryID = i;
+ oBill.DetailColl.Add(oItemSub);
+ }
+
+ string sErrMsg = "";
+ bool bResult;
+ //鑾峰彇绯荤粺鍙傛暟
+ if (oSystemParameter.ShowBill(ref sErrMsg) == true)
+ {
+ //淇濆瓨
+ if (oBill.omodel.HInterID == 0) //鏂板淇濆瓨
+ {
+ bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+
+ if (oSystemParameter.omodel.WMS_CampanyName == "鍥涚淮灏�") //绯荤粺鍙傛暟 瀹㈡埛瀹氬埗鍖栧悕绉� 绌虹櫧涓洪�氱敤
+ {
+ //淇敼鍣ㄥ叿妗f浣嶇疆
+ string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'out','{oBill.omodel.HInterID.ToString()}' ");
+ oCn.RunProc(sql);
+ }
+ }
+ else //缂栬緫淇濆瓨
+ {
+ bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+
+ if (oSystemParameter.omodel.WMS_CampanyName == "鍥涚淮灏�") //绯荤粺鍙傛暟 瀹㈡埛瀹氬埗鍖栧悕绉� 绌虹櫧涓洪�氱敤
+ {
+ //淇敼鍣ㄥ叿妗f浣嶇疆
+ string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID ");
+ oCn.RunProc(sql);
+ }
+ }
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg;
objJsonResult.data = null;
return objJsonResult;
}
- DLL.ClsSc_MouldScrapOutBill oBill = new DLL.ClsSc_MouldScrapOutBill();
- List<Model.ClsSc_MouldStockBillMain> lsmain = new List<Model.ClsSc_MouldStockBillMain>();
- msg2 = msg2.Replace("\\", "");
- msg2 = msg2.Replace("\n", ""); //\n
- lsmain = oListModels.getObjectByJson_Gy_MouldScrapOutHouseBillMain(msg2);
- foreach (Model.ClsSc_MouldStockBillMain oItem in lsmain)
- {
- //oItem.HMaker = "";
- UserName = oItem.HMaker; //鍒跺崟浜�
- oItem.HBillType = "3832";
- oItem.HBillSubType = "3832";
- //oItem.HBillNo = ""; //鍗曟嵁鍙�
- //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --鏃ユ湡
- //oItem.HInnerBillNo = ""; // --鍐呴儴鍗曟嵁鍙�
- oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
- oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd"));
- //oItem.HEquipID = 0; //璁惧ID(Gy_EquipMent)
- //oItem.HPeriod = 0;
- //oItem.HCheckBeginDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); // --缁翠慨鏃ユ湡
- //oItem.HCheckResult = ""; //楠屾敹缁撹--(姝e父锛屽紓甯�)
- //oItem.HEmpID = 0; //楠屾敹浜�(Gy_Employee)
- //oItem.HManagerID = 0; //璐熻矗浜�(Gy_Employee)
- //oItem.HDeptID = 0; //楠屾敹閮ㄩ棬(Gy_Department)
- //oItem.HExplanation = ""; //鎽樿(鏁呴殰鎻忚堪)
- //oItem.HRemark = ""; //澶囨敞
-
- //oItem.HMainSourceInterID = oItem.HInterID;
-
- //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo);
- 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
- //msg2 = msg2.Replace("'", "鈥�");
- List<Model.ClsSc_MouldStockBillSub> ls = new List<Model.ClsSc_MouldStockBillSub>();
- ls = oListModels.getObjectByJson_Gy_MouldScrapOutHouseBillSub(msg3);
- int i = 0;
- foreach (Model.ClsSc_MouldStockBillSub oItemSub in ls)
- {
-
- i++;
- oItemSub.HEntryID = i;
-
- //oItemSub.HRepairCheckID = 0; //楠屾敹椤圭洰ID
- //oItemSub.HRepairCheckContent = ""; //楠屾敹鍐呭
- //oItemSub.HManagerID = 0; //璐熻矗浜篒D
- //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; //鍏宠仈閲戦
- //oItemSub.HRepairID = 0; //缁翠慨椤圭洰
- //oItemSub.HRepairExplanation =""; //缁翠慨瑕佹眰
- //oItemSub.HMoney = 0; //缁翠慨璐圭敤
- oBill.DetailColl.Add(oItemSub);
-
- }
- //淇濆瓨
- //淇濆瓨瀹屾瘯鍚庡鐞�
- bool bResult;
- if (oBill.omodel.HInterID == 0)
- {
- // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
- bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
- string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'out','{oBill.omodel.HInterID.ToString()}' ");
- oCn.RunProc(sql);
- }
- else
- {
- bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
- //淇敼鎴愬姛
- //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID 1,{oBill.omodel.HInterID.ToString()},' ' ");
- string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID ");
- oCn.RunProc(sql);
- }
if (bResult)
{
objJsonResult.code = "0";
objJsonResult.count = 1;
- objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
- //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
- objJsonResult.data = 1;
+ objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; //鎴愬姛锛�
+ objJsonResult.data = null;
return objJsonResult;
}
else
@@ -6962,7 +7935,7 @@
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo;
- objJsonResult.data = 1;
+ objJsonResult.data = null;
return objJsonResult;
}
}
@@ -6970,8 +7943,8 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString();
- objJsonResult.data = 1;
+ objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.Message;
+ objJsonResult.data = null;
return objJsonResult;
}
}
@@ -7418,7 +8391,159 @@
}
#endregion
- #region 妯″叿閫�搴撳崟淇濆瓨/缂栬緫
+ #region 妯″叿閫�搴撳崟淇濆瓨/缂栬緫 20240702浣滃簾
+ /// <summary>
+ /// 淇濆瓨妯″叿閫�搴撳崟
+ /// </summary>
+ /// <param name="msg"></param>
+ /// <returns></returns>
+ //[Route("Sc_MouldProdBackBill/SaveGetMouldProdBackBillList")]
+ //[HttpPost]
+ //public object SaveGetMouldProdBackBillList([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_MouldProdBackBill_Edit", 1, false, msg4))
+ // {
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "娌℃湁淇濆瓨鏉冮檺";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ // }
+
+ // DLL.ClsSc_MouldProdBackBill oBill = new DLL.ClsSc_MouldProdBackBill();
+ // List<Model.ClsSc_MouldProdBackBillMain> lsmain = new List<Model.ClsSc_MouldProdBackBillMain>();
+ // msg2 = msg2.Replace("\\", "");
+ // msg2 = msg2.Replace("\n", ""); //\n
+ // lsmain = oListModels.getObjectByJson_Gy_MouldProdBackBillMain(msg2);
+ // foreach (Model.ClsSc_MouldProdBackBillMain oItem in lsmain)
+ // {
+ // //oItem.HMaker = "";
+ // UserName = oItem.HMaker; //鍒跺崟浜�
+ // oItem.HBillType = "3803";
+ // oItem.HBillSubType = "3803";
+ // //oItem.HBillNo = ""; //鍗曟嵁鍙�
+ // //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --鏃ユ湡
+ // //oItem.HInnerBillNo = ""; // --鍐呴儴鍗曟嵁鍙�
+ // oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
+ // oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd"));
+ // //oItem.HEquipID = 0; //璁惧ID(Gy_EquipMent)
+ // //oItem.HPeriod = 0;
+ // //oItem.HCheckBeginDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); // --缁翠慨鏃ユ湡
+ // //oItem.HCheckResult = ""; //楠屾敹缁撹--(姝e父锛屽紓甯�)
+ // //oItem.HEmpID = 0; //楠屾敹浜�(Gy_Employee)
+ // //oItem.HManagerID = 0; //璐熻矗浜�(Gy_Employee)
+ // //oItem.HDeptID = 0; //楠屾敹閮ㄩ棬(Gy_Department)
+ // //oItem.HExplanation = ""; //鎽樿(鏁呴殰鎻忚堪)
+ // //oItem.HRemark = ""; //澶囨敞
+
+ // //oItem.HMainSourceInterID = oItem.HInterID;
+
+ // //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo);
+ // 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
+ // //msg2 = msg2.Replace("'", "鈥�");
+ // List<Model.ClsSc_MouldProdBackBillSub> ls = new List<Model.ClsSc_MouldProdBackBillSub>();
+ // ls = oListModels.getObjectByJson_Gy_MouldProdBackBillSub(msg3);
+ // int i = 0;
+ // foreach (Model.ClsSc_MouldProdBackBillSub oItemSub in ls)
+ // {
+
+ // i++;
+ // oItemSub.HEntryID = i;
+
+ // //oItemSub.HRepairCheckID = 0; //楠屾敹椤圭洰ID
+ // //oItemSub.HRepairCheckContent = ""; //楠屾敹鍐呭
+ // //oItemSub.HManagerID = 0; //璐熻矗浜篒D
+ // //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; //鍏宠仈閲戦
+ // //oItemSub.HRepairID = 0; //缁翠慨椤圭洰
+ // //oItemSub.HRepairExplanation =""; //缁翠慨瑕佹眰
+ // //oItemSub.HMoney = 0; //缁翠慨璐圭敤
+ // oBill.DetailColl.Add(oItemSub);
+
+ // }
+ // //淇濆瓨
+ // //淇濆瓨瀹屾瘯鍚庡鐞�
+ // bool bResult;
+ // if (oBill.omodel.HInterID == 0)
+ // {
+ // // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+ // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+ // string sql1 = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'in','{oBill.omodel.HInterID.ToString()}' ");
+ // oCn.RunProc(sql1);
+ // }
+ // else
+ // {
+ // bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+ // //淇敼鎴愬姛
+ // //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID 1,{oBill.omodel.HInterID.ToString()},' ' ");
+ // string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID ");
+ // oCn.RunProc(sql);
+ // }
+ // if (bResult)
+ // {
+ // string sql =string.Format($"exec h_p_Sc_MouldProdBackBillList '{oBill.omodel.HBillNo}' ") ;
+ // oCn.RunProc(sql);
+ // 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 妯″叿閫�搴撳崟淇濆瓨/缂栬緫 20240702
/// <summary>
/// 淇濆瓨妯″叿閫�搴撳崟
/// </summary>
@@ -7428,126 +8553,127 @@
[HttpPost]
public object SaveGetMouldProdBackBillList([FromBody] JObject msg)
{
+ DAL.ClsSc_MouldProdBackBill oBill = new DAL.ClsSc_MouldProdBackBill();
+
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();
+ string sMainStr = sArray[0].ToString(); //涓昏〃鏁版嵁
+ string sSubStr = sArray[1].ToString(); //瀛愯〃鏁版嵁
+ string HMaker = sArray[2].ToString(); //鍒跺崟浜�
try
{
- if (!DBUtility.ClsPub.Security_Log("Sc_MouldProdBackBill_Edit", 1, false, msg4))
+ //鍒ゆ柇鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log("Sc_MouldProdBackBill_Edit", 1, false, HMaker))
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "娌℃湁淇濆瓨鏉冮檺";
+ objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡鏂板/缂栬緫鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //琛ㄥご璧嬪��
+ sMainStr = sMainStr.Replace("\\", "");
+ sMainStr = sMainStr.Replace("\n", "");
+ sMainStr = "[" + sMainStr.ToString() + "]";
+ List<Model.ClsSc_MouldProdBackBillMain> lsmain = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldProdBackBillMain>>(sMainStr);
+ foreach (Model.ClsSc_MouldProdBackBillMain oItem in lsmain)
+ {
+ if (oItem.HInterID == 0)
+ {
+ BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew;
+ }
+ else
+ {
+ BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_Modify;
+ }
+ //鍗曟嵁鍙锋槸鍚﹂噸澶�
+ if (oBill.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, oItem.HInterID))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鍙烽噸澶嶏紒涓嶅厑璁镐繚瀛橈紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //鍒ゆ柇浼氳鏈熸槸鍚﹀悎鐞�
+ string s = "";
+ int sYear = 0;
+ int sPeriod = 0;
+ if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(oItem.HDate, ref sYear, ref sPeriod, ref s) == false)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = s;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ oItem.HYear = sYear;
+ oItem.HPeriod = sPeriod;
+ DBUtility.ClsPub.CurUserName = oItem.HMaker;
+ oBill.omodel = oItem;
+ }
+ //琛ㄤ綋璧嬪��
+ //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆�
+ sSubStr = sSubStr.Substring(1, sSubStr.Length - 2);
+ sSubStr = sSubStr.Replace("\\", "");
+ sSubStr = sSubStr.Replace("\n", "");
+ sSubStr = "[" + sSubStr.ToString() + "]";
+ List<Model.ClsSc_MouldStockBillSub> ls = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldStockBillSub>>(sSubStr);
+ int i = 0;
+ foreach (Model.ClsSc_MouldStockBillSub oItemSub in ls)
+ {
+ i++;
+ oItemSub.HEntryID = i;
+ oBill.DetailColl.Add(oItemSub);
+ }
+
+ string sErrMsg = "";
+ bool bResult;
+ //鑾峰彇绯荤粺鍙傛暟
+ if (oSystemParameter.ShowBill(ref sErrMsg) == true)
+ {
+ //淇濆瓨
+ if (oBill.omodel.HInterID == 0) //鏂板淇濆瓨
+ {
+ bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+
+ if (oSystemParameter.omodel.WMS_CampanyName == "鍥涚淮灏�") //绯荤粺鍙傛暟 瀹㈡埛瀹氬埗鍖栧悕绉� 绌虹櫧涓洪�氱敤
+ {
+ //淇敼鍣ㄥ叿妗f浣嶇疆
+ string sql1 = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'in','{oBill.omodel.HInterID.ToString()}' ");
+ oCn.RunProc(sql1);
+ }
+ }
+ else //缂栬緫淇濆瓨
+ {
+ bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+
+ if (oSystemParameter.omodel.WMS_CampanyName == "鍥涚淮灏�") //绯荤粺鍙傛暟 瀹㈡埛瀹氬埗鍖栧悕绉� 绌虹櫧涓洪�氱敤
+ {
+ //淇敼鍣ㄥ叿妗f浣嶇疆
+ string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID ");
+ oCn.RunProc(sql);
+ }
+ }
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg;
objJsonResult.data = null;
return objJsonResult;
}
- DLL.ClsSc_MouldProdBackBill oBill = new DLL.ClsSc_MouldProdBackBill();
- List<Model.ClsSc_MouldProdBackBillMain> lsmain = new List<Model.ClsSc_MouldProdBackBillMain>();
- msg2 = msg2.Replace("\\", "");
- msg2 = msg2.Replace("\n", ""); //\n
- lsmain = oListModels.getObjectByJson_Gy_MouldProdBackBillMain(msg2);
- foreach (Model.ClsSc_MouldProdBackBillMain oItem in lsmain)
- {
- //oItem.HMaker = "";
- UserName = oItem.HMaker; //鍒跺崟浜�
- oItem.HBillType = "3803";
- oItem.HBillSubType = "3803";
- //oItem.HBillNo = ""; //鍗曟嵁鍙�
- //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --鏃ユ湡
- //oItem.HInnerBillNo = ""; // --鍐呴儴鍗曟嵁鍙�
- oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
- oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd"));
- //oItem.HEquipID = 0; //璁惧ID(Gy_EquipMent)
- //oItem.HPeriod = 0;
- //oItem.HCheckBeginDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); // --缁翠慨鏃ユ湡
- //oItem.HCheckResult = ""; //楠屾敹缁撹--(姝e父锛屽紓甯�)
- //oItem.HEmpID = 0; //楠屾敹浜�(Gy_Employee)
- //oItem.HManagerID = 0; //璐熻矗浜�(Gy_Employee)
- //oItem.HDeptID = 0; //楠屾敹閮ㄩ棬(Gy_Department)
- //oItem.HExplanation = ""; //鎽樿(鏁呴殰鎻忚堪)
- //oItem.HRemark = ""; //澶囨敞
-
- //oItem.HMainSourceInterID = oItem.HInterID;
-
- //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo);
- 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
- //msg2 = msg2.Replace("'", "鈥�");
- List<Model.ClsSc_MouldProdBackBillSub> ls = new List<Model.ClsSc_MouldProdBackBillSub>();
- ls = oListModels.getObjectByJson_Gy_MouldProdBackBillSub(msg3);
- int i = 0;
- foreach (Model.ClsSc_MouldProdBackBillSub oItemSub in ls)
- {
-
- i++;
- oItemSub.HEntryID = i;
-
- //oItemSub.HRepairCheckID = 0; //楠屾敹椤圭洰ID
- //oItemSub.HRepairCheckContent = ""; //楠屾敹鍐呭
- //oItemSub.HManagerID = 0; //璐熻矗浜篒D
- //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; //鍏宠仈閲戦
- //oItemSub.HRepairID = 0; //缁翠慨椤圭洰
- //oItemSub.HRepairExplanation =""; //缁翠慨瑕佹眰
- //oItemSub.HMoney = 0; //缁翠慨璐圭敤
- oBill.DetailColl.Add(oItemSub);
-
- }
- //淇濆瓨
- //淇濆瓨瀹屾瘯鍚庡鐞�
- bool bResult;
- if (oBill.omodel.HInterID == 0)
- {
- // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
- bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
- string sql1 = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'in','{oBill.omodel.HInterID.ToString()}' ");
- oCn.RunProc(sql1);
- }
- else
- {
- bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
- //淇敼鎴愬姛
- //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID 1,{oBill.omodel.HInterID.ToString()},' ' ");
- string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID ");
- oCn.RunProc(sql);
- }
if (bResult)
{
- string sql =string.Format($"exec h_p_Sc_MouldProdBackBillList '{oBill.omodel.HBillNo}' ") ;
- oCn.RunProc(sql);
+ string sql = string.Format($"exec h_p_Sc_MouldProdBackBillList '{oBill.omodel.HBillNo}' ");
objJsonResult.code = "0";
objJsonResult.count = 1;
- objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
- //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
- objJsonResult.data = 1;
+ objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; //鎴愬姛锛�
+ objJsonResult.data = null;
return objJsonResult;
}
else
@@ -7555,7 +8681,7 @@
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo;
- objJsonResult.data = 1;
+ objJsonResult.data = null;
return objJsonResult;
}
}
@@ -7563,8 +8689,8 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString();
- objJsonResult.data = 1;
+ objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.Message;
+ objJsonResult.data = null;
return objJsonResult;
}
}
@@ -7871,7 +8997,158 @@
}
#endregion
- #region 妯″叿棰嗙敤鍗曚繚瀛�/缂栬緫
+ #region 妯″叿棰嗙敤鍗曚繚瀛�/缂栬緫 20240702浣滃簾
+ /// <summary>
+ /// 淇濆瓨妯″叿棰嗙敤鍗�
+ /// </summary>
+ /// <param name="msg"></param>
+ /// <returns></returns>
+ //[Route("Sc_MouldProdOutBill/SaveGetMouldProdOutBillList")]
+ //[HttpPost]
+ //public object SaveGetMouldProdOutBillList([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_MouldProdOutBill_Edit", 1, false, msg4))
+ // {
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "娌℃湁淇濆瓨鏉冮檺";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ // }
+ // DLL.ClsSc_MouldProdOutBill oBill = new DLL.ClsSc_MouldProdOutBill();
+ // List<Model.ClsSc_MouldProdOutBillMain> lsmain = new List<Model.ClsSc_MouldProdOutBillMain>();
+ // msg2 = msg2.Replace("\\", "");
+ // msg2 = msg2.Replace("\n", ""); //\n
+ // lsmain = oListModels.getObjectByJson_Gy_MouldProdOutBillMain(msg2);
+ // foreach (Model.ClsSc_MouldProdOutBillMain oItem in lsmain)
+ // {
+ // //oItem.HMaker = "";
+ // UserName = oItem.HMaker; //鍒跺崟浜�
+ // oItem.HBillType = "3802";
+ // oItem.HBillSubType = "3802";
+ // //oItem.HBillNo = ""; //鍗曟嵁鍙�
+ // //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --鏃ユ湡
+ // //oItem.HInnerBillNo = ""; // --鍐呴儴鍗曟嵁鍙�
+ // oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
+ // oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd"));
+ // //oItem.HEquipID = 0; //璁惧ID(Gy_EquipMent)
+ // //oItem.HPeriod = 0;
+ // //oItem.HCheckBeginDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); // --缁翠慨鏃ユ湡
+ // //oItem.HCheckResult = ""; //楠屾敹缁撹--(姝e父锛屽紓甯�)
+ // //oItem.HEmpID = 0; //楠屾敹浜�(Gy_Employee)
+ // //oItem.HManagerID = 0; //璐熻矗浜�(Gy_Employee)
+ // //oItem.HDeptID = 0; //楠屾敹閮ㄩ棬(Gy_Department)
+ // //oItem.HExplanation = ""; //鎽樿(鏁呴殰鎻忚堪)
+ // //oItem.HRemark = ""; //澶囨敞
+
+ // //oItem.HMainSourceInterID = oItem.HInterID;
+
+ // //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo);
+ // 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
+ // //msg2 = msg2.Replace("'", "鈥�");
+ // List<Model.ClsSc_MouldStockBillSub> ls = new List<Model.ClsSc_MouldStockBillSub>();
+ // ls = oListModels.getObjectByJson_Gy_MouldStockBillSub(msg3);
+ // int i = 0;
+ // foreach (Model.ClsSc_MouldStockBillSub oItemSub in ls)
+ // {
+
+ // i++;
+ // oItemSub.HEntryID = i;
+
+ // //oItemSub.HRepairCheckID = 0; //楠屾敹椤圭洰ID
+ // //oItemSub.HRepairCheckContent = ""; //楠屾敹鍐呭
+ // //oItemSub.HManagerID = 0; //璐熻矗浜篒D
+ // //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; //鍏宠仈閲戦
+ // //oItemSub.HRepairID = 0; //缁翠慨椤圭洰
+ // //oItemSub.HRepairExplanation =""; //缁翠慨瑕佹眰
+ // //oItemSub.HMoney = 0; //缁翠慨璐圭敤
+ // oBill.DetailColl.Add(oItemSub);
+
+ // }
+ // //淇濆瓨
+ // //淇濆瓨瀹屾瘯鍚庡鐞�
+ // bool bResult;
+ // if (oBill.omodel.HInterID == 0)
+ // {
+ // // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+ // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+ // string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'out','{oBill.omodel.HInterID.ToString()}' ");
+ // oCn.RunProc(sql);
+ // }
+ // else
+ // {
+ // bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+ // //淇敼鎴愬姛
+ // //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID 1,{oBill.omodel.HInterID.ToString()},' ' ");
+ // string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID ");
+ // oCn.RunProc(sql);
+ // }
+ // if (bResult)
+ // {
+ // 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 妯″叿棰嗙敤鍗曚繚瀛�/缂栬緫 20240702
/// <summary>
/// 淇濆瓨妯″叿棰嗙敤鍗�
/// </summary>
@@ -7881,125 +9158,126 @@
[HttpPost]
public object SaveGetMouldProdOutBillList([FromBody] JObject msg)
{
+ DAL.ClsSc_MouldProdOutBill oBill = new DAL.ClsSc_MouldProdOutBill();
+
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();
+ string sMainStr = sArray[0].ToString(); //涓昏〃鏁版嵁
+ string sSubStr = sArray[1].ToString(); //瀛愯〃鏁版嵁
+ string HMaker = sArray[2].ToString(); //鍒跺崟浜�
try
{
//妯″潡鍚嶏紝鍐欏叆鏃ュ織锛屾姤閿欐锛岀敤鎴峰悕
- if (!DBUtility.ClsPub.Security_Log("Sc_MouldProdOutBill_Edit", 1, false, msg4))
+ if (!DBUtility.ClsPub.Security_Log("Sc_MouldProdOutBill_Edit", 1, false, HMaker))
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "娌℃湁淇濆瓨鏉冮檺";
+ objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡鏂板/缂栬緫鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒";
objJsonResult.data = null;
return objJsonResult;
}
- DLL.ClsSc_MouldProdOutBill oBill = new DLL.ClsSc_MouldProdOutBill();
- List<Model.ClsSc_MouldProdOutBillMain> lsmain = new List<Model.ClsSc_MouldProdOutBillMain>();
- msg2 = msg2.Replace("\\", "");
- msg2 = msg2.Replace("\n", ""); //\n
- lsmain = oListModels.getObjectByJson_Gy_MouldProdOutBillMain(msg2);
+ //琛ㄥご璧嬪��
+ sMainStr = sMainStr.Replace("\\", "");
+ sMainStr = sMainStr.Replace("\n", "");
+ sMainStr = "[" + sMainStr.ToString() + "]";
+ List<Model.ClsSc_MouldProdOutBillMain> lsmain = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldProdOutBillMain>>(sMainStr);
foreach (Model.ClsSc_MouldProdOutBillMain oItem in lsmain)
{
- //oItem.HMaker = "";
- UserName = oItem.HMaker; //鍒跺崟浜�
- oItem.HBillType = "3802";
- oItem.HBillSubType = "3802";
- //oItem.HBillNo = ""; //鍗曟嵁鍙�
- //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --鏃ユ湡
- //oItem.HInnerBillNo = ""; // --鍐呴儴鍗曟嵁鍙�
- oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
- oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd"));
- //oItem.HEquipID = 0; //璁惧ID(Gy_EquipMent)
- //oItem.HPeriod = 0;
- //oItem.HCheckBeginDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); // --缁翠慨鏃ユ湡
- //oItem.HCheckResult = ""; //楠屾敹缁撹--(姝e父锛屽紓甯�)
- //oItem.HEmpID = 0; //楠屾敹浜�(Gy_Employee)
- //oItem.HManagerID = 0; //璐熻矗浜�(Gy_Employee)
- //oItem.HDeptID = 0; //楠屾敹閮ㄩ棬(Gy_Department)
- //oItem.HExplanation = ""; //鎽樿(鏁呴殰鎻忚堪)
- //oItem.HRemark = ""; //澶囨敞
-
- //oItem.HMainSourceInterID = oItem.HInterID;
-
- //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo);
- if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "")
+ if (oItem.HInterID == 0)
+ {
+ BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew;
+ }
+ else
+ {
+ BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_Modify;
+ }
+ //鍗曟嵁鍙锋槸鍚﹂噸澶�
+ if (oBill.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, oItem.HInterID))
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "淇濆瓨澶辫触锛佹病鏈夊崟鎹棩鏈燂紝鏃犳硶淇濆瓨锛�";
- objJsonResult.data = 1;
+ objJsonResult.Message = "鍗曟嵁鍙烽噸澶嶏紒涓嶅厑璁镐繚瀛橈紒";
+ objJsonResult.data = null;
return objJsonResult;
}
+ //鍒ゆ柇浼氳鏈熸槸鍚﹀悎鐞�
+ string s = "";
+ int sYear = 0;
+ int sPeriod = 0;
+ if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(oItem.HDate, ref sYear, ref sPeriod, ref s) == false)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = s;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ oItem.HYear = sYear;
+ oItem.HPeriod = sPeriod;
+ DBUtility.ClsPub.CurUserName = oItem.HMaker;
oBill.omodel = oItem;
}
- //琛ㄤ綋鏁版嵁
+ //琛ㄤ綋璧嬪��
//鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆�
- msg3 = msg3.Substring(1, msg3.Length - 2);
- msg3 = msg3.Replace("\\", "");
- msg3 = msg3.Replace("\n", ""); //\n
- //msg2 = msg2.Replace("'", "鈥�");
- List<Model.ClsSc_MouldStockBillSub> ls = new List<Model.ClsSc_MouldStockBillSub>();
- ls = oListModels.getObjectByJson_Gy_MouldStockBillSub(msg3);
+ sSubStr = sSubStr.Substring(1, sSubStr.Length - 2);
+ sSubStr = sSubStr.Replace("\\", "");
+ sSubStr = sSubStr.Replace("\n", "");
+ sSubStr = "[" + sSubStr.ToString() + "]";
+ List<Model.ClsSc_MouldStockBillSub> ls = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldStockBillSub>>(sSubStr);
int i = 0;
foreach (Model.ClsSc_MouldStockBillSub oItemSub in ls)
{
-
i++;
oItemSub.HEntryID = i;
-
- //oItemSub.HRepairCheckID = 0; //楠屾敹椤圭洰ID
- //oItemSub.HRepairCheckContent = ""; //楠屾敹鍐呭
- //oItemSub.HManagerID = 0; //璐熻矗浜篒D
- //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; //鍏宠仈閲戦
- //oItemSub.HRepairID = 0; //缁翠慨椤圭洰
- //oItemSub.HRepairExplanation =""; //缁翠慨瑕佹眰
- //oItemSub.HMoney = 0; //缁翠慨璐圭敤
oBill.DetailColl.Add(oItemSub);
-
}
- //淇濆瓨
- //淇濆瓨瀹屾瘯鍚庡鐞�
+
+ string sErrMsg = "";
bool bResult;
- if (oBill.omodel.HInterID == 0)
+ //鑾峰彇绯荤粺鍙傛暟
+ if (oSystemParameter.ShowBill(ref sErrMsg) == true)
{
- // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
- bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
- string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'out','{oBill.omodel.HInterID.ToString()}' ");
- oCn.RunProc(sql);
+ //淇濆瓨
+ if (oBill.omodel.HInterID == 0) //鏂板淇濆瓨
+ {
+ bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+
+ if (oSystemParameter.omodel.WMS_CampanyName == "鍥涚淮灏�") //绯荤粺鍙傛暟 瀹㈡埛瀹氬埗鍖栧悕绉� 绌虹櫧涓洪�氱敤
+ {
+ //淇敼鍣ㄥ叿妗f浣嶇疆
+ string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'out','{oBill.omodel.HInterID.ToString()}' ");
+ oCn.RunProc(sql);
+ }
+ }
+ else //缂栬緫淇濆瓨
+ {
+ bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+
+ if (oSystemParameter.omodel.WMS_CampanyName == "鍥涚淮灏�") //绯荤粺鍙傛暟 瀹㈡埛瀹氬埗鍖栧悕绉� 绌虹櫧涓洪�氱敤
+ {
+ //淇敼鍣ㄥ叿妗f浣嶇疆
+ string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID ");
+ oCn.RunProc(sql);
+ }
+ }
}
else
{
- bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
- //淇敼鎴愬姛
- //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID 1,{oBill.omodel.HInterID.ToString()},' ' ");
- string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID ");
- oCn.RunProc(sql);
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg;
+ objJsonResult.data = null;
+ return objJsonResult;
}
+
if (bResult)
{
objJsonResult.code = "0";
objJsonResult.count = 1;
- objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
- //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
- objJsonResult.data = 1;
+ objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; //鎴愬姛锛�
+ objJsonResult.data = null;
return objJsonResult;
}
else
@@ -8007,7 +9285,7 @@
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo;
- objJsonResult.data = 1;
+ objJsonResult.data = null;
return objJsonResult;
}
}
@@ -8015,8 +9293,8 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString();
- objJsonResult.data = 1;
+ objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.Message;
+ objJsonResult.data = null;
return objJsonResult;
}
}
@@ -8593,6 +9871,367 @@
}
#endregion
+ #region [妯″叿瀵垮懡璋冩暣鍗曞鏍搞�佸弽瀹℃牳]
+ /// <summary>
+ ///
+ /// </summary>
+ /// <param name="HInterID">鍗曟嵁ID</param>
+ /// <param name="IsAudit">瀹℃牳(0),鍙嶅鏍�(1)</param>
+ /// <param name="CurUserName">瀹℃牳浜�</param>
+ /// <returns></returns>
+ [Route("Sc_MouldLifeChangeBill/AuditSc_MouldLifeChangeBillList")]
+ [HttpGet]
+ public object AuditSc_MouldLifeChangeBillList(int HInterID, int IsAudit, string CurUserName)
+ {
+ string ModRightNameCheck = "Sc_MouldLifeChangeBill_Check";
+ DBUtility.ClsPub.CurUserName = CurUserName;
+ try
+ {
+ //瀹℃牳鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, false, CurUserName))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (HInterID <= 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "HInterID灏忎簬0锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ Int64 lngBillKey = 0;
+ lngBillKey = DBUtility.ClsPub.isLong(HInterID);
+ DAL.ClsSc_MouldLifeChangeBill oBill = new DAL.ClsSc_MouldLifeChangeBill();
+ //鏌ョ湅鏄惁宸插鏍�,鍏抽棴,浣滃簾
+ if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))
+ {
+ if (oBill.omodel.HCloseMan.Trim() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸插叧闂�!涓嶈兘鍐嶆瀹℃牳锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (oBill.omodel.HDeleteMan.Trim() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸蹭綔搴�!涓嶈兘鍐嶆瀹℃牳锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (IsAudit == 0) //瀹℃牳鍒ゆ柇
+ {
+ if (oBill.omodel.HChecker.Trim() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘鍐嶆瀹℃牳锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ if (IsAudit == 1) //鍙嶅鏍稿垽鏂�
+ {
+ if (oBill.omodel.HChecker.Trim() == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鏈鏍�!涓嶉渶瑕佸弽瀹℃牳!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ oCn.BeginTran();//寮�濮嬩簨鐗�
+
+ if (IsAudit == 0) //瀹℃牳鎻愪氦
+ {
+
+ //===============================Begin 瀹℃牳鍓嶆帶鍒� Begin===============================
+ string sql = "exec h_p_Sc_MouldLifeChangeBill_BeforeCheckCtrl " + HInterID + ",'" + CurUserName + "'";
+ ds = oCn.RunProcReturn(sql, "h_p_Sc_MouldLifeChangeBill_BeforeCheckCtrl");
+ if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+ {
+ oCn.RollBack();//鍥炴粴浜嬬墿
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:瀹℃牳鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
+ objJsonResult.data = null;
+ return objJsonResult;
+
+ }
+ if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ oCn.RollBack();//鍥炴粴浜嬬墿
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=================================End 瀹℃牳鍓嶆帶鍒� End=================================
+
+ //瀹℃牳鎻愪氦
+ if (oBill.CheckBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
+ {
+
+ //===============================Begin 瀹℃牳鍚庢帶鍒� Begin===============================
+ string sql2 = "exec h_p_Sc_MouldLifeChangeBill_AfterCheckCtrl " + HInterID + ",'" + CurUserName + "'";
+ ds = oCn.RunProcReturn(sql2, "h_p_Sc_MouldLifeChangeBill_AfterCheckCtrl");
+ if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+ {
+ oCn.RollBack();//鍥炴粴浜嬬墿
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:瀹℃牳鍚庡垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
+ objJsonResult.data = null;
+ return objJsonResult;
+
+ }
+ if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ oCn.RollBack();//鍥炴粴浜嬬墿
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=================================End 瀹℃牳鍚庢帶鍒� End=================================
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "瀹℃牳鎴愬姛";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ oCn.RollBack();//鍥炴粴浜嬬墿
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ if (IsAudit == 1) //鍙嶅鏍告彁浜�
+ {
+ //===============================Begin 鍙嶅鏍稿墠鎺у埗 Begin===============================
+ string sql = "exec h_p_Sc_MouldLifeChangeBill_BeforeUnCheckCtrl " + HInterID + ",'" + CurUserName + "'";
+ ds = oCn.RunProcReturn(sql, "h_p_Sc_MouldLifeChangeBill_BeforeUnCheckCtrl");
+ if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+ {
+ oCn.RollBack();//鍥炴粴浜嬬墿
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:鍙嶅鏍稿墠鍒ゆ柇澶辫触锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�";
+ objJsonResult.data = null;
+ return objJsonResult;
+
+ }
+ if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ oCn.RollBack();//鍥炴粴浜嬬墿
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=================================End 鍙嶅鏍稿墠鎺у埗 End=================================
+ //鍙嶅鏍告彁浜bandonCheck
+ if (oBill.AbandonCheck(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
+ {
+ //===============================Begin 鍙嶅鏍稿悗鎺у埗 Begin===============================
+ string sql2 = "exec h_p_Sc_MouldLifeChangeBill_AfterUnCheckCtrl " + HInterID + ",'" + CurUserName + "'";
+ ds = oCn.RunProcReturn(sql2, "h_p_Sc_MouldLifeChangeBill_AfterUnCheckCtrl");
+ if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+ {
+ oCn.RollBack();//鍥炴粴浜嬬墿
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:鍙嶅鏍稿悗鍒ゆ柇澶辫触锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�";
+ objJsonResult.data = null;
+ return objJsonResult;
+
+ }
+ if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ oCn.RollBack();//鍥炴粴浜嬬墿
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=================================End 鍙嶅鏍稿悗鎺у埗 End=================================
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍙嶅鏍告垚鍔�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ oCn.Commit();//鎻愪氦浜嬬墿
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ oCn.RollBack();//鍥炴粴浜嬬墿
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳澶辫触鎴栬�呭弽瀹℃牳澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #endregion
+
+ #region 鍣ㄥ叿淇濆吇璁″垝鍗曞鏍�/鍙嶅鏍稿姛鑳�
+ [Route("Sc_MouldMaintainPlanBill/CheckSc_MouldMaintainPlanBill")]
+ [HttpGet]
+ public object CheckSc_MouldMaintainPlanBill(string HInterID, int Type, string user)
+ {
+ DAL.ClsSc_MouldMaintainPlanBill BillOld = new DAL.ClsSc_MouldMaintainPlanBill();
+ try
+ {
+ //鍒ゆ柇鏄惁鏈夊鏍告潈闄�
+ if (!DBUtility.ClsPub.Security_Log("Sc_MouldMaintainPlanBill_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;
+ oCN.BeginTran();//寮�濮嬩簨鍔�
+
+ //Type 1 瀹℃牳 2 鍙嶅鏍�
+ if (Type == 1)
+ {
+ if (!BillOld.CheckBill(int.Parse(HInterID), ref ClsPub.sExeReturnInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //鑷姩鐢熸垚鐐规璁″垝鍗�
+ oCN.RunProc("exec h_p_Sc_MouldMaintainPlan_Auto " + HInterID);
+ }
+ else
+ {
+ if (BillOld.AbandonCheck(int.Parse(HInterID), ref ClsPub.sExeReturnInfo))
+ {
+ SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+ }
+ 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("Sc_MouldMaintainPlanBill/GetPlanList")]
+ [HttpGet]
+ public object GetPlanList(string sqlWhere)
+ {
+ DataSet ds;
+ try
+ {
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ if (sqlWhere == null || sqlWhere.Equals(""))
+ {
+ ds = oCN.RunProcReturn("select * from h_v_Sc_MouldMaintainPlanList", "h_v_Sc_MouldMaintainPlanList");
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+ objJsonResult.data = ds.Tables[0];
+ }
+ else
+ {
+ string sql1 = "select * from h_v_Sc_MouldMaintainPlanList where 1 = 1 ";
+ string sql = sql1 + sqlWhere;
+ ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldMaintainPlanList");
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+ objJsonResult.data = ds.Tables[0];
+ }
+ }
+ 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