Pārlūkot izejas kodu

1、修复使用未审批重算后,这里没显示价格
2、历史报价新增散单金额,标准金额,大单金额,小单金额字段

MY 2 dienas atpakaļ
vecāks
revīzija
48d7647f36

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

@@ -18,6 +18,10 @@ namespace JLHHJSvr.Com.Model
         public decimal? nottax_dept_cost { get; set; }
         public decimal? dept_cost { get; set; }
         public decimal? foreign_cost { get; set; }
+        public decimal? dannum_cost1 { get; set; }
+        public decimal? dannum_cost2 { get; set; }
+        public decimal? dannum_cost3 { get; set; }
+        public decimal? dannum_cost4 { get; set; }
 
     }
 }

+ 1 - 0
JLHHJSvr/Excutor/ReCalculateNoAuditExcutor.cs

@@ -71,6 +71,7 @@ namespace JLHHJSvr.Excutor
 
                             helper.CalCulateFormula(mattress_temp, mxList, true, true, mxExtra1List, mxExtra2List);
 
+                            helper.MattressCalculateCost(mattress_temp, mxList, mxExtra1List, mxExtra2List);
                             helper.SaveMattress(mattress_temp, mxList, mxExtra1List, mxExtra2List);
                         }
                         cmd.Transaction.Commit();

+ 1 - 150
JLHHJSvr/Excutor/SaveMattressExcutor.cs

@@ -289,156 +289,7 @@ 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)
-            {
-                throw new LJCommonException(e.Message);
-            }
+            helper.MattressCalculateCost(mattress, mattressMx, extraProcesses, extraCosts);
 
             var mxmessageList = mattressMx.Where(item => !string.IsNullOrEmpty(item.message)).ToList();
             if (mxmessageList.Any())

+ 157 - 2
JLHHJSvr/Helper/MattressHelper.cs

@@ -1672,9 +1672,13 @@ namespace JLHHJSvr.Helper
                 cmpemp = context.tokendata.username,
                 nottax_dept_cost = mattress.nottax_dept_cost,
                 dept_cost = mattress.dept_cost,
-                foreign_cost = mattress.foreign_cost
+                foreign_cost = mattress.foreign_cost,
+                dannum_cost1 = mattress.dannum_cost1,
+                dannum_cost2 = mattress.dannum_cost2,
+                dannum_cost3 = mattress.dannum_cost3,
+                dannum_cost4 = mattress.dannum_cost4
             };
-            var fieldsHs = "bednetid_mattressid, typeid, cmpdate, cmpemp, nottax_dept_cost, dept_cost, foreign_cost";
+            var fieldsHs = "bednetid_mattressid, typeid, cmpdate, cmpemp, nottax_dept_cost, dept_cost, foreign_cost, dannum_cost1, dannum_cost2, dannum_cost3, dannum_cost4";
             DbSqlHelper.Insert(cmd, "u_his_price", null, hisprice, fieldsHs);
         }
         public u_mattress GetMattress(int mattressid)
@@ -2176,6 +2180,157 @@ namespace JLHHJSvr.Helper
 
         }
 
+        public void MattressCalculateCost(u_mattress mattress, List<u_mattress_mx_mtrl> mattressMx, List<u_mattress_mx_extra> extraProcesses, List<u_mattress_mx_extra> extraCosts)
+        {
+            // 没有输入默认按标准计算
+            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;
+                        CalCulateFormula(_mattress, mattressMx, true, true, extraProcesses, extraCosts);
+
+                        var nottax_factory_cost = Replacements.Where(o => o.label == "【不含税出厂价】").ToList();
+                        var dept_cost = 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);
+                    }
+                }
+
+                CalCulateFormula(mattress, mattressMx, true, true, extraProcesses, extraCosts);
+                for (var i = 1; i < 5; i++)
+                {
+                    if (mattress.dannum_type.Value == i)
+                    {
+                        var nottax_factory_cost = Replacements.Where(o => o.label == "【不含税出厂价】").ToList();
+                        var dept_cost = 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)
+            {
+                throw new LJCommonException(e.Message);
+            }
+        }
+
         #region 床垫接口相关方法
         /// <summary>
         /// 业务审核