From f5b70781bdbf6f2bc35d48b47fd198b9211005db Mon Sep 17 00:00:00 2001 From: "2265829957@qq.com" <2265829957@qq.com> Date: Fri, 6 Jun 2025 16:33:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE=E6=9D=83?= =?UTF-8?q?=E9=99=90=E3=80=81=E4=BF=AE=E6=94=B9BMS=E7=94=B5=E6=B5=81?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/bootstrap.yml | 6 +- ruoyi-auth/src/main/resources/bootstrap.yml | 4 +- .../src/main/resources/bootstrap.yml | 6 +- .../src/main/resources/bootstrap.yml | 4 +- .../src/main/resources/bootstrap.yml | 4 +- .../src/main/resources/bootstrap.yml | 4 +- .../src/main/resources/bootstrap.yml | 4 +- .../src/main/resources/bootstrap.yml | 4 +- .../domain/XhpcWorkStationDomain.java | 6 +- .../service/impl/WorkOrderServiceImpl.java | 32 ++- .../service/impl/WorkStationServiceImpl.java | 61 ++++- .../impl/XhpcClearingCheckoutServiceImpl.java | 27 +- .../XhpcClearingHistoryOrderServiceImpl.java | 30 +-- .../xhpc/activity/task/AutoClearDataTask.java | 29 +- .../activity/task/SyncHistoryOrderTask.java | 2 +- .../src/main/resources/bootstrap.yml | 4 +- .../mapper/XhpcStationDeviceMapper.xml | 6 + .../mapper/XhpcWorkStationMapper.xml | 53 ++-- .../src/main/resources/bootstrap.yml | 4 +- .../service/XhpcChargingPileServiceImpl.java | 2 +- .../service/XhpcPlaceholderServiceImpl.java | 2 +- .../src/main/resources/bootstrap.yml | 4 +- .../mapper/XhpcChargingStationMapper.xml | 6 +- .../resources/mapper/XhpcTerminalMapper.xml | 5 +- .../com/xhpc/pp/utils/BMSCurrentParser.java | 47 ++++ .../src/main/resources/bootstrap.yml | 4 +- .../XhpcPlaceholderOrderController.java | 2 +- .../impl/XhpcPlaceholderOrderServiceImpl.java | 254 +++++++++++------- .../impl/XhpcRealTimeOrderServiceImpl.java | 19 +- .../src/main/resources/bootstrap.yml | 4 +- .../mapper/XhpcChargeOrderMapper.xml | 5 +- .../mapper/XhpcPlaceholderOrderMapper.xml | 11 +- .../resources/mapper/XhpcStatisticsMapper.xml | 9 + .../src/main/resources/bootstrap.yml | 4 +- .../pp/controller/ChargingController.java | 2 +- .../logic/BmsReqChargerOutputDataLogic.java | 91 ++++--- .../com/xhpc/pp/logic/OrderDataLogic.java | 6 +- .../com/xhpc/pp/logic/RealtimeDataLogic.java | 38 ++- .../java/com/xhpc/pp/server/HBCheckTask.java | 2 +- .../src/main/resources/bootstrap.yml | 4 +- .../src/main/resources/bootstrap.yml | 4 +- .../src/main/resources/bootstrap.yml | 4 +- 42 files changed, 542 insertions(+), 277 deletions(-) create mode 100644 xhpc-modules/xhpc-common/src/main/java/com/xhpc/pp/utils/BMSCurrentParser.java diff --git a/evcs-modules/evcs-core/src/main/resources/bootstrap.yml b/evcs-modules/evcs-core/src/main/resources/bootstrap.yml index 674a5abe..0b3b311a 100644 --- a/evcs-modules/evcs-core/src/main/resources/bootstrap.yml +++ b/evcs-modules/evcs-core/src/main/resources/bootstrap.yml @@ -1,4 +1,4 @@ -# Tomcat 9009 不走推送 name: evcs 9099走推送 name: jp 120.26.46.180:8858 +# Tomcat 9009 不走推送 name: evcs 9099走推送 name: jp mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848 server: port: 9099 @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 120.26.46.180:8858 + server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848 config: # 配置中心地址 - server-addr: 120.26.46.180:8858 + server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/ruoyi-auth/src/main/resources/bootstrap.yml b/ruoyi-auth/src/main/resources/bootstrap.yml index 39b4ae7d..62be9823 100644 --- a/ruoyi-auth/src/main/resources/bootstrap.yml +++ b/ruoyi-auth/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 120.26.46.180:8858 + server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848 config: # 配置中心地址 - server-addr: 120.26.46.180:8858 + server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/ruoyi-gateway/src/main/resources/bootstrap.yml b/ruoyi-gateway/src/main/resources/bootstrap.yml index 902c9297..5bbe74ea 100644 --- a/ruoyi-gateway/src/main/resources/bootstrap.yml +++ b/ruoyi-gateway/src/main/resources/bootstrap.yml @@ -16,10 +16,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 120.26.46.180:8858 + server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848 config: # 配置中心地址 - server-addr: 120.26.46.180:8858 + server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848 # 配置文件格式 file-extension: yml # 共享配置 @@ -35,7 +35,7 @@ spring: datasource: ds1: nacos: - server-addr: 120.26.46.180:8858 + server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848 dataId: sentinel-ruoyi-gateway groupId: DEFAULT_GROUP data-type: json diff --git a/ruoyi-modules/ruoyi-file/src/main/resources/bootstrap.yml b/ruoyi-modules/ruoyi-file/src/main/resources/bootstrap.yml index b5bedcae..020707b3 100644 --- a/ruoyi-modules/ruoyi-file/src/main/resources/bootstrap.yml +++ b/ruoyi-modules/ruoyi-file/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 120.26.46.180:8858 + server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848 config: # 配置中心地址 - server-addr: 120.26.46.180:8858 + server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/ruoyi-modules/ruoyi-gen/src/main/resources/bootstrap.yml b/ruoyi-modules/ruoyi-gen/src/main/resources/bootstrap.yml index f455ff02..d6293b3a 100644 --- a/ruoyi-modules/ruoyi-gen/src/main/resources/bootstrap.yml +++ b/ruoyi-modules/ruoyi-gen/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 120.26.46.180:8858 + server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848 config: # 配置中心地址 - server-addr: 120.26.46.180:8858 + server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/ruoyi-modules/ruoyi-job/src/main/resources/bootstrap.yml b/ruoyi-modules/ruoyi-job/src/main/resources/bootstrap.yml index f8eb4379..bb947c6e 100644 --- a/ruoyi-modules/ruoyi-job/src/main/resources/bootstrap.yml +++ b/ruoyi-modules/ruoyi-job/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 120.26.46.180:8858 + server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848 config: # 配置中心地址 - server-addr: 120.26.46.180:8858 + server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/bootstrap.yml b/ruoyi-modules/ruoyi-system/src/main/resources/bootstrap.yml index bbd4382c..d0362649 100644 --- a/ruoyi-modules/ruoyi-system/src/main/resources/bootstrap.yml +++ b/ruoyi-modules/ruoyi-system/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 120.26.46.180:8858 + server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848 config: # 配置中心地址 - server-addr: 120.26.46.180:8858 + server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/ruoyi-visual/ruoyi-monitor/src/main/resources/bootstrap.yml b/ruoyi-visual/ruoyi-monitor/src/main/resources/bootstrap.yml index e063163e..09a81fa8 100644 --- a/ruoyi-visual/ruoyi-monitor/src/main/resources/bootstrap.yml +++ b/ruoyi-visual/ruoyi-monitor/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 120.26.46.180:8858 + server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848 config: # 配置中心地址 - server-addr: 120.26.46.180:8858 + server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/domain/XhpcWorkStationDomain.java b/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/domain/XhpcWorkStationDomain.java index cea5e698..1228870e 100644 --- a/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/domain/XhpcWorkStationDomain.java +++ b/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/domain/XhpcWorkStationDomain.java @@ -7,7 +7,7 @@ import java.util.Date; /** * xhpc_work_station - * @author + * @author */ @Data public class XhpcWorkStationDomain implements Serializable { @@ -146,5 +146,7 @@ public class XhpcWorkStationDomain implements Serializable { */ private String tenantId; + private Long chargingStationId; + private static final long serialVersionUID = 1L; -} \ No newline at end of file +} diff --git a/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/service/impl/WorkOrderServiceImpl.java b/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/service/impl/WorkOrderServiceImpl.java index 5f00dd1b..78f158d6 100644 --- a/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/service/impl/WorkOrderServiceImpl.java +++ b/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/service/impl/WorkOrderServiceImpl.java @@ -18,7 +18,12 @@ import com.xhpc.common.api.SmsService; import com.xhpc.common.core.domain.R; import com.xhpc.common.core.exception.CustomException; import com.xhpc.common.core.utils.StringUtils; +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 lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -53,10 +58,33 @@ public class WorkOrderServiceImpl implements WorkOrderService { WorkUserService workUserService; @Resource WorkTypeService typeService; - + @Autowired + private TokenService tokenService; @Override public List> getOrderPage(Map params) { - return orderMapper.findOrderListByParams(params); + LoginUser loginUser = tokenService.getLoginUser(); + Long sysUserId = loginUser.getUserid(); + SysUser sysUser = loginUser.getSysUser(); + //获取登陆用户 + if(!UserTypeUtil.SYS_USER_TYPE_ADMIN.equals(sysUser.getUserId())){ + if(UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())){ + Long logOperatorId = sysUser.getOperatorId(); + params.put("type", 1); + params.put("userId", logOperatorId); + + //运营商看自己的场站 + return deviceMapper.selectStationGunDeviceListByParams(params); + }else{ + params.put("type", 2); + params.put("userId", sysUserId); + //查询赋值的场站 + return deviceMapper.selectStationGunDeviceListByParams(params); + } + }else{ + params.put("type", 0); + params.put("userId", sysUserId); + return deviceMapper.selectStationGunDeviceListByParams(params); + } } @Override diff --git a/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/service/impl/WorkStationServiceImpl.java b/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/service/impl/WorkStationServiceImpl.java index ecc08f57..50d67d25 100644 --- a/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/service/impl/WorkStationServiceImpl.java +++ b/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/service/impl/WorkStationServiceImpl.java @@ -3,6 +3,7 @@ package com.xhpc.activity.service.impl; import cn.hutool.core.util.StrUtil; import com.xhpc.common.core.exception.CustomException; import com.xhpc.common.core.utils.StringUtils; +import com.xhpc.common.core.web.service.BaseService; import com.xhpc.common.redis.service.RedisService; import com.xhpc.activity.domain.XhpcStationDeviceDomain; import com.xhpc.activity.domain.XhpcWorkStationDomain; @@ -10,10 +11,16 @@ import com.xhpc.activity.mapper.XhpcStationDeviceMapper; import com.xhpc.activity.mapper.XhpcWorkStationMapper; import com.xhpc.activity.service.WorkStationService; import com.xhpc.activity.vo.XhpcStationDeviceVo; +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 org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -21,7 +28,7 @@ import java.util.Map; @Service @Transactional -public class WorkStationServiceImpl implements WorkStationService { +public class WorkStationServiceImpl extends BaseService implements WorkStationService { @Resource XhpcStationDeviceMapper deviceMapper; @@ -31,7 +38,8 @@ public class WorkStationServiceImpl implements WorkStationService { @Resource RedisService redisService; - + @Autowired + private TokenService tokenService; private int getTerminalStatus(String serialNumber) { //0离线 1故障 2空闲 3充电 4 已插枪 5未知 @@ -65,8 +73,30 @@ public class WorkStationServiceImpl implements WorkStationService { @Override public List> getStationDevice(Map params){ + LoginUser loginUser = tokenService.getLoginUser(); + Long sysUserId = loginUser.getUserid(); + List> deviceList = new ArrayList<>(); + SysUser sysUser = loginUser.getSysUser(); + //获取登陆用户 + if(!UserTypeUtil.SYS_USER_TYPE_ADMIN.equals(sysUser.getUserId())){ + if(UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())){ + Long logOperatorId = sysUser.getOperatorId(); + params.put("type", 1); + params.put("userId", logOperatorId); - List> deviceList = deviceMapper.selectStationGunDeviceListByParams(params); + //运营商看自己的场站 + deviceList =deviceMapper.selectStationGunDeviceListByParams(params); + }else{ + params.put("type", 2); + params.put("userId", sysUserId); + //查询赋值的场站 + deviceList=deviceMapper.selectStationGunDeviceListByParams(params); + } + }else{ + params.put("type", 0); + params.put("userId", sysUserId); + deviceList=deviceMapper.selectStationGunDeviceListByParams(params); + } for(Map map : deviceList){ //状态 int pileSerialNumber = getTerminalStatus(map.get("gunSerialNumber").toString()); @@ -84,7 +114,30 @@ public class WorkStationServiceImpl implements WorkStationService { @Override public List getStationList(Map params){ - return stationMapper.selectListByParams(params); + LoginUser loginUser = tokenService.getLoginUser(); + Long sysUserId = loginUser.getUserid(); + List> list = new ArrayList<>(); + SysUser sysUser = loginUser.getSysUser(); + //获取登陆用户 + if(!UserTypeUtil.SYS_USER_TYPE_ADMIN.equals(sysUser.getUserId())){ + if(UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())){ + Long logOperatorId = sysUser.getOperatorId(); + params.put("type", 1); + params.put("userId", logOperatorId); + + //运营商看自己的场站 + return stationMapper.selectListByParams(params); + }else{ + params.put("type", 2); + params.put("userId", sysUserId); + //查询赋值的场站 + return stationMapper.selectListByParams(params); + } + }else{ + params.put("type", 0); + params.put("userId", sysUserId); + return stationMapper.selectListByParams(params); + } } diff --git a/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/service/impl/XhpcClearingCheckoutServiceImpl.java b/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/service/impl/XhpcClearingCheckoutServiceImpl.java index fb6de7e7..cb12d687 100644 --- a/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/service/impl/XhpcClearingCheckoutServiceImpl.java +++ b/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/service/impl/XhpcClearingCheckoutServiceImpl.java @@ -177,16 +177,23 @@ public class XhpcClearingCheckoutServiceImpl extends BaseService implements Xhpc domain.setStatus(99); checkoutMapper.insert(domain); - executorService.execute(new Runnable() { - @Override - public void run() { - if (StringUtils.isEmpty(domain.getClearingOrderIds())) { - asyncService.updateCheckoutByOperatorAsync(domain.getOperatorId(), domain.getClearingCheckoutId()); - } else { - asyncService.updateCheckoutByOrderIdsAsync(domain.getClearingOrderIds(), domain.getClearingCheckoutId()); - } - } - }); + if (StringUtils.isEmpty(domain.getClearingOrderIds())) { + asyncService.updateCheckoutByOperatorAsync(domain.getOperatorId(), domain.getClearingCheckoutId()); + } else { + asyncService.updateCheckoutByOrderIdsAsync(domain.getClearingOrderIds(), domain.getClearingCheckoutId()); + } + + +// executorService.execute(new Runnable() { +// @Override +// public void run() { +// if (StringUtils.isEmpty(domain.getClearingOrderIds())) { +// asyncService.updateCheckoutByOperatorAsync(domain.getOperatorId(), domain.getClearingCheckoutId()); +// } else { +// asyncService.updateCheckoutByOrderIdsAsync(domain.getClearingOrderIds(), domain.getClearingCheckoutId()); +// } +// } +// }); return true; } diff --git a/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/service/impl/XhpcClearingHistoryOrderServiceImpl.java b/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/service/impl/XhpcClearingHistoryOrderServiceImpl.java index d5153790..60a3bddb 100644 --- a/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/service/impl/XhpcClearingHistoryOrderServiceImpl.java +++ b/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/service/impl/XhpcClearingHistoryOrderServiceImpl.java @@ -108,21 +108,21 @@ public class XhpcClearingHistoryOrderServiceImpl extends BaseService implements params.put("chargingPileId", orderVo.getChargingPileId()); params.put("terminalId", orderVo.getTerminalId()); -// List orderDomainList = historyOrderMapper.getListPage(params); -// String orderIds = orderDomainList.stream().map(n -> n.getClearingOrderId().toString()).collect(Collectors.joining(",")); -// -// if (StringUtils.isNotEmpty(orderIds)){ -// asyncService.updateCheckStatusAsync(orderIds, orderVo.getStatus(), orderVo.getCheckBy()); -// } - executorService.execute(new Runnable() { - @Override - public void run() { - String clearingOrderIds = historyOrderMapper.getClearingOrderIds(params); - if (StringUtils.isNotEmpty(clearingOrderIds)){ - asyncService.updateCheckStatusAsync(clearingOrderIds, orderVo.getStatus(), orderVo.getCheckBy()); - } - } - }); + List orderDomainList = historyOrderMapper.getListPage(params); + String orderIds = orderDomainList.stream().map(n -> n.getClearingOrderId().toString()).collect(Collectors.joining(",")); + + if (StringUtils.isNotEmpty(orderIds)){ + asyncService.updateCheckStatusAsync(orderIds, orderVo.getStatus(), orderVo.getCheckBy()); + } +// executorService.execute(new Runnable() { +// @Override +// public void run() { +// String clearingOrderIds = historyOrderMapper.getClearingOrderIds(params); +// if (StringUtils.isNotEmpty(clearingOrderIds)){ +// asyncService.updateCheckStatusAsync(clearingOrderIds, orderVo.getStatus(), orderVo.getCheckBy()); +// } +// } +// }); return true; } diff --git a/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/task/AutoClearDataTask.java b/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/task/AutoClearDataTask.java index 1150cf3d..85a9b5d9 100644 --- a/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/task/AutoClearDataTask.java +++ b/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/task/AutoClearDataTask.java @@ -1,13 +1,17 @@ package com.xhpc.activity.task; -import com.xhpc.common.util.DateUtil; import com.xhpc.activity.mapper.XhpcDeviceMessageMapper; +import com.xhpc.common.util.DateUtil; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import javax.annotation.Resource; +import java.util.Collection; import java.util.Date; +import java.util.Map; + +import static com.xhpc.common.data.redis.StaticBeanUtil.REDIS; @Component public class AutoClearDataTask { @@ -22,8 +26,29 @@ public class AutoClearDataTask { @Scheduled(cron = "0 0 5 * * ?") private void autoClearDeviceMessageData(){ - String date = DateUtil.date2String(DateUtil.addDay(new Date(), -7), "yyyy-MM-dd"); + String date = DateUtil.date2String(DateUtil.addDay(new Date(), -3), "yyyy-MM-dd"); messageMapper.deleteMessageByDate(date); + } + + @Scheduled(cron = "0 0/10 * * * ? ") + private void getNotificationPlaceholderOrderInfo(){ + String orderKey = "notificationPlaceholderOrderInfo:*"; + + Collection orderKeys = REDIS.keys(orderKey); + for (String okey : orderKeys) { + REDIS.deleteObject(okey); + } + } + + public static void main(String[] args) { + + String substring = "notificationPlaceholderOrderInfo:80836000010001012505142200439549".substring(49, 57); + + System.out.println("substring="+substring); + + String format = cn.hutool.core.date.DateUtil.format(cn.hutool.core.date.DateUtil.offsetDay(new Date(), -3), "yyMMdd"); + + System.out.println("format="+format); } } diff --git a/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/task/SyncHistoryOrderTask.java b/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/task/SyncHistoryOrderTask.java index 4f24d04c..37d3ef0b 100644 --- a/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/task/SyncHistoryOrderTask.java +++ b/xhpc-modules/xhpc-activity/src/main/java/com/xhpc/activity/task/SyncHistoryOrderTask.java @@ -38,7 +38,7 @@ public class SyncHistoryOrderTask { @Scheduled(cron = "0 0 0/1 * * ?") @Transactional @GetMapping("/syncTask") - void ExpiredTenantStatusTask() { + public void ExpiredTenantStatusTask() { System.out.println(" ============== 自动同步订单到清分 开始 =========================="); try { diff --git a/xhpc-modules/xhpc-activity/src/main/resources/bootstrap.yml b/xhpc-modules/xhpc-activity/src/main/resources/bootstrap.yml index f2b7e48a..4d87bbea 100644 --- a/xhpc-modules/xhpc-activity/src/main/resources/bootstrap.yml +++ b/xhpc-modules/xhpc-activity/src/main/resources/bootstrap.yml @@ -19,10 +19,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 120.26.46.180:8858 + server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848 config: # 配置中心地址 - server-addr: 120.26.46.180:8858 + server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/xhpc-modules/xhpc-activity/src/main/resources/mapper/XhpcStationDeviceMapper.xml b/xhpc-modules/xhpc-activity/src/main/resources/mapper/XhpcStationDeviceMapper.xml index 84a56193..961804ae 100644 --- a/xhpc-modules/xhpc-activity/src/main/resources/mapper/XhpcStationDeviceMapper.xml +++ b/xhpc-modules/xhpc-activity/src/main/resources/mapper/XhpcStationDeviceMapper.xml @@ -67,6 +67,12 @@ and s.tenant_id=#{params.tenantId} + + and s.charging_station_id in (select charging_station_id from xhpc_charging_station where operator_id=#{params.userId}) + + + and s.charging_station_id in (select charging_station_id from xhpc_user_privilege where user_id=#{params.userId}) + GROUP BY d2.device_id order by s.work_station_id, d1.device_type,d1.device_id, d1.sorted, d2.device_type,d2.device_id, d2.sorted diff --git a/xhpc-modules/xhpc-activity/src/main/resources/mapper/XhpcWorkStationMapper.xml b/xhpc-modules/xhpc-activity/src/main/resources/mapper/XhpcWorkStationMapper.xml index b03dd4a4..9695c3ec 100644 --- a/xhpc-modules/xhpc-activity/src/main/resources/mapper/XhpcWorkStationMapper.xml +++ b/xhpc-modules/xhpc-activity/src/main/resources/mapper/XhpcWorkStationMapper.xml @@ -29,13 +29,14 @@ + - work_station_id, `name`, operator_id, `type`, construction_site, service_facilities, - periphery_facilities, address, detailed_address, longitude, latitude, parking_instructions, - serial_number, `status`, del_flag, create_time, create_by, update_time, update_by, - remark, business_instructions, reminder_instructions, img_id, station_type, service_tel, - park_nums, tenant_id + work_station_id, `name`, operator_id, `type`, construction_site, service_facilities, + periphery_facilities, address, detailed_address, longitude, latitude, parking_instructions, + serial_number, `status`, del_flag, create_time, create_by, update_time, update_by, + remark, business_instructions, reminder_instructions, img_id, station_type, service_tel, + park_nums, tenant_id,charging_station_id - \ No newline at end of file + diff --git a/xhpc-modules/xhpc-card/src/main/resources/bootstrap.yml b/xhpc-modules/xhpc-card/src/main/resources/bootstrap.yml index 2a4e98a5..7b26271c 100644 --- a/xhpc-modules/xhpc-card/src/main/resources/bootstrap.yml +++ b/xhpc-modules/xhpc-card/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 120.26.46.180:8858 + server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848 config: # 配置中心地址 - server-addr: 120.26.46.180:8858 + server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingPileServiceImpl.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingPileServiceImpl.java index d6fea441..9a503b8b 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingPileServiceImpl.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingPileServiceImpl.java @@ -147,7 +147,7 @@ public class XhpcChargingPileServiceImpl extends BaseService implements IXhpcCha }else{ Map map = (Map)r1.getData(); if(map !=null){ - if(!map.get("stationPileQuote").equals("-1")){ + if(!map.get("stationPileQuote").toString().equals("-1")){ int count = xhpcChargingPileMapper.getCountXhpcChargingPile(chargingStationId,loginUser.getTenantId()); if(Integer.parseInt(map.get("stationPileQuote").toString()) select start_time as startTime, - replace(end_time, '00:00:00', '24:00:00') as endTime, + replace(end_time, '00:00:00', '23:59:59') as endTime, price as price from xhpc_placeholder_time where charging_station_id=#{chargingStationId} and del_flag =0 @@ -632,11 +632,11 @@ select price as placeholderPrice, start_time as placeholderStartTime, - end_time as placeholderEndTime + replace(end_time, '00:00:00', '23:59:59') as placeholderEndTime from xhpc_placeholder_time where charging_station_id = #{datchargingStationId} and start_time <= #{date} - and replace(end_time, '00:00:00', '24:00:00') >= #{date} + and replace(end_time, '00:00:00', '23:59:59') >= #{date} and del_flag = 0 limit 1 diff --git a/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcTerminalMapper.xml b/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcTerminalMapper.xml index 22d889d4..61bd00a3 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcTerminalMapper.xml +++ b/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcTerminalMapper.xml @@ -365,7 +365,6 @@ cp.auxiliary_power_supply as auxiliaryPowerSupply, ct.parking_instructions as parkingInstructions, ct.create_time as createTime, - xp.content as content, xp.max_fee as maxFee, xp.free_time as freeTime, ter.charging_station_id as chargingStationId @@ -437,11 +436,11 @@ select price as placeholderPrice, start_time as placeholderStartTime, - end_time as placeholderEndTime + replace(end_time, '00:00:00', '23:59:59') as placeholderEndTime from xhpc_placeholder_time where charging_station_id = #{datchargingStationId} and start_time <= #{date} - and replace(end_time, '00:00:00', '24:00:00') >= #{date} + and replace(end_time, '00:00:00', '23:59:59') >= #{date} and del_flag = 0 limit 1 diff --git a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/pp/utils/BMSCurrentParser.java b/xhpc-modules/xhpc-common/src/main/java/com/xhpc/pp/utils/BMSCurrentParser.java new file mode 100644 index 00000000..8013e949 --- /dev/null +++ b/xhpc-modules/xhpc-common/src/main/java/com/xhpc/pp/utils/BMSCurrentParser.java @@ -0,0 +1,47 @@ +package com.xhpc.pp.utils; + +/** + * 电流算法 + * + * @author yuyang + * @Date 2025-06-06 11:02 + */ +public class BMSCurrentParser { + /** + * 解析BMS电流需求值 + * @param hexString 2字节十六进制字符串(小端序),如"18FC" + * @return 电流值(单位:A) + */ + public static double parseBmsCurrent(String hexString,int number) { + // 验证输入格式 + if (hexString == null || hexString.length() != 4) { + throw new IllegalArgumentException("输入必须是4位十六进制字符串"); + } + + try { + // 解析低字节(前2位字符) + int lowByte = Integer.parseInt(hexString.substring(0, 2), 16); + // 解析高字节(后2位字符) + int highByte = Integer.parseInt(hexString.substring(2, 4), 16); + + // 组合为16位无符号整数(小端序) + int unsignedValue = (highByte << 8) | lowByte; + + // 转换为有符号16位整数 + int signedValue = unsignedValue; + if (unsignedValue >= 32768) { + signedValue = unsignedValue - 65536; + } + + // 应用单位换算和偏移量 + return (signedValue * 0.1) - number; + } catch (NumberFormatException e) { + throw new IllegalArgumentException("无效的十六进制格式"); + } + } + + public static void main(String[] args) { + + } + +} diff --git a/xhpc-modules/xhpc-general/src/main/resources/bootstrap.yml b/xhpc-modules/xhpc-general/src/main/resources/bootstrap.yml index a42b67b3..dbb21612 100644 --- a/xhpc-modules/xhpc-general/src/main/resources/bootstrap.yml +++ b/xhpc-modules/xhpc-general/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 120.26.46.180:8858 + server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848 config: # 配置中心地址 - server-addr: 120.26.46.180:8858 + server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcPlaceholderOrderController.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcPlaceholderOrderController.java index fb6df8b9..6959b934 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcPlaceholderOrderController.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcPlaceholderOrderController.java @@ -86,7 +86,7 @@ public class XhpcPlaceholderOrderController extends BaseController { } //定时任务,查询状态 - @Scheduled(cron = "0/30 * * * * ? ") + //@Scheduled(cron = "0/30 * * * * ? ") public void getxhpcPlaceholderOrderTime() { xhpcPlaceholderOrderService.getTimingPriceTime(); } diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcPlaceholderOrderServiceImpl.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcPlaceholderOrderServiceImpl.java index a688bb60..2586970e 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcPlaceholderOrderServiceImpl.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcPlaceholderOrderServiceImpl.java @@ -10,6 +10,7 @@ import com.xhpc.common.api.UserTypeService; import com.xhpc.common.core.domain.R; import com.xhpc.common.core.utils.SecurityUtils; import com.xhpc.common.core.web.domain.AjaxResult; +import com.xhpc.common.core.web.service.BaseService; import com.xhpc.common.domain.XhpcPlaceholderTime; import com.xhpc.common.enums.StopReasonEnum; import com.xhpc.common.security.service.TokenService; @@ -38,7 +39,7 @@ import static com.xhpc.common.data.redis.StaticBeanUtil.REDIS; * @Date 2025-05-06 10:07 */ @Service -public class XhpcPlaceholderOrderServiceImpl implements IXhpcPlaceholderOrderService { +public class XhpcPlaceholderOrderServiceImpl extends BaseService implements IXhpcPlaceholderOrderService { @Resource XhpcPlaceholderOrderMapper xhpcPlaceholderOrderMapper; @@ -75,7 +76,9 @@ public class XhpcPlaceholderOrderServiceImpl implements IXhpcPlaceholderOrderSer String start = DateUtil.formatTime(startTime); String end = DateUtil.formatTime(endTime); - long betweenDay = DateUtil.between(endTime, startTime, DateUnit.DAY); + DateTime parse = DateUtil.parse(DateUtil.format(startTime, "yyyy-MM-dd"), "yyyy-MM-dd"); + DateTime parse1 = DateUtil.parse(DateUtil.format(endTime, "yyyy-MM-dd"), "yyyy-MM-dd"); + long betweenDay = DateUtil.between(parse,parse1, DateUnit.DAY); long between = DateUtil.between(endTime, startTime, DateUnit.MINUTE); xhpcPlaceholderOrder.setEndTime(endTime); xhpcPlaceholderOrder.setTotalTimeSpan((int) between); @@ -86,105 +89,159 @@ public class XhpcPlaceholderOrderServiceImpl implements IXhpcPlaceholderOrderSer } else { between = between - freeTime; if (betweenDay > 0) { - List xhpcPlaceholderTimeOne = xhpcPlaceholderOrderMapper.getXhpcPlaceholderTime(start, "23:59:59", xhpcPlaceholderOrder.getPlaceholderId()); - for (int i = 0; i < xhpcPlaceholderTimeOne.size(); i++) { - XhpcPlaceholderTime xhpcPlaceholderTime = xhpcPlaceholderTimeOne.get(i); - BigDecimal price = xhpcPlaceholderTime.getPrice(); - String pattern = "HH:mm:ss"; - Long startOne = DateUtil.parse(start, pattern).getTime(); - Long endOne = DateUtil.parse("23:59:59", pattern).getTime(); + for (int m = 0; m <= betweenDay; m++) { + if(m==0){ + List xhpcPlaceholderTimeOne = xhpcPlaceholderOrderMapper.getXhpcPlaceholderTime(start, "23:59:59", xhpcPlaceholderOrder.getPlaceholderId()); + for (int i = 0; i < xhpcPlaceholderTimeOne.size(); i++) { + XhpcPlaceholderTime xhpcPlaceholderTime = xhpcPlaceholderTimeOne.get(i); + BigDecimal price = xhpcPlaceholderTime.getPrice(); + String pattern = "HH:mm:ss"; + Long startOne = DateUtil.parse(start, pattern).getTime(); + Long endOne = DateUtil.parse("23:59:59", pattern).getTime(); - String format1 = DateUtil.format(xhpcPlaceholderTime.getStartTime(), pattern); - String format2 = DateUtil.format(xhpcPlaceholderTime.getEndTime(), pattern); + String format1 = DateUtil.format(xhpcPlaceholderTime.getStartTime(), pattern); + String format2 = DateUtil.format(xhpcPlaceholderTime.getEndTime(), pattern); - Long time1 = DateUtil.parse(format1, pattern).getTime(); - Long time2 = DateUtil.parse(format2, pattern).getTime(); - XhpcPlaceholderTimeOrderDto placeholderTimeOrderDto = new XhpcPlaceholderTimeOrderDto(); - if (startOne < time1) { - startOne = time1; - placeholderTimeOrderDto.setStartTime(xhpcPlaceholderTime.getStartTime()); + Long time1 = DateUtil.parse(format1, pattern).getTime(); + Long time2 = DateUtil.parse(format2, pattern).getTime(); + XhpcPlaceholderTimeOrderDto placeholderTimeOrderDto = new XhpcPlaceholderTimeOrderDto(); + if (startOne < time1) { + startOne = time1; + placeholderTimeOrderDto.setStartTime(xhpcPlaceholderTime.getStartTime()); + }else{ + placeholderTimeOrderDto.setStartTime(DateUtil.parse(start, pattern)); + } + if (endOne > time2) { + endOne = time2; + placeholderTimeOrderDto.setEndTime(xhpcPlaceholderTime.getEndTime()); + }else{ + placeholderTimeOrderDto.setEndTime(DateUtil.parse("23:59:59", pattern)); + } + long betweOne = (endOne - startOne) / 60000; + int i1 = (int) (betweOne); + + if (freeTime - i1 > 0) { + freeTime = freeTime - i1; + ; + i1 = 0; + } else { + i1 = i1 - freeTime; + freeTime = 0; + + } + + BigDecimal multiply = new BigDecimal(i1).multiply(price); + totalMoney = totalMoney.add(multiply); + + placeholderTimeOrderDto.setPlaceholderOrderId(xhpcPlaceholderOrder.getPlaceholderOrderId()); + placeholderTimeOrderDto.setPrice(price); + placeholderTimeOrderDto.setTotalMoney(multiply); + placeholderTimeOrderDto.setTotalTimeSpan(i1); + xhpcPlaceholderOrderMapper.insertXhpcPlaceholderTimeOrder(placeholderTimeOrderDto); + + } + }else if(m>0 && m xhpcPlaceholderTimeOne = xhpcPlaceholderOrderMapper.getXhpcPlaceholderTime("00:00:00", "23:59:59", xhpcPlaceholderOrder.getPlaceholderId()); + for (int i = 0; i < xhpcPlaceholderTimeOne.size(); i++) { + XhpcPlaceholderTime xhpcPlaceholderTime = xhpcPlaceholderTimeOne.get(i); + BigDecimal price = xhpcPlaceholderTime.getPrice(); + String pattern = "HH:mm:ss"; + Long startOne = DateUtil.parse("00:00:00", pattern).getTime(); + Long endOne = DateUtil.parse("23:59:59", pattern).getTime(); + + String format1 = DateUtil.format(xhpcPlaceholderTime.getStartTime(), pattern); + String format2 = DateUtil.format(xhpcPlaceholderTime.getEndTime(), pattern); + + Long time1 = DateUtil.parse(format1, pattern).getTime(); + Long time2 = DateUtil.parse(format2, pattern).getTime(); + XhpcPlaceholderTimeOrderDto placeholderTimeOrderDto = new XhpcPlaceholderTimeOrderDto(); + if (startOne < time1) { + startOne = time1; + placeholderTimeOrderDto.setStartTime(xhpcPlaceholderTime.getStartTime()); + }else{ + placeholderTimeOrderDto.setStartTime(DateUtil.parse("00:00:00", pattern)); + } + if (endOne > time2) { + endOne = time2; + placeholderTimeOrderDto.setEndTime(xhpcPlaceholderTime.getEndTime()); + }else{ + placeholderTimeOrderDto.setEndTime(DateUtil.parse("23:59:59", pattern)); + } + long betweOne = (endOne - startOne) / 60000; + int i1 = (int) (betweOne); + + if (freeTime - i1 > 0) { + freeTime = freeTime - i1; + ; + i1 = 0; + } else { + i1 = i1 - freeTime; + freeTime = 0; + + } + + BigDecimal multiply = new BigDecimal(i1).multiply(price); + totalMoney = totalMoney.add(multiply); + + placeholderTimeOrderDto.setPlaceholderOrderId(xhpcPlaceholderOrder.getPlaceholderOrderId()); + placeholderTimeOrderDto.setPrice(price); + placeholderTimeOrderDto.setTotalMoney(multiply); + placeholderTimeOrderDto.setTotalTimeSpan(i1); + xhpcPlaceholderOrderMapper.insertXhpcPlaceholderTimeOrder(placeholderTimeOrderDto); + + } }else{ - placeholderTimeOrderDto.setStartTime(DateUtil.parse(start, pattern)); + List xhpcPlaceholderTimeTwo = xhpcPlaceholderOrderMapper.getXhpcPlaceholderTime("00:00:00", end, xhpcPlaceholderOrder.getPlaceholderId()); + for (int i = 0; i < xhpcPlaceholderTimeTwo.size(); i++) { + XhpcPlaceholderTime xhpcPlaceholderTime = xhpcPlaceholderTimeTwo.get(i); + BigDecimal price = xhpcPlaceholderTime.getPrice(); + String pattern = "HH:mm:ss"; + Long startOne = DateUtil.parse("00:00:00", pattern).getTime(); + Long endOne = DateUtil.parse(end, pattern).getTime(); + + String format1 = DateUtil.format(xhpcPlaceholderTime.getStartTime(), pattern); + String format2 = DateUtil.format(xhpcPlaceholderTime.getEndTime(), pattern); + + Long time1 = DateUtil.parse(format1, pattern).getTime(); + Long time2 = DateUtil.parse(format2, pattern).getTime(); + + XhpcPlaceholderTimeOrderDto placeholderTimeOrderDto = new XhpcPlaceholderTimeOrderDto(); + if (startOne < time1) { + startOne = time1; + placeholderTimeOrderDto.setStartTime(xhpcPlaceholderTime.getStartTime()); + }else{ + placeholderTimeOrderDto.setStartTime(DateUtil.parse("00:00:00", pattern)); + } + if (endOne > time2) { + endOne = time2; + placeholderTimeOrderDto.setEndTime(xhpcPlaceholderTime.getEndTime()); + }else{ + placeholderTimeOrderDto.setEndTime(DateUtil.parse(end, pattern)); + } + long betweOne = (endOne - startOne) / 60000; + int i1 = (int) (betweOne); + + if (freeTime - i1 > 0) { + freeTime = freeTime - i1; + ; + i1 = 0; + } else { + i1 = i1 - freeTime; + freeTime = 0; + } + BigDecimal multiply = new BigDecimal(i1).multiply(price); + totalMoney = totalMoney.add(multiply); + + + placeholderTimeOrderDto.setPlaceholderOrderId(xhpcPlaceholderOrder.getPlaceholderOrderId()); + placeholderTimeOrderDto.setPrice(price); + placeholderTimeOrderDto.setTotalMoney(multiply); + placeholderTimeOrderDto.setTotalTimeSpan(i1); + xhpcPlaceholderOrderMapper.insertXhpcPlaceholderTimeOrder(placeholderTimeOrderDto); + } } - if (endOne > time2) { - endOne = time2; - placeholderTimeOrderDto.setEndTime(xhpcPlaceholderTime.getEndTime()); - }else{ - placeholderTimeOrderDto.setEndTime(DateUtil.parse("23:59:59", pattern)); - } - long betweOne = (endOne - startOne) / 60000; - int i1 = (int) (betweOne); - - if (freeTime - i1 > 0) { - freeTime = freeTime - i1; - ; - i1 = 0; - } else { - i1 = i1 - freeTime; - freeTime = 0; - - } - - BigDecimal multiply = new BigDecimal(i1).multiply(price); - totalMoney = totalMoney.add(multiply); - - placeholderTimeOrderDto.setPlaceholderOrderId(xhpcPlaceholderOrder.getPlaceholderOrderId()); - placeholderTimeOrderDto.setPrice(price); - placeholderTimeOrderDto.setTotalMoney(multiply); - placeholderTimeOrderDto.setTotalTimeSpan(i1); - xhpcPlaceholderOrderMapper.insertXhpcPlaceholderTimeOrder(placeholderTimeOrderDto); - } - - List xhpcPlaceholderTimeTwo = xhpcPlaceholderOrderMapper.getXhpcPlaceholderTime("00:00:00", end, xhpcPlaceholderOrder.getPlaceholderId()); - for (int i = 0; i < xhpcPlaceholderTimeTwo.size(); i++) { - XhpcPlaceholderTime xhpcPlaceholderTime = xhpcPlaceholderTimeOne.get(i); - BigDecimal price = xhpcPlaceholderTime.getPrice(); - String pattern = "HH:mm:ss"; - Long startOne = DateUtil.parse("00:00:00", pattern).getTime(); - Long endOne = DateUtil.parse(end, pattern).getTime(); - - String format1 = DateUtil.format(xhpcPlaceholderTime.getStartTime(), pattern); - String format2 = DateUtil.format(xhpcPlaceholderTime.getEndTime(), pattern); - - Long time1 = DateUtil.parse(format1, pattern).getTime(); - Long time2 = DateUtil.parse(format2, pattern).getTime(); - - XhpcPlaceholderTimeOrderDto placeholderTimeOrderDto = new XhpcPlaceholderTimeOrderDto(); - if (startOne < time1) { - startOne = time1; - placeholderTimeOrderDto.setStartTime(xhpcPlaceholderTime.getStartTime()); - }else{ - placeholderTimeOrderDto.setStartTime(DateUtil.parse("00:00:00", pattern)); - } - if (endOne > time2) { - endOne = time2; - placeholderTimeOrderDto.setEndTime(xhpcPlaceholderTime.getEndTime()); - }else{ - placeholderTimeOrderDto.setEndTime(DateUtil.parse(end, pattern)); - } - long betweOne = (endOne - startOne) / 60000; - int i1 = (int) (betweOne); - - if (freeTime - i1 > 0) { - freeTime = freeTime - i1; - ; - i1 = 0; - } else { - i1 = i1 - freeTime; - freeTime = 0; - } - BigDecimal multiply = new BigDecimal(i1).multiply(price); - totalMoney = totalMoney.add(multiply); - - - placeholderTimeOrderDto.setPlaceholderOrderId(xhpcPlaceholderOrder.getPlaceholderOrderId()); - placeholderTimeOrderDto.setPrice(price); - placeholderTimeOrderDto.setTotalMoney(multiply); - placeholderTimeOrderDto.setTotalTimeSpan(i1); - xhpcPlaceholderOrderMapper.insertXhpcPlaceholderTimeOrder(placeholderTimeOrderDto); - } - } else { + }else { List xhpcPlaceholderTimeOne = xhpcPlaceholderOrderMapper.getXhpcPlaceholderTime(start, end, xhpcPlaceholderOrder.getPlaceholderId()); for (int i = 0; i < xhpcPlaceholderTimeOne.size(); i++) { XhpcPlaceholderTime xhpcPlaceholderTime = xhpcPlaceholderTimeOne.get(i); @@ -235,6 +292,9 @@ public class XhpcPlaceholderOrderServiceImpl implements IXhpcPlaceholderOrderSer } } + if(totalMoney.compareTo(new BigDecimal(50)) == 1){ + totalMoney = new BigDecimal(50); + } xhpcPlaceholderOrder.setTotalMoney(totalMoney); if (new BigDecimal(0).compareTo(new BigDecimal(between)) == 1) { xhpcPlaceholderOrder.setOvertimePrice(totalMoney.divide(new BigDecimal(between), 2, BigDecimal.ROUND_HALF_UP)); @@ -299,6 +359,7 @@ public class XhpcPlaceholderOrderServiceImpl implements IXhpcPlaceholderOrderSer //桩的统计、该时段金额 List> list = new ArrayList<>(); if (!UserTypeUtil.SYS_USER_TYPE_ADMIN.equals(sysUser.getUserId())) { + startPage(); if (UserTypeUtil.SYS_SUPER_TYPE_ONE.equals(loginUser.getSuperType())) { tenantId = loginUser.getTenantId(); Long logOperatorId = sysUser.getOperatorId(); @@ -312,6 +373,7 @@ public class XhpcPlaceholderOrderServiceImpl implements IXhpcPlaceholderOrderSer list = xhpcPlaceholderOrderMapper.getListPage(chargingStationId, chargingPileId, terminalId, phone, transactionNumber, 2, chargingStationName, operatorId, source, beginStartTime, beginEndTime, logUserId, type, number, affiliationOrganization, evcsOrderNo, plateNum, internetId, internetSerialNumber, terminalName, vinCode, overStartTime, overEndTime, personnelId, confirmResult, tenantId, 0); } } else { + startPage(); list = xhpcPlaceholderOrderMapper.getListPage(chargingStationId, chargingPileId, terminalId, phone, transactionNumber, 0, chargingStationName, operatorId, source, beginStartTime, beginEndTime, userId, type, number, affiliationOrganization, evcsOrderNo, plateNum, internetId, internetSerialNumber, terminalName, vinCode, overStartTime, overEndTime, personnelId, confirmResult, tenantId, 0); } 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 35c8ab1b..4e732514 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 @@ -1633,17 +1633,18 @@ public class XhpcRealTimeOrderServiceImpl extends BaseService implements IXhpcRe placeholderOrder.setStartTime(xhpcHistoryOrder.getEndTime()); placeholderOrder.setCreateTime(new Date()); placeholderOrder.setTenantId(xhpcHistoryOrder.getTenantId()); + placeholderOrder.setPlateNum(xhpcChargeOrder.getPlateNum()); placeholderOrderService.insertXhpcPlaceholderOrder(placeholderOrder); logger.info("<<<<<<<<<<<<<>>>>>>>>>>>>>>>"+placeholderOrder.getPlaceholderOrderId()); - String gunkey = "placeholderOrder:"+substring+":"+xhpcHistoryOrder.getSerialNumber(); - Map cacheGun =new HashMap<>(); - cacheGun.put("source",xhpcHistoryOrder.getSource()); - cacheGun.put("placeholderOrderId",placeholderOrder.getPlaceholderOrderId()); - cacheGun.put("status",0); - cacheGun.put("serialNumber",xhpcHistoryOrder.getSerialNumber()); - cacheGun.put("internetSerialNumber",xhpcHistoryOrder.getInternetSerialNumber()); - cacheGun.put("startTime",DateUtil.format(xhpcHistoryOrder.getEndTime(),"yyyy-MM-dd HH:mm:ss")); - REDIS.setCacheMap(gunkey, cacheGun); +// String gunkey = "placeholderOrder:"+substring+":"+xhpcHistoryOrder.getSerialNumber(); +// Map cacheGun =new HashMap<>(); +// cacheGun.put("source",xhpcHistoryOrder.getSource()); +// cacheGun.put("placeholderOrderId",placeholderOrder.getPlaceholderOrderId()); +// cacheGun.put("status",0); +// cacheGun.put("serialNumber",xhpcHistoryOrder.getSerialNumber()); +// cacheGun.put("internetSerialNumber",xhpcHistoryOrder.getInternetSerialNumber()); +// cacheGun.put("startTime",DateUtil.format(xhpcHistoryOrder.getEndTime(),"yyyy-MM-dd HH:mm:ss")); + //REDIS.setCacheMap(gunkey, cacheGun); } }catch (Exception e){ e.printStackTrace(); diff --git a/xhpc-modules/xhpc-order/src/main/resources/bootstrap.yml b/xhpc-modules/xhpc-order/src/main/resources/bootstrap.yml index 0db7c88d..8fd67a26 100644 --- a/xhpc-modules/xhpc-order/src/main/resources/bootstrap.yml +++ b/xhpc-modules/xhpc-order/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 120.26.46.180:8858 + server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848 config: # 配置中心地址 - server-addr: 120.26.46.180:8858 + server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcChargeOrderMapper.xml b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcChargeOrderMapper.xml index db8b506a..d83202f1 100644 --- a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcChargeOrderMapper.xml +++ b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcChargeOrderMapper.xml @@ -35,6 +35,9 @@ + + + @@ -473,7 +476,7 @@ select start_time as startTime, - end_time as endTime, + replace(end_time, '00:00:00', '23:59:59') as endTime, price as price from xhpc_placeholder_time where placeholder_time_id in ( @@ -458,6 +458,7 @@ select ho.placeholder_order_id as placeholderOrderId, ho.serial_number as serialNumber, + ho.placeholder_id as placeholderId, ct.name as chargingStationName, ter.pile_serial_number as pileSerialNumber, ter.name as terminalName, @@ -533,7 +534,7 @@ diff --git a/xhpc-modules/xhpc-payment/src/main/resources/bootstrap.yml b/xhpc-modules/xhpc-payment/src/main/resources/bootstrap.yml index 27bd265a..4a2817f0 100644 --- a/xhpc-modules/xhpc-payment/src/main/resources/bootstrap.yml +++ b/xhpc-modules/xhpc-payment/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 120.26.46.180:8858 + server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848 config: # 配置中心地址 - server-addr: 120.26.46.180:8858 + server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848 # 配置文件格式 file-extension: yml # 共享配置 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 7417efc7..dfb08aad 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 @@ -418,7 +418,7 @@ public class ChargingController { String pileNo = startChargingData.getPileNo(); String pkey = "pile:".concat(pileNo); - log.info("==================pkey======================"+pkey); + //log.info("==================pkey======================"+pkey); Map cachePile = REDIS.getCacheMap(pkey); R r = checkPile(cachePile); if (r.getCode() == 200) { diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/BmsReqChargerOutputDataLogic.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/BmsReqChargerOutputDataLogic.java index dc7326e5..2165ce58 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/BmsReqChargerOutputDataLogic.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/BmsReqChargerOutputDataLogic.java @@ -11,6 +11,7 @@ import com.xhpc.pp.mapper.XhpcDeviceMessageMapper; import com.xhpc.pp.tx.ServiceParameter; import com.xhpc.pp.tx.ServiceResult; import com.xhpc.pp.tx.logic.ServiceLogic; +import com.xhpc.pp.utils.BMSCurrentParser; import com.xhpc.pp.utils.HexUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -49,20 +50,20 @@ public class BmsReqChargerOutputDataLogic implements ServiceLogic { int bmsVoltageRequest = HexUtils.reverseHexInt(hex.substring(idxStart, 4 + idxStart));//BMS 电压需求 idxStart = 4 + idxStart; - - int bmsCurrentRequest = HexUtils.reverseHexInt(hex.substring(idxStart, 4 + idxStart));//BMS 电流需求 + double bmsCurrentRequest = BMSCurrentParser.parseBmsCurrent(hex.substring(idxStart, 4 + idxStart),400); + //int bmsCurrentRequest = HexUtils.reverseHexInt(hex.substring(idxStart, 4 + idxStart));//BMS 电流需求 idxStart = 6 + idxStart; int bmsChargingVolt = HexUtils.reverseHexInt(hex.substring(idxStart, 4 + idxStart));//BMS 充电电压测量值 idxStart = 4 + idxStart; - int bmsChargingCurrent = HexUtils.reverseHexInt(hex.substring(idxStart, 4 + idxStart));//BMS 充电电流测量值 + + double bmsChargingCurrent = BMSCurrentParser.parseBmsCurrent(hex.substring(idxStart, 4 + idxStart),400); idxStart = 88; int pileVoltageOutput = HexUtils.reverseHexInt(hex.substring(idxStart, 4 + idxStart));//电桩电压输出值 idxStart = 4 + idxStart; - int pileCurrentOutput = HexUtils.reverseHexInt(hex.substring(idxStart, 4 + idxStart));//电桩电流输出值 - + double pileCurrentOutput = BMSCurrentParser.parseBmsCurrent(hex.substring(idxStart, 4 + idxStart),400);//电桩电流输出值 String orderNo = (String) req.get("orderNo"); String orderKey = "order:".concat(orderNo).concat(".bms"); @@ -85,43 +86,45 @@ public class BmsReqChargerOutputDataLogic implements ServiceLogic { cacheBmsReqChargerOutputData.setPileNo(orderData.getPileNo()); cacheBmsReqChargerOutputData.setGunId(orderData.getGunId()); cacheBmsReqChargerOutputData.setBmsVoltageRequest(new BigDecimal(bmsVoltageRequest).divide(new BigDecimal(10),BigDecimal.ROUND_DOWN).doubleValue()); - try{ - BigDecimal subtract1 = new BigDecimal(bmsCurrentRequest).divide(new BigDecimal(10), BigDecimal.ROUND_DOWN).subtract(new BigDecimal(400)); - if(subtract1.compareTo(new BigDecimal(0))<0){ - subtract1 =subtract1.abs(); - } - cacheBmsReqChargerOutputData.setBmsCurrentRequest(subtract1.doubleValue()); - }catch (Exception e){ - - } +// try{ +// BigDecimal subtract1 = new BigDecimal(bmsCurrentRequest).divide(new BigDecimal(10), BigDecimal.ROUND_DOWN).subtract(new BigDecimal(400)); +// if(subtract1.compareTo(new BigDecimal(0))<0){ +// subtract1 =subtract1.abs(); +// } +// cacheBmsReqChargerOutputData.setBmsCurrentRequest(subtract1.doubleValue()); +// }catch (Exception e){ +// +// } + cacheBmsReqChargerOutputData.setBmsCurrentRequest(new BigDecimal(orderData.getBmsCurrentRequest()).abs().setScale(2,RoundingMode.DOWN).doubleValue()); cacheBmsReqChargerOutputData.setBmsChargingMod(HexUtils.reverseHexInt(orderData.getBmsChargingMod())); cacheBmsReqChargerOutputData.setBmsChargingVolt(new BigDecimal(bmsChargingVolt).divide(new BigDecimal(10),BigDecimal.ROUND_DOWN).doubleValue()); - try{ - BigDecimal subtract2 = new BigDecimal(bmsChargingCurrent).divide(new BigDecimal(10), BigDecimal.ROUND_DOWN).subtract(new BigDecimal(400)); - if(subtract2.compareTo(new BigDecimal(0))<0){ - subtract2 =subtract2.abs(); - } - cacheBmsReqChargerOutputData.setBmsChargingCurrent(subtract2.doubleValue()); - - }catch (Exception e){ - - } - +// try{ +// BigDecimal subtract2 = new BigDecimal(bmsChargingCurrent).divide(new BigDecimal(10), BigDecimal.ROUND_DOWN).subtract(new BigDecimal(400)); +// if(subtract2.compareTo(new BigDecimal(0))<0){ +// subtract2 =subtract2.abs(); +// } +// cacheBmsReqChargerOutputData.setBmsChargingCurrent(subtract2.doubleValue()); +// +// }catch (Exception e){ +// +// } + cacheBmsReqChargerOutputData.setBmsChargingCurrent(new BigDecimal(orderData.getBmsChargingCurrent()).abs().setScale(2,RoundingMode.DOWN).doubleValue()); cacheBmsReqChargerOutputData.setMonoBatteryVolt(convertDouble(Integer.parseInt(orderData.getMonoBatteryVoltGroupId().substring(0, 3), 16) * 0.01)); cacheBmsReqChargerOutputData.setSoc(HexUtils.reverseHexInt(orderData.getSoc())); cacheBmsReqChargerOutputData.setBmsEstRemainingTime(HexUtils.reverseHexInt(orderData.getBmsEstRemainingTime())); cacheBmsReqChargerOutputData.setPileVoltageOutput(new BigDecimal(pileVoltageOutput).divide(new BigDecimal(10),BigDecimal.ROUND_DOWN).doubleValue()); - try{ - - BigDecimal subtract = new BigDecimal(pileCurrentOutput).divide(new BigDecimal(10), BigDecimal.ROUND_DOWN).subtract(new BigDecimal(400)); - if(subtract.compareTo(new BigDecimal(0))<0){ - subtract =subtract.abs(); - } - cacheBmsReqChargerOutputData.setPileCurrentOutput(subtract.doubleValue()); - }catch (Exception e){ - - } +// try{ +// +// BigDecimal subtract = new BigDecimal(pileCurrentOutput).divide(new BigDecimal(10), BigDecimal.ROUND_DOWN).subtract(new BigDecimal(400)); +// if(subtract.compareTo(new BigDecimal(0))<0){ +// subtract =subtract.abs(); +// } +// cacheBmsReqChargerOutputData.setPileCurrentOutput(subtract.doubleValue()); +// }catch (Exception e){ +// +// } + cacheBmsReqChargerOutputData.setPileCurrentOutput(new BigDecimal(orderData.getPileCurrentOutput()).abs().setScale(2,RoundingMode.DOWN).doubleValue()); cacheBmsReqChargerOutputData.setChargingTimeSummary(HexUtils.reverseHexInt(orderData.getChargingTimeSummary())); cacheBmsReqChargerOutputData.setMonoBatteryVoltGroupId(Integer.parseInt(orderData.getMonoBatteryVoltGroupId().substring(3), 16)); cacheBmsReqChargerOutputData.setHex(orderData.getHex()); @@ -211,18 +214,18 @@ public class BmsReqChargerOutputDataLogic implements ServiceLogic { int idxStart = 60; int bmsVoltageRequest = HexUtils.reverseHexInt(hex.substring(idxStart, 4 + idxStart));//BMS 电压需求 - System.out.println("===================bmsVoltageRequest========================="+bmsVoltageRequest); + // System.out.println("===================bmsVoltageRequest========================="+bmsVoltageRequest); idxStart =idxStart+4; int bmsCurrentRequest = HexUtils.reverseHexInt(hex.substring(idxStart, 4 + idxStart));//BMS 电流需求 - System.out.println("===================bmsCurrentRequest========================="+bmsCurrentRequest); +//System.out.println("===================bmsCurrentRequest========================="+bmsCurrentRequest); idxStart = 88; int pileVoltageOutput = HexUtils.reverseHexInt(hex.substring(idxStart, 4 + idxStart));//电桩电压输出值 - System.out.println("===================pileVoltageOutput========================="+pileVoltageOutput); + // System.out.println("===================pileVoltageOutput========================="+pileVoltageOutput); idxStart = 4 + idxStart; int pileCurrentOutput = HexUtils.reverseHexInt(hex.substring(idxStart, 4 + idxStart));//电桩电流输出值 - System.out.println("===================pileCurrentOutput========================="+pileCurrentOutput); + // System.out.println("===================pileCurrentOutput========================="+pileCurrentOutput); @@ -230,11 +233,17 @@ public class BmsReqChargerOutputDataLogic implements ServiceLogic { if(subtract1.compareTo(new BigDecimal(0))<0){ subtract1 =subtract1.abs(); } - System.out.println("===================subtract1========================="+subtract1); + // System.out.println("===================subtract1========================="+subtract1); BigDecimal subtract = new BigDecimal(2905).divide(new BigDecimal(10), BigDecimal.ROUND_DOWN).subtract(new BigDecimal(400)); if(subtract.compareTo(new BigDecimal(0))<0){ subtract =subtract.abs(); } - System.out.println("===================subtract========================="+subtract); + // System.out.println("===================subtract========================="+subtract); + + + String bmsData = "800C"; // 从BMS获取的实际数据 + double current = BMSCurrentParser.parseBmsCurrent(bmsData,400); + System.out.println("BMS电流需求: " + current + " A"); + } } diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/OrderDataLogic.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/OrderDataLogic.java index 66d04756..76b16a19 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/OrderDataLogic.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/OrderDataLogic.java @@ -57,9 +57,9 @@ public class OrderDataLogic implements ServiceLogic { public ServiceResult service(ServiceParameter sp) throws Exception { Map req = sp.getParameters(); - log.info("================订单结束报文=============================="); - log.info("================订单结束报文================req=============="+req.toString()); - log.info("================订单结束报文=============================="); + //log.info("================订单结束报文=============================="); + //log.info("================订单结束报文================req=============="+req.toString()); + //log.info("================订单结束报文=============================="); ObjectMapper objectMapper = new ObjectMapper(); OrderData orderData = objectMapper.convertValue(req, OrderData.class); String orderNo = orderData.getOrderNo(); 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 f789124b..b5163970 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 @@ -134,6 +134,18 @@ public class RealtimeDataLogic implements ServiceLogic { cacheGun.put("orderkey","order:"+orderNo); final String orderstarttime = DateUtil.format(Calendar.getInstance().getTime(), NORM_DATETIME_FORMAT); cacheGun.put("pileStartTime", orderstarttime); + +// String key = "placeholderOrder:"+terminalId+":*"; +// Collection orderKeys = REDIS.keys(key); +// for (String okey : orderKeys) { +// Map cacheGunYu = REDIS.getCacheMap(okey); +// if(cacheGunYu !=null && "0".equals(cacheGunYu.get("status").toString()) && !okey.equals("placeholderOrder:"+terminalId+":"+orderNo)){ +// cacheGunYu.put("status",1); +// cacheGunYu.put("endTime",DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss")); +// REDIS.setCacheMap(okey, cacheGunYu); +// } +// } + } } List realtimeDataList = (List) cacheOrder.get("realtimeDataList"); @@ -298,20 +310,20 @@ public class RealtimeDataLogic implements ServiceLogic { public void run() { REDIS.setCacheObject("cdjgpc:realTime:"+orderNo,orderNo); //插枪状态发生变化进行判断是否收停车费 - String vehicleGunStatus = pvgstable[Integer.parseInt(realtimeData.getVehicleGunStatus())]; - if("否".equals(vehicleGunStatus)){ - String gunkey = "placeholderOrder:"+terminalId+":*"; +// String vehicleGunStatus = pvgstable[Integer.parseInt(realtimeData.getVehicleGunStatus())]; +// if("否".equals(vehicleGunStatus)){ +// String gunkey = "placeholderOrder:"+terminalId+":*"; +// Collection orderKeys = REDIS.keys(gunkey); +// for (String okey : orderKeys) { +// Map cacheGun = REDIS.getCacheMap(okey); +// if(cacheGun !=null && "0".equals(cacheGun.get("status").toString())){ +// cacheGun.put("status",1); +// cacheGun.put("endTime",DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss")); +// REDIS.setCacheMap(okey, cacheGun); +// } +// } +// } - Collection orderKeys = REDIS.keys(gunkey); - for (String okey : orderKeys) { - Map cacheGun = REDIS.getCacheMap(okey); - if(cacheGun !=null && "0".equals(cacheGun.get("status").toString())){ - cacheGun.put("status",1); - cacheGun.put("endTime",DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss")); - REDIS.setCacheMap(okey, cacheGun); - } - } - } } }); return new ServiceResult(false); diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/server/HBCheckTask.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/server/HBCheckTask.java index ccaa9839..e9f4f6e2 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/server/HBCheckTask.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/server/HBCheckTask.java @@ -52,7 +52,7 @@ public class HBCheckTask { String pkey = "pile:".concat(pileId); Map cachePile = REDIS.getCacheMap(pkey); String stationId = cachePile.get("stationId").toString(); - System.out.println("================gunkey===="+gunkey+"======pileId========"+pileId+"========stationId==="+stationId); + // System.out.println("================gunkey===="+gunkey+"======pileId========"+pileId+"========stationId==="+stationId); if(1==Integer.parseInt(gunkey.substring(gunkey.length() - 1))){ deviceMessageMapper.insertChargingPileStatus(gunkey.substring(gunkey.lastIndexOf(":") + 1),pileId,stationId,"A枪"); }else{ diff --git a/xhpc-modules/xhpc-power-pile/src/main/resources/bootstrap.yml b/xhpc-modules/xhpc-power-pile/src/main/resources/bootstrap.yml index 224d1f2e..0244fca3 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/resources/bootstrap.yml +++ b/xhpc-modules/xhpc-power-pile/src/main/resources/bootstrap.yml @@ -18,10 +18,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 120.26.46.180:8858 + server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848 config: # 配置中心地址 - server-addr: 120.26.46.180:8858 + server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/xhpc-modules/xhpc-user/src/main/resources/bootstrap.yml b/xhpc-modules/xhpc-user/src/main/resources/bootstrap.yml index 953f05a5..69f51a0e 100644 --- a/xhpc-modules/xhpc-user/src/main/resources/bootstrap.yml +++ b/xhpc-modules/xhpc-user/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 120.26.46.180:8858 + server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848 config: # 配置中心地址 - server-addr: 120.26.46.180:8858 + server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/xhpc-modules/xhpc-wxma/src/main/resources/bootstrap.yml b/xhpc-modules/xhpc-wxma/src/main/resources/bootstrap.yml index 287434f3..6287bed8 100644 --- a/xhpc-modules/xhpc-wxma/src/main/resources/bootstrap.yml +++ b/xhpc-modules/xhpc-wxma/src/main/resources/bootstrap.yml @@ -16,10 +16,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 120.26.46.180:8858 + server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848 config: # 配置中心地址 - server-addr: 120.26.46.180:8858 + server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848 # 配置文件格式 file-extension: yml # 共享配置