1
0
Selaa lähdekoodia

Merge branch 'master' of http://git.ds-bay.com/project/kmall-pt-general

lsp 4 vuotta sitten
vanhempi
commit
376752d0aa

+ 9 - 4
kmall-admin/src/main/java/com/kmall/admin/controller/OrderController.java

@@ -1325,12 +1325,17 @@ public class OrderController {
 
                 if (Objects.nonNull(systemFormat.getCurrentPrice()) && Objects.nonNull(systemFormat.getEdlp())){
                     // 设置扣率
-                    systemFormat.setDeductionRate(new BigDecimal(systemFormat.getCurrentPrice()).divide(new BigDecimal(systemFormat.getEdlp()),2,BigDecimal.ROUND_HALF_UP).setScale(2,BigDecimal.ROUND_HALF_UP).toEngineeringString());
+                    systemFormat.setDeductionRate(new BigDecimal(1).subtract(new BigDecimal(systemFormat.getCurrentPrice()).divide(new BigDecimal(systemFormat.getEdlp()),2,BigDecimal.ROUND_HALF_UP).setScale(2,BigDecimal.ROUND_HALF_UP)).toString());
                     if (Objects.nonNull(systemFormat.getCostPrice())){
                         // 设置GP ¥
                         systemFormat.setGp1(new BigDecimal(systemFormat.getCurrentPrice()).subtract(new BigDecimal(systemFormat.getCostPrice())).setScale(4,BigDecimal.ROUND_HALF_UP).toEngineeringString());
                         // 设置GP %
-                        systemFormat.setGp2(new BigDecimal(systemFormat.getGp1()).divide(new BigDecimal(systemFormat.getCurrentPrice()),8,BigDecimal.ROUND_HALF_UP).setScale(8,BigDecimal.ROUND_HALF_UP).toString());
+                        systemFormat.setGp2(new BigDecimal(systemFormat.getGp1()).divide(new BigDecimal(systemFormat.getCurrentPrice()),4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(4,BigDecimal.ROUND_HALF_UP).toString()+"%");
+                        if (Dict.orderStatus.item_401.getItem().equals(systemFormat.getOrderStatus())){
+                            systemFormat.setGp1("-"+systemFormat.getGp1());
+                            systemFormat.setGp2("-"+systemFormat.getGp2());
+                        }
+
                     }
                 }
                 // 如果是退货
@@ -1395,9 +1400,9 @@ public class OrderController {
         headerMap.put("TimeStampDetails","销售时间");
         headerMap.put("StaffID","收银员");
         headerMap.put("StaffName","收银员姓名");
-        headerMap.put("HSCode","品编码");
+        headerMap.put("HSCode","海关商品编码");
         headerMap.put("HSCodeName","品类名称");
-        headerMap.put("EmatouCode","商品编码");
+        headerMap.put("EmatouCode","料件号");
         headerMap.put("PLU","PLU");
         headerMap.put("MychemID","MychemID");
         headerMap.put("ProductNameEN","商品名称(英文)");