|
@@ -2553,13 +2553,14 @@ public class HeiHuOrderServiceImpl implements HeiHuOrderService {
|
|
|
for (Map<String, Object> row : tableData) {
|
|
for (Map<String, Object> row : tableData) {
|
|
|
// String orderCode = row.get("textField_mm2t71jm"); // 采购订单号
|
|
// String orderCode = row.get("textField_mm2t71jm"); // 采购订单号
|
|
|
String orderCode = UtilMap.getString(row,"textField_mm2t71jm");
|
|
String orderCode = UtilMap.getString(row,"textField_mm2t71jm");
|
|
|
|
|
+ String saleOrderCode = UtilMap.getString(row,"textField_ml6g7k5f");
|
|
|
String orderFax = UtilMap.getString(row,"orderFax");
|
|
String orderFax = UtilMap.getString(row,"orderFax");
|
|
|
if (orderCode == null || orderCode.isEmpty()) {
|
|
if (orderCode == null || orderCode.isEmpty()) {
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 获取或创建该订单的汇总Map
|
|
// 获取或创建该订单的汇总Map
|
|
|
- Map<String, Double> orderSum = summaryMap.computeIfAbsent(orderCode+"~"+orderFax,
|
|
|
|
|
|
|
+ Map<String, Double> orderSum = summaryMap.computeIfAbsent(orderCode+"~"+orderFax + "~"+saleOrderCode,
|
|
|
k -> {
|
|
k -> {
|
|
|
Map<String, Double> newMap = new HashMap<>();
|
|
Map<String, Double> newMap = new HashMap<>();
|
|
|
newMap.put("salesAmount", 0.0); // 销售金额总和
|
|
newMap.put("salesAmount", 0.0); // 销售金额总和
|
|
@@ -2602,6 +2603,7 @@ public class HeiHuOrderServiceImpl implements HeiHuOrderService {
|
|
|
for (Map.Entry<String, Map<String, Double>> entry : summaryMap.entrySet()) {
|
|
for (Map.Entry<String, Map<String, Double>> entry : summaryMap.entrySet()) {
|
|
|
String[] split = entry.getKey().split("~");
|
|
String[] split = entry.getKey().split("~");
|
|
|
String orderCode = split[0];
|
|
String orderCode = split[0];
|
|
|
|
|
+ String saleOrderCode = split[2];
|
|
|
Double orderFax = Double.parseDouble(split[1]);
|
|
Double orderFax = Double.parseDouble(split[1]);
|
|
|
Map<String, Double> sums = entry.getValue();
|
|
Map<String, Double> sums = entry.getValue();
|
|
|
|
|
|
|
@@ -2612,10 +2614,11 @@ public class HeiHuOrderServiceImpl implements HeiHuOrderService {
|
|
|
// 构建结果行
|
|
// 构建结果行
|
|
|
Map<String, String> summaryRow = new LinkedHashMap<>();
|
|
Map<String, String> summaryRow = new LinkedHashMap<>();
|
|
|
summaryRow.put("textField_ml7ch2pk", orderCode);//orderCode:采购审批单单号
|
|
summaryRow.put("textField_ml7ch2pk", orderCode);//orderCode:采购审批单单号
|
|
|
|
|
+ summaryRow.put("textField_motpbfwq", saleOrderCode);//saleOrderCode:销售订单单号
|
|
|
summaryRow.put("numberField_ml862225", formatNumber(salesAmount));//salesAmount:销售总金额
|
|
summaryRow.put("numberField_ml862225", formatNumber(salesAmount));//salesAmount:销售总金额
|
|
|
summaryRow.put("numberField_ml862226", formatNumber(purchaseAmount));//purchaseAmount:采购订单总金额
|
|
summaryRow.put("numberField_ml862226", formatNumber(purchaseAmount));//purchaseAmount:采购订单总金额
|
|
|
summaryRow.put("numberField_ml862228", formatNumber(flygcb));//flygcb:辅料预估总成本
|
|
summaryRow.put("numberField_ml862228", formatNumber(flygcb));//flygcb:辅料预估总成本
|
|
|
- summaryRow.put("numberField_ml86222d",formatNumber((salesAmount - purchaseAmount/orderFax - flygcb) / salesAmount));//毛利率
|
|
|
|
|
|
|
+ summaryRow.put("numberField_ml86222d",formatNumber((salesAmount - purchaseAmount/orderFax - flygcb) / salesAmount * 100));//毛利率
|
|
|
Double mlv = (salesAmount - purchaseAmount/orderFax - flygcb) / salesAmount;
|
|
Double mlv = (salesAmount - purchaseAmount/orderFax - flygcb) / salesAmount;
|
|
|
if(mlv >= 0.15){
|
|
if(mlv >= 0.15){
|
|
|
summaryRow.put("numberField_mm2t71jo", String.valueOf(1));
|
|
summaryRow.put("numberField_mm2t71jo", String.valueOf(1));
|