增加充电失败订单入库

This commit is contained in:
yuyang 2022-08-08 17:05:12 +08:00
parent bf1b6f7049
commit e284cee23d
2 changed files with 20 additions and 7 deletions

View File

@ -375,6 +375,11 @@ public class XhpcPileOrderController extends BaseController {
if(cacheOrderData.getTotalPowerQuantity()==0 || totalPowerQuantity.compareTo(new BigDecimal(0.1))<1 || money.compareTo(new BigDecimal(0.1))<1){
xhpcChargeOrder.setStatus(3);
xhpcChargeOrder.setUpdateTime(new Date());
int startSoc1 = cacheOrderData.getStartSoc();
int endSoc1 = cacheOrderData.getEndSoc();
xhpcChargeOrder.setStartSoc(startSoc1 + "");
xhpcChargeOrder.setEndSoc(endSoc1 + "");
xhpcChargeOrderService.updateXhpcChargeOrder(xhpcChargeOrder);
xhpcRealTimeOrderService.addZeroHistoryOrder(xhpcChargeOrder);
logger.info("*********************电量为0订单号>>>>>orderNo" + orderNo);

View File

@ -1313,13 +1313,19 @@ public class XhpcRealTimeOrderServiceImpl extends BaseService implements IXhpcRe
logger.info("<<<<<<<<<<<<<<<<订单结束回调成功>>>>>>>>>订单号:>>>"+orderNo+">>>>>");
logger.info("<<<<<<<<<<<<<<<<订单结束回调成功>>>>>>>>>订单号:>>>"+orderNo+">>>>>>>>");
logger.info("<<<<<<<<<<<<<<<<订单结束回调成功>>>>>>>>>订单号:>>>"+orderNo+">>>>>>>>");
if(!"40".equals(xhpcHistoryOrder.getStopReasonEvcs())){
XhpcWorkHistoryOrderDto xhpcWorkHistoryOrderDto =new XhpcWorkHistoryOrderDto();
BeanUtils.copyProperties(xhpcHistoryOrder,xhpcWorkHistoryOrderDto);
String nameByCode = StopReasonEnum.getNameByCode(xhpcHistoryOrder.getStopReasonEvcs());
xhpcWorkHistoryOrderDto.setStopReasonEvcsName(nameByCode);
xhpcHistoryOrderService.insertXhpcWorkHistoryOrderDto(xhpcWorkHistoryOrderDto);
logger.info("<<<<<<<<<<<<<<<<入库成功>>>>>>>>>订单号:>>>");
try {
int startSoc = Integer.parseInt(xhpcHistoryOrder.getStartSoc());
int endSoc = Integer.parseInt(xhpcHistoryOrder.getEndSoc());
if(!"40".equals(xhpcHistoryOrder.getStopReasonEvcs()) || startSoc>95 || endSoc>95){
XhpcWorkHistoryOrderDto xhpcWorkHistoryOrderDto =new XhpcWorkHistoryOrderDto();
BeanUtils.copyProperties(xhpcHistoryOrder,xhpcWorkHistoryOrderDto);
String nameByCode = StopReasonEnum.getNameByCode(xhpcHistoryOrder.getStopReasonEvcs());
xhpcWorkHistoryOrderDto.setStopReasonEvcsName(nameByCode);
xhpcHistoryOrderService.insertXhpcWorkHistoryOrderDto(xhpcWorkHistoryOrderDto);
logger.info("<<<<<<<<<<<<<<<<入库成功>>>>>>>>>订单号:>>>");
}
}catch (Exception e){
}
}
@ -1482,6 +1488,8 @@ public class XhpcRealTimeOrderServiceImpl extends BaseService implements IXhpcRe
xhpcHistoryOrder.setInternetSerialNumber(xhpcChargeOrder.getInternetSerialNumber());
xhpcHistoryOrder.setType(2);
xhpcHistoryOrder.setStatus(0);
xhpcHistoryOrder.setStartSoc(xhpcChargeOrder.getStartSoc());
xhpcHistoryOrder.setEndSoc(xhpcChargeOrder.getEndSoc());
Date date = new Date();
xhpcHistoryOrder.setCreateTime(date);
Map<String, Object> pushOrder = redisService.getCacheMap("pushOrder:"+xhpcChargeOrder.getSerialNumber());