From 51aebb52e3f964ad5d0e96c6b92ae8e455b24ceb Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期五, 10 四月 2026 13:08:17 +0800
Subject: [PATCH] 需要修改的,   不选板材,直接按照板材规格扣减库存。  发版套数不填的话就是1.  扣减库存的量就是  数量*发版套数 20260410  试卷 6年级添加 答题卡 选项  完成

---
 CY_ECommercePlatform/CY.WebForm/Pages/business/AgSpecialOrderEdit.aspx.cs |  179 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 170 insertions(+), 9 deletions(-)

diff --git a/CY_ECommercePlatform/CY.WebForm/Pages/business/AgSpecialOrderEdit.aspx.cs b/CY_ECommercePlatform/CY.WebForm/Pages/business/AgSpecialOrderEdit.aspx.cs
index 65e8bb1..57a91a1 100644
--- a/CY_ECommercePlatform/CY.WebForm/Pages/business/AgSpecialOrderEdit.aspx.cs
+++ b/CY_ECommercePlatform/CY.WebForm/Pages/business/AgSpecialOrderEdit.aspx.cs
@@ -13,6 +13,7 @@
 using CY.Model.Inquiry;
 using CY.BLL.OA;
 using CY.SQLDAL;
+using CY.BLL.Inquiry;
 
 namespace CY.WebForm.Pages.business
 {
@@ -46,7 +47,7 @@
         public string shukuanhuaceneiye4 = "";
         public string shukuanhuaceneiye5 = "";
         public string PrintTypeId = "";
-
+        AfterParameterInfoBLL _afterParameterInfoBLL = null;
         //鍒濆鍖�
         public AgSpecialOrderEdit()
         {
@@ -55,6 +56,7 @@
             bll_OA_InventoryBLL = new OA_InventoryBLL();
             bll_OA_OutOfStorageBLL = new OA_OutOfStorageBLL();
             bll_EC_CuttingPaperSpecBLL = new EC_CuttingPaperSpecBLL();
+            _afterParameterInfoBLL = new AfterParameterInfoBLL();
         }
 
         //椤甸潰鍔犺浇
@@ -314,6 +316,84 @@
             this.RepClientList.DataSource = m_EC_SpecialForumsList;
             this.RepClientList.DataBind();
 
+            List<EC_SpecialHoudaos> m_EC_SpecialHoudaosList = bll_EC_SpecialOrdersBLL.GetEC_SpecialHoudaosListByKeyid(m_EC_SpecialOrders.Keyid) as List<EC_SpecialHoudaos>;
+            if (m_EC_SpecialHoudaosList == null || m_EC_SpecialHoudaosList.Count == 0)
+            {
+                m_EC_SpecialHoudaosList = new List<EC_SpecialHoudaos>();
+                EC_SpecialHoudaos m_EC_SpecialHoudaos = new EC_SpecialHoudaos();
+                m_EC_SpecialHoudaosList.Add(m_EC_SpecialHoudaos);
+                
+            }
+
+            var ssssss = _inquiryCommonModel.AfterWorkList;
+            var inquiryInsideModels = _inquiryCommonModel.InquiryInsideList;
+            foreach (var c_SpecialHoudaos in m_EC_SpecialHoudaosList)
+            {
+                List<int> houdaolist = new List<int>();
+                string select = "<option value=''>鏃�</option>";
+                if (ssssss != null && ssssss.Count > 0)
+                {
+                    if (_eC_OrderBasic.PrintTypeId != 27)
+                    {
+                        foreach (var aaaaa in ssssss)
+                        {
+                            houdaolist.Add(aaaaa);
+                        }
+                    }
+                }
+                if (inquiryInsideModels != null && inquiryInsideModels.Count > 0)
+                {
+                        foreach (var inquiryInsideModel in inquiryInsideModels)
+                        {
+                            var afterWorkList = inquiryInsideModel.AfterWorkList;
+                            if (afterWorkList != null && afterWorkList.Count > 0)
+                            {
+                                foreach (var aaaaa in afterWorkList)
+                                {
+                                    houdaolist.Add(aaaaa);
+                                }
+                            }
+                        }   
+                }
+
+                var sysInquiry_Afters = _afterParameterInfoBLL.GetModelList().Where(x => houdaolist.Contains(x.KeyId)).ToList();
+                if (sysInquiry_Afters != null && sysInquiry_Afters.Count > 0)
+                {
+                    foreach (var item in sysInquiry_Afters)
+                    {
+                        if (item.ParameterName == c_SpecialHoudaos.PSF_Houdaogongxu)
+                        {
+                            select += "<option value='" + item.ParameterName + "'  selected=\"selected\" >" + item.ParameterName + "</option>";
+                        }
+                        else
+                        {
+                            select += "<option value='" + item.ParameterName + "'>" + item.ParameterName + "</option>";
+                        }
+
+                    }
+                }
+                if (_eC_OrderBasic.PrintTypeId == 29 || _eC_OrderBasic.PrintTypeId == 27)
+                {
+                    if (_inquiryCommonModel.JTWZ == c_SpecialHoudaos.PSF_Houdaogongxu)
+                    {
+                        select += "<option value='" + _inquiryCommonModel.JTWZ + "' selected=\"selected\" >" + _inquiryCommonModel.JTWZ + "</option>";
+                    }
+                    else
+                    {
+                        select += "<option value='" + _inquiryCommonModel.JTWZ + "' >" + _inquiryCommonModel.JTWZ + "</option>";
+                    }
+                       
+
+                }
+                c_SpecialHoudaos.PSF_Houdaogongxu = select;
+            }
+
+            this.RepeaterHoudaoList.DataSource = m_EC_SpecialHoudaosList;
+            this.RepeaterHoudaoList.DataBind();
+
+
+
+
             //鑾峰彇寮�鏂欏昂瀵�
             EC_CuttingPaperSpec model = new EC_CuttingPaperSpec();
             //model = bll_EC_CuttingPaperSpecBLL.SelectListByMemberIdAndParType(CurrentUser.MemberId, "灏忓叏寮�");
@@ -427,6 +507,7 @@
                 string[] PSF_PrintedColorRear = Request["PSF_PrintedColorRear"].ToString2().Split(',');
                 string[] PSF_Typesetting = Request["PSF_Typesetting"].ToString2().Split(',');
                 string[] PSF_Typesettinghide = Request["PSF_Typesettinghide"].ToString2().Split(',');
+                string[] PSF_Fabantaoshu = Request["PSF_Fabantaoshu"].ToString2().Split(',');
                 string[] PSF_PrintedCount = Request["PSF_PrintedCount"].ToString2().Split(',');
                 string[] PSF_PrintedPositive = Request["PSF_PrintedPositive"].ToString2().Split(',');
                 string[] PSF_LastNum = Request["PSF_LastNum"].ToString2().Split(',');
@@ -465,6 +546,13 @@
                 string[] oldPSF_PaperId = Request["oldPSF_PaperId"].ToString2().Split(',');
                 string[] oldPSF_BigPaperCount = Request["oldPSF_BigPaperCount"].ToString2().Split(',');
 
+
+                string[] selHoudaogongxu = Request["selHoudaogongxu"].ToString2().Split(',');
+                string[] txtShuliang = Request["txtShuliang"].ToString2().Split(',');
+                string[] txtBeishu = Request["txtBeishu"].ToString2().Split(',');
+                string[] txtJichang = Request["txtJichang"].ToString2().Split(',');
+                string[] txtYaoqiu = Request["txtYaoqiu"].ToString2().Split(',');
+
                 //if (PSF_Forumsid.Length != PSF_Component.Length || PSF_Forumsid.Length != PSF_PNum.Length || PSF_Forumsid.Length != PSF_PressesDesk.Length || PSF_Forumsid.Length != PSF_PrintedColorPositive.Length || PSF_Forumsid.Length != PSF_PrintedColorRear.Length || PSF_Forumsid.Length != PSF_Typesetting.Length || PSF_Forumsid.Length != PSF_PrintedCount.Length || PSF_Forumsid.Length != PSF_PrintedPositive.Length || PSF_Forumsid.Length != PSF_LastNum.Length || PSF_Forumsid.Length != PSF_SheetSource.Length || PSF_Forumsid.Length != PSF_SpecificationsSheet.Length || PSF_Forumsid.Length != PSF_EditionCount.Length || PSF_Forumsid.Length != PSF_PaperSource.Length || PSF_Forumsid.Length != PSF_PaperId.Length || PSF_Forumsid.Length != PSF_PaperName.Length || PSF_Forumsid.Length != PSF_MaterialSpecifications.Length || PSF_Forumsid.Length != PSF_BigPaperCount.Length || PSF_Forumsid.Length != PSF_OpenSpecifications.Length || PSF_Forumsid.Length != PSF_OpenWidth.Length || PSF_Forumsid.Length != PSF_OpenLength.Length || PSF_Forumsid.Length != PSF_Note.Length)
                 //{
                 //    JavaScript.MessageBox("鎻愪氦澶辫触", this);
@@ -502,6 +590,7 @@
                 List<EC_SpecialForums> m_EC_SpecialForumsList = new List<EC_SpecialForums>();
                 List<OA_Inventory> m_OA_InventoryList = new List<OA_Inventory>();
                 List<OA_OutOfStorage> m_OA_OutOfStorageList = new List<OA_OutOfStorage>();
+                List<EC_SpecialHoudaos> m_EC_SpecialHoudaosList = new List<EC_SpecialHoudaos>();
 
                 for (int i = 0; i < PSF_Forumsid.Length; i++)
                 {
@@ -530,8 +619,8 @@
                     {
                         m_EC_SpecialForums.PSF_Typesetting = PSF_Typesetting[i].ToString2().Replace("锛�+-+锛�", ",");
                     }
-                       
-                    
+
+                    m_EC_SpecialForums.PSF_Fabantaoshu = PSF_Fabantaoshu[i];
                     if (PSF_PrintedCount[i].ToInt32() == null)
                     {
                         m_EC_SpecialForums.PSF_PrintedCount = 0;
@@ -625,8 +714,8 @@
                     if (m_EC_SpecialForums.PSF_PlateSource == "鏈巶CTP")
                     {
                         m_EC_SpecialForums.PSF_CTPSpecType = CTPSpecName[i].ToString2().Replace("锛�+-+锛�", ",");
-                       
-                        if(CTPCount[i].ToInt32() == null)
+
+                        if (CTPCount[i].ToInt32() == null)
                         {
                             m_EC_SpecialForums.PSF_CTPCount = 0;
                         }
@@ -644,6 +733,16 @@
                     {
                         m_EC_SpecialForums.PSF_CTPSpecType = selFilmSpec[i].ToString2().Replace("锛�+-+锛�", ",");
                         m_EC_SpecialForums.PSF_CTPCount = 0;
+                    }
+                    m_EC_SpecialForums.PSF_CTPSpecType = CTPSpecName[i].ToString2().Replace("锛�+-+锛�", ",");
+
+                    if (CTPCount[i].ToInt32() == null)
+                    {
+                        m_EC_SpecialForums.PSF_CTPCount = 0;
+                    }
+                    else
+                    {
+                        m_EC_SpecialForums.PSF_CTPCount = CTPCount[i].ToInt32();
                     }
                     m_EC_SpecialForums.PSF_FilmType = "";   
                     m_EC_SpecialForums.PSF_PSSpec = PSF_PSBan[i].ToString2().Replace("锛�+-+锛�", ",");
@@ -691,7 +790,7 @@
                                         m_OA_OutOfStorageOld.GoodsId = m_OA_InventoryOld.GoodsId;
                                         m_OA_OutOfStorageOld.CargoSpaceId = 0;
                                         m_OA_OutOfStorageOld.WarehouseId = m_OA_InventoryOld.WarehouseId;
-                                        m_OA_OutOfStorageOld.InfoType = "纭鍑哄簱";
+                                        m_OA_OutOfStorageOld.InfoType = "鍑哄簱";
                                         m_OA_OutOfStorageOld.SuppliersId = 0;
                                         m_OA_OutOfStorageOld.Price = 0;
                                         m_OA_OutOfStorageOld.Quantity = PMS_PaperCount1_NEW[Array.IndexOf(PSF_PaperId_NEW, item)].ToInt32() ?? 0;
@@ -703,7 +802,10 @@
                                         m_OA_OutOfStorageOld.BrandId = m_OA_InventoryOld.BrandId;
                                         m_OA_OutOfStorageOld.PaperWeightId = m_OA_InventoryOld.PaperWeightId;
                                         m_OA_OutOfStorageOld.SpecificationId = m_OA_InventoryOld.SpecificationId;
+                                        m_OA_OutOfStorageOld.InventoryId = m_OA_InventoryOld.Keyid;
                                         m_OA_OutOfStorageList.Add(m_OA_OutOfStorageOld);
+                                        m_OA_InventoryOld.InventoryCount = m_OA_InventoryOld.InventoryCount - m_OA_OutOfStorageOld.Quantity;
+                                        m_OA_InventoryList.Add(m_OA_InventoryOld);
                                     }
                                 }
                             }
@@ -717,7 +819,7 @@
                                     m_OA_OutOfStorage.GoodsId = m_OA_Inventory.GoodsId;
                                     m_OA_OutOfStorage.CargoSpaceId = 0;
                                     m_OA_OutOfStorage.WarehouseId = m_OA_Inventory.WarehouseId;
-                                    m_OA_OutOfStorage.InfoType = "纭鍑哄簱";
+                                    m_OA_OutOfStorage.InfoType = "鍑哄簱";
                                     m_OA_OutOfStorage.SuppliersId = 0;
                                     m_OA_OutOfStorage.Price = 0;
                                     if (j == 0)
@@ -740,12 +842,71 @@
                                     m_OA_OutOfStorage.BrandId = m_OA_Inventory.BrandId;
                                     m_OA_OutOfStorage.PaperWeightId = m_OA_Inventory.PaperWeightId;
                                     m_OA_OutOfStorage.SpecificationId = m_OA_Inventory.SpecificationId;
+                                    m_OA_OutOfStorage.InventoryId = m_OA_Inventory.Keyid;
                                     m_OA_OutOfStorageList.Add(m_OA_OutOfStorage);
+                                    m_OA_Inventory.InventoryCount = m_OA_Inventory.InventoryCount - m_OA_OutOfStorage.Quantity;
+                                    m_OA_InventoryList.Add(m_OA_Inventory);
                                 }
+                            }
+                        }
+
+                        var CTPSpecNamei = CTPSpecName[i];
+                        var CTPCounti = CTPCount[i];
+                        var PSF_Fabantaoshui = PSF_Fabantaoshu[i];
+                        if (!string.IsNullOrEmpty(CTPCounti))
+                        {
+                            OA_Inventory m_OA_InventoryOld = bll_OA_InventoryBLL.SelecetModelDetailInfoList(CurrentUser.MemberId, "", "", "鏉挎潗", "", CTPSpecNamei).FirstOrDefault();
+                            if (m_OA_InventoryOld != null)
+                            {
+                                OA_OutOfStorage m_OA_OutOfStorageOld = new OA_OutOfStorage();
+                                m_OA_OutOfStorageOld.FirmId = CurrentUser.MemberId;
+                                m_OA_OutOfStorageOld.GoodsId = m_OA_InventoryOld.GoodsId;
+                                m_OA_OutOfStorageOld.CargoSpaceId = 0;
+                                m_OA_OutOfStorageOld.WarehouseId = m_OA_InventoryOld.WarehouseId;
+                                m_OA_OutOfStorageOld.InfoType = "鍑哄簱";
+                                m_OA_OutOfStorageOld.SuppliersId = 0;
+                                m_OA_OutOfStorageOld.Price = 0;
+                                m_OA_OutOfStorageOld.Quantity = CTPCounti.ToInt32() ?? 0;
+                                if (!string.IsNullOrEmpty(PSF_Fabantaoshui))
+                                {
+                                    m_OA_OutOfStorageOld.Quantity = m_OA_OutOfStorageOld.Quantity * (PSF_Fabantaoshui.ToInt32() ?? 0);
+                                }
+                                m_OA_OutOfStorageOld.AllMoney = 0;
+                                m_OA_OutOfStorageOld.LastUpdateTime = DateTime.Now;
+                                m_OA_OutOfStorageOld.Operator = CurrentUser.ShortName;
+                                m_OA_OutOfStorageOld.Remark = "";
+                                m_OA_OutOfStorageOld.TanPrice = 0;
+                                m_OA_OutOfStorageOld.BrandId = m_OA_InventoryOld.BrandId;
+                                m_OA_OutOfStorageOld.PaperWeightId = m_OA_InventoryOld.PaperWeightId;
+                                m_OA_OutOfStorageOld.SpecificationId = m_OA_InventoryOld.SpecificationId;
+                                m_OA_OutOfStorageOld.InventoryId = m_OA_InventoryOld.Keyid;
+                                m_OA_OutOfStorageList.Add(m_OA_OutOfStorageOld);
+                                m_OA_InventoryOld.InventoryCount = m_OA_InventoryOld.InventoryCount - m_OA_OutOfStorageOld.Quantity;
+                                m_OA_InventoryList.Add(m_OA_InventoryOld);
                             }
                         }
                     }
                  }
+
+
+                for (int i = 0; i < selHoudaogongxu.Length; i++)
+                {
+                    EC_SpecialHoudaos m_EC_SpecialHoudaos = new EC_SpecialHoudaos();
+                    m_EC_SpecialHoudaos.PSF_Houdaogongxu = selHoudaogongxu[i].ToString2().Replace("锛�+-+锛�", ",");
+                    m_EC_SpecialHoudaos.PSF_Shuliang = txtShuliang[i] ;
+                    m_EC_SpecialHoudaos.PSF_Beishu = txtBeishu[i];
+                    m_EC_SpecialHoudaos.PSF_Jichang = txtJichang[i];
+                    m_EC_SpecialHoudaos.PSF_Yaoqiu = txtYaoqiu[i].Trim();
+                    if(!string.IsNullOrEmpty(m_EC_SpecialHoudaos.PSF_Houdaogongxu)
+                        || !string.IsNullOrEmpty(m_EC_SpecialHoudaos.PSF_Shuliang)
+                        || !string.IsNullOrEmpty(m_EC_SpecialHoudaos.PSF_Beishu)
+                        || !string.IsNullOrEmpty(m_EC_SpecialHoudaos.PSF_Jichang)
+                        || !string.IsNullOrEmpty(m_EC_SpecialHoudaos.PSF_Yaoqiu)){
+                        m_EC_SpecialHoudaosList.Add(m_EC_SpecialHoudaos);
+                    }
+                }
+
+
                 m_EC_SpecialOrders.LastUpdateTime = DateTime.Now;
                 m_EC_SpecialOrders.Operator = CurrentUser.ShortName;
                 m_EC_SpecialOrders.PSO_Remarks = this.txtPSO_Remarks.InnerText;
@@ -754,7 +915,7 @@
                 if (m_EC_SpecialOrders.Keyid > 0)
                 {
 
-                    if (bll_EC_SpecialOrdersBLL.UpdateSpecialForums(m_EC_SpecialOrders, m_EC_SpecialForumsList, m_OA_InventoryList, m_OA_OutOfStorageList))
+                    if (bll_EC_SpecialOrdersBLL.UpdateSpecialForums(m_EC_SpecialOrders, m_EC_SpecialForumsList, m_OA_InventoryList, m_OA_OutOfStorageList, m_EC_SpecialHoudaosList))
                         //JavaScript.MessageBox("鎿嶄綔鎴愬姛", this);
                         JavaScript.RefreshDIVOpener(this);
                     else
@@ -787,7 +948,7 @@
                     m_OA_OrderWorkListRelation.RelationTypeId = 1; //涓撶増1锛屽悎鐗�2锛屽悗閬撳鍗�3锛屾暣鍗曞鍗�4
 
                     //bll_EC_SpecialOrdersBLL.AddSpecialForums(m_EC_OrderOperate, m_EC_SpecialOrders, m_OA_OrderWorkListRelation, m_EC_SpecialForumsList, m_OA_InventoryList, m_OA_OutOfStorageList)
-                    if (bll_EC_SpecialOrdersBLL.AddSpecialForums(m_EC_OrderOperate, m_EC_SpecialOrders, m_OA_OrderWorkListRelation, m_EC_SpecialForumsList, m_OA_InventoryList, m_OA_OutOfStorageList))
+                    if (bll_EC_SpecialOrdersBLL.AddSpecialForums(m_EC_OrderOperate, m_EC_SpecialOrders, m_OA_OrderWorkListRelation, m_EC_SpecialForumsList, m_OA_InventoryList, m_OA_OutOfStorageList, m_EC_SpecialHoudaosList))
                     {
                         //JavaScript.MessageBox("鎿嶄綔鎴愬姛", this);
                         JavaScript.RefreshDIVOpener(this);

--
Gitblit v1.9.1