From 5831172413f02d5eecf239359fbe3661822c3b0d Mon Sep 17 00:00:00 2001 From: yuyang Date: Wed, 11 May 2022 16:01:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A4=A7=E5=B1=8F=E3=80=81?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9C=BA=E6=9E=84=E7=BB=9F=E8=AE=A1=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/XhpcChargingStationMapper.xml | 2 +- .../mapper/XhpcHistoryOrderMapper.xml | 2 +- .../XhpcHistoryOrderController.java | 2 +- .../user/controller/XhpcCommonController.java | 8 +++---- .../xhpc/user/mapper/XhpcCommonMapper.java | 2 +- .../xhpc/user/service/IXhpcCommonService.java | 4 ++-- .../service/impl/XhpcCommonServiceImpl.java | 16 ++++++------- .../resources/mapper/XhpcCommonMapper.xml | 24 +++++++++++++++++++ 8 files changed, 42 insertions(+), 18 deletions(-) diff --git a/xhpc-modules/xhpc-card/src/main/resources/mapper/XhpcChargingStationMapper.xml b/xhpc-modules/xhpc-card/src/main/resources/mapper/XhpcChargingStationMapper.xml index b6dec5c0..c08c6f88 100644 --- a/xhpc-modules/xhpc-card/src/main/resources/mapper/XhpcChargingStationMapper.xml +++ b/xhpc-modules/xhpc-card/src/main/resources/mapper/XhpcChargingStationMapper.xml @@ -494,7 +494,7 @@ delete 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 8e15dc6e..c2cd2618 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 @@ -971,7 +971,7 @@ public class XhpcHistoryOrderController extends BaseController { } xhpcSt.setOperatorId(xhpc.getOperatorId()); xhpcSt.setChargingStationId(xhpc.getChargingStationId()); - xhpcSt.setCreateTime(Calendar.getInstance().getTime()); + //xhpcSt.setCreateTime(Calendar.getInstance().getTime()); xhpcSt.setTerminalId(xhpc.getTerminalId()); xhpcSt.setChargingMode(xhpc.getChargingMode()); xhpcSt.setActivityPowerPriceTotal(xhpc.getActivityPowerPriceTotal()); diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCommonController.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCommonController.java index a8ba8051..10d6afaf 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCommonController.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCommonController.java @@ -94,8 +94,8 @@ public class XhpcCommonController extends BaseController { * 机构人员统计 */ @GetMapping(value = "/getPersonnelStatistics") - public TableDataInfo getPersonnelStatistics(String tenantId,Long terminalId,Long operatorId, Long chargingStationId, Long chargingPileId, Integer type, String name , String phone, String account) { - List> list = xhpcCommonService.getPersonnelStatistics(tenantId,terminalId,operatorId,chargingStationId,chargingPileId,type,name,phone,account); + public TableDataInfo getPersonnelStatistics(String tenantId,Long terminalId,Long operatorId, Long chargingStationId, Long chargingPileId, Integer type, String name , String phone, String account,String startTime,String endTime) { + List> list = xhpcCommonService.getPersonnelStatistics(tenantId,terminalId,operatorId,chargingStationId,chargingPileId,type,name,phone,account,startTime,endTime); return getDataTable(list); } @@ -103,8 +103,8 @@ public class XhpcCommonController extends BaseController { * 机构人员统计 */ @PostMapping(value = "/getPersonnelStatisticsExport") - public void getPersonnelStatisticsExport(HttpServletResponse response,String tenantId,Long terminalId, Long operatorId, Long chargingStationId, Long chargingPileId, Integer type, String name , String phone, String account)throws IOException { - xhpcCommonService.getPersonnelStatisticsExport(response,tenantId,terminalId,operatorId,chargingStationId,chargingPileId,type,name,phone,account); + public void getPersonnelStatisticsExport(HttpServletResponse response,String tenantId,Long terminalId, Long operatorId, Long chargingStationId, Long chargingPileId, Integer type, String name , String phone, String account,String startTime,String endTime)throws IOException { + xhpcCommonService.getPersonnelStatisticsExport(response,tenantId,terminalId,operatorId,chargingStationId,chargingPileId,type,name,phone,account,startTime,endTime); } 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 4bfcb0cc..5bc44a21 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 @@ -28,5 +28,5 @@ public interface XhpcCommonMapper { Map getCustomersUser(@Param("phone") String phone,@Param("userId")Long userId,@Param("serialNumber")String serialNumber,@Param("tenantId") String tenantId); - 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); + 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/IXhpcCommonService.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcCommonService.java index 0f3f5895..1c837c09 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcCommonService.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcCommonService.java @@ -46,8 +46,8 @@ public interface IXhpcCommonService { /** * 根据用户手机号获取用户信息 */ - List> getPersonnelStatistics(String tenantId,Long terminalId,Long operatorId, Long chargingStationId, Long chargingPileId, Integer type, String name , String phone, String account); + List> getPersonnelStatistics(String tenantId,Long terminalId,Long operatorId, Long chargingStationId, Long chargingPileId, Integer type, String name , String phone, String account,String startTime,String endTime); - void getPersonnelStatisticsExport(HttpServletResponse response,String tenantId,Long terminalId, Long operatorId, Long chargingStationId, Long chargingPileId, Integer type, String name , String phone, String account)throws IOException; + void getPersonnelStatisticsExport(HttpServletResponse response,String tenantId,Long terminalId, Long operatorId, Long chargingStationId, Long chargingPileId, Integer type, String name , String phone, String account,String startTime,String endTime)throws IOException; } 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 62a3707e..bc5e387c 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 @@ -125,7 +125,7 @@ public class XhpcCommonServiceImpl extends BaseService implements IXhpcCommonSer * @param account */ @Override - public List> getPersonnelStatistics(String tenantId,Long terminalId,Long operatorId, Long chargingStationId, Long chargingPileId, Integer type, String name, String phone, String account) { + public List> getPersonnelStatistics(String tenantId,Long terminalId,Long operatorId, Long chargingStationId, Long chargingPileId, Integer type, String name, String phone, String account,String startTime,String endTime) { //获取登陆用户 LoginUser loginUser = tokenService.getLoginUser(); @@ -139,20 +139,20 @@ 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); + list = xhpcCommonMapper.getPersonnelStatistics(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); + list = xhpcCommonMapper.getPersonnelStatistics(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); + list =xhpcCommonMapper.getPersonnelStatistics(terminalId,operatorId, chargingStationId, chargingPileId, type, name,phone,account, 0,sysUserId,tenantId,startTime,endTime); } return list; } @Override - public void getPersonnelStatisticsExport(HttpServletResponse response, String tenantId,Long terminalId,Long operatorId, Long chargingStationId, Long chargingPileId, Integer type, String name, String phone, String account) throws IOException { + public void getPersonnelStatisticsExport(HttpServletResponse response, String tenantId,Long terminalId,Long operatorId, Long chargingStationId, Long chargingPileId, Integer type, String name, String phone, String account,String startTime,String endTime) throws IOException { LoginUser loginUser = tokenService.getLoginUser(); SysUser sysUser = loginUser.getSysUser(); Long sysUserId = sysUser.getUserId(); @@ -162,14 +162,14 @@ 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); + list = xhpcCommonMapper.getPersonnelStatistics(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); + list = xhpcCommonMapper.getPersonnelStatistics(terminalId,operatorId, chargingStationId, chargingPileId, type, name,phone,account, 2,sysUserId,tenantId,startTime,endTime); } }else{ - list =xhpcCommonMapper.getPersonnelStatistics(terminalId,operatorId, chargingStationId, chargingPileId, type, name,phone,account, 0,sysUserId,tenantId); + list =xhpcCommonMapper.getPersonnelStatistics(terminalId,operatorId, chargingStationId, chargingPileId, type, name,phone,account, 0,sysUserId,tenantId,startTime,endTime); } // 通过工具类创建writer,默认创建xls格式 BigExcelWriter writer = ExcelUtil.getBigWriter("机构人员统计.xlsx"); 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 71cf070a..a6ea1278 100644 --- a/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcCommonMapper.xml +++ b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcCommonMapper.xml @@ -161,6 +161,12 @@ and xcp.phone like concat('%',#{phone},'%') + + and xho.end_time >=#{startTime} + + + and xho.end_time <=#{endTime} + GROUP BY xcp.account @@ -204,6 +210,12 @@ and xcup.phone like concat('%',#{phone},'%') + + and xho.end_time >=#{startTime} + + + and xho.end_time <=#{endTime} + GROUP BY xcup.account @@ -247,6 +259,12 @@ and xcp.phone like concat('%',#{phone},'%') + + and xho.end_time >=#{startTime} + + + and xho.end_time <=#{endTime} + GROUP BY xcp.account union select @@ -289,6 +307,12 @@ and xcup.phone like concat('%',#{phone},'%') + + and xho.end_time >=#{startTime} + + + and xho.end_time <=#{endTime} + GROUP BY xcup.account