From 35355b33ce0bc54d4d495f8e53ef8ebe7d771024 Mon Sep 17 00:00:00 2001 From: 18123374652 <2265829957@qq.com> Date: Thu, 7 Mar 2024 11:19:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=85=85=E5=80=BC=E9=87=91?= =?UTF-8?q?=E9=A2=9D=EF=BC=8C=E7=99=BB=E5=BD=95=EF=BC=8C=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E9=80=9F=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xhpc/auth/controller/TokenController.java | 27 +++++++++--- .../java/com/xhpc/auth/form/LoginBody.java | 20 +++++++++ .../controller/StationLogController.java | 7 +++- .../XhpcClearingCheckoutController.java | 4 +- .../activity/service/StationLogService.java | 3 +- .../service/impl/StationLogServiceImpl.java | 41 +++++++++++++++++-- .../mapper/XhpcChargingStationMapper.xml | 10 ++++- .../mapper/XhpcClearingCheckoutMapper.xml | 9 +++- .../order/api/XhpcChargeOrderController.java | 2 +- .../XhpcHistoryOrderController.java | 4 +- .../impl/XhpcChargeOrderServiceImpl.java | 10 +---- .../impl/XhpcRealTimeOrderServiceImpl.java | 3 ++ .../controller/AlipayPaymentController.java | 6 +-- .../controller/WxPaymentController.java | 7 ++-- .../pp/controller/ChargingController.java | 4 +- .../pp/logic/PileStartChargingDataLogic.java | 6 +++ .../com/xhpc/pp/logic/RealtimeDataLogic.java | 16 ++++---- .../pp/logic/RemoteStartReplyDataLogic.java | 10 ++++- 18 files changed, 143 insertions(+), 46 deletions(-) diff --git a/ruoyi-auth/src/main/java/com/xhpc/auth/controller/TokenController.java b/ruoyi-auth/src/main/java/com/xhpc/auth/controller/TokenController.java index f62ad6f3..0efffdd2 100644 --- a/ruoyi-auth/src/main/java/com/xhpc/auth/controller/TokenController.java +++ b/ruoyi-auth/src/main/java/com/xhpc/auth/controller/TokenController.java @@ -100,6 +100,24 @@ public class TokenController extends BaseController return R.fail(HttpStatus.ERROR_STATUS, "手机号验证码错误"); } } + + String code = form.getCode(); + String uuid = form.getUuid(); + + if (StringUtils.isEmpty(code)) + { + return R.fail("1003", "图形验证码不能为空"); + } + if (StringUtils.isEmpty(uuid)) + { + return R.fail("1003", "图形验验证码已失效"); + } + String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid; + String captcha = redisService.getCacheObject(verifyKey); + if (!code.equalsIgnoreCase(captcha)) { + redisService.deleteObject(verifyKey); + return R.fail("1003", "图形验证码错误"); + } // 用户登录 LoginUser userInfo = sysLoginService.login(form.getUsername(), "123456",1,form.getTenantId()); // 获取登录token @@ -125,12 +143,10 @@ public class TokenController extends BaseController return R.fail("1003", "图形验验证码已失效"); } String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid; - System.out.println("=============uuid========="+uuid); String captcha = redisService.getCacheObject(verifyKey); - System.out.println("=============captcha========="+captcha); - redisService.deleteObject(verifyKey); - if (!code.equalsIgnoreCase(captcha) && !code.equals("741852963")) { - return R.fail("1003", "手机号验证码错误"); + if (!code.equalsIgnoreCase(captcha)) { + redisService.deleteObject(verifyKey); + return R.fail("1003", "图形验证码错误"); } } //验证 输入的验证码 @@ -143,7 +159,6 @@ public class TokenController extends BaseController return R.fail("1003", "请输入正确的手机号"); } String random = getRandom(); - String content ="【小华充电】您的验证码是:"+random+",有效期为5分钟。如非本人操作,可不用理会。"; //添加短信记录 try { //用户使用的Key diff --git a/ruoyi-auth/src/main/java/com/xhpc/auth/form/LoginBody.java b/ruoyi-auth/src/main/java/com/xhpc/auth/form/LoginBody.java index 903da49c..53eee521 100644 --- a/ruoyi-auth/src/main/java/com/xhpc/auth/form/LoginBody.java +++ b/ruoyi-auth/src/main/java/com/xhpc/auth/form/LoginBody.java @@ -19,6 +19,10 @@ public class LoginBody private String tenantId; + private String code; + + private String uuid; + public String getUsername() { return username; @@ -46,4 +50,20 @@ public class LoginBody public void setTenantId(String tenantId) { this.tenantId = tenantId; } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } } diff --git a/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/controller/StationLogController.java b/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/controller/StationLogController.java index 8c27ce45..8c7221f5 100644 --- a/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/controller/StationLogController.java +++ b/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/controller/StationLogController.java @@ -9,6 +9,7 @@ import com.xhpc.activity.service.StationLogService; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; import java.util.HashMap; import java.util.Map; @@ -21,14 +22,16 @@ public class StationLogController extends BaseController { StationLogService stationLogService; @GetMapping("/getPage") - public TableDataInfo getPilePage(@RequestParam(required = false) String tenantId, + public TableDataInfo getPilePage( + HttpServletRequest request, + @RequestParam(required = false) String tenantId, @RequestParam(required = false) Integer number) { startPage(); Map params = new HashMap<>(); params.put("operatorId", SecurityUtils.getUserId()); params.put("number", number); params.put("tenantId", tenantId); - return getDataTable(stationLogService.getStationPage(params)); + return getDataTable(stationLogService.getStationPage(request,params)); } diff --git a/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/controller/XhpcClearingCheckoutController.java b/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/controller/XhpcClearingCheckoutController.java index 7867a19c..a9365a0e 100644 --- a/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/controller/XhpcClearingCheckoutController.java +++ b/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/controller/XhpcClearingCheckoutController.java @@ -62,12 +62,14 @@ public class XhpcClearingCheckoutController extends BaseController { @GetMapping("/getCheckoutPage") public TableDataInfo getCheckoutPage(Long operatorId, - String tenantId) { + String tenantId,String startTime,String endTime) { startPage(); Map params = new HashMap<>(); params.put("tenantId", tenantId); params.put("operatorId", operatorId); + params.put("startTime", startTime); + params.put("endTime", endTime); return getDataTable(checkoutService.getCheckoutPage(params)); } diff --git a/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/service/StationLogService.java b/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/service/StationLogService.java index 2cbd17c0..a5e83c19 100644 --- a/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/service/StationLogService.java +++ b/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/service/StationLogService.java @@ -1,12 +1,13 @@ package com.xhpc.activity.service; +import javax.servlet.http.HttpServletRequest; import java.util.List; import java.util.Map; public interface StationLogService { - List> getStationPage(Map params); + List> getStationPage(HttpServletRequest request, Map params); List> getStationRatePage(Long stationId); diff --git a/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/service/impl/StationLogServiceImpl.java b/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/service/impl/StationLogServiceImpl.java index eff1bdc2..afabc29e 100644 --- a/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/service/impl/StationLogServiceImpl.java +++ b/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/service/impl/StationLogServiceImpl.java @@ -2,23 +2,58 @@ package com.xhpc.activity.service.impl; import com.xhpc.activity.mapper.XhpcChargingStationMapper; import com.xhpc.activity.service.StationLogService; +import com.xhpc.common.core.web.service.BaseService; +import com.xhpc.common.security.service.TokenService; +import com.xhpc.common.util.UserTypeUtil; +import com.xhpc.system.api.domain.SysUser; +import com.xhpc.system.api.model.LoginUser; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @Service -public class StationLogServiceImpl implements StationLogService { +public class StationLogServiceImpl extends BaseService implements StationLogService { @Resource XhpcChargingStationMapper stationMapper; + @Autowired + private TokenService tokenService; @Override - public List> getStationPage(Map params){ - return stationMapper.selectXhpcChargingStationList(params); + public List> getStationPage(HttpServletRequest request, Map params){ + //获取登陆用户 + LoginUser loginUser = tokenService.getLoginUser(request); + SysUser sysUser = loginUser.getSysUser(); + Long sysUserId = sysUser.getUserId(); + //桩的统计、该时段金额 + List> list =new ArrayList<>(); + + if(!UserTypeUtil.SYS_USER_TYPE_ADMIN.equals(sysUser.getUserId())){ + if(UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())){ + Long operatorId = sysUser.getOperatorId(); + params.put("type",1); + params.put("operatorId",operatorId); + //运营商看自己的场站 + list = stationMapper.selectXhpcChargingStationList(params); + }else{ + //查询赋值的场站 + params.put("type",2); + params.put("operatorId",sysUserId); + list = stationMapper.selectXhpcChargingStationList(params); + } + }else{ + startPage(); + params.put("type",0); + list = stationMapper.selectXhpcChargingStationList(params); + } + return list; } diff --git a/xhpc-modules/xhpc-activity/src/main/resources/mapper/XhpcChargingStationMapper.xml b/xhpc-modules/xhpc-activity/src/main/resources/mapper/XhpcChargingStationMapper.xml index 320585c9..6d7e1ea8 100644 --- a/xhpc-modules/xhpc-activity/src/main/resources/mapper/XhpcChargingStationMapper.xml +++ b/xhpc-modules/xhpc-activity/src/main/resources/mapper/XhpcChargingStationMapper.xml @@ -16,10 +16,16 @@ from xhpc_charging_station as cs left join xhpc_operator as ope on cs.operator_id = ope.operator_id where cs.del_flag =0 - + + and cs.charging_station_id = #{params.chargingStationId} + + + and cs.operator_id = #{params.operatorId} + + and cs.charging_station_id in(select charging_station_id from xhpc_charging_station where operator_id=#{params.operatorId}) - + and cs.charging_station_id in(select charging_station_id from xhpc_user_privilege where user_id=#{params.operatorId}) diff --git a/xhpc-modules/xhpc-activity/src/main/resources/mapper/XhpcClearingCheckoutMapper.xml b/xhpc-modules/xhpc-activity/src/main/resources/mapper/XhpcClearingCheckoutMapper.xml index dc3f6774..b5b4d671 100644 --- a/xhpc-modules/xhpc-activity/src/main/resources/mapper/XhpcClearingCheckoutMapper.xml +++ b/xhpc-modules/xhpc-activity/src/main/resources/mapper/XhpcClearingCheckoutMapper.xml @@ -96,6 +96,12 @@ left join xhpc_charging_station as ct on ct.charging_station_id = ho.charging_station_id left join xhpc_operator as op on op.operator_id = ct.operator_id where ho.check_status not in (1,2) and ho.del_flag=0 + + and ho.end_time >= #{params.startTime} + + + and ho.end_time <= #{params.endTime} + GROUP BY ct.operator_id ) ho on ho.operatorId = xo.operator_id LEFT JOIN ( @@ -103,7 +109,8 @@ ifnull(sum(ho.act_power_price + ho.act_service_price), 0) as 'cashAmount', ho.operator_id as 'operatorId' from xhpc_clearing_history_order as ho - where ho.check_status=2 and ho.del_flag=0 and ho.clearing_checkout_id is null GROUP BY ho.operator_id + where ho.check_status=2 and ho.del_flag=0 and ho.clearing_checkout_id is null + GROUP BY ho.operator_id ) cho on cho.operatorId= xo.operator_id where xo.del_flag = 0 diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/api/XhpcChargeOrderController.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/api/XhpcChargeOrderController.java index d0e8c359..5acb7417 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/api/XhpcChargeOrderController.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/api/XhpcChargeOrderController.java @@ -193,7 +193,7 @@ public class XhpcChargeOrderController extends BaseController { { logger.info("<<<<<<<<<>>>>>>>"+serialNumber+">>>vinNumber>>>"+vinNumber+">>>"); return R.fail(1880, "无效VIN码"); - // return iXhpcChargeOrderService.pileVin(serialNumber,vinNumber); + //return iXhpcChargeOrderService.pileVin(serialNumber,vinNumber); } @GetMapping("/constantSoc") diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderController.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderController.java index e4f12851..46d13abc 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderController.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderController.java @@ -889,7 +889,7 @@ public class XhpcHistoryOrderController extends BaseController { * 24小时异常订单自动结算 */ @GetMapping("/test4") - //@Scheduled(cron = "0 0/5 * * * ?") + @Scheduled(cron = "0 0/5 * * * ?") public void test4(){ //获取异常的订单 24小时之外的异常订单 List> xhpcChargeOrderList= chargeOrderService.getXhpcChargeOrderStatus(2); @@ -916,7 +916,7 @@ public class XhpcHistoryOrderController extends BaseController { * @param */ @GetMapping("/test5") - //@Scheduled(cron = "0 0/5 * * * ?") + @Scheduled(cron = "0 0/5 * * * ?") public void test5(){ logger.info(">>>>>>>>>>>>>>>>>>>>>>>标记异常大于创建4小时,标记为异常>>>>>>>>>>>>>>>>>>>>>"); chargeOrderService.updateStatus(); diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcChargeOrderServiceImpl.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcChargeOrderServiceImpl.java index b2269ce9..c2cf3b56 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcChargeOrderServiceImpl.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcChargeOrderServiceImpl.java @@ -402,9 +402,6 @@ public class XhpcChargeOrderServiceImpl extends BaseService implements IXhpcChar return AjaxResult.error(1104, "请登陆相应账号停止充电"); } } - System.out.println("=================111========请登陆相应账号停止充电==================停止 充电=================="+order.getSerialNumber()); - System.out.println("=================111========请登陆相应账号停止充电==================停止 充电=================="+order.getSerialNumber()); - System.out.println("=================111========请登陆相应账号停止充电==================停止 充电=================="+order.getSerialNumber()); R oa = powerPileService.stopCharging(order.getSerialNumber(), xhpcTerminal.getPileSerialNumber(), xhpcTerminal.getSerialNumber(), version); @@ -950,9 +947,7 @@ public class XhpcChargeOrderServiceImpl extends BaseService implements IXhpcChar if (serialNumber.length() != 16 || !m.matches()) { return R.fail(1104, "无效的终端编号"); } - //查看充电用户金额是否大于5元 - //Map userMessage = xhpcChargeOrderMapper.getUserMessage(userId); BigDecimal a = new BigDecimal(5); if (userMessage == null || userMessage.get("balance") == null || a.compareTo(new BigDecimal(userMessage.get("balance").toString())) == 1) { return R.fail(1100, "金额小于5元,不能充电,请充值后再进行充电"); @@ -1006,9 +1001,6 @@ public class XhpcChargeOrderServiceImpl extends BaseService implements IXhpcChar } } } - logger.info("<<<<<<<<<<<<<<<<<<<<<<<<终端编号>>>>"+serialNumber+">>>>>>>>>>>>>"+tenantId); - - logger.info("<<<<<<<<<<<<<<<<<<<<<<<<终端编号>>>>>>>>>>>>>>>>"); //余额 String balance = new BigDecimal(userMessage.get("balance").toString()).multiply(new BigDecimal(100)).toString(); //获取桩信息 @@ -1084,7 +1076,7 @@ public class XhpcChargeOrderServiceImpl extends BaseService implements IXhpcChar @Override public void run() { R r1 = powerPileService.startCharging(startChargingData); - logger.info("<<<<<<<<<<<<<<<<<<<<<<<<充电返回>>>>>>>>>>>>>>>>>"); + logger.info("<<<<<<<<<<<<<<<<<<<<>>>>>VIN>>>>>>>>>>>"); logger.info("<<<<<<<<<<<<<<<<<<<<<<<<" + r1.getCode() + ">>>>>>>>>>>>>>>>>"); logger.info("<<<<<<<<<<<<<<<<<<<<<<<<" + r1.getMsg() + ">>>>>>>>>>>>>>>>>"); logger.info("<<<<<<<<<<<<<<<<<<<<<<<<" + r1.getData() + ">>>>>>>>>>>>>>>>>"); diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcRealTimeOrderServiceImpl.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcRealTimeOrderServiceImpl.java index b3144812..f4012e07 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcRealTimeOrderServiceImpl.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcRealTimeOrderServiceImpl.java @@ -1154,6 +1154,9 @@ public class XhpcRealTimeOrderServiceImpl extends BaseService implements IXhpcRe if("刷卡".equals(xhpcChargeOrder.getChargingMode())){ xhpcHistoryOrder.setChargingMode("刷卡"); } + if("VIN码".equals(xhpcChargeOrder.getChargingMode())){ + xhpcHistoryOrder.setChargingMode("VIN码"); + } }else{ //订单异常 xhpcChargeOrder.setStatus(2); diff --git a/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/AlipayPaymentController.java b/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/AlipayPaymentController.java index b18d8495..57049562 100644 --- a/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/AlipayPaymentController.java +++ b/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/AlipayPaymentController.java @@ -96,9 +96,9 @@ public class AlipayPaymentController { if(new BigDecimal(5).compareTo(new BigDecimal(amount))==1){ return AjaxResult.error(HttpStatus.NOT_NULL, "充值金额不能少于5元"); } -// if(new BigDecimal(200).compareTo(new BigDecimal(amount))==-1){ -// return AjaxResult.error(HttpStatus.NOT_NULL, "充值金额不能大于200元"); -// } + if(new BigDecimal(600).compareTo(new BigDecimal(amount))==-1){ + return AjaxResult.error(HttpStatus.NOT_NULL, "充值金额不能大于600元"); + } } //用户信息id String userId = StringUtils.valueOf(map.get("userId")); diff --git a/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/WxPaymentController.java b/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/WxPaymentController.java index 2f7e966d..9bc0fd4a 100644 --- a/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/WxPaymentController.java +++ b/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/WxPaymentController.java @@ -97,10 +97,11 @@ public class WxPaymentController { if(new BigDecimal(5).compareTo(new BigDecimal(amount))==1){ return AjaxResult.error(HttpStatus.NOT_NULL, "充值金额不能少于5元"); } -// if(new BigDecimal(200).compareTo(new BigDecimal(amount))==-1){ -// return AjaxResult.error(HttpStatus.NOT_NULL, "充值金额不能大于200元"); -// } + if(new BigDecimal(600).compareTo(new BigDecimal(amount))==-1){ + return AjaxResult.error(HttpStatus.NOT_NULL, "充值金额不能大于600元"); + } } + //用户信息id if(map.get("userId") ==null || "".equals(map.get("userId").toString())){ return AjaxResult.error(HttpStatus.NOT_NULL, "请在我的里面进行充值"); diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/ChargingController.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/ChargingController.java index a612ff9f..7a6afe8f 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/ChargingController.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/ChargingController.java @@ -397,8 +397,8 @@ public class ChargingController { public static void main(String[] args) { - Integer F401 = HexUtils.reverseHexInt("A6010000"); - System.out.println("F401 转化成="+F401); + Integer FFFF = HexUtils.reverseHexInt("51"); + System.out.println("51 转化成="+FFFF); Integer F402 = HexUtils.reverseHexInt("B602"); System.out.println("F402 转化成="+F402); diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/PileStartChargingDataLogic.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/PileStartChargingDataLogic.java index 55e42269..f1f8e7f2 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/PileStartChargingDataLogic.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/PileStartChargingDataLogic.java @@ -203,9 +203,15 @@ public class PileStartChargingDataLogic implements ServiceLogic { Integer startFlag = result.equals(ServiceResult.HEX_01) ? 2: 4; + log.info("======================ServiceResult.HEX_01========================="+ServiceResult.HEX_01); + log.info("======================result========================="+result); + log.info("======================startFlag========================="+startFlag); + + String pushOrderKey = "pushOrder:".concat(orderNo); Map pushOrder = REDIS.getCacheMap(pushOrderKey); if (pushOrder != null) { + log.info("======================startChargeSeqStat========================="+startFlag); REDIS.setCacheMapValue(pushOrderKey, "startChargeSeqStat", startFlag); } else { Map map = new HashMap<>(); diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/RealtimeDataLogic.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/RealtimeDataLogic.java index 817ababf..88b9f50d 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/RealtimeDataLogic.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/RealtimeDataLogic.java @@ -28,14 +28,12 @@ import org.springframework.stereotype.Component; import javax.annotation.Resource; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; +import static cn.hutool.core.date.DatePattern.NORM_DATETIME_FORMAT; import static com.xhpc.common.data.redis.StaticBeanUtil.REDIS; import static com.xhpc.pp.server.ChargingPileServer.default_version; import static com.xhpc.pp.utils.HexUtils.reverseHexInt; @@ -130,6 +128,9 @@ public class RealtimeDataLogic implements ServiceLogic { R r = pileOrderService.pileStartup(orderNo, 1, "启动充电成功"); if (r.getCode() == 200) { cacheGun.put("ac.on", true); + cacheGun.put("orderkey","order:"+orderNo); + final String orderstarttime = DateUtil.format(Calendar.getInstance().getTime(), NORM_DATETIME_FORMAT); + cacheGun.put("pileStartTime", orderstarttime); } } List realtimeDataList = (List) cacheOrder.get("realtimeDataList"); @@ -169,8 +170,6 @@ public class RealtimeDataLogic implements ServiceLogic { Integer vul = (Integer) cachePile.get("voltageUpperLimits"); Integer cul = (Integer) cachePile.get("currentLimit"); if(vul != null && cul != null && (wc > cul || wv > vul)) { - System.out.println("==========================wc > cul || wv > vul==================停止 充电=================="+pileNo); - System.out.println("==========================wc > cul || wv > vul==================停止 充电=================="+pileNo); System.out.println("==========================wc > cul || wv > vul==================停止 充电=================="+pileNo); R r = chargingController.stopCharging(pileNo, gunId, default_version); if (r.getCode() == 200) { @@ -181,9 +180,8 @@ public class RealtimeDataLogic implements ServiceLogic { } else { Integer stopSoc = (Integer) cacheOrder.get("stopSoc"); if (stopSoc != null && socInt >= stopSoc) { - System.out.println("==========================stopSoc==================停止 充电=================="+pileNo); - System.out.println("==========================stopSoc==================停止 充电=================="+pileNo); - System.out.println("==========================stopSoc==================停止 充电=================="+pileNo); + System.out.println("==========================stopSoc===="+stopSoc+"==============停止 充电=================="+pileNo); + System.out.println("==========================socInt====="+socInt+"=============停止 充电=================="+pileNo); R r = chargingController.stopCharging(pileNo, gunId, default_version); String alerted = (String) cacheOrder.get("socalerted"); String tel = (String) cacheOrder.get("tel"); diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/RemoteStartReplyDataLogic.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/RemoteStartReplyDataLogic.java index 2f0db351..b85af8dd 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/RemoteStartReplyDataLogic.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/RemoteStartReplyDataLogic.java @@ -63,8 +63,10 @@ public class RemoteStartReplyDataLogic implements ServiceLogic { REDIS.setCacheMap(gunkey, cacheGun); String pushOrderKey = orderkey.replace("order:", "pushOrder:"); Map pushOrder = REDIS.getCacheMap(pushOrderKey); - + log.info("===================11===启动失敗成功===11==RemoteStartReplyDataLogic===================="+remoteStartReplyData.toString()); + log.info("===================222===启动失敗成功===33==RemoteStartReplyDataLogic===================="+remoteStartReplyData.getStartResult()); if (HEX_01.equals(remoteStartReplyData.getStartResult())) { + log.info("======================启动充电成功=====RemoteStartReplyDataLogic===================="); final String orderstarttime = DateUtil.format(Calendar.getInstance().getTime(), NORM_DATETIME_FORMAT); cacheGun.put("pileStartTime", orderstarttime); cacheGun.put("orderstoptime", null); @@ -76,18 +78,24 @@ public class RemoteStartReplyDataLogic implements ServiceLogic { REDIS.setCacheMap(orderkey, cacheOrder); pileOrderService.pileStartup(orderNo, 1, "启动充电成功"); if (pushOrder != null) { + log.info("==========11========RemoteStartReplyDataLogic======11=============="); REDIS.setCacheMapValue(pushOrderKey, "startChargeSeqStat", 2); } else { + log.info("==========22========RemoteStartReplyDataLogic======22=============="); Map map = new HashMap<>(); map.put("startChargeSeqStat", Integer.valueOf(2)); REDIS.setCacheMap(pushOrderKey, map); } } else { + log.info("======================启动失敗成功=====RemoteStartReplyDataLogic===================="); + final String remark = frs.get(remoteStartReplyData.getFailReason()); pileOrderService.pileStartup(orderNo, 2, remark == null ? "未知错误" : remark); if (pushOrder != null) { + log.info("==========33========RemoteStartReplyDataLogic======33=============="); REDIS.setCacheMapValue(pushOrderKey, "startChargeSeqStat", 4); } else { + log.info("=========44========RemoteStartReplyDataLogic======44=============="); Map map = new HashMap<>(); map.put("startChargeSeqStat", Integer.valueOf(4)); REDIS.setCacheMap(pushOrderKey, map);