mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-23 12:35:07 +08:00
update 占桩订单优化
This commit is contained in:
@@ -66,6 +66,8 @@ public interface OrderPileOccupyService{
|
||||
|
||||
void stopOccupyPileOrder(OrderPileOccupy orderPileOccupy);
|
||||
|
||||
int retryCalculateOccupyPileOrderAmount(String occupyCode);
|
||||
|
||||
/**
|
||||
* 通过memberid查询挂起状态订单
|
||||
* @param memberId
|
||||
|
||||
@@ -282,6 +282,26 @@ public class OrderPileOccupyServiceImpl implements OrderPileOccupyService {
|
||||
orderPileOccupyMapper.updateByPrimaryKeySelective(orderPileOccupy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int retryCalculateOccupyPileOrderAmount(String occupyCode) {
|
||||
OrderPileOccupy orderPileOccupy = queryByOccupyCode(occupyCode);
|
||||
// 计算金额
|
||||
BigDecimal orderAmount = calculateOccupyPileOrderAmount(orderPileOccupy);
|
||||
|
||||
if (orderAmount.compareTo(BigDecimal.ZERO) > 0) {
|
||||
// 需要支付金额,订单挂起
|
||||
orderPileOccupy.setStatus(Constants.TWO); // 2-订单挂起
|
||||
} else {
|
||||
// 订单金额为0
|
||||
orderPileOccupy.setPayStatus(Constants.TWO); // 2-无需支付
|
||||
orderPileOccupy.setStatus(Constants.ONE); // 1-订单完成
|
||||
}
|
||||
orderPileOccupy.setOrderAmount(orderAmount);
|
||||
// 更新数据库
|
||||
int i = orderPileOccupyMapper.updateByPrimaryKeySelective(orderPileOccupy);
|
||||
return i;
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算占桩订单金额
|
||||
* calculateTheAmountOfTheOccupancyOrder
|
||||
|
||||
Reference in New Issue
Block a user