瀏覽代碼

核价后台更新:1、床垫报价保存时,新增记录不含税出厂价、部门含税价的四个大小单金额;
2、修改导入价格表的匹配字段

chen_yjin 1 天之前
父節點
當前提交
69ff5094c2

+ 32 - 0
JLHHJSvr/Com/Model/u_mattress.cs

@@ -174,6 +174,22 @@ namespace JLHHJSvr.Com.Model
         public int? mtrltypeid { get; set; }
         public string bj_mxdscrp { get; set; }
         public decimal? dijia_cost { get; set; }
+        /// <summary>
+        /// 1:散单底价-不含税出厂价
+        /// </summary>
+        public decimal? dijia_cost1 { get; set; }
+        /// <summary>
+        /// 2:标准底价-不含税出厂价
+        /// </summary>
+        public decimal? dijia_cost2 { get; set; }
+        /// <summary>
+        /// 3:大单底价-不含税出厂价
+        /// </summary>
+        public decimal? dijia_cost3 { get; set; }
+        /// <summary>
+        /// 4:小单底价-不含税出厂价
+        /// </summary>
+        public decimal? dijia_cost4 { get; set; }
         public string configcode { get; set; }
         public string configname { get; set; }
         public string model { get; set; }
@@ -181,6 +197,22 @@ namespace JLHHJSvr.Com.Model
         /// 大小单类型,1:散单,2:标准,3:大单,4:小单
         /// </summary>
         public int? dannum_type { get; set; }
+        /// <summary>
+        /// 1:散单报价-部门含税价
+        /// </summary>
+        public decimal? dannum_cost1 { get; set; }
+        /// <summary>
+        /// 2:标准报价-部门含税价
+        /// </summary>
+        public decimal? dannum_cost2 { get; set; }
+        /// <summary>
+        /// 3:大单报价-部门含税价
+        /// </summary>
+        public decimal? dannum_cost3 { get; set; }
+        /// <summary>
+        /// 4:小单报价-部门含税价
+        /// </summary>
+        public decimal? dannum_cost4 { get; set; }
         #endregion
     }
 }

+ 9 - 1
JLHHJSvr/DataStore/web_mattress.xml

@@ -82,7 +82,11 @@
 		diameter,
 		cubage,
 		parentid,
-		vv_mattress.child_count
+		vv_mattress.child_count,
+		 dannum_cost1,
+		 dannum_cost2,
+		 dannum_cost3,
+		 dannum_cost4
 
 		From u_mattress
 		LEFT JOIN (
@@ -152,6 +156,10 @@
 		<field field="nottax_dept_cost" datatype="number">部门不含税价</field>
 		<field field="taxes" datatype="number">税金</field>
 		<field field="dept_cost" datatype="number">部门含税价</field>
+		<field field="dannum_cost1" datatype="number">散单金额</field>
+		<field field="dannum_cost2" datatype="number">标准金额</field>
+		<field field="dannum_cost3" datatype="number">大单金额</field>
+		<field field="dannum_cost4" datatype="number">小单金额</field>
 		<field field="foreign_cost" datatype="number">外币价</field>
 		<field field="packtype">包装方式</field>
 		<field field="packqty" datatype="number">压包数量</field>

+ 8 - 15
JLHHJSvr/Excutor/ImportMtrlPriceByExcelExcutor.cs

@@ -81,7 +81,7 @@ namespace JLHHJSvr.Excutor
                 int k = 0;
                 foreach (ICell cell in headerRow.Cells)
                 {
-                    if(cell.ToString() == "类别" || cell.ToString() == "名称")
+                    if(cell.ToString() == "物料ID" || cell.ToString() == "名称")
                     {
                         headers.Add(new HeaderPropetry { name = cell.ToString(), colIndex = k});
                     }
@@ -128,36 +128,29 @@ namespace JLHHJSvr.Excutor
                             row = sheet.GetRow(rowIndex);
                             if (row == null) continue;
 
-                            var mtrltype = string.Empty;
+                            var mtrlid = 0;
                             var mtrlname = string.Empty;
                             foreach (var head in headers)
                             {
                                 ICell cell = row.GetCell(head.colIndex);
                                 if (cell == null || cell.ToString() == "") continue;
-                                if (head.name == "类别")
+                                if (head.name == "物料ID")
                                 {
-                                    mtrltype = cell.ToString();
+                                    mtrlid = Convert.ToInt32(GetCellValue(cell));
                                 }
                                 else if (head.name == "名称")
                                 {
                                     mtrlname = cell.ToString();
                                 }
                             }
-                            if (!string.IsNullOrEmpty(mtrltype) && !string.IsNullOrEmpty(mtrlname))
+                            if (mtrlid > 0)
                             {
 
-                                var mtrlid = 0;
-                                cmd.CommandText = @"Select isnull(u_mtrl_price.mtrlid,0) from u_mtrl_price 
-                            where u_mtrl_price.mtrltype = (select isnull(mtrltypeid,0) from u_mtrltype where mtrltype = @mtrltype)
-                            and u_mtrl_price.name = @mtrlname";
-                                cmd.Parameters.Clear();
-                                cmd.Parameters.AddWithValue("@mtrltype", mtrltype);
-                                cmd.Parameters.AddWithValue("@mtrlname", mtrlname);
-                                mtrlid = Convert.ToInt32(cmd.ExecuteScalar());
-                                if (mtrlid == 0)
+                                u_mtrl_price mtrlPrice = new u_mtrl_price { mtrlid = mtrlid };
+                                if (DbSqlHelper.SelectOne(cmd, mtrlPrice, "mtrlid") == 0)
                                 {
                                     //throw new Exception(string.Format("类别:{0},名称:{1}的物料类别或物料不存在",mtrltype,mtrlname));
-                                    rslt.messageList.Add(string.Format("第【{0}】行, 类别:【{1}】,名称:【{2}】", rowIndex, mtrltype, mtrlname));
+                                    rslt.messageList.Add(string.Format("第【{0}】行, mtrlid:【{1}】,名称:【{2}】", rowIndex + 1, mtrlid, mtrlname));
                                     continue;
                                 }
 

+ 142 - 0
JLHHJSvr/Excutor/SaveMattressExcutor.cs

@@ -289,9 +289,151 @@ namespace JLHHJSvr.Excutor
 
             List<string> message = new List<string>();
 
+            // 没有输入默认按标准计算
+            if (mattress.dannum_type == null || mattress.dannum_type == 0) mattress.dannum_type = 2;
+
+            // 作为记录不含税出厂价、部门含税价的各个大小单价格的载体
+            var _mattressMain = ObjectHelper.DeepCopy(mattress);
+
             try
             {
+
+                List<u_mattress> sumMattress = new List<u_mattress>();
+                for (var i = 1; i < 5; i++)
+                {
+                    var _mattress = ObjectHelper.DeepCopy(mattress);
+                    if (mattress.dannum_type.Value != i)
+                    {
+                        _mattress.dannum_type = i;
+                        helper.CalCulateFormula(_mattress, mattressMx, true, true, extraProcesses, extraCosts);
+
+                        var nottax_factory_cost = helper.Replacements.Where(o => o.label == "【不含税出厂价】").ToList();
+                        var dept_cost = helper.Replacements.Where(o => o.label == "【部门含税价】").ToList();
+                        if (nottax_factory_cost.Count > 0)
+                        {
+                            decimal nottax_value = Convert.ToDecimal(nottax_factory_cost[0].value);
+                            decimal dept_costValue = Convert.ToDecimal(dept_cost[0].value);
+
+                            if (i == 1) {
+
+                                _mattress.dijia_cost1 = nottax_value;
+                            }
+                            else if (i ==2)
+                            {
+                                _mattress.dijia_cost2 = nottax_value;
+                            }
+                            else if (i == 3)
+                            {
+                                _mattress.dijia_cost3 = nottax_value;
+                            }
+                            else if (i == 4)
+                            {
+                                _mattress.dijia_cost4 = nottax_value;
+                            }
+                        }
+                        if (dept_cost.Count > 0)
+                        {
+                            decimal dept_costValue = Convert.ToDecimal(dept_cost[0].value);
+                            if (i == 1)
+                            {
+                                _mattress.dannum_cost1 = dept_costValue;
+                            }
+                            else if (i == 2)
+                            {
+                                _mattress.dannum_cost2 = dept_costValue;
+                            }
+                            else if (i == 3)
+                            {
+                                _mattress.dannum_cost3 = dept_costValue;
+                            }
+                            else if (i == 4)
+                            {
+                                _mattress.dannum_cost4 = dept_costValue;
+                            }
+                        }
+                        sumMattress.Add(_mattress);
+                    }
+                }
+
+
                 helper.CalCulateFormula(mattress, mattressMx, true, true, extraProcesses, extraCosts);
+                for (var i = 1; i < 5; i++)
+                {
+                    if (mattress.dannum_type.Value == i)
+                    {
+                        var nottax_factory_cost = helper.Replacements.Where(o => o.label == "【不含税出厂价】").ToList();
+                        var dept_cost = helper.Replacements.Where(o => o.label == "【部门含税价】").ToList();
+                        if (nottax_factory_cost.Count > 0)
+                        {
+                            decimal nottax_value = Convert.ToDecimal(nottax_factory_cost[0].value);
+                            decimal dept_costValue = Convert.ToDecimal(dept_cost[0].value);
+
+                            if (i == 1)
+                            {
+                                mattress.dijia_cost1 = nottax_value;
+                            }
+                            else if (i == 2)
+                            {
+                                mattress.dijia_cost2 = nottax_value;
+                            }
+                            else if (i == 3)
+                            {
+                                mattress.dijia_cost3 = nottax_value;
+                            }
+                            else if (i == 4)
+                            {
+                                mattress.dijia_cost4 = nottax_value;
+                            }
+                        }
+                        if (dept_cost.Count > 0)
+                        {
+                            decimal dept_costValue = Convert.ToDecimal(dept_cost[0].value);
+                            if (i == 1)
+                            {
+                                mattress.dannum_cost1 = dept_costValue;
+                            }
+                            else if (i == 2)
+                            {
+                                mattress.dannum_cost2 = dept_costValue;
+                            }
+                            else if (i == 3)
+                            {
+                                mattress.dannum_cost3 = dept_costValue;
+                            }
+                            else if (i == 4)
+                            {
+                                mattress.dannum_cost4 = dept_costValue;
+                            }
+                        }
+                    }
+                    else
+                    {
+                        var matchMattress = sumMattress.Where(o => o.dannum_type == i).ToList();
+                        if (matchMattress.Count> 0)
+                        {
+                            if (i == 1)
+                            {
+                                mattress.dannum_cost1 = matchMattress[0].dannum_cost1;
+                                mattress.dijia_cost1 = matchMattress[0].dijia_cost1;
+                            }
+                            else if (i == 2)
+                            {
+                                mattress.dannum_cost2 = matchMattress[0].dannum_cost2;
+                                mattress.dijia_cost2 = matchMattress[0].dijia_cost2;
+                            }
+                            else if (i == 3)
+                            {
+                                mattress.dannum_cost3 = matchMattress[0].dannum_cost3;
+                                mattress.dijia_cost3 = matchMattress[0].dijia_cost3;
+                            }
+                            else if (i == 4)
+                            {
+                                mattress.dannum_cost4 = matchMattress[0].dannum_cost4;
+                                mattress.dijia_cost4 = matchMattress[0].dijia_cost4;
+                            }
+                        }
+                    }
+                }
             }
             catch (Exception e)
             {

+ 2 - 1
JLHHJSvr/Excutor/UpdateL1BasicinfoExcutor.cs

@@ -63,6 +63,7 @@ namespace JLHHJSvr.Excutor
 
                 var parameters = new JObject();
                 parameters.Add("moddate", JToken.FromObject(maxMtrlModdate));
+                parameters.Add("flag", 2);
                 parameters.Add("pageindex", JToken.FromObject(0));
                 parameters.Add("pagesize", JToken.FromObject(0));
 
@@ -71,7 +72,7 @@ namespace JLHHJSvr.Excutor
                 if (mtrldefList.Count > 0)
                 {
                     var outputFields =
-                        "mtrlid,mtrlcode,mtrlname,mtrlorigin,mtrltype,unit,mtrlmode,mtrlsectype,zxmtrlmode," +
+                        "mtrlid,mtrlcode,mtrlname,mtrlorigin,mtrltype,unit,mtrlmode,mtrlsectype,zxmtrlmode,flag" +
                         "fjcnt,status_config,woodcode_config,pcode_config,statustype,woodcodetype,pcodetype,scid" +
                         ",handtype,mtrlengname,barcode,dscrp,issuliao,isuse,iflimitprice,net_weight,gross_weight,cubage,prdpackcode,opdate,opemp,moddate,lspacklimit,planprice";
                     foreach (var mtrl in mtrldefList)

+ 4 - 3
JLHHJSvr/Helper/ERPHelper.cs

@@ -377,9 +377,10 @@ namespace JLHHJSvr.Helper
                         ["mtrltype"] = mtrl.erp_mtrltype,
                         ["unit"] = mtrl.erp_mtrlunit,
                         ["mtrlengname"] = mtrl.erp_mtrlengname,
-                        ["dijia_cost"] = mtrl.dijia_cost, // 底价1
-                        ["dijia_cost2"] = mtrl.dijia_cost, // 底价2
-                        ["dijia_cost3"] = mtrl.dijia_cost, // 底价3
+                        ["dijia_cost1"] = mtrl.dijia_cost1, // 底价1
+                        ["dijia_cost2"] = mtrl.dijia_cost2, // 底价2
+                        ["dijia_cost3"] = mtrl.dijia_cost3, // 底价3
+                        ["dijia_cost4"] = mtrl.dijia_cost4, // 底价3
                         ["fob"] = mtrl.fob, // fob费用
                         ["taxes"] = mtrl.taxes, // 税金
                         ["extras_cost"] = mtrl.extras_cost, // 额外费用

File diff suppressed because it is too large
+ 4 - 1
JLHHJSvr/Helper/MattressHelper.cs