From 64dfc6fe76317b0bc2c06b5aff6aa4ef37b47ae9 Mon Sep 17 00:00:00 2001
From: yxj <1qaz@123>
Date: 星期五, 08 七月 2022 16:52:03 +0800
Subject: [PATCH] 新增工序转移单(生成生产入库单、直接调拨单)上传方法;直接调拨无源单上传方法中表头、表体增加递入MainCustom、SubCustom;生产入库(源单生产订单)表体增加递入辅助属性
---
CLOUDWEB/WebService1.asmx.cs | 664 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 663 insertions(+), 1 deletions(-)
diff --git a/CLOUDWEB/WebService1.asmx.cs b/CLOUDWEB/WebService1.asmx.cs
index fe087d6..7110f47 100644
--- a/CLOUDWEB/WebService1.asmx.cs
+++ b/CLOUDWEB/WebService1.asmx.cs
@@ -6066,6 +6066,9 @@
else
{
string sJson_StockStyle = "";
+ string sJson_MainCustom = ""; //涓昏〃鑷畾涔夊瓧娈�
+ sJson_MainCustom = Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["MainCustom"]);
+
if (oSystemParameterMain.WMS_CampanyName == "闊╃數") //绯荤粺鍙傛暟 瀹㈡埛瀹氬埗鍖栧悕绉� 绌虹櫧涓洪�氱敤
{
sJson_StockStyle = "\"F_CHLX\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["F_CHLX"]) + "\","; //鍑鸿揣绫诲瀷
@@ -6095,11 +6098,13 @@
"\"FDate\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FDate"]) + "\"," +
"\"FBaseCurrId\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FBaseCurrId"]) + "\" }," +
sJson_StockStyle +
+ sJson_MainCustom +
"\"FBillEntry\": [ ";
string sJson_Entry = "";
string sJson_SrcStockPlace = "";
string sJson_DestStockPlace = "";
string sJson_FAUXPROPID = "";
+
for (int i = 0; i < Ds.Tables[1].Rows.Count; i++)
{
if (sJson_Entry != "")
@@ -6107,6 +6112,11 @@
sJson_Entry = sJson_Entry + " , ";
}
string sJson_BatchNo = "";
+ string sJson_SubCustom = ""; //瀛愯〃鑷畾涔夊瓧娈�
+
+ //瀛愯〃鑷畾涔夊瓧娈�
+ sJson_SubCustom = Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["SubCustom"]);
+
if (Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["HISBATCHMANAGE"]) == "1") //鏄惁鍚敤鎵规绠$悊
{
sJson_BatchNo = " \"FLOT\": {\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FLOT"]) + "\"}, \"FLOT_TEXT\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FLOT"]) + "\" , ";
@@ -6193,6 +6203,7 @@
"\"FPriceBaseQty\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FPriceQty"]) + "\"," +
"\"FTransReserveLink\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FTransReserveLink"]) + "," +
"\"FCheckDelivery\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FCheckDelivery"]) + "," +
+ sJson_SubCustom +
//"\"FSRCBILLTYPEID\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCBILLTYPEID"]) + "\"," +
//"\"FSRCBILLNO\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCBILLNO"]) + "\"," +
//"\"FORDERTYPE\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FORDERTYPE"]) + "\" }," +
@@ -24675,6 +24686,7 @@
}
string sJson_BatchNo = "";
string sJson_StockPlace = "";
+ string sJson_FAUXPROPID = "";
string sJson_SubCustom = ""; //瀛愯〃鑷畾涔夊瓧娈�
sJson_SubCustom = Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["SubCustom"]);
@@ -24687,6 +24699,10 @@
{
sJson_BatchNo = "";
}
+
+ //杈呭姪灞炴��
+ sJson_FAUXPROPID = " \"FAUXPROPID\":{\"FAUXPROPID__FF100002\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FAUXPROPID"]) + "\"}},";
+
//浠撲綅
if (Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FStockLocId"]) == "")
{
@@ -24720,6 +24736,7 @@
sJson_BatchNo +
" \"FISBACKFLUSH\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FISBACKFLUSH"]) + "," +
//" \"FAUXPROPID\":{\"FAUXPROPID__FF100002\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FAUXPROPID"]) + "\"}}," +
+ sJson_FAUXPROPID +
" \"FMTONO\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMTONO"]) + "\"," +
" \"FPROJECTNO\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FPROJECTNO"]) + "\"," +
" \"FWORKSHOPID1\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FWORKSHOPID1"]) + "\"}," +
@@ -28772,7 +28789,7 @@
#endregion
- #region 宸ュ簭姹囨姤杞Щ鍗� *
+ #region 宸ュ簭姹囨姤杞Щ鍗� *鐢熸垚鐢熶骇鍏ュ簱鍗曘�侀鏂欏嚭搴撳崟
//鐢熸垚宸ュ簭姹囨姤杞Щ鍗�
[WebMethod]
@@ -29410,6 +29427,651 @@
#endregion
+ #region 宸ュ簭姹囨姤杞Щ鍗� *鐢熸垚鐢熶骇鍏ュ簱鍗曘�佺洿鎺ヨ皟鎷ㄥ崟
+
+ //鐢熸垚宸ュ簭姹囨姤杞Щ鍗� 鐢熶骇鍏ュ簱鍗曘�佺洿鎺ヨ皟鎷ㄥ崟
+ [WebMethod]
+ public bool set_SaveProcReportMoveBill_MoveStock(Model.ClsKf_ProductInBillMain oMain, Int64 HOutBillID, string HOutBillNo, string HPPBomBillNo, Int64 HSCWHID, Int64 HSCSPID, ref string sErrMsg)
+ {
+ //鑾峰彇绯荤粺鍙傛暟
+ Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
+ if (oSystemParameter.ShowBill(ref sErrMsg) == false)
+ {
+ sErrMsg = "鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg;
+ return false;
+ }
+
+ //涓婁紶鍓嶅垽鏂�
+ SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+ DataSet Ds = oCn.RunProcReturn("exec h_p_WMS_PreUploadJudgment_ProcReportMoveStock " + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "'," + HOutBillID.ToString() + ",'" + HOutBillNo + "','" + HPPBomBillNo + "'," + HSCWHID.ToString() + "," + HSCSPID.ToString() + "," + oMain.HOWNERID.ToString(), "h_p_WMS_PreUploadJudgment_ProcReportMoveStock");
+ if (Ds == null || Ds.Tables[0].Rows.Count == 0)
+ {
+ sErrMsg = "涓婁紶鍓嶅垽鏂暟鎹畬鏁存�уけ璐ワ紒";
+ return false;
+ }
+ else
+ {
+ if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0][0]) == 1)
+ {
+ sErrMsg = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]);
+ return false;
+ }
+ }
+
+ if (set_SaveProcReportMoveBill_MoveStock_CLD_New(oMain, HOutBillID, HOutBillNo, oSystemParameter.omodel, ref sErrMsg) == true)
+ {
+ //"淇濆瓨鎴愬姛锛�";
+ return true;
+ }
+ else
+ {
+ //"淇濆瓨澶辫触锛�";
+ return false;
+ }
+
+ sErrMsg = "淇濆瓨宸ュ簭姹囨姤杞Щ鍗曞け璐ワ紒" + sErrMsg;
+ return false;
+ }
+
+ //鐢熸垚宸ュ簭姹囨姤杞Щ鍗�
+ [WebMethod]
+ public bool set_SaveProcReportMoveBill_MoveStock_CLD_New(Model.ClsKf_ProductInBillMain oMain, Int64 HOutBillID, string HOutBillNo, Pub_Class.ClsXt_SystemParameterMain oSystemParameterMain, ref string sErrMsg)
+ {
+ if (SaveProcReportMoveBill_MoveStock_CLD(oMain, HOutBillID, HOutBillNo, oSystemParameterMain, ref sErrMsg))
+ {
+ //"淇濆瓨鎴愬姛锛�";
+ sErrMsg = "淇濆瓨鎴愬姛锛佺敓浜у叆搴撳崟鍙凤細" + oMain.HBillNo + "锛岀洿鎺ヨ皟鎷ㄥ崟鍙凤細" + HOutBillNo;
+ return true;
+ }
+ else
+ {
+ //"淇濆瓨澶辫触锛�";
+ sErrMsg = "鐢熶骇鍏ュ簱鍗曞彿锛�" + oMain.HBillNo + "锛岀敓浜у叆搴撳崟ID锛�" + oMain.HInterID + "锛岀洿鎺ヨ皟鎷ㄥ崟鍙凤細" + HOutBillNo + "锛岀洿鎺ヨ皟鎷ㄥ崟ID锛�" + HOutBillID + "锛�" + sErrMsg;
+ return false;
+ }
+ }
+
+ /// <summary>
+ /// 宸ュ簭姹囨姤杞Щ鍗� 鐢熶骇鍏ュ簱鍗� 婧愬崟锛氱敓浜ф眹鎶ュ崟 鐩存帴璋冩嫧鍗� 婧愬崟锛氱敓浜х敤鏂欐竻鍗�
+ /// </summary>
+ /// <param name="oMain"></param>
+ /// <param name="sErrMsg"></param>
+ /// <returns></returns>
+ public bool SaveProcReportMoveBill_MoveStock_CLD(Model.ClsKf_ProductInBillMain oMain, Int64 HOutBillID, string HOutBillNo, Pub_Class.ClsXt_SystemParameterMain oSystemParameterMain, ref string sErrMsg)
+ {
+ SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); //寤虹珛涓�涓� 浜嬪姟锛�
+ try
+ {
+ //鍒ゆ柇浼氳鏈熸槸鍚﹀悎鐞�
+ string s = "";
+ int sYear = 0;
+ int sPeriod = 0;
+ if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(oMain.HDate, ref sYear, ref sPeriod, ref s) == false)
+ {
+ sErrMsg = s;
+ return false;
+ }
+ oMain.HYear = sYear;
+ oMain.HPeriod = sPeriod;
+
+ oCn.BeginTran();
+ //鐢熸垚鍑哄叆搴撳崟鎹�
+ //鎻掑叆瀛愯〃
+ oCn.RunProc("EXEC h_p_Kf_ProductInBillSub_Insert_New " + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "','3711'");
+ //鎻掑叆涓昏〃
+ oCn.RunProc("Insert Into Kf_ICStockBillMain " +
+ "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMainSourceBillType" +
+ ",HYear,HPeriod,HRemark,HMaker,HMakeDate" +
+ ",HSupID,HWHID,HSCWHID,HEmpID,HManagerID,HSecManagerID" +
+ ",HKeeperID,HDeptID,HExplanation,HInnerBillNo,HRedBlueFlag" +
+ ",HSTOCKORGID,HOWNERID" +
+ ") " +
+ " values('1202','1202'," + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "',convert(varchar(10),getdate(),120),'" + oMain.HMainSourceBillType + "'" +
+ ", " + oMain.HYear.ToString() + "," + oMain.HPeriod.ToString() + ",'" + oMain.HRemark + "','" + oMain.HMaker + "',convert(varchar(10),getdate(),120)" +
+ ", " + oMain.HSupID.ToString() + "," + oMain.HWHID.ToString() + "," + oMain.HSCWHID.ToString() + "," + oMain.HEmpID.ToString() + "," + oMain.HManagerID.ToString() + "," + oMain.HSecManagerID.ToString() +
+ ", " + oMain.HKeeperID.ToString() + "," + oMain.HDeptID.ToString() + ",'" + oMain.HExplanation + "','" + oMain.HBillNo + "'," + DBUtility.ClsPub.BoolToString(oMain.HRedBlueFlag) +
+ ", " + oMain.HSTOCKORGID.ToString() + "," + oMain.HOWNERID.ToString() +
+ ") ");
+ //鏇存柊鍏宠仈鏁伴噺
+ oCn.RunProc("exec h_p_Sc_UpDateRelation_ICMOReportToProductIn_Add " + oMain.HInterID.ToString());
+
+ if (oSystemParameterMain.Kf_ProductInBill_AutoCheck == "Y") //绯荤粺鍙傛暟 鑷姩瀹℃牳
+ {
+ //瀹℃牳鍗曟嵁
+ oCn.RunProc("Update Kf_ICStockBillMain Set HChecker='" + oMain.HMaker + "',HCheckDate=convert(varchar(10),getdate(),120) where HInterID= " + oMain.HInterID.ToString());
+ }
+ oCn.Commit();
+ }
+ catch (Exception e)
+ {
+ sErrMsg = "鐢熸垚宸ュ簭姹囨姤杞Щ涓敓浜у叆搴撳崟澶辫触ERP锛�" + e.Message;
+ oCn.RollBack();
+ return false;
+ }
+
+ try
+ {
+ //鏍规嵁TMP琛� 杩斿洖 瀛愯〃淇℃伅
+ DataSet Ds;
+ Ds = oCn.RunProcReturn("exec h_p_Kf_GetProductInBill_ICMOReport_CLD_New " + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "'", "h_p_Kf_GetProductInBill_ICMOReport_CLD_New");
+ if (Ds == null || Ds.Tables[0].Rows.Count == 0 || Ds.Tables[1].Rows.Count == 0)
+ {
+ sErrMsg = "鑾峰彇宸ュ簭姹囨姤杞Щ涓敓浜у叆搴撳崟瀛愯〃淇℃伅澶辫触锛�";
+ return false;
+ }
+ else
+ {
+ string sJson_Main = "{\"Creator\":\"\",\"NeedUpDateFields\":[],\"NeedReturnFields\":[],\"IsDeleteEntry\":\"True\",\"SubSystemId\":\"\",\"IsVerifyBaseDataField\":\"false\"," +
+ "\"IsEntryBatchFill\":\"false\",\"ValidateFlag\":\"True\",\"NumberSearch\":\"True\",\"InterationFlags\":\"\"," +
+ "\"Model\": { \"FBILLNO\":\"" + oMain.HBillNo + "\"," +
+ //\"FID\":\"0\",
+ "\"FBillType\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FBillType"]) + "\"}," +
+ "\"FDate\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FDate"]) + "\"," +
+ "\"FSTOCKORGID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FSTOCKORGID"]) + "\"}," +
+ //\"FStockId0\":{\"FNumber\":\"\"},
+ "\"FPRDORGID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FPRDORGID"]) + "\"}," +
+ //\"FWorkShopId\":{\"FNumber\":\"\"},
+ "\"FOWNERTYPEID0\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FOWNERTYPEID0"]) + "\"," +
+ "\"FOWNERID0\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FOWNERID0"]) + "\"}," +
+ //\"FSTOCKERID\":{\"FNAME\":\"\"},
+ //\"FDescription\":\"\",
+ "\"FISENTRUST\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FISENTRUST"]) + "," +
+ //\"FCurrId\":{\"FNumber\":\"\"},
+ //\"FEntrustInStockId\":\"0\",
+ //\"FScanBox\":\"\",
+ "\"FEntity\": [ ";
+ string sJson_Entry = "";
+ for (int i = 0; i < Ds.Tables[1].Rows.Count; i++)
+ {
+ if (sJson_Entry != "")
+ {
+ sJson_Entry = sJson_Entry + " , ";
+ }
+ string sJson_BatchNo = "";
+ string sJson_StockPlace = "";
+ string sJson_FProduceDate = ""; //鐢熶骇鏃ユ湡
+ string sJson_FExpiryDate = ""; //鏈夋晥鏈熻嚦
+ if (Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["HISBATCHMANAGE"]) == "1") //鏄惁鍚敤鎵规绠$悊
+ {
+ sJson_BatchNo = " \"FLOT\": {\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FLOT"]) + "\"}, \"FLOT_TEXT\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FLOT"]) + "\" , ";
+ }
+ else
+ {
+ sJson_BatchNo = "";
+ }
+
+ if (Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FISKFPERIOD"]) == "1") //鏄惁鍚敤淇濊川鏈熸帶鍒�
+ {
+ sJson_FProduceDate = " \"FProduceDate\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FProduceDate"]) + "\",";
+ sJson_FExpiryDate = " \"FExpiryDate\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FExpiryDate"]) + "\",";
+ }
+ else
+ {
+ sJson_FProduceDate = "";
+ sJson_FExpiryDate = "";
+ }
+
+ //浠撲綅
+ if (Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSTOCKLOCID"]) == "")
+ {
+ sJson_StockPlace = "";
+ }
+ else
+ {
+ sJson_StockPlace = Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSTOCKLOCID"]) + "\"}},";
+ }
+ //
+ sJson_Entry = sJson_Entry + " {" +
+ //\"FEntryID\":\"0\",
+ " \"FSRCENTRYID\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCENTRYID"]) + "," +
+ " \"FIsNew\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FIsNew"]) + "," +
+ " \"FMATERIALID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMATERIALID"]) + "\"}," +
+ " \"FCHECKPRODUCT\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FCHECKPRODUCT"]) + "," +
+ " \"FINSTOCKTYPE\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FINSTOCKTYPE"]) + "\"," +
+ " \"FPRODUCTTYPE\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FPRODUCTTYPE"]) + "\"," +
+ " \"FUNITID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FUNITID"]) + "\"}," +
+ " \"FMUSTQTY\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMUSTQTY"]) + "," +
+ " \"FREALQTY\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FREALQTY"]) + "," +
+ " \"FCostRate\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FCOSTWEIGHT"]) + "," +
+ " \"FBASEUNITID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBASEUNITID"]) + "\"}," +
+ " \"FBASEMUSTQTY\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBASEMUSTQTY"]) + "," +
+ " \"FBASEREALQTY\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBASEREALQTY"]) + "," +
+ " \"FOWNERTYPEID\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FOWNERTYPEID"]) + "\"," +
+ " \"FOWNERID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FOWNERID"]) + "\"}," +
+ " \"FSTOCKID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSTOCKID"]) + "\"}," +
+ sJson_StockPlace +
+ " \"FBOMID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBOMID"]) + "\"}," +
+ sJson_BatchNo +
+ " \"FISBACKFLUSH\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FISBACKFLUSH"]) + "," +
+ " \"FAUXPROPID\":{\"FAUXPROPID__FF100002\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FAUXPROPID"]) + "\"}}," +
+ " \"FMTONO\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMTONO"]) + "\"," +
+ " \"FPROJECTNO\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FPROJECTNO"]) + "\"," +
+ " \"FWORKSHOPID1\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FWORKSHOPID1"]) + "\"}," +
+ " \"FSHIFTGROUPID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSHIFTGROUPID"]) + "\"}," +
+ " \"FMOBILLNO\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMOBILLNO"]) + "\"," +
+ " \"FMOID\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMOID"]) + "," +
+ " \"FMOENTRYID\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMOENTRYID"]) + "," +
+ " \"FMOENTRYSEQ\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMOENTRYSEQ"]) + "," +
+ " \"FMemo\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMemo"]) + "\"," +
+ " \"FSTOCKUNITID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSTOCKUNITID"]) + "\"}," +
+ " \"FSTOCKREALQTY\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSTOCKREALQTY"]) + "," +
+ " \"FSECUNITID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSECUNITID"]) + "\"}," +
+ //\"FSecRealQty\":\"0\",
+ " \"FSRCBILLTYPE\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCBILLTYPE"]) + "\"," +
+ " \"FSRCBILLNO\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCBILLNO"]) + "\"," +
+ " \"FSRCINTERID\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCINTERID"]) + "," +
+ " \"FBASEPRDREALQTY\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBASEPRDREALQTY"]) + "," +
+ //\"FIsFinished\":\"false\",
+ //\"FStockStatusId\":{\"FNumber\":\"\"},
+ " \"FSRCENTRYSEQ\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCENTRYSEQ"]) + "," +
+ " \"FMOMAINENTRYID\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMOMAINENTRYID"]) + "," +
+ " \"FKEEPERTYPEID\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FKEEPERTYPEID"]) + "\"," +
+ " \"FKEEPERID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FKEEPERID"]) + "\"}," +
+ sJson_FProduceDate +
+ //\"FSelReStkQty\":\"0\",
+ sJson_FExpiryDate +
+ //\"FBaseSelReStkQty\":\"0\",
+ " \"FSNUNITID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSNUNITID"]) + "\"}," +
+ " \"FQAIP\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FQAIP"]) + "\"," +
+ " \"FREQSRC\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FREQSRC"]) + "\"," +
+ " \"FREQBILLNO\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FREQBILLNO"]) + "\"," +
+ " \"FREQBILLID\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FREQBILLID"]) + "," +
+ " \"FREQENTRYSEQ\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FREQENTRYSEQ"]) + "," +
+ " \"FREQENTRYID\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FREQENTRYID"]) + "," +
+
+ //\"FSerialSubEntity\":[{\"FDetailID\":\"0\",
+ //\"FSerialNo\":\"\",
+ //\"FSerialId\":{\"FNumber\":\"\"},
+ //\"FSerialNote\":\"\"}]
+
+ " \"FEntity_Link\": [ { " +
+ " \"FEntity_Link_FFlowId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntity_Link_FFlowId"]) + "\"," +
+ " \"FEntity_Link_FFlowLineId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntity_Link_FFlowLineId"]) + "\"," +
+ " \"FEntity_Link_FRuleId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntity_Link_FRuleId"]) + "\"," +
+ " \"FEntity_Link_FSTableName\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntity_Link_FSTableName"]) + "\"," +
+ " \"FEntity_Link_FSBillId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntity_Link_FSBillId"]) + "\"," +
+ " \"FEntity_Link_FSId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntity_Link_FSId"]) + "\"," +
+ " \"FEntity_Link_FBasePrdRealQtyOld\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntity_Link_FBasePrdRealQtyOld"]) + "," +
+ " \"FEntity_Link_FBasePrdRealQty\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntity_Link_FBasePrdRealQty"]) + "" +
+ " } ]," +
+ " \"FBFLOWID\":{\"FID\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBFLOWID"]) + "\"}}";
+ }
+ string sJson_End = " ] }}";
+ string sJson = sJson_Main + sJson_Entry + sJson_End;
+
+ //浠庨厤缃枃浠惰幏鍙� CLOUD缃戝潃銆佽处濂椾俊鎭�佺櫥褰曠敤鎴枫�佺櫥褰曞瘑鐮�
+ if (!Pub_Class.ClsPub.GetCLOUDLoginInfo(ref Pub_Class.ClsPub.sExeReturnInfo))
+ {
+ sErrMsg = Pub_Class.ClsPub.sExeReturnInfo;
+ return false;
+ }
+
+ //鑾峰彇CLOUD璐﹀彿瀵嗙爜
+ string sCLOUDUseName = Pub_Class.ClsPub.sCLOUDUseName;
+ string sCLOUDPsd = Pub_Class.ClsPub.sCLOUDPsd;
+ DataSet ds11 = get_SaveCLOUDUseNameandPsd(oMain.HInterID);
+ if (ds11 == null || ds11.Tables[0].Rows.Count == 0)
+ {
+ }
+ else
+ {
+ sCLOUDUseName = DBUtility.ClsPub.isStrNull(ds11.Tables[0].Rows[0]["HCloudUserName"]);
+ sCLOUDPsd = DBUtility.ClsPub.isStrNull(ds11.Tables[0].Rows[0]["HCloudUserPsd"]);
+ }
+
+ //鐢熸垚 鍏ュ簱鍗�
+ string HReturn;
+ ApiClient client = new ApiClient(Pub_Class.ClsPub.sCLOUDUrl);
+ string dbId = Pub_Class.ClsPub.sCLOUDAcc; //AotuTest117
+ bool bLogin = client.Login(dbId, sCLOUDUseName, sCLOUDPsd, 2052);
+ if (bLogin)
+ {
+ var result = client.Execute<string>("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Save",
+ new object[] { "PRD_INSTOCK", sJson }); //璋冪敤淇濆瓨鏂瑰紡
+
+ //鐢熸垚鍗曟嵁鍚庢洿鏂拌嚜瀹氫箟瀛楁
+ oCn.RunProc("exec h_p_Sc_UpDateSelfFildProductIn '" + oMain.HBillNo + "','3711'");
+
+ if (oSystemParameterMain.Kf_ProductInBill_AutoCheck == "Y") //绯荤粺鍙傛暟 鑷姩瀹℃牳
+ {
+ string sJson2 = "{\"CreateOrgId\":0,\"Numbers\":[\"" + oMain.HBillNo + "\"]}";
+ var result2 = client.Execute<string>("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Submit",
+ new object[] { "PRD_INSTOCK", sJson2 }); //鎻愪氦鍗曟嵁
+
+ string sJson3 = "{\"CreateOrgId\":0,\"Numbers\":[\"" + oMain.HBillNo + "\"]}";
+ var result3 = client.Execute<string>("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Audit",
+ new object[] { "PRD_INSTOCK", sJson3 }); //瀹℃牳鍗曟嵁
+
+ HReturn = result.ToString() + "," + result2.ToString() + "," + result3.ToString();
+ }
+ else
+ {
+ HReturn = result.ToString();
+ }
+ if (HReturn.Contains("\"IsSuccess\":false") == true)
+ {
+ sErrMsg = "宸ュ簭姹囨姤杞Щ鐢熸垚鐢熶骇鍏ュ簱鍗曞け璐ワ紒" + HReturn + sJson;
+ return false;
+ }
+ else
+ {
+ if (SaveMoveStockBill_ProcReportMove_CLD(oMain, HOutBillID, HOutBillNo, oSystemParameterMain, ref sErrMsg))
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ }
+ else
+ {
+ sErrMsg = "宸ュ簭姹囨姤杞Щ鐢熸垚鐢熶骇鍏ュ簱鍗曞け璐ワ紒鐧诲綍澶辫触锛�";
+ return false;
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ sErrMsg = "宸ュ簭姹囨姤杞Щ鐢熸垚鐢熶骇鍏ュ簱鍗曞け璐ワ紒" + e.Message;
+ return false;
+ }
+ }
+
+
+ /// <summary>
+ /// 宸ュ簭姹囨姤杞Щ鍗� 鐩存帴璋冩嫧鍗� 锛堟簮鍗曪細鐢熶骇鐢ㄦ枡娓呭崟锛�
+ /// </summary>
+ /// <param name="oMain"></param>
+ /// <param name="sErrMsg"></param>
+ /// <returns></returns>
+ public bool SaveMoveStockBill_ProcReportMove_CLD(Model.ClsKf_ProductInBillMain oMain, Int64 HOutBillID, string HOutBillNo, Pub_Class.ClsXt_SystemParameterMain oSystemParameterMain, ref string sErrMsg)
+ {
+ SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+ try
+ {
+ //鍒ゆ柇浼氳鏈熸槸鍚﹀悎鐞�
+ string s = "";
+ int sYear = 0;
+ int sPeriod = 0;
+ if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(oMain.HDate, ref sYear, ref sPeriod, ref s) == false)
+ {
+ sErrMsg = s;
+ return false;
+ }
+ oMain.HYear = sYear;
+ oMain.HPeriod = sPeriod;
+
+ oCn.BeginTran();
+ //鍐欏叆WMS璋冩嫧鍗�
+ //鎻掑叆瀛愯〃
+ oCn.RunProc("EXEC h_p_Kf_MoveStockBillSub_Insert_ProcReportMove " + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "'," + HOutBillID.ToString() + ",'" + HOutBillNo + "'");
+ //鎻掑叆涓昏〃
+ oCn.RunProc("Insert Into Kf_ICStockBillMain " +
+ "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMainSourceBillType" +
+ ",HYear,HPeriod,HRemark,HMaker,HMakeDate" +
+ ",HSupID,HWHID,HSCWHID,HEmpID,HManagerID,HSecManagerID" +
+ ",HKeeperID,HDeptID,HExplanation,HInnerBillNo,HRedBlueFlag" +
+ ",HSTOCKORGID,HOWNERID" +
+ ") " +
+ " values('1207','1207'," + HOutBillID.ToString() + ",'" + HOutBillNo + "',convert(varchar(10),getdate(),120),'鐢熶骇浠诲姟鍗�-鎶曟枡'" +
+ ", " + oMain.HYear.ToString() + "," + oMain.HPeriod.ToString() + ",'" + oMain.HRemark + "','" + oMain.HMaker + "',convert(varchar(10),getdate(),120)" +
+ ", " + oMain.HSupID.ToString() + "," + oMain.HWHID.ToString() + "," + oMain.HSCWHID.ToString() + "," + oMain.HEmpID.ToString() + "," + oMain.HManagerID.ToString() + "," + oMain.HSecManagerID.ToString() +
+ ", " + oMain.HKeeperID.ToString() + "," + oMain.HDeptID.ToString() + ",'" + oMain.HExplanation + "','" + oMain.HBillNo + "'," + DBUtility.ClsPub.BoolToString(oMain.HRedBlueFlag) +
+ ", " + oMain.HSTOCKORGID.ToString() + "," + oMain.HOWNERID.ToString() +
+ ") ");
+ //鏇存柊鍏宠仈鏁伴噺
+ oCn.RunProc("exec h_p_Sc_UpDateMoveStockPPBomRelation_Add " + HOutBillID.ToString());
+
+ if (oSystemParameterMain.Kf_MoveStockBill_AutoCheck == "Y") //绯荤粺鍙傛暟 鑷姩瀹℃牳
+ {
+ //瀹℃牳鍗曟嵁
+ oCn.RunProc("Update Kf_ICStockBillMain Set HChecker='" + oMain.HMaker + "',HCheckDate=convert(varchar(10),getdate(),120) where HInterID= " + HOutBillID.ToString());
+ }
+
+ //鏍规嵁TMP琛� 杩斿洖 淇℃伅
+ DataSet Ds;
+ Ds = oCn.RunProcReturn("exec h_p_Kf_GetMoveStockBill_ProcReportMove_CLD_New " + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "'," + HOutBillID.ToString() + ",'" + HOutBillNo + "'," + oMain.HOWNERID.ToString(), "h_p_Kf_GetMoveStockBill_ProcReportMove_CLD_New");
+ if (Ds == null || Ds.Tables[0].Rows.Count == 0 || Ds.Tables[1].Rows.Count == 0)
+ {
+ sErrMsg = "鑾峰彇宸ュ簭姹囨姤杞Щ涓洿鎺ヨ皟鎷ㄥ崟瀛愯〃淇℃伅澶辫触锛�";
+ oCn.RollBack();
+ return false;
+ }
+ else
+ {
+ string sJson_Main = "{\"Creator\":\"\",\"NeedUpDateFields\":[],\"NeedReturnFields\":[],\"IsDeleteEntry\":\"True\",\"SubSystemId\":\"\",\"IsVerifyBaseDataField\":\"false\"," +
+ "\"IsEntryBatchFill\":\"True\",\"ValidateFlag\":\"True\",\"NumberSearch\":\"True\",\"InterationFlags\":\"\"," +
+ "\"Model\":{ " +
+ //\"FID\":\"0\",
+ "\"FBillNo\":\"" + oMain.HBillNo + "\"," +
+ "\"FBillTypeID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FBillTypeID"]) + "\"}," +
+ "\"FBizType\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FBizType"]) + "\"," +
+ "\"FTransferDirect\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FTransferDirect"]) + "\"," +
+ "\"FTransferBizType\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FTransferBizType"]) + "\"," +
+ "\"FSettleOrgId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FSettleOrgId"]) + "\"}," +
+ "\"FSaleOrgId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FSaleOrgId"]) + "\"}," +
+ "\"FStockOutOrgId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FStockOutOrgId"]) + "\"}," +
+ "\"FOwnerTypeOutIdHead\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FOwnerTypeOutIdHead"]) + "\"," +
+ "\"FOwnerOutIdHead\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FOwnerOutIdHead"]) + "\"}," +
+ "\"FStockOrgId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FStockOrgId"]) + "\"}," +
+ "\"FIsIncludedTax\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FIsIncludedTax"]) + "," +
+ "\"FIsPriceExcludeTax\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FIsPriceExcludeTax"]) + "," +
+ "\"FOwnerTypeIdHead\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FOwnerTypeIdHead"]) + "\"," +
+ "\"FSETTLECURRID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FSETTLECURRID"]) + "\"}," +
+ "\"FOwnerIdHead\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FOwnerIdHead"]) + "\"}," +
+ //\"FStockerId\":{\"FNumber\":\"\"},
+ //\"FStockerGroupId\":{\"FNumber\":\"\"},
+ "\"FDATE\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FDATE"]) + "\"," +
+ //\"FNote\":\"\",
+ "\"FBaseCurrId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FBaseCurrId"]) + "\"}," +
+ "\"FSUPPLIERID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FSUPPLIERID"]) + "\"}," +
+ //\"FCustID\":{\"FNUMBER\":\"\"},
+ //\"FScanBox\":\"\",
+ //\"FThirdSystem\":\"\",
+ //\"FThirdSrcBillNo\":\"\",
+ //\"FThirdSrcId\":\"\",
+ "\"FBillEntry\": [ ";
+ string sJson_Entry = "";
+ for (int i = 0; i < Ds.Tables[1].Rows.Count; i++)
+ {
+ if (sJson_Entry != "")
+ {
+ sJson_Entry = sJson_Entry + " , ";
+ }
+ string sJson_BatchNo = "";
+ string sJson_SrcStockPlace = "";
+ string sJson_DestStockPlace = "";
+ string sJson_FAUXPROPID = "";
+ if (Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["HISBATCHMANAGE"]) == "1") //鏄惁鍚敤鎵规绠$悊
+ {
+ sJson_BatchNo = " \"FLOT\": {\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FLOT"]) + "\"}, \"FLOT_TEXT\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FLOT"]) + "\" , ";
+ }
+ else
+ {
+ sJson_BatchNo = "";
+ }
+ //杈呭姪灞炴��
+ sJson_FAUXPROPID = " \"FAUXPROPID\":{\"FAUXPROPID__FF100002\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FAUXPROPID"]) + "\"}},";
+ //璋冨叆浠撲綅
+ if (Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSrcStockLocId"]) == "")
+ {
+ sJson_SrcStockPlace = "";
+ }
+ else
+ {
+ sJson_SrcStockPlace = Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSrcStockLocId"]) + "\"}},";
+ }
+ //璋冨嚭浠撲綅
+ if (Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FDestStockLocId"]) == "")
+ {
+ sJson_DestStockPlace = "";
+ }
+ else
+ {
+ sJson_DestStockPlace = Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FDestStockLocId"]) + "\"}},";
+ }
+ //
+ sJson_Entry = sJson_Entry + " {" +
+ //\"FEntryID\":\"0\",
+ " \"FMaterialId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMaterialId"]) + "\"}," +
+ //" \"FAuxPropId\":{\"FAUXPROPID__FF100002\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FAuxPropId"]) + "\"}}," +
+ sJson_FAUXPROPID +
+ " \"FUnitID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FUnitID"]) + "\"}," +
+ " \"FQty\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FQty"]) + "," +
+ sJson_BatchNo +
+ " \"FSrcStockId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSrcStockId"]) + "\"}," +
+ sJson_SrcStockPlace +
+ //\"FPrice\":\"0\",
+ " \"FDestStockId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FDestStockId"]) + "\"}," +
+ sJson_DestStockPlace +
+ " \"FBomId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBomId"]) + "\"}," +
+ " \"FSrcStockStatusId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSrcStockStatusId"]) + "\"}," +
+ //\"FDeliChkQualifyType\":\"\",
+ //\"FAmount\":\"0\",
+ //\"FProduceDate\":\"1900-01-01\",
+ " \"FDestStockStatusId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FDestStockStatusId"]) + "\"}," +
+ " \"FMtoNo\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMtoNo"]) + "\"," +
+ " \"FBusinessDate\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBusinessDate"]) + "\"," +
+ //\"FExpiryDate\":\"1900-01-01\",
+ " \"FOwnerTypeOutId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FOwnerTypeOutId"]) + "\"," +
+ " \"FOwnerOutId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FOwnerOutId"]) + "\"}," +
+ " \"FOwnerTypeId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FOwnerTypeId"]) + "\"," +
+ " \"FOwnerId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FOwnerId"]) + "\"}," +
+ //\"FNoteEntry\":\"\",
+ " \"FProjectNo\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FProjectNo"]) + "\"," +
+ //\"FOutJoinQty\":\"0\",
+ " \"FSecUnitId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSecUnitId"]) + "\"}," +
+ //\"FSecQty\":\"0\",
+ //\"FBASEOUTJOINQTY\":\"0\",
+ " \"FBaseUnitId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBaseUnitId"]) + "\"}," +
+ " \"FExtAuxUnitId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FExtAuxUnitId"]) + "\"}," +
+ //\"FExtAuxUnitQty\":\"0\",
+ " \"FBaseQty\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBaseQty"]) + "," +
+ " \"FISFREE\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FISFREE"]) + "," +
+ " \"FKeeperTypeId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FKeeperTypeId"]) + "\"," +
+ //\"FActQty\":\"0\",
+ " \"FKeeperId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FKeeperId"]) + "\"}," +
+ " \"FKeeperTypeOutId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FKeeperTypeOutId"]) + "\"," +
+ " \"FKeeperOutId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FKeeperOutId"]) + "\"}," +
+ //\"FDiscountRate\":\"0\",
+ //\"FRepairQty\":\"0\",
+ //\"FRETURNNOTE\":\"\",
+ " \"FDestLot\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FDestLot"]) + "\"}," +
+ " \"FDestMaterialId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FDestMaterialId"]) + "\"}," +
+ " \"FDestBomId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FDestBomId"]) + "\"}," +
+ //\"FServiceContext\":\"\",
+ //\"FPriceUnitID\":{\"FNumber\":\"\"},
+ //\"FPriceQty\":\"0\",
+ //\"FPriceBaseQty\":\"0\",
+ //\"FSOEntryId\":\"0\",
+ " \"FTransReserveLink\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FTransReserveLink"]) + "," +
+ //\"FQmEntryId\":\"0\",
+ //\"FConvertEntryId\":\"0\",
+ //\"FThirdSrcEntryId\":\"\",
+ " \"FOrderNo\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FOrderNo"]) + "\"," +
+ " \"FSNUnitID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSNUnitID"]) + "\"}," +
+ " \"FORDERTYPE\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FORDERTYPE"]) + "\"}," +
+ " \"FSrcBillTypeId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSrcBillTypeId"]) + "\"," +
+ " \"FSrcBillNo\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSrcBillNo"]) + "\"," +
+
+ //\"FSerialSubEntity\":[{\"FDetailID\":\"0\",
+ //\"FSerialNo\":\"\",
+ //\"FSerialNote\":\"\"}]
+
+ " \"FBillEntry_Link\": [{" +
+ " \"FBillEntry_Link_FFlowId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntity_Link_FFlowId"]) + "\"," +
+ " \"FBillEntry_Link_FFlowLineId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntity_Link_FFlowLineId"]) + "\"," +
+ " \"FBillEntry_Link_FRuleId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntity_Link_FRuleId"]) + "\"," +
+ " \"FBillEntry_Link_FSTableName\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntity_Link_FSTableName"]) + "\"," +
+ " \"FBillEntry_Link_FSBillId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntity_Link_FSBillId"]) + "\"," +
+ " \"FBillEntry_Link_FSId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntity_Link_FSId"]) + "\"" +
+ " } ]," +
+ " \"FBFLOWID\":{\"FID\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBFLOWID"]) + "\"}}";
+ }
+ string sJson_End = " ] }}";
+ string sJson = sJson_Main + sJson_Entry + sJson_End;
+
+ //浠庨厤缃枃浠惰幏鍙� CLOUD缃戝潃銆佽处濂椾俊鎭�佺櫥褰曠敤鎴枫�佺櫥褰曞瘑鐮�
+ if (!Pub_Class.ClsPub.GetCLOUDLoginInfo(ref Pub_Class.ClsPub.sExeReturnInfo))
+ {
+ sErrMsg = Pub_Class.ClsPub.sExeReturnInfo;
+ return false;
+ }
+
+ //鑾峰彇CLOUD璐﹀彿瀵嗙爜
+ string sCLOUDUseName = Pub_Class.ClsPub.sCLOUDUseName;
+ string sCLOUDPsd = Pub_Class.ClsPub.sCLOUDPsd;
+ DataSet ds11 = get_SaveCLOUDUseNameandPsd(oMain.HInterID);
+ if (ds11 == null || ds11.Tables[0].Rows.Count == 0)
+ {
+ }
+ else
+ {
+ sCLOUDUseName = DBUtility.ClsPub.isStrNull(ds11.Tables[0].Rows[0]["HCloudUserName"]);
+ sCLOUDPsd = DBUtility.ClsPub.isStrNull(ds11.Tables[0].Rows[0]["HCloudUserPsd"]);
+ }
+
+ //鐢熸垚 鐩存帴璋冩嫧
+ string HReturn;
+ ApiClient client = new ApiClient(Pub_Class.ClsPub.sCLOUDUrl);
+ string dbId = Pub_Class.ClsPub.sCLOUDAcc; //AotuTest117
+ bool bLogin = client.Login(dbId, sCLOUDUseName, sCLOUDPsd, 2052);
+ if (bLogin)
+ {
+ var result = client.Execute<string>("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Save",
+ new object[] { "STK_TransferDirect", sJson });
+
+ //鐢熸垚鍗曟嵁鍚庢洿鏂拌嚜瀹氫箟瀛楁
+ oCn.RunProc("exec h_p_Sc_UpDateSelfFildMove '" + oMain.HBillNo + "','3720'");
+
+ if (oSystemParameterMain.Kf_MoveStockBill_AutoCheck == "Y") //绯荤粺鍙傛暟 鑷姩瀹℃牳
+ {
+ string sJson2 = "{\"CreateOrgId\":0,\"Numbers\":[\"" + oMain.HBillNo + "\"]}";
+ var result2 = client.Execute<string>("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Submit",
+ new object[] { "STK_TransferDirect", sJson2 });
+
+ string sJson3 = "{\"CreateOrgId\":0,\"Numbers\":[\"" + oMain.HBillNo + "\"]}";
+ var result3 = client.Execute<string>("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Audit",
+ new object[] { "STK_TransferDirect", sJson3 });
+
+ HReturn = result.ToString() + "," + result2.ToString() + "," + result3.ToString();
+ }
+ else
+ {
+ HReturn = result.ToString();
+ }
+ if (HReturn.Contains("\"IsSuccess\":false") == true)
+ {
+ sErrMsg = "宸ュ簭姹囨姤杞Щ涓敓鎴愮洿鎺ヨ皟鎷ㄥ崟澶辫触锛�" + HReturn + sJson;
+ oCn.RollBack();
+ return false;
+ }
+ else
+ {
+ oCn.Commit();
+ return true;
+ }
+ }
+ else
+ {
+ sErrMsg = "宸ュ簭姹囨姤杞Щ涓敓鎴愮洿鎺ヨ皟鎷ㄥ崟澶辫触锛佺櫥褰曞け璐ワ紒";
+ oCn.RollBack();
+ return false;
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ sErrMsg = "宸ュ簭姹囨姤杞Щ涓敓鎴愮洿鎺ヨ皟鎷ㄥ崟澶辫触锛�" + e.Message;
+ oCn.RollBack();
+ return false;
+ }
+ }
+
+ #endregion
+
#region 鏀舵枡閫氱煡鍗曪紙瀹℃牳锛� *
//瀹℃牳鏀舵枡閫氱煡鍗�
--
Gitblit v1.9.1