Browse Source

核价后台:1、床垫清单,新增半成品分类归属字段;

chen_yjin 1 week ago
parent
commit
a9c331d0f1

+ 1 - 0
JLHHJSvr/Com/Model/erp_prdpf.cs

@@ -75,6 +75,7 @@ namespace JLHHJSvr.Com.Model
         /// 核价清单2的领料工组
         /// </summary>
         public string wrkgrpcode2 { get; set; }
+        public string wip_type { get; set; }
         #endregion
     }
 }

+ 1 - 0
JLHHJSvr/Com/Model/u_mattress_interface_qd.cs

@@ -15,6 +15,7 @@ namespace JLHHJSvr.Com.Model
         public string bj_pzname { get; set; }
         public string bj_pzname_mx { get; set; }
         public string bj_pzname_mx_mx { get; set; }
+        public string wip_type { get; set; }
         public int? mtrlid { get; set; }
         public int? erp_mtrlid { get; set; }
         public int? wrkgrpid { get; set; }

+ 14 - 49
JLHHJSvr/Excutor/CreatPrdPfExcutor.cs

@@ -51,6 +51,7 @@ namespace JLHHJSvr.Excutor
 	                                ,u_mattress_interface_qd.bj_pzname 
 	                                ,u_mattress_interface_qd.bj_pzname_mx 
 	                                ,u_mattress_interface_qd.bj_pzname_mx_mx 
+	                                ,u_mattress_interface_qd.wip_type 
 	                                ,u_mattress_interface_qd.mtrlid 
 	                                ,u_mattress_interface_qd.erp_mtrlid 
 	                                ,u_mattress_interface_qd.useqty 
@@ -68,7 +69,7 @@ namespace JLHHJSvr.Excutor
 	                                ,u_mattress_interface_qd.sh_rate 
                                 FROM u_mattress_interface_qd
                                 LEFT JOIN u_mtrl_price ON u_mtrl_price.mtrlid = u_mattress_interface_qd.mtrlid";
-                    var outputFields = "mattressid,printid,itemname,bj_pzname,bj_pzname_mx,bj_pzname_mx_mx,mtrlid,erp_mtrlid,useqty,dscrp,mtrlname,actual_useqty,qd_actual_size,qd_pfgroupqty,wrkgrpid,wrkgrpid2,ss_rate,ls_rate,sh_rate,wrkgrpcode1,wrkgrpcode2";
+                    var outputFields = "mattressid,printid,itemname,bj_pzname,bj_pzname_mx,bj_pzname_mx_mx,wip_type,mtrlid,erp_mtrlid,useqty,dscrp,mtrlname,actual_useqty,qd_actual_size,qd_pfgroupqty,wrkgrpid,wrkgrpid2,ss_rate,ls_rate,sh_rate,wrkgrpcode1,wrkgrpcode2";
                     DbSqlHelper.SelectJoin(cmd, selectStr, "mattressid = @mattressid", new Dictionary<string, object>() { { "@mattressid", mattressid } }, "printid", outputFields, 0, 0, mattress_interface_qd_list);
 
 
@@ -99,22 +100,12 @@ namespace JLHHJSvr.Excutor
                         prdPfs = new List<u_PrdPF>()
                     };
 
-                    // 自动归类半成品-20250604
-                    var qdMxClass = new Dictionary<string, string[]>
-                    {
-                        { "裥面", new string[] {"补充物料-裥棉面线"} },
-                        { "裥底", new string[] {"补充物料-裥棉底线" } },
-                        { "大侧", new string[] {"拉手刺绣及其他工艺-拉手刺绣", "拉手刺绣及其他工艺-拉手无纺布", "拉手刺绣及其他工艺-侧刺绣做法", "辅料-打印小标1", "辅料-打印小标2", "辅料-打印小标3", "辅料-织唛1", "辅料-防火线2", "车位说明-车位说明", "补充物料-车位面线", "补充物料-车位底线" } },
-                    };
-
                     var bcpNames = new Dictionary<string, string> { };
-                    var bcpPfGroup = new Dictionary<string, string> { };
                     foreach (var mx in mattress_interface_qd_list)
                     {
-                        if (!string.IsNullOrEmpty(mx.bj_pzname_mx_mx) && mx.bj_pzname_mx_mx.Contains(" + ") && !bcpNames.ContainsKey(mx.itemname))
+                        if (!string.IsNullOrEmpty(mx.wip_type) && !string.IsNullOrEmpty(mx.bj_pzname_mx_mx) && mx.bj_pzname_mx_mx.Contains(" + ") && !bcpNames.ContainsKey(mx.wip_type))
                         {
-                            bcpNames.Add(mx.itemname, mx.bj_pzname_mx_mx);
-                            bcpPfGroup.Add(mx.itemname, mx.itemname + '-' + mx.bj_pzname);
+                            bcpNames.Add(mx.wip_type, mx.bj_pzname_mx_mx);
                         }
                     }
 
@@ -124,50 +115,23 @@ namespace JLHHJSvr.Excutor
 
                         var ls_temp_pfgroup = mx.itemname + '-' + mx.bj_pzname;
                         var ll_cnt_temp = 0;
-
-                        var _dscrp = mx.bj_pzname_mx_mx;
-                        var _pfgroup = ls_temp_pfgroup;
-                        #region 自动归类半成品
-                        string searchValue = mx.itemname + "-" + mx.bj_pzname;
-                        bool found = false;
-
-                        foreach (var qdMx in qdMxClass)
-                        {
-                            foreach (string item in qdMx.Value)
-                            {
-                                if (item == searchValue)
-                                {
-                                    found = true;
-                                    break;
-                                }
-                            }
-
-                            if (found)
-                            {
-                                var dscrpStr = bcpNames[qdMx.Key];
-                                var pfgroupStr = bcpPfGroup[qdMx.Key];
-
-                                if (!string.IsNullOrEmpty(dscrpStr))
-                                {
-                                    _dscrp = dscrpStr;
-                                    _pfgroup = pfgroupStr;
-                                }
-                                break;
-                            }
-                        }
-
                         for (var j = 0; j < i - 1; j++)
                         {
-                            if (_pfgroup == mattress_interface_qd_list[j].itemname + '-' + mattress_interface_qd_list[j].bj_pzname)
+                            if (ls_temp_pfgroup == mattress_interface_qd_list[j].itemname + '-' + mattress_interface_qd_list[j].bj_pzname)
                             {
                                 ll_cnt_temp++;
                             }
                         }
                         if (ll_cnt_temp > 0)
                         {
-                            _pfgroup = ls_temp_pfgroup + (ll_cnt_temp).ToString();
+                            ls_temp_pfgroup = ls_temp_pfgroup + (ll_cnt_temp).ToString();
+                        }
+
+                        var _dscrp = mx.bj_pzname_mx_mx;
+                        if (!string.IsNullOrEmpty(mx.wip_type) && !string.IsNullOrEmpty(bcpNames[mx.wip_type]))
+                        {
+                            _dscrp = bcpNames[mx.wip_type];
                         }
-                        #endregion
 
                         string ls_azcode = i.ToString("D3");
 
@@ -175,7 +139,7 @@ namespace JLHHJSvr.Excutor
                         {
                             mtrlid = mattress.erp_mtrlid.Value,
                             pfcode = pfcode,
-                            pfgroup = _pfgroup,
+                            pfgroup = ls_temp_pfgroup,
                             SonMtrlid = mx.erp_mtrlid,
                             wrkgrpid = mx.wrkgrpid,
                             wrkgrpcode1 = mx.wrkgrpcode1,
@@ -190,6 +154,7 @@ namespace JLHHJSvr.Excutor
                             promode = mx.ss_rate.ToString(),
                             SonLoss = mx.sh_rate,
                             SonDECLosS = 0,
+                            wip_type = mx.wip_type
                         };
                         l1Req.prdPfs.Add(prdpf);
                         i++;

+ 5 - 5
JLHHJSvr/Helper/ERPHelper.cs

@@ -109,7 +109,7 @@ namespace JLHHJSvr.Helper
                 throw;
             }
         }
-        public List<L1Mtrldef> GetERPMtrldef(SqlCommand cmd, ref int total, string keyword, L1Mtrldef mtrldef, int pagesize = 0, int pageindex = 0, int simpleField = 1)
+        public List<L1Mtrldef> GetERPMtrldef(SqlCommand cmd, ref int total, string keyword, L1Mtrldef mtrldef, int pagesize = 0, int pageindex = 0, int simpleField = 1, List<int> mtrlids = null)
         {
             var mtrldefList = new List<L1Mtrldef>();
             var selectFields =
@@ -148,10 +148,10 @@ namespace JLHHJSvr.Helper
                 whereList.Add("u_mtrldef.mtrlid = @mtrlid");
                 parms.Add("@mtrlid", mtrldef.mtrlid);
             }
-            //else if (mtrldef.mtrlids != null && request.mtrlids.Count > 0)
-            //{
-            //    whereList.Add($"u_mtrldef.mtrlid IN {ListEx.getString(request.mtrlids)}");
-            //}
+            else if (mtrlids != null && mtrlids.Count > 0)
+            {
+                whereList.Add($"u_mtrldef.mtrlid IN {ListEx.getString(mtrlids)}");
+            }
             else
             {
                 if (mtrldef.mtrlprp != null && mtrldef.mtrlprp != -1)

+ 7 - 4
JLHHJSvr/Helper/InterfaceHelper.cs

@@ -170,6 +170,7 @@ namespace JLHHJSvr.Helper
 	                            ,u_mattress_interface_qd.bj_pzname 
 	                            ,u_mattress_interface_qd.bj_pzname_mx 
 	                            ,u_mattress_interface_qd.bj_pzname_mx_mx 
+	                            ,u_mattress_interface_qd.wip_type 
 	                            ,u_mattress_interface_qd.mtrlid 
 	                            ,u_mattress_interface_qd.erp_mtrlid 
 	                            ,u_mattress_interface_qd.useqty 
@@ -188,7 +189,7 @@ namespace JLHHJSvr.Helper
 	                            ,u_mattress_interface_qd.formulaid 
                             FROM u_mattress_interface_qd
                             LEFT JOIN u_mtrl_price ON u_mtrl_price.mtrlid = u_mattress_interface_qd.mtrlid";
-            var outputFields = "mattressid,printid,itemname,bj_pzname,bj_pzname_mx,bj_pzname_mx_mx,mtrlid,erp_mtrlid,useqty,dscrp,mtrlname,actual_useqty,qd_actual_size,qd_pfgroupqty,wrkgrpid,wrkgrpid2,ss_rate,ls_rate,sh_rate,wrkgrpcode1,wrkgrpcode2";
+            var outputFields = "mattressid,printid,itemname,bj_pzname,bj_pzname_mx,bj_pzname_mx_mx,wip_type,mtrlid,erp_mtrlid,useqty,dscrp,mtrlname,actual_useqty,qd_actual_size,qd_pfgroupqty,wrkgrpid,wrkgrpid2,ss_rate,ls_rate,sh_rate,wrkgrpcode1,wrkgrpcode2";
             DbSqlHelper.SelectJoin(cmd, selectStr, "mattressid = @mattressid", new Dictionary<string, object>() { { "@mattressid", mattressid } }, "printid", outputFields, 0, 0, qdList);
 
             if (qdList.Count <= 0)
@@ -1151,9 +1152,11 @@ namespace JLHHJSvr.Helper
             if (mtrlidList.Count > 0)
             {
                 var erpHelper = HelperBase.GetHelper<ERPHelper>(null);
-                var parameters = new JObject();
-                parameters.Add("mtrlids", JToken.FromObject(mtrlidList));
-                var resultList = erpHelper.GetERPList<erp_mtrldef>("GetL1Mtrldef", parameters);
+                //var parameters = new JObject();
+                //parameters.Add("mtrlids", JToken.FromObject(mtrlidList));
+                //var resultList = erpHelper.GetERPList<erp_mtrldef>("GetL1Mtrldef", parameters);
+                var total = 0;
+                var resultList = erpHelper.GetERPMtrldef(cmd, ref total, "", new L1Mtrldef(), 0, 0, 1, mtrlidList);
 
                 if (resultList != null && resultList.Any())
                 {

+ 1 - 1
JLHHJSvr/Helper/MattressHelper.cs

@@ -2154,7 +2154,7 @@ namespace JLHHJSvr.Helper
             foreach (var mx in qdlist)
             {
                 mx.mattressid = mattressid;
-                DbSqlHelper.Insert(cmd, mx, "mattressid,printid,itemname,bj_pzname,bj_pzname_mx,bj_pzname_mx_mx,mtrlid,erp_mtrlid,wrkgrpid,wrkgrpid2,useqty,dscrp,actual_useqty,qd_actual_size,qd_pfgroupqty,ss_rate,ls_rate,sh_rate,formulaid,wrkgrpcode1,wrkgrpcode2");
+                DbSqlHelper.Insert(cmd, mx, "mattressid,printid,itemname,bj_pzname,bj_pzname_mx,bj_pzname_mx_mx,wip_type,mtrlid,erp_mtrlid,wrkgrpid,wrkgrpid2,useqty,dscrp,actual_useqty,qd_actual_size,qd_pfgroupqty,ss_rate,ls_rate,sh_rate,formulaid,wrkgrpcode1,wrkgrpcode2");
             }