mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-03 17:40:13 +08:00
如果结算金额为0,减去优惠金额后为负数,还设置为0
This commit is contained in:
@@ -59,25 +59,6 @@ public class BillingTemplateValidateRequestHandler extends AbstractHandler{
|
||||
byte[] billingTemplateCodeByte = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||||
String billingTemplateCode = BytesUtil.binary(billingTemplateCodeByte, 16);
|
||||
|
||||
// 根据桩号查询计费模板
|
||||
// BillingTemplateVO billingTemplateVO = pileBillingTemplateService.selectBillingTemplateDetailByPileSn(pileSn);
|
||||
// String templateCode = null;
|
||||
// if (billingTemplateVO != null) {
|
||||
// templateCode = billingTemplateVO.getTemplateCode();
|
||||
// }
|
||||
|
||||
|
||||
// log.info("桩传的计费模型编码:{}, 根据桩号:{} 查询到的计费模型编码:{}", billingTemplateCode, pileSn, templateCode);
|
||||
// log.info("桩传的计费模型编码:{}", billingTemplateCode);
|
||||
|
||||
/**
|
||||
* 应答 0x00 桩计费模型与平台一致 0x01 桩计费模型与平台不一致
|
||||
*/
|
||||
// byte[] flag;
|
||||
// if (StringUtils.equals(billingTemplateCode, "100")){
|
||||
// flag = Constants.zeroByteArray;
|
||||
// }else {
|
||||
// }
|
||||
byte[] flag = Constants.oneByteArray;
|
||||
// 消息体
|
||||
byte[] messageBody = Bytes.concat(pileSnByte, billingTemplateCodeByte, flag);
|
||||
|
||||
@@ -895,6 +895,10 @@ public abstract class AbstractProgramLogic implements InitializingBean {
|
||||
|
||||
// 更新结算金额 结算金额 = 消费金额 - 虚拟金额 - 优惠金额
|
||||
BigDecimal newSettleAmount = orderBasicInfo.getSettleAmount().subtract(discountAmount);
|
||||
if (newSettleAmount.compareTo(BigDecimal.ZERO) < 0) {
|
||||
// 如果结算金额为0,减去优惠金额后为负数,还设置为0
|
||||
newSettleAmount = BigDecimal.ZERO;
|
||||
}
|
||||
orderBasicInfo.setSettleAmount(newSettleAmount);
|
||||
|
||||
// 优惠后总消费金额 = 折扣后电费 + 折扣后服务费
|
||||
|
||||
Reference in New Issue
Block a user