修改支付逻辑
This commit is contained in:
@@ -132,11 +132,6 @@ public class PayService {
|
|||||||
private MpShopTableMapper mpShopTableMapper;
|
private MpShopTableMapper mpShopTableMapper;
|
||||||
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
|
|
||||||
System.out.printf("%.2f%n", new BigDecimal(1).setScale(2, RoundingMode.DOWN));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public Result queryPayType(String shopId) {
|
public Result queryPayType(String shopId) {
|
||||||
return Result.success(CodeEnum.SUCCESS, tbShopPayTypeMapper.selectByShopId(shopId));
|
return Result.success(CodeEnum.SUCCESS, tbShopPayTypeMapper.selectByShopId(shopId));
|
||||||
@@ -1622,20 +1617,20 @@ public class PayService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if("0".equals(staff.getDiscountType())){
|
if("0".equals(staff.getDiscountType())){
|
||||||
|
|
||||||
if(staff.getMaxDiscountAmount().compareTo(tbOrderInfo.getOrderAmount())>=0){
|
if(staff.getMaxDiscountAmount().compareTo(tbOrderInfo.getOrderAmount())>=0){
|
||||||
staff.setMaxDiscountAmount(BigDecimal.ONE);
|
staff.setMaxDiscountAmount(new BigDecimal(0.01));
|
||||||
}else {
|
}else {
|
||||||
staff.setMaxDiscountAmount(BigDecimal.ONE.subtract(staff.getMaxDiscountAmount().divide(tbOrderInfo.getOrderAmount(),2,RoundingMode.HALF_UP).setScale(2,RoundingMode.HALF_UP)));
|
staff.setMaxDiscountAmount(BigDecimal.ONE.subtract(staff.getMaxDiscountAmount().divide(tbOrderInfo.getOrderAmount(),2,RoundingMode.HALF_DOWN).setScale(2,RoundingMode.HALF_DOWN)));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Result.success(SUCCESS,staff.getMaxDiscountAmount());
|
return Result.success(SUCCESS,staff.getMaxDiscountAmount());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user