From b05067e164b141a869285309b1cb4d138e4c78f0 Mon Sep 17 00:00:00 2001
From: zgq <519541279@qq.com>
Date: 星期一, 10 五月 2021 09:27:21 +0800
Subject: [PATCH] 部门设置树形结构-合并

---
 WebAPI/Controllers/Sc_ProcessMangementController.cs |  576 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 576 insertions(+), 0 deletions(-)

diff --git a/WebAPI/Controllers/Sc_ProcessMangementController.cs b/WebAPI/Controllers/Sc_ProcessMangementController.cs
index dc74d15..981824b 100644
--- a/WebAPI/Controllers/Sc_ProcessMangementController.cs
+++ b/WebAPI/Controllers/Sc_ProcessMangementController.cs
@@ -1602,5 +1602,581 @@
         }
 
 
+        /// <summary>
+        /// 淇濆瓨濮斿姹囨姤鍗曚俊鎭�
+        /// </summary>
+        /// <param name="msg"></param>
+        /// <returns></returns>
+        [Route("SaveWW_EntrustProcessReportBill")]
+        [HttpPost]
+        public object SaveWW_EntrustProcessReportBill([FromBody] JObject msg)
+        {
+            var _value = msg["msg"].ToString();
+            string msg1 = _value.ToString();
+            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+            string msg2 = sArray[0].ToString();
+            string msg3 = sArray[1].ToString();
+
+            string UserName = "";
+            ListModels oListModels = new ListModels();
+
+            try
+            {
+                WebAPI.DLL.ClsWW_EntrustProcessReportBill Sendwork = new WebAPI.DLL.ClsWW_EntrustProcessReportBill();
+                List<WebAPI.Models.ClsWW_EntrustProcessReportBillMain> lsmain = new List<WebAPI.Models.ClsWW_EntrustProcessReportBillMain>();
+                msg2 = msg2.Replace("\\", "");
+                msg2 = msg2.Replace("\n", "");
+                lsmain = oListModels.getObjectByJson_WW_EntrustProcessReportBillMain(msg2);
+                foreach (WebAPI.Models.ClsWW_EntrustProcessReportBillMain oItem in lsmain)
+                {
+                    UserName = oItem.HMaker;
+                    oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd"));
+                    oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
+                    oItem.HDate = DateTime.Now;
+                    oItem.HMainSourceInterID = oItem.HInterID;
+                    oItem.HInterID = 0;
+                    Sendwork.omodel = oItem;
+
+
+                }
+
+                //琛ㄤ綋鏁版嵁
+                //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆�
+                msg3 = msg3.Substring(1, msg3.Length - 2);
+                msg3 = msg3.Replace("\\", "");
+                msg3 = msg3.Replace("\n", "");  //\n
+                List<WebAPI.Models.WW_EntrustProcSendWorkViewModel> ls = new List<WebAPI.Models.WW_EntrustProcSendWorkViewModel>();
+                ls = oListModels.getObjectByJson_WW_EntrustProcSendWork(msg3);
+                int i = 0;
+                List<Models.ClsWW_EntrustProcessReportBillSub> lss = new List<Models.ClsWW_EntrustProcessReportBillSub>();
+                foreach (WebAPI.Models.WW_EntrustProcSendWorkViewModel oItemSub in ls)
+                {
+
+                    i++;
+                    Models.ClsWW_EntrustProcessReportBillSub sendworksub = new Models.ClsWW_EntrustProcessReportBillSub();
+                    sendworksub.HProcID = 0;//--宸ュ簭ID
+                    sendworksub.HSourceInterID = (long)oItemSub.hmainid;//婧愬崟id
+                    sendworksub.HSourceEntryID = (long)oItemSub.hsubid; //--婧愬崟瀛怚D
+                    sendworksub.HSourceBillNo = oItemSub.鍗曟嵁鍙�; //--婧愬崟鍗曞彿
+                    sendworksub.HSourceBillType = oItemSub.HBillType; //--婧愬崟绫诲瀷
+                    sendworksub.HQty = (decimal)oItemSub.鏁伴噺; //--鏁伴噺
+                    sendworksub.HICMOBillNo = "";  //--浠诲姟鍗曞彿
+                    sendworksub.HSeOrderBillNo = ""; //--閿�鍞鍗曞彿
+                    sendworksub.HSeOrderEntryID = 0; //--閿�鍞瓙ID
+                    sendworksub.HSeOrderInterID = 0; //--閿�鍞鍗曚富ID
+                    sendworksub.HTimes = 0; //--璁″垝宸ユ椂
+                    if (oItemSub.鏁伴噺 <= 0)
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨澶辫触锛佺" + i.ToString() + "琛屾暟閲忎笉澶т簬0鏃犳硶淇濆瓨锛�";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+                    if (Convert.ToInt32(sendworksub.HQty) > Convert.ToInt32(oItemSub.鏁伴噺))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨澶辫触锛佺" + i.ToString() + "琛屽澶栨眹鎶ユ暟閲忎笉鑳藉ぇ浜庡澶栨淳宸ュ崟鏁伴噺锛�";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+                  
+
+                    sendworksub.HEntryID = i;
+                    sendworksub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
+                    sendworksub.HRemark = "";
+                    sendworksub.HCloseMan = "";
+                    sendworksub.HCloseType = false;
+                    lss.Add(sendworksub);//鍏堟妸鏁版嵁瀛樻斁鍒版淳宸ュ崟瀛愯〃闆嗗悎閲�
+
+
+                }
+                if (lss.Count > 0)
+                {
+                    //鐒跺悗鍐嶅惊鐜繚瀛樺埌娲惧伐鍗曞瓙琛ㄧ殑闆嗗悎閲�
+                    foreach (Models.ClsWW_EntrustProcessReportBillSub Itemsendwork in lss)
+                    {
+                        Sendwork.DetailColl.Add(Itemsendwork);
+                    }
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "淇濆瓨澶辫触锛乴ss闆嗗悎灏忎簬0";
+                    objJsonResult.data = 1;
+                    return objJsonResult;
+                }
+                //淇濆瓨
+                //淇濆瓨瀹屾瘯鍚庡鐞�
+                bool bResult;
+                if (Sendwork.omodel.HInterID == 0)
+                {
+                    // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+                    bResult = Sendwork.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+                }
+                else
+                {
+                    bResult = Sendwork.ModifyBill(Sendwork.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+                }
+                if (bResult)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
+                    //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
+                    objJsonResult.data = 1;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo;
+                    objJsonResult.data = 1;
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString();
+                objJsonResult.data = 1;
+                return objJsonResult;
+            }
+        }
+
+
+        /// <summary>
+        /// 濮斿娲惧伐鍗曞彿鑾峰彇淇℃伅
+        /// </summary>
+        /// <returns></returns>
+        [Route("Sc_ProcessMangement/WWgetHbarCodeDetail")]
+        [HttpGet]
+        public ApiResult<DataSet> WWGetHbarCodeDetail(string sBillBarCode)
+        {
+            var model = LuBaoSevice.WWGetHbarCodeDetail(sBillBarCode);
+            return model;
+        }
+
+        /// <summary>
+        ///濮斿宸ュ簭鍙疯幏寰椾俊鎭�
+        /// </summary>
+        /// <returns></returns>
+        [Route("Sc_ProcessMangement/WWgetProcDetail")]
+        [HttpGet]
+        public ApiResult<DataSet> WWGetProcDetail(string sBillNo, string sProcNo)
+        {
+            var model = LuBaoSevice.WWGetProcDetail(sBillNo, sProcNo);
+            return model;
+        }
+
+        /// <summary>
+        /// PDA濮斿宸ュ簭姹囨姤鍗曚繚瀛�
+        /// </summary>
+        /// <param name="msg"></param>
+        /// <returns></returns>
+        [Route("SaveWWReport")]
+        [HttpPost]
+        public object SaveWWReport([FromBody] JObject msg)
+        {
+            var _value = msg["msg"].ToString();
+            string msg1 = _value.ToString();
+            ListModels oListModels = new ListModels();
+            try
+            {
+                WebAPI.DLL.ClsWW_EntrustProcessReportBill ReportModel = new WebAPI.DLL.ClsWW_EntrustProcessReportBill();
+                List<WebAPI.Models.WWReportViewModel> ls = new List<WebAPI.Models.WWReportViewModel>();
+                ls = oListModels.getObjectByJson_WWReport(msg1);
+                int i = 0;
+
+                foreach (Models.WWReportViewModel ItemView in ls)
+                {
+                    i++;
+                    Models.ClsWW_EntrustProcessReportBillMain ReportMain = new Models.ClsWW_EntrustProcessReportBillMain();
+                    Models.ClsWW_EntrustProcessReportBillSub ReportSub = new Models.ClsWW_EntrustProcessReportBillSub();
+                    //宸ュ簭姹囨姤鍗曚富琛ㄤ繚瀛�
+                    ReportMain.HBillType = "3742";
+                    ReportMain.HBillNo = ItemView.HBillNo;
+                    ReportMain.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd"));
+                    ReportMain.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
+                    ReportMain.HDate = DateTime.Now;
+                    ReportMain.HMaker = "";
+                    ReportMain.HCloseType = false;
+                    ReportMain.HPrintQty = 0;
+                    ReportMain.HMainSourceBillType = "3740";
+                    ReportMain.HMainSourceInterID =0;
+                    ReportMain.HMainSourceBillNo = ItemView.HWW_BillNo;
+                    ReportMain.HInterID = 0;
+                    ReportMain.HPeriod = 1;
+                    ReportMain.HBillSubType = "3742";
+                    ReportMain.HBillStatus = 0;
+                    ReportMain.HCheckItemNowID = 0;
+                    ReportMain.HCheckItemNextID = 0;
+                    ReportMain.HDeptID = Convert.ToInt32(ItemView.HDeptID);
+                    ReportMain.HExplanation = "";
+                    ReportMain.HInnerBillNo = "";
+                    ReportMain.HSupID =Convert.ToInt32( ItemView.HSupID);
+
+
+                    //淇濆瓨鍒版眹鎶ュ崟涓昏〃
+                    ReportModel.omodel = ReportMain;
+
+
+                    ReportSub.HMaterID = Convert.ToInt32(ItemView.HMaterID);
+                    ReportSub.HICMOBillNo = "";
+                    ReportSub.HICMOInterID = 0;
+                    ReportSub.HEntryID = i;
+                    ReportSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
+                    ReportSub.HRemark = "";
+                    ReportSub.HCloseMan = "";
+                    ReportSub.HCloseType = false;
+                    ReportSub.HSourceBillType = "3740";
+                    ReportSub.HQty = Convert.ToDecimal(ItemView.HQty);
+                    ReportSub.HProcID =Convert.ToInt32( ItemView.HProcID);
+                    ReportSub.HTimes = 0;
+                    ReportSub.HSeOrderInterID = 0;
+                    ReportSub.HSeOrderEntryID = 0;
+                    ReportSub.HSeOrderBillNo = "";
+                    ReportSub.HProcPlanInterID = 0;
+                    ReportSub.HProcPlanBillNo = "";
+                    ReportSub.HSourceInterID = 0;
+                    ReportSub.HSourceBillNo = "";
+                    ReportSub.HRelationQty = 0;
+                    ReportSub.HRelationMoney = 0;
+                    ReportSub.HCheckQty = 0;
+                    ReportSub.HBadCount = 0;
+                    ReportSub.HWasterQty = 0;
+                    ReportSub.HWasterQty2 = 0;
+                    ReportSub.HPrice = 0;
+                    ReportSub.HMoney = 0;
+                    ReportSub.HProcPlanInterID = 0;
+                    ReportSub.HProcPlanEntryID = 0;
+                    ReportSub.HProcPlanBillNo = "";
+                    ReportSub.HSourceEntryID = 0;
+                    ReportSub.HSourceBillType = "";
+                    ReportSub.HRelationQty = 0;
+                    ReportSub.HRelationMoney = 0;
+                    ReportSub.HBadPrirce = 0;
+                    ReportSub.HBadMoney = 0;
+                    ReportSub.HWasterPrice = 0;
+                    ReportSub.HWasterMoney = 0;
+                    ReportSub.HQualityRate = 0;
+                    ReportSub.HUsingQty = 0;
+                    ReportSub.HSelfBadCount = 0;
+                    ReportSub.HPreBadCount = 0;
+                    ReportSub.HPayMentQty = 0;
+                    ReportSub.HPackType = "";
+                    ReportSub.HCheckEmpID = 0;
+                    ReportSub.HWeight = 0;
+                    ReportSub.HBatchNo = "";
+
+                    //淇濆瓨鍒板澶栨眹鎶ュ崟瀛愯〃
+                    ReportModel.DetailColl.Add(ReportSub);
+                }
+                //淇濆瓨
+                //淇濆瓨瀹屾瘯鍚庡鐞�
+                bool bResult;
+                bResult = ReportModel.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+                if (bResult)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
+                    //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
+                    objJsonResult.data = 1;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo;
+                    objJsonResult.data = 1;
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString();
+                objJsonResult.data = 1;
+                return objJsonResult;
+            }
+        }
+
+        /// <summary>
+        /// 淇濆瓨濮斿杞嚭鍗曚俊鎭�
+        /// </summary>
+        /// <param name="msg"></param>
+        /// <returns></returns>
+        [Route("SaveWW_EntrustProcessSendOutBill")]
+        [HttpPost]
+        public object SaveWW_EntrustProcessSendOutBill([FromBody] JObject msg)
+        {
+            var _value = msg["msg"].ToString();
+            string msg1 = _value.ToString();
+            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+            string msg2 = sArray[0].ToString();
+            string msg3 = sArray[1].ToString();
+
+            string UserName = "";
+            ListModels oListModels = new ListModels();
+
+            try
+            {
+                WebAPI.DLL.ClsWW_EntrustProcessSendOutBill Sendwork = new WebAPI.DLL.ClsWW_EntrustProcessSendOutBill();
+                List<WebAPI.Models.ClsWW_EntrustProcessSendOutBillMain> lsmain = new List<WebAPI.Models.ClsWW_EntrustProcessSendOutBillMain>();
+                msg2 = msg2.Replace("\\", "");
+                msg2 = msg2.Replace("\n", "");
+                lsmain = oListModels.getObjectByJson_WW_EntrustProcessSendOutBillMain(msg2);
+                foreach (WebAPI.Models.ClsWW_EntrustProcessSendOutBillMain oItem in lsmain)
+                {
+                    UserName = oItem.HMaker;
+                    oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd"));
+                    oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
+                    oItem.HDate = DateTime.Now;
+                    oItem.HMainSourceInterID = oItem.HInterID;
+                    oItem.HInterID = 0;
+                    Sendwork.omodel = oItem;
+
+
+                }
+
+                //琛ㄤ綋鏁版嵁
+                //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆�
+                msg3 = msg3.Substring(1, msg3.Length - 2);
+                msg3 = msg3.Replace("\\", "");
+                msg3 = msg3.Replace("\n", "");  //\n
+                List<WebAPI.Models.WW_EntrustProcSendWorkViewModel> ls = new List<WebAPI.Models.WW_EntrustProcSendWorkViewModel>();
+                ls = oListModels.getObjectByJson_WW_EntrustProcSendWork(msg3);
+                int i = 0;
+                List<Models.ClsWW_EntrustProcessSendOutBillSub> lss = new List<Models.ClsWW_EntrustProcessSendOutBillSub>();
+                foreach (WebAPI.Models.WW_EntrustProcSendWorkViewModel oItemSub in ls)
+                {
+
+                    i++;
+                    Models.ClsWW_EntrustProcessSendOutBillSub sendworksub = new Models.ClsWW_EntrustProcessSendOutBillSub();
+                    sendworksub.HProcID = 0;//--宸ュ簭ID
+                    sendworksub.HSourceInterID = (long)oItemSub.hmainid;//婧愬崟id
+                    sendworksub.HSourceEntryID = (long)oItemSub.hsubid; //--婧愬崟瀛怚D
+                    sendworksub.HSourceBillNo = oItemSub.鍗曟嵁鍙�; //--婧愬崟鍗曞彿
+                    sendworksub.HSourceBillType = oItemSub.HBillType; //--婧愬崟绫诲瀷
+                    sendworksub.HQty = (decimal)oItemSub.鏁伴噺; //--鏁伴噺
+                    sendworksub.HICMOBillNo = "";  //--浠诲姟鍗曞彿
+                    sendworksub.HSeOrderBillNo = ""; //--閿�鍞鍗曞彿
+                    sendworksub.HSeOrderEntryID = 0; //--閿�鍞瓙ID
+                    sendworksub.HSeOrderInterID = 0; //--閿�鍞鍗曚富ID
+                    if (oItemSub.鏁伴噺 <= 0)
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨澶辫触锛佺" + i.ToString() + "琛屾暟閲忎笉澶т簬0鏃犳硶淇濆瓨锛�";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+                    if (Convert.ToInt32(sendworksub.HQty) > Convert.ToInt32(oItemSub.鏁伴噺))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨澶辫触锛佺" + i.ToString() + "琛屽澶栨眹鎶ユ暟閲忎笉鑳藉ぇ浜庡澶栨淳宸ュ崟鏁伴噺锛�";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+
+
+                    sendworksub.HEntryID = i;
+                    sendworksub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
+                    sendworksub.HRemark = "";
+                    sendworksub.HCloseMan = "";
+                    sendworksub.HCloseType = false;
+                    lss.Add(sendworksub);//鍏堟妸鏁版嵁瀛樻斁鍒版淳宸ュ崟瀛愯〃闆嗗悎閲�
+
+
+                }
+                if (lss.Count > 0)
+                {
+                    //鐒跺悗鍐嶅惊鐜繚瀛樺埌娲惧伐鍗曞瓙琛ㄧ殑闆嗗悎閲�
+                    foreach (Models.ClsWW_EntrustProcessSendOutBillSub Itemsendwork in lss)
+                    {
+                        Sendwork.DetailColl.Add(Itemsendwork);
+                    }
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "淇濆瓨澶辫触锛乴ss闆嗗悎灏忎簬0";
+                    objJsonResult.data = 1;
+                    return objJsonResult;
+                }
+                //淇濆瓨
+                //淇濆瓨瀹屾瘯鍚庡鐞�
+                bool bResult;
+                if (Sendwork.omodel.HInterID == 0)
+                {
+                    // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+                    bResult = Sendwork.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+                }
+                else
+                {
+                    bResult = Sendwork.ModifyBill(Sendwork.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+                }
+                if (bResult)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
+                    //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
+                    objJsonResult.data = 1;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo;
+                    objJsonResult.data = 1;
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString();
+                objJsonResult.data = 1;
+                return objJsonResult;
+            }
+        }
+
+        /// <summary>
+        /// PDA濮斿宸ュ簭杞嚭鍗曚繚瀛�
+        /// </summary>
+        /// <param name="msg"></param>
+        /// <returns></returns>
+        [Route("SaveWWSendOutBill")]
+        [HttpPost]
+        public object SaveWWSendOutBill([FromBody] JObject msg)
+        {
+            var _value = msg["msg"].ToString();
+            string msg1 = _value.ToString();
+            ListModels oListModels = new ListModels();
+            try
+            {
+                WebAPI.DLL.ClsWW_EntrustProcessSendOutBill ReportModel = new WebAPI.DLL.ClsWW_EntrustProcessSendOutBill();
+                List<WebAPI.Models.WWSendOutBillViewModel> ls = new List<WebAPI.Models.WWSendOutBillViewModel>();
+                ls = oListModels.getObjectByJson_WWSendOutBill(msg1);
+                int i = 0;
+
+                foreach (Models.WWSendOutBillViewModel ItemView in ls)
+                {
+                    i++;
+                    Models.ClsWW_EntrustProcessSendOutBillMain ReportMain = new Models.ClsWW_EntrustProcessSendOutBillMain();
+                    Models.ClsWW_EntrustProcessSendOutBillSub ReportSub = new Models.ClsWW_EntrustProcessSendOutBillSub();
+                    //宸ュ簭杞嚭鍗曚富琛ㄤ繚瀛�
+                    ReportMain.HBillType = "3741";
+                    ReportMain.HBillNo = ItemView.HBillNo;
+                    ReportMain.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd"));
+                    ReportMain.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
+                    ReportMain.HDate = DateTime.Now;
+                    ReportMain.HMaker = "";
+                    ReportMain.HCloseType = false;
+                    ReportMain.HPrintQty = 0;
+                    ReportMain.HMainSourceBillType = "3740";
+                    ReportMain.HMainSourceInterID = 0;
+                    ReportMain.HMainSourceBillNo = ItemView.HWW_BillNo;
+                    ReportMain.HInterID = 0;
+                    ReportMain.HPeriod = 1;
+                    ReportMain.HBillSubType = "3741";
+                    ReportMain.HBillStatus = 0;
+                    ReportMain.HCheckItemNowID = 0;
+                    ReportMain.HCheckItemNextID = 0;
+                    ReportMain.HDeptID = Convert.ToInt32(ItemView.HDeptID);
+                    ReportMain.HExplanation = "";
+                    ReportMain.HInnerBillNo = "";
+                    ReportMain.HSupID = Convert.ToInt32(ItemView.HSupID);
+
+
+                    //淇濆瓨鍒拌浆鍑哄崟涓昏〃
+                    ReportModel.omodel = ReportMain;
+
+
+                    ReportSub.HMaterID = Convert.ToInt32(ItemView.HMaterID);
+                    ReportSub.HICMOBillNo = "";
+                    ReportSub.HICMOInterID = 0;
+                    ReportSub.HEntryID = i;
+                    ReportSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
+                    ReportSub.HRemark = "";
+                    ReportSub.HCloseMan = "";
+                    ReportSub.HCloseType = false;
+                    ReportSub.HSourceBillType = "3740";
+                    ReportSub.HQty = Convert.ToDecimal(ItemView.HQty);
+                    ReportSub.HProcID = Convert.ToInt32(ItemView.HProcID);
+                    ReportSub.HSeOrderInterID = 0;
+                    ReportSub.HSeOrderEntryID = 0;
+                    ReportSub.HSeOrderBillNo = "";
+                    ReportSub.HProcPlanInterID = 0;
+                    ReportSub.HProcPlanBillNo = "";
+                    ReportSub.HSourceInterID = 0;
+                    ReportSub.HSourceBillNo = "";
+                    ReportSub.HRelationQty = 0;
+                    ReportSub.HRelationMoney = 0;
+                    ReportSub.HPrice = 0;
+                    ReportSub.HMoney = 0;
+                    ReportSub.HProcPlanInterID = 0;
+                    ReportSub.HProcPlanEntryID = 0;
+                    ReportSub.HProcPlanBillNo = "";
+                    ReportSub.HSourceEntryID = 0;
+                    ReportSub.HSourceBillType = "";
+                    ReportSub.HRelationQty = 0;
+                    ReportSub.HRelationMoney = 0;
+                    ReportSub.HPackType = "";
+                    ReportSub.HBatchNo = "";
+
+                    //淇濆瓨鍒板澶栬浆鍑哄崟瀛愯〃
+                    ReportModel.DetailColl.Add(ReportSub);
+                }
+                //淇濆瓨
+                //淇濆瓨瀹屾瘯鍚庡鐞�
+                bool bResult;
+                bResult = ReportModel.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+                if (bResult)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
+                    //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
+                    objJsonResult.data = 1;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo;
+                    objJsonResult.data = 1;
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString();
+                objJsonResult.data = 1;
+                return objJsonResult;
+            }
+        }
+
+
+
     }
 }
\ No newline at end of file

--
Gitblit v1.9.1