|
@@ -287,10 +287,10 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
|
|
|
p.setCostPrice(MathUtil.div(p.getCostPrice(), MathUtil.div(MathUtil.add(p.getTaxRate(), 100),100)).doubleValue());
|
|
|
p.setNewCostPrice(newCostPrice);*/
|
|
|
|
|
|
- p.setOldDiscountPrice(p.getDiscountPrice());
|
|
|
+ /* p.setOldDiscountPrice(p.getDiscountPrice());
|
|
|
if ("0".equals(p.getIncludedTax()) && null != p.getTaxRate() && p.getTaxRate() > 0d) {
|
|
|
p.setDiscountPrice(MathUtil.div(p.getDiscountPrice(), MathUtil.div(MathUtil.add(p.getTaxRate(), 100), 100)).doubleValue());
|
|
|
- }
|
|
|
+ }*/
|
|
|
// 付采美总金额
|
|
|
allServeAmount = MathUtil.add(allServeAmount, MathUtil.mul(p.getNum(), p.getCmCostPrice())).doubleValue();
|
|
|
// 子订单利润
|
|
@@ -443,10 +443,10 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
|
|
|
newCostPrice = p.getCostPrice();
|
|
|
p.setCostPrice(MathUtil.div(p.getCostPrice(), MathUtil.div(MathUtil.add(p.getTaxRate(), 100),100)).doubleValue());
|
|
|
p.setNewCostPrice(newCostPrice);*/
|
|
|
- p.setOldDiscountPrice(p.getDiscountPrice());
|
|
|
+ /*p.setOldDiscountPrice(p.getDiscountPrice());
|
|
|
if ("0".equals(p.getIncludedTax()) && null != p.getTaxRate() && p.getTaxRate() > 0d) {
|
|
|
p.setDiscountPrice(MathUtil.div(p.getDiscountPrice(), MathUtil.div(MathUtil.add(p.getTaxRate(), 100), 100)).doubleValue());
|
|
|
- }
|
|
|
+ }*/
|
|
|
// 付采美总金额
|
|
|
allServeAmount = MathUtil.add(allServeAmount, MathUtil.mul(p.getNum(), p.getCmCostPrice())).doubleValue();
|
|
|
brokerage = MathUtil.add(brokerage, MathUtil.mul(p.getBrokerage(),p.getNum())).doubleValue();
|
|
@@ -733,10 +733,10 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
|
|
|
NewShopOrder shopOrder = newShopOrderDao.get(record.getShopOrderID());
|
|
|
Double wipePayment = cmPayShopRecordDao.sumWipePaymentNoStatus(Integer.valueOf(record.getShopOrderID()));
|
|
|
wipePayment = wipePayment != null ? wipePayment : 0d;
|
|
|
- // 本次付款金额 + 抹平金额 + 原来已经付过的金额
|
|
|
- BigDecimal payedFee = MathUtil.add(MathUtil.add(record.getPayAmount(), wipePayment), shopOrder.getPayedShopAmount());
|
|
|
+ // 本次付款金额 + 抹平金额 + 原来已经付过的金额 - 付第三方
|
|
|
+ BigDecimal payedFee = MathUtil.add(MathUtil.sub(MathUtil.add(record.getPayAmount(), wipePayment), shopOrder.getShopOtherFee()), shopOrder.getPayedShopAmount());
|
|
|
// 总共要付的金额
|
|
|
- BigDecimal shouldPayFee = BigDecimal.valueOf(shopOrder.getShouldPayShopAmount());
|
|
|
+ BigDecimal shouldPayFee = MathUtil.sub(shopOrder.getShouldPayShopAmount(), shopOrder.getShopOtherFee());
|
|
|
//判断是否有差价金额
|
|
|
if (shopOrder.getDifferenceType() != null && shopOrder.getDifferenceType() == 1) {
|
|
|
shouldPayFee = MathUtil.add(shouldPayFee, shopOrder.getDifferencePrice());
|
|
@@ -756,7 +756,7 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
|
|
|
logger.info("check ----> 付款金额异常, 付款金额大于待付款金额");
|
|
|
throw new Exception("付款金额异常, 付款金额大于待付款金额");
|
|
|
}
|
|
|
- shopOrder.setPayedShopAmount(shopOrder.getPayedShopAmount() == null ? 0D : shopOrder.getPayedShopAmount() + record.getPayAmount());
|
|
|
+ shopOrder.setPayedShopAmount(shopOrder.getPayedShopAmount() == null ? 0D : MathUtil.add(shopOrder.getPayedShopAmount(), MathUtil.sub(record.getPayAmount(), shopOrder.getShopOtherFee())).doubleValue());
|
|
|
shopOrder.setPaying("0"); //退出付款进行状态
|
|
|
newShopOrderDao.update(shopOrder);
|
|
|
record.setStatus("1");
|
|
@@ -881,7 +881,7 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
|
|
|
//修改每一条子订单的已付款金额
|
|
|
for (CmPayShopRecord record : records) {
|
|
|
NewShopOrder shopOrder = newShopOrderDao.get(record.getShopOrderID());
|
|
|
- shopOrder.setPayedShopAmount(shopOrder.getPayedShopAmount() - record.getPayAmount());
|
|
|
+ shopOrder.setPayedShopAmount(shopOrder.getPayedShopAmount() - record.getPayAmount() + shopOrder.getShopOtherFee());
|
|
|
if (shopOrder.getPayedShopAmount() == 0D) {
|
|
|
// 本次付款金额 + 原来已经付过的金额 < 总共要付的金额
|
|
|
shopOrder.setPayStatus("1");
|