修改 场站添加和费率编辑必需入缓存,修改启动订单获桩服务模型id入库

This commit is contained in:
yuyang 2021-11-17 11:03:56 +08:00
parent ad0f0833ed
commit 39ed2e03db
3 changed files with 19 additions and 8 deletions

View File

@ -537,6 +537,14 @@ public class XhpcChargingStationServiceImpl implements IXhpcChargingStationServi
cacheRateModel.setTfPricesSeq(tfPricesSeq); cacheRateModel.setTfPricesSeq(tfPricesSeq);
R r = powerPileService.setStationRateModel(chargingStationId, rateModelId, cacheRateModel); R r = powerPileService.setStationRateModel(chargingStationId, rateModelId, cacheRateModel);
if (r.getCode() != 200) {
logger.info("添加费率桩服务错误:"+r.getMsg());
//数据回滚-手动回滚
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return AjaxResult.error("添加费率入缓存失败,请稍后在试");
}
//修改桩和终端的模板id //修改桩和终端的模板id
xhpcChargingStationMapper.updateXhpcChargingPile(chargingStationId,rateModelId); xhpcChargingStationMapper.updateXhpcChargingPile(chargingStationId,rateModelId);
xhpcChargingStationMapper.updateXhpcTerminal(chargingStationId,rateModelId); xhpcChargingStationMapper.updateXhpcTerminal(chargingStationId,rateModelId);
@ -1005,6 +1013,12 @@ public class XhpcChargingStationServiceImpl implements IXhpcChargingStationServi
} }
cacheRateModel.setTfPricesSeq(tfPricesSeq); cacheRateModel.setTfPricesSeq(tfPricesSeq);
R r = powerPileService.setStationRateModel(chargingStationId, rateModelId, cacheRateModel); R r = powerPileService.setStationRateModel(chargingStationId, rateModelId, cacheRateModel);
if (r.getCode() != 200) {
logger.info("添加费率桩服务错误:"+r.getMsg());
//数据回滚-手动回滚
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return AjaxResult.error("添加费率入缓存失败,请稍后在试");
}
//修改桩和终端的模板id //修改桩和终端的模板id
xhpcChargingStationMapper.updateXhpcChargingPile(chargingStationId,rateModelId); xhpcChargingStationMapper.updateXhpcChargingPile(chargingStationId,rateModelId);
xhpcChargingStationMapper.updateXhpcTerminal(chargingStationId,rateModelId); xhpcChargingStationMapper.updateXhpcTerminal(chargingStationId,rateModelId);

View File

@ -88,7 +88,7 @@ public class XhpcHistoryOrderController extends BaseController {
* 终端统计 * 终端统计
*/ */
@GetMapping("/test3") @GetMapping("/test3")
@Scheduled(cron = "0 0/8 * * * ?") //@Scheduled(cron = "0 0/8 * * * ?")
public void test3(){ public void test3(){
logger.info(">>>>>>>>>>>>>>>>>>>>>>>终端统计定时任务>>>>>>>>>>>>>>>>>>>>>"); logger.info(">>>>>>>>>>>>>>>>>>>>>>>终端统计定时任务>>>>>>>>>>>>>>>>>>>>>");
logger.info(">>>>>>>>>>>>>>>>>>>>>>>终端统计定时任务>>>>>>>>>>>>>>>>>>>>>"); logger.info(">>>>>>>>>>>>>>>>>>>>>>>终端统计定时任务>>>>>>>>>>>>>>>>>>>>>");
@ -99,7 +99,7 @@ public class XhpcHistoryOrderController extends BaseController {
* 场站统计 * 场站统计
*/ */
@GetMapping("/test2") @GetMapping("/test2")
@Scheduled(cron = "0 0/7 * * * ?") //@Scheduled(cron = "0 0/7 * * * ?")
public void test2(){ public void test2(){
logger.info(">>>>>>>>>>>>>>>>>>>>>>>场站统计定时任务>>>>>>>>>>>>>>>>>>>>>"); logger.info(">>>>>>>>>>>>>>>>>>>>>>>场站统计定时任务>>>>>>>>>>>>>>>>>>>>>");
logger.info(">>>>>>>>>>>>>>>>>>>>>>>场站统计定时任务>>>>>>>>>>>>>>>>>>>>>"); logger.info(">>>>>>>>>>>>>>>>>>>>>>>场站统计定时任务>>>>>>>>>>>>>>>>>>>>>");
@ -111,7 +111,7 @@ public class XhpcHistoryOrderController extends BaseController {
* 日期统计 * 日期统计
*/ */
@GetMapping("/test1") @GetMapping("/test1")
@Scheduled(cron = "0 0/6 * * * ?") //@Scheduled(cron = "0 0/6 * * * ?")
public void test1(){ public void test1(){
logger.info(">>>>>>>>>>>>>>>>>>>>>>>日期统计定时任务>>>>>>>>>>>>>>>>>>>>>"); logger.info(">>>>>>>>>>>>>>>>>>>>>>>日期统计定时任务>>>>>>>>>>>>>>>>>>>>>");
logger.info(">>>>>>>>>>>>>>>>>>>>>>>日期统计定时任务>>>>>>>>>>>>>>>>>>>>>"); logger.info(">>>>>>>>>>>>>>>>>>>>>>>日期统计定时任务>>>>>>>>>>>>>>>>>>>>>");
@ -403,7 +403,7 @@ public class XhpcHistoryOrderController extends BaseController {
* 小时统计 * 小时统计
*/ */
@GetMapping("/test") @GetMapping("/test")
@Scheduled(cron = "0 0/5 * * * ?") //@Scheduled(cron = "0 0/5 * * * ?")
public void test(){ public void test(){
logger.info(">>>>>>>>>>>>>>>>>>>>>>>小时统计定时任务>>>>>>>>>>>>>>>>>>>>>"); logger.info(">>>>>>>>>>>>>>>>>>>>>>>小时统计定时任务>>>>>>>>>>>>>>>>>>>>>");
logger.info(">>>>>>>>>>>>>>>>>>>>>>>小时统计定时任务>>>>>>>>>>>>>>>>>>>>>"); logger.info(">>>>>>>>>>>>>>>>>>>>>>>小时统计定时任务>>>>>>>>>>>>>>>>>>>>>");

View File

@ -171,13 +171,11 @@ public class XhpcChargeOrderServiceImpl implements IXhpcChargeOrderService {
int number =0; int number =0;
if(!"".equals(userMessage.get("soc")) && userMessage.get("soc") !=null && !"".equals(userMessage.get("soc"))){ if(!"".equals(userMessage.get("soc")) && userMessage.get("soc") !=null && !"".equals(userMessage.get("soc"))){
number =Integer.parseInt(userMessage.get("soc").toString()); number =Integer.parseInt(userMessage.get("soc").toString());
logger.info("<<<<<<<<<<<<<<<<<<<<<<<<用户>>>>>>>>>>>>>>>>>:"+number);
} }
//平台 //平台
String soc = redisService.getCacheObject("global:SOC"); String soc = redisService.getCacheObject("global:SOC");
if(!"".equals(soc) && soc!=null){ if(!"".equals(soc) && soc!=null){
if(number!=0){ if(number!=0){
logger.info("<<<<<<<<<<<<<<<<<<<<<<<<平台>>>>>>>>>>>>>>>>>:"+soc);
if(Integer.parseInt(soc)-number<0){ if(Integer.parseInt(soc)-number<0){
number=Integer.parseInt(soc); number=Integer.parseInt(soc);
} }
@ -188,7 +186,6 @@ public class XhpcChargeOrderServiceImpl implements IXhpcChargeOrderService {
Map<String, Object> operatorMessage = xhpcChargeOrderMapper.getOperatorMessage(xhpcTerminal.getChargingStationId()); Map<String, Object> operatorMessage = xhpcChargeOrderMapper.getOperatorMessage(xhpcTerminal.getChargingStationId());
if(operatorMessage !=null && operatorMessage.get("soc") !=null && !"".equals(operatorMessage.get("soc"))){ if(operatorMessage !=null && operatorMessage.get("soc") !=null && !"".equals(operatorMessage.get("soc"))){
if(number!=0){ if(number!=0){
logger.info("<<<<<<<<<<<<<<<<<<<<<<<<营运商>>>>>>>>>>>>>>>>>:"+operatorMessage.get("soc").toString());
if(Integer.parseInt(operatorMessage.get("soc").toString())-number<0){ if(Integer.parseInt(operatorMessage.get("soc").toString())-number<0){
number=Integer.parseInt(operatorMessage.get("soc").toString()); number=Integer.parseInt(operatorMessage.get("soc").toString());
} }
@ -224,7 +221,7 @@ public class XhpcChargeOrderServiceImpl implements IXhpcChargeOrderService {
if (xhpcChargingPileById != null && xhpcChargingPileById.get("power") != null) { if (xhpcChargingPileById != null && xhpcChargingPileById.get("power") != null) {
xhpcChargeOrder.setPower(xhpcChargingPileById.get("power").toString()); xhpcChargeOrder.setPower(xhpcChargingPileById.get("power").toString());
} }
xhpcChargeOrder.setRateModelId(xhpcTerminal.getRateModelId()); xhpcChargeOrder.setRateModelId(Long.valueOf(r1.getData().toString()));
if (type == 1) { if (type == 1) {
xhpcChargeOrder.setChargingMode("小华充电微信"); xhpcChargeOrder.setChargingMode("小华充电微信");
} else { } else {