订单金额修改
This commit is contained in:
parent
57720d713c
commit
e556b37c7c
|
@ -52,7 +52,7 @@ public class Suit extends BaseEntity
|
||||||
@Excel(name = "价格/押金")
|
@Excel(name = "价格/押金")
|
||||||
@JsonView({DeviceView.SuitList.class, JsonViewProfile.AppMch.class})
|
@JsonView({DeviceView.SuitList.class, JsonViewProfile.AppMch.class})
|
||||||
@NotNull(message = "价格/押金不允许为空", groups = {ValidGroup.Create.class, ValidGroup.FrontCreate.class})
|
@NotNull(message = "价格/押金不允许为空", groups = {ValidGroup.Create.class, ValidGroup.FrontCreate.class})
|
||||||
@DecimalMin(value = "0.1", message = "价格/押金不允许小于0.1")
|
@Min(value = 0, message = "价格/押金不允许小于0")
|
||||||
private BigDecimal price;
|
private BigDecimal price;
|
||||||
|
|
||||||
/** 详细说明 */
|
/** 详细说明 */
|
||||||
|
|
|
@ -13,6 +13,8 @@ import com.ruoyi.ss.suit.domain.enums.SuitFeeMode;
|
||||||
import com.ruoyi.ss.suit.domain.enums.SuitFeeType;
|
import com.ruoyi.ss.suit.domain.enums.SuitFeeType;
|
||||||
import com.ruoyi.ss.suit.service.SuitService;
|
import com.ruoyi.ss.suit.service.SuitService;
|
||||||
import com.ruoyi.ss.suit.service.SuitValidator;
|
import com.ruoyi.ss.suit.service.SuitValidator;
|
||||||
|
import com.ruoyi.system.domain.enums.config.ConfigKey;
|
||||||
|
import com.ruoyi.system.service.ISysConfigService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@ -33,6 +35,9 @@ public class SuitValidatorImpl extends BaseValidator implements SuitValidator {
|
||||||
@Autowired
|
@Autowired
|
||||||
private SuitService suitService;
|
private SuitService suitService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysConfigService sysConfigService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ValidateResult preLogicDel(List<Long> suitIds) {
|
public ValidateResult preLogicDel(List<Long> suitIds) {
|
||||||
if (CollectionUtils.isEmptyElement(suitIds)) {
|
if (CollectionUtils.isEmptyElement(suitIds)) {
|
||||||
|
@ -166,6 +171,13 @@ public class SuitValidatorImpl extends BaseValidator implements SuitValidator {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (create || suit.getPrice() != null) {
|
||||||
|
BigDecimal minService = sysConfigService.getBigDecimal(ConfigKey.RECHARGE_MIN_SERVICE);
|
||||||
|
if (suit.getPrice().compareTo(minService) < 0) {
|
||||||
|
return error("价格/押金不允许低于" + minService + "元");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return success();
|
return success();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -293,10 +293,15 @@ public class TransactionBillServiceImpl implements TransactionBillService, After
|
||||||
// 非分时订单,处理最低服务费
|
// 非分时订单,处理最低服务费
|
||||||
if (!SuitFeeType.timingList().contains(order.getSuitFeeType())) {
|
if (!SuitFeeType.timingList().contains(order.getSuitFeeType())) {
|
||||||
BigDecimal minService = sysConfigService.getBigDecimal(ConfigKey.RECHARGE_MIN_SERVICE);
|
BigDecimal minService = sysConfigService.getBigDecimal(ConfigKey.RECHARGE_MIN_SERVICE);
|
||||||
ServiceUtil.assertion(order.getMoney().compareTo(minService) < 0, "当前套餐金额小于最低服务费,请联系商户处理");
|
// ServiceUtil.assertion(order.getMoney().compareTo(minService) < 0, "当前套餐金额小于最低服务费,请联系商户处理");
|
||||||
|
// 当服务费不满足最低服务费时,设置为最低服务费
|
||||||
if (serviceCharge.compareTo(minService) < 0) {
|
if (serviceCharge.compareTo(minService) < 0) {
|
||||||
serviceCharge = minService;
|
serviceCharge = minService;
|
||||||
}
|
}
|
||||||
|
// 当金额不满足服务费时,将全收
|
||||||
|
if (order.getMoney().compareTo(serviceCharge) < 0) {
|
||||||
|
serviceCharge = order.getMoney();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
order.setServiceCharge(serviceCharge);
|
order.setServiceCharge(serviceCharge);
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ wx:
|
||||||
# 转账回调地址
|
# 转账回调地址
|
||||||
transferNotifyUrl: https://kg-dev.chuangtewl.com/dev-api/app/pay/notify/wx/transfer
|
transferNotifyUrl: https://kg-dev.chuangtewl.com/dev-api/app/pay/notify/wx/transfer
|
||||||
# 密钥所在位置
|
# 密钥所在位置
|
||||||
privateKeyPath: D:/project/证书/wxpay-kg/apiclient_key.pem
|
privateKeyPath: H:/project/创特/证书/wxpay-kg/apiclient_key.pem
|
||||||
# 证书序列号
|
# 证书序列号
|
||||||
merchantSerialNumber: 6AD69237C0F22A9AE51A64F1927E3A0962AC1FB0
|
merchantSerialNumber: 6AD69237C0F22A9AE51A64F1927E3A0962AC1FB0
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user