瀏覽代碼

新增床垫接口代码

MY 10 月之前
父節點
當前提交
f8c02db19a
共有 48 個文件被更改,包括 3436 次插入291 次删除
  1. 84 0
      JLHHJSvr/BLL/UserHelper.cs
  2. 30 0
      JLHHJSvr/Com/GetERPConfigureList.cs
  3. 30 0
      JLHHJSvr/Com/GetERPMtrldefList.cs
  4. 30 0
      JLHHJSvr/Com/GetERPWrkGrpList.cs
  5. 32 0
      JLHHJSvr/Com/GetMattressInterfaceList.cs
  6. 33 0
      JLHHJSvr/Com/MattressJS2Audit.cs
  7. 33 0
      JLHHJSvr/Com/MattressJSAudit.cs
  8. 33 0
      JLHHJSvr/Com/MattressYWAudit.cs
  9. 26 0
      JLHHJSvr/Com/Model/ColumnItem.cs
  10. 18 0
      JLHHJSvr/Com/Model/erp_configure_code.cs
  11. 22 0
      JLHHJSvr/Com/Model/erp_mtrldef.cs
  12. 16 0
      JLHHJSvr/Com/Model/erp_sc_workgroup.cs
  13. 1 6
      JLHHJSvr/Com/Model/u_spring.cs
  14. 31 0
      JLHHJSvr/Com/ReBuildMattressInterface.cs
  15. 31 0
      JLHHJSvr/Com/RefreshMattressInterface.cs
  16. 31 0
      JLHHJSvr/Com/RefreshMattressInterfaceQd.cs
  17. 29 0
      JLHHJSvr/Com/SaveMattressInterface.cs
  18. 4 0
      JLHHJSvr/DataStore/_Mapper_inputtype.xml
  19. 56 0
      JLHHJSvr/DataStore/web_mattress_interface_qd.xml
  20. 39 0
      JLHHJSvr/DataStore/web_mattress_interface_yw.xml
  21. 31 0
      JLHHJSvr/DataStore/web_mattress_interface_yw_edit.xml
  22. 113 0
      JLHHJSvr/DataStore/web_mattress_interfacelist.xml
  23. 13 0
      JLHHJSvr/Excutor/CommonDynamicSelectExcutor.cs
  24. 64 0
      JLHHJSvr/Excutor/GetERPConfigureListExcutor.cs
  25. 69 0
      JLHHJSvr/Excutor/GetERPMtrldefListExcutor.cs
  26. 64 0
      JLHHJSvr/Excutor/GetERPWrkGrpListExcutor.cs
  27. 100 0
      JLHHJSvr/Excutor/GetMattressInterfaceListExcutor.cs
  28. 75 0
      JLHHJSvr/Excutor/MattressJS2AuditExcutor.cs
  29. 75 0
      JLHHJSvr/Excutor/MattressJSAuditExcutor.cs
  30. 75 0
      JLHHJSvr/Excutor/MattressYWAuditExcutor.cs
  31. 67 0
      JLHHJSvr/Excutor/ReBuildMattressInterfaceExcutor.cs
  32. 102 0
      JLHHJSvr/Excutor/RefreshMattressInterfaceExcutor.cs
  33. 110 0
      JLHHJSvr/Excutor/RefreshMattressInterfaceQdExcutor.cs
  34. 82 0
      JLHHJSvr/Excutor/SaveMattressInterfaceExcutor.cs
  35. 14 0
      JLHHJSvr/GlobalVar/GlobalVar.cs
  36. 22 20
      JLHHJSvr/Helper/BedNetHelper.cs
  37. 232 252
      JLHHJSvr/Helper/InterfaceHelper.cs
  38. 29 0
      JLHHJSvr/JLHHJSvr.csproj
  39. 60 11
      JLHHJSvr/Tools/AutoInit.cs
  40. 53 0
      JLHWEB/src/api/interface/index.ts
  41. 12 0
      JLHWEB/src/api/modules/common.ts
  42. 49 0
      JLHWEB/src/api/modules/quote.ts
  43. 17 1
      JLHWEB/src/enums/dwnameEnum.ts
  44. 6 1
      JLHWEB/src/languages/modules/zh-cn/menu.json
  45. 81 0
      JLHWEB/src/routers/modules/mattressQtuoteRouter.ts
  46. 278 0
      JLHWEB/src/views/quote/mattressInterface/detail.vue
  47. 600 0
      JLHWEB/src/views/quote/mattressInterface/hooks/index.tsx
  48. 334 0
      JLHWEB/src/views/quote/mattressInterface/index.vue

+ 84 - 0
JLHHJSvr/BLL/UserHelper.cs

@@ -206,5 +206,89 @@ namespace JLHHJSvr.BLL
 
             return rslt.ToList();
         }
+
+        public static List<int> getPowerDept(SqlCommand cmd, int empid)
+        {
+            List<int> rslt = new List<int>();
+            var powerstr = "-1";
+            string userid;
+
+            cmd.CommandText = @"SELECT deptstr,userid FROM u_user_jlhprice WHERE Empid=@empid";
+            cmd.Parameters.Clear();
+            cmd.Parameters.AddWithValue("@empid", empid);
+
+            using (var reader = cmd.ExecuteReader())
+            {
+                if (reader.Read())
+                {
+                    powerstr = reader["deptstr"].ToString().Trim();
+                    userid = reader["userid"].ToString().Trim();
+                    if (userid.ToLower() == "super")
+                    {
+                        powerstr = "0";
+                    }
+                }
+            }
+
+            if (string.IsNullOrEmpty(powerstr) || powerstr.Equals("-1"))
+            {
+                return rslt;
+            }
+            cmd.CommandText = "select deptid from u_dept";
+            if (powerstr != "0")
+            {
+                cmd.CommandText += string.Format(" WHERE deptid IN ({0})", powerstr.Trim(','));
+            }
+            cmd.Parameters.Clear();
+            using (var reader = cmd.ExecuteReader())
+            {
+                while (reader.Read())
+                {
+                    rslt.Add(Convert.ToInt32(reader["deptid"]));
+                }
+            }
+
+            return rslt;
+        }
+
+        public static List<string> getPowerOutRep(SqlCommand cmd, int empid)
+        {
+            List<string> rslt = new List<string>();
+            var powerstr = "-1";
+            string userid;
+
+            cmd.CommandText = @"SELECT outrepstr,userid FROM u_user_jlhprice WHERE Empid=@empid";
+            cmd.Parameters.Clear();
+            cmd.Parameters.AddWithValue("@empid", empid);
+
+            using (var reader = cmd.ExecuteReader())
+            {
+                if (reader.Read())
+                {
+                    powerstr = reader["outrepstr"].ToString().Trim();
+                    userid = reader["userid"].ToString().Trim();
+                    if (userid.ToLower() == "super")
+                    {
+                        powerstr = "0";
+                    }
+                }
+            }
+
+            cmd.CommandText = "select username from u_user_jlhprice";
+            if (powerstr != "0")
+            {
+                cmd.CommandText += string.Format(" WHERE username IN ({0})", powerstr.Trim(','));
+            }
+            cmd.Parameters.Clear();
+            using (var reader = cmd.ExecuteReader())
+            {
+                while (reader.Read())
+                {
+                    rslt.Add(Convert.ToString(reader["username"]).Trim());
+                }
+            }
+
+            return rslt;
+        }
     }
 }

+ 30 - 0
JLHHJSvr/Com/GetERPConfigureList.cs

@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using JLHHJSvr.Com.Model;
+using LJLib.Net.SPI.Com;
+
+namespace JLHHJSvr.Com
+{
+    public sealed class GetERPConfigureListRequest : ILJRequest<GetERPConfigureListResponse>
+    {
+        public string GetApiName()
+        {
+            return "GetERPConfigureList";
+        }
+        /// <summary>
+        /// 登录token
+        /// </summary>
+        public string token { get; set; }
+        /// <summary>
+        /// 单据id
+        /// </summary>
+        public int? typeid { get; set; }
+    }
+
+    public sealed class GetERPConfigureListResponse : LJResponse
+    {
+        public List<erp_configure_code> configureList { get; set; }
+    }
+}

+ 30 - 0
JLHHJSvr/Com/GetERPMtrldefList.cs

@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using JLHHJSvr.Com.Model;
+using LJLib.Net.SPI.Com;
+
+namespace JLHHJSvr.Com
+{
+    public sealed class GetERPMtrldefListRequest : ILJRequest<GetERPMtrldefListResponse>
+    {
+        public string GetApiName()
+        {
+            return "GetERPMtrldefList";
+        }
+        /// <summary>
+        /// 登录token
+        /// </summary>
+        public string token { get; set; }
+        /// <summary>
+        /// 单据id
+        /// </summary>
+        public int? mtrlid { get; set; }
+    }
+
+    public sealed class GetERPMtrldefListResponse : LJResponse
+    {
+        public List<erp_mtrldef> mtrldefList { get; set; }
+    }
+}

+ 30 - 0
JLHHJSvr/Com/GetERPWrkGrpList.cs

@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using JLHHJSvr.Com.Model;
+using LJLib.Net.SPI.Com;
+
+namespace JLHHJSvr.Com
+{
+    public sealed class GetERPWrkGrpListRequest : ILJRequest<GetERPWrkGrpListResponse>
+    {
+        public string GetApiName()
+        {
+            return "GetERPWrkGrpList";
+        }
+        /// <summary>
+        /// 登录token
+        /// </summary>
+        public string token { get; set; }
+        /// <summary>
+        /// 单据id
+        /// </summary>
+        public int? wrkgrpid { get; set; }
+    }
+
+    public sealed class GetERPWrkGrpListResponse : LJResponse
+    {
+        public List<erp_sc_workgroup> workgroupList { get; set; }
+    }
+}

+ 32 - 0
JLHHJSvr/Com/GetMattressInterfaceList.cs

@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using JLHHJSvr.Com.Model;
+using LJLib.Net.SPI.Com;
+
+namespace JLHHJSvr.Com
+{
+    public sealed class GetMattressInterfaceListRequest : ILJRequest<GetMattressInterfaceListResponse>
+    {
+        public string GetApiName()
+        {
+            return "GetMattressInterfaceList";
+        }
+        /// <summary>
+        /// 登录token
+        /// </summary>
+        public string token { get; set; }
+        /// <summary>
+        /// 单据id
+        /// </summary>
+        public int? mattressid { get; set; }
+    }
+
+    public sealed class GetMattressInterfaceListResponse : LJResponse
+    {
+        public u_mattress mattress { get; set; }
+        public List<u_mattress_interface> interfaceList { get; set; }
+        public List<u_mattress_interface_qd> qdList { get; set; }
+    }
+}

+ 33 - 0
JLHHJSvr/Com/MattressJS2Audit.cs

@@ -0,0 +1,33 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using JLHHJSvr.Com.Model;
+using LJLib.Net.SPI.Com;
+
+namespace JLHHJSvr.Com
+{
+    public sealed class MattressJS2AuditRequest : ILJRequest<MattressJS2AuditResponse>
+    {
+        public string GetApiName()
+        {
+            return "MattressJS2Audit";
+        }
+        /// <summary>
+        /// 登录token
+        /// </summary>
+        public string token { get; set; }
+        /// <summary>
+        /// 1 - 审核 0 - 撤审
+        /// </summary>
+        public byte type { get; set; }
+        /// <summary>
+        /// 单据id
+        /// </summary>
+        public List<u_mattress> list { get; set; }
+    }
+
+    public sealed class MattressJS2AuditResponse : LJResponse
+    {
+    }
+}

+ 33 - 0
JLHHJSvr/Com/MattressJSAudit.cs

@@ -0,0 +1,33 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using JLHHJSvr.Com.Model;
+using LJLib.Net.SPI.Com;
+
+namespace JLHHJSvr.Com
+{
+    public sealed class MattressJSAuditRequest : ILJRequest<MattressJSAuditResponse>
+    {
+        public string GetApiName()
+        {
+            return "MattressJSAudit";
+        }
+        /// <summary>
+        /// 登录token
+        /// </summary>
+        public string token { get; set; }
+        /// <summary>
+        /// 1 - 审核 0 - 撤审
+        /// </summary>
+        public byte type { get; set; }
+        /// <summary>
+        /// 单据id
+        /// </summary>
+        public List<u_mattress> list { get; set; }
+    }
+
+    public sealed class MattressJSAuditResponse : LJResponse
+    {
+    }
+}

+ 33 - 0
JLHHJSvr/Com/MattressYWAudit.cs

@@ -0,0 +1,33 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using JLHHJSvr.Com.Model;
+using LJLib.Net.SPI.Com;
+
+namespace JLHHJSvr.Com
+{
+    public sealed class MattressYWAuditRequest : ILJRequest<MattressYWAuditResponse>
+    {
+        public string GetApiName()
+        {
+            return "MattressYWAudit";
+        }
+        /// <summary>
+        /// 登录token
+        /// </summary>
+        public string token { get; set; }
+        /// <summary>
+        /// 1 - 审核 0 - 撤审
+        /// </summary>
+        public byte type { get; set; }
+        /// <summary>
+        /// 单据id
+        /// </summary>
+        public List<u_mattress> list { get; set; }
+    }
+
+    public sealed class MattressYWAuditResponse : LJResponse
+    {
+    }
+}

+ 26 - 0
JLHHJSvr/Com/Model/ColumnItem.cs

@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace JLHHJSvr.Com.Model
+{
+    public sealed class ColumnItem
+    {
+        public string Column { get; set; }
+        public string IsNullable { get; set; }
+
+        public ColumnItem(string column, string isNullable)
+        {
+            Column = column;
+            IsNullable = isNullable;
+        }
+    }
+
+    public class CacheItem
+    {
+        public DateTime CacheTime { get; set; }
+        public Dictionary<string, ColumnItem> ColumnInfo { get; set; }
+    }
+}

+ 18 - 0
JLHHJSvr/Com/Model/erp_configure_code.cs

@@ -0,0 +1,18 @@
+using JLHHJSvr.Com.Model;
+using LJLib.DAL.SQL;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace JLHHJSvr.Com.Model
+{
+    [PK(new[] { "pzid" })]
+    public sealed class erp_configure_code
+    {
+        public int? pzid { get; set; }
+        public int? inputtype { get; set; }
+        public string pzcode { get; set; }
+        public string name { get; set; }
+    }
+}

+ 22 - 0
JLHHJSvr/Com/Model/erp_mtrldef.cs

@@ -0,0 +1,22 @@
+using LJLib.DAL.SQL;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace JLHHJSvr.Com.Model
+{
+    [PK(new[] { "mtrlid" })]
+    public sealed class erp_mtrldef
+    {
+		public int? mtrlid { get; set; }
+		public int? mtrltypeid { get; set; }
+		public string mtrltype { get; set; }
+		public string mtrlcode { get; set; }
+		public string mtrlname { get; set; }
+		public string mtrlmode { get; set; }
+		public string unit { get; set; }
+		public string mtrlengname { get; set; }
+		public int? dftwrkgrpid { get; set; }
+    }
+}

+ 16 - 0
JLHHJSvr/Com/Model/erp_sc_workgroup.cs

@@ -0,0 +1,16 @@
+using LJLib.DAL.SQL;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace JLHHJSvr.Com.Model
+{
+    [PK(new[] { "wrkgrpid" })]
+    public sealed class erp_sc_workgroup
+    {
+        public int? wrkgrpid { get; set; }
+        public int? wrkgrpname { get; set; }
+        public string wrkgrpcode { get; set; }
+    }
+}

+ 1 - 6
JLHHJSvr/Com/Model/u_spring.cs

@@ -122,14 +122,9 @@ namespace JLHHJSvr.Com.Model
         {
             get
             {
-                return $"{LeftTrim(line_diameter.Value, 4)}/{LeftTrim(height.Value, 4)}/{LeftTrim(caliber.Value, 4)}/{LeftTrim(center_diameter.Value, 4)}/{LeftTrim(cyclenum.Value, 4)}";
+                return $"{line_diameter.Value.ToString("0.###")}/{height.Value.ToString("0.###")}/{caliber.Value.ToString("0.###")}/{center_diameter.Value.ToString("0.###")}/{cyclenum.Value.ToString("0.###")}/";
             }
             set { }
         }
-
-        private string LeftTrim(decimal value, int length)
-        {
-            return value.ToString(new string('0', length)).PadLeft(length, ' ');
-        }
     }
 }

+ 31 - 0
JLHHJSvr/Com/ReBuildMattressInterface.cs

@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using JLHHJSvr.Com.Model;
+using LJLib.Net.SPI.Com;
+
+namespace JLHHJSvr.Com
+{
+    public sealed class ReBuildMattressInterfaceRequest : ILJRequest<ReBuildMattressInterfaceResponse>
+    {
+        public string GetApiName()
+        {
+            return "ReBuildMattressInterface";
+        }
+        /// <summary>
+        /// 登录token
+        /// </summary>
+        public string token { get; set; }
+        /// <summary>
+        /// 单据id
+        /// </summary>
+        public int? mattressid { get; set; }
+        public byte? isPz { get; set; }
+    }
+
+    public sealed class ReBuildMattressInterfaceResponse : LJResponse
+    {
+        public List<u_mattress_interface> mxList { get; set; }
+    }
+}

+ 31 - 0
JLHHJSvr/Com/RefreshMattressInterface.cs

@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using JLHHJSvr.Com.Model;
+using LJLib.Net.SPI.Com;
+
+namespace JLHHJSvr.Com
+{
+    public sealed class RefreshMattressInterfaceRequest : ILJRequest<RefreshMattressInterfaceResponse>
+    {
+        public string GetApiName()
+        {
+            return "RefreshMattressInterface";
+        }
+        /// <summary>
+        /// 登录token
+        /// </summary>
+        public string token { get; set; }
+        /// <summary>
+        /// 单据id
+        /// </summary>
+        public int? mattressid { get; set; }
+        public byte? isPz { get; set; }
+    }
+
+    public sealed class RefreshMattressInterfaceResponse : LJResponse
+    {
+        public List<u_mattress_interface> mxList { get; set; }
+    }
+}

+ 31 - 0
JLHHJSvr/Com/RefreshMattressInterfaceQd.cs

@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using JLHHJSvr.Com.Model;
+using LJLib.Net.SPI.Com;
+
+namespace JLHHJSvr.Com
+{
+    public sealed class RefreshMattressInterfaceQdRequest : ILJRequest<RefreshMattressInterfaceQdResponse>
+    {
+        public string GetApiName()
+        {
+            return "RefreshMattressInterfaceQd";
+        }
+        /// <summary>
+        /// 登录token
+        /// </summary>
+        public string token { get; set; }
+        /// <summary>
+        /// 单据id
+        /// </summary>
+        public int? mattressid { get; set; }
+        public byte? isPz { get; set; }
+    }
+
+    public sealed class RefreshMattressInterfaceQdResponse : LJResponse
+    {
+        public List<u_mattress_interface_qd> mxList { get; set; }
+    }
+}

+ 29 - 0
JLHHJSvr/Com/SaveMattressInterface.cs

@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using JLHHJSvr.Com.Model;
+using LJLib.Net.SPI.Com;
+
+namespace JLHHJSvr.Com
+{
+    public sealed class SaveMattressInterfaceRequest : ILJRequest<SaveMattressInterfaceResponse>
+    {
+        public string GetApiName()
+        {
+            return "SaveMattressInterface";
+        }
+        public string token { get; set; }
+        /// <summary>
+        /// 半成品信息:主表
+        /// </summary>
+        public u_mattress mattress { get; set; }
+        public List<u_mattress_interface> interfaceList { get; set; }
+        public List<u_mattress_interface_qd> qdList { get; set; }
+    }
+
+    public sealed class SaveMattressInterfaceResponse : LJResponse
+    {
+        public u_mattress mattress { get; set; }
+    }
+}

+ 4 - 0
JLHHJSvr/DataStore/_Mapper_inputtype.xml

@@ -9,6 +9,10 @@
 			{
 				"label": "录入",
 				"value": "1"
+			},
+			{
+				"label": "带出",
+				"value": "2"
 			}
 		]
 	</json>

+ 56 - 0
JLHHJSvr/DataStore/web_mattress_interface_qd.xml

@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<select>
+  <selectstr>
+SELECT u_mattress_interface_qd.mattressid
+	,u_mattress_interface_qd.printid
+	,u_mattress_interface_qd.itemname
+	,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.mtrlid
+	,u_mattress_interface_qd.erp_mtrlid
+	,u_mattress_interface_qd.useqty
+	,u_mattress_interface_qd.dscrp
+	,u_mtrl_price.name AS mtrlname
+	,u_mattress_interface_qd.actual_useqty
+	,u_mattress_interface_qd.qd_actual_size
+	,u_mattress_interface_qd.qd_pfgroupqty
+	,u_mattress_interface_qd.wrkgrpid
+	,u_mattress_interface_qd.ss_rate
+	,u_mattress_interface_qd.ls_rate
+	,u_mattress_interface_qd.sh_rate
+	,Space(200) AS erp_mtrlcode
+	,Space(200) AS erp_mtrlname
+	,Space(200) AS erp_mtrlmode
+	,Space(200) AS erp_unit
+	,Space(200) AS mtrlengname
+FROM u_mattress_interface_qd
+LEFT JOIN u_mtrl_price ON u_mtrl_price.mtrlid = u_mattress_interface_qd.mtrlid
+  </selectstr>
+  <where>
+	<when notnull="@mattressid">
+		u_mattress_interface_qd.mattressid = @mattressid
+	</when>
+  </where>
+  <displayfields>
+    <field field="printid">排序</field>
+    <field field="itemname">项目</field>
+    <field field="bj_pzname">二级项目</field>
+    <field field="bj_pzname_mx">明细项目</field>
+    <field field="bj_pzname_mx_mx">二级明细项目</field>
+    <field field="erp_mtrlcode">L1物料编码</field>
+    <field field="mtrlengname">自定义2</field>
+    <field field="erp_mtrlname">L1物料名称</field>
+    <field field="erp_mtrlmode">L1物料规格</field>
+    <field field="erp_unit">L1物料单位</field>
+    <field field="useqty" datatype="number">参考用料量</field>
+    <field field="actual_useqty" datatype="number">实际用量</field>
+    <field field="wrkgrpid">领用工组</field>
+    <field field="qd_actual_size">实际尺寸</field>
+    <field field="qd_pfgroupqty">条数</field>
+    <field field="dscrp">备注</field>
+    <field field="ss_rate" datatype="number">收缩率</field>
+    <field field="ls_rate" datatype="number">拉伸率</field>
+    <field field="sh_rate" datatype="number">损耗率</field>
+  </displayfields>
+</select>

+ 39 - 0
JLHHJSvr/DataStore/web_mattress_interface_yw.xml

@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<select>
+  <selectstr>
+SELECT mattressid
+	,printid
+	,itemname
+	,bj_pzname
+	,bj_namemx
+	,actual_size
+	,sb_craft
+	,actual_size_sb
+	,erp_pzid
+	,ss_rate
+	,ls_rate
+	,Space(200) AS erp_pzcode
+	,Space(200) AS erp_pzname
+	,bj_inputtype AS erp_inputtype
+FROM u_mattress_interface
+  </selectstr>
+  <where>
+	<when notnull="@mattressid">
+		u_mattress_interface.mattressid = @mattressid
+	</when>
+  </where>
+  <displayfields>
+    <field field="printid">排序</field>
+    <field field="itemname">项目</field>
+    <field field="bj_pzname">核价_配置名称</field>
+    <field field="erp_pzcode">ERP配置编码</field>
+    <field field="erp_pzname">ERP配置名称</field>
+    <field field="erp_inputtype" mapper="inputtype">录入类型</field>
+    <field field="bj_namemx">明细名称</field>
+    <field field="actual_size">生产尺寸</field>
+    <field field="sb_craft">锁边工艺</field>
+    <field field="actual_size_sb">锁边后尺寸</field>
+    <field field="ss_rate" datatype="number">收缩率</field>
+    <field field="ls_rate" datatype="number">拉伸率</field>
+  </displayfields>
+</select>

+ 31 - 0
JLHHJSvr/DataStore/web_mattress_interface_yw_edit.xml

@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<select>
+	<selectstr>
+SELECT u_mattress.mattressid
+	,u_mattress.erp_mtrlid
+	,u_mattress.mattressname
+	,u_mattress.erp_configcodetype
+	,u_mattress.mattresscode
+	,u_mattress.mattressrelcode
+	,erp_mtrltypeid
+	,erp_mtrlcode
+	,erp_mtrlname
+	,erp_mtrlmode
+	,erp_mtrlunit
+	,erp_mtrltype
+	,CASE 
+		WHEN isnull(erp_mtrlengname, '') = ''
+			THEN mattressrelcode
+		ELSE erp_mtrlengname
+		END AS mtrlengname
+	,old_mtrlname AS old_mtrlname
+FROM u_mattress
+	</selectstr>
+	<where>
+		<when notnull="@mattressid">
+			u_mattress.mattressid = @mattressid
+		</when>
+	</where>
+	<displayfields>
+	</displayfields>
+</select>

+ 113 - 0
JLHHJSvr/DataStore/web_mattress_interfacelist.xml

@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<select>
+  <selectstr>
+SELECT mattressid
+	,mattressname
+	,deptid
+	,mattresstypeid
+	,mattresscode
+	,mattress_width
+	,mattress_length
+	,mattress_height
+	,packtype
+	,packqty
+	,woodpallettype
+	,total_hr_cost
+	,total_material_cost
+	,fees_dscrp
+	,total_fees_cost
+	,total_cost
+	,taxrate
+	,taxes
+	,commissionrate
+	,commission
+	,fob
+	,profitrate
+	,nottax_factory_cost
+	,nottax_dept_cost
+	,dept_cost
+	,foreign_cost
+	,extras_cost
+	,dept_profitrate
+	,moneyrate
+	,mattressrelcode
+	,flag
+	,auditingrep
+	,auditingdate
+	,createtime
+	,createby
+	,yw_flag
+	,yw_auditingrep
+	,yw_auditingdate
+	,js1_flag
+	,js1_auditingrep
+	,js1_auditingdate
+	,js2_flag
+	,js2_auditingrep
+	,js2_auditingdate
+	,creatmtrl_flag
+	,creatmtrl_auditingrep
+	,creatmtrl_auditingdate
+	,creatmtrlqd_flag
+	,creatmtrlqd_auditingrep
+	,creatmtrlqd_auditingdate
+	,erp_mtrlcode AS erp_mtrlcode
+	,erp_mtrlid
+	,nottax_factory_cost / (dept_profitrate + dept_profitrate_rangli / 100) AS dijia_cost
+	,erp_mtrlengname
+	,erp_configcodetype
+	,0 AS yongjin
+FROM u_mattress
+  </selectstr>
+  <where>
+	<when>u_mattress.xd_flag = 1</when>
+	<when notnull="@arg_deptid">u_mattress.deptid=@arg_deptid</when>
+	<when notnull="@creatmtrlqd_flag">u_mattress.creatmtrlqd_flag = @creatmtrlqd_flag</when>
+	<when notnull="@creatmtrl_flag">u_mattress.creatmtrl_flag = @creatmtrl_flag</when>
+	<when notnull="@js2_flag">u_mattress.js2_flag = @js2_flag</when>
+	<when notnull="@js1_flag">u_mattress.js1_flag = @js1_flag</when>
+	<when notnull="@yw_flag">u_mattress.yw_flag = @yw_flag</when>
+	<when>
+		u_mattress.createby in ($$user_outrepstr$$)
+	</when>
+	<when>
+		u_mattress.deptid in ($$user_deptstr$$)
+	</when>
+  </where>
+  <displayfields>
+    <field field="pid" compute="getrow()">序</field>
+    <field field="yw_flag" datatype="checkbox">业务审核</field>
+    <field field="js1_flag" datatype="checkbox">产品补充审核</field>
+    <field field="js2_flag" datatype="checkbox">清单补充审核</field>
+    <field field="creatmtrl_flag" datatype="checkbox">生成L1产品</field>
+    <field field="creatmtrlqd_flag" datatype="checkbox">生成L1清单</field>
+    <field field="erp_mtrlcode">L1物料编码</field>
+    <field field="deptid" mapper="">部门</field>
+    <field field="mattresscode">报价唯一码</field>
+    <field field="mattressrelcode">床垫编码</field>
+    <field field="mattressname">床垫名称</field>
+    <field field="mattresstypeid" mapper="">床垫类别</field>
+    <field field="mattress_width" datatype="number">床垫宽/CM</field>
+    <field field="mattress_length" datatype="number">床垫长/CM</field>
+    <field field="mattress_height" datatype="number">床垫高/CM</field>
+    <field field="createby">登记人</field>
+    <field field="createtime" datatype="datetime">登记时间</field>
+    <field field="yw_auditingrep">业务审核人</field>
+    <field field="yw_auditingdate" datatype="datetime">业务审核时间</field>
+    <field field="js1_auditingrep">产品补充审核人</field>
+    <field field="js1_auditingdate" datatype="datetime">产品补充审核时间</field>
+    <field field="js2_auditingrep">清单补充审核人</field>
+    <field field="js2_auditingdate" datatype="datetime">清单补充审核时间</field>
+    <field field="creatmtrl_auditingrep">生成L1产品人</field>
+    <field field="creatmtrl_auditingdate" datatype="datetime">生成L1产品时间</field>
+    <field field="creatmtrlqd_auditingrep">生成L1清单人</field>
+    <field field="creatmtrlqd_auditingdate" datatype="datetime">生成L1清单时间</field>
+    <field field="dijia_cost" datatype="number">底价</field>
+    <field field="yongjin" datatype="number">佣金</field>
+    <field field="taxrate" datatype="number">税率</field>
+    <field field="fob" datatype="number">Fob</field>
+    <field field="taxes" datatype="number">税金</field>
+    <field field="erp_mtrlengname">原物料编码</field>
+    <field field="erp_configcodetype">ERP配置类型</field>
+  </displayfields>
+</select>

+ 13 - 0
JLHHJSvr/Excutor/CommonDynamicSelectExcutor.cs

@@ -133,6 +133,19 @@ namespace JLHHJSvr.Excutor
                         {
                             var staticParm = item.Trim('$');
                             var staticVal = string.Empty;
+
+                            if (staticParm == "user_deptstr")
+                            {
+                                var getPower = UserHelper.getPowerDept(cmd, tokendata.empid);
+                                if (getPower.Count == 0) getPower.Add(-1);
+                                staticVal = ListEx.getString(getPower);
+                            }else if (staticParm == "user_outrepstr")
+                            {
+                                var getPower = UserHelper.getPowerOutRep(cmd, tokendata.empid);
+                                if (getPower.Count == 0) getPower.Add("");
+                                staticVal = ListEx.getString(getPower);
+                            }
+
                             staticVal = staticVal ?? string.Empty;
                             staticParmDic[item] = staticVal.Trim(new[] { '(', ')' });
                         }

+ 64 - 0
JLHHJSvr/Excutor/GetERPConfigureListExcutor.cs

@@ -0,0 +1,64 @@
+using System;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Linq;
+using DirectService.Tools;
+using JLHHJSvr.BLL;
+using JLHHJSvr.Com;
+using JLHHJSvr.Com.Model;
+using JLHHJSvr.Helper;
+using JLHHJSvr.LJException;
+using LJLib.DAL.SQL;
+using LJLib.Net.SPI.Server;
+
+namespace JLHHJSvr.Excutor
+{
+    internal sealed class GetERPConfigureListExcutor : ExcutorBase<GetERPConfigureListRequest, GetERPConfigureListResponse>
+    {
+        protected override void ExcuteInternal(GetERPConfigureListRequest request, object state, GetERPConfigureListResponse rslt)
+        {
+            var tokendata = BllHelper.GetToken(request.token);
+            if (tokendata == null)
+            {
+                rslt.ErrMsg = "会话已经中断,请重新登录";
+                return;
+            }
+            if (request.typeid == null || request.typeid <= 0)
+            {
+                rslt.ErrMsg = "配置id有误,请检查!";
+                return;
+            }
+
+            using (var con = new SqlConnection(GlobalVar.ConnectionString))
+            using (var cmd = con.CreateCommand())
+            {
+                con.Open();
+
+                using (var erp_con = new SqlConnection(BllHelper.GetERPConnectString(cmd)))
+                using (var erp_cmd = erp_con.CreateCommand())
+                {
+                    erp_con.Open();
+                    var configureList = new List<erp_configure_code>();
+
+                    var param = new Dictionary<string, object>();
+                    var whereList = new List<string>();
+                    var selectStr = @"SELECT u_configure_code.pzid,
+	                                        u_configure_code.pzcode,
+	                                        u_configure_code.name,
+	                                        u_configure_code.inputtype
+                                    FROM u_configure_code";
+                    var outputFields = "pzid,pzcode,name,inputtype";
+
+                    if (request.typeid != null && request.typeid > 0)
+                    {
+                        whereList.Add("typeid = @typeid");
+                        param.Add("@typeid", request.typeid);
+                    }
+                    DbSqlHelper.SelectJoin(erp_cmd, selectStr, ListEx.GetWhereStr(whereList), param, "typeid", outputFields, 0, 0, configureList);
+
+                    rslt.configureList = configureList;
+                }
+            }
+        }
+    }
+}

+ 69 - 0
JLHHJSvr/Excutor/GetERPMtrldefListExcutor.cs

@@ -0,0 +1,69 @@
+using System;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Linq;
+using DirectService.Tools;
+using JLHHJSvr.BLL;
+using JLHHJSvr.Com;
+using JLHHJSvr.Com.Model;
+using JLHHJSvr.Helper;
+using JLHHJSvr.LJException;
+using LJLib.DAL.SQL;
+using LJLib.Net.SPI.Server;
+
+namespace JLHHJSvr.Excutor
+{
+    internal sealed class GetERPMtrldefListExcutor : ExcutorBase<GetERPMtrldefListRequest, GetERPMtrldefListResponse>
+    {
+        protected override void ExcuteInternal(GetERPMtrldefListRequest request, object state, GetERPMtrldefListResponse rslt)
+        {
+            var tokendata = BllHelper.GetToken(request.token);
+            if (tokendata == null)
+            {
+                rslt.ErrMsg = "会话已经中断,请重新登录";
+                return;
+            }
+            if (request.mtrlid == null || request.mtrlid <= 0)
+            {
+                rslt.ErrMsg = "物料id有误,请检查!";
+                return;
+            }
+
+            using (var con = new SqlConnection(GlobalVar.ConnectionString))
+            using (var cmd = con.CreateCommand())
+            {
+                con.Open();
+
+                using (var erp_con = new SqlConnection(BllHelper.GetERPConnectString(cmd)))
+                using (var erp_cmd = erp_con.CreateCommand())
+                {
+                    erp_con.Open();
+                    var mtrldefList = new List<erp_mtrldef>();
+
+                    var param = new Dictionary<string, object>();
+                    var whereList = new List<string>();
+                    var selectStr = @"SELECT mtrltypeid
+	                                    ,mtrltype
+	                                    ,mtrlcode
+	                                    ,mtrlname
+	                                    ,mtrlmode
+	                                    ,unit
+	                                    ,mtrlengname
+	                                    ,dftwrkgrpid
+                                        ,mtrlid
+                                    FROM u_mtrldef";
+                    var outputFields = "mtrltypeid,mtrltype,mtrlcode,mtrlname,mtrlmode,unit,mtrlengname,dftwrkgrpid,mtrlid";
+
+                    if(request.mtrlid != null && request.mtrlid > 0)
+                    {
+                        whereList.Add("mtrlid = @mtrlid");
+                        param.Add("@mtrlid", request.mtrlid);
+                    }
+                    DbSqlHelper.SelectJoin(erp_cmd, selectStr, ListEx.GetWhereStr(whereList), param, "mtrlid", outputFields, 0, 0, mtrldefList);
+
+                    rslt.mtrldefList = mtrldefList;
+                }
+            }
+        }
+    }
+}

+ 64 - 0
JLHHJSvr/Excutor/GetERPWrkGrpListExcutor.cs

@@ -0,0 +1,64 @@
+using System;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Linq;
+using DirectService.Tools;
+using JLHHJSvr.BLL;
+using JLHHJSvr.Com;
+using JLHHJSvr.Com.Model;
+using JLHHJSvr.Helper;
+using JLHHJSvr.LJException;
+using LJLib.DAL.SQL;
+using LJLib.Net.SPI.Server;
+
+namespace JLHHJSvr.Excutor
+{
+    internal sealed class GetERPWrkGrpListExcutor : ExcutorBase<GetERPWrkGrpListRequest, GetERPWrkGrpListResponse>
+    {
+        protected override void ExcuteInternal(GetERPWrkGrpListRequest request, object state, GetERPWrkGrpListResponse rslt)
+        {
+            var tokendata = BllHelper.GetToken(request.token);
+            if (tokendata == null)
+            {
+                rslt.ErrMsg = "会话已经中断,请重新登录";
+                return;
+            }
+            if (request.wrkgrpid == null || request.wrkgrpid <= 0)
+            {
+                rslt.ErrMsg = "工组id有误,请检查!";
+                return;
+            }
+
+            using (var con = new SqlConnection(GlobalVar.ConnectionString))
+            using (var cmd = con.CreateCommand())
+            {
+                con.Open();
+
+                using (var erp_con = new SqlConnection(BllHelper.GetERPConnectString(cmd)))
+                using (var erp_cmd = erp_con.CreateCommand())
+                {
+                    erp_con.Open();
+                    var workgroupList = new List<erp_sc_workgroup>();
+
+                    var param = new Dictionary<string, object>();
+                    var whereList = new List<string>();
+                    var selectStr = @"SELECT u_sc_workgroup.wrkGrpid
+	                                        ,u_sc_workgroup.wrkGrpName
+	                                        ,u_sc_workgroup.wrkgrpcode
+                                        FROM u_sc_workgroup
+                                        WHERE inuse = 1";
+                    var outputFields = "pzid,pzcode,name,inputtype";
+
+                    if (request.wrkgrpid != null && request.wrkgrpid > 0)
+                    {
+                        whereList.Add("wrkgrpid = @wrkgrpid");
+                        param.Add("@wrkgrpid", request.wrkgrpid);
+                    }
+                    DbSqlHelper.SelectJoin(erp_cmd, selectStr, ListEx.GetWhereStr(whereList), param, "wrkgrpid", outputFields, 0, 0, workgroupList);
+
+                    rslt.workgroupList = workgroupList;
+                }
+            }
+        }
+    }
+}

+ 100 - 0
JLHHJSvr/Excutor/GetMattressInterfaceListExcutor.cs

@@ -0,0 +1,100 @@
+using System;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Linq;
+using DirectService.Tools;
+using JLHHJSvr.BLL;
+using JLHHJSvr.Com;
+using JLHHJSvr.Com.Model;
+using JLHHJSvr.Helper;
+using JLHHJSvr.LJException;
+using LJLib.DAL.SQL;
+using LJLib.Net.SPI.Server;
+
+namespace JLHHJSvr.Excutor
+{
+    internal sealed class GetMattressInterfaceListExcutor : ExcutorBase<GetMattressInterfaceListRequest, GetMattressInterfaceListResponse>
+    {
+        protected override void ExcuteInternal(GetMattressInterfaceListRequest request, object state, GetMattressInterfaceListResponse rslt)
+        {
+            var tokendata = BllHelper.GetToken(request.token);
+            if (tokendata == null)
+            {
+                rslt.ErrMsg = "会话已经中断,请重新登录";
+                return;
+            }
+            if (request.mattressid == null || request.mattressid <= 0)
+            {
+                rslt.ErrMsg = "床垫id有误,请检查!";
+                return;
+            }
+
+            using (var con = new SqlConnection(GlobalVar.ConnectionString))
+            using (var cmd = con.CreateCommand())
+            {
+                con.Open();
+
+                cmd.CommandText = @"SELECT u_mattress.mattressid
+	                                ,u_mattress.erp_mtrlid
+	                                ,u_mattress.mattressname
+	                                ,u_mattress.erp_configcodetype
+	                                ,u_mattress.mattresscode
+	                                ,u_mattress.mattressrelcode
+	                                ,erp_mtrltypeid
+	                                ,erp_mtrlcode
+	                                ,erp_mtrlname
+	                                ,erp_mtrlmode
+	                                ,erp_mtrlunit
+	                                ,erp_mtrltype
+	                                ,CASE 
+		                                WHEN isnull(erp_mtrlengname, '') = ''
+			                                THEN mattressrelcode
+		                                ELSE erp_mtrlengname
+		                                END AS erp_mtrlengname
+	                                ,old_mtrlname AS old_mtrlname
+                                FROM u_mattress
+                                WHERE u_mattress.mattressid = @mattressid";
+                cmd.Parameters.Clear();
+                cmd.Parameters.AddWithValue("@mattressid", request.mattressid);
+                using (var reader = cmd.ExecuteReader()) 
+                {
+                    if (reader.Read()) {
+                        rslt.mattress = new u_mattress()
+                        {
+                            mattressid = request.mattressid.Value,
+                            erp_mtrlid = Convert.ToInt32(reader["erp_mtrlid"]),
+                            mattressname = Convert.ToString(reader["mattressname"]),
+                            mattresscode = Convert.ToString(reader["mattresscode"]),
+                            mattressrelcode = Convert.ToString(reader["mattressrelcode"]),
+                            erp_configcodetype = Convert.ToInt32(reader["erp_configcodetype"]),
+                            erp_mtrltypeid = Convert.ToInt32(reader["erp_mtrltypeid"]),
+                            erp_mtrlcode = Convert.ToString(reader["erp_mtrlcode"]),
+                            erp_mtrlname = Convert.ToString(reader["erp_mtrlname"]),
+                            erp_mtrlmode = Convert.ToString(reader["erp_mtrlmode"]),
+                            erp_mtrlunit = Convert.ToString(reader["erp_mtrlunit"]),
+                            erp_mtrlengname = Convert.ToString(reader["erp_mtrlengname"]),
+                            erp_mtrltype = Convert.ToString(reader["erp_mtrltype"]),
+                            old_mtrlname = Convert.ToString(reader["old_mtrlname"])
+                        };
+                    }
+                }
+
+                using (var erp_con = new SqlConnection(BllHelper.GetERPConnectString(cmd)))
+                using (var erp_cmd = erp_con.CreateCommand())
+                {
+                    erp_con.Open();
+
+                    var interfaceHelper = HelperBase.GetHelper<InterfaceHelper>(cmd, erp_cmd, new HelperBase.Context() { tokendata = tokendata });
+
+                    var interfaceList = interfaceHelper.GetMattressInterfaceList(request.mattressid.Value);
+                    var qdList = interfaceHelper.GetMattressInterfaceQdList(request.mattressid.Value);
+
+                    interfaceHelper.MattressInterfaceFindERPPrdPf(qdList, interfaceList);
+
+                    rslt.interfaceList = interfaceList;
+                    rslt.qdList = qdList;
+                }
+            }
+        }
+    }
+}

+ 75 - 0
JLHHJSvr/Excutor/MattressJS2AuditExcutor.cs

@@ -0,0 +1,75 @@
+using System;
+using System.Data.SqlClient;
+using System.Linq;
+using JLHHJSvr.BLL;
+using JLHHJSvr.Com;
+using JLHHJSvr.Com.Model;
+using JLHHJSvr.Helper;
+using JLHHJSvr.LJException;
+using LJLib.DAL.SQL;
+using LJLib.Net.SPI.Server;
+
+namespace JLHHJSvr.Excutor
+{
+    internal sealed class MattressJS2AuditExcutor : ExcutorBase<MattressJS2AuditRequest, MattressJS2AuditResponse>
+    {
+        protected override void ExcuteInternal(MattressJS2AuditRequest request, object state, MattressJS2AuditResponse rslt)
+        {
+            var tokendata = BllHelper.GetToken(request.token);
+            if (tokendata == null)
+            {
+                rslt.ErrMsg = "会话已经中断,请重新登录";
+                return;
+            }
+            if (!request.list.Any())
+            {
+                rslt.ErrMsg = "至少提交一条需要审核的记录";
+                return;
+            }
+
+            using (var con = new SqlConnection(GlobalVar.ConnectionString))
+            using (var cmd = con.CreateCommand())
+            {
+                con.Open();
+
+                if (request.type == 1)
+                {
+                    var power86 = UserHelper.CheckFuncPower(cmd, tokendata.empid, 86);
+                    if (!power86)
+                    {
+                        throw new LJCommonException("你没有审核权限");
+                    }
+                }
+                else
+                {
+                    var power87 = UserHelper.CheckFuncPower(cmd, tokendata.empid, 87);
+                    if (!power87)
+                    {
+                        throw new LJCommonException("你没有撤审权限");
+                    }
+                }
+
+                var mattressHelper = HelperBase.GetHelper<MattressHelper>(cmd, new HelperBase.Context() { tokendata = tokendata });
+
+                using (cmd.Transaction = con.BeginTransaction())
+                {
+                    try
+                    {
+                        foreach (var bill in request.list)
+                        {
+                            if (request.type == 1) mattressHelper.MattressJS2Audit(bill.mattressid);
+                            else mattressHelper.MattressJS2CancelAudit(bill.mattressid);
+                        }
+
+                        cmd.Transaction.Commit();
+                    }
+                    catch (Exception e)
+                    {
+                        cmd.Transaction.Rollback();
+                        rslt.ErrMsg = e.ToString();
+                    }
+                }
+            }
+        }
+    }
+}

+ 75 - 0
JLHHJSvr/Excutor/MattressJSAuditExcutor.cs

@@ -0,0 +1,75 @@
+using System;
+using System.Data.SqlClient;
+using System.Linq;
+using JLHHJSvr.BLL;
+using JLHHJSvr.Com;
+using JLHHJSvr.Com.Model;
+using JLHHJSvr.Helper;
+using JLHHJSvr.LJException;
+using LJLib.DAL.SQL;
+using LJLib.Net.SPI.Server;
+
+namespace JLHHJSvr.Excutor
+{
+    internal sealed class MattressJSAuditExcutor : ExcutorBase<MattressJSAuditRequest, MattressJSAuditResponse>
+    {
+        protected override void ExcuteInternal(MattressJSAuditRequest request, object state, MattressJSAuditResponse rslt)
+        {
+            var tokendata = BllHelper.GetToken(request.token);
+            if (tokendata == null)
+            {
+                rslt.ErrMsg = "会话已经中断,请重新登录";
+                return;
+            }
+            if (!request.list.Any())
+            {
+                rslt.ErrMsg = "至少提交一条需要审核的记录";
+                return;
+            }
+
+            using (var con = new SqlConnection(GlobalVar.ConnectionString))
+            using (var cmd = con.CreateCommand())
+            {
+                con.Open();
+
+                if (request.type == 1)
+                {
+                    var power83 = UserHelper.CheckFuncPower(cmd, tokendata.empid, 83);
+                    if (!power83)
+                    {
+                        throw new LJCommonException("你没有审核权限");
+                    }
+                }
+                else
+                {
+                    var power84 = UserHelper.CheckFuncPower(cmd, tokendata.empid, 84);
+                    if (!power84)
+                    {
+                        throw new LJCommonException("你没有撤审权限");
+                    }
+                }
+
+                var mattressHelper = HelperBase.GetHelper<MattressHelper>(cmd, new HelperBase.Context() { tokendata = tokendata });
+
+                using (cmd.Transaction = con.BeginTransaction())
+                {
+                    try
+                    {
+                        foreach (var bill in request.list)
+                        {
+                            if (request.type == 1) mattressHelper.MattressJSAudit(bill.mattressid);
+                            else mattressHelper.MattressJSCancelAudit(bill.mattressid);
+                        }
+
+                        cmd.Transaction.Commit();
+                    }
+                    catch (Exception e)
+                    {
+                        cmd.Transaction.Rollback();
+                        rslt.ErrMsg = e.ToString();
+                    }
+                }
+            }
+        }
+    }
+}

+ 75 - 0
JLHHJSvr/Excutor/MattressYWAuditExcutor.cs

@@ -0,0 +1,75 @@
+using System;
+using System.Data.SqlClient;
+using System.Linq;
+using JLHHJSvr.BLL;
+using JLHHJSvr.Com;
+using JLHHJSvr.Com.Model;
+using JLHHJSvr.Helper;
+using JLHHJSvr.LJException;
+using LJLib.DAL.SQL;
+using LJLib.Net.SPI.Server;
+
+namespace JLHHJSvr.Excutor
+{
+    internal sealed class MattressYWAuditExcutor : ExcutorBase<MattressYWAuditRequest, MattressYWAuditResponse>
+    {
+        protected override void ExcuteInternal(MattressYWAuditRequest request, object state, MattressYWAuditResponse rslt)
+        {
+            var tokendata = BllHelper.GetToken(request.token);
+            if (tokendata == null)
+            {
+                rslt.ErrMsg = "会话已经中断,请重新登录";
+                return;
+            }
+            if (!request.list.Any())
+            {
+                rslt.ErrMsg = "至少提交一条需要审核的记录";
+                return;
+            }
+
+            using (var con = new SqlConnection(GlobalVar.ConnectionString))
+            using (var cmd = con.CreateCommand())
+            {
+                con.Open();
+
+                if (request.type == 1)
+                {
+                    var power80 = UserHelper.CheckFuncPower(cmd, tokendata.empid, 80);
+                    if (!power80)
+                    {
+                        throw new LJCommonException("你没有审核权限");
+                    }
+                }
+                else
+                {
+                    var power81 = UserHelper.CheckFuncPower(cmd, tokendata.empid, 81);
+                    if (!power81)
+                    {
+                        throw new LJCommonException("你没有撤审权限");
+                    }
+                }
+
+                var mattressHelper = HelperBase.GetHelper<MattressHelper>(cmd, new HelperBase.Context() { tokendata = tokendata });
+
+                using (cmd.Transaction = con.BeginTransaction())
+                {
+                    try
+                    {
+                        foreach (var bill in request.list)
+                        {
+                            if (request.type == 1) mattressHelper.MattressYWAudit(bill.mattressid);
+                            else mattressHelper.MattressYWCancelAudit(bill.mattressid);
+                        }
+
+                        cmd.Transaction.Commit();
+                    }
+                    catch (Exception e)
+                    {
+                        cmd.Transaction.Rollback();
+                        rslt.ErrMsg = e.ToString();
+                    }
+                }
+            }
+        }
+    }
+}

+ 67 - 0
JLHHJSvr/Excutor/ReBuildMattressInterfaceExcutor.cs

@@ -0,0 +1,67 @@
+using System;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Linq;
+using JLHHJSvr.BLL;
+using JLHHJSvr.Com;
+using JLHHJSvr.Com.Model;
+using JLHHJSvr.Helper;
+using JLHHJSvr.LJException;
+using LJLib.DAL.SQL;
+using LJLib.Net.SPI.Server;
+
+namespace JLHHJSvr.Excutor
+{
+    internal sealed class ReBuildMattressInterfaceExcutor : ExcutorBase<ReBuildMattressInterfaceRequest, ReBuildMattressInterfaceResponse>
+    {
+        protected override void ExcuteInternal(ReBuildMattressInterfaceRequest request, object state, ReBuildMattressInterfaceResponse rslt)
+        {
+            var tokendata = BllHelper.GetToken(request.token);
+            if (tokendata == null)
+            {
+                rslt.ErrMsg = "会话已经中断,请重新登录";
+                return;
+            }
+            if (request.mattressid == null || request.mattressid <= 0)
+            {
+                rslt.ErrMsg = "床垫id有误,请检查!";
+                return;
+            }
+
+            using (var con = new SqlConnection(GlobalVar.ConnectionString))
+            using (var cmd = con.CreateCommand())
+            {
+                con.Open();
+
+                var copy_list = new List<u_mattress_interface>();
+
+                var selectStr = @"SELECT mattressid
+	                            ,printid
+	                            ,itemname
+	                            ,bj_pzname
+	                            ,bj_namemx
+	                            ,actual_size
+	                            ,sb_craft
+	                            ,actual_size_sb
+	                            ,erp_pzid
+	                            ,ss_rate
+	                            ,ls_rate
+	                            ,bj_inputtype
+                            FROM u_mattress_interface";
+                DbSqlHelper.SelectJoin(cmd, selectStr, "mattressid = @mattressid", new Dictionary<string, object>() { { "@mattressid", request.mattressid } }, "printid", "mattressid,printid,itemname,bj_pzname,bj_namemx,actual_size,sb_craft,actual_size_sb,erp_pzid,ss_rate,ls_rate,bj_inputtype", 0, 0, copy_list);
+
+                using (var erp_con = new SqlConnection(BllHelper.GetERPConnectString(cmd)))
+                using (var erp_cmd = erp_con.CreateCommand())
+                {
+                    erp_con.Open();
+
+                    var interfaceHelper = HelperBase.GetHelper<InterfaceHelper>(cmd, erp_cmd, new HelperBase.Context() { tokendata = tokendata });
+
+                    var interfaceList = interfaceHelper.RefreshMattressInterfaceList(request.mattressid.Value);
+
+                    rslt.mxList = interfaceList;
+                }
+            }
+        }
+    }
+}

+ 102 - 0
JLHHJSvr/Excutor/RefreshMattressInterfaceExcutor.cs

@@ -0,0 +1,102 @@
+using System;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Linq;
+using JLHHJSvr.BLL;
+using JLHHJSvr.Com;
+using JLHHJSvr.Com.Model;
+using JLHHJSvr.Helper;
+using JLHHJSvr.LJException;
+using LJLib.DAL.SQL;
+using LJLib.Net.SPI.Server;
+
+namespace JLHHJSvr.Excutor
+{
+    internal sealed class RefreshMattressInterfaceExcutor : ExcutorBase<RefreshMattressInterfaceRequest, RefreshMattressInterfaceResponse>
+    {
+        protected override void ExcuteInternal(RefreshMattressInterfaceRequest request, object state, RefreshMattressInterfaceResponse rslt)
+        {
+            var tokendata = BllHelper.GetToken(request.token);
+            if (tokendata == null)
+            {
+                rslt.ErrMsg = "会话已经中断,请重新登录";
+                return;
+            }
+            if (request.mattressid == null || request.mattressid <= 0)
+            {
+                rslt.ErrMsg = "床垫id有误,请检查!";
+                return;
+            }
+
+            using (var con = new SqlConnection(GlobalVar.ConnectionString))
+            using (var cmd = con.CreateCommand())
+            {
+                con.Open();
+
+                var copy_list = new List<u_mattress_interface>();
+
+                var selectStr = @"SELECT mattressid
+	                            ,printid
+	                            ,itemname
+	                            ,bj_pzname
+	                            ,bj_namemx
+	                            ,actual_size
+	                            ,sb_craft
+	                            ,actual_size_sb
+	                            ,erp_pzid
+	                            ,ss_rate
+	                            ,ls_rate
+	                            ,bj_inputtype
+                            FROM u_mattress_interface";
+                DbSqlHelper.SelectJoin(cmd, selectStr, "mattressid = @mattressid", new Dictionary<string, object>() { { "@mattressid", request.mattressid } }, "printid", "mattressid,printid,itemname,bj_pzname,bj_namemx,actual_size,sb_craft,actual_size_sb,erp_pzid,ss_rate,ls_rate,bj_inputtype", 0, 0, copy_list);
+
+                using (var erp_con = new SqlConnection(BllHelper.GetERPConnectString(cmd)))
+                using (var erp_cmd = erp_con.CreateCommand())
+                {
+                    erp_con.Open();
+
+                    var interfaceHelper = HelperBase.GetHelper<InterfaceHelper>(cmd,erp_cmd, new HelperBase.Context() { tokendata = tokendata });
+
+                    var interfaceList = interfaceHelper.RefreshMattressInterfaceList(request.mattressid.Value);
+
+                    if(request.isPz != null && request.isPz == 1)
+                    {
+                        var copyDict = copy_list.Where(mx2 => mx2.erp_pzid > 0)
+                                    .ToDictionary(mx2 => mx2.erp_pzid, mx2 => mx2);
+
+                        foreach (var mx in interfaceList)
+                        {
+                            if (mx.erp_pzid > 0 && copyDict.TryGetValue(mx.erp_pzid, out var mx2))
+                            {
+                                if (mx.bj_inputtype != 2 || (mx.bj_inputtype == 2 && mx2.bj_inputtype == 1))
+                                {
+                                    mx.bj_namemx = mx2.bj_namemx;
+                                    mx.actual_size = mx2.actual_size;
+                                    mx.sb_craft = mx2.sb_craft;
+                                    mx.actual_size_sb = mx2.actual_size_sb;
+                                    mx.ss_rate = mx2.ss_rate;
+                                    mx.ls_rate = mx2.ls_rate;
+
+                                    if (mx.bj_inputtype == 2 && mx2.bj_inputtype == 1)
+                                    {
+                                        mx.bj_inputtype = 1;
+                                    }
+                                }
+                                else
+                                {
+                                    mx.actual_size = mx2.actual_size;
+                                    mx.sb_craft = mx2.sb_craft;
+                                    mx.actual_size_sb = mx2.actual_size_sb;
+                                    mx.ss_rate = mx2.ss_rate;
+                                    mx.ls_rate = mx2.ls_rate;
+                                }
+                            }
+                        }
+                    }
+
+                    rslt.mxList = interfaceList;
+                }
+            }
+        }
+    }
+}

+ 110 - 0
JLHHJSvr/Excutor/RefreshMattressInterfaceQdExcutor.cs

@@ -0,0 +1,110 @@
+using System;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Linq;
+using JLHHJSvr.BLL;
+using JLHHJSvr.Com;
+using JLHHJSvr.Com.Model;
+using JLHHJSvr.Helper;
+using JLHHJSvr.LJException;
+using LJLib.DAL.SQL;
+using LJLib.Net.SPI.Server;
+
+namespace JLHHJSvr.Excutor
+{
+    internal sealed class RefreshMattressInterfaceQdExcutor : ExcutorBase<RefreshMattressInterfaceQdRequest, RefreshMattressInterfaceQdResponse>
+    {
+        protected override void ExcuteInternal(RefreshMattressInterfaceQdRequest request, object state, RefreshMattressInterfaceQdResponse rslt)
+        {
+            var tokendata = BllHelper.GetToken(request.token);
+            if (tokendata == null)
+            {
+                rslt.ErrMsg = "会话已经中断,请重新登录";
+                return;
+            }
+            if (request.mattressid == null || request.mattressid <= 0)
+            {
+                rslt.ErrMsg = "床垫id有误,请检查!";
+                return;
+            }
+
+            using (var con = new SqlConnection(GlobalVar.ConnectionString))
+            using (var cmd = con.CreateCommand())
+            {
+                con.Open();
+
+                var mattress = new u_mattress() { mattressid = request.mattressid.Value };
+                DbSqlHelper.SelectOne(cmd, mattress, "js2_flag");
+
+                if (mattress.js2_flag == 1)
+                {
+                    throw new LJCommonException("床垫已技术2审核,不能重新生成!");
+                }
+
+                var copy_list = new List<u_mattress_interface_qd>();
+
+                var selectStr = @"SELECT u_mattress_interface_qd.mattressid 
+	                            ,u_mattress_interface_qd.printid 
+	                            ,u_mattress_interface_qd.itemname 
+	                            ,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.mtrlid 
+	                            ,u_mattress_interface_qd.erp_mtrlid 
+	                            ,u_mattress_interface_qd.useqty 
+	                            ,u_mattress_interface_qd.dscrp 
+	                            ,u_mtrl_price.name AS mtrlname
+	                            ,u_mattress_interface_qd.actual_useqty 
+	                            ,u_mattress_interface_qd.qd_actual_size 
+	                            ,u_mattress_interface_qd.qd_pfgroupqty 
+	                            ,u_mattress_interface_qd.wrkgrpid 
+	                            ,u_mattress_interface_qd.ss_rate 
+	                            ,u_mattress_interface_qd.ls_rate 
+	                            ,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,ss_rate,ls_rate,sh_rate";
+                DbSqlHelper.SelectJoin(cmd, selectStr, "mattressid = @mattressid", new Dictionary<string, object>() { { "@mattressid", request.mattressid } }, "printid", outputFields, 0, 0, copy_list);
+
+
+                using (var erp_con = new SqlConnection(BllHelper.GetERPConnectString(cmd)))
+                using (var erp_cmd = erp_con.CreateCommand())
+                {
+                    erp_con.Open();
+
+                    var interfaceHelper = HelperBase.GetHelper<InterfaceHelper>(cmd, erp_cmd, new HelperBase.Context() { tokendata = tokendata });
+
+                    var qdList = interfaceHelper.RefreshMattressInterfaceQdList(request.mattressid.Value);
+
+                    if(request.isPz != null && request.isPz == 1)
+                    {
+                        var copyDict = copy_list.ToDictionary(mx2 => Tuple.Create(mx2.itemname, mx2.bj_pzname, mx2.bj_pzname_mx), mx2 => mx2);
+
+                        // 遍历qdList
+                        foreach (var mx in qdList)
+                        {
+                            var key = Tuple.Create(mx.itemname, mx.bj_pzname, mx.bj_pzname_mx); // 创建复合键
+                            if (copyDict.TryGetValue(key, out var mx2)) // 高效查找对应的mx2
+                            {
+                                // 更新mx属性
+                                mx.erp_mtrlid = mx2.erp_mtrlid;
+                                mx.erp_mtrlcode = mx2.erp_mtrlcode;
+                                mx.erp_mtrlname = mx2.erp_mtrlname;
+                                mx.erp_mtrlmode = mx2.erp_mtrlmode;
+                                mx.erp_unit = mx2.erp_unit;
+                                mx.useqty = mx2.useqty;
+                                mx.actual_useqty = mx2.actual_useqty;
+                                mx.wrkgrpid = mx2.wrkgrpid;
+                                mx.qd_actual_size = mx2.qd_actual_size;
+                                mx.qd_pfgroupqty = mx2.qd_pfgroupqty;
+                                mx.dscrp = mx2.dscrp;
+                            }
+                        }
+                    }
+
+                    rslt.mxList = qdList;
+                }
+            }
+        }
+    }
+}

+ 82 - 0
JLHHJSvr/Excutor/SaveMattressInterfaceExcutor.cs

@@ -0,0 +1,82 @@
+using System;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Text;
+using DirectService.Tools;
+using JLHHJSvr.BLL;
+using JLHHJSvr.Com;
+using JLHHJSvr.Com.Model;
+using JLHHJSvr.Helper;
+using JLHHJSvr.LJException;
+using JLHHJSvr.LJFramework.Tools;
+using JLHHJSvr.Tools;
+using LJLib.DAL.SQL;
+using LJLib.Net.SPI.Server;
+
+namespace JLHHJSvr.Excutor
+{
+    internal sealed class SaveMattressInterfaceExcutor : ExcutorBase<SaveMattressInterfaceRequest, SaveMattressInterfaceResponse>
+    {
+        Dictionary<string, object> replacements = new Dictionary<string, object>();
+
+        protected override void ExcuteInternal(SaveMattressInterfaceRequest request, object state, SaveMattressInterfaceResponse rslt)
+        {
+            var tokendata = BllHelper.GetToken(request.token);
+            if (tokendata == null)
+            {
+                rslt.ErrMsg = "会话已经中断,请重新登录";
+                return;
+            }
+            if (request.mattress == null)
+            {
+                rslt.ErrMsg = "缺少主表信息";
+                return;
+            }
+            if (request.interfaceList == null || !request.interfaceList.Any())
+            {
+                rslt.ErrMsg = "缺少产品配置明细";
+                return;
+            }
+            if (request.qdList == null || !request.qdList.Any())
+            {
+                rslt.ErrMsg = "缺少产品清单明细";
+                return;
+            }
+
+            using (var con = new SqlConnection(GlobalVar.ConnectionString))
+            using (var cmd = con.CreateCommand())
+            {
+                con.Open();
+
+                // 初始化属性
+                AutoInit.AutoInitS(cmd, request.mattress);
+
+                foreach (var mx in request.interfaceList)
+                {
+                    AutoInit.AutoInitS(cmd, mx);
+                }
+
+                foreach (var mx in request.qdList)
+                {
+                    AutoInit.AutoInitS(cmd, mx);
+                }
+
+                var interfaceHelper = HelperBase.GetHelper<InterfaceHelper>(cmd, new HelperBase.Context() { tokendata = tokendata });
+                
+                using (cmd.Transaction = con.BeginTransaction())
+                {
+                    try
+                    {
+                        interfaceHelper.SaveMattressInterface(request.mattress, request.interfaceList, request.qdList);
+                    }
+                    catch (Exception e)
+                    {
+                        cmd.Transaction.Rollback();
+                        rslt.ErrMsg = e.ToString();
+                    }
+                }
+            }
+        }
+    }
+}

+ 14 - 0
JLHHJSvr/GlobalVar/GlobalVar.cs

@@ -171,6 +171,20 @@ namespace JLHHJSvr
                 excutorManager.AddMap("CopyMattressAudited", typeof(CopyMattressAuditedRequest), new CopyMattressAuditedExcutor());// 复制审核床垫报价
                 excutorManager.AddMap("ReCalculateNoAudit", typeof(ReCalculateNoAuditRequest), new ReCalculateNoAuditExcutor());// 重算床垫报价
                 excutorManager.AddMap("ReCalculateBedNetNoAudit", typeof(ReCalculateBedNetNoAuditRequest), new ReCalculateBedNetNoAuditExcutor());// 重算床网报价
+
+                excutorManager.AddMap("MattressYWAudit", typeof(MattressYWAuditRequest), new MattressYWAuditExcutor());// 床垫接口业务审核撤审
+                excutorManager.AddMap("MattressJSAudit", typeof(MattressJSAuditRequest), new MattressJSAuditExcutor());// 床垫接口产品补充审核撤审
+                excutorManager.AddMap("MattressJS2Audit", typeof(MattressJS2AuditRequest), new MattressJS2AuditExcutor());// 床垫接口清单补充审核撤审
+
+                excutorManager.AddMap("SaveMattressInterface", typeof(SaveMattressInterfaceRequest), new SaveMattressInterfaceExcutor());// 床垫接口清单补充审核撤审
+                excutorManager.AddMap("RefreshMattressInterface", typeof(RefreshMattressInterfaceRequest), new RefreshMattressInterfaceExcutor());// 刷新床垫配置清单
+                excutorManager.AddMap("RefreshMattressInterfaceQd", typeof(RefreshMattressInterfaceQdRequest), new RefreshMattressInterfaceQdExcutor());// 刷新床垫清单
+
+                excutorManager.AddMap("GetERPMtrldefList", typeof(GetERPMtrldefListRequest), new GetERPMtrldefListExcutor());// 获取ERP物料资料
+                excutorManager.AddMap("GetERPConfigureList", typeof(GetERPConfigureListRequest), new GetERPConfigureListExcutor());// 获取ERP配置资料
+                excutorManager.AddMap("GetERPWrkGrpList", typeof(GetERPWrkGrpListRequest), new GetERPWrkGrpListExcutor());// 获取ERP配置资料
+                excutorManager.AddMap("GetMattressInterfaceList", typeof(GetMattressInterfaceListRequest), new GetMattressInterfaceListExcutor());// 获取ERP配置资料
+
             }
             catch (Exception ex)
             {

+ 22 - 20
JLHHJSvr/Helper/BedNetHelper.cs

@@ -1945,7 +1945,7 @@ namespace JLHHJSvr.Helper
                 throw new LJCommonException("获取床网清单,bednettypeid错误");
             }
 
-            if (bednet.pricelistid == null || bednet.pricelistid.Value <= 0)
+            if (dept.pricelistid <= 0)
             {
                 throw new LJCommonException("获取床网清单,pricelistid错误");
             }
@@ -1977,7 +1977,7 @@ namespace JLHHJSvr.Helper
                 amt = 0,
                 useqty = 0
             });
-            specifications = $"{bednet.mattress_width - 2}*{bednet.mattress_length}*{bednet.mattress_height - 2}";
+            specifications = $"{bednet.mattress_width - 2}*{bednet.mattress_length}";
             qdList.Add(new u_bednet_qingdan()
             {
                 pzname = "排列",
@@ -1989,11 +1989,11 @@ namespace JLHHJSvr.Helper
             qdList.Add(new u_bednet_qingdan()
             {
                 pzname = "床网高度",
-                pznamemx = $"{mx.bednet_height}高",
+                pznamemx = $"{mx.bednet_height.Value.ToString("#,##0.##")}高",
                 amt = 0,
                 useqty = 0
             });
-            bednetHeight = $"{mx.bednet_height}高";
+            bednetHeight = $"{mx.bednet_height.Value.ToString("#,##0.##")}高";
             qdList.Add(new u_bednet_qingdan()
             {
                 pzname = "弹簧线径/高度/口径/中心直径/圈数",
@@ -2045,11 +2045,10 @@ namespace JLHHJSvr.Helper
 
             for (int i = 1;i <= 5;i++)
             {
-                if (i > springList.Count) break;
                 qdList.Add(new u_bednet_qingdan()
                 {
                     pzname = $"多区弹簧{i}/高度/口径/中心直径/圈数",
-                    pznamemx = springList.Count >= 1 ? GetSpringName(springList[i].springid.Value) : string.Empty,
+                    pznamemx = springList.Count >= 1 && i <= springList.Count ? GetSpringName(springList[i - 1].springid.Value) : string.Empty,
                     amt = 0,
                     useqty = 0
                 });
@@ -2057,11 +2056,11 @@ namespace JLHHJSvr.Helper
             qdList.Add(new u_bednet_qingdan()
             {
                 pzname = "边铁条数",
-                pznamemx = mx.side_iron_qty > 0 ? $"{mx.side_iron_qty}条" : string.Empty,
+                pznamemx = mx.side_iron_qty > 0 ? $"{mx.side_iron_qty.Value.ToString("#,##0.##")}条" : string.Empty,
                 amt = 0,
                 useqty = 0
             });
-            edgeIron = mx.side_iron_qty > 0 ? $"{mx.side_iron_qty}条边铁" : "无边铁";
+            edgeIron = mx.side_iron_qty > 0 ? $"{mx.side_iron_qty.Value.ToString("#,##0.##")}条边铁" : "无边铁";
             var mtrldef1 = new u_mtrl_price();
             DbSqlHelper.SelectOne(cmd, "u_mtrl_price", "mtrltype = 2 AND mtrlid = @mtrlid", new Dictionary<string, object>() { { "mtrlid", mx.fabrics2_mtrlid } },mtrldef1, "name");
             qdList.Add(new u_bednet_qingdan()
@@ -2105,11 +2104,11 @@ namespace JLHHJSvr.Helper
             qdList.Add(new u_bednet_qingdan()
             {
                 pzname = "四周加硬排数",
-                pznamemx = mx.hard_around_row > 0 ? $"{mx.hard_around_row}排{GetSpringName(mx.hard_around_springid.Value)}" : string.Empty,
+                pznamemx = mx.hard_around_row > 0 ? $"{mx.hard_around_row.Value.ToString("#,##0.##")}排{GetSpringName(mx.hard_around_springid.Value)}" : string.Empty,
                 amt = 0,
                 useqty = 0
             });
-            surroundingReinforcementRows = mx.hard_around_row > 0 ? $"四周加硬{mx.hard_around_row}排{GetSpringName(mx.hard_around_springid.Value)}" : string.Empty;
+            surroundingReinforcementRows = mx.hard_around_row > 0 ? $"四周加硬{mx.hard_around_row.Value.ToString("#,##0.##")}排{GetSpringName(mx.hard_around_springid.Value)}" : string.Empty;
             qdList.Add(new u_bednet_qingdan()
             {
                 pzname = "四周加硬弹簧线径/高度/口径/中心直径/圈数",
@@ -2126,7 +2125,7 @@ namespace JLHHJSvr.Helper
                 amt = 0,
                 useqty = 0
             });
-            foamBorderMaterial = !string.IsNullOrEmpty(mtrldef5.name) ? $"{bednet.sponge_thickness}分{bednet.sponge_height}高{mtrldef5.name}" : string.Empty;
+            foamBorderMaterial = !string.IsNullOrEmpty(mtrldef5.name) ? $"{bednet.sponge_thickness.Value.ToString("#,##0.##")}分{bednet.sponge_height.Value.ToString("#,##0.##")}高{mtrldef5.name}" : string.Empty;
             var mtrldef6 = new u_mtrl_price();
             DbSqlHelper.SelectOne(cmd, "u_mtrl_price", "mtrlid = @mtrlid", new Dictionary<string, object>() { { "mtrlid", bednet.sponge_tc_mtrlid } }, mtrldef6, "name");
             qdList.Add(new u_bednet_qingdan()
@@ -2136,11 +2135,11 @@ namespace JLHHJSvr.Helper
                 amt = 0,
                 useqty = 0
             });
-            fillingFoamMaterial = !string.IsNullOrEmpty(mtrldef6.name) ? $"{bednet.sponge_tc_thickness}分{bednet.sponge_tc_height}高{mtrldef6.name}" : string.Empty;
+            fillingFoamMaterial = !string.IsNullOrEmpty(mtrldef6.name) ? $"{bednet.sponge_tc_thickness.Value.ToString("#,##0.##")}分{bednet.sponge_tc_height.Value.ToString("#,##0.##")}高{mtrldef6.name}" : string.Empty;
             qdList.Add(new u_bednet_qingdan()
             {
                 pzname = "填充包边物料厚度",
-                pznamemx = bednet.sponge_tc_thickness > 0 ? $"{bednet.sponge_tc_thickness}分厚,{bednet.sponge_tc_height}分高,{mtrldef6.name}" : string.Empty,
+                pznamemx = bednet.sponge_tc_thickness > 0 ? $"{bednet.sponge_tc_thickness.Value.ToString("#,##0.##")}分厚,{bednet.sponge_tc_height.Value.ToString("#,##0.##")}分高,{mtrldef6.name}" : string.Empty,
                 amt = 0,
                 useqty = 0
             });
@@ -2158,7 +2157,7 @@ namespace JLHHJSvr.Helper
             qdList.Add(new u_bednet_qingdan()
             {
                 pzname = "封边高度",
-                pznamemx = bednet.edge_height > 0 ? $"{bednet.edge_height}高" : string.Empty,
+                pznamemx = bednet.edge_height > 0 ? $"{bednet.edge_height.Value.ToString("#,##0.##")}高" : string.Empty,
                 amt = 0,
                 useqty = 0
             });
@@ -2180,11 +2179,11 @@ namespace JLHHJSvr.Helper
             qdList.Add(new u_bednet_qingdan()
             {
                 pzname = "弹叉数量",
-                pznamemx = bednet.fork_qty > 0 ? $"{bednet.fork_qty}只弹叉" : string.Empty,
+                pznamemx = bednet.fork_qty > 0 ? $"{bednet.fork_qty.Value.ToString("#,##0.##")}只弹叉" : string.Empty,
                 amt = 0,
                 useqty = 0
             });
-            springPins = bednet.fork_qty > 0 ? $"{bednet.fork_qty}只弹叉" : string.Empty;
+            springPins = bednet.fork_qty > 0 ? $"{bednet.fork_qty.Value.ToString("#,##0.##")}只弹叉" : string.Empty;
             qdList.Add(new u_bednet_qingdan()
             {
                 pzname = "15分布条",
@@ -2202,7 +2201,7 @@ namespace JLHHJSvr.Helper
             qdList.Add(new u_bednet_qingdan()
             {
                 pzname = "四周口袋弹簧排数",
-                pznamemx = mx.pocket_around_row > 0 ? $"{mx.pocket_around_row}排" : string.Empty,
+                pznamemx = mx.pocket_around_row > 0 ? $"{mx.pocket_around_row.Value.ToString("#,##0.##")}排" : string.Empty,
                 amt = 0,
                 useqty = 0
             });
@@ -2226,12 +2225,14 @@ namespace JLHHJSvr.Helper
 
             if (!string.IsNullOrEmpty(bednet.duo_qv_str))
             {
+                areaType = $"{bednet.duo_qv_str}区";
                 ls_temp_name.Append("丨")
                             .Append(bednet.duo_qv_str)
                             .Append("区");
             }
             else
             {
+                areaType = string.IsNullOrEmpty(qdList[5].pznamemx) ? "多区" : "单区";
                 ls_temp_name.Append("丨")
                             .Append(string.IsNullOrEmpty(qdList[5].pznamemx) ? "多区" : "单区");
             }
@@ -2256,10 +2257,11 @@ namespace JLHHJSvr.Helper
 
             rollPackage = bednet.if_jb == 0 ? string.Empty : "卷包";
 
-            // Final concatenation with custom name
             if (ls_temp_name.ToString().Contains("袋装"))
             {
-                ls_temp_name.Append("丨")
+                ls_temp_name.Clear();
+                ls_temp_name.Append(bednetName)
+                            .Append("丨")
                             .Append(areaType)
                             .Append("丨")
                             .Append(rollPackage)
@@ -2364,7 +2366,7 @@ namespace JLHHJSvr.Helper
         public string GetSpringName(int springid)
         {
             var spring = new u_spring() { springid = springid };
-            DbSqlHelper.SelectOne(cmd, spring, "line_diameter,gram_weight,height,center_diameter,cyclenum");
+            DbSqlHelper.SelectOne(cmd, spring, "line_diameter,gram_weight,height,center_diameter,cyclenum,caliber");
 
             return spring.name;
         }

+ 232 - 252
JLHHJSvr/Helper/InterfaceHelper.cs

@@ -36,8 +36,6 @@ namespace JLHHJSvr.Helper
 
             AutoSetMtrlName(mattress, mxlist);
 
-            AutoInit.AutoInitS(cmd, mattress);
-
             if (string.IsNullOrEmpty(mattress.erp_mtrlcode))
             {
                 throw new LJCommonException("请输入物料名称!");
@@ -131,18 +129,9 @@ namespace JLHHJSvr.Helper
             }
         }
 
-        #region 导入配置方法
-        /// <summary>
-        /// 刷新带出配置
-        /// </summary>
-        /// <param name="mattressid"></param>
-        /// <returns></returns>
-        public List<u_mattress_interface> RefreshMattressInterface(int mattressid)
+        public List<u_mattress_interface> GetMattressInterfaceList(int mattressid)
         {
             var interfaceList = new List<u_mattress_interface>();
-
-            var copy_list = new List<u_mattress_interface>();
-
             var selectStr = @"SELECT mattressid
 	                            ,printid
 	                            ,itemname
@@ -156,43 +145,67 @@ namespace JLHHJSvr.Helper
 	                            ,ls_rate
 	                            ,bj_inputtype
                             FROM u_mattress_interface";
-            DbSqlHelper.SelectJoin(cmd, selectStr, "mattressid = @mattressid", new Dictionary<string, object>() { { "@mattressid", mattressid } }, "printid", "mattressid,printid,itemname,bj_pzname,bj_namemx,actual_size,sb_craft,actual_size_sb,erp_pzid,ss_rate,ls_rate,bj_inputtype", 0, 0, copy_list);
+            DbSqlHelper.SelectJoin(cmd, selectStr, "mattressid = @mattressid", new Dictionary<string, object>() { { "@mattressid", mattressid } }, "printid", "mattressid,printid,itemname,bj_pzname,bj_namemx,actual_size,sb_craft,actual_size_sb,erp_pzid,ss_rate,ls_rate,bj_inputtype", 0, 0, interfaceList);
 
-            // 导入配置
-            ImportMattressInterfaceList(mattressid, interfaceList);
+            if(interfaceList.Count <= 0)
+            {
+                interfaceList = RefreshMattressInterfaceList(mattressid);
+            }
+
+            MattressInterfaceFindERPPz(mattressid, interfaceList);
 
-            var copyDict = copy_list.Where(mx2 => mx2.erp_pzid > 0)
-                                    .ToDictionary(mx2 => mx2.erp_pzid, mx2 => mx2);
+            return interfaceList;
+        }
 
-            foreach (var mx in interfaceList)
+        public List<u_mattress_interface_qd> GetMattressInterfaceQdList(int mattressid)
+        {
+            var qdList = new List<u_mattress_interface_qd>();
+            var selectStr = @"SELECT u_mattress_interface_qd.mattressid 
+	                            ,u_mattress_interface_qd.printid 
+	                            ,u_mattress_interface_qd.itemname 
+	                            ,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.mtrlid 
+	                            ,u_mattress_interface_qd.erp_mtrlid 
+	                            ,u_mattress_interface_qd.useqty 
+	                            ,u_mattress_interface_qd.dscrp 
+	                            ,u_mtrl_price.name AS mtrlname
+	                            ,u_mattress_interface_qd.actual_useqty 
+	                            ,u_mattress_interface_qd.qd_actual_size 
+	                            ,u_mattress_interface_qd.qd_pfgroupqty 
+	                            ,u_mattress_interface_qd.wrkgrpid 
+	                            ,u_mattress_interface_qd.ss_rate 
+	                            ,u_mattress_interface_qd.ls_rate 
+	                            ,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,ss_rate,ls_rate,sh_rate";
+            DbSqlHelper.SelectJoin(cmd, selectStr, "mattressid = @mattressid", new Dictionary<string, object>() { { "@mattressid", mattressid } }, "printid", outputFields, 0, 0, qdList);
+
+            if (qdList.Count <= 0)
             {
-                if (mx.erp_pzid > 0 && copyDict.TryGetValue(mx.erp_pzid, out var mx2))
-                {
-                    if (mx.bj_inputtype != 2 || (mx.bj_inputtype == 2 && mx2.bj_inputtype == 1))
-                    {
-                        mx.bj_pzname = mx2.bj_pzname;
-                        mx.actual_size = mx2.actual_size;
-                        mx.sb_craft = mx2.sb_craft;
-                        mx.actual_size_sb = mx2.actual_size_sb;
-                        mx.ss_rate = mx2.ss_rate;
-                        mx.ls_rate = mx2.ls_rate;
-
-                        if (mx.bj_inputtype == 2 && mx2.bj_inputtype == 1)
-                        {
-                            mx.bj_inputtype = 1;
-                        }
-                    }
-                    else
-                    {
-                        mx.actual_size = mx2.actual_size;
-                        mx.sb_craft = mx2.sb_craft;
-                        mx.actual_size_sb = mx2.actual_size_sb;
-                        mx.ss_rate = mx2.ss_rate;
-                        mx.ls_rate = mx2.ls_rate;
-                    }
-                }
+                qdList = RefreshMattressInterfaceQdList(mattressid);
             }
 
+            return qdList;
+        }
+
+        #region 导入配置方法
+        /// <summary>
+        /// 刷新带出配置
+        /// </summary>
+        /// <param name="mattressid"></param>
+        /// <returns></returns>
+        public List<u_mattress_interface> RefreshMattressInterfaceList(int mattressid)
+        {
+            var interfaceList = new List<u_mattress_interface>();
+
+            // 导入配置
+            ImportMattressInterfaceList(mattressid, interfaceList);
+
+            MattressInterfaceFindERPPz(mattressid, interfaceList);
+
             return interfaceList;
         }
         /// <summary>
@@ -200,7 +213,7 @@ namespace JLHHJSvr.Helper
         /// </summary>
         /// <param name="mattressid"></param>
         /// <exception cref="LJCommonException"></exception>
-        public void ImportMattressInterfaceList(int mattressid, List<u_mattress_interface> intefaceList)
+        public void ImportMattressInterfaceList(int mattressid, List<u_mattress_interface> interfaceList)
         {
             if (mattressid <= 0)
             {
@@ -220,17 +233,17 @@ namespace JLHHJSvr.Helper
             var mxlist_101 = mattressHelper.GetMattressMxMtrl(mattressid, new List<string>() { "u_mattress_formula.formulatype = 101" });
 
             // 高度
-            intefaceList.Add(InserMattressInterfacePz("床垫", "高度", 2, new string[] { $"{mattress.mattress_height}" }));
+            interfaceList.Add(InserMattressInterfacePz("床垫", "高度", 2, new string[] { $"{mattress.mattress_height}" }));
 
             // 参考外观
-            intefaceList.Add(InserMattressInterfacePz("床垫", "参考外观", 1, new string[] { "" }));
+            interfaceList.Add(InserMattressInterfacePz("床垫", "参考外观", 1, new string[] { "" }));
 
             // 尺寸
             mattress.erp_mtrlcode = $"{mattress.mattress_width}*{mattress.mattress_length}*{mattress.mattress_height}";
-            intefaceList.Add(InserMattressInterfacePz("床垫", "尺寸", 2, new string[] { mattress.erp_mtrlcode }));
+            interfaceList.Add(InserMattressInterfacePz("床垫", "尺寸", 2, new string[] { mattress.erp_mtrlcode }));
 
             // 床垫类别
-            intefaceList.Add(InserMattressInterfacePz("床垫", "床垫类别", 2, new string[] { mattress_type.typename }));
+            interfaceList.Add(InserMattressInterfacePz("床垫", "床垫类别", 2, new string[] { mattress_type.typename }));
 
             // 拆装类型
             var name_arr = new string[1];
@@ -238,69 +251,80 @@ namespace JLHHJSvr.Helper
             if (mattress.if_m_chai == 1) name_arr[0] = AppendToString(name_arr[0], "面拆");
             if (mattress.if_z_chai == 1) name_arr[0] = AppendToString(name_arr[0], "中拆");
             if (mattress.if_d_chai == 1) name_arr[0] = AppendToString(name_arr[0], "底拆");
-            intefaceList.Add(InserMattressInterfacePz("床垫", "拆装类型", 1, name_arr));
+            interfaceList.Add(InserMattressInterfacePz("床垫", "拆装类型", 1, name_arr));
 
             // 床垫分类
             name_arr[0] = string.Empty;
             if (mattress.if_haimian_type == 1) name_arr[0] = AppendToString(name_arr[0], "海绵床垫");
             else name_arr[0] = AppendToString(name_arr[0], "弹簧床垫");
             if (mattress.if_zhedie_type == 1) name_arr[0] = AppendToString(name_arr[0], "折叠床垫");
-            intefaceList.Add(InserMattressInterfacePz("床垫", "拆装类型", 1, name_arr));
+            interfaceList.Add(InserMattressInterfacePz("床垫", "床垫分类", 1, name_arr));
 
             // 外观布套做法
             name_arr[0] = string.Empty;
             if (mattress.if_m_wbutao_way == 1) name_arr[0] = AppendToString(name_arr[0], $"面层向大侧覆盖{mattress.s_m_cover_qty}CM、大侧向底层覆盖{mattress.z_m_cover_qty}CM、底层向大侧覆盖{mattress.x_m_cover_qty}CM");
-            intefaceList.Add(InserMattressInterfacePz("床垫", "外观布套做法", 1, name_arr));
+            interfaceList.Add(InserMattressInterfacePz("床垫", "外观布套做法", 1, name_arr));
 
             // 边带
             name_arr[0] = string.Empty;
-            intefaceList.Add(InserMattressInterfacePz("床垫", "边带", 2, name_arr));
+            interfaceList.Add(InserMattressInterfacePz("床垫", "边带", 0, name_arr));
 
             #region 面料类清单导入 AutoSetFormulaTypeZeroPz()需要优化
-            AutoSetFormulaTypeZeroPz(mxlist, intefaceList);
-            intefaceList.Add(InserMattressInterfacePz("车位说明", "车位说明", 1, name_arr));
+            AutoSetFormulaTypeZeroPz(mxlist, interfaceList);
+            interfaceList.Add(InserMattressInterfacePz("车位说明", "车位说明", 1, name_arr));
             #endregion
 
             #region 垫层类清单导入
-            AutoSetFormulaTypeOnePz(mxlist, intefaceList);
+            AutoSetFormulaTypeOnePz(mxlist, interfaceList);
             #endregion
 
             #region 辅料类清单导入
-            AutoSetFormulaTypeTwoPz(mxlist, intefaceList);
+            AutoSetFormulaTypeTwoPz(mxlist, interfaceList);
             #endregion
 
             #region 包装类清单导入
-            AutoSetFormulaTypeThreePz(mattress, mxlist, intefaceList);
+            AutoSetFormulaTypeThreePz(mattress, mxlist, interfaceList);
             #endregion
 
             #region 内布套类清单导入
-            AutoSetFormulaType101Pz(mattress, mxlist_103, intefaceList);
+            AutoSetFormulaType101Pz(mattress, mxlist_103, interfaceList);
             #endregion
 
             #region 自定义配置导入
-            erp_cmd.CommandText = @"SELECT u_configure_code.pzid
+            if(mattress.erp_configcodetype != null && mattress.erp_configcodetype > 0)
+            {
+                erp_cmd.CommandText = @"SELECT u_configure_code.pzid
 	                                    ,u_configure_code.pzcode
 	                                    ,u_configure_code.name
 	                                    ,u_configure_code.inputtype
                                     FROM u_configure_code
                                     WHERE u_configure_code.typeid = @configcodetype
 	                                    AND u_configure_code.ifpack = 1";
-            erp_cmd.Parameters.Clear();
-            erp_cmd.Parameters.AddWithValue("@configcodetype", mattress.erp_configcodetype);
-            using (var reader = erp_cmd.ExecuteReader())
-            {
-                while (reader.Read())
+                erp_cmd.Parameters.Clear();
+                erp_cmd.Parameters.AddWithValue("@configcodetype", mattress.erp_configcodetype);
+                using (var reader = erp_cmd.ExecuteReader())
                 {
-                    var pzname = Convert.ToString(reader["name"]);
-                    intefaceList.Add(InserMattressInterfacePz("自定义", pzname, 1, new string[] { "" }));
+                    while (reader.Read())
+                    {
+                        var pzname = Convert.ToString(reader["name"]);
+                        interfaceList.Add(InserMattressInterfacePz("自定义", pzname, 1, new string[] { "" }));
+                    }
                 }
             }
             #endregion
+        }
+        public void MattressInterfaceFindERPPz(int mattressid, List<u_mattress_interface> interfaceList)
+        {
+            var mattress = new u_mattress() { mattressid = mattressid };
+            DbSqlHelper.SelectOne(cmd, mattress, "erp_configcodetype");
 
-            #region 匹配ERP配置 + 初始化printid PB代码参考:wf_fine_erp_pz
-            for (var i = 0; i < intefaceList.Count; i++)
+            MattressInterfaceFindERPPz(mattress, interfaceList);
+        }
+        public void MattressInterfaceFindERPPz(u_mattress mattress,List<u_mattress_interface> interfaceList)
+        {
+            for (var i = 0; i < interfaceList.Count; i++)
             {
-                intefaceList[i].printid = i + 1;
+                interfaceList[i].printid = i + 1;
 
                 erp_cmd.CommandText = @"SELECT u_configure_code.pzid
 	                                    ,u_configure_code.pzcode
@@ -311,7 +335,7 @@ namespace JLHHJSvr.Helper
 	                                    AND u_configure_code.name = @pzname";
                 erp_cmd.Parameters.Clear();
                 erp_cmd.Parameters.AddWithValue("@configcodetype", mattress.erp_configcodetype);
-                erp_cmd.Parameters.AddWithValue("@pzname", intefaceList[i].bj_pzname);
+                erp_cmd.Parameters.AddWithValue("@pzname", interfaceList[i].bj_pzname);
                 using (var reader = erp_cmd.ExecuteReader())
                 {
                     if (reader.Read())
@@ -322,16 +346,15 @@ namespace JLHHJSvr.Helper
                         var inputtype = Convert.ToByte(reader["inputtype"]);
                         if (pzid > 0)
                         {
-                            intefaceList[i].erp_pzid = pzid;
-                            intefaceList[i].erp_pzcode = pzcode;
-                            intefaceList[i].erp_pzname = pzname;
+                            interfaceList[i].erp_pzid = pzid;
+                            interfaceList[i].erp_pzcode = pzcode;
+                            interfaceList[i].erp_pzname = pzname;
                         }
 
-                        if (inputtype != 2) intefaceList[i].bj_inputtype = inputtype;
+                        if (interfaceList[i].bj_inputtype != 2) interfaceList[i].bj_inputtype = inputtype;
                     }
                 }
             }
-            #endregion
         }
         /// <summary>
         /// 初始化配置信息
@@ -365,7 +388,7 @@ namespace JLHHJSvr.Helper
 
             return result;
         }
-        private void AutoSetFormulaTypeZeroPz(List<u_mattress_mx_mtrl> mxlist, List<u_mattress_interface> intefaceList)
+        private void AutoSetFormulaTypeZeroPz(List<u_mattress_mx_mtrl> mxlist, List<u_mattress_interface> interfaceList)
         {
             var powerDict = new Dictionary<string, int[]>()
             {
@@ -411,7 +434,7 @@ namespace JLHHJSvr.Helper
                 {"小侧1",new string[] { "小侧", "小侧1裥棉", "小侧1裥棉图案" } },
                 {"小侧1-上下拼侧1",new string[] { "小侧", "小侧1-上下拼侧1裥棉", "小侧1-上下拼侧1裥棉图案" } },
                 {"小侧1-上下拼侧2",new string[] { "小侧", "小侧1-上下拼侧2裥棉", "小侧1-上下拼侧2裥棉图案" } },
-                {"小侧1-上下拼侧2",new string[] { "小侧", "小侧1-上下拼侧3裥棉", "小侧1-上下拼侧3裥棉图案" } },
+                {"小侧1-上下拼侧3",new string[] { "小侧", "小侧1-上下拼侧3裥棉", "小侧1-上下拼侧3裥棉图案" } },
                 {"小侧2",new string[] { "小侧", "小侧2裥棉", "小侧2裥棉图案" } },
                 {"小侧3",new string[] { "小侧", "小侧3裥棉", "小侧3裥棉图案", "小侧说明" } },
                 {"V侧1_EMPTY",new string[] { "V侧", "V侧1裥棉", "V侧1裥棉图案" } },
@@ -424,7 +447,7 @@ namespace JLHHJSvr.Helper
             #region wf_import_qingdan + wf_import_qingdan_1 面料部分
             foreach (var item in powerDict)
             {
-                SetFormulaTypeZeroPz(jianmianList, intefaceList, item.Value, item.Key, chastrArrDict[item.Key]);
+                SetFormulaTypeZeroPz(jianmianList, interfaceList, item.Value, item.Key, chastrArrDict[item.Key]);
             }
             #endregion
 
@@ -436,8 +459,8 @@ namespace JLHHJSvr.Helper
                 var mx = lashouList[i];
                 if (string.IsNullOrEmpty(mx.chastr) && mx.mtrlid > 0)
                 {
-                    intefaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", $"拉手{i + 1}做法", 1, new string[] { $"{mx.qty.Value}只{mx.mtrlname}" }));
-                    intefaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", $"拉手{i + 1}刺绣", 0, new string[] { "" }));
+                    interfaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", $"拉手{i + 1}做法", 1, new string[] { $"{mx.qty.Value.ToString("#,##0.0#")}只{mx.mtrlname}" }));
+                    interfaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", $"拉手{i + 1}刺绣", 0, new string[] { "" }));
                 }
             }
             // 刺绣
@@ -447,8 +470,8 @@ namespace JLHHJSvr.Helper
                 var mx = cixiuList[i];
                 if (string.IsNullOrEmpty(mx.chastr) && mx.mtrlid > 0)
                 {
-                    intefaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", $"侧刺绣{i + 1}做法", 1, new string[] { "" }));
-                    intefaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", $"侧刺绣{i + 1}位置", 0, new string[] { "" }));
+                    interfaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", $"侧刺绣{i + 1}做法", 1, new string[] { "" }));
+                    interfaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", $"侧刺绣{i + 1}位置", 0, new string[] { "" }));
                 }
             }
             // 大侧压压布
@@ -458,7 +481,7 @@ namespace JLHHJSvr.Helper
                 var mx = dcyybList[i];
                 if (string.IsNullOrEmpty(mx.chastr) && mx.mtrlid > 0)
                 {
-                    intefaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", $"大侧压压布{i + 1}", 1, new string[] { $"{mx.qty.Value}米{mx.mtrlname}" }));
+                    interfaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", $"大侧压压布{i + 1}", 1, new string[] { $"{mx.qty.Value.ToString("#,##0.0#")}米{mx.mtrlname}" }));
                 }
             }
             // 大侧压边带
@@ -468,7 +491,7 @@ namespace JLHHJSvr.Helper
                 var mx = dcybdList[i];
                 if (string.IsNullOrEmpty(mx.chastr) && mx.mtrlid > 0)
                 {
-                    intefaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", $"大侧压边带{i + 1}", 1, new string[] { $"{mx.qty.Value}米{mx.mtrlname}" }));
+                    interfaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", $"大侧压边带{i + 1}", 1, new string[] { $"{mx.qty.Value.ToString("#,##0.0#")}米{mx.mtrlname}" }));
                 }
             }
             // 大侧压织带
@@ -478,7 +501,7 @@ namespace JLHHJSvr.Helper
                 var mx = dcyzdList[i];
                 if (string.IsNullOrEmpty(mx.chastr) && mx.mtrlid > 0)
                 {
-                    intefaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", $"大侧压织带{i + 1}", 1, new string[] { $"{mx.qty.Value}米{mx.mtrlname}" }));
+                    interfaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", $"大侧压织带{i + 1}", 1, new string[] { $"{mx.qty.Value.ToString("#,##0.0#")}米{mx.mtrlname}" }));
                 }
             }
             // 大侧压上下压线
@@ -488,7 +511,7 @@ namespace JLHHJSvr.Helper
                 var mx = dcysxyxList[i];
                 if (string.IsNullOrEmpty(mx.chastr) && mx.mtrlid > 0)
                 {
-                    intefaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", $"大侧压上下压线{i + 1}", 1, new string[] { $"{mx.qty.Value}米{mx.mtrlname}" }));
+                    interfaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", $"大侧压上下压线{i + 1}", 1, new string[] { $"{mx.qty.Value.ToString("#,##0.0#")}米{mx.mtrlname}" }));
                 }
             }
             // 车花边
@@ -498,7 +521,7 @@ namespace JLHHJSvr.Helper
                 var mx = chbList[i];
                 if (string.IsNullOrEmpty(mx.chastr) && mx.mtrlid > 0)
                 {
-                    intefaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", "车花边", 1, new string[] { $"{mx.qty.Value}米{mx.mtrlname}" }));
+                    interfaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", "车花边", 1, new string[] { $"{mx.qty.Value.ToString("#,##0.0#")}米{mx.mtrlname}" }));
                 }
             }
             // 防火线
@@ -508,7 +531,7 @@ namespace JLHHJSvr.Helper
                 var mx = fhxList[i];
                 if (string.IsNullOrEmpty(mx.chastr) && mx.mtrlid > 0)
                 {
-                    intefaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", "防火线", 1, new string[] { mx.mtrlname }));
+                    interfaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", "防火线", 1, new string[] { mx.mtrlname }));
                 }
             }
             // 拉链
@@ -518,12 +541,12 @@ namespace JLHHJSvr.Helper
                 var mx = llList[i];
                 if (string.IsNullOrEmpty(mx.chastr) && mx.mtrlid > 0)
                 {
-                    intefaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", "拉链", 1, new string[] { $"{mx.qty.Value}米{mx.mtrlname}" }));
+                    interfaceList.Add(InserMattressInterfacePz("拉手刺绣及其他工艺", "拉链", 1, new string[] { $"{mx.qty.Value.ToString("#,##0.0#")}米{mx.mtrlname}" }));
                 }
             }
             #endregion
         }
-        private void SetFormulaTypeZeroPz(List<u_mattress_mx_mtrl> mxlist, List<u_mattress_interface> intefaceList, int[] powerArr, string key, string[] chastrArr)
+        private void SetFormulaTypeZeroPz(List<u_mattress_mx_mtrl> mxlist, List<u_mattress_interface> interfaceList, int[] powerArr, string key, string[] chastrArr)
         {
             var mianList1 = new HashSet<string> { "面裥绵", "底裥绵" };
             var mianList2 = new string[4] { "顶布裥棉1", "顶布裥棉2", "顶布裥棉3", "顶布裥棉4" };
@@ -539,53 +562,32 @@ namespace JLHHJSvr.Helper
             {
                 for (int i = 0; i < mianList2.Length; i++)
                 {
-                    DingBuLianMian.SetValue(name_arr, i);
+                    DingBuLianMian.SetValue(name_arr[i], i, 0);
                 }
             }
 
-            foreach (var name in chastrArr)
+            var sb = new StringBuilder();
+            foreach (var name2 in name_arr)
             {
-                if (string.IsNullOrEmpty(name)) continue;
-
-                //if (mianList3.Contains(key))
-                //{
-                //    var sb = new StringBuilder();
-                //    foreach (var name2 in name_arr)
-                //    {
-                //        sb.Append(name2);
-                //    }
-
-                //    if (sb.Length > 0)
-                //    {
-                //        intefaceList.Add(InserMattressInterfacePz(chastrArr[0], chastrArr[1], 2, name_arr));
-                //        intefaceList.Add(InserMattressInterfacePz(chastrArr[0], chastrArr[2], 1, new string[] { "" }));
-                //        if (chastrArr.Length > 3) intefaceList.Add(InserMattressInterfacePz(chastrArr[0], chastrArr[3], 1, new string[] { "" }));
-                //    }
-                //} else
-                //{
-                //    intefaceList.Add(InserMattressInterfacePz(chastrArr[0], chastrArr[1], 2, name_arr));
-                //    // 图案
-                //    intefaceList.Add(InserMattressInterfacePz(chastrArr[0], chastrArr[2], 1, new string[] { "" }));
-                //}
-
-                var sb = new StringBuilder();
-                foreach (var name2 in name_arr)
-                {
-                    sb.Append(name2);
-                }
+                sb.Append(name2);
+            }
 
-                if (sb.Length > 0)
-                {
-                    intefaceList.Add(InserMattressInterfacePz(chastrArr[0], chastrArr[1], 2, name_arr));
-                    intefaceList.Add(InserMattressInterfacePz(chastrArr[0], chastrArr[2], 1, new string[] { "" }));
-                    if (chastrArr.Length > 3) intefaceList.Add(InserMattressInterfacePz(chastrArr[0], chastrArr[3], 1, new string[] { "" }));
-                }
+            if (sb.Length > 0)
+            {
+                if (!string.IsNullOrEmpty(chastrArr[1])) interfaceList.Add(InserMattressInterfacePz(chastrArr[0], chastrArr[1], 2, name_arr));
+                interfaceList.Add(InserMattressInterfacePz(chastrArr[0], chastrArr[2], 1, new string[] { "" }));
+                if (chastrArr.Length > 3) interfaceList.Add(InserMattressInterfacePz(chastrArr[0], chastrArr[3], 1, new string[] { "" }));
+            }
 
+            foreach (var name in chastrArr)
+            {
+                if (string.IsNullOrEmpty(name)) continue;
                 if (name.Contains("说明"))
                 {
-                    intefaceList.Add(InserMattressInterfacePz(chastrArr[0], name, 1, new string[] { "" }));
+                    interfaceList.Add(InserMattressInterfacePz(chastrArr[0], name, 1, new string[] { "" }));
                 }
             }
+            
         }
 
         private void SetFormulaTypeZeroPzName(u_mattress_mx_mtrl mx, string key, int[] powerArr, string[] name_arr)
@@ -606,7 +608,7 @@ namespace JLHHJSvr.Helper
                     var mtrlname_temp = mx.mtrlname;
                     if (!(mx.mtrlname.IndexOf("分") > -1 && mx.thickness == 0 || mx.if_inputqty == 1))
                     {
-                        mtrlname_temp = $"{mx.thickness}分{mx.mtrlname}";
+                        mtrlname_temp = $"{mx.thickness.Value.ToString("#,##0.0#")}分{mx.mtrlname}";
                     }
                     name_arr[2] = SplitNameCount(mtrlname_temp, Convert.ToInt32(mx.qty.Value));
                 }
@@ -621,7 +623,7 @@ namespace JLHHJSvr.Helper
                 }
             }
         }
-        private void AutoSetFormulaTypeOnePz(List<u_mattress_mx_mtrl> mxlist, List<u_mattress_interface> intefaceList)
+        private void AutoSetFormulaTypeOnePz(List<u_mattress_mx_mtrl> mxlist, List<u_mattress_interface> interfaceList)
         {
             var diancengList = mxlist.Where(t => t.formulatype == 1).ToList();
 
@@ -648,51 +650,49 @@ namespace JLHHJSvr.Helper
 
             foreach (var mx in diancengList)
             {
-                if (mx.mtrlid > 0)
-                {
-                    var key = $"{mx.chastr}-{kindDict[mx.formulakind.Value]}";
+                var key = $"{mx.chastr}-{kindDict[mx.formulakind.Value]}";
 
-                    if (mx.formulakind == 999)
-                    {
-                        this.ProcessChuangWangPz(mx, intefaceList, mx.chastr, ++countDict[key]);
-                    }
-                    else if (mx.formulakind == 1201)
-                    {
-                        this.ProcessDingbuLianMianPz(mx, intefaceList, mx.chastr, ++countDict[key]);
-                    }
-                    else if (new int[] { 32, 12, 13, 14, 29 }.Contains(mx.formulakind.Value))
-                    {
-                        this.ProcessWangMianBLPz(mx, intefaceList, mx.chastr, kindDict[mx.formulakind.Value], ++countDict[key]);
-                    }
+                if (mx.formulakind == 999)
+                {
+                    this.ProcessChuangWangPz(mx, interfaceList, mx.chastr, ++countDict[key]);
+                }
+                else if (mx.mtrlid > 0 && mx.formulakind == 1201)
+                {
+                    this.ProcessDingbuLianMianPz(mx, interfaceList, mx.chastr, ++countDict[key]);
+                }
+                else if (mx.mtrlid > 0 && new int[] { 32, 12, 13, 14, 29 }.Contains(mx.formulakind.Value))
+                {
+                    this.ProcessWangMianBLPz(mx, interfaceList, mx.chastr, kindDict[mx.formulakind.Value], ++countDict[key]);
                 }
             }
 
             if (countDict["大侧-垫层"] > 0)
             {
-                intefaceList.Add(InserMattressInterfacePz("垫层", "大侧垫层生产说明", 1, new string[1]));
+                interfaceList.Add(InserMattressInterfacePz("垫层", "大侧垫层生产说明", 1, new string[1]));
             }
 
             if (countDict["小侧1-垫层"] > 0)
             {
-                intefaceList.Add(InserMattressInterfacePz("垫层", "小侧垫层生产说明", 1, new string[1]));
+                interfaceList.Add(InserMattressInterfacePz("垫层", "小侧垫层生产说明", 1, new string[1]));
             }
 
             if (countDict["V侧1-垫层"] > 0)
             {
-                intefaceList.Add(InserMattressInterfacePz("垫层", "V侧垫层生产说明", 1, new string[1]));
+                interfaceList.Add(InserMattressInterfacePz("垫层", "V侧垫层生产说明", 1, new string[1]));
             }
         }
         /// <summary>
         /// 床网
         /// </summary>
         /// <param name="mx"></param>
-        /// <param name="intefaceList"></param>
+        /// <param name="interfaceList"></param>
         /// <param name="chastr"></param>
         /// <param name="count"></param>
-        private void ProcessChuangWangPz(u_mattress_mx_mtrl mx, List<u_mattress_interface> intefaceList, string chastr, int count)
+        private void ProcessChuangWangPz(u_mattress_mx_mtrl mx, List<u_mattress_interface> interfaceList, string chastr, int count)
         {
             var name_arr = new string[5];
             int bednetid = 0;
+
             cmd.CommandText = @"SELECT u_bednetmx.bednet_height,u_bednetmx.bednetid
                                 FROM u_bednetmx
                                 INNER JOIN (
@@ -716,40 +716,52 @@ namespace JLHHJSvr.Helper
 
             if (bednetid > 0)
             {
-                // 获取床网清单
-                var bednetList = new List<u_bednetmx>();
-                if (bednetList.Any())
-                {
-                    var bednetHelper = HelperBase.GetHelper<BedNetHelper>(cmd);
-                    var bednetQdList = bednetHelper.GetBedNetQingDan(bednetid);
+                var bednetHelper = HelperBase.GetHelper<BedNetHelper>(cmd);
+                var bednetQdList = bednetHelper.GetBedNetQingDan(bednetid);
 
-                    if(bednetQdList.Any())
+                if (bednetQdList.Any())
+                {
+                    name_arr[0] = bednetQdList[0].pznamemx;
+                    name_arr[0] += "丨erp编码:";
+                    cmd.CommandText = @"SELECT u_mattress.erp_mtrlcode
+                                        FROM u_mattress_mx_mtrl
+                                        INNER JOIN u_mattress_formula ON u_mattress_formula.formulaid = u_mattress_mx_mtrl.formulaid
+                                        INNER JOIN u_mattress ON u_mattress.mattressid = u_mattress_mx_mtrl.mattressid
+                                        WHERE u_mattress_formula.formulakind = 99
+	                                        AND u_mattress.bcptypeid <> 0
+	                                        AND u_mattress_mx_mtrl.mtrlid = @bednetid";
+                    cmd.Parameters.Clear();
+                    cmd.Parameters.AddWithValue("@bednetid", bednetid);
+                    using(var reader = cmd.ExecuteReader())
                     {
-                        name_arr[0] = bednetQdList[0].pznamemx;
+                        if (reader.Read())
+                        {
+                            name_arr[0] += Convert.ToString(reader["erp_mtrlcode"]);
+                        }
                     }
                 }
             }
 
             if (FuncPowerHelper.CheckFuncPower(cmd, context.tokendata.userid, 98) && "super".Equals(context.tokendata.username.ToLower()))
             {
-                intefaceList.Add(InserMattressInterfacePz("垫层", $"{chastr}-床网{count}", 2, name_arr));
+                interfaceList.Add(InserMattressInterfacePz("垫层", $"{chastr}-床网{count}", 2, name_arr));
             }
             else
             {
-                intefaceList.Add(InserMattressInterfacePz("垫层", $"{chastr}-床网{count}", 1, name_arr));
+                interfaceList.Add(InserMattressInterfacePz("垫层", $"{chastr}-床网{count}", 1, name_arr));
             }
 
-            intefaceList.Add(InserMattressInterfacePz("垫层", $"{chastr}-床网{count}生产说明", 1, new string[] { "" }));
-            intefaceList.Add(InserMattressInterfacePz("垫层", $"{chastr}-床网{count}包边海绵条", 1, new string[] { "" }));
+            interfaceList.Add(InserMattressInterfacePz("垫层", $"{chastr}-床网{count}生产说明", 1, new string[] { "" }));
+            interfaceList.Add(InserMattressInterfacePz("垫层", $"{chastr}-床网{count}包边海绵条", 1, new string[] { "" }));
         }
         /// <summary>
         /// 网面布料 / 打底无纺布 / 毡类 / 顶布 / 垫层
         /// </summary>
         /// <param name="mx"></param>
-        /// <param name="intefaceList"></param>
+        /// <param name="interfaceList"></param>
         /// <param name="chastr"></param>
         /// <param name="count"></param>
-        private void ProcessWangMianBLPz(u_mattress_mx_mtrl mx, List<u_mattress_interface> intefaceList, string chastr, string typename, int count)
+        private void ProcessWangMianBLPz(u_mattress_mx_mtrl mx, List<u_mattress_interface> interfaceList, string chastr, string typename, int count)
         {
             var name_arr = new string[5];
             var mtrlname_temp = mx.mtrlname;
@@ -767,18 +779,19 @@ namespace JLHHJSvr.Helper
 
             if ((!mx.mtrlname.Contains("分") && mx.thickness > 0) || ("垫层".Equals(typename)))
             {
-                mtrlname_temp = $"{mx.thickness}分{mx.mtrlname}";
+                mtrlname_temp = $"{mx.thickness.Value.ToString("#,##0.0#")}分{mx.mtrlname}";
             }
 
-            intefaceList.Add(InserMattressInterfacePz("垫层", chastr_temp, 2, name_arr));
+            name_arr[0] = mtrlname_temp;
+            interfaceList.Add(InserMattressInterfacePz("垫层", chastr_temp, 2, name_arr));
         }
         /// <summary>
         /// 顶布裥棉
         /// </summary>
         /// <param name="mx"></param>
-        /// <param name="intefaceList"></param>
+        /// <param name="interfaceList"></param>
         /// <param name="count"></param>
-        private void ProcessDingbuLianMianPz(u_mattress_mx_mtrl mx, List<u_mattress_interface> intefaceList, string chastr, int count)
+        private void ProcessDingbuLianMianPz(u_mattress_mx_mtrl mx, List<u_mattress_interface> interfaceList, string chastr, int count)
         {
             string chastr_temp = string.Empty;
             string ls_temp = "";
@@ -817,9 +830,9 @@ namespace JLHHJSvr.Helper
                 }
             }
 
-            intefaceList.Add(InserMattressInterfacePz("垫层", chastr_temp, 2, name_arr));
+            interfaceList.Add(InserMattressInterfacePz("垫层", chastr_temp, 2, name_arr));
         }
-        private void AutoSetFormulaTypeTwoPz(List<u_mattress_mx_mtrl> mxlist, List<u_mattress_interface> intefaceList)
+        private void AutoSetFormulaTypeTwoPz(List<u_mattress_mx_mtrl> mxlist, List<u_mattress_interface> interfaceList)
         {
             var fuliaoList = mxlist.Where(t => t.formulatype == 2).ToList();
 
@@ -840,29 +853,35 @@ namespace JLHHJSvr.Helper
                     // 处理特殊辅料
                     if (specialSet.Contains(mx.mtrlname))
                     {
-                        intefaceList.Add(InserMattressInterfacePz("辅料", $"{mx.mtrlname}", 1, new string[] { $"{cnt}个" }));
+                        interfaceList.Add(InserMattressInterfacePz("辅料", $"{mx.mtrlname}", 1, new string[] { $"{cnt.ToString("#,##0.0#")}个" }));
                         continue; // 跳过后续的处理
                     }
 
                     // 处理其他辅料
-                    if (nameSet.Contains(mx.mtrlname) || mx.formulakind == 15 && !nameSet.Contains(mx.mtrlname))
+                    if (nameSet.Contains(mx.mtrlname))
                     {
                         for (int i = 1; i <= cnt; i++)
                         {
                             // 添加辅料接口
-                            intefaceList.Add(InserMattressInterfacePz("辅料", $"{mx.mtrlname}{i}", 1, new string[] { "" }));
-
+                            interfaceList.Add(InserMattressInterfacePz("辅料", $"{mx.mtrlname}{i}", 1, new string[] { "" }));
                             // 如果是额外的辅料,添加位置接口
                             if (extraSet.Contains(mx.mtrlname))
                             {
-                                intefaceList.Add(InserMattressInterfacePz("辅料", $"{mx.mtrlname}{i}位置", 0, new string[] { "" }));
+                                interfaceList.Add(InserMattressInterfacePz("辅料", $"{mx.mtrlname}{i}位置", 0, new string[] { "" }));
                             }
                         }
+                    }else if(mx.formulakind == 15 && !nameSet.Contains(mx.mtrlname))
+                    {
+                        for (int i = 1; i <= cnt; i++)
+                        {
+                            interfaceList.Add(InserMattressInterfacePz("辅料", $"{mx.mtrlname}{i}", 1, new string[] { "" }));
+                            interfaceList.Add(InserMattressInterfacePz("辅料", $"{mx.mtrlname}{i}位置", 0, new string[] { "" }));
+                        }
                     }
                 }
             }
         }
-        private void AutoSetFormulaTypeThreePz(u_mattress mattress, List<u_mattress_mx_mtrl> mxlist, List<u_mattress_interface> intefaceList)
+        private void AutoSetFormulaTypeThreePz(u_mattress mattress, List<u_mattress_mx_mtrl> mxlist, List<u_mattress_interface> interfaceList)
         {
             // 筛选 formulatype 为 3 的物料
             var bzList = mxlist.Where(t => t.formulatype == 3).ToList();
@@ -888,7 +907,7 @@ namespace JLHHJSvr.Helper
             };
 
             // 外观
-            intefaceList.Add(InserMattressInterfacePz("包装", "包装方式", 1, new string[] { Enum.GetName(typeof(PackType), mattress.packtype) }));
+            interfaceList.Add(InserMattressInterfacePz("包装", "包装方式", 1, new string[] { Enum.GetName(typeof(PackType), mattress.packtype) }));
 
             foreach (var mx in bzList)
             {
@@ -897,7 +916,7 @@ namespace JLHHJSvr.Helper
                     var name_arr = new string[1];
                     if (mx.qty.HasValue && mx.qty.Value > 1)
                     {
-                        name_arr[0] = $"{mx.qty.Value}个{mx.mtrlname}";
+                        name_arr[0] = $"{mx.qty.Value.ToString("#,##0.0#")}个{mx.mtrlname}";
                     }
                     else
                     {
@@ -910,20 +929,20 @@ namespace JLHHJSvr.Helper
                     }
 
                     // 添加包装信息
-                    intefaceList.Add(InserMattressInterfacePz("包装", chastr, 2, name_arr));
+                    interfaceList.Add(InserMattressInterfacePz("包装", chastr, 2, name_arr));
                 }
             }
 
             // 压包数量
-            intefaceList.Add(InserMattressInterfacePz("包装", "压包数量", 1, new string[] { $"{mattress.packqty}" }));
+            interfaceList.Add(InserMattressInterfacePz("包装", "压包数量", 1, new string[] { $"{mattress.packqty.Value.ToString("#,##0.0#")}" }));
             // 包装说明
-            intefaceList.Add(InserMattressInterfacePz("包装", "包装说明", 1, new string[] { "" }));
+            interfaceList.Add(InserMattressInterfacePz("包装", "包装说明", 1, new string[] { "" }));
             // 压包说明
-            if (mattress.packqty.HasValue && mattress.packqty.Value > 0) intefaceList.Add(InserMattressInterfacePz("包装", "压包说明", 1, new string[] { "" }));
+            if (mattress.packqty.HasValue && mattress.packqty.Value > 0) interfaceList.Add(InserMattressInterfacePz("包装", "压包说明", 1, new string[] { "" }));
             // 卷包说明
-            if (mattress.diameter.HasValue && mattress.diameter.Value > 0) intefaceList.Add(InserMattressInterfacePz("包装", "卷包说明", 1, new string[] { "" }));
+            if (mattress.diameter.HasValue && mattress.diameter.Value > 0) interfaceList.Add(InserMattressInterfacePz("包装", "卷包说明", 1, new string[] { "" }));
         }
-        private void AutoSetFormulaType101Pz(u_mattress mattress, List<u_mattress_mx_mtrl> mxlist, List<u_mattress_interface> intefaceList)
+        private void AutoSetFormulaType101Pz(u_mattress mattress, List<u_mattress_mx_mtrl> mxlist, List<u_mattress_interface> interfaceList)
         {
             var powerDict = new Dictionary<string, int[]>()
             {
@@ -955,8 +974,8 @@ namespace JLHHJSvr.Helper
 
                 if (sb.Length > 0)
                 {
-                    intefaceList.Add(InserMattressInterfacePz("内布套", chastrDict[item.Key][0], 2, name_arr));
-                    intefaceList.Add(InserMattressInterfacePz("内布套", chastrDict[item.Key][1], 1, new string[] { "" }));
+                    interfaceList.Add(InserMattressInterfacePz("内布套", chastrDict[item.Key][0], 2, name_arr));
+                    interfaceList.Add(InserMattressInterfacePz("内布套", chastrDict[item.Key][1], 1, new string[] { "" }));
                 }
             }
 
@@ -965,86 +984,33 @@ namespace JLHHJSvr.Helper
             {
                 if (mx.mtrlid > 0 && "内布套".Equals(mx.chastr) && mx.formulakind == 203)
                 {
-                    intefaceList.Add(InserMattressInterfacePz("内布套", "内布套-围边边带", 2, new string[] { $"{mx.thickness.Value}条共{mx.qty.Value}米{mx.mtrlname}" }));
+                    interfaceList.Add(InserMattressInterfacePz("内布套", "内布套-围边边带", 2, new string[] { $"{mx.thickness.Value.ToString("#,##0.0#")}条共{mx.qty.Value.ToString("#,##0.0#")}米{mx.mtrlname}" }));
                 }
                 else if (mx.mtrlid > 0 && "内布套".Equals(mx.chastr) && mx.formulakind == 202)
                 {
-                    intefaceList.Add(InserMattressInterfacePz("内布套", "内布套-拉链", 2, new string[] { $"{mx.thickness.Value}条共{mx.qty.Value}米{mx.mtrlname}" }));
+                    interfaceList.Add(InserMattressInterfacePz("内布套", "内布套-拉链", 2, new string[] { $"{mx.thickness.Value.ToString("#,##0.0#")}条共{mx.qty.Value.ToString("#,##0.0#")}米{mx.mtrlname}" }));
                 }
             }
 
             if (mattress.if_n_butao == 1)
             {
-                intefaceList.Add(InserMattressInterfacePz("内布套", "内布套做法说明", 1, new string[] { $"内布套面层向大侧覆盖{mattress.s_cover_qty}CM、内布套大侧向底层覆盖{mattress.z_cover_qty}CM、内布套底层向大侧覆盖{mattress.x_cover_qty}CM" }));
+                interfaceList.Add(InserMattressInterfacePz("内布套", "内布套做法说明", 1, new string[] { $"内布套面层向大侧覆盖{mattress.s_cover_qty.Value.ToString("#,##0.0#")}CM、内布套大侧向底层覆盖{mattress.z_cover_qty.Value.ToString("#,##0.0#")}CM、内布套底层向大侧覆盖{mattress.x_cover_qty.Value.ToString("#,##0.0#")}CM" }));
             }
         }
         #endregion
 
         #region 导入清单方法 
-        public void RefreshMattressInterfaceQdList(int mattressid, List<u_mattress_interface_qd> qdList)
+        public List<u_mattress_interface_qd> RefreshMattressInterfaceQdList(int mattressid)
         {
-            var mattress = new u_mattress() { mattressid = mattressid };
-            DbSqlHelper.SelectOne(cmd, mattress, "js2_flag");
-
-            if(mattress.js2_flag == 1)
-            {
-                throw new LJCommonException("床垫已技术2审核,不能重新生成!");
-            }
-
-            var copy_list = new List<u_mattress_interface_qd>();
-
-            var selectStr = @"SELECT u_mattress_interface_qd.mattressid 
-	                            ,u_mattress_interface_qd.printid 
-	                            ,u_mattress_interface_qd.itemname 
-	                            ,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.mtrlid 
-	                            ,u_mattress_interface_qd.erp_mtrlid 
-	                            ,u_mattress_interface_qd.useqty 
-	                            ,u_mattress_interface_qd.dscrp 
-	                            ,u_mtrl_price.name AS mtrlname
-	                            ,u_mattress_interface_qd.actual_useqty 
-	                            ,u_mattress_interface_qd.qd_actual_size 
-	                            ,u_mattress_interface_qd.qd_pfgroupqty 
-	                            ,u_mattress_interface_qd.wrkgrpid 
-	                            ,u_mattress_interface_qd.ss_rate 
-	                            ,u_mattress_interface_qd.ls_rate 
-	                            ,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,ss_rate,ls_rate,sh_rate";
-            DbSqlHelper.SelectJoin(cmd, selectStr, "mattressid = @mattressid", new Dictionary<string, object>() { { "@mattressid", mattressid } }, "printid", outputFields, 0, 0, copy_list);
-
+            var qdList = new List<u_mattress_interface_qd>();
+            
             ImportMattressInterfaceQdList(mattressid, qdList);
 
+            MattressInterfaceFindERPPrdPf(qdList,null);
 
-            var copyDict = copy_list.ToDictionary(mx2 => Tuple.Create(mx2.itemname, mx2.bj_pzname, mx2.bj_pzname_mx), mx2 => mx2);
-
-            // 遍历qdList
-            foreach (var mx in qdList)
-            {
-                var key = Tuple.Create(mx.itemname, mx.bj_pzname, mx.bj_pzname_mx); // 创建复合键
-                if (copyDict.TryGetValue(key, out var mx2)) // 高效查找对应的mx2
-                {
-                    // 更新mx属性
-                    mx.erp_mtrlid = mx2.erp_mtrlid;
-                    mx.erp_mtrlcode = mx2.erp_mtrlcode;
-                    mx.erp_mtrlname = mx2.erp_mtrlname;
-                    mx.erp_mtrlmode = mx2.erp_mtrlmode;
-                    mx.erp_unit = mx2.erp_unit;
-                    mx.useqty = mx2.useqty;
-                    mx.actual_useqty = mx2.actual_useqty;
-                    mx.wrkgrpid = mx2.wrkgrpid;
-                    mx.qd_actual_size = mx2.qd_actual_size;
-                    mx.qd_pfgroupqty = mx2.qd_pfgroupqty;
-                    mx.dscrp = mx2.dscrp;
-                }
-            }
-
-            FindERPPrdPf(qdList);
+            return qdList;
         }
-        private void FindERPPrdPf(List<u_mattress_interface_qd> qdList)
+        public void MattressInterfaceFindERPPrdPf(List<u_mattress_interface_qd> qdList,List<u_mattress_interface> interfaceList)
         {
             foreach(var mx in qdList)
             {
@@ -1086,6 +1052,20 @@ namespace JLHHJSvr.Helper
             }
 
             //更新 二级明细项目 需要产品配置列表,此部分由前端完成
+            if(interfaceList != null && interfaceList.Any())
+            {
+                Dictionary<string, u_mattress_interface> interfaceDict = interfaceList.ToDictionary(mb => mb.bj_pzname, mb => mb);
+                foreach (var mx in qdList)
+                {
+                    if (interfaceDict.TryGetValue(mx.bj_pzname, out var mb))
+                    {
+                        mx.bj_pzname_mx_mx = mb.bj_namemx;
+
+                        if (mx.ss_rate == 0) mx.ss_rate = mb.ss_rate;
+                        if (mx.ls_rate == 0) mx.ls_rate = mb.ls_rate;
+                    }
+                }
+            }
         }
         /// <summary>
         /// 导入产品清单
@@ -1213,7 +1193,7 @@ namespace JLHHJSvr.Helper
                 {"小侧1",new string[] { "小侧", "小侧1裥棉"} },
                 {"小侧1-上下拼侧1",new string[] { "小侧", "小侧1-上下拼侧1裥棉" } },
                 {"小侧1-上下拼侧2",new string[] { "小侧", "小侧1-上下拼侧2裥棉" } },
-                {"小侧1-上下拼侧2",new string[] { "小侧", "小侧1-上下拼侧3裥棉" } },
+                {"小侧1-上下拼侧3",new string[] { "小侧", "小侧1-上下拼侧3裥棉" } },
                 {"小侧2",new string[] { "小侧", "小侧2裥棉", "小侧2裥棉图案" } },
                 {"小侧3",new string[] { "小侧", "小侧3裥棉", "小侧3裥棉图案", "小侧说明" } },
                 {"V侧1_EMPTY",new string[] { "V侧", "V侧1裥棉", "V侧1裥棉图案" } },
@@ -1351,7 +1331,7 @@ namespace JLHHJSvr.Helper
         /// 床网
         /// </summary>
         /// <param name="mx"></param>
-        /// <param name="intefaceList"></param>
+        /// <param name="interfaceList"></param>
         /// <param name="chastr"></param>
         /// <param name="count"></param>
         private void ProcessChuangWangPrdPf(u_mattress_mx_mtrl mx, List<u_mattress_interface_qd> qdList, string chastr, int count)
@@ -1406,7 +1386,7 @@ namespace JLHHJSvr.Helper
         /// 网面布料 / 打底无纺布 / 毡类 / 顶布 / 垫层
         /// </summary>
         /// <param name="mx"></param>
-        /// <param name="intefaceList"></param>
+        /// <param name="interfaceList"></param>
         /// <param name="chastr"></param>
         /// <param name="count"></param>
         private void ProcessWangMianBLPrdPf(u_mattress_mx_mtrl mx, List<u_mattress_interface_qd> qdList, string chastr, string typename, int count)
@@ -1415,7 +1395,7 @@ namespace JLHHJSvr.Helper
 
             if ((!mx.mtrlname.Contains("分") && mx.thickness > 0) || ("垫层".Equals(typename)))
             {
-                mtrlname_temp = $"{mx.thickness}分{mx.mtrlname}";
+                mtrlname_temp = $"{mx.thickness.Value.ToString("#,##0.0#")}分{mx.mtrlname}";
             }
 
             qdList.Add(InserMattressInterfacePrdPf("垫层", $"{chastr}-{typename}{count}", "",mx.mtrlid.Value,mx.useqty.Value));
@@ -1499,7 +1479,7 @@ namespace JLHHJSvr.Helper
                     var name_arr = new string[1];
                     if (mx.qty.HasValue && mx.qty.Value > 1)
                     {
-                        name_arr[0] = $"{mx.qty.Value}个{mx.mtrlname}";
+                        name_arr[0] = $"{mx.qty.Value.ToString("#,##0.0#")}个{mx.mtrlname}";
                     }
                     else
                     {

+ 29 - 0
JLHHJSvr/JLHHJSvr.csproj

@@ -106,11 +106,23 @@
     <Compile Include="Com\GetComputeBednet.cs" />
     <Compile Include="Com\GetDept.cs" />
     <Compile Include="Com\GetDwLayout.cs" />
+    <Compile Include="Com\GetERPConfigureList.cs" />
+    <Compile Include="Com\GetERPMtrldefList.cs" />
+    <Compile Include="Com\GetERPWrkGrpList.cs" />
     <Compile Include="Com\GetFileByMd5.cs" />
+    <Compile Include="Com\GetMattressImportDW2.cs" />
+    <Compile Include="Com\GetMattressInterfaceList.cs" />
     <Compile Include="Com\GetMtrlTypeList.cs" />
     <Compile Include="Com\GetPriceList.cs" />
     <Compile Include="Com\GetSysFuncPwr.cs" />
     <Compile Include="Com\GetFormulaCompute.cs" />
+    <Compile Include="Com\MattressJS2Audit.cs" />
+    <Compile Include="Com\MattressJSAudit.cs" />
+    <Compile Include="Com\MattressYWAudit.cs" />
+    <Compile Include="Com\Model\ColumnItem.cs" />
+    <Compile Include="Com\Model\erp_configure_code.cs" />
+    <Compile Include="Com\Model\erp_mtrldef.cs" />
+    <Compile Include="Com\Model\erp_sc_workgroup.cs" />
     <Compile Include="Com\Model\replacement.cs" />
     <Compile Include="Com\Model\Recursion.cs" />
     <Compile Include="Com\Model\sys_func_pwr.cs" />
@@ -119,6 +131,7 @@
     <Compile Include="Com\Model\u_bednetmx_mtrl.cs" />
     <Compile Include="Com\Model\u_bednetmx_spring.cs" />
     <Compile Include="Com\Model\u_bednet_area.cs" />
+    <Compile Include="Com\Model\u_bednet_qingdan.cs" />
     <Compile Include="Com\Model\u_bednet_type.cs" />
     <Compile Include="Com\Model\u_bednet_var.cs" />
     <Compile Include="Com\Model\u_bednet_varmx.cs" />
@@ -146,8 +159,11 @@
     <Compile Include="Com\Model\u_shrinkage.cs" />
     <Compile Include="Com\Model\u_spring.cs" />
     <Compile Include="Com\Model\u_workmanship_add.cs" />
+    <Compile Include="Com\ReBuildMattressInterface.cs" />
     <Compile Include="Com\ReCalculateBedNetNoAudit.cs" />
     <Compile Include="Com\ReCalculateNoAudit.cs" />
+    <Compile Include="Com\RefreshMattressInterface.cs" />
+    <Compile Include="Com\RefreshMattressInterfaceQd.cs" />
     <Compile Include="Com\SaveBedNet.cs" />
     <Compile Include="Com\SaveBedNetArea.cs" />
     <Compile Include="Com\SaveBedNetType.cs" />
@@ -163,6 +179,7 @@
     <Compile Include="Com\SaveMattress.cs" />
     <Compile Include="Com\SaveMattressBcp.cs" />
     <Compile Include="Com\SaveMattressFormula.cs" />
+    <Compile Include="Com\SaveMattressInterface.cs" />
     <Compile Include="Com\SaveMattressType.cs" />
     <Compile Include="Com\SaveMtrlDef.cs" />
     <Compile Include="Com\SaveMtrlType.cs" />
@@ -260,7 +277,12 @@
     <Compile Include="Excutor\GetComputeBednetExcutor.cs" />
     <Compile Include="Excutor\GetDeptExcutor.cs" />
     <Compile Include="Excutor\GetDwLayoutExcutor.cs" />
+    <Compile Include="Excutor\GetERPConfigureListExcutor.cs" />
+    <Compile Include="Excutor\GetERPMtrldefListExcutor.cs" />
+    <Compile Include="Excutor\GetERPWrkGrpListExcutor.cs" />
     <Compile Include="Excutor\GetFileByMd5Excutor.cs" />
+    <Compile Include="Excutor\GetMattressImportDW2Excutor.cs" />
+    <Compile Include="Excutor\GetMattressInterfaceListExcutor.cs" />
     <Compile Include="Excutor\GetMtrlTypeListExcutor.cs" />
     <Compile Include="Excutor\GetOptionListExcutor.cs" />
     <Compile Include="Excutor\GetPermitListExcutor.cs" />
@@ -272,10 +294,16 @@
     <Compile Include="Excutor\GetUserPowerExcutor.cs" />
     <Compile Include="Excutor\HelloWordExcutor.cs" />
     <Compile Include="Excutor\LoginExcutor.cs" />
+    <Compile Include="Excutor\MattressJS2AuditExcutor.cs" />
+    <Compile Include="Excutor\MattressJSAuditExcutor.cs" />
+    <Compile Include="Excutor\MattressYWAuditExcutor.cs" />
     <Compile Include="Excutor\ModPasswordExcutor.cs" />
     <Compile Include="Excutor\PostFileExcutor.cs" />
+    <Compile Include="Excutor\ReBuildMattressInterfaceExcutor.cs" />
     <Compile Include="Excutor\ReCalculateBedNetNoAuditExcutor.cs" />
     <Compile Include="Excutor\ReCalculateNoAuditExcutor.cs" />
+    <Compile Include="Excutor\RefreshMattressInterfaceExcutor.cs" />
+    <Compile Include="Excutor\RefreshMattressInterfaceQdExcutor.cs" />
     <Compile Include="Excutor\SaveBedNetAreaExcutor.cs" />
     <Compile Include="Excutor\SaveBedNetExcutor.cs" />
     <Compile Include="Excutor\SaveBedNetTypeExcutor.cs" />
@@ -289,6 +317,7 @@
     <Compile Include="Excutor\SaveMattressAuditingExcutor.cs" />
     <Compile Include="Excutor\SaveMattressBcpExcutor.cs" />
     <Compile Include="Excutor\SaveMattressFormulaExcutor.cs" />
+    <Compile Include="Excutor\SaveMattressInterfaceExcutor.cs" />
     <Compile Include="Excutor\SaveMattressTypeExcutor.cs" />
     <Compile Include="Excutor\SaveMtrlDefExcutor.cs" />
     <Compile Include="Excutor\SaveMtrlTypeExcutor.cs" />

+ 60 - 11
JLHHJSvr/Tools/AutoInit.cs

@@ -1,5 +1,8 @@
-using JLHHJSvr.LJException;
+using JLHHJSvr.Com.Model;
+using JLHHJSvr.LJException;
 using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
 using System.Data.SqlClient;
 using System.Data.SqlTypes;
 using System.Diagnostics;
@@ -11,25 +14,71 @@ namespace JLHHJSvr.Tools
 {
     public class AutoInit
     {
+        private static readonly ConcurrentDictionary<string, CacheItem> ColumnInfoCache = new ConcurrentDictionary<string, CacheItem>();
+        private static readonly TimeSpan CacheExpirationTime = TimeSpan.FromMinutes(60); // 缓存过期时间1小时
+
+
         public static void AutoInitS <T>(SqlCommand cmd, T instance){
-            cmd.CommandText = @"SELECT COLUMN_NAME, IS_NULLABLE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = @tableName";
-            cmd.Parameters.Clear();
-            cmd.Parameters.AddWithValue("@tableName", instance.GetType().Name);
-            using (var reader = cmd.ExecuteReader())
+            var tableName = instance.GetType().Name;
+            var currentTime = DateTime.Now;
+
+            if (ColumnInfoCache.TryGetValue(tableName, out var cache) && currentTime - cache.CacheTime < CacheExpirationTime)
             {
-                while (reader.Read())
+                // 缓存有效,使用缓存
+                foreach (var item in cache.ColumnInfo)
                 {
-                    var column = Convert.ToString(reader["COLUMN_NAME"]).Trim();
-                    var isNullable = Convert.ToString(reader["IS_NULLABLE"]).Trim();
+                    var column = item.Value.Column;
+                    var isNullable = item.Value.IsNullable;
 
                     var property = instance.GetType().GetProperties().FirstOrDefault(prop => prop.Name.Equals(column, StringComparison.OrdinalIgnoreCase));
+                    if (property == null) continue;
 
-                    if(property == null)
+                    if (isNullable.Equals("NO") && property.GetValue(instance) == null)
                     {
-                        //throw new LJCommonException($"数据库字段:{column}在模型中找不到相关属性!");
-                        continue;
+                        var type = property.PropertyType;
+
+                        if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>))
+                        {
+                            type = type.GetGenericArguments()[0];
+                        }
+
+                        if (type.IsAssignableFrom(typeof(string)))
+                        {
+                            property.SetValue(instance, "");
+                        }
+                        else if (type.IsAssignableFrom(typeof(int))
+                            || type.IsAssignableFrom(typeof(decimal))
+                            || type.IsAssignableFrom(typeof(byte)))
+                        {
+                            property.SetValue(instance, Activator.CreateInstance(type));
+                        }
+                    }
+                }
+            } else
+            {
+                // 缓存过期,重新加载列信息
+                var columnInfo = new Dictionary<string, ColumnItem>();
+                cmd.CommandText = @"SELECT COLUMN_NAME, IS_NULLABLE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = @tableName";
+                cmd.Parameters.Clear();
+                cmd.Parameters.AddWithValue("@tableName", instance.GetType().Name);
+                using (var reader = cmd.ExecuteReader())
+                {
+                    while (reader.Read())
+                    {
+                        var column = Convert.ToString(reader["COLUMN_NAME"]).Trim();
+                        var isNullable = Convert.ToString(reader["IS_NULLABLE"]).Trim();
+                        columnInfo[column] = new ColumnItem(column, isNullable);
                     }
+                }
+                ColumnInfoCache[tableName] = new CacheItem { CacheTime = currentTime, ColumnInfo = columnInfo };
+                // 使用新的列信息初始化属性
+                foreach (var item in columnInfo)
+                {
+                    var column = item.Value.Column;
+                    var isNullable = item.Value.IsNullable;
 
+                    var property = instance.GetType().GetProperties().FirstOrDefault(prop => prop.Name.Equals(column, StringComparison.OrdinalIgnoreCase));
+                    if (property == null) continue;
                     if (isNullable.Equals("NO") && property.GetValue(instance) == null)
                     {
                         var type = property.PropertyType;

+ 53 - 0
JLHWEB/src/api/interface/index.ts

@@ -1003,6 +1003,42 @@ export namespace GenericApi {
      */
     values: number[];
   }
+  export interface ReqGetERPMtrldefList {
+    /**
+     * @description 物料id
+     */
+    mtrlid?: number;
+  }
+  export interface ResGetERPMtrldefList {
+    /**
+     * @description 返回的结果
+     */
+    mtrldefList: any[];
+  }
+  export interface ReqGetERPConfigureList {
+    /**
+     * @description 配置id
+     */
+    typeid?: number;
+  }
+  export interface ResGetERPConfigureList {
+    /**
+     * @description 返回的结果
+     */
+    configureList: any[];
+  }
+  export interface ReqGetERPWrkGrpList {
+    /**
+     * @description 工组id
+     */
+    wrkgrpid?: number;
+  }
+  export interface ResGetERPWrkGrpList {
+    /**
+     * @description 返回的结果
+     */
+    workgroupList: any[];
+  }
 }
 
 export namespace FileApi {
@@ -1205,4 +1241,21 @@ export namespace Mattress {
     formulas: any;
     message: string;
   }
+  export interface ReqRefreshMattressInterface {
+    mattressid: number;
+    isPz?: number;
+  }
+  export interface ResRefreshMattressInterface {
+    mxList: any[];
+  }
+  export interface ResGetMattressInterfaceList {
+    mattress: any;
+    interfaceList: any[];
+    qdList: any[];
+  }
+  export interface ReqSaveMattressInterface {
+    mattress: any;
+    interfaceList: any[];
+    qdList: any[];
+  }
 }

+ 12 - 0
JLHWEB/src/api/modules/common.ts

@@ -70,3 +70,15 @@ export const UploadFile = (params: FileApi.ReqUploadFile) => {
 export const GetFormulaCompute = (params: GenericApi.ReqFormulaCompute) => {
   return http.post<GenericApi.ResFormulaCompute>(PORT1 + `/GetFormulaCompute`, params);
 };
+
+export const GetERPMtrldefList = (params?: GenericApi.ReqGetERPMtrldefList) => {
+  return http.post<GenericApi.ResGetERPMtrldefList>(PORT1 + `/GetERPMtrldefList`, params);
+};
+
+export const GetERPConfigureList = (params?: GenericApi.ReqGetERPConfigureList) => {
+  return http.post<GenericApi.ResGetERPConfigureList>(PORT1 + `/GetERPConfigureList`, params);
+};
+
+export const GetERPWrkGrpList = (params?: GenericApi.ReqGetERPWrkGrpList) => {
+  return http.post<GenericApi.ResGetERPWrkGrpList>(PORT1 + `/GetERPWrkGrpList`, params);
+};

+ 49 - 0
JLHWEB/src/api/modules/quote.ts

@@ -99,3 +99,52 @@ export const GetComputeBednet = (params: Mattress.ReqSaveBedNet) => {
 export const ReCalculateBedNetNoAudit = (params: Mattress.ReqMultiMattressBcp) => {
   return http.post(PORT1 + `/ReCalculateBedNetNoAudit`, params);
 };
+
+/**
+ * @name 床垫清单:业务审核
+ */
+export const MattressYWAudit = (params: Mattress.ReqMultiMattressBcp) => {
+  return http.post(PORT1 + `/MattressYWAudit`, params);
+};
+
+/**
+ * @name 床垫清单:产品补充审核
+ */
+export const MattressJSAudit = (params: Mattress.ReqMultiMattressBcp) => {
+  return http.post(PORT1 + `/MattressJSAudit`, params);
+};
+
+/**
+ * @name 床垫清单:清单补充审核
+ */
+export const MattressJS2Audit = (params: Mattress.ReqMultiMattressBcp) => {
+  return http.post(PORT1 + `/MattressJS2Audit`, params);
+};
+
+/**
+ * @name 床垫清单:刷新配置
+ */
+export const RefreshMattressInterface = (params: Mattress.ReqRefreshMattressInterface) => {
+  return http.post<Mattress.ResRefreshMattressInterface>(PORT1 + `/RefreshMattressInterface`, params);
+};
+
+/**
+ * @name 床垫清单:刷新清单
+ */
+export const RefreshMattressInterfaceQd = (params: Mattress.ReqRefreshMattressInterface) => {
+  return http.post<Mattress.ResRefreshMattressInterface>(PORT1 + `/RefreshMattressInterfaceQd`, params);
+};
+
+/**
+ * @name 床垫清单:获取清单
+ */
+export const GetMattressInterfaceList = (params: Mattress.ReqRefreshMattressInterface) => {
+  return http.post<Mattress.ResGetMattressInterfaceList>(PORT1 + `/GetMattressInterfaceList`, params);
+};
+
+/**
+ * @name 床垫清单:保存清单
+ */
+export const SaveMattressInterface = (params: Mattress.ReqSaveMattressInterface) => {
+  return http.post<Mattress.ResSaveMattressBcp>(PORT1 + `/SaveMattressInterface`, params);
+};

+ 17 - 1
JLHWEB/src/enums/dwnameEnum.ts

@@ -133,5 +133,21 @@ export enum DwnameEnum {
   /**
    * @description 床网报价表-选择
    */
-  bednetQuoteChoose = "u_bednet_choose"
+  bednetQuoteChoose = "u_bednet_choose",
+  /**
+   * @description 床垫接口
+   */
+  mattressInterface = "u_mattress_interface",
+  /**
+   * @description 床垫接口-主体内容
+   */
+  mattressInterfaceDetail = "u_mattress_interface_zt",
+  /**
+   * @description 床垫接口清单
+   */
+  mattressInterfaceYw = "u_mattress_interface_yw",
+  /**
+   * @description 床垫接口清单
+   */
+  mattressInterfaceQd = "u_mattress_interface_qd"
 }

+ 6 - 1
JLHWEB/src/languages/modules/zh-cn/menu.json

@@ -162,5 +162,10 @@
   "semifinprodQuote": "半成品报价",
   "semifinprodQuoteDetail": "半成品报价详情",
   "semifinprodQuoteEdit": "修改半成品垫报价",
-  "semifinprodQuoteAdd": "新建半成品报价"
+  "semifinprodQuoteAdd": "新建半成品报价",
+  "mattressInterface": "床垫清单",
+  "mattressInterfaceDetail": "床垫清单详情",
+  "mattressInterfaceEditYw": "床垫清单-业务补充",
+  "mattressInterfaceEditCp": "床垫清单-产品补充",
+  "mattressInterfaceEditQd": "床垫清单-清单补充"
 }

+ 81 - 0
JLHWEB/src/routers/modules/mattressQtuoteRouter.ts

@@ -119,5 +119,86 @@ export const mattressQtuoteRouter: Menu.MenuOptions[] = [
     //   ]
     // }
     // ]
+  },
+  {
+    path: "/mattressInterface",
+    name: "mattressInterface",
+    component: "/quote/mattressInterface/index",
+    meta: {
+      icon: "Common_Business.png",
+      title: "床垫接口",
+      isLink: "",
+      isHide: false,
+      isFull: false,
+      isAffix: false,
+      isKeepAlive: true,
+      funid: 71
+    },
+    children: [
+      {
+        path: "/mattressInterface/detail",
+        name: "mattressInterfaceDetail",
+        component: "/quote/mattressInterface/detail",
+        meta: {
+          icon: "iconpackage",
+          title: "床垫接口详情",
+          isLink: "",
+          isHide: true,
+          isFull: false,
+          isAffix: false,
+          isKeepAlive: true,
+          funid: 71,
+          activeMenu: "/mattressInterface"
+        }
+      },
+      {
+        path: "/mattressInterface/1/edit",
+        name: "mattressInterfaceEditYw",
+        component: "/quote/mattressInterface/detail",
+        meta: {
+          icon: "iconpackage",
+          title: "修改床垫接口-业务补充",
+          isLink: "",
+          isHide: true,
+          isFull: false,
+          isAffix: false,
+          isKeepAlive: false,
+          funid: 71,
+          activeMenu: "/mattressInterface"
+        }
+      },
+      {
+        path: "/mattressInterface/2/edit",
+        name: "mattressInterfaceEditCp",
+        component: "/quote/mattressInterface/detail",
+        meta: {
+          icon: "iconpackage",
+          title: "修改床垫接口-产品补充",
+          isLink: "",
+          isHide: true,
+          isFull: false,
+          isAffix: false,
+          isKeepAlive: false,
+          funid: 71,
+          activeMenu: "/mattressInterface"
+        }
+      },
+      {
+        path: "/mattressInterface/3/edit",
+        name: "mattressInterfaceEditQd",
+        component: "/quote/mattressInterface/detail",
+        meta: {
+          icon: "iconpackage",
+          title: "修改床垫接口-清单补充",
+          isLink: "",
+          isHide: true,
+          isFull: false,
+          isAffix: false,
+          isKeepAlive: false,
+          funid: 71,
+          activeMenu: "/mattressInterface"
+        }
+      }
+    ]
   }
 ];

+ 278 - 0
JLHWEB/src/views/quote/mattressInterface/detail.vue

@@ -0,0 +1,278 @@
+<template>
+  <LjDetail
+    name="mattressInterfaceDetail"
+    ref="LjDetailRef"
+    v-bind="detailProps"
+    :data="[mainData]"
+    v-model:order-status="orderStatus"
+    :action="orderDefaultAction"
+    :after-mound="funcAfterMound"
+    :if-layout-editable="false"
+    :search-col="{ xs: 3, sm: 3, md: 3, lg: 3, xl: 3 }"
+    :basic-group-col="{ xs: 3, sm: 3, md: 3, lg: 3, xl: 3 }"
+  >
+    <template #mattressYW>
+      <LjVxeTable
+        ref="VxeTableMxRef"
+        row-key="key"
+        table-cls=""
+        :data="mattressYWList"
+        :columns="columns_yw"
+        :dwname="DwnameEnum.mattressInterfaceYw"
+        :table-props="tableProps_mx"
+        :tool-button="[]"
+        :auto-load-layout="false"
+        collapseButtons
+      >
+      </LjVxeTable>
+    </template>
+    <template #mattressQD>
+      <LjVxeTable
+        ref="VxeTableMxRef"
+        row-key="key"
+        table-cls=""
+        :data="mattressQDList"
+        :columns="columns_qd"
+        :dwname="DwnameEnum.mattressInterfaceQd"
+        :table-props="tableProps_mx"
+        :tool-button="[]"
+        :auto-load-layout="false"
+        collapseButtons
+      >
+      </LjVxeTable>
+    </template>
+  </LjDetail>
+
+  <!-- <MtrldefDialog ref="MtrldefDialogRef" v-bind="MtrldefDialogProps" /> -->
+</template>
+
+<script setup lang="tsx" name="mattressInterfaceDetail">
+import { ref, watch, reactive, inject, onMounted } from "vue";
+import { DwnameEnum } from "@/enums/dwnameEnum";
+import LjDetail from "@/components/LjDetail/index.vue";
+import { DetailProp } from "@/components/LjDetail/interface";
+import { useI18n } from "vue-i18n";
+import { useRoute, useRouter } from "vue-router";
+import { useHooks } from "./hooks/index";
+import { useAuthButtons } from "@/hooks/useAuthButtons";
+import { CommonDynamicSelect } from "@/api/modules/common";
+import { SaveMattressInterface } from "@/api/modules/quote";
+import { ElMessage, ElMessageBox } from "element-plus";
+import mittBus from "@/utils/mittBus";
+import { MittEnum } from "@/enums/mittEnum";
+import MtrldefDialog from "@/views/system/selector/mtrldefNoPrice/index.vue";
+import { formatToDate } from "@/utils/dateUtil";
+
+interface detailProp {
+  /**
+   * @argument any 页面数据
+   */
+  data?: any;
+  /**
+   * @argument string 请求数据的api ==> 非必传
+   */
+  requestApi?: (params: any) => Promise<any>;
+  /**
+   * @argument any 基础信息,表格展示数据
+   */
+  // columns?: any;
+  /**
+   * @description 是否可编辑
+   */
+  status: "edit" | "new" | string;
+  enum?: any;
+}
+
+const props = withDefaults(defineProps<detailProp>(), {});
+const { t } = useI18n();
+const route = useRoute();
+const router = useRouter();
+const {
+  orderStatus,
+  LjDetailRef,
+  columns_detail,
+  columns_yw,
+  columns_qd,
+  mainData,
+  editType,
+  mattressYWList,
+  mattressQDList,
+  RetriveMattressInterface,
+  RefreshMattressInterfaceList,
+  RefreshMattressInterfaceQdList
+} = useHooks(t);
+const { CheckPower, CheckOption, buttonNew, buttonDefault } = useAuthButtons(t);
+
+const initParams = ref({ mattressid: 0 as Number });
+
+/**
+ * @description 明细表格组件基础配置
+ */
+const tableProps_mx = ref({
+  height: "auto",
+  align: "left",
+  // height: "",
+  minHeight: "300px",
+  editConfig: { trigger: "click", mode: "cell", enabled: false },
+  // exportConfig: {
+  //   filename: t("menu.saleTaskCrmDetail") + formatToDate(new Date(), "YYYY-MM-DDHH:mm:ss")
+  // }
+  keyboardConfig: {
+    isEdit: true,
+    isArrow: true,
+    isEnter: true,
+    isTab: true,
+    isDel: true,
+    isBack: true,
+    isEsc: true,
+    editMethod({ $table, row, column }) {
+      // 先清空原先的值
+      row[column.field] = "";
+      // 再激活编辑状态并输入新值
+      $table.setEditCell(row, column);
+    }
+  },
+  mouseConfig: {
+    selected: true
+  }
+});
+
+const detailProps = reactive<DetailProp>({
+  dwname: DwnameEnum.mattressInterfaceDetail,
+  columns: columns_detail,
+  basicDefault: {},
+  header: {
+    fieldNames: {
+      code: "sptcode",
+      codeLabel: t("table.u_spt.sptcode") + ":",
+      name: "name"
+    }
+  },
+  mould: [
+    {
+      id: "mattressYW",
+      type: "table",
+      label: "产品配置"
+    },
+    {
+      id: "mattressQD",
+      type: "table",
+      label: "产品清单"
+    }
+  ]
+});
+
+const orderDefaultAction = [
+  buttonDefault({
+    label: t("common.saveText"),
+    icon: "iconchevron-left",
+    limited: () => {
+      return !orderStatus.value;
+    },
+    clickFunc: item => {
+      ElMessageBox.confirm("是否确定要保存吗?", "询问", {
+        confirmButtonText: "是",
+        cancelButtonText: "否",
+        type: "warning"
+      }).then(async () => {
+        try {
+          const res = await SaveMattressInterface({
+            mattress: mainData.value,
+            interfaceList: mattressYWList.value,
+            qdList: mattressQDList.value
+          });
+          router.replace(`/mattressInterface/detail?id=${res.mattress.billid}&code=${res.mattress.billcode}`);
+        } catch (error) {
+          ElMessage.error(t("sys.api.operationFailed"));
+        }
+      });
+    }
+  }),
+  buttonDefault({
+    label: "刷新带出配置",
+    limited: () => {
+      return !orderStatus.value || editType.value == 3;
+    },
+    clickFunc: item => {
+      RefreshMattressInterfaceList(mainData.value.mattressid, 1);
+    }
+  }),
+  buttonDefault({
+    label: "复制配置",
+    limited: () => {
+      return !orderStatus.value || editType.value == 3;
+    },
+    clickFunc: item => {
+      throw new Error("功能没开放");
+    }
+  }),
+  buttonDefault({
+    label: "重新生成配置项目",
+    limited: () => {
+      return !orderStatus.value || editType.value != 1;
+    },
+    clickFunc: item => {
+      RefreshMattressInterfaceList(mainData.value.mattressid, 0);
+    }
+  }),
+  buttonDefault({
+    label: "刷新清单",
+    limited: () => {
+      return !orderStatus.value;
+    },
+    clickFunc: item => {
+      RefreshMattressInterfaceQdList(mainData.value.mattressid, 1);
+    }
+  }),
+  buttonDefault({
+    label: "复制清单",
+    limited: () => {
+      return !orderStatus.value;
+    },
+    clickFunc: item => {}
+  }),
+  buttonDefault({
+    label: "重新生成清单",
+    limited: () => {
+      return !orderStatus.value;
+    },
+    clickFunc: item => {
+      RefreshMattressInterfaceQdList(mainData.value.mattressid, 0);
+    }
+  })
+];
+
+/**
+ * @description 页面数据加载完成
+ */
+const funcAfterMound = async () => {
+  console.log("onMounted detail sale start!!!! :>> ");
+  if (!orderStatus.value) {
+    // 详情页
+    // gotoSummy(8000);
+  } else {
+    // 新增/编辑
+    tableProps_mx.value.editConfig.enabled = true;
+  }
+
+  console.log("onMounted detail sale start LjDetailRef.value.mainData :>> ", LjDetailRef.value);
+
+  if (orderStatus.value != "new") {
+  }
+};
+
+onMounted(async () => {
+  console.log("route onMounted:>> ", route);
+  console.log("route onMounted:>> ", route.params);
+  console.log("route onMounted:>> ", route.params.id);
+
+  if (route.query?.id) {
+    // 刷新数据
+    initParams.value.mattressid = Number(route.query?.id);
+    editType.value = Number(route.query?.type);
+    console.log("detail onMounted initParams.value :>> ", initParams.value);
+
+    RetriveMattressInterface(initParams.value.mattressid.valueOf());
+  }
+});
+</script>

+ 600 - 0
JLHWEB/src/views/quote/mattressInterface/hooks/index.tsx

@@ -0,0 +1,600 @@
+import { ref, reactive, computed, toRefs } from "vue";
+import { Table } from "@/hooks/interface";
+import { ColumnProps } from "@/components/LjVxeTable/interface";
+import { ALLOW_EDIT_STATE } from "@/config/index";
+import { GetMattressInterfaceList, RefreshMattressInterface, RefreshMattressInterfaceQd } from "@/api/modules/quote";
+import { ElMessage, ElMessageBox } from "element-plus";
+import { CommonDynamicSelect, GetERPMtrldefList } from "@/api/modules/common";
+import { useHooks as useHooks_mtrltype } from "@/views/baseinfo/mtrltype/hooks/index";
+import { number } from "echarts";
+const { gMtrltypeList } = useHooks_mtrltype();
+interface defaultState {
+  /**
+   * @description 单据当前状态
+   */
+  orderStatus: string;
+  /**
+   * @description 列表Ref
+   */
+  VxeTableRef: any;
+  /**
+   * @description 详情页Ref
+   */
+  LjDetailRef: any;
+  mainData: any;
+  mattressYWList: any[];
+  mattressQDList: any[];
+  editType: number;
+}
+
+const state = reactive<defaultState>({
+  orderStatus: "",
+  VxeTableRef: null,
+  LjDetailRef: null,
+  mainData: {},
+  mattressYWList: [],
+  mattressQDList: [],
+  editType: 0
+});
+/**
+ * @description 表格多选数据操作
+ * @param {String} rowKey 当表格可以多选时,所指定的 id
+ * */
+export const useHooks = (t?: any) => {
+  // 表格配置项
+  const columns: ColumnProps<any>[] = [
+    { type: "checkbox", width: 80, fixed: "left" },
+    { title: "#", field: "pid", fixed: "left", width: 80 },
+    {
+      field: "yw_flag",
+      title: "业务审核"
+    },
+    {
+      field: "js1_flag",
+      title: "产品补充审核"
+    },
+    {
+      field: "js2_flag",
+      title: "清单补充审核"
+    },
+    {
+      field: "creatmtrl_flag",
+      title: "生成L1产品"
+    },
+    {
+      field: "creatmtrlqd_flag",
+      title: "生成L1清单"
+    },
+    {
+      field: "erp_mtrlcode",
+      title: "L1物料编码"
+    },
+    {
+      field: "deptid",
+      title: "部门",
+      search: {
+        el: "select",
+        key: "arg_deptid",
+        props: {
+          filterable: true
+        },
+        order: 1
+      }
+    },
+    {
+      field: "mattresscode",
+      title: "报价唯一码"
+    },
+    {
+      field: "mattressrelcode",
+      title: "床垫编码"
+    },
+    {
+      field: "mattressname",
+      title: "床垫名称"
+    },
+    {
+      field: "mattresstypeid",
+      title: "床垫类别"
+    },
+    {
+      field: "mattress_width",
+      title: "床垫宽/CM"
+    },
+    {
+      field: "mattress_length",
+      title: "床垫长/CM"
+    },
+    {
+      field: "mattress_height",
+      title: "床垫高/CM"
+    },
+    {
+      field: "createby",
+      title: "登记人"
+    },
+    {
+      field: "createtime",
+      title: "登记时间"
+    },
+    {
+      field: "yw_auditingrep",
+      title: "业务审核人"
+    },
+    {
+      field: "yw_auditingdate",
+      title: "业务审核时间"
+    },
+    {
+      field: "js1_auditingrep",
+      title: "产品补充审核人"
+    },
+    {
+      field: "js1_auditingdate",
+      title: "产品补充审核时间"
+    },
+    {
+      field: "js2_auditingrep",
+      title: "清单补充审核人"
+    },
+    {
+      field: "js2_auditingdate",
+      title: "清单补充审核时间"
+    },
+    {
+      field: "creatmtrl_auditingrep",
+      title: "生成L1产品人"
+    },
+    {
+      field: "creatmtrl_auditingdate",
+      title: "生成L1产品时间"
+    },
+    {
+      field: "creatmtrlqd_auditingrep",
+      title: "生成L1清单人"
+    },
+    {
+      field: "creatmtrlqd_auditingdate",
+      title: "生成L1清单时间"
+    },
+    {
+      field: "dijia_cost",
+      title: "底价"
+    },
+    {
+      field: "yongjin",
+      title: "佣金"
+    },
+    {
+      field: "taxrate",
+      title: "税率"
+    },
+    {
+      field: "fob",
+      title: "FOB"
+    },
+    {
+      field: "taxes",
+      title: "税金"
+    },
+    {
+      field: "erp_mtrlengname",
+      title: "原物料编码"
+    },
+    {
+      field: "erp_configcodetype",
+      title: "ERP配置类型"
+    }
+  ];
+
+  const columns_detail: ColumnProps<any>[] = [
+    {
+      field: "erp_mtrlcode",
+      title: "新物料编码",
+      basicinfo: {
+        el: "input",
+        editable: () => {
+          return false;
+        },
+        group: "单据信息",
+        order: 1,
+        span: 1
+      }
+    },
+    {
+      field: "erp_mtrlname",
+      title: "新物料名称",
+      basicinfo: {
+        el: "input",
+        editable: () => {
+          return false;
+        },
+        group: "单据信息",
+        order: 4,
+        span: 1
+      }
+    },
+    {
+      field: "erp_mtrlmode",
+      title: "新物料规格",
+      basicinfo: {
+        el: "input",
+        editable: ALLOW_EDIT_STATE,
+        group: "单据信息",
+        order: 2,
+        span: 1
+      }
+    },
+    {
+      field: "erp_mtrlunit",
+      title: "物料单位",
+      basicinfo: {
+        el: "input",
+        editable: ALLOW_EDIT_STATE,
+        group: "单据信息",
+        order: 5,
+        span: 1
+      }
+    },
+    {
+      field: "erp_mtrltype",
+      title: "物料类别",
+      basicinfo: {
+        el: "tree-select",
+        editable: ALLOW_EDIT_STATE,
+        group: "单据信息",
+        order: 3,
+        span: 1
+      },
+      enum: gMtrltypeList,
+      fieldNames: {
+        label: "mtrltype",
+        value: "mtrltypeid",
+        children: "children"
+      }
+    },
+    {
+      field: "erp_configcodetype",
+      title: "配置类型",
+      basicinfo: {
+        el: "input",
+        editable: ALLOW_EDIT_STATE,
+        group: "单据信息",
+        order: 6,
+        span: 1
+      }
+    },
+    {
+      field: "mattresscode",
+      title: "图号(床垫唯一码)",
+      basicinfo: {
+        el: "input",
+        editable: () => {
+          return false;
+        },
+        group: "单据信息",
+        order: 8,
+        span: 1
+      }
+    },
+    {
+      field: "erp_mtrlengname",
+      title: "英文名称",
+      basicinfo: {
+        el: "input",
+        editable: ALLOW_EDIT_STATE,
+        group: "单据信息",
+        order: 7,
+        span: 1
+      }
+    },
+    {
+      field: "old_mtrlname",
+      title: "旧物料名称",
+      basicinfo: {
+        el: "input",
+        editable: ALLOW_EDIT_STATE,
+        group: "单据信息",
+        order: 9,
+        span: 1
+      }
+    }
+  ];
+
+  const columns_yw: ColumnProps<any>[] = [
+    {
+      field: "printid",
+      title: "排序",
+      width: 80
+    },
+    {
+      field: "itemname",
+      title: "项目"
+    },
+    {
+      field: "bj_pzname",
+      title: "核价_配置名称"
+    },
+    {
+      field: "erp_pzcode",
+      title: "ERP配置编码"
+    },
+    {
+      field: "erp_pzname",
+      title: "ERP配置名称"
+    },
+    {
+      field: "bj_inputtype",
+      title: "录入类型",
+      enum: [
+        {
+          value: "0",
+          label: "选择"
+        },
+        {
+          value: "1",
+          label: "录入"
+        },
+        {
+          value: "2",
+          label: "带出"
+        }
+      ],
+      editRender: {
+        name: "$select"
+      }
+    },
+    {
+      field: "bj_namemx",
+      title: "明细名称",
+      editRender: {
+        name: "$input"
+      }
+    },
+    {
+      field: "actual_size",
+      title: "生产尺寸",
+      limited: () => {
+        return state.editType == 1;
+      },
+      editRender: {
+        name: "$input"
+      }
+    },
+    {
+      field: "sb_craft",
+      title: "锁边工艺",
+      limited: () => {
+        return state.editType == 1;
+      },
+      editRender: {
+        name: "$input"
+      }
+    },
+    {
+      field: "actual_size_sb",
+      title: "锁边后尺寸",
+      limited: () => {
+        return state.editType == 1;
+      },
+      editRender: {
+        name: "$input"
+      }
+    },
+    {
+      field: "ss_rate",
+      title: "收缩率",
+      limited: () => {
+        return state.editType == 1;
+      },
+      datatype: "number",
+      editRender: {
+        name: "$input"
+      }
+    },
+    {
+      field: "ls_rate",
+      title: "拉伸率",
+      limited: () => {
+        return state.editType == 1;
+      },
+      datatype: "number",
+      editRender: {
+        name: "$input"
+      }
+    }
+  ];
+
+  const columns_qd: ColumnProps<any>[] = [
+    {
+      field: "printid",
+      title: "排序",
+      width: 80
+    },
+    {
+      field: "itemname",
+      title: "项目"
+    },
+    {
+      field: "bj_pzname",
+      title: "二级项目"
+    },
+    {
+      field: "bj_pzname_mx",
+      title: "明细项目"
+    },
+    {
+      field: "bj_pzname_mx_mx",
+      title: "二级明细项目"
+    },
+    {
+      field: "erp_mtrlcode",
+      title: "L1物料编码",
+      limited: () => {
+        return state.editType == 1 || state.editType == 2;
+      },
+      editRender: {
+        name: "$input"
+      }
+    },
+    {
+      field: "mtrlengname",
+      title: "自定义2",
+      editRender: {
+        name: "$input"
+      }
+    },
+    {
+      field: "erp_mtrlname",
+      title: "L1物料名称",
+      limited: () => {
+        return state.editType == 1 || state.editType == 2;
+      }
+    },
+    {
+      field: "erp_mtrlmode",
+      title: "L1物料规格",
+      limited: () => {
+        return state.editType == 1 || state.editType == 2;
+      }
+    },
+    {
+      field: "erp_unit",
+      title: "L1物料单位",
+      limited: () => {
+        return state.editType == 1 || state.editType == 2;
+      }
+    },
+    {
+      field: "useqty",
+      title: "参考用料量",
+      datatype: "number",
+      limited: () => {
+        return state.editType == 1 || state.editType == 2;
+      }
+    },
+    {
+      field: "actual_useqty",
+      title: "实际用量",
+      datatype: "number",
+      editRender: {
+        name: "$input"
+      },
+      limited: () => {
+        return state.editType == 1 || state.editType == 2;
+      }
+    },
+    {
+      field: "wrkgrpid",
+      title: "领用工组",
+      editRender: {
+        name: "$input"
+      }
+    },
+    {
+      field: "qd_actual_size",
+      title: "实际尺寸",
+      editRender: {
+        name: "$input"
+      }
+    },
+    {
+      field: "qd_pfgroupqty",
+      title: "条数",
+      editRender: {
+        name: "$input"
+      }
+    },
+    {
+      field: "dscrp",
+      title: "备注",
+      editRender: {
+        name: "$input"
+      }
+    },
+    {
+      field: "ss_rate",
+      title: "收缩率",
+      datatype: "number",
+      editRender: {
+        name: "$input"
+      }
+    },
+    {
+      field: "ls_rate",
+      title: "拉伸率",
+      datatype: "number",
+      editRender: {
+        name: "$input"
+      }
+    },
+    {
+      field: "sh_rate",
+      title: "损耗率",
+      datatype: "number",
+      editRender: {
+        name: "$input"
+      }
+    }
+  ];
+
+  /**
+   * 获取产品配置,产品清单
+   * @param mattressid 床垫ID
+   */
+  const RetriveMattressInterface = async (mattressid: number) => {
+    let res = await GetMattressInterfaceList({ mattressid });
+    state.mainData = res.mattress;
+    state.mattressYWList = res.interfaceList;
+    state.mattressQDList = res.qdList;
+  };
+  /**
+   * 获取产品配置,产品清单
+   * @param mattressid 床垫ID
+   */
+  const RefreshMattressInterfaceList = async (mattressid: number, isPz: number) => {
+    let res = await RefreshMattressInterface({ mattressid, isPz });
+    state.mattressYWList = res.mxList;
+  };
+  /**
+   * 获取产品配置,产品清单
+   * @param mattressid 床垫ID
+   */
+  const RefreshMattressInterfaceQdList = async (mattressid: number, isPz: number) => {
+    let res = await RefreshMattressInterfaceQd({ mattressid, isPz });
+
+    const interfaceMap = {};
+    state.mattressYWList.forEach(mb => {
+      interfaceMap[mb.bj_pzname] = mb;
+    });
+
+    // 遍历 qdList 并使用哈希表来查找和赋值
+    res.mxList.forEach(mx => {
+      const mb = interfaceMap[mx.bj_pzname];
+      if (mb) {
+        mx.bj_pzname_mx_mx = mb.bj_namemx;
+
+        if (mx.ss_rate === 0) {
+          mx.ss_rate = mb.ss_rate;
+        }
+
+        if (mx.ls_rate === 0) {
+          mx.ls_rate = mb.ls_rate;
+        }
+      }
+    });
+
+    state.mattressQDList = res.mxList;
+  };
+
+  return {
+    ...toRefs(state),
+    columns,
+    columns_detail,
+    columns_yw,
+    columns_qd,
+    RetriveMattressInterface,
+    RefreshMattressInterfaceList,
+    RefreshMattressInterfaceQdList
+  };
+};

+ 334 - 0
JLHWEB/src/views/quote/mattressInterface/index.vue

@@ -0,0 +1,334 @@
+<template>
+  <div class="table-box">
+    <LjVxeTable
+      ref="vxeTableRef"
+      row-key="mattressid"
+      :columns="columns"
+      :init-param="initParams"
+      :request-api="getData"
+      :data-callback="dataCallback"
+      :dwname="DwnameEnum.mattressQuote"
+      :table-props="tableProps"
+      :table-events="tableEvents"
+      :auto-load-layout="false"
+      :search-btn-size-extent="[]"
+      pagination
+    >
+      <!-- 表格 header 按钮 -->
+      <template #tableHeader>
+        <LjHeaderMenu :update="dialogVisible" :action="action" />
+      </template>
+    </LjVxeTable>
+  </div>
+</template>
+
+<script setup lang="ts" name="mattressQuote">
+import { ref, onMounted, inject } from "vue";
+import { useRouter } from "vue-router";
+import { MattressYWAudit, MattressJSAudit, MattressJS2Audit } from "@/api/modules/quote";
+import { CommonDynamicSelect } from "@/api/modules/common";
+import { ColumnProps } from "@/components/LjVxeTable/interface";
+import LjDrawer from "@/components/LjDrawer/index.vue";
+import { useHooks } from "./hooks/index";
+import LjDialog from "@/components/LjDialog/index.vue";
+import LjHeaderMenu from "@/components/LjHeaderMenu/index.vue";
+import { useI18n } from "vue-i18n";
+import { useAuthButtons } from "@/hooks/useAuthButtons";
+import { DwnameEnum } from "@/enums/dwnameEnum";
+import { formatToDateTime, formatToDate } from "@/utils/dateUtil";
+import { cloneDeep } from "lodash-es";
+import { useGlobalStore } from "@/stores/modules/global";
+import { ElMessage, ElMessageBox } from "element-plus";
+import { detailAction } from "@/components/LjDetail/interface";
+import mittBus from "@/utils/mittBus";
+import { MittEnum } from "@/enums/mittEnum";
+import { getCurrentRecords } from "@/utils/index";
+
+const { t } = useI18n();
+const router = useRouter();
+const globalStore = useGlobalStore();
+const { columns } = useHooks();
+// const { toExcelQuote } = useHooksCpQuote();
+const { CheckPower, CheckOption, buttonNew, buttonDefault } = useAuthButtons(t);
+
+const initParams = ref({});
+const dialogVisible = ref(false);
+const vxeTableRef = ref();
+const enumMap = ref(new Map());
+
+const getData = (params: any) => {
+  console.log("getData mattress params :>> ", params);
+  let newParams: any = {};
+  params.pageNum && (newParams.pageindex = params.pageNum);
+  params.pageSize && (newParams.pagesize = params.pageSize);
+  params.orderstr && (newParams.orderstr = params.orderstr);
+  delete params.pageNum;
+  delete params.pageSize;
+  delete params.orderstr;
+  let _params = cloneDeep(params);
+  newParams.queryParams = _params;
+  newParams.dsname = "web_mattress_interfacelist";
+
+  return CommonDynamicSelect(newParams, DwnameEnum.mattressInterface);
+};
+
+const handleDBlClickTable = ({ row, rowIndex, $rowIndex, column, columnIndex, $columnIndex, $event }: any) => {
+  if (globalStore.detailBlank) {
+    // 打开新的窗口
+    const routeUrl = router.resolve({
+      path: `/mattressInterface/detail`,
+      query: {
+        id: row.mattressid,
+        code: row.mattresscode
+      }
+    });
+    window.open(routeUrl.href, "_blank");
+  } else {
+    // 打开新的标签页
+    router.push(`/mattressInterface/detail?id=${row.mattressid}&code=${row.mattresscode}`);
+  }
+};
+
+const rowClsNameFunc = (data: any) => {
+  const { row, rowIndex, $rowIndex } = data;
+  if (Number(row.flag) == 0) {
+    if (Number(row.xd_flag) == 0) {
+      return "vxecol-danger";
+    }
+    if (Number(row.xd_flag) == 1) {
+      return "vxecol-blue";
+    }
+  }
+  return "";
+};
+const tableProps = {
+  height: "auto",
+  editConfig: { trigger: "click", mode: "cell" },
+  rowClassName: rowClsNameFunc,
+  exportConfig: {
+    filename: t("menu.rpMsttake") + formatToDate(new Date(), "YYYY-MM-DD HH:mm:ss")
+  }
+};
+
+// 返回绑定的事件
+const tableEvents = {
+  // "checkbox-change": handleCheckboxChange,
+  // "checkbox-all": handleCheckboxChange,
+  // "checkbox-range-change": handleCheckboxChange,
+  // "current-change": handleCurrentChanged
+  "cell-dblclick": handleDBlClickTable
+  // "cell-click": handleClickTable
+};
+
+/**
+ * @description 按钮展示
+ */
+const action: detailAction[] = [
+  buttonDefault({
+    label: "业务补充",
+    power: 79,
+    clickFunc: item => {
+      routeToEdit(1);
+    }
+  }),
+  buttonDefault({
+    label: "业务审核",
+    power: 80,
+    clickFunc: item => {
+      YWAudit(1);
+    }
+  }),
+  buttonDefault({
+    label: "业务撤审",
+    power: 81,
+    clickFunc: item => {
+      YWAudit(0);
+    }
+  }),
+  buttonDefault({
+    label: "产品补充",
+    power: 82,
+    clickFunc: item => {
+      routeToEdit(2);
+    }
+  }),
+  buttonDefault({
+    label: "产品补充审核",
+    power: 83,
+    clickFunc: item => {
+      JSAudit(1);
+    }
+  }),
+  buttonDefault({
+    label: "产品补充撤审",
+    power: 84,
+    clickFunc: item => {
+      JSAudit(0);
+    }
+  }),
+  buttonDefault({
+    label: "清单补充",
+    power: 85,
+    clickFunc: item => {
+      routeToEdit(3);
+    }
+  }),
+  buttonDefault({
+    label: "清单补充审核",
+    power: 86,
+    clickFunc: item => {
+      JS2Audit(1);
+    }
+  }),
+  buttonDefault({
+    label: "清单补充撤审",
+    power: 87,
+    clickFunc: item => {
+      JS2Audit(0);
+    }
+  })
+];
+
+const dataCallback = (data: any) => {
+  if (data.tableinfo?.columns) {
+    data.tableinfo?.columns.map((item: any) => {
+      if (item?.enum) {
+        enumMap.value.set(item.field, item.enum);
+      }
+    });
+  }
+  return {
+    list: data.datatable,
+    tableinfo: data.tableinfo,
+    total: data.totalcnt,
+    pageNum: data.pageindex,
+    pageSize: data.pagesize
+  };
+};
+
+const YWAudit = type => {
+  const { curRecords } = getCurrentRecords(vxeTableRef.value);
+
+  console.log("curRecords :>> ", curRecords);
+  if (!curRecords.length) {
+    ElMessage.warning(t("business.tips.mattress.records"));
+    return;
+  }
+
+  let list = curRecords.map((item: any) => {
+    return {
+      mattressid: Number(item.mattressid)
+    };
+  });
+  ElMessageBox.confirm(`是否确定要${type ? "审核" : "撤审"}${curRecords.length}张床垫报价单吗?`, "询问", {
+    confirmButtonText: t("common.okText"),
+    cancelButtonText: "否",
+    type: "warning"
+  })
+    .then(() => {
+      MattressYWAudit({ list, type }).then(() => {
+        ElMessage.success(`业务${type ? "审核" : "撤审"}成功!`);
+        vxeTableRef.value.refresh();
+      });
+    })
+    .catch((e: TypeError) => {
+      console.log("e :>> ", e);
+      ElMessage({
+        type: "info",
+        message: "操作取消"
+      });
+    });
+};
+
+const JSAudit = type => {
+  const { curRecords } = getCurrentRecords(vxeTableRef.value);
+
+  console.log("curRecords :>> ", curRecords);
+  if (!curRecords.length) {
+    ElMessage.warning(t("business.tips.mattress.records"));
+    return;
+  }
+
+  let list = curRecords.map((item: any) => {
+    return {
+      mattressid: Number(item.mattressid)
+    };
+  });
+  ElMessageBox.confirm(`是否确定要${type ? "审核" : "撤审"}${curRecords.length}张床垫报价单吗?`, "询问", {
+    confirmButtonText: t("common.okText"),
+    cancelButtonText: "否",
+    type: "warning"
+  })
+    .then(() => {
+      MattressJSAudit({ list, type }).then(() => {
+        ElMessage.success(`产品补充${type ? "审核" : "撤审"}成功!`);
+        vxeTableRef.value.refresh();
+      });
+    })
+    .catch((e: TypeError) => {
+      console.log("e :>> ", e);
+      ElMessage({
+        type: "info",
+        message: "操作取消"
+      });
+    });
+};
+
+const JS2Audit = type => {
+  const { curRecords } = getCurrentRecords(vxeTableRef.value);
+
+  console.log("curRecords :>> ", curRecords);
+  if (!curRecords.length) {
+    ElMessage.warning(t("business.tips.mattress.records"));
+    return;
+  }
+
+  let list = curRecords.map((item: any) => {
+    return {
+      mattressid: Number(item.mattressid)
+    };
+  });
+  ElMessageBox.confirm(`是否确定要${type ? "审核" : "撤审"}${curRecords.length}张床垫报价单吗?`, "询问", {
+    confirmButtonText: t("common.okText"),
+    cancelButtonText: "否",
+    type: "warning"
+  })
+    .then(() => {
+      MattressJS2Audit({ list, type }).then(() => {
+        ElMessage.success(`清单补充${type ? "审核" : "撤审"}成功!`);
+        vxeTableRef.value.refresh();
+      });
+    })
+    .catch((e: TypeError) => {
+      console.log("e :>> ", e);
+      ElMessage({
+        type: "info",
+        message: "操作取消"
+      });
+    });
+};
+
+const routeToEdit = type => {
+  const { $table, curRecords } = getCurrentRecords(vxeTableRef.value);
+
+  if (!curRecords.length) {
+    ElMessage.warning(t("business.tips.mattress.records"));
+    return;
+  }
+
+  const _cur = $table.getCurrentRecord() ?? null;
+  if (_cur) {
+    router.push(`/mattressInterface/${type}/edit?id=${_cur.mattressid}&code=${_cur.mattresscode}&type=${type}`);
+  } else {
+    const _cur = curRecords[curRecords.length - 1];
+    router.push(`/mattressInterface/${type}/edit?id=${_cur.mattressid}&code=${_cur.mattresscode}&type=${type}`);
+  }
+};
+
+/**
+ * @description 监听框架属性变化
+ */
+mittBus.on(MittEnum.MattressList, () => {
+  vxeTableRef.value.refresh();
+});
+</script>