From 08665ff78fbc131fd647fad4ba48742faec53529 Mon Sep 17 00:00:00 2001
From: ch <37327@LLOOCCY>
Date: 星期二, 12 七月 2022 11:27:51 +0800
Subject: [PATCH] 修改了 夏宝 车间看板 采购看板 缺料看板 根据系统设置默认车间过滤功能
---
WebAPI/Controllers/POStockInBillController.cs | 593 +++++++++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 531 insertions(+), 62 deletions(-)
diff --git a/WebAPI/Controllers/POStockInBillController.cs b/WebAPI/Controllers/POStockInBillController.cs
index 401da54..e180af3 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;
@@ -26,14 +27,14 @@
public Int64 HWhID;//浠撳簱ID
public Int64 HSPID;//浠撲綅ID
- public string HSupName=string.Empty;
- public string HDeptName=string.Empty;
- public string HWhName=string.Empty;
- public string HSPName=string.Empty;
+ public string HSupName = string.Empty;
+ public string HDeptName = string.Empty;
+ public string HWhName = string.Empty;
+ public string HSPName = string.Empty;
public Int64 HInterID;//鏈崟ID
public string HBillNo;
- public string HSourceBillNo=string.Empty;
+ public string HSourceBillNo = string.Empty;
public string HBillType = "1201";//鍗曟嵁绫诲瀷
public string sBillCode = "ICStockBill";
public string sTranType = "1";
@@ -43,16 +44,17 @@
public string sSourceTypeName = "閲囪喘璁㈠崟";
public string sRedBlue2 = "钃濆瓧";
//public bool sRedBlue = false;
- public WebServer webserver =new WebServer();
- public DataSet ds =new DataSet();
- public ClsGy_BarCodeBill_WMS_Model_View oView =new ClsGy_BarCodeBill_WMS_Model_View();
- public ClsKF_PonderationBillMain_Temp model =new ClsKF_PonderationBillMain_Temp();
+ public WebServer webserver = new WebServer();
+ public DataSet ds = new DataSet();
+ public ClsGy_BarCodeBill_WMS_Model_View oView = new ClsGy_BarCodeBill_WMS_Model_View();
+ public ClsKF_PonderationBillMain_Temp model = new ClsKF_PonderationBillMain_Temp();
public ClsKf_ICStockBill_WMS oBar = new Model.ClsKf_ICStockBill_WMS();
public double sRelQty = 0;
- // private DataBaseServices objDataBaseServices = new DataBaseServices();
+ SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+ // private DataBaseServices objDataBaseServices = new DataBaseServices();
private JsonResult objJsonResult = new JsonResult();
- // private string msgModel = "{{\"count\":{0},\"code\":{0},\"message\":\"{1}\",\"result\":{2}}}";
+ // private string msgModel = "{{\"count\":{0},\"code\":{0},\"message\":\"{1}\",\"result\":{2}}}";
public static string GetSession(string sMsg)
{
@@ -75,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>
@@ -113,7 +180,7 @@
{
HBillType = "1239";
}
- oBar = webserver.get_CheckTypeByBarCode_All(sCode, sInterID, HBillType, sBillNo, sMaker, WhID, SPID, sQty, sRedBlue, SourceFlag, sSourceBillNo, sSourceType, HOWNERID,sExpressNumber, ref DBUtility.ClsPub.sErrInfo);
+ oBar = webserver.get_CheckTypeByBarCode_All(sCode, sInterID, HBillType, sBillNo, sMaker, WhID, SPID, sQty, sRedBlue, SourceFlag, sSourceBillNo, sSourceType, HOWNERID, sExpressNumber, ref DBUtility.ClsPub.sErrInfo);
if (oBar == null)
{
objJsonResult.code = "0";
@@ -168,16 +235,16 @@
objJsonResult.count = 0;
objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + HSourceBillType;
objJsonResult.data = null;
- return objJsonResult;
+ return objJsonResult;
}
else
- {
+ {
objJsonResult.code = "0";
objJsonResult.count = 1;
objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�";
objJsonResult.data = ds.Tables[0];
return objJsonResult;
-
+
}
}
catch (Exception ex)
@@ -199,12 +266,12 @@
/// <returns></returns>
[Route("POStockInBill/set_SavePonderationBillMain_Temp_Source_Fast_Json")]
[HttpGet]
- public object set_SavePonderationBillMain_Temp_Source_Fast_Json(string HSourceBillType,string HSourceBillNo, Int64 sInterID, string sBillNo)
+ public object set_SavePonderationBillMain_Temp_Source_Fast_Json(string HSourceBillType, string HSourceBillNo, Int64 sInterID, string sBillNo)
{
try
{
- // DataSet ds = new DataSet();
- // WebServer webserver = new WebServer();
+ // DataSet ds = new DataSet();
+ // WebServer webserver = new WebServer();
string sWhere = " Where 鍗曟嵁鍙� like '%" + HSourceBillNo.Trim() + "'";
//鏍规嵁婧愬崟绫诲瀷鏉ヨ皟鐢ㄤ笉鍚岀殑WEBS鏂规硶 new
if (HSourceBillType == "1102")
@@ -213,7 +280,7 @@
}
else if (HSourceBillType == "1103")
{
- ds = webserver.GetCg_PoInStockBillList(sWhere + " and isnull(HBillSubType,0)=12510 ");
+ ds = webserver.GetCg_PoInStockBillList(sWhere + "");
}
else
{
@@ -259,14 +326,89 @@
}
catch (Exception ex)
{
-
+
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�"+ex.ToString();
+ objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString();
objJsonResult.data = null;
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>
@@ -299,12 +441,12 @@
}
catch (Exception e)
{
-
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�"+e.ToString();
- objJsonResult.data = null;
- return objJsonResult;
+
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
}
}
/// <summary>
@@ -327,7 +469,7 @@
{
objJsonResult.code = "0";
objJsonResult.count = 1;
- objJsonResult.Message ="";
+ objJsonResult.Message = "";
objJsonResult.data = null;
return objJsonResult;
}
@@ -335,7 +477,7 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "澶辫触锛�"+DBUtility.ClsPub.sErrInfo;
+ objJsonResult.Message = "澶辫触锛�" + DBUtility.ClsPub.sErrInfo;
objJsonResult.data = null;
return objJsonResult;
}
@@ -363,7 +505,7 @@
else
{
- if (webserver.set_SavePonderationBillMain_Temp_Source_SourceBillType(sInterID, sBillNo, HBillType, sBarCode, sRedBlue2, ref HSourceBillNo, ref sSourceTypeName, ref HSupID, ref HSupName, ref HDeptID, ref HDeptName, ref DBUtility.ClsPub.sErrInfo))
+ if (webserver.set_SavePonderationBillMain_Temp_Source_SourceBillType(sInterID, sBillNo, HBillType, sBarCode, sRedBlue2, ref HSourceBillNo, ref sSourceTypeName, ref HSupID, ref HSupName, ref HDeptID, ref HDeptName, ref DBUtility.ClsPub.sErrInfo))
{
//----------鍒涘缓铏氳〃------------------------
DataTable dt_Main = new DataTable("Json");
@@ -424,7 +566,7 @@
[HttpGet]
public object get_InfoByBarCode_Source_Json(string sBarCode, Int64 sInterID, string sBillNo, Double sQty, Int64 HWHID, Int64 HSPID)
{
- // string sRedBlue = "钃濆瓧";
+ // string sRedBlue = "钃濆瓧";
try
{
string sErrMsg = "";
@@ -473,12 +615,12 @@
}
catch (Exception e)
{
-
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "鎵爜澶辫触,姝ゆ潯鐮佷笉瀛樺湪锛�"+e.ToString();
- objJsonResult.data = null;
- return objJsonResult;
+
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎵爜澶辫触,姝ゆ潯鐮佷笉瀛樺湪锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
}
}
/// <summary>
@@ -487,7 +629,7 @@
/// <returns></returns>
[Route("POStockInBill/set_SavePOStockInBackBill_Json")]
[HttpPost]
- public object set_SavePOStockInBackBill_Json([FromBody]JObject oMain)
+ public object set_SavePOStockInBackBill_Json([FromBody] JObject oMain)
{
var _value = oMain["oMain"].ToString();
string msg1 = _value.ToString();
@@ -543,7 +685,7 @@
/// <returns></returns>
[Route("POStockInBill/set_SavePOStockInBill_Json")]
[HttpPost]
- public object set_SavePOStockInBill_Json([FromBody]JObject oMain)
+ public object set_SavePOStockInBill_Json([FromBody] JObject oMain)
{
var _value = oMain["oMain"].ToString();
string msg1 = _value.ToString();
@@ -572,10 +714,10 @@
websLsmain.HManagerID = 0;
websLsmain.HBillerID = lsmain[0].HBillerID;
websLsmain.HRemark = "";
- websLsmain.HExplanation = "";
websLsmain.HInnerBillNo = "";
websLsmain.HRedBlueFlag = false;//false钃濆瓧 true绾㈠瓧
websLsmain.HMainSourceBillType = lsmain[0].HBillType;
+ websLsmain.HExplanation = lsmain[0].HExplanation;
if (webserver.set_SavePOStockInBill_New(websLsmain, sSourceBillType, ref DBUtility.ClsPub.sErrInfo))
@@ -605,16 +747,75 @@
}
}
+
+ /// <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)
+ public object GetSpName_Json(long HSpID, long HWHID, long HStockOrgID, ref string sErrMsg)
{
try
{
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 = "娌℃湁杩斿洖浠讳綍璁板綍锛�";
@@ -650,7 +851,7 @@
string sErrMsg = string.Empty;
try
{
- if (webserver.set_DelPonderationBillMain_Temp_InterIDAndSource(HInterID, HMaterID,HAuxPropID,HMTONo,HSourceInterID,HSourceEntryID,sHBillType,ref sErrMsg))
+ if (webserver.set_DelPonderationBillMain_Temp_InterIDAndSource(HInterID, HMaterID, HAuxPropID, HMTONo, HSourceInterID, HSourceEntryID, sHBillType, ref sErrMsg))
{
objJsonResult.code = "0";
objJsonResult.count = 1;
@@ -719,7 +920,7 @@
[Route("POStockInBillList/DisBillEntryList_Mate_Webs_Json")]
[HttpGet]
- public object DisBillEntryList_Webs_Json(string HBillType,string sWhere)
+ public object DisBillEntryList_Webs_Json(string HBillType, string sWhere)
{
try
{
@@ -789,5 +990,273 @@
}
+
+ #region 鍒拌揣鐐规暟
+ [Route("POStockInBillList/get_InfoByBillNo")]
+ [HttpGet]
+ public object get_InfoByBillNo(string HBillno)
+ {
+ try
+ {
+ string sqlwhere = " where 1=1 ";
+ if (!String.IsNullOrEmpty(HBillno))
+ sqlwhere += "and 鍗曟嵁鍙�='" + HBillno + "'";
+ string sql = $"select * from h_v_Cg_POInStockBillList {sqlwhere} ";
+ ds = oCn.RunProcReturn(sql, "h_v_Cg_POInStockBillList");
+ if (ds == null || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[0];
+ return objJsonResult;
+ }
+ }
+ catch (Exception)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "澶辫触 锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ }
+
+
+ //[Route("POStockInBillList/confirm")]
+ //public object confirm(string hmainid)
+ //{
+ // try
+ // {
+ // JObject model = new JObject();
+ // model.Add("FBILLTYPEID", new JObject() { ["Fnumber"] = "SLD01_SYS" }); //鍗曟嵁绫诲瀷
+ // model.Add("FDate", DateTime.Now.ToString("yyyy-MM-dd")); //閫氱煡鏃ユ湡
+ // model.Add("FStockOrgId", new JObject() { ["Fnumber"] = (this.Model.GetValue("FHPURCHASEORGID") as DynamicObject)?["Number"].ToString() ?? "" }); // 鏀舵枡缁勭粐
+ // model.Add("FPurOrgId", new JObject() { ["Fnumber"] = (this.Model.GetValue("FHPURCHASEORGID") as DynamicObject)?["Number"].ToString() ?? "" }); //閲囪喘缁勭粐
+ // model.Add("FSupplierId", new JObject() { ["Fnumber"] = (this.Model.GetValue("FSupplierID") as DynamicObject)?["Number"].ToString() ?? "" }); //渚涘簲鍟�
+ // model.Add("FOwnerTypeIdHead", "BD_OwnerOrg");// 璐т富绫诲瀷
+ // model.Add("FOwnerIdHead", new JObject() { ["Fnumber"] = (this.Model.GetValue("FHPURCHASEORGID") as DynamicObject)?["Number"].ToString() ?? "" });//璐т富
+ // //瀛愯〃 鏁版嵁妯″瀷
+ // JArray Fentity = new JArray();
+ // foreach (var item in entityRows)
+ // {
+ // if (Convert.ToBoolean(item["FCloseStatus"]))
+ // continue;
+ // JObject FentityModel = new JObject();
+ // FentityModel.Add("FMaterialId", new JObject() { ["Fnumber"] = (item["FHMaterID"] as DynamicObject)?["Number"].ToString() ?? "" }); // 鐗╂枡缂栫爜
+ // FentityModel.Add("FUnitID", new JObject() { ["Fnumber"] = (item["FUnitID"] as DynamicObject)?["Number"].ToString() ?? "" }); // 鍗曚綅
+ // FentityModel.Add("FPreDeliveryDate", this.Model.GetValue("FHDate").ToString()); //棰勮鍒拌揣鏃ユ湡
+ // FentityModel.Add("FPriceUnitId", new JObject() { ["Fnumber"] = (item["FUnitID"] as DynamicObject)?["Number"].ToString() ?? "" }); // 璁′环鍗曚綅
+ // FentityModel.Add("FStockUnitID", new JObject() { ["Fnumber"] = (item["FUnitID"] as DynamicObject)?["Number"].ToString() ?? "" }); // 搴撳瓨鍗曚綅
+ // FentityModel.Add("FActReceiveQty", Convert.ToDecimal(item["FHQty"]) - Convert.ToDecimal(item["FReciveCount"])); // 渚涘簲鍟嗛�佽揣鏁伴噺锛堟彁鏂欒鍒掓暟閲� - 宸茬敓鎴愰�佽揣鍗曟暟閲忥級
+ // FentityModel.Add("FOwnerTypeId", "BD_OwnerOrg");//璐т富绫诲瀷
+ // FentityModel.Add("FOwnerID", new JObject() { ["Fnumber"] = (this.Model.GetValue("FHPURCHASEORGID") as DynamicObject)?["Number"].ToString() ?? "" });//璐т富
+ // FentityModel.Add("FSrcId", item["FHPOOrderInterID"].ToString());//婧愬崟鍐呯爜
+ // FentityModel.Add("FSRCFORMID", "PUR_PurchaseOrder");//婧愬崟绫诲瀷
+ // FentityModel.Add("FSrcBillNo", item["FHPOOrderBillNo"].ToString());//婧愬崟鍗曞彿
+ // 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();
+ // FentityModel2.Add("FDetailEntity_Link_FRULEID", "a8c6b6e5-a8c0-4fc1-8592-6b76c2136cf9");
+ // FentityModel2.Add("FDetailEntity_Link_FSTableName", "t_PUR_POOrderEntry");
+ // FentityModel2.Add("FDetailEntity_Link_FSBillId", item["FHPOOrderInterID"].ToString());
+ // FentityModel2.Add("FDetailEntity_Link_FSId", item["FHPOOrderEntryID"].ToString());
+ // Fentity2.Add(FentityModel2);
+ // FentityModel.Add("FDetailEntity_Link", Fentity2);
+ // Fentity.Add(FentityModel);
+ // }
+ // model.Add("FDetailEntity", Fentity); //鏄庣粏淇℃伅
+
+ // JObject _FentityModel = new JObject();
+ // _FentityModel.Add("FSettleOrgId", new JObject() { ["Fnumber"] = (this.Model.GetValue("FHPURCHASEORGID") as DynamicObject)?["Number"].ToString() ?? "" }); // 缁撶畻缁勭粐
+ // _FentityModel.Add("FSettleCurrId", new JObject() { ["Fnumber"] = (this.Model.GetValue("FSettleCurrId") as DynamicObject)?["Number"].ToString() ?? "" }); // 缁撶畻甯佸埆
+ // _FentityModel.Add("FPricePoint", 0); // 瀹氫环鏃剁偣
+ // model.Add("FinanceEntity ", _FentityModel);//璐㈠姟淇℃伅
+ // JObject jsonRoot = new JObject()
+ // {
+ // ["Creator"] = "",
+ // ["NeedUpDateFields"] = new JArray(),
+ // ["NeedReturnFields"] = new JArray(),
+ // ["IsDeleteEntry"] = "false",
+ // ["SubSystemId"] = "",
+ // ["IsVerifyBaseDataField"] = "false",
+ // //["IsAutoSubmitAndAudit"] = true,//鑷姩璋冪敤鎻愪氦鍜屽鏍稿姛鑳�
+ // ["Model"] = model
+ // };
+ // var result = cloudClient.Save("PUR_ReceiveBill", jsonRoot.ToString());
+ // JObject saveObj = JObject.Parse(result);
+ // string saveIsSuc = saveObj["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper();
+ // }
+ // catch (Exception)
+ // {
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "澶辫触 锛�";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ // }
+
+ //}
+ #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
+
+ #region PDA閿�鍞嚭搴�
+ //PDA閿�鍞嚭搴撴暣鎵樺垹闄�
+ [Route("POStockInBillList/SellOutBillSDeleCode")]
+ [HttpGet]
+ public object SellOutBillSDeleCode(string HBarCode,string HInterID)
+ {
+ try
+ {
+ //鏍规嵁鏉$爜鍦ㄦ潯鐮佹。妗堜腑鎵惧埌瀵瑰簲鐨勬墭鏉$爜锛屽啀鍦ㄤ复鏃惰〃涓垹闄よ鎵樻潯鐮佺殑鍏ㄩ儴璁板綍
+ string sql = string.Format(@"delete from KF_PonderationBillMain_Temp where HBillType=1205 and HInterID=" + HInterID + " and HBarCode" +
+ " in (select HBarCode from Gy_BarCodeBill where HBarCode_Pack = (select HBarCode_Pack from Gy_BarCodeBill where HBarCode = '"+ HBarCode + "'))");
+ oCn.RunProc(sql);
+
+ 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