|
@@ -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)
|
|
|
{
|