From d79f81d5f07f47be053cfcbae4a4ed47cd0ccce0 Mon Sep 17 00:00:00 2001
From: yxj <yxj@hz-kingdee.com>
Date: 星期二, 13 八月 2024 09:59:03 +0800
Subject: [PATCH] 新增设备保养率报表、设备维修率报表调用方法

---
 WebAPI/Controllers/OtherInStockController.cs |  284 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 280 insertions(+), 4 deletions(-)

diff --git a/WebAPI/Controllers/OtherInStockController.cs b/WebAPI/Controllers/OtherInStockController.cs
index 765f92e..2bba4cc 100644
--- a/WebAPI/Controllers/OtherInStockController.cs
+++ b/WebAPI/Controllers/OtherInStockController.cs
@@ -1,5 +1,6 @@
 锘縰sing DBUtility;
 using Model;
+using Newtonsoft.Json;
 using Newtonsoft.Json.Linq;
 using SQLHelper;
 using System;
@@ -14,6 +15,7 @@
 using WebAPI;
 using WebAPI.Code;
 using WebAPI.Models;
+using WebAPI.Utility;
 
 namespace WebAPI.Controllers
 {
@@ -49,6 +51,9 @@
         private JsonResult objJsonResult = new JsonResult();
         public ClsKf_ICStockBill_WMS oBar = new Model.ClsKf_ICStockBill_WMS();
         // private string msgModel = "{{\"count\":{0},\"code\":{0},\"message\":\"{1}\",\"result\":{2}}}";
+        Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
+        SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+
         public static string GetSession(string sMsg)
         {
             try
@@ -70,6 +75,269 @@
         [HttpGet]
         public Object get_CheckTypeByBarCode_Json(string sCode, Int64 sInterID, string sBillNo, string sMaker, Int64 WhID, Int64 SPID, Double sQty, bool sRedBlue, bool SourceFlag, string sSourceBillNo, string sSourceType, Int64 HOWNERID)
         {
+
+            string sErrMsg = "";
+            bool bResult;
+            //鑾峰彇绯荤粺鍙傛暟
+            if (oSystemParameter.ShowBill(ref sErrMsg) == true)
+            {
+                if (oSystemParameter.omodel.WMS_CampanyName == "妫シ") //绯荤粺鍙傛暟  瀹㈡埛瀹氬埗鍖栧悕绉�     绌虹櫧涓洪�氱敤
+                {
+                    DataSet ds;
+                    string sql = "select HBarCode,HSourceInterID,HSourceEntryID,HSourceBillNo from Gy_BarCodeBill with(nolock) where HBarCode = '" + sCode + "'";
+                    string HDataBaseName = Util.GetConfigKey(AppDomain.CurrentDomain.BaseDirectory + "/Config/kdapi.config", "DataBaseName");//鑾峰彇閲戣澏鏁版嵁搴撳悕绉�
+                    string HSourceBillNo = "";
+                    Int64 HSourceInterID = 0;
+
+                    ds = oCn.RunProcReturn(sql, "Gy_BarCodeBill");
+                    //鍒ゆ柇鏉$爜淇℃伅鏄惁鍦ㄦ潯鐮佹。妗堜腑
+                    if (ds == null || ds.Tables[0].Rows.Count < 1)
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鏉$爜妗f涓笉瀛樺湪鏉$爜缂栧彿锛�" + sCode;
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    else
+                    {
+                        //鑾峰彇鍏ュ簱鐢宠鍗曞崟鍙�/涓籌D
+                        HSourceBillNo = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HSourceBillNo"]);
+                        HSourceInterID = DBUtility.ClsPub.isInt(ds.Tables[0].Rows[0]["HSourceInterID"]);                        
+                        //鏍规嵁鍏ュ簱鐢宠鍗曞崟鍙峰垽鏂崟鎹俊鎭槸鍚﹀凡缁忓悓姝ュ埌閲戣澏
+                        sql = string.Format(@"select * from FROM {0}..T_STK_MISCELLANEOUS with(nolock) where FBILLNO = '" + HSourceBillNo + "'", HDataBaseName);
+                        ds = oCn.RunProcReturn(sql, "T_STK_MISCELLANEOUS");
+                        //鍏ュ簱鐢宠鍗曟病鏈夊悓姝ュ埌閲戣澏鍒欒繘琛屽悓姝�
+                        if (ds == null || ds.Tables[0].Rows.Count < 1)
+                        {
+                            sql = "exec h_p_Kf_StockInRequestBillToErp " + HSourceInterID + "," + HSourceBillNo;
+                            ds = oCn.RunProcReturn(sql, "h_p_Kf_StockInRequestBillToErp");
+
+                            if (ds == null || ds.Tables[0].Rows.Count == 0)
+                            {
+                                oCn.RollBack();
+                                objJsonResult.code = "0";
+                                objJsonResult.count = 0;
+                                objJsonResult.Message = "webapi鍏ュ簱鐢宠鍗曞悓姝ワ紝鑾峰彇淇℃伅澶辫触";
+                                objJsonResult.data = null;
+                                return objJsonResult;
+                            }
+                            else
+                            {
+                                JObject model = new JObject();
+                                model.Add("FBillType", new JObject() { ["FNumber"] = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["FBillType"]) }); //鍗曟嵁绫诲瀷
+                                model.Add("FDate", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鏃ユ湡"])); //鍗曟嵁鏃ユ湡                   
+                                model.Add("FStockOrgId", new JObject() { ["FNumber"] = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["搴撳瓨缁勭粐浠g爜"]) }); //搴撳瓨缁勭粐浠g爜
+                                model.Add("FBillNo", HSourceBillNo); //鍗曟嵁鍙�
+                                model.Add("FStockDirect", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["搴撳瓨鏂瑰悜"])); //搴撳瓨鏂瑰悜                   
+                                model.Add("FDEPTID", new JObject() { ["FNumber"] = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["閮ㄩ棬浠g爜"]) }); //鐢熶骇杞﹂棿
+                                model.Add("F_paez_Text", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鍏ュ簱鐮佸崟"])); //鍏ュ簱鐮佸崟              
+                                model.Add("F_paez_Integer2", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绛掑瓙鏁�"])); //绛掑瓙鏁�              
+                                model.Add("F_paez_Integer1", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绛掔鍙暟"])); //绛掔鍙暟            
+                                model.Add("F_paez_Integer3", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["瀹氶暱"])); //瀹氶暱              
+                                model.Add("F_paez_BaseProperty4", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绛掗噸"])); //绛掗噸              
+                                model.Add("F_paez_Base", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["宸ュ彿"])); //宸ュ彿              
+                                model.Add("F_paez_Combo", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鐝浠g爜"])); //鐝              
+                                model.Add("F_paez_BaseProperty1", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鎵瑰彿"])); //鎵瑰彿              
+                                model.Add("F_paez_Integer", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绠辨暟"])); //绠辨暟              
+                                model.Add("F_paez_Decimal2", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鎬婚噸"])); //鎬婚噸              
+                                model.Add("F_paez_BaseProperty2", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鎴愬搧缂栫爜"])); //鎴愬搧缂栫爜              
+                                model.Add("F_paez_BaseProperty5", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鍝佸悕"])); //鍝佸悕              
+                                model.Add("F_paez_Base1", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绾垮彿"])); //绾垮彿              
+
+                                model.Add("F_paez_BaseProperty", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鏈哄彴"])); //鏈哄彴              
+                                model.Add("F_paez_Decimal", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绠遍噸"])); //绠遍噸              
+                                //model.Add("F_WJUK_Text", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鏉ユ簮"])); //鏉ユ簮              
+                                model.Add("FDEPTID1", new JObject() { ["FNumber"] = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["閮ㄩ棬浠g爜"]) });//閮ㄩ棬       
+                                model.Add("F_paez_BaseProperty6", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鎹诲悜"])); //鎹诲悜              
+                                model.Add("F_paez_BaseProperty7", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绠¤壊"])); //绠¤壊              
+                                model.Add("F_paez_Assistant", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绛夌骇"])); //绛夌骇              
+                                model.Add("F_paez_Text11", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鏈�灏忕鍙�"])); //鏈�灏忕鍙�              
+                                //model.Add("F_paez_Text3", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鏂囨湰"])); //鏂囨湰              
+                                model.Add("F_paez_Text4", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鏈�澶х鍙�"])); //鏈�澶х鍙�              
+                                //model.Add("F_paez_PrintTimes", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鎵撳嵃娆℃暟"])); //鎵撳嵃娆℃暟              
+                                //model.Add("F_paez_Text5", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绾垮彿"])); //鏉$爜鎵撳嵃              
+                                model.Add("F_paez_BaseProperty10", new JObject() { ["FNumber"] = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["閮ㄩ棬浠g爜"]) }); //鐢熶骇閮ㄩ棬              
+                                model.Add("F_paez_Combo1", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鏄惁鍐呭璐�"])); //鏄惁鍐呭璐�              
+                                model.Add("F_paez_Combo2", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["浜у搧绫诲瀷"])); //浜у搧绫诲瀷              
+                                model.Add("F_paez_Combo3", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["婊$増鐘舵��"])); //婊$増鐘舵��              
+                                model.Add("F_paez_BaseProperty11", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["瑙勬牸鍨嬪彿"])); //瑙勬牸鍨嬪彿              
+                                model.Add("F_paez_BaseProperty12", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["缃戝埆"])); //缃戝埆              
+                                model.Add("F_TFKO_Text4", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绠卞彿鍓嶇紑"])); //绠卞彿鍓嶇紑              
+                                model.Add("F_paez_WB", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["缃戝埆"])); //缃戝埆1              
+
+
+                                JArray Fentity = new JArray();
+                                foreach (DataRow item in ds.Tables[1].Rows)
+                                {
+                                    JObject FentityModel = new JObject();
+                                    FentityModel.Add("FSrcEntryId", item["FSRCENTRYID"].ToString());//  婧愬崟鍒嗗綍鍐呯爜銆�
+                                    FentityModel.Add("FIsNew", item["FIsNew"].ToString());//  婧愬崟绫诲瀷 
+                                    FentityModel.Add("FMaterialId", new JObject() { ["FNumber"] = item["FMaterialId"].ToString() }); // 鐗╂枡缂栫爜 
+                                    FentityModel.Add("FREPORTTYPE", new JObject() { ["FNumber"] = item["FREPORTTYPE"].ToString() });  // 鐢熶骇姹囨姤绫诲瀷
+                                    FentityModel.Add("FProductType", item["FPRODUCTTYPE"].ToString());// 	 浜у搧绫诲瀷
+                                    FentityModel.Add("FUNITID", new JObject() { ["FNumber"] = item["FUNITID"].ToString() });//鍗曚綅
+                                    FentityModel.Add("FWORKSHIPID", new JObject() { ["FNumber"] = item["FWORKSHOPID"].ToString() });//鐢熶骇杞﹂棿
+                                    FentityModel.Add("FMTONO", item["FMTONO"].ToString());//   璁″垝璺熻釜鍙�
+                                    FentityModel.Add("FCheckProduct", item["FCheckProduct"].ToString());//   浜у搧妫�楠�
+                                    FentityModel.Add("FISENTRUST", item["FISENTRUST"].ToString());//  	 缁勭粐濮旀墭鍔犲伐
+                                    FentityModel.Add("FSrcBillType", item["FSRCBILLTYPE"].ToString());//   婧愬崟绫诲瀷
+                                    FentityModel.Add("FMOBILLNO", item["FMOBILLNO"].ToString());//  鐢熶骇璁㈠崟
+                                    FentityModel.Add("FSrcBillNo", item["FSrcBillNo"].ToString());//   婧愬崟缂栧彿
+                                    FentityModel.Add("FMoEntrySeq", item["FMoEntrySeq"].ToString());//鐢熶骇璁㈠崟琛屽彿
+                                    FentityModel.Add("FPROJECTNO", item["FPROJECTNO"].ToString());//  椤圭洰缂栧彿
+                                    FentityModel.Add("FSTDMANHOUR", item["FSTDMANHOUR"].ToString());//  鍗曚綅鏍囧噯宸ユ椂
+                                    FentityModel.Add("FHRPREPARETIME", item["FHRPREPARETIME"].ToString());//  浜哄憳鍑嗗宸ユ椂
+                                    FentityModel.Add("FMACPREPARETIME", item["FMACPREPARETIME"].ToString());//  鏈哄櫒鍑嗗宸ユ椂
+                                    FentityModel.Add("FSrcInterId", item["FSrcInterId"].ToString());//  婧愬崟鍐呯爜
+                                    FentityModel.Add("FSrcEntrySeq", item["FSrcEntrySeq"].ToString());//  婧愬崟琛屽彿
+                                    FentityModel.Add("FMoId", item["FMoId"].ToString());//鐢熶骇璁㈠崟鍐呯爜
+                                    FentityModel.Add("FMoEntryId", item["FMoEntryId"].ToString());//鐢熶骇璁㈠崟鍒嗗綍鍙�
+                                    FentityModel.Add("FBaseUnitID", new JObject() { ["FNumber"] = item["FBaseUnitID"].ToString() });//鍗曚綅
+                                    FentityModel.Add("FSTOCKINORGID", new JObject() { ["FNumber"] = item["FSTOCKINORGID"].ToString() });//鍏ュ簱缁勭粐
+                                    FentityModel.Add("FOwnerTypeId", item["FOwnerTypeId"].ToString());// 璐т富绫诲瀷
+                                    FentityModel.Add("FOwnerId", new JObject() { ["FNumber"] = item["FOwnerId"].ToString() });// 璐т富
+                                    FentityModel.Add("FSTOCKID", new JObject() { ["FNumber"] = item["FSTOCKID"].ToString() });//浠撳簱
+                                    FentityModel.Add("FCostRate", item["FCOSTRATE"].ToString());//	 鎴愭湰鏉冮噸
+                                    FentityModel.Add("FSNUNITID", new JObject() { ["FNumber"] = item["FSNUNITID"].ToString() });//搴忓垪鍙峰崟浣�
+                                    FentityModel.Add("FISBACKFLUSH", item["FISBACKFLUSH"].ToString());//  鍊掑啿棰嗘枡
+                                    FentityModel.Add("FMOMAINENTRYID", item["FMOMAINENTRYID"].ToString());// 鐢熶骇璁㈠崟涓讳骇鍝佸垎褰�
+                                    FentityModel.Add("FQAIP", item["FQAIP"].ToString());//绱ф�ユ斁琛�
+                                    FentityModel.Add("FREQSRC", item["FREQSRC"].ToString());//闇�姹傛潵婧�
+                                    FentityModel.Add("FREQBILLNO", item["FREQBILLNO"].ToString());//闇�姹傚崟鎹�
+                                    FentityModel.Add("FREQBILLID", item["FREQBILLID"].ToString());// 闇�姹傚崟鎹唴鐮�
+                                    FentityModel.Add("FREQENTRYSEQ", item["FREQENTRYSEQ"].ToString());//闇�姹傚崟鎹鍙�
+                                    FentityModel.Add("FREQENTRYID", item["FREQENTRYID"].ToString());// 闇�姹傚崟鎹垎褰曞唴鐮�
+                                    FentityModel.Add("FBASEQUAQTY", item["FBASEQUAQTY"].ToString());// 鍩烘湰鍗曚綅鍚堟牸鏁伴噺
+                                    FentityModel.Add("FQUAQTY", item["FQUAQTY"].ToString());//鍚堟牸鏁伴噺
+                                    FentityModel.Add("FFailQty", item["FFailQty"].ToString());//涓嶅悎鏍兼暟閲�
+                                    FentityModel.Add("FScrapQty", item["FScrapQty"].ToString());//鎶ュ簾鏁伴噺
+                                    FentityModel.Add("FBASEFINISHQTY", item["FBASEFINISHQTY"].ToString());//鍩烘湰鍗曚綅瀹屾垚鏁伴噺
+                                    FentityModel.Add("FFINISHQTY", item["FFINISHQTY"].ToString());//瀹屾垚鏁伴噺
+                                    FentityModel.Add("FLot", new JObject() { ["FNumber"] = item["FLot"].ToString() });//鎵瑰彿                                   
+                                    FentityModel.Add("FBOMID", new JObject() { ["FNumber"] = item["FBOMID"].ToString() });// BOM鐗堟湰
+
+                                    JArray Fentity2 = new JArray();
+                                    JObject FentityModel2 = new JObject();
+                                    FentityModel2.Add("FEntity_Link_FFlowId", item["FEntity_Link_FFlowId"].ToString());
+                                    FentityModel2.Add("FEntity_Link_FFlowLineId", item["FEntity_Link_FFlowLineId"].ToString());
+                                    FentityModel2.Add("FEntity_Link_FRuleId", item["FEntity_Link_FRuleId"].ToString());
+                                    FentityModel2.Add("FEntity_Link_FSTableName", item["FEntity_Link_FSTableName"].ToString());
+                                    FentityModel2.Add("FEntity_Link_FSBillId", item["FEntity_Link_FSBillId"].ToString());
+                                    FentityModel2.Add("FEntity_Link_FSId", item["FEntity_Link_FSId"].ToString());
+                                    Fentity2.Add(FentityModel2);
+                                    FentityModel.Add("FEntity_Link", Fentity2);
+                                    FentityModel.Add("FBFLowId", new JObject() { ["FID"] = item["FBFLOWID"].ToString() });
+                                    Fentity.Add(FentityModel);
+                                }
+                                model.Add("FEntity", Fentity); //鏄庣粏淇℃伅                       
+                                JObject jsonRoot = new JObject()
+                                {
+                                    ["Creator"] = "",
+                                    ["NeedUpDateFields"] = new JArray(),
+                                    ["NeedReturnFields"] = new JArray(),
+                                    //["IsDeleteEntry"] = "true",
+                                    //["SubSystemId"] = "",
+                                    //["IsVerifyBaseDataField"] = "false",
+                                    ["IsDeleteEntry"] = "true",
+                                    ["SubSystemId"] = "",
+                                    ["IsVerifyBaseDataField"] = "true",
+                                    ["IsEntryBatchFill"] = "false",
+                                    ["ValidateFlag"] = "true",
+                                    ["NumberSearch"] = "true",
+                                    ["IsAutoAdjustField"] = "false",
+                                    ["InterationFlags"] = "",
+                                    ["IgnoreInterationFlag"] = "",
+                                    //["IsAutoSubmitAndAudit"] = true,//鑷姩璋冪敤鎻愪氦鍜屽鏍稿姛鑳�
+                                    ["Model"] = model
+                                };
+
+                                //浠庨厤缃枃浠惰幏鍙� CLOUD缃戝潃銆佽处濂椾俊鎭�佺櫥褰曠敤鎴枫�佺櫥褰曞瘑鐮�
+                                if (!Pub_Class.ClsPub.GetCLOUDLoginInfo(ref Pub_Class.ClsPub.sExeReturnInfo))
+                                {
+                                    oCn.RollBack();
+                                    objJsonResult.code = "0";
+                                    objJsonResult.count = 0;
+                                    objJsonResult.Message = "鍏ュ簱鐢宠鍗曞悓姝ヨ幏鍙栫櫥褰曡处鍙峰瘑鐮佸け璐ワ紒";
+                                    objJsonResult.data = null;
+                                    return objJsonResult;
+                                }
+
+                                var loginRet = InvokeHelper.Login();
+                                var isSuccess = JObject.Parse(loginRet)["LoginResultType"].Value<int>();
+                                if (isSuccess == 0)
+                                {
+                                    oCn.RollBack();
+                                    objJsonResult.code = "0";
+                                    objJsonResult.count = 0;
+                                    objJsonResult.Message = "鐧诲綍閲戣澏澶辫触锛�";
+                                    objJsonResult.data = null;
+                                    return objJsonResult;
+                                }
+                                else
+                                {                                   
+                                    string result = InvokeHelper.Save("PRD_MORPT", JsonConvert.SerializeObject(jsonRoot));//淇濆瓨
+
+                                    if (JObject.Parse(result)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE")
+                                    {
+                                        LogService.Write(JsonConvert.SerializeObject(jsonRoot));
+                                        oCn.RollBack();
+                                        objJsonResult.code = "0";
+                                        objJsonResult.count = 0;
+                                        objJsonResult.Message = "鍏ュ簱鐢宠鍗曞悓姝ラ噾铦朵簯澶辫触锛佸崟鍙�:" + HSourceBillNo + result + jsonRoot;
+                                        objJsonResult.data = null;
+                                        return objJsonResult;
+                                    }
+
+                                    //鎻愪氦瀹℃牳
+                                    string result1 = string.Empty;
+                                    string result2 = string.Empty;
+                                    var fID = JObject.Parse(result)["Result"]["Id"].ToString();
+                                    var fBillNo = JObject.Parse(result)["Result"]["Number"].ToString();
+                                    var json = new
+                                    {
+                                        Ids = fID,
+                                    };
+                                    if (oSystemParameter.omodel.Sc_ICMOReportBill_AutoCheck == "Y") //绯荤粺鍙傛暟  鑷姩瀹℃牳 
+                                    {
+                                        result1 = InvokeHelper.Submit("PRD_MORPT", JsonConvert.SerializeObject(json));//鎻愪氦
+                                        result2 = InvokeHelper.Audit("PRD_MORPT", JsonConvert.SerializeObject(json));//瀹℃牳
+
+                                        if (JObject.Parse(result1)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE")
+                                        {
+                                            oCn.RollBack();
+                                            objJsonResult.code = "0";
+                                            objJsonResult.count = 0;
+                                            objJsonResult.Message = "鍏ュ簱鐢宠鍗曞崟鍙�:" + ",鎻愪氦澶辫触" + result1;
+                                            objJsonResult.data = null;
+                                            return objJsonResult;
+                                        }
+
+                                        if (JObject.Parse(result2)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE")
+                                        {
+                                            oCn.RollBack();
+                                            objJsonResult.code = "0";
+                                            objJsonResult.count = 0;
+                                            objJsonResult.Message = "鍏ュ簱鐢宠鍗曞崟鍙�:" + ",瀹℃牳澶辫触" + result2;
+                                            objJsonResult.data = null;
+                                            return objJsonResult;
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            else
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg;
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+
             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)
@@ -167,6 +435,7 @@
         {
             try
             {
+
                 string sErrMsg = "";
                 bool sBool = false;
                 oView = webserver.get_InfoByBarCode_Source(sBarCode, sInterID, ref sBool, ref sErrMsg);
@@ -233,6 +502,8 @@
             string msg1 = _value.ToString();
             try
             {
+                
+               
                 List<Model.ClsKf_ICStockBillMain> lsmain = new List<Model.ClsKf_ICStockBillMain>();
                 ListModels oListModels = new ListModels();
                 lsmain = oListModels.getICStockBillMainByJson(msg1);
@@ -336,8 +607,8 @@
                 List<Model.ClsKf_OtherInBillMain> lsmain = new List<Model.ClsKf_OtherInBillMain>();
                 ListModels oListModels = new ListModels();
                 lsmain = oListModels.getOtherInBillMainByJson(msg1);
-                lsmain[0].HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
-                lsmain[0].HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));
+                //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.ClsKf_OtherInBillMain websLsmain = new WebS.ClsKf_OtherInBillMain();
@@ -350,7 +621,11 @@
                 websLsmain.HMaker = lsmain[0].HMaker;
                 websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
                 websLsmain.HOWNERID = lsmain[0].HSTOCKORGID;
+                websLsmain.HKeeperID = lsmain[0].HKeeperID;
+                websLsmain.HSecManagerID = lsmain[0].HSecManagerID;
+                websLsmain.HBillerID = lsmain[0].HBillerID;
                 websLsmain.HBillType = "1203";//鍥哄畾鍊�
+                websLsmain.HBillSubType = lsmain[0].HBillSubType;
 
                 WebS.WebService1 oWebs = new WebS.WebService1();
                 WebS.ClsXt_SystemParameterMain oSystemParameterMain = new WebS.ClsXt_SystemParameterMain();
@@ -358,7 +633,7 @@
                 {            
                     objJsonResult.code = "0";
                     objJsonResult.count = 1;
-                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;
+                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //鎴愬姛锛�
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
@@ -366,7 +641,8 @@
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
-                    objJsonResult.Message = "涓婁紶澶辫触锛�" + DBUtility.ClsPub.sErrInfo;
+                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //澶辫触锛�
+                    //objJsonResult.Message = "涓婁紶澶辫触锛�" + DBUtility.ClsPub.sErrInfo;
                     objJsonResult.data = null;
                     return objJsonResult;
                 }

--
Gitblit v1.9.1