From 073ac235b4e0121f623b700070000eee796e3ee6 Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期四, 16 六月 2022 09:11:33 +0800
Subject: [PATCH] 提料计划报表 工艺路线和工序流转卡维护
---
WebAPI/Controllers/POStockInBillController.cs | 357 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 337 insertions(+), 20 deletions(-)
diff --git a/WebAPI/Controllers/POStockInBillController.cs b/WebAPI/Controllers/POStockInBillController.cs
index 31c4efd..aac8764 100644
--- a/WebAPI/Controllers/POStockInBillController.cs
+++ b/WebAPI/Controllers/POStockInBillController.cs
@@ -1,5 +1,6 @@
锘縰sing DBUtility;
using Model;
+using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using SQLHelper;
using System;
@@ -76,32 +77,97 @@
[HttpGet]
public Object get_CheckTypeByBarCode_Json(string sCode, Int64 sInterID, string sBillNo, string sBillType, string sMaker, Int64 WhID, Int64 SPID, Double sQty, bool sRedBlue, bool SourceFlag, string sSourceBillNo, string sSourceType, Int64 HOWNERID)
{
- //if (sRedBlue == true)
- //{
- // HBillType = "1239";
- //}
- //oBar = webserver.get_CheckTypeByBarCode(sCode, sInterID, sBillType, sBillNo, sMaker, WhID, SPID, sQty, sRedBlue, SourceFlag, sSourceBillNo, sSourceType, HOWNERID, ref DBUtility.ClsPub.sErrInfo);
- WebS.WebService1 oWebs = new WebS.WebService1();
- WebS.ClsKf_ICStockBill_WMS WebSoBar = new WebS.ClsKf_ICStockBill_WMS();
- string sExpressNumber = "";
- WebSoBar = oWebs.get_CheckTypeByBarCode_All(sCode, sInterID, HBillType, sBillNo, sMaker, WhID, SPID, sQty, sRedBlue, SourceFlag, sSourceBillNo, sSourceType, HOWNERID, sExpressNumber, ref DBUtility.ClsPub.sErrInfo);
- if (WebSoBar == null)
+ try
{
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = DBUtility.ClsPub.sErrInfo;
- objJsonResult.data = null;
- return objJsonResult;
+ //if (sRedBlue == true)
+ //{
+ // HBillType = "1239";
+ //}
+ //oBar = webserver.get_CheckTypeByBarCode(sCode, sInterID, sBillType, sBillNo, sMaker, WhID, SPID, sQty, sRedBlue, SourceFlag, sSourceBillNo, sSourceType, HOWNERID, ref DBUtility.ClsPub.sErrInfo);
+ WebS.WebService1 oWebs = new WebS.WebService1();
+ WebS.ClsKf_ICStockBill_WMS WebSoBar = new WebS.ClsKf_ICStockBill_WMS();
+ string sExpressNumber = "";
+ WebSoBar = oWebs.get_CheckTypeByBarCode_All(sCode, sInterID, HBillType, sBillNo, sMaker, WhID, SPID, sQty, sRedBlue, SourceFlag, sSourceBillNo, sSourceType, HOWNERID, sExpressNumber, ref DBUtility.ClsPub.sErrInfo);
+ if (WebSoBar == null)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = DBUtility.ClsPub.sErrInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = DBUtility.ClsPub.sErrInfo;
+ objJsonResult.data = WebSoBar;
+ return objJsonResult;
+ }
}
- else
+ catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 1;
- objJsonResult.Message = DBUtility.ClsPub.sErrInfo;
- objJsonResult.data = WebSoBar;
+ objJsonResult.Message = e.Message+";"+e.StackTrace;
+ objJsonResult.data = null;
return objJsonResult;
}
+
}
+
+
+
+
+ /// <summary>
+ /// 鐢熶骇姹囨姤/鎵潯鐮�/鐩存帴璋冪敤webservice
+ /// </summary>
+ /// <returns></returns>
+ [Route("ICMOReportBill/get_CheckTypeByBarCode_Json1")]
+ [HttpGet]
+ public Object get_CheckTypeByBarCode_Json1(string sCode, Int64 sInterID, string sBillType, string sBillNo, string sMaker, Int64 WhID, Int64 SPID, Double sQty, bool sRedBlue, bool SourceFlag, string sSourceBillNo, string sSourceType, Int64 HOWNERID)
+ {
+ try
+ {
+ //if (sRedBlue == true)
+ //{
+ // HBillType = "1239";
+ //}
+ //oBar = webserver.get_CheckTypeByBarCode(sCode, sInterID, sBillType, sBillNo, sMaker, WhID, SPID, sQty, sRedBlue, SourceFlag, sSourceBillNo, sSourceType, HOWNERID, ref DBUtility.ClsPub.sErrInfo);
+ WebS.WebService1 oWebs = new WebS.WebService1();
+ WebS.ClsKf_ICStockBill_WMS WebSoBar = new WebS.ClsKf_ICStockBill_WMS();
+ string sExpressNumber = "";
+ WebSoBar = oWebs.get_CheckTypeByBarCode_All(sCode, sInterID, sBillType, sBillNo, sMaker, WhID, SPID, sQty, sRedBlue, SourceFlag, sSourceBillNo, sSourceType, HOWNERID, sExpressNumber, ref DBUtility.ClsPub.sErrInfo);
+ if (WebSoBar == null)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = DBUtility.ClsPub.sErrInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = DBUtility.ClsPub.sErrInfo;
+ objJsonResult.data = WebSoBar;
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = e.Message + ";" + e.StackTrace;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ }
+
+
+
/// <summary>
/// 涓�閿壂鐮佺孩瀛�
/// </summary>
@@ -268,6 +334,81 @@
return objJsonResult;
}
}
+
+
+
+ /// <summary>
+ /// 鍐欏叆涓存椂琛� 鎵簮鍗曠殑鏂规硶
+ /// </summary>
+ /// <param name="HSourceBillNo"></param>
+ /// <returns></returns>
+ [Route("ICMOReportBill/set_SavePonderationBillMain_Temp_Source_Fast_Json_New")]
+ [HttpGet]
+ public object set_SavePonderationBillMain_Temp_Source_Fast_Json_New(string HSourceBillType, string HSourceBillNo, Int64 sInterID, string sBillNo)
+ {
+ try
+ {
+ LogService.Write("鎵ц鎴愬姛!");
+ // DataSet ds = new DataSet();
+ // WebServer webserver = new WebServer();
+ string sWhere = " Where 鍗曟嵁鍙� like '%" + HSourceBillNo.Trim() + "'";
+ //鏍规嵁婧愬崟绫诲瀷鏉ヨ皟鐢ㄤ笉鍚岀殑WEBS鏂规硶 new
+ if (HSourceBillType == "3710")
+ {
+ ds = webserver.GetSc_ICMOBillList(sWhere + " ");
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍,婧愬崟绫诲瀷鏈夐敊璇紒";
+ objJsonResult.data = null;
+ return objJsonResult; ;
+ }
+ //
+ if (ds == null || ds.Tables[0].Rows.Count <= 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + HSourceBillType;
+ objJsonResult.data = null;
+ return objJsonResult;
+ //DBUtility.ClsPub.MessageBeep((int)DBUtility.ClsPub.BeepType.Warning);
+ }
+ else
+ {
+ HDeptID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HDeptID"]);
+ HDeptName = Convert.ToString(ds.Tables[0].Rows[0]["HDeptName"]);
+ if (webserver.set_SavePonderationBillMain_Temp_Source_Fast(sInterID, sBillNo, "3711", HSourceBillNo, HSourceBillType, "钃濆瓧", ref DBUtility.ClsPub.sErrInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�";
+ objJsonResult.data = ds.Tables[0];
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍐欏叆涓存椂琛ㄥけ璐ワ紒" + DBUtility.ClsPub.sErrInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+
/// <summary>
/// 杩斿洖鍑哄叆搴撴潯鐮佷复鏃惰〃
/// </summary>
@@ -606,6 +747,66 @@
}
}
+
+ /// <summary>
+ /// 鐢熶骇姹囨姤鍗�/鎻愪氦/鐩存帴璋僿ebservice
+ /// </summary>
+ /// <returns></returns>
+ [Route("ICMOReportBill/set_SaveICMOReportBill_Json")]
+ [HttpPost]
+ public object set_SaveICMOReportBill_Json([FromBody] JObject oMain)
+ {
+ var _value = oMain["oMain"].ToString();
+ string msg1 = _value.ToString();
+ try
+ {
+ List<Model.ClsSc_ICMOReportBillMain> lsmain = new List<Model.ClsSc_ICMOReportBillMain>();
+ ListModels oListModels = new ListModels();
+ lsmain = oListModels.getICMOReportBillMainByJson(msg1);
+ lsmain[0].HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
+ lsmain[0].HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));
+ string sSourceBillType = lsmain[0].HBillType;
+
+ WebAPI.WebS.ClsSc_ICMOReportBillMain websLsmain = new WebS.ClsSc_ICMOReportBillMain();
+
+ websLsmain.HInterID = lsmain[0].HInterID;
+ websLsmain.HBillNo = lsmain[0].HBillNo;
+ websLsmain.HBillType = "3711";//鍥哄畾鍊�
+ websLsmain.HDate = lsmain[0].HDate;
+ websLsmain.HDeptID = lsmain[0].HDeptID;
+ websLsmain.HEmpID = 0;
+ websLsmain.HBillerID = lsmain[0].HBillerID;
+ websLsmain.HRemark = "";
+ websLsmain.HMainSourceBillType = lsmain[0].HBillType;
+
+
+ if (webserver.set_SaveICMOReportBill_Json(websLsmain, sSourceBillType, ref DBUtility.ClsPub.sErrInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鎴愬姛锛佸崟鎹彿涓猴細";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "涓婁紶澶辫触锛�" + DBUtility.ClsPub.sErrInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "涓婁紶澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
[Route("POStockInBill/GetSpName_Json")]
[HttpGet]
public object GetSpName_Json(long HSpID, long HWHID, long HStockOrgID, ref string sErrMsg)
@@ -615,7 +816,6 @@
ds = webserver.GetSPInfoByIDandHWHIDandOrg(HSpID, HWHID, HStockOrgID, ref sErrMsg);
if (ds == null || ds.Tables[0].Rows.Count <= 0)
{
-
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�";
@@ -831,6 +1031,7 @@
}
+
//[Route("POStockInBillList/confirm")]
//public object confirm(string hmainid)
//{
@@ -865,7 +1066,7 @@
// FentityModel.Add("FSRCENTRYID", item["FHPOOrderEntryID"].ToString());//婧愬崟鍒嗗綍鍐呯爜
// FentityModel.Add("FORDERBILLNO", item["FHPOOrderBillNo"].ToString());//婧愬崟鍗曞彿
// FentityModel.Add("FPOORDERENTRYID", item["FHPOOrderEntryID"].ToString());//婧愬崟鍒嗗綍鍐呯爜
-
+
// JArray Fentity2 = new JArray();
// JObject FentityModel2 = new JObject();
@@ -910,5 +1111,121 @@
//}
#endregion
+
+ #region [鏀舵枡閫氱煡鍗曞鏍竇
+ //鏀舵枡閫氱煡鍗曞鏍� 鎵潯鐮�
+ [Route("POStockInBillList/Get_ReciveBillCheckDate")]
+ [HttpGet]
+ public object Get_ReciveBillCheckDate(string HBarCode)
+ {
+ try
+ {
+ SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+ DataSet Ds = oCn.RunProcReturn("exec h_p_KF_PonderationBillMain_Temp_Add_POInStockCheck2 '" + HBarCode + "'", "h_p_KF_PonderationBillMain_Temp_Add_POInStockCheck2");
+ if (Ds == null || Ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0][0]) == 0)
+ {
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = Ds.Tables[0];
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ }
+
+ //鏀舵枡閫氱煡鍗曞鏍� 瀹℃牳鎻愪氦
+ [Route("POStockInBillList/Exec_ReciveBillCheck")]
+ [HttpGet]
+ public object Exec_ReciveBillCheck(string HBarCode)
+ {
+ try
+ {
+ //淇敼閲戣澏鐢熶骇鍗曠殑鐘舵��
+ //璁块棶閲戣澏
+ var loginRet = InvokeHelper.Login();
+ var isSuccess = JObject.Parse(loginRet)["LoginResultType"].Value<int>();
+
+ if (isSuccess == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎿嶄綔澶辫触,閲戣澏璐﹀彿鐧诲綍寮傚父銆�" + loginRet;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ var json = new
+ {
+ //CreateOrgId = 0,
+ Numbers = HBarCode,
+ //Ids = (EntyID).Split('-')[0],
+ //PkEntryIds = (EntyID).Split('-')[1]
+ };
+ string result1 = string.Empty;
+ string result2 = string.Empty;
+ DataSet Ds = oCn.RunProcReturn("select FDOCUMENTSTATUS,FID from AIS20210811135644..T_PUR_RECEIVE where FBILLNO='" + HBarCode+"'", "AIS20210811135644..T_PUR_RECEIVE");
+ //鍒ゆ柇褰撳墠鏀舵枡閫氱煡鍗曠姸鎬佲�斺�斿凡鍒涘缓鍒欏厛鎻愪氦鍐嶅鏍搞�佷互鎻愪氦鍒欏彧瀹℃牳
+ if (Ds.Tables[0].Rows[0][0].ToString() == "A"|| Ds.Tables[0].Rows[0][0].ToString() == "D")
+ {
+ result1 = InvokeHelper.Submit("PUR_ReceiveBill", JsonConvert.SerializeObject(json));
+ result2 = InvokeHelper.Audit("PUR_ReceiveBill", JsonConvert.SerializeObject(json));
+ }
+ if (Ds.Tables[0].Rows[0][0].ToString() == "B")
+ {
+ result2 = InvokeHelper.Audit("PUR_ReceiveBill", JsonConvert.SerializeObject(json));
+ }
+ //鍒ゆ柇瀹℃牳鏄惁鎴愬姛
+ if (JObject.Parse(result2)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳鏀舵枡閫氱煡鍗曞け璐ワ紒鍗曟嵁鍙凤細" + HBarCode;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "瀹℃牳鎴愬姛锛�";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ }
+ #endregion
}
}
\ No newline at end of file
--
Gitblit v1.9.1