mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-07-05 22:47:59 +08:00
Merge branch 'dev' of http://192.168.2.2:8099/jsowell/jsowell-charger-web into dev
This commit is contained in:
@@ -2030,25 +2030,30 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
|||||||
BigDecimal totalSettleAmount = BigDecimal.ZERO;
|
BigDecimal totalSettleAmount = BigDecimal.ZERO;
|
||||||
List<String> orderCodeList = Lists.newArrayList();
|
List<String> orderCodeList = Lists.newArrayList();
|
||||||
for (OrderListVO vo : orderListVOS) {
|
for (OrderListVO vo : orderListVOS) {
|
||||||
// 统计orderAmount大于0的
|
// 统计结算金额大于0的
|
||||||
String orderAmount = vo.getOrderAmount();
|
BigDecimal settleAmount = StringUtils.isBlank(vo.getSettleAmount())
|
||||||
if (StringUtils.isBlank(orderAmount)) {
|
? BigDecimal.ZERO
|
||||||
// 没有订单消费金额,不统计
|
: new BigDecimal(vo.getChargingDegree());
|
||||||
|
if (settleAmount.compareTo(BigDecimal.ZERO) <= 0) {
|
||||||
|
// 只统计用电量大于0的
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 订单消费金额
|
||||||
|
String orderAmount = vo.getOrderAmount();
|
||||||
|
|
||||||
// 用电度数
|
// 用电度数
|
||||||
BigDecimal chargingDegree = StringUtils.isBlank(vo.getChargingDegree())
|
BigDecimal chargingDegree = StringUtils.isBlank(vo.getChargingDegree())
|
||||||
? BigDecimal.ZERO
|
? BigDecimal.ZERO
|
||||||
: new BigDecimal(vo.getChargingDegree());
|
: new BigDecimal(vo.getChargingDegree());
|
||||||
if (chargingDegree.compareTo(BigDecimal.ZERO) <= 0) {
|
|
||||||
// 只统计用电量大于0的
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
// 充电度数累计
|
// 充电度数累计
|
||||||
useElectricity = useElectricity.add(chargingDegree);
|
useElectricity = useElectricity.add(chargingDegree);
|
||||||
|
|
||||||
// 充电次数
|
// 充电次数
|
||||||
chargeNum += 1;
|
chargeNum += 1;
|
||||||
orderCodeList.add(vo.getOrderCode());
|
orderCodeList.add(vo.getOrderCode());
|
||||||
|
|
||||||
// 充电时间累计
|
// 充电时间累计
|
||||||
if (StringUtils.isNotBlank(vo.getChargeStartTime()) && StringUtils.isNotBlank(vo.getChargeEndTime())) {
|
if (StringUtils.isNotBlank(vo.getChargeStartTime()) && StringUtils.isNotBlank(vo.getChargeEndTime())) {
|
||||||
long l = DateUtils.intervalTime(vo.getChargeStartTime(), vo.getChargeEndTime());
|
long l = DateUtils.intervalTime(vo.getChargeStartTime(), vo.getChargeEndTime());
|
||||||
@@ -2071,8 +2076,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
|||||||
totalVirtualAmount = totalVirtualAmount.add(new BigDecimal(virtualAmount));
|
totalVirtualAmount = totalVirtualAmount.add(new BigDecimal(virtualAmount));
|
||||||
|
|
||||||
// 结算金额
|
// 结算金额
|
||||||
String settleAmount = StringUtils.isNotBlank(vo.getSettleAmount()) ? vo.getSettleAmount() : Constants.ZERO;
|
totalSettleAmount = totalSettleAmount.add(settleAmount);
|
||||||
totalSettleAmount = totalSettleAmount.add(new BigDecimal(settleAmount));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 计算报表
|
// 计算报表
|
||||||
@@ -2130,9 +2134,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
|||||||
checkPileInfo(dto);
|
checkPileInfo(dto);
|
||||||
|
|
||||||
// 保存订单到数据库 saveOrder2Database
|
// 保存订单到数据库 saveOrder2Database
|
||||||
OrderBasicInfo basicInfo = saveOrder2Database(dto);
|
return saveOrder2Database(dto);
|
||||||
|
|
||||||
return basicInfo;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -2173,7 +2175,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
|||||||
if (orderInfo == null) {
|
if (orderInfo == null) {
|
||||||
throw new BusinessException(ReturnCodeEnum.CODE_QUERY_ORDER_NULL_ERROR);
|
throw new BusinessException(ReturnCodeEnum.CODE_QUERY_ORDER_NULL_ERROR);
|
||||||
}
|
}
|
||||||
if (!StringUtils.equals(orderInfo.getPayStatus(), "0")) {
|
if (!StringUtils.equals(orderInfo.getPayStatus(), OrderPayStatusEnum.unpaid.getValue())) {
|
||||||
// 订单已支付
|
// 订单已支付
|
||||||
throw new BusinessException(ReturnCodeEnum.CODE_ORDER_IS_NOT_TO_BE_PAID_ERROR);
|
throw new BusinessException(ReturnCodeEnum.CODE_ORDER_IS_NOT_TO_BE_PAID_ERROR);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user