hu 2 лет назад
Родитель
Сommit
982855b0ff

+ 1 - 0
src/custom/restcontroller/sale/shoppingcart/SQL/购物车列表.sql

@@ -15,6 +15,7 @@ SELECT t1.sa_shoppingcartid,
        t3.orderminqty_auxunit,
        t3.orderaddqty_auxunit,
        t3.iscustomsize,
+       t3.pricingmetod,
        t3.widthschemeid,
        t3.lengthschemeid,
        t4.unitname,

+ 6 - 1
src/custom/restcontroller/sale/shoppingcart/ShoppingCart.java

@@ -178,11 +178,16 @@ public class ShoppingCart extends Controller {
             try {
                 ItemPrice itemPrice = ItemPrice.getItemPrice(this, sys_enterpriseid, row.getLong("itemid"));
                 row.put("oldprice",  istool == 0 ?itemPrice.getContractprice():itemPrice.getMarketprice());
+                if(row.getBoolean("iscustomsize") && row.getLong("pricingmetod")==1){
+                    row.put("gradeprice", itemPrice.getContractprice().multiply(row.getBigDecimal("length").multiply(row.getBigDecimal("width")).divide(new BigDecimal("1000000"), 4, BigDecimal.ROUND_HALF_UP)));
+                }else{
+                    row.put("gradeprice", itemPrice.getContractprice());
+                }
 //                row.put("gradeprice", istool == 0 ?itemPrice.getContractprice():itemPrice.getMarketprice());
             } catch (Exception e) {
                 e.printStackTrace();
                 row.put("oldprice", 0);
-//                row.put("gradeprice", 0);
+                row.put("gradeprice", 0);
             }
             row.put("tradefield", tradefieldRowsMap.getOrDefault(row.getString("itemid"), new Rows()));
         }