ソースを参照

修改清单金额不匹配问题

cy 6 年 前
コミット
8de293d8fc

+ 1 - 1
src/main/java/com/emato/ccnet/wx/service/impl/CusWaybillServiceImpl.java

@@ -215,7 +215,7 @@ public class CusWaybillServiceImpl implements CusWaybillService {
             cusWaybillGoods.setCusWaybillSn(cusWaybillSn);
             cusWaybillGoods.setMerchOrderSn(wxOrder.getOrderSn());
             cusWaybillGoods.setSku(wxOrderGoods.getItemNo());
-            cusWaybillGoods.setBuyUnitPrice(wxOrderGoods.getTaxPrice());
+            cusWaybillGoods.setBuyUnitPrice(wxOrderGoods.getPrice());
             cusWaybillGoods.setBuyQty(wxOrderGoods.getQty());
             cusWaybillGoods.setCreaterSn(Contants.CREATER_NUMBER);
             cusWaybillGoods.setCreateTime(new Date());

+ 2 - 1
src/main/java/com/emato/ccnet/wx/service/impl/WxOrderGoodsServiceImpl.java

@@ -112,7 +112,8 @@ public class WxOrderGoodsServiceImpl implements WxOrderGoodsService {
         wxOrderGoods.setQty(wxOrderGoodsDate.getQty());
         BigDecimal acturalPrice = wxOrderGoodsDate.getTotalPrice();
         BigDecimal acturalTax = wxOrderGoodsDate.getTaxTotal();
-        BigDecimal price = acturalPrice.multiply(new BigDecimal(1).subtract(acturalTax)).divide(wxOrderGoodsDate.getQty()).setScale(2,BigDecimal.ROUND_HALF_UP);
+        BigDecimal price = acturalPrice.divide(new BigDecimal(1).add(acturalTax),2,BigDecimal.ROUND_HALF_UP);
+        price = price.divide(wxOrderGoodsDate.getQty(),2,BigDecimal.ROUND_HALF_UP);
         wxOrderGoods.setPrice(price);
         wxOrderGoods.setTotalPrice(price.multiply(wxOrderGoodsDate.getQty()).setScale(2,BigDecimal.ROUND_HALF_UP));
         wxOrderGoods.setTaxPrice(acturalPrice.divide(wxOrderGoodsDate.getQty()).setScale(2,BigDecimal.ROUND_HALF_UP));