瀏覽代碼

获取额外费用和特殊工艺枚举

chen_yjin 1 月之前
父節點
當前提交
fdede43cf0

+ 3 - 1
JLHHJSvr/Com/GetMattressImportDW2.cs

@@ -35,6 +35,8 @@ namespace JLHHJSvr.Com
         /// </summary>
         public List<u_mattress_mx_mtrl> mattressMx { get; set; }
         public List<replacement> diancengarea { get; set; }
-        public List<u_mattress_mx_extra> extraMx { get; set; }
+        public List<u_mattress_mx_extra> extraProcessesMx { get; set; }
+        public List<u_mattress_mx_extra> extraCostsMx { get; set; }
+        public List<u_mattress_extra> extraEnum { get; set; }
     }
 }

+ 4 - 0
JLHHJSvr/Com/Model/u_mattress_mx_extra.cs

@@ -33,6 +33,10 @@ namespace JLHHJSvr.Com.Model
         /// 备注
         /// </summary>
         public string dscrp { get; set; }
+        /// <summary>
+        /// 项目类型id
+        /// </summary>
+        public int? typeid { get; set; }
 
     }
 }

+ 73 - 73
JLHHJSvr/DataStore/_Mapper_formulakind.xml

@@ -4,295 +4,295 @@
 		[
 			{
 				"label": "面裥绵-布料",
-				"value": "0"
+				"value": 0
 			},
 			{
 				"label": "面裥绵-布料-加工工艺",
-				"value": "80"
+				"value": 80
 			},
 			{
 				"label": "面裥绵-喷胶绵",
-				"value": "40"
+				"value": 40
 			},
 			{
 				"label": "面裥绵-裥绵海绵",
-				"value": "50"
+				"value": 50
 			},
 			{
 				"label": "面裥绵-无纺布",
-				"value": "60"
+				"value": 60
 			},
 			{
 				"label": "面裥绵-裥花图案",
-				"value": "70"
+				"value": 70
 			},
 			{
 				"label": "底裥绵-布料",
-				"value": "1"
+				"value": 1
 			},
 			{
 				"label": "底裥绵-布料-加工工艺",
-				"value": "81"
+				"value": 81
 			},
 			{
 				"label": "底裥绵-喷胶绵",
-				"value": "41"
+				"value": 41
 			},
 			{
 				"label": "底裥绵-裥绵海绵",
-				"value": "51"
+				"value": 51
 			},
 			{
 				"label": "底裥绵-无纺布",
-				"value": "61"
+				"value": 61
 			},
 			{
 				"label": "底裥绵-裥花图案",
-				"value": "71"
+				"value": 71
 			},
 			{
 				"label": "大侧裥绵-布料",
-				"value": "2"
+				"value": 2
 			},
 			{
 				"label": "大侧裥绵-布料-加工工艺",
-				"value": "82"
+				"value": 82
 			},
 			{
 				"label": "大侧裥绵-喷胶绵",
-				"value": "42"
+				"value": 42
 			},
 			{
 				"label": "大侧裥绵-裥绵海绵",
-				"value": "52"
+				"value": 52
 			},
 			{
 				"label": "大侧裥绵-无纺布",
-				"value": "62"
+				"value": 62
 			},
 			{
 				"label": "大侧裥绵-裥花图案",
-				"value": "72"
+				"value": 72
 			},
 			{
 				"label": "小侧裥绵-布料",
-				"value": "3"
+				"value": 3
 			},
 			{
 				"label": "小侧裥绵-布料-加工工艺",
-				"value": "83"
+				"value": 83
 			},
 			{
 				"label": "小侧裥绵-喷胶绵",
-				"value": "43"
+				"value": 43
 			},
 			{
 				"label": "小侧裥绵-裥绵海绵",
-				"value": "53"
+				"value": 53
 			},
 			{
 				"label": "小侧裥绵-无纺布",
-				"value": "63"
+				"value": 63
 			},
 			{
 				"label": "小侧裥绵-裥花图案",
-				"value": "73"
+				"value": 73
 			},
 			{
 				"label": "V侧裥绵-布料",
-				"value": "4"
+				"value": 4
 			},
 			{
 				"label": "V侧裥绵-布料-加工工艺",
-				"value": "84"
+				"value": 84
 			},
 			{
 				"label": "V侧裥绵-喷胶绵",
-				"value": "44"
+				"value": 44
 			},
 			{
 				"label": "V侧裥绵-裥绵海绵",
-				"value": "54"
+				"value": 54
 			},
 			{
 				"label": "V侧裥绵-无纺布",
-				"value": "64"
+				"value": 64
 			},
 			{
 				"label": "V侧裥绵-裥花图案",
-				"value": "74"
+				"value": 74
 			},
 			{
 				"label": "拉手",
-				"value": "5"
+				"value": 5
 			},
 			{
 				"label": "刺绣",
-				"value": "6"
+				"value": 6
 			},
 			{
 				"label": "大侧压压布",
-				"value": "7"
+				"value": 7
 			},
 			{
 				"label": "大侧压边带",
-				"value": "8"
+				"value": 8
 			},
 			{
 				"label": "大侧压织带",
-				"value": "9"
+				"value": 9
 			},
 			{
 				"label": "大侧压上下压线",
-				"value": "10"
+				"value": 10
 			},
 			{
 				"label": "顶垫层",
-				"value": "11"
+				"value": 11
 			},
 			{
 				"label": "顶布",
-				"value": "12"
+				"value": 12
 			},
 			{
 				"label": "顶布裥棉",
-				"value": "1201"
+				"value": 1201
 			},
 			{
 				"label": "垫层",
-				"value": "32"
+				"value": 32
 			},
 			{
 				"label": "底垫层",
-				"value": "33"
+				"value": 33
 			},
 			{
 				"label": "毡类",
-				"value": "13"
+				"value": 13
 			},
 			{
 				"label": "打底无纺布",
-				"value": "14"
+				"value": 14
 			},
 			{
 				"label": "辅料",
-				"value": "15"
+				"value": 15
 			},
 			{
 				"label": "PE",
-				"value": "16"
+				"value": 16
 			},
 			{
 				"label": "外层PE",
-				"value": "17"
+				"value": 17
 			},
 			{
 				"label": "PVC",
-				"value": "18"
+				"value": 18
 			},
 			{
 				"label": "卷包包装",
-				"value": "19"
+				"value": 19
 			},
 			{
 				"label": "牛皮纸袋",
-				"value": "20"
+				"value": 20
 			},
 			{
 				"label": "蓝色PE护角",
-				"value": "21"
+				"value": 21
 			},
 			{
 				"label": "无纺布袋",
-				"value": "22"
+				"value": 22
 			},
 			{
 				"label": "牛皮袋护角",
-				"value": "23"
+				"value": 23
 			},
 			{
 				"label": "编织袋",
-				"value": "24"
+				"value": 24
 			},
 			{
 				"label": "外袋",
-				"value": "25"
+				"value": 25
 			},
 			{
 				"label": "内袋",
-				"value": "26"
+				"value": 26
 			},
 			{
 				"label": "拉手脚轮",
-				"value": "27"
+				"value": 27
 			},
 			{
 				"label": "拉钮",
-				"value": "28"
+				"value": 28
 			},
 			{
 				"label": "网面布料",
-				"value": "29"
+				"value": 29
 			},
 			{
 				"label": "防火线",
-				"value": "30"
+				"value": 30
 			},
 			{
 				"label": "木托",
-				"value": "31"
+				"value": 31
 			},
 			{
 				"label": "无纺布护角",
-				"value": "201"
+				"value": 201
 			},
 			{
 				"label": "拉链",
-				"value": "202"
+				"value": 202
 			},
 			{
 				"label": "内布套围边边带",
-				"value": "203"
+				"value": 203
 			},
 			{
 				"label": "席垫橡皮筋",
-				"value": "204"
+				"value": 204
 			},
 			{
 				"label": "车花边",
-				"value": "205"
+				"value": 205
 			},
 			{
 				"label": "床网",
-				"value": "99"
+				"value": 99
 			},
 			{
 				"label": "床网_",
-				"value": "999"
+				"value": 999
 			},
 			{
 				"label": "半成品裥面",
-				"value": "9000"
+				"value": 9000
 			},
 			{
 				"label": "半成品裥底",
-				"value": "9001"
+				"value": 9001
 			},
 			{
 				"label": "半成品裥大侧",
-				"value": "9002"
+				"value": 9002
 			},
 			{
 				"label": "半成品裥小侧",
-				"value": "9003"
+				"value": 9003
 			},
 			{
 				"label": "半成品裥V侧",
-				"value": "9004"
+				"value": 9004
 			},
 			{
 				"label": "半成品裥床网",
-				"value": "9005"
+				"value": 9005
 			}
 		]
 	</json>

+ 47 - 6
JLHHJSvr/Excutor/GetMattressImportDW2Excutor.cs

@@ -49,6 +49,8 @@ namespace JLHHJSvr.Excutor
                         }
                         else
                         {
+                            // 床垫报价修改时,获取相关数据
+
                             var matterss = new u_mattress() { mattressid = request.mattressid };
                             DbSqlHelper.SelectOne(cmd, matterss, "mattresstypeid");
 
@@ -60,6 +62,28 @@ namespace JLHHJSvr.Excutor
                             {
                                 rslt.diancengarea = wf_add_dianceng_area_bytype(cmd, mattersstype.dianceng_area);
                             }
+
+                            var selectStr = @"
+                                SELECT
+			                        extraid
+			                        ,extratypename
+			                        ,extraname
+			                        ,typeid
+			                        ,price
+			                        ,dscrp
+			                        ,inuse
+			                        ,inputtype
+			                        ,ifinit
+		                        From u_mattress_extra";
+                            var outFields = "extraid,extratypename,extraname,typeid,price,dscrp,inuse,inputtype,ifinit";
+                            var whereList = new List<string>();
+                            whereList.Add("u_mattress_extra.inuse = 0");
+                            var param = new Dictionary<string, object>();
+
+                            var mattressExtra = new List<u_mattress_extra>();
+                            DbSqlHelper.SelectJoin(cmd, selectStr, ListEx.GetWhereStr(whereList), param, "typeid, extraid", outFields, 0, 0, mattressExtra);
+
+                            rslt.extraEnum = mattressExtra;
                         }
                     }
                     else
@@ -269,15 +293,31 @@ namespace JLHHJSvr.Excutor
 		                        From u_mattress_extra";
                         outFields = "extraid,extratypename,extraname,typeid,price,dscrp,inuse,inputtype,ifinit";
                         whereList = new List<string>();
-                        whereList.Add("u_mattress_extra.ifinit = 1");
+                        whereList.Add("u_mattress_extra.inuse = 0");
                         param = new Dictionary<string, object>();
 
-                        //   导入 0-通用类型  的公式
                         var mattressExtra = new List<u_mattress_extra>();
                         DbSqlHelper.SelectJoin(cmd, selectStr, ListEx.GetWhereStr(whereList), param, "typeid, extraid", outFields, 0, 0, mattressExtra);
 
-                        rslt.extraMx = new List<u_mattress_mx_extra>();
-                        foreach (var mx in mattressExtra)
+                        rslt.extraEnum = mattressExtra;
+                        rslt.extraProcessesMx = new List<u_mattress_mx_extra>();
+                        var processesMx = mattressExtra.Where(item => item.ifinit == 1 && item.typeid == 1).ToArray();
+                        var costsMx = mattressExtra.Where(item => item.ifinit == 1 && item.typeid == 2).ToArray();
+                        foreach (var mx in processesMx)
+                        {
+                            u_mattress_mx_extra mxItem = new u_mattress_mx_extra
+                            {
+                                mattressid = 0,
+                                mattressmxid = 0,
+                                extraid = mx.extraid,
+                                extraname = mx.extraname,
+                                dscrp = mx.dscrp,
+                                price = mx.price,
+                                typeid = mx.typeid
+                            };
+                            rslt.extraProcessesMx.Add(mxItem);
+                        }
+                        foreach (var mx in costsMx)
                         {
                             u_mattress_mx_extra mxItem = new u_mattress_mx_extra
                             {
@@ -286,9 +326,10 @@ namespace JLHHJSvr.Excutor
                                 extraid = mx.extraid,
                                 extraname = mx.extraname,
                                 dscrp = mx.dscrp,
-                                price = mx.price
+                                price = mx.price,
+                                typeid = mx.typeid
                             };
-                            rslt.extraMx.Add(mxItem);
+                            rslt.extraCostsMx.Add(mxItem);
                         }
                         #endregion
                     }