From ddd4696f5b000754020121384e6c7cf2f2958339 Mon Sep 17 00:00:00 2001 From: yuyang Date: Tue, 24 May 2022 17:32:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=9C=BA=E6=9E=84=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E4=B8=AD=E5=BF=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/XhpcRealTimeOrderServiceImpl.java | 16 +- .../xhpc/user/mapper/XhpcCommonMapper.java | 10 + .../service/impl/XhpcCommonServiceImpl.java | 24 +- .../resources/mapper/XhpcCommonMapper.xml | 217 +++++++++--------- 4 files changed, 156 insertions(+), 111 deletions(-) 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 887e9dcc..1f7709da 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 @@ -361,11 +361,17 @@ public class XhpcRealTimeOrderServiceImpl extends BaseService implements IXhpcRe if(xhpcChargeOrder.getStartTime() ==null || xhpcChargeOrder.getEndTime()==null){ //获取实时数据 Map cacheMap = redisService.getCacheMap("order:"+xhpcChargeOrder.getSerialNumber()); - if(cacheMap !=null && cacheMap.get("realtimeDataList") !=null){ - List list = (List) cacheMap.get("realtimeDataList"); - if(list !=null && list.size()>0){ - xhpcChargeOrder.setEndTime(DateUtil.parse(list.get(list.size()-1).getCreateTime(),"yyyy-MM-dd HH:mm:ss")); - xhpcChargeOrder.setStartTime(DateUtil.parse(list.get(0).getCreateTime(),"yyyy-MM-dd HH:mm:ss")); + if(cacheMap !=null){ + if(cacheMap.get("realtimeDataList") !=null){ + List list = (List) cacheMap.get("realtimeDataList"); + if(list !=null && list.size()>0){ + xhpcChargeOrder.setEndTime(DateUtil.parse(list.get(list.size()-1).getCreateTime(),"yyyy-MM-dd HH:mm:ss")); + xhpcChargeOrder.setStartTime(DateUtil.parse(list.get(0).getCreateTime(),"yyyy-MM-dd HH:mm:ss")); + } + }else{ + if(cacheMap.get("startTime") !=null) { + xhpcChargeOrder.setEndTime(DateUtil.parse(cacheMap.get("startTime").toString(), "yyyy-MM-dd HH:mm:ss")); + } } } } diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcCommonMapper.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcCommonMapper.java index 5bc44a21..d1e02877 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcCommonMapper.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcCommonMapper.java @@ -27,6 +27,16 @@ public interface XhpcCommonMapper { */ Map getCustomersUser(@Param("phone") String phone,@Param("userId")Long userId,@Param("serialNumber")String serialNumber,@Param("tenantId") String tenantId); + List> getCommunityPersonnel(@Param("terminalId")Long terminalId,@Param("operatorId")Long operatorId,@Param("chargingStationId") Long chargingStationId, @Param("chargingPileId")Long chargingPileId, @Param("type")Integer type, @Param("name")String name , @Param("phone")String phone, @Param("account")String account,@Param("number") Integer number,@Param("userId") Long userId,@Param("tenantId")String tenantId,@Param("startTime")String startTime,@Param("endTime")String endTime); + + + List> getCustomersPersonnel(@Param("terminalId")Long terminalId,@Param("operatorId")Long operatorId,@Param("chargingStationId") Long chargingStationId, @Param("chargingPileId")Long chargingPileId, @Param("type")Integer type, @Param("name")String name , @Param("phone")String phone, @Param("account")String account,@Param("number") Integer number,@Param("userId") Long userId,@Param("tenantId")String tenantId,@Param("startTime")String startTime,@Param("endTime")String endTime); + List> getPersonnelStatistics(@Param("terminalId")Long terminalId,@Param("operatorId")Long operatorId,@Param("chargingStationId") Long chargingStationId, @Param("chargingPileId")Long chargingPileId, @Param("type")Integer type, @Param("name")String name , @Param("phone")String phone, @Param("account")String account,@Param("number") Integer number,@Param("userId") Long userId,@Param("tenantId")String tenantId,@Param("startTime")String startTime,@Param("endTime")String endTime); + + + + + } diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCommonServiceImpl.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCommonServiceImpl.java index bc5e387c..c0da4e33 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCommonServiceImpl.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCommonServiceImpl.java @@ -139,14 +139,32 @@ public class XhpcCommonServiceImpl extends BaseService implements IXhpcCommonSer if(UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())){ Long logOperatorId = sysUser.getOperatorId(); //运营商看自己的场站 - list = xhpcCommonMapper.getPersonnelStatistics(terminalId,operatorId, chargingStationId, chargingPileId, type, name,phone,account, 1,logOperatorId,tenantId,startTime,endTime); + if(type==null){ + list = xhpcCommonMapper.getPersonnelStatistics(terminalId,operatorId, chargingStationId, chargingPileId, type, name,phone,account, 1,logOperatorId,tenantId,startTime,endTime); + }else if(type==1){ + list = xhpcCommonMapper.getCommunityPersonnel(terminalId,operatorId, chargingStationId, chargingPileId, type, name,phone,account, 1,logOperatorId,tenantId,startTime,endTime); + }else{ + list = xhpcCommonMapper.getCustomersPersonnel(terminalId,operatorId, chargingStationId, chargingPileId, type, name,phone,account, 1,logOperatorId,tenantId,startTime,endTime); + } }else{ //查询赋值的场站 - list = xhpcCommonMapper.getPersonnelStatistics(terminalId,operatorId, chargingStationId, chargingPileId, type, name,phone,account, 2,sysUserId,tenantId,startTime,endTime); + if(type==null){ + list = xhpcCommonMapper.getPersonnelStatistics(terminalId,operatorId, chargingStationId, chargingPileId, type, name,phone,account, 2,sysUserId,tenantId,startTime,endTime); + }else if(type==1){ + list = xhpcCommonMapper.getCommunityPersonnel(terminalId,operatorId, chargingStationId, chargingPileId, type, name,phone,account, 2,sysUserId,tenantId,startTime,endTime); + }else{ + list = xhpcCommonMapper.getCustomersPersonnel(terminalId,operatorId, chargingStationId, chargingPileId, type, name,phone,account, 2,sysUserId,tenantId,startTime,endTime); + } } }else{ startPage(); - list =xhpcCommonMapper.getPersonnelStatistics(terminalId,operatorId, chargingStationId, chargingPileId, type, name,phone,account, 0,sysUserId,tenantId,startTime,endTime); + if(type==null){ + list =xhpcCommonMapper.getPersonnelStatistics(terminalId,operatorId, chargingStationId, chargingPileId, type, name,phone,account, 0,sysUserId,tenantId,startTime,endTime); + }else if(type==1){ + list =xhpcCommonMapper.getCommunityPersonnel(terminalId,operatorId, chargingStationId, chargingPileId, type, name,phone,account, 0,sysUserId,tenantId,startTime,endTime); + }else{ + list =xhpcCommonMapper.getCustomersPersonnel(terminalId,operatorId, chargingStationId, chargingPileId, type, name,phone,account, 0,sysUserId,tenantId,startTime,endTime); + } } return list; } diff --git a/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcCommonMapper.xml b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcCommonMapper.xml index a6ea1278..87b373cb 100644 --- a/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcCommonMapper.xml +++ b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcCommonMapper.xml @@ -120,7 +120,6 @@ + +