diff --git a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/util/UserTypeUtil.java b/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/util/UserTypeUtil.java index d42975d1..f8e605f9 100644 --- a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/util/UserTypeUtil.java +++ b/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/util/UserTypeUtil.java @@ -88,5 +88,8 @@ public class UserTypeUtil { */ public static final String SYS_USER_TYPE_ZERO = "00"; public static final String SYS_USER_TYPE_ONE = "01"; + public static final String SYS_USER_TYPE_TWO = "02"; public static final String SYS_USER_TYPE_THREE = "03"; + + public static final Long SYS_USER_TYPE_ADMIN = 1L; } diff --git a/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcAgreementController.java b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcAgreementController.java index a2756b26..1e63467d 100644 --- a/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcAgreementController.java +++ b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcAgreementController.java @@ -3,6 +3,8 @@ package com.xhpc.general.controller; import com.xhpc.common.core.web.controller.BaseController; import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.core.web.page.TableDataInfo; +import com.xhpc.common.log.annotation.Log; +import com.xhpc.common.log.enums.BusinessType; import com.xhpc.general.domain.XhpcAgreement; import com.xhpc.general.service.IXhpcAgreementService; import org.springframework.beans.factory.annotation.Autowired; @@ -20,18 +22,22 @@ public class XhpcAgreementController extends BaseController { @Autowired IXhpcAgreementService iXhpcAgreementService; + + @Log(title = "协议-删除", businessType = BusinessType.DELETE) @PostMapping("/delete") public AjaxResult delete(@RequestBody XhpcAgreement xhpcAgreement){ return iXhpcAgreementService.deleteAgreementItem(xhpcAgreement.getAgreementId()); } + @Log(title = "协议-添加", businessType = BusinessType.DELETE) @PostMapping("/add") public AjaxResult add(@RequestBody XhpcAgreement xhpcAgreement){ return iXhpcAgreementService.insertAgreementItem(xhpcAgreement.getTitle(),xhpcAgreement.getType(),xhpcAgreement.getContent()); } + @Log(title = "协议-编辑", businessType = BusinessType.UPDATE) @PostMapping("/update") public AjaxResult update(@RequestBody XhpcAgreement xhpcAgreement){ @@ -51,6 +57,7 @@ public class XhpcAgreementController extends BaseController { return AjaxResult.success(iXhpcAgreementService.selectAgreementItem(agreementId)); } + @GetMapping("/getContent") public AjaxResult getContent(@RequestParam Integer type){ diff --git a/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcDictBizController.java b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcDictBizController.java index ae6e2d50..d92d5ea2 100644 --- a/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcDictBizController.java +++ b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcDictBizController.java @@ -3,6 +3,8 @@ package com.xhpc.general.controller; import com.xhpc.common.core.web.controller.BaseController; import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.core.web.page.TableDataInfo; +import com.xhpc.common.log.annotation.Log; +import com.xhpc.common.log.enums.BusinessType; import com.xhpc.general.domain.XhpcDictionary; import com.xhpc.general.dto.XhpcDictionaryChild; import com.xhpc.general.service.IXhpcDictBizService; @@ -42,6 +44,7 @@ public class XhpcDictBizController extends BaseController { * @param sort the dictionary's sortValue * @return */ + @Log(title = "字典-添加", businessType = BusinessType.INSERT) @PostMapping("/addMainItem") public AjaxResult addMainDictionaryItem(@RequestBody XhpcDictionary xhpcDictionary){ diff --git a/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcEtTokenController.java b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcEtTokenController.java index 16360e06..96d6ded3 100644 --- a/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcEtTokenController.java +++ b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcEtTokenController.java @@ -3,6 +3,8 @@ package com.xhpc.general.controller; import com.xhpc.common.core.web.controller.BaseController; import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.core.web.page.TableDataInfo; +import com.xhpc.common.log.annotation.Log; +import com.xhpc.common.log.enums.BusinessType; import com.xhpc.general.domain.EtTokenEntity; import com.xhpc.general.service.IXhpcEtTokenService; import org.springframework.beans.factory.annotation.Autowired; @@ -28,12 +30,14 @@ public class XhpcEtTokenController extends BaseController { return getDataTable(iXhpcEtTokenService.list(operatorId, operatorId3irdpty)); } + @Log(title = "第三方token-删除", businessType = BusinessType.DELETE) @PostMapping(value = "/delete") public AjaxResult delete(@RequestBody EtTokenEntity etTokenEntity){ return iXhpcEtTokenService.delete(etTokenEntity.getId()); } + @Log(title = "第三方token-添加", businessType = BusinessType.INSERT) @PostMapping(value = "/add") public AjaxResult add(@RequestBody EtTokenEntity etTokenEntity){ diff --git a/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcHelpController.java b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcHelpController.java index a17144d5..6901de2d 100644 --- a/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcHelpController.java +++ b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcHelpController.java @@ -3,6 +3,8 @@ package com.xhpc.general.controller; import com.xhpc.common.core.web.controller.BaseController; import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.core.web.page.TableDataInfo; +import com.xhpc.common.log.annotation.Log; +import com.xhpc.common.log.enums.BusinessType; import com.xhpc.general.domain.HelpEntity; import com.xhpc.general.service.IXhpcHelpService; import org.springframework.beans.factory.annotation.Autowired; @@ -22,18 +24,22 @@ public class XhpcHelpController extends BaseController { @Autowired IXhpcHelpService iXhpcHelpService; + + @Log(title = "帮助-删除", businessType = BusinessType.DELETE) @PostMapping("/delete") public AjaxResult deleteHelpItem(@RequestBody HelpEntity helpEntity){ return iXhpcHelpService.deleteHelpItem(helpEntity.getHelpId()); } + @Log(title = "帮助-添加", businessType = BusinessType.INSERT) @PostMapping("/add") public AjaxResult insertHelpItem(@RequestBody HelpEntity helpEntity){ return iXhpcHelpService.insertHelpItem(helpEntity.getTitle(),helpEntity.getContent(),helpEntity.getType()); } + @Log(title = "帮助-修改", businessType = BusinessType.UPDATE) @PostMapping("/update") public AjaxResult updateHelpItem(@RequestBody HelpEntity helpEntity){ diff --git a/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcServiceDataUpdateController.java b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcServiceDataUpdateController.java index 80703e03..58bf8604 100644 --- a/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcServiceDataUpdateController.java +++ b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcServiceDataUpdateController.java @@ -1,6 +1,8 @@ package com.xhpc.general.controller; import com.xhpc.common.core.web.domain.AjaxResult; +import com.xhpc.common.log.annotation.Log; +import com.xhpc.common.log.enums.BusinessType; import com.xhpc.general.service.IXhpcServiceDataUpdateService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -23,6 +25,7 @@ public class XhpcServiceDataUpdateController { return AjaxResult.success(xhpcServiceDataUpdateService.list()); } + @Log(title = "小程序设置-修改", businessType = BusinessType.UPDATE) @PostMapping("/update") public AjaxResult update(@RequestParam(required = false) String SOC, @RequestParam(required = false) String version, @RequestParam(required = false) String phone, @RequestParam(required = false) String aliyunMessageCount) { diff --git a/xhpc-modules/xhpc-general/src/main/resources/mapper/XhpcAgreementMapper.xml b/xhpc-modules/xhpc-general/src/main/resources/mapper/XhpcAgreementMapper.xml index 4966c1ec..533c8494 100644 --- a/xhpc-modules/xhpc-general/src/main/resources/mapper/XhpcAgreementMapper.xml +++ b/xhpc-modules/xhpc-general/src/main/resources/mapper/XhpcAgreementMapper.xml @@ -19,7 +19,6 @@ - update xhpc_agreement set del_flag=1 where agreement_id=#{agreementId} diff --git a/xhpc-modules/xhpc-general/src/main/resources/mapper/XhpcEtTokenMapper.xml b/xhpc-modules/xhpc-general/src/main/resources/mapper/XhpcEtTokenMapper.xml index 94ab0063..823957d3 100644 --- a/xhpc-modules/xhpc-general/src/main/resources/mapper/XhpcEtTokenMapper.xml +++ b/xhpc-modules/xhpc-general/src/main/resources/mapper/XhpcEtTokenMapper.xml @@ -34,7 +34,6 @@ - delete from et_auth_sec_token where id = #{id} diff --git a/xhpc-modules/xhpc-order/pom.xml b/xhpc-modules/xhpc-order/pom.xml index 121691b4..f1a31b0a 100644 --- a/xhpc-modules/xhpc-order/pom.xml +++ b/xhpc-modules/xhpc-order/pom.xml @@ -99,6 +99,10 @@ com.squareup.okhttp3 okhttp + + com.ruoyi + ruoyi-common-log + 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 78a7a2e0..142be756 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 @@ -1,6 +1,5 @@ package com.xhpc.order.api; -import cn.hutool.core.date.DateUtil; import com.alibaba.fastjson.JSONObject; import com.xhpc.common.api.WebSocketService; import com.xhpc.common.core.web.controller.BaseController; @@ -22,7 +21,6 @@ import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletRequest; import java.math.BigDecimal; -import java.util.Calendar; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -68,7 +66,6 @@ public class XhpcChargeOrderController extends BaseController { } - /** * 启动充电 * @param userId diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderReconciliationStatusController.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderReconciliationStatusController.java index 04eeeede..01aaefeb 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderReconciliationStatusController.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderReconciliationStatusController.java @@ -4,6 +4,8 @@ import com.xhpc.common.core.utils.StringUtils; import com.xhpc.common.core.web.controller.BaseController; import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.core.web.page.TableDataInfo; +import com.xhpc.common.log.annotation.Log; +import com.xhpc.common.log.enums.BusinessType; import com.xhpc.order.service.IXhpcHistoryOrderReconciliationStatusService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -25,6 +27,7 @@ public class XhpcHistoryOrderReconciliationStatusController extends BaseControll * 修改对账状态 * @return */ + @Log(title = "对账-修改对账状态", businessType = BusinessType.UPDATE) @PostMapping("/status") @ApiOperation(value = "修改对账状态") public AjaxResult status(@RequestBody Map map) { diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderSortingStatusController.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderSortingStatusController.java index cbb246fe..6c097111 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderSortingStatusController.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderSortingStatusController.java @@ -5,6 +5,8 @@ import com.xhpc.common.core.utils.StringUtils; import com.xhpc.common.core.web.controller.BaseController; import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.core.web.page.TableDataInfo; +import com.xhpc.common.log.annotation.Log; +import com.xhpc.common.log.enums.BusinessType; import com.xhpc.order.service.IXhpcHistoryOrderSortingStatusService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -27,6 +29,7 @@ public class XhpcHistoryOrderSortingStatusController extends BaseController { * 修改清分状态 * @return */ + @Log(title = "清分-修改清分状态", businessType = BusinessType.UPDATE) @PostMapping("/status") @ApiOperation(value = "修改清分状态") public AjaxResult status(@RequestBody Map map) { diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcStatisticsController.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcStatisticsController.java index c99ff053..52bc164b 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcStatisticsController.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcStatisticsController.java @@ -10,6 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.UnsupportedEncodingException; @@ -42,9 +43,9 @@ public class XhpcStatisticsController extends BaseController { * @return */ @GetMapping("/getTimeIntervalPage") - public TableDataInfo getTimeIntervalPage(String chargingStationIds,Long internetUserId, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) + public TableDataInfo getTimeIntervalPage(HttpServletRequest request,String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) { - List> list = xhpcStatisticsService.getTimeIntervalPage(chargingStationIds,internetUserId,operatorId,startTime,endTime,userId,type); + List> list = xhpcStatisticsService.getTimeIntervalPage(request,chargingStationIds,internetUserId,operatorId,startTime,endTime,userId,type); return getDataTable(list); } @@ -60,9 +61,9 @@ public class XhpcStatisticsController extends BaseController { * @return */ @GetMapping("/getDateIntervalPage") - public TableDataInfo getDateIntervalPage(String chargingStationIds,Long internetUserId, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) + public TableDataInfo getDateIntervalPage(HttpServletRequest request,String chargingStationIds,Long internetUserId, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) { - List> list = xhpcStatisticsService.getDateIntervalPage(chargingStationIds,internetUserId,operatorId,startTime,endTime,userId,type); + List> list = xhpcStatisticsService.getDateIntervalPage(request,chargingStationIds,internetUserId,operatorId,startTime,endTime,userId,type); return getDataTable(list); } /** @@ -78,9 +79,9 @@ public class XhpcStatisticsController extends BaseController { * @return */ @GetMapping("/getStationIntervalPage") - public TableDataInfo getStationIntervalPage(String chargingStationIds,String operatorIds,Long internetUserId, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) + public TableDataInfo getStationIntervalPage(HttpServletRequest request,String chargingStationIds,String operatorIds,Long internetUserId, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) { - List> list = xhpcStatisticsService.getStationIntervalPage(chargingStationIds,operatorIds,internetUserId,operatorId,startTime,endTime,userId,type); + List> list = xhpcStatisticsService.getStationIntervalPage(request,chargingStationIds,operatorIds,internetUserId,operatorId,startTime,endTime,userId,type); return getDataTable(list); } @@ -95,9 +96,9 @@ public class XhpcStatisticsController extends BaseController { * @return */ @GetMapping("/getOperatorIntervalPage") - public TableDataInfo getOperatorIntervalPage(String operatorIds, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) + public TableDataInfo getOperatorIntervalPage(HttpServletRequest request,String operatorIds, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) { - List> list = xhpcStatisticsService.getOperatorIntervalPage(operatorIds,operatorId,startTime,endTime,userId,type); + List> list = xhpcStatisticsService.getOperatorIntervalPage(request,operatorIds,operatorId,startTime,endTime,userId,type); return getDataTable(list); } @@ -112,10 +113,10 @@ public class XhpcStatisticsController extends BaseController { * @return */ @GetMapping("/getInternetUserIntervalPage") - public TableDataInfo getInternetUserIntervalPage(String internetUserIds,Long internetUserId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) + public TableDataInfo getInternetUserIntervalPage(HttpServletRequest request,String internetUserIds,Long internetUserId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) { startPage(); - List> list = xhpcStatisticsService.getInternetUserIntervalPage(internetUserIds,internetUserId,startTime,endTime,userId,type); + List> list = xhpcStatisticsService.getInternetUserIntervalPage(request,internetUserIds,internetUserId,startTime,endTime,userId,type); return getDataTable(list); } @@ -132,9 +133,9 @@ public class XhpcStatisticsController extends BaseController { * @return */ @GetMapping("/getTerminalIntervalPage") - public TableDataInfo getTerminalIntervalPage(String chargingStationId,String terminalId,Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) + public TableDataInfo getTerminalIntervalPage(HttpServletRequest request,String chargingStationId,String terminalId,Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) { - List> list = xhpcStatisticsService.getTerminalIntervalPage(chargingStationId,terminalId,operatorId,startTime,endTime,userId,type); + List> list = xhpcStatisticsService.getTerminalIntervalPage(request,chargingStationId,terminalId,operatorId,startTime,endTime,userId,type); return getDataTable(list); } @@ -146,12 +147,12 @@ public class XhpcStatisticsController extends BaseController { * @return */ @GetMapping("/getChargingStationList") - public AjaxResult getChargingStationList(Long operatorId, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) + public AjaxResult getChargingStationList(HttpServletRequest request,Long operatorId, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) { if (type == null || type==3) { return AjaxResult.success(); } - return xhpcStatisticsService.getChargingStationList(operatorId, userId, type); + return xhpcStatisticsService.getChargingStationList(request,operatorId, userId, type); } /** @@ -162,12 +163,12 @@ public class XhpcStatisticsController extends BaseController { * @return */ @GetMapping("/getOperatorList") - public AjaxResult getOperatorList(Long operatorId, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) + public AjaxResult getOperatorList(HttpServletRequest request,Long operatorId, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) { if (type == null || type==3) { return AjaxResult.success(); } - return xhpcStatisticsService.getOperatorList(operatorId, userId, type); + return xhpcStatisticsService.getOperatorList(request,operatorId, userId, type); } /** @@ -178,12 +179,12 @@ public class XhpcStatisticsController extends BaseController { * @return */ @GetMapping("/getInternetUserIList") - public AjaxResult getInternetUserIList(Long internetUserId, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) + public AjaxResult getInternetUserIList(HttpServletRequest request,Long internetUserId, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) { if (type == null || type==2) { return AjaxResult.success(); } - return xhpcStatisticsService.getInternetUserIList(internetUserId, userId, type); + return xhpcStatisticsService.getInternetUserIList(request,internetUserId, userId, type); } /** @@ -194,11 +195,11 @@ public class XhpcStatisticsController extends BaseController { * @return */ @GetMapping("/getTerminalList") - public AjaxResult getTerminalList(Long chargingStationId, @RequestParam("userId") Long userId, @RequestParam("type") Integer type) { + public AjaxResult getTerminalList(HttpServletRequest request,Long chargingStationId, @RequestParam("userId") Long userId, @RequestParam("type") Integer type) { if (type == null || type == 3) { return AjaxResult.success(); } - return xhpcStatisticsService.getTerminalList(chargingStationId, userId, type); + return xhpcStatisticsService.getTerminalList(request,chargingStationId, userId, type); } /** @@ -208,8 +209,8 @@ public class XhpcStatisticsController extends BaseController { * @return */ @GetMapping("/getSourceList") - public AjaxResult getSourceList(@RequestParam("userId") Long userId, @RequestParam("type") Integer type) { - return xhpcStatisticsService.getSourceList(userId, type); + public AjaxResult getSourceList(HttpServletRequest request,@RequestParam("userId") Long userId, @RequestParam("type") Integer type) { + return xhpcStatisticsService.getSourceList(request,userId, type); } /** @@ -220,9 +221,9 @@ public class XhpcStatisticsController extends BaseController { * @return */ @GetMapping("/getSumSourceList") - public TableDataInfo getSumSourceList(String startTime, String endTime, String internetUserIds,@RequestParam("userId") Long userId, @RequestParam("type") Integer type, String chargingStationIds) { + public TableDataInfo getSumSourceList(HttpServletRequest request,String startTime, String endTime, String internetUserIds,@RequestParam("userId") Long userId, @RequestParam("type") Integer type, String chargingStationIds) { startPage(); - List> list = xhpcStatisticsService.getSumSourceList(startTime,endTime,internetUserIds,userId, type,chargingStationIds); + List> list = xhpcStatisticsService.getSumSourceList(request,startTime,endTime,internetUserIds,userId, type,chargingStationIds); return getDataTable(list); } @@ -242,8 +243,8 @@ public class XhpcStatisticsController extends BaseController { * @return */ @PostMapping("/timeInterval/export") - public void timeIntervalExport(HttpServletResponse response, String chargingStationIds,Long internetUserId, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) throws IOException { - xhpcStatisticsService.timeIntervalExport(response, chargingStationIds,internetUserId,operatorId,startTime,endTime,userId,type); + public void timeIntervalExport(HttpServletRequest request,HttpServletResponse response, String chargingStationIds,Long internetUserId, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) throws IOException { + xhpcStatisticsService.timeIntervalExport(request,response, chargingStationIds,internetUserId,operatorId,startTime,endTime,userId,type); } /** @@ -258,8 +259,8 @@ public class XhpcStatisticsController extends BaseController { * @return */ @PostMapping("/dateInterval/export") - public void dateIntervalExport(HttpServletResponse response, String chargingStationIds,Long internetUserId, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) throws IOException { - xhpcStatisticsService.dateIntervalExport(response, chargingStationIds,internetUserId,operatorId,startTime,endTime,userId,type); + public void dateIntervalExport(HttpServletRequest request,HttpServletResponse response, String chargingStationIds,Long internetUserId, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) throws IOException { + xhpcStatisticsService.dateIntervalExport(request,response, chargingStationIds,internetUserId,operatorId,startTime,endTime,userId,type); } /** * 电站统计导出 @@ -274,8 +275,8 @@ public class XhpcStatisticsController extends BaseController { * @return */ @PostMapping("/stationInterval/export") - public void stationIntervalExport(HttpServletResponse response, String chargingStationIds,String operatorIds,Long internetUserId, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) throws IOException { - xhpcStatisticsService.stationIntervalExport(response, chargingStationIds,operatorIds,internetUserId,operatorId,startTime,endTime,userId,type); + public void stationIntervalExport(HttpServletRequest request,HttpServletResponse response, String chargingStationIds,String operatorIds,Long internetUserId, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) throws IOException { + xhpcStatisticsService.stationIntervalExport(request,response, chargingStationIds,operatorIds,internetUserId,operatorId,startTime,endTime,userId,type); } /** @@ -289,8 +290,8 @@ public class XhpcStatisticsController extends BaseController { * @return */ @PostMapping("/operatorInterval/export") - public void operatorIntervalExport(HttpServletResponse response, String operatorIds, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) throws IOException { - xhpcStatisticsService.operatorIntervalExport(response, operatorIds,operatorId,startTime,endTime,userId,type); + public void operatorIntervalExport(HttpServletRequest request,HttpServletResponse response, String operatorIds, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) throws IOException { + xhpcStatisticsService.operatorIntervalExport(request,response, operatorIds,operatorId,startTime,endTime,userId,type); } /** @@ -298,8 +299,8 @@ public class XhpcStatisticsController extends BaseController { * @return */ @PostMapping("/internetUserInterval/export") - public void internetUserIntervalExport(HttpServletResponse response, String startTime, String endTime,String internetUserIds, @RequestParam("userId") Long userId, @RequestParam("type")Integer type, String chargingStationIds) throws IOException { - xhpcStatisticsService.getSumSourceListExport(response, startTime,endTime,internetUserIds,userId,type,chargingStationIds); + public void internetUserIntervalExport(HttpServletRequest request,HttpServletResponse response, String startTime, String endTime,String internetUserIds, @RequestParam("userId") Long userId, @RequestParam("type")Integer type, String chargingStationIds) throws IOException { + xhpcStatisticsService.getSumSourceListExport(request,response, startTime,endTime,internetUserIds,userId,type,chargingStationIds); } @@ -315,8 +316,8 @@ public class XhpcStatisticsController extends BaseController { * @return */ @PostMapping("/terminalInterval/export") - public void terminalIntervalExport(HttpServletResponse response, String chargingStationId,String terminalId,Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) throws IOException { - xhpcStatisticsService.terminalIntervalExport(response, chargingStationId,terminalId,operatorId,startTime,endTime,userId,type); + public void terminalIntervalExport(HttpServletRequest request,HttpServletResponse response, String chargingStationId,String terminalId,Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) throws IOException { + xhpcStatisticsService.terminalIntervalExport(request,response, chargingStationId,terminalId,operatorId,startTime,endTime,userId,type); } } diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcStatisticsServiceMapper.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcStatisticsServiceMapper.java index a3667492..b36de127 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcStatisticsServiceMapper.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcStatisticsServiceMapper.java @@ -27,7 +27,7 @@ public interface XhpcStatisticsServiceMapper { * @param type 1 平台 2 运营商 3流量方 * @return */ - List> getTimeIntervalPage(@Param("chargingStationIds") List chargingStationIds,@Param("internetUserId") Long internetUserId,@Param("operatorId") Long operatorId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("type") Integer type,@Param("userId") Long userId); + List> getTimeIntervalPage(@Param("chargingStationIds") List chargingStationIds,@Param("internetUserId") Long internetUserId,@Param("operatorId") Long operatorId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("type") Integer type,@Param("userId") Long userId,@Param("tenantId")String tenantId); /** @@ -40,7 +40,7 @@ public interface XhpcStatisticsServiceMapper { * @param type 1 平台 2 运营商 3流量方 * @return */ - List> getDateIntervalPage(@Param("chargingStationIds") List chargingStationIds,@Param("internetUserId") Long internetUserId,@Param("operatorId") Long operatorId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("type") Integer type,@Param("userId")Long userId); + List> getDateIntervalPage(@Param("chargingStationIds") List chargingStationIds,@Param("internetUserId") Long internetUserId,@Param("operatorId") Long operatorId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("type") Integer type,@Param("userId")Long userId,@Param("tenantId")String tenantId); /** * 电站统计 @@ -53,7 +53,7 @@ public interface XhpcStatisticsServiceMapper { * @param type 1 平台 2 运营商 3流量方 * @return */ - List> getStationIntervalPage(@Param("chargingStationIds") List chargingStationIds,@Param("operatorUserId") List operatorUserId,@Param("internetUserId") Long internetUserId,@Param("operatorId") Long operatorId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("type") Integer type,@Param("userId") Long userId); + List> getStationIntervalPage(@Param("chargingStationIds") List chargingStationIds,@Param("operatorUserId") List operatorUserId,@Param("internetUserId") Long internetUserId,@Param("operatorId") Long operatorId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("type") Integer type,@Param("userId") Long userId,@Param("tenantId")String tenantId); /** * 运营商统计 @@ -64,7 +64,7 @@ public interface XhpcStatisticsServiceMapper { * @param type 1 平台 2 运营商 3流量方 * @return */ - List> getOperatorIntervalPage(@Param("operatorUserId") List operatorUserId,@Param("operatorId") Long operatorId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("type") Integer type,@Param("userId") Long userId); + List> getOperatorIntervalPage(@Param("operatorUserId") List operatorUserId,@Param("operatorId") Long operatorId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("type") Integer type,@Param("userId") Long userId,@Param("tenantId")String tenantId); /** * 流量方统计 @@ -75,7 +75,7 @@ public interface XhpcStatisticsServiceMapper { * @param type 1 平台 2 运营商 3流量方 * @return */ - List> getInternetUserIntervalPage(@Param("internetIds") List internetIds,@Param("internetUserId") Long internetUserId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("type") Integer type,@Param("userId") Long userId); + List> getInternetUserIntervalPage(@Param("internetIds") List internetIds,@Param("internetUserId") Long internetUserId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("type") Integer type,@Param("userId") Long userId,@Param("tenantId")String tenantId); /** @@ -88,7 +88,7 @@ public interface XhpcStatisticsServiceMapper { * @param type 1 平台 2 运营商 3流量方 * @return */ - List> getTerminalIntervalPage(@Param("chargingStationId") String chargingStationId,@Param("terminalId") String terminalId,@Param("operatorId") Long operatorId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("type") Integer type,@Param("userId") Long userId); + List> getTerminalIntervalPage(@Param("chargingStationId") String chargingStationId,@Param("terminalId") String terminalId,@Param("operatorId") Long operatorId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("type") Integer type,@Param("userId") Long userId,@Param("tenantId")String tenantId); /** @@ -98,7 +98,7 @@ public interface XhpcStatisticsServiceMapper { * @param type 1 平台 2 运营商 3流量方 * @return */ - List> getChargingStationList(@Param("operatorId")Long operatorId,@Param("userId")Long userId,@Param("type")Integer type); + List> getChargingStationList(@Param("operatorId")Long operatorId,@Param("userId")Long userId,@Param("type")Integer type,@Param("tenantId")String tenantId); /** * 运营商列表 @@ -107,7 +107,7 @@ public interface XhpcStatisticsServiceMapper { * @param type 1 平台 2 运营商 3流量方 * @return */ - List> getOperatorList(@Param("operatorId")Long operatorId,@Param("userId")Long userId,@Param("type")Integer type); + List> getOperatorList(@Param("operatorId")Long operatorId,@Param("userId")Long userId,@Param("type")Integer type,@Param("tenantId")String tenantId); /** @@ -117,7 +117,7 @@ public interface XhpcStatisticsServiceMapper { * @param type 1 平台 2 运营商 3流量方 * @return */ - List> getInternetUserIList(@Param("internetUserId")Long internetUserId,@Param("userId")Long userId,@Param("type")Integer type); + List> getInternetUserIList(@Param("internetUserId")Long internetUserId,@Param("userId")Long userId,@Param("type")Integer type,@Param("tenantId")String tenantId); /** * 终端列表 @@ -126,7 +126,7 @@ public interface XhpcStatisticsServiceMapper { * @param type 1 平台 2 运营商 3流量方 * @return */ - List> getTerminalList(@Param("chargingStationId")Long chargingStationId,@Param("userId")Long userId,@Param("type")Integer type); + List> getTerminalList(@Param("chargingStationId")Long chargingStationId,@Param("userId")Long userId,@Param("type")Integer type,@Param("tenantId")String tenantId); /** * 添加时段订单统计 @@ -144,7 +144,7 @@ public interface XhpcStatisticsServiceMapper { * 获取流量方列表 * @return */ - List> getInternetList(@Param("userId")Long userId); + List> getInternetList(@Param("userId")Long userId,@Param("tenantId")String tenantId); /** @@ -153,7 +153,7 @@ public interface XhpcStatisticsServiceMapper { * @param type 1 平台 2 运营商 3流量方 * @return */ - List> getSumSourceList(@Param("startTime")String startTime, @Param("endTime")String endTime,@Param("sourceIds")List sourceIds, @Param("userId")Long userId, @Param("type")Integer type,@Param("chargingStationIdList")List chargingStationIdList); + List> getSumSourceList(@Param("startTime")String startTime, @Param("endTime")String endTime,@Param("sourceIds")List sourceIds, @Param("userId")Long userId, @Param("type")Integer type,@Param("chargingStationIdList")List chargingStationIdList,@Param("tenantId")String tenantId); /** * 获取登陆用户信息 diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IXhpcStatisticsService.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IXhpcStatisticsService.java index 4cf4c5c9..2210ef8f 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IXhpcStatisticsService.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IXhpcStatisticsService.java @@ -6,6 +6,7 @@ import com.xhpc.order.domain.XhpcStatisticsTimeInterval; import org.springframework.web.bind.annotation.RequestParam; import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.List; @@ -29,7 +30,7 @@ public interface IXhpcStatisticsService { * @param type 1 平台 2 运营商 3流量方 * @return */ - List> getTimeIntervalPage(String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type); + List> getTimeIntervalPage(HttpServletRequest request,String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type); /** @@ -43,7 +44,7 @@ public interface IXhpcStatisticsService { * @param type 1 平台 2 运营商 3流量方 * @return */ - List> getDateIntervalPage(String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type); + List> getDateIntervalPage(HttpServletRequest request,String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type); /** * 电站统计 @@ -57,7 +58,7 @@ public interface IXhpcStatisticsService { * @param type 1 平台 2 运营商 3流量方 * @return */ - List> getStationIntervalPage(String chargingStationIds,String operatorIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type); + List> getStationIntervalPage(HttpServletRequest request,String chargingStationIds,String operatorIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type); /** * 运营商统计 @@ -69,7 +70,7 @@ public interface IXhpcStatisticsService { * @param type 1 平台 2 运营商 3流量方 * @return */ - List> getOperatorIntervalPage(String operatorIds,Long operatorId, String startTime, String endTime, Long userId, Integer type); + List> getOperatorIntervalPage(HttpServletRequest request,String operatorIds,Long operatorId, String startTime, String endTime, Long userId, Integer type); /** @@ -82,7 +83,7 @@ public interface IXhpcStatisticsService { * @param type 1 平台 2 运营商 3流量方 * @return */ - List> getInternetUserIntervalPage(String internetUserIds, Long internetUserId, String startTime, String endTime, Long userId, Integer type); + List> getInternetUserIntervalPage(HttpServletRequest request,String internetUserIds, Long internetUserId, String startTime, String endTime, Long userId, Integer type); /** @@ -96,7 +97,7 @@ public interface IXhpcStatisticsService { * @param type 1 平台 2 运营商 3流量方 * @return */ - List> getTerminalIntervalPage(String chargingStationId, String terminalId, Long operatorId, String startTime, String endTime, Long userId, Integer type); + List> getTerminalIntervalPage(HttpServletRequest request,String chargingStationId, String terminalId, Long operatorId, String startTime, String endTime, Long userId, Integer type); /** * 电站列表 @@ -105,7 +106,7 @@ public interface IXhpcStatisticsService { * @param type 1 平台 2 运营商 3流量方 * @return */ - AjaxResult getChargingStationList(Long operatorId,Long userId,Integer type); + AjaxResult getChargingStationList(HttpServletRequest request,Long operatorId,Long userId,Integer type); /** * 运营商列表 @@ -114,7 +115,7 @@ public interface IXhpcStatisticsService { * @param type 1 平台 2 运营商 3流量方 * @return */ - AjaxResult getOperatorList(Long operatorId,Long userId,Integer type); + AjaxResult getOperatorList(HttpServletRequest request,Long operatorId,Long userId,Integer type); /** * 流量方列表 @@ -123,7 +124,7 @@ public interface IXhpcStatisticsService { * @param type 1 平台 2 运营商 3流量方 * @return */ - AjaxResult getInternetUserIList(Long internetUserId,Long userId,Integer type); + AjaxResult getInternetUserIList(HttpServletRequest request,Long internetUserId,Long userId,Integer type); /** @@ -133,7 +134,7 @@ public interface IXhpcStatisticsService { * @param type 1 平台 2 运营商 3流量方 * @return */ - AjaxResult getTerminalList(Long chargingStationId,Long userId,Integer type); + AjaxResult getTerminalList(HttpServletRequest request,Long chargingStationId,Long userId,Integer type); /** * 订单来源列表 @@ -141,7 +142,7 @@ public interface IXhpcStatisticsService { * @param type 1 平台 2 运营商 3流量方 * @return */ - AjaxResult getSourceList(Long userId,Integer type); + AjaxResult getSourceList(HttpServletRequest request,Long userId,Integer type); /** * 订单来源列表 @@ -149,7 +150,7 @@ public interface IXhpcStatisticsService { * @param type 1 平台 2 运营商 3流量方 * @return */ - List> getSumSourceList(String startTime, String endTime, String sourceIds,Long userId,Integer type, String chargingStationIds); + List> getSumSourceList(HttpServletRequest request,String startTime, String endTime, String sourceIds,Long userId,Integer type, String chargingStationIds); /** * 添加时段订单统计 @@ -180,7 +181,7 @@ public interface IXhpcStatisticsService { * @param type 1 平台 2 运营商 3流量方 * @return */ - void timeIntervalExport(HttpServletResponse response, String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException; + void timeIntervalExport(HttpServletRequest request,HttpServletResponse response, String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException; /** @@ -194,7 +195,7 @@ public interface IXhpcStatisticsService { * @param type 1 平台 2 运营商 3流量方 * @return */ - void dateIntervalExport(HttpServletResponse response, String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException; + void dateIntervalExport(HttpServletRequest request,HttpServletResponse response, String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException; /** * 电站统计导出 @@ -208,7 +209,7 @@ public interface IXhpcStatisticsService { * @param type 1 平台 2 运营商 3流量方 * @return */ - void stationIntervalExport(HttpServletResponse response, String chargingStationIds,String operatorIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException; + void stationIntervalExport(HttpServletRequest request,HttpServletResponse response, String chargingStationIds,String operatorIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException; /** * 运营商统计导出 @@ -220,14 +221,14 @@ public interface IXhpcStatisticsService { * @param type 1 平台 2 运营商 3流量方 * @return */ - void operatorIntervalExport(HttpServletResponse response, String operatorIds,Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException; + void operatorIntervalExport(HttpServletRequest request,HttpServletResponse response, String operatorIds,Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException; /** * 订单来源统计导出 * @return */ - void getSumSourceListExport(HttpServletResponse response, String startTime, String endTime, String sourceIds,Long userId,Integer type, String chargingStationIds) throws IOException; + void getSumSourceListExport(HttpServletRequest request,HttpServletResponse response, String startTime, String endTime, String sourceIds,Long userId,Integer type, String chargingStationIds) throws IOException; /** @@ -241,7 +242,7 @@ public interface IXhpcStatisticsService { * @param type 1 平台 2 运营商 3流量方 * @return */ - void terminalIntervalExport(HttpServletResponse response, String chargingStationId, String terminalId, Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException; + void terminalIntervalExport(HttpServletRequest request,HttpServletResponse response, String chargingStationId, String terminalId, Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException; } diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcStatisticsServiceImpl.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcStatisticsServiceImpl.java index 61333dea..284ca74e 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcStatisticsServiceImpl.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcStatisticsServiceImpl.java @@ -8,17 +8,22 @@ import cn.hutool.poi.excel.ExcelWriter; 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.security.service.TokenService; +import com.xhpc.common.util.UserTypeUtil; import com.xhpc.order.domain.XhpcStatisticsStation; import com.xhpc.order.domain.XhpcStatisticsTimeInterval; import com.xhpc.order.mapper.XhpcStatisticsServiceMapper; import com.xhpc.order.service.IXhpcHistoryOrderService; import com.xhpc.order.service.IXhpcStatisticsService; +import com.xhpc.system.api.domain.SysUser; +import com.xhpc.system.api.model.LoginUser; import org.checkerframework.checker.units.qual.A; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.*; @@ -35,8 +40,11 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati private XhpcStatisticsServiceMapper xhpcStatisticsServiceMapper; @Autowired private IXhpcHistoryOrderService xhpcHistoryOrderService; + @Autowired + private TokenService tokenService; + @Override - public List> getTimeIntervalPage(String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) { + public List> getTimeIntervalPage(HttpServletRequest request,String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) { if (getJudge(internetUserId, operatorId, type)){ return new ArrayList<>(); } @@ -45,26 +53,24 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati chargingStationId= Arrays.asList(chargingStationIds.split(",")); } //获取登陆用户 - Long logUserId = SecurityUtils.getUserId(); + LoginUser loginUser = tokenService.getLoginUser(request); List> list =new ArrayList<>(); - if(logUserId !=1){ - Map landUser = xhpcHistoryOrderService.getLandUser(logUserId); - if(landUser !=null){ - startPage(); - if(landUser.get("userType") !=null){ - if("01".equals(landUser.get("userType").toString()) || "03".equals(landUser.get("userType").toString())){ - Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString()); - //运营商看自己的场站 - list = xhpcStatisticsServiceMapper.getTimeIntervalPage(chargingStationId, internetUserId, operatorId, startTime, endTime, 1,logOperatorId); - }else{ - //查询赋值的场站 - list = xhpcStatisticsServiceMapper.getTimeIntervalPage(chargingStationId, internetUserId, operatorId, startTime, endTime, 2,logUserId); - } - } + SysUser sysUser = loginUser.getSysUser(); + String tenantId = loginUser.getTenantId(); + Long sysUserId = sysUser.getUserId(); + if(!UserTypeUtil.SYS_USER_TYPE_ADMIN.equals(sysUser.getUserId())){ + startPage(); + if(UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())){ + Long logOperatorId = sysUser.getOperatorId(); + //运营商看自己的场站 + list = xhpcStatisticsServiceMapper.getTimeIntervalPage(chargingStationId, internetUserId, operatorId, startTime, endTime, 1,logOperatorId,tenantId); + }else{ + //查询赋值的场站 + list = xhpcStatisticsServiceMapper.getTimeIntervalPage(chargingStationId, internetUserId, operatorId, startTime, endTime, 2,sysUserId,tenantId); } }else{ startPage(); - list =xhpcStatisticsServiceMapper.getTimeIntervalPage(chargingStationId, internetUserId, operatorId, startTime, endTime, 0,logUserId); + list =xhpcStatisticsServiceMapper.getTimeIntervalPage(chargingStationId, internetUserId, operatorId, startTime, endTime, 0,sysUserId,tenantId); } List> page =new ArrayList<>(); if(list !=null && list.size()>0){ @@ -159,7 +165,7 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati return page; } @Override - public List> getDateIntervalPage(String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) { + public List> getDateIntervalPage(HttpServletRequest request,String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) { if (getJudge(internetUserId, operatorId, type)){ return new ArrayList<>(); } @@ -167,35 +173,33 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati if(!"".equals(chargingStationIds) && chargingStationIds !=null){ chargingStationId= Arrays.asList(chargingStationIds.split(",")); } - //获取登陆用户 - Long logUserId = SecurityUtils.getUserId(); + LoginUser loginUser = tokenService.getLoginUser(request); + SysUser sysUser = loginUser.getSysUser(); + String tenantId = loginUser.getTenantId(); + Long sysUserId = sysUser.getUserId(); + //获取登陆用户 List> list =new ArrayList<>(); - if(logUserId !=1){ - Map landUser = xhpcHistoryOrderService.getLandUser(logUserId); - if(landUser !=null){ - startPage(); - if(landUser.get("userType") !=null){ - if("01".equals(landUser.get("userType").toString())){ - Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString()); - //运营商看自己的场站 - list = xhpcStatisticsServiceMapper.getDateIntervalPage(chargingStationId, internetUserId, operatorId, startTime, endTime, 1,logOperatorId); - }else{ - //查询赋值的场站 - list = xhpcStatisticsServiceMapper.getDateIntervalPage(chargingStationId, internetUserId, operatorId, startTime, endTime, 2,logUserId); - } - } + if(!UserTypeUtil.SYS_USER_TYPE_ADMIN.equals(sysUser.getUserId())){ + startPage(); + if(UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())){ + Long logOperatorId = sysUser.getOperatorId(); + //运营商看自己的场站 + list = xhpcStatisticsServiceMapper.getDateIntervalPage(chargingStationId, internetUserId, operatorId, startTime, endTime, 1,logOperatorId,tenantId); + }else{ + //查询赋值的场站 + list = xhpcStatisticsServiceMapper.getDateIntervalPage(chargingStationId, internetUserId, operatorId, startTime, endTime, 2,sysUserId,tenantId); } }else{ startPage(); - list =xhpcStatisticsServiceMapper.getDateIntervalPage(chargingStationId, internetUserId, operatorId, startTime, endTime, 0,logUserId); + list =xhpcStatisticsServiceMapper.getDateIntervalPage(chargingStationId, internetUserId, operatorId, startTime, endTime, 0,sysUserId,tenantId); } return list; } @Override - public List> getStationIntervalPage(String chargingStationIds, String operatorIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) { + public List> getStationIntervalPage(HttpServletRequest request,String chargingStationIds, String operatorIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) { if (getJudge(internetUserId, operatorId, type)){ return new ArrayList<>(); } @@ -207,28 +211,24 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati if(!"".equals(operatorIds) && operatorIds !=null){ operatorUserId= Arrays.asList(operatorIds.split(",")); } - - //获取登陆用户 - Long logUserId = SecurityUtils.getUserId(); + LoginUser loginUser = tokenService.getLoginUser(request); + SysUser sysUser = loginUser.getSysUser(); + String tenantId = loginUser.getTenantId(); + Long sysUserId = sysUser.getUserId(); List> list =new ArrayList<>(); - if(logUserId !=1){ - Map landUser = xhpcHistoryOrderService.getLandUser(logUserId); - if(landUser !=null){ - startPage(); - if(landUser.get("userType") !=null){ - if("01".equals(landUser.get("userType").toString()) || "03".equals(landUser.get("userType").toString())){ - Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString()); - //运营商看自己的场站 - list = xhpcStatisticsServiceMapper.getStationIntervalPage(chargingStationId,operatorUserId,internetUserId,operatorId,startTime,endTime,1,logOperatorId); - }else{ - //查询赋值的场站 - list = xhpcStatisticsServiceMapper.getStationIntervalPage(chargingStationId,operatorUserId,internetUserId,operatorId,startTime,endTime,2,logUserId); - } - } + if(!UserTypeUtil.SYS_USER_TYPE_ADMIN.equals(sysUser.getUserId())){ + startPage(); + if(UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())){ + Long logOperatorId = sysUser.getOperatorId(); + //运营商看自己的场站 + list = xhpcStatisticsServiceMapper.getStationIntervalPage(chargingStationId,operatorUserId,internetUserId,operatorId,startTime,endTime,1,logOperatorId,tenantId); + }else{ + //查询赋值的场站 + list = xhpcStatisticsServiceMapper.getStationIntervalPage(chargingStationId,operatorUserId,internetUserId,operatorId,startTime,endTime,2,sysUserId,tenantId); } }else{ startPage(); - list =xhpcStatisticsServiceMapper.getStationIntervalPage(chargingStationId,operatorUserId,internetUserId,operatorId,startTime,endTime,0,logUserId); + list =xhpcStatisticsServiceMapper.getStationIntervalPage(chargingStationId,operatorUserId,internetUserId,operatorId,startTime,endTime,0,sysUserId,tenantId); } @@ -236,7 +236,7 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati } @Override - public List> getOperatorIntervalPage(String operatorIds, Long operatorId, String startTime, String endTime, Long userId, Integer type) { + public List> getOperatorIntervalPage(HttpServletRequest request,String operatorIds, Long operatorId, String startTime, String endTime, Long userId, Integer type) { if(getJudge(null,operatorId,type)){ return new ArrayList<>(); } @@ -244,35 +244,31 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati if(!"".equals(operatorIds) && operatorIds !=null){ operatorUserId= Arrays.asList(operatorIds.split(",")); } - - //获取登陆用户 - Long logUserId = SecurityUtils.getUserId(); + LoginUser loginUser = tokenService.getLoginUser(request); + SysUser sysUser = loginUser.getSysUser(); + String tenantId = loginUser.getTenantId(); + Long sysUserId = sysUser.getUserId(); List> list =new ArrayList<>(); - if(logUserId !=1){ - Map landUser = xhpcHistoryOrderService.getLandUser(logUserId); - if(landUser !=null){ - startPage(); - if(landUser.get("userType") !=null){ - if("01".equals(landUser.get("userType").toString()) || "03".equals(landUser.get("userType").toString())){ - Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString()); - //运营商看自己的场站 - list = xhpcStatisticsServiceMapper.getOperatorIntervalPage(operatorUserId, operatorId, startTime, endTime, 1,logOperatorId); - }else{ - //查询赋值的场站 - list = xhpcStatisticsServiceMapper.getOperatorIntervalPage(operatorUserId, operatorId, startTime, endTime, 2,logUserId); - } - } + if(!UserTypeUtil.SYS_USER_TYPE_ADMIN.equals(sysUser.getUserId())){ + startPage(); + if(UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())){ + Long logOperatorId = sysUser.getOperatorId(); + //运营商看自己的场站 + list = xhpcStatisticsServiceMapper.getOperatorIntervalPage(operatorUserId, operatorId, startTime, endTime, 1,logOperatorId,tenantId); + }else{ + //查询赋值的场站 + list = xhpcStatisticsServiceMapper.getOperatorIntervalPage(operatorUserId, operatorId, startTime, endTime, 2,sysUserId,tenantId); } }else{ startPage(); - list =xhpcStatisticsServiceMapper.getOperatorIntervalPage(operatorUserId, operatorId, startTime, endTime, 0,logUserId); + list =xhpcStatisticsServiceMapper.getOperatorIntervalPage(operatorUserId, operatorId, startTime, endTime, 0,sysUserId,tenantId); } return list; } @Override - public List> getInternetUserIntervalPage(String internetUserIds, Long internetUserId, String startTime, String endTime, Long userId, Integer type) { + public List> getInternetUserIntervalPage(HttpServletRequest request,String internetUserIds, Long internetUserId, String startTime, String endTime, Long userId, Integer type) { if(getJudge(internetUserId,null,type)){ return new ArrayList<>(); } @@ -280,36 +276,38 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati if(!"".equals(internetUserIds) && internetUserIds !=null){ internetIds= Arrays.asList(internetUserIds.split(",")); } + LoginUser loginUser = tokenService.getLoginUser(request); + SysUser sysUser = loginUser.getSysUser(); + String tenantId = loginUser.getTenantId(); + Long sysUserId = sysUser.getUserId(); // if(("".equals(startTime) && "".equals(endTime)) ||(startTime==null && endTime==null)){ // startTime =date(1); // endTime =date(2); // } - return xhpcStatisticsServiceMapper.getInternetUserIntervalPage(internetIds, internetUserId, startTime, endTime, type,userId); + return xhpcStatisticsServiceMapper.getInternetUserIntervalPage(internetIds, internetUserId, startTime, endTime, type,sysUserId,tenantId); } @Override - public List> getTerminalIntervalPage(String chargingStationId, String terminalId, Long operatorId, String startTime, String endTime, Long userId, Integer type) { + public List> getTerminalIntervalPage(HttpServletRequest request,String chargingStationId, String terminalId, Long operatorId, String startTime, String endTime, Long userId, Integer type) { //获取登陆用户 - Long logUserId = SecurityUtils.getUserId(); + LoginUser loginUser = tokenService.getLoginUser(request); List> list =new ArrayList<>(); - if(logUserId !=1){ - Map landUser = xhpcHistoryOrderService.getLandUser(logUserId); - if(landUser !=null){ - startPage(); - if(landUser.get("userType") !=null){ - if("01".equals(landUser.get("userType").toString())){ - Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString()); - //运营商看自己的场站 - list = xhpcStatisticsServiceMapper.getTerminalIntervalPage(chargingStationId, terminalId, operatorId, startTime, endTime, 1,logOperatorId); - }else{ - //查询赋值的场站 - list = xhpcStatisticsServiceMapper.getTerminalIntervalPage(chargingStationId, terminalId, operatorId, startTime, endTime, 2,logUserId); - } - } + SysUser sysUser = loginUser.getSysUser(); + String tenantId = loginUser.getTenantId(); + Long sysUserId = sysUser.getUserId(); + if(!UserTypeUtil.SYS_USER_TYPE_ADMIN.equals(sysUser.getUserId())){ + startPage(); + if(UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())){ + Long logOperatorId = sysUser.getOperatorId(); + //运营商看自己的场站 + list = xhpcStatisticsServiceMapper.getTerminalIntervalPage(chargingStationId, terminalId, operatorId, startTime, endTime, 1,logOperatorId,tenantId); + }else{ + //查询赋值的场站 + list = xhpcStatisticsServiceMapper.getTerminalIntervalPage(chargingStationId, terminalId, operatorId, startTime, endTime, 2,sysUserId,tenantId); } }else{ startPage(); - list =xhpcStatisticsServiceMapper.getTerminalIntervalPage(chargingStationId, terminalId, operatorId, startTime, endTime, 0,logUserId); + list =xhpcStatisticsServiceMapper.getTerminalIntervalPage(chargingStationId, terminalId, operatorId, startTime, endTime, 0,sysUserId,tenantId); } @@ -317,114 +315,104 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati } @Override - public AjaxResult getChargingStationList(Long operatorId, Long userId, Integer type) { - + public AjaxResult getChargingStationList(HttpServletRequest request,Long operatorId, Long userId, Integer type) { + LoginUser loginUser = tokenService.getLoginUser(request); + SysUser sysUser = loginUser.getSysUser(); + String tenantId = loginUser.getTenantId(); + Long sysUserId = sysUser.getUserId(); //获取登陆用户 - Long logUserId = SecurityUtils.getUserId(); - if(logUserId !=1){ - Map landUser = xhpcHistoryOrderService.getLandUser(logUserId); - if(landUser !=null){ - if(landUser.get("userType") !=null){ - if("01".equals(landUser.get("userType").toString())){ - Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString()); - //运营商看自己的场站 - return AjaxResult.success(xhpcStatisticsServiceMapper.getChargingStationList(operatorId, logOperatorId, 1)); - }else{ - //查询赋值的场站 - return AjaxResult.success(xhpcStatisticsServiceMapper.getChargingStationList(operatorId, logUserId, 2)); - } - } + if(!UserTypeUtil.SYS_USER_TYPE_ADMIN.equals(sysUser.getUserId())){ + if(UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())){ + Long logOperatorId = sysUser.getOperatorId(); + //运营商看自己的场站 + return AjaxResult.success(xhpcStatisticsServiceMapper.getChargingStationList(operatorId, logOperatorId, 1,tenantId)); + }else{ + //查询赋值的场站 + return AjaxResult.success(xhpcStatisticsServiceMapper.getChargingStationList(operatorId, sysUserId, 2,tenantId)); } }else{ - return AjaxResult.success(xhpcStatisticsServiceMapper.getChargingStationList(operatorId, logUserId, 0)); + return AjaxResult.success(xhpcStatisticsServiceMapper.getChargingStationList(operatorId, sysUserId, 0,tenantId)); } - return AjaxResult.success(); } @Override - public AjaxResult getOperatorList(Long operatorId, Long userId, Integer type) { + public AjaxResult getOperatorList(HttpServletRequest request,Long operatorId, Long userId, Integer type) { //获取登陆用户 - Long logUserId = SecurityUtils.getUserId(); - if(logUserId !=1){ - Map landUser = xhpcHistoryOrderService.getLandUser(logUserId); - if(landUser !=null){ - if(landUser.get("userType") !=null){ - if("01".equals(landUser.get("userType").toString())){ - Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString()); - //运营商看自己的场站 - return AjaxResult.success(xhpcStatisticsServiceMapper.getOperatorList(operatorId, logOperatorId, 1)); - }else{ - //查询赋值的场站 - return AjaxResult.success(xhpcStatisticsServiceMapper.getOperatorList(operatorId, logUserId, 2)); - } - } + LoginUser loginUser = tokenService.getLoginUser(request); + SysUser sysUser = loginUser.getSysUser(); + String tenantId = loginUser.getTenantId(); + Long sysUserId = sysUser.getUserId(); + if(!UserTypeUtil.SYS_USER_TYPE_ADMIN.equals(sysUser.getUserId())){ + if(UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())){ + Long logOperatorId = sysUser.getOperatorId(); + //运营商看自己的场站 + return AjaxResult.success(xhpcStatisticsServiceMapper.getOperatorList(operatorId, logOperatorId, 1,tenantId)); + }else{ + //查询赋值的场站 + return AjaxResult.success(xhpcStatisticsServiceMapper.getOperatorList(operatorId, sysUserId, 2,tenantId)); } }else{ - return AjaxResult.success(xhpcStatisticsServiceMapper.getOperatorList(operatorId, logUserId, 0)); + return AjaxResult.success(xhpcStatisticsServiceMapper.getOperatorList(operatorId, sysUserId, 0,tenantId)); } - return AjaxResult.success(); } @Override - public AjaxResult getInternetUserIList(Long internetUserId, Long userId, Integer type) { - return AjaxResult.success(xhpcStatisticsServiceMapper.getInternetUserIList(internetUserId, userId, type)); + public AjaxResult getInternetUserIList(HttpServletRequest request,Long internetUserId, Long userId, Integer type) { + LoginUser loginUser = tokenService.getLoginUser(request); + SysUser sysUser = loginUser.getSysUser(); + String tenantId = loginUser.getTenantId(); + Long sysUserId = sysUser.getUserId(); + return AjaxResult.success(xhpcStatisticsServiceMapper.getInternetUserIList(internetUserId, sysUserId, type,tenantId)); } @Override - public AjaxResult getTerminalList(Long chargingStationId, Long userId, Integer type) { - - //获取登陆用户 - Long logUserId = SecurityUtils.getUserId(); - if(logUserId !=1){ - Map landUser = xhpcHistoryOrderService.getLandUser(logUserId); - if(landUser !=null){ - if(landUser.get("userType") !=null){ - if("01".equals(landUser.get("userType").toString())){ - Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString()); - //运营商看自己的场站 - return AjaxResult.success(xhpcStatisticsServiceMapper.getTerminalList(chargingStationId, logOperatorId, 1)); - }else{ - //查询赋值的场站 - return AjaxResult.success(xhpcStatisticsServiceMapper.getTerminalList(chargingStationId, logUserId, 2)); - } - } + public AjaxResult getTerminalList(HttpServletRequest request,Long chargingStationId, Long userId, Integer type) { +//获取登陆用户 + LoginUser loginUser = tokenService.getLoginUser(request); + SysUser sysUser = loginUser.getSysUser(); + String tenantId = loginUser.getTenantId(); + Long sysUserId = sysUser.getUserId(); + if(!UserTypeUtil.SYS_USER_TYPE_ADMIN.equals(sysUser.getUserId())){ + if(UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())){ + Long logOperatorId = sysUser.getOperatorId(); + //运营商看自己的场站 + return AjaxResult.success(xhpcStatisticsServiceMapper.getTerminalList(chargingStationId, logOperatorId, 1,tenantId)); + }else{ + //查询赋值的场站 + return AjaxResult.success(xhpcStatisticsServiceMapper.getTerminalList(chargingStationId, sysUserId, 2,tenantId)); } }else{ - return AjaxResult.success(xhpcStatisticsServiceMapper.getTerminalList(chargingStationId, logUserId, 0)); + return AjaxResult.success(xhpcStatisticsServiceMapper.getTerminalList(chargingStationId, sysUserId, 0,tenantId)); } - - - - return AjaxResult.success(); } @Override - public AjaxResult getSourceList(Long userId, Integer type) { + public AjaxResult getSourceList(HttpServletRequest request,Long userId, Integer type) { //获取登陆用户 - Long logUserId = SecurityUtils.getUserId(); + LoginUser loginUser = tokenService.getLoginUser(request); + SysUser sysUser = loginUser.getSysUser(); + String tenantId = loginUser.getTenantId(); + Long sysUserId = sysUser.getUserId(); //桩的统计、该时段金额 List> list = new ArrayList<>(); - Map landUser = xhpcStatisticsServiceMapper.getLandUser(logUserId); - if (landUser != null) { - if (landUser.get("userType") != null && "02".equals(landUser.get("userType").toString())) { - list = xhpcStatisticsServiceMapper.getInternetList(logUserId); - }else{ - list = xhpcStatisticsServiceMapper.getInternetList(null); - Map map1 =new HashMap<>(); - Map map2 =new HashMap<>(); - map1.put("name","微信"); - map1.put("id","微信"); - map2.put("name","支付宝"); - map2.put("id","支付宝"); - list.add(map1); - list.add(map2); - } + if (UserTypeUtil.SYS_USER_TYPE_TWO.equals(sysUser.getUserType())) { + list = xhpcStatisticsServiceMapper.getInternetList(sysUserId,tenantId); + }else{ + list = xhpcStatisticsServiceMapper.getInternetList(null,tenantId); + Map map1 =new HashMap<>(); + Map map2 =new HashMap<>(); + map1.put("name","微信"); + map1.put("id","微信"); + map2.put("name","支付宝"); + map2.put("id","支付宝"); + list.add(map1); + list.add(map2); } return AjaxResult.success(list); } @Override - public List> getSumSourceList(String startTime, String endTime, String sourceIds, Long userId, Integer type,String chargingStationIds) { + public List> getSumSourceList(HttpServletRequest request,String startTime, String endTime, String sourceIds, Long userId, Integer type,String chargingStationIds) { List sourceList =new ArrayList<>(); if(!"".equals(sourceIds) && sourceIds !=null){ sourceList= Arrays.asList(sourceIds.split(",")); @@ -433,7 +421,11 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati if(!"".equals(chargingStationIds) && chargingStationIds !=null){ chargingStationIdList= Arrays.asList(chargingStationIds.split(",")); } - return xhpcStatisticsServiceMapper.getSumSourceList(startTime, endTime, sourceList, userId, type,chargingStationIdList); + LoginUser loginUser = tokenService.getLoginUser(request); + SysUser sysUser = loginUser.getSysUser(); + String tenantId = loginUser.getTenantId(); + Long sysUserId = sysUser.getUserId(); + return xhpcStatisticsServiceMapper.getSumSourceList(startTime, endTime, sourceList, sysUserId, type,chargingStationIdList,tenantId); } @Override @@ -507,8 +499,8 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati @Override - public void timeIntervalExport(HttpServletResponse response, String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException { - List> list = getTimeIntervalPage(chargingStationIds, internetUserId, operatorId, startTime, endTime, userId, type); + public void timeIntervalExport(HttpServletRequest request,HttpServletResponse response, String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException { + List> list = getTimeIntervalPage(request,chargingStationIds, internetUserId, operatorId, startTime, endTime, userId, type); // 通过工具类创建writer,默认创建xls格式 ExcelWriter writer = ExcelUtil.getWriter(true); @@ -546,8 +538,8 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati @Override - public void dateIntervalExport(HttpServletResponse response, String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException { - List> list = getDateIntervalPage(chargingStationIds, internetUserId, operatorId, startTime, endTime, userId, type); + public void dateIntervalExport(HttpServletRequest request,HttpServletResponse response, String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException { + List> list = getDateIntervalPage(request,chargingStationIds, internetUserId, operatorId, startTime, endTime, userId, type); // 通过工具类创建writer,默认创建xls格式 ExcelWriter writer = ExcelUtil.getWriter(true); @@ -588,8 +580,8 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati } @Override - public void stationIntervalExport(HttpServletResponse response, String chargingStationIds,String operatorIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException { - List> list = getStationIntervalPage(chargingStationIds, operatorIds, internetUserId, operatorId, startTime, endTime, userId, type); + public void stationIntervalExport(HttpServletRequest request,HttpServletResponse response, String chargingStationIds,String operatorIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException { + List> list = getStationIntervalPage(request,chargingStationIds, operatorIds, internetUserId, operatorId, startTime, endTime, userId, type); // 通过工具类创建writer,默认创建xls格式 ExcelWriter writer = ExcelUtil.getWriter(true); @@ -632,8 +624,8 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati } @Override - public void operatorIntervalExport(HttpServletResponse response, String operatorIds,Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException { - List> list = getOperatorIntervalPage(operatorIds, operatorId, startTime, endTime, userId, type); + public void operatorIntervalExport(HttpServletRequest request,HttpServletResponse response, String operatorIds,Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException { + List> list = getOperatorIntervalPage(request,operatorIds, operatorId, startTime, endTime, userId, type); // 通过工具类创建writer,默认创建xls格式 ExcelWriter writer = ExcelUtil.getWriter(true); @@ -676,9 +668,9 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati @Override - public void getSumSourceListExport(HttpServletResponse response, String startTime, String endTime, String sourceIds,Long userId,Integer type, String chargingStationIds) throws IOException { + public void getSumSourceListExport(HttpServletRequest request,HttpServletResponse response, String startTime, String endTime, String sourceIds,Long userId,Integer type, String chargingStationIds) throws IOException { - List> list = getSumSourceList(startTime, endTime, sourceIds, userId, type,chargingStationIds); + List> list = getSumSourceList(request,startTime, endTime, sourceIds, userId, type,chargingStationIds); // 通过工具类创建writer,默认创建xls格式 ExcelWriter writer = ExcelUtil.getWriter(true); @@ -721,8 +713,8 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati @Override - public void terminalIntervalExport(HttpServletResponse response, String chargingStationId, String terminalId, Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException { - List> list = getTerminalIntervalPage(chargingStationId, terminalId, operatorId, startTime, endTime, userId, type); + public void terminalIntervalExport(HttpServletRequest request,HttpServletResponse response, String chargingStationId, String terminalId, Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException { + List> list = getTerminalIntervalPage(request,chargingStationId, terminalId, operatorId, startTime, endTime, userId, type); // 通过工具类创建writer,默认创建xls格式 ExcelWriter writer = ExcelUtil.getWriter(true); diff --git a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcStatisticsMapper.xml b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcStatisticsMapper.xml index e81c2180..e6bd2a26 100644 --- a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcStatisticsMapper.xml +++ b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcStatisticsMapper.xml @@ -101,6 +101,9 @@ and charging_station_id in (select charging_station_id from xhpc_user_privilege where user_id=#{userId}) + + and tenant_id = #{tenantId} + group by status order by status @@ -145,6 +148,9 @@ and charging_station_id in (select charging_station_id from xhpc_user_privilege where user_id=#{userId}) + + and tenant_id = #{tenantId} + group by DATE_FORMAT(create_time,'%Y-%m-%d') order by DATE_FORMAT(create_time,'%Y-%m-%d') desc @@ -199,6 +205,9 @@ #{operatorId} + + and ss.tenant_id = #{tenantId} + group by ss.charging_station_id @@ -244,6 +253,9 @@ and ss.charging_station_id in (select charging_station_id from xhpc_user_privilege where user_id=#{userId}) + + and ss.tenant_id = #{tenantId} + group by ss.operator_id @@ -286,6 +298,9 @@ and ss.internet_user_id =#{internetUserId} + + and ss.tenant_id = #{tenantId} + group by ss.internet_user_id @@ -333,6 +348,9 @@ and ss.charging_station_id in (select charging_station_id from xhpc_user_privilege where user_id=#{userId}) + + and ss.tenant_id = #{tenantId} + group by ss.terminal_id @@ -348,6 +366,9 @@ and charging_station_id in (select charging_station_id from xhpc_user_privilege where user_id=#{userId}) + + and tenant_id = #{tenantId} + @@ -357,13 +378,15 @@ name as operatorName from xhpc_operator where 1=1 - and operator_id in (select operator_id from xhpc_charging_station where operator_id=#{userId}) and operator_id in (select operator_id from xhpc_charging_station where charging_station_id in (select charging_station_id from xhpc_user_privilege where user_id=#{userId})) + + and tenant_id = #{tenantId} + @@ -766,6 +794,9 @@ and internet_user_id=#{userId} + + and tenant_id = #{tenantId} + diff --git a/xhpc-modules/xhpc-payment/pom.xml b/xhpc-modules/xhpc-payment/pom.xml index bb3ef119..3c43cfbf 100644 --- a/xhpc-modules/xhpc-payment/pom.xml +++ b/xhpc-modules/xhpc-payment/pom.xml @@ -81,6 +81,10 @@ 3.0.0 compile + + com.ruoyi + ruoyi-common-log + 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 855dab4a..9c18eb43 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 @@ -35,6 +35,8 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.env.Environment; import org.springframework.web.bind.annotation.*; +import com.xhpc.common.log.annotation.Log; +import com.xhpc.common.log.enums.BusinessType; import javax.servlet.http.HttpServletRequest; import java.math.BigDecimal; @@ -68,6 +70,7 @@ public class AlipayPaymentController { private static final Logger logger = LoggerFactory.getLogger(AlipayPaymentController.class); + @Log(title = "支付宝-支付", businessType = BusinessType.INSERT) @NoRepeatSubmit @PostMapping("/payment") @ApiOperation(value = "支付宝支付") 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 0d418809..c1af930b 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 @@ -10,6 +10,8 @@ import com.xhpc.common.core.utils.StringUtils; import com.xhpc.common.core.utils.WXPayUtil; import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.data.down.StartChargingData; +import com.xhpc.common.log.annotation.Log; +import com.xhpc.common.log.enums.BusinessType; import com.xhpc.common.security.service.TokenService; import com.xhpc.common.util.UserTypeUtil; import com.xhpc.payment.domain.XhpcAppUser; @@ -78,6 +80,7 @@ public class WxPaymentController { private static final Logger logger = LoggerFactory.getLogger(WxPaymentController.class); + @Log(title = "微信-支付", businessType = BusinessType.INSERT) @NoRepeatSubmit @PostMapping("/payment") @ApiOperation(value = "微信支付") diff --git a/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/XhpcRefundAuditController.java b/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/XhpcRefundAuditController.java index 0a380825..90158226 100644 --- a/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/XhpcRefundAuditController.java +++ b/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/XhpcRefundAuditController.java @@ -18,6 +18,8 @@ import com.xhpc.common.core.utils.WXPayUtil; import com.xhpc.common.core.web.controller.BaseController; import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.core.web.page.TableDataInfo; +import com.xhpc.common.log.annotation.Log; +import com.xhpc.common.log.enums.BusinessType; import com.xhpc.common.security.service.TokenService; import com.xhpc.common.util.UserTypeUtil; import com.xhpc.payment.domain.XhpcAppUser; @@ -99,6 +101,7 @@ public class XhpcRefundAuditController extends BaseController { * @param xhpcRefundAudit * @return */ + @Log(title = "退款-审核", businessType = BusinessType.UPDATE) @PostMapping("/examine") @ApiOperation(value = "退款审核") @Transactional diff --git a/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/XhpcRefundOrderController.java b/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/XhpcRefundOrderController.java index 5a894afb..cdc749ac 100644 --- a/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/XhpcRefundOrderController.java +++ b/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/XhpcRefundOrderController.java @@ -8,6 +8,8 @@ import com.xhpc.common.core.utils.StringUtils; import com.xhpc.common.core.web.controller.BaseController; import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.core.web.page.TableDataInfo; +import com.xhpc.common.log.annotation.Log; +import com.xhpc.common.log.enums.BusinessType; import com.xhpc.common.security.service.TokenService; import com.xhpc.common.util.UserTypeUtil; import com.xhpc.payment.service.IXhpcCommonPayment; @@ -44,6 +46,7 @@ public class XhpcRefundOrderController extends BaseController { * * @return */ + @Log(title = "申请退款", businessType = BusinessType.INSERT) @NoRepeatSubmit @PostMapping("/checkOut") @ApiOperation(value = "申请退款") diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCommunityController.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCommunityController.java index e70eb708..9f16aa45 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCommunityController.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCommunityController.java @@ -49,6 +49,7 @@ public class XhpcCommunityController extends BaseController { /** * 删除社区组树 */ + @Log(title = "社区", businessType = BusinessType.DELETE) @PostMapping(value = "/deleteCommunity") public AjaxResult deleteCommunity(@RequestBody XhpcCommunity xhpcCommunity) { return xhpcCommunityService.deleteCommunity(xhpcCommunity); @@ -67,6 +68,7 @@ public class XhpcCommunityController extends BaseController { * * @return */ + @Log(title = "社区", businessType = BusinessType.UPDATE) @PostMapping(value = "/updateCommunity") public AjaxResult updateCommunity(@RequestBody XhpcCommunity xhpcCommunity) { return xhpcCommunityService.updateCommunity(xhpcCommunity); @@ -89,6 +91,7 @@ public class XhpcCommunityController extends BaseController { * 社区人员添加 * */ + @Log(title = "社区人员", businessType = BusinessType.INSERT) @PostMapping(value = "/addCommunityPersonnel") public AjaxResult addCommunityPersonnel(@RequestBody XhpcCommunityPersonnel xhpcCommunityPersonnel) { return xhpcCommunityService.addCommunityPersonnel(xhpcCommunityPersonnel); @@ -107,6 +110,7 @@ public class XhpcCommunityController extends BaseController { * 编辑社区人员 * */ + @Log(title = "社区人员", businessType = BusinessType.UPDATE) @PostMapping(value = "/updateCommunityPersonnel") public AjaxResult updateCommunityPersonnel(@RequestBody XhpcCommunityPersonnel xhpcCommunityPersonnel) { return xhpcCommunityService.updateCommunityPersonnel(xhpcCommunityPersonnel); @@ -115,6 +119,7 @@ public class XhpcCommunityController extends BaseController { /** * 删除社区人员 */ + @Log(title = "社区人员", businessType = BusinessType.DELETE) @PostMapping(value = "/deleteCommunityPersonnel") public AjaxResult deleteCommunityPersonnel(@RequestBody XhpcCommunityPersonnel xhpcCommunityPersonnel) { xhpcCommunityService.deleteCommunityPersonnel(xhpcCommunityPersonnel); @@ -124,6 +129,7 @@ public class XhpcCommunityController extends BaseController { /** * 改变社区人员状态 */ + @Log(title = "社区人员-状态", businessType = BusinessType.UPDATE) @PostMapping(value = "/updateCommunityPersonnelStatus") public AjaxResult updateCommunityPersonnelStatus(@RequestBody XhpcCommunityPersonnel xhpcCommunityPersonnel) { xhpcCommunityService.updateCommunityPersonnelStatus(xhpcCommunityPersonnel); @@ -133,6 +139,7 @@ public class XhpcCommunityController extends BaseController { /** * 充值 */ + @Log(title = "社区人员-充值", businessType = BusinessType.INSERT) @PostMapping(value = "/addRecharge") public AjaxResult addRecharge(@RequestBody XhpcCommunityPersonnel xhpcCommunityPersonnel) { return xhpcCommunityService.addRecharge(xhpcCommunityPersonnel); diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCustomersController.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCustomersController.java index baf20483..b36c2cb4 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCustomersController.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCustomersController.java @@ -3,6 +3,8 @@ package com.xhpc.user.controller; import com.xhpc.common.core.web.controller.BaseController; import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.core.web.page.TableDataInfo; +import com.xhpc.common.log.annotation.Log; +import com.xhpc.common.log.enums.BusinessType; import com.xhpc.user.domain.XhpcCustomers; import com.xhpc.user.domain.XhpcCustomersPersonnel; import com.xhpc.user.service.IXhpcCustomersService; @@ -39,6 +41,7 @@ public class XhpcCustomersController extends BaseController { * * @return */ + @Log(title = "大客户组", businessType = BusinessType.INSERT) @PostMapping(value = "/addCustomers") public AjaxResult addCustomers(HttpServletRequest request, @RequestBody XhpcCustomers xhpcCustomers) { return xhpcCustomersService.addCustomers(request,xhpcCustomers); @@ -47,6 +50,7 @@ public class XhpcCustomersController extends BaseController { /** * 删除大客户 */ + @Log(title = "大客户组", businessType = BusinessType.DELETE) @PostMapping(value = "/deleteCustomers") public AjaxResult deleteCustomers(@RequestBody XhpcCustomers xhpcCustomers) { return xhpcCustomersService.deleteCustomers(xhpcCustomers); @@ -65,6 +69,7 @@ public class XhpcCustomersController extends BaseController { * * @return */ + @Log(title = "大客户组", businessType = BusinessType.UPDATE) @PostMapping(value = "/updateCustomers") public AjaxResult updateCustomers(@RequestBody XhpcCustomers xhpcCustomers) { return xhpcCustomersService.updateCustomers(xhpcCustomers); @@ -83,6 +88,7 @@ public class XhpcCustomersController extends BaseController { * 大客户人员添加 * */ + @Log(title = "大客户人员", businessType = BusinessType.INSERT) @PostMapping(value = "/addCustomersPersonnel") public AjaxResult addCustomersPersonnel(@RequestBody XhpcCustomersPersonnel xhpcCustomersPersonnel) { return xhpcCustomersService.addCustomersPersonnel(xhpcCustomersPersonnel); @@ -101,6 +107,7 @@ public class XhpcCustomersController extends BaseController { * 编辑大客户人员 * */ + @Log(title = "大客户人员", businessType = BusinessType.UPDATE) @PostMapping(value = "/updateCustomersPersonnel") public AjaxResult updateCustomersPersonnel(@RequestBody XhpcCustomersPersonnel xhpcCustomersPersonnel) { return xhpcCustomersService.updateCustomersPersonnel(xhpcCustomersPersonnel); @@ -109,6 +116,7 @@ public class XhpcCustomersController extends BaseController { /** * 删除社区人员 */ + @Log(title = "大客户人员", businessType = BusinessType.DELETE) @PostMapping(value = "/deleteCustomersPersonnel") public AjaxResult deleteCustomersPersonnel(@RequestBody XhpcCustomersPersonnel xhpcCustomersPersonnel) { xhpcCustomersService.deleteCustomersPersonnel(xhpcCustomersPersonnel); @@ -118,6 +126,7 @@ public class XhpcCustomersController extends BaseController { /** * 充值 */ + @Log(title = "大客户人员-充值", businessType = BusinessType.INSERT) @PostMapping(value = "/addRecharge") public AjaxResult addRecharge(@RequestBody XhpcCustomersPersonnel xhpcCustomersPersonnel) { return xhpcCustomersService.addRecharge(xhpcCustomersPersonnel); @@ -126,6 +135,7 @@ public class XhpcCustomersController extends BaseController { /** * 改变社区人员状态 */ + @Log(title = "大客户人员-状态", businessType = BusinessType.UPDATE) @PostMapping(value = "/updateCustomersPersonnelStatus") public AjaxResult updateCustomersPersonnelStatus(@RequestBody XhpcCustomersPersonnel xhpcCustomersPersonnel) { xhpcCustomersService.updateCustomersPersonnelStatus(xhpcCustomersPersonnel); diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcInternetUserController.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcInternetUserController.java index 249a49ec..530a4432 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcInternetUserController.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcInternetUserController.java @@ -8,6 +8,8 @@ import com.xhpc.common.core.utils.StringUtils; import com.xhpc.common.core.web.controller.BaseController; import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.core.web.page.TableDataInfo; +import com.xhpc.common.log.annotation.Log; +import com.xhpc.common.log.enums.BusinessType; import com.xhpc.common.security.annotation.PreAuthorize; import com.xhpc.system.api.domain.SysUser; import com.xhpc.user.domain.XhpcInternetUser; @@ -43,6 +45,7 @@ public class XhpcInternetUserController extends BaseController { /** * 新增流量用户 */ + @Log(title = "流量用户", businessType = BusinessType.INSERT) @ApiOperation("新增流量用户") @RequiresRoles("admin") @PostMapping("/add") @@ -81,6 +84,7 @@ public class XhpcInternetUserController extends BaseController { /** * 修改流量用户 */ + @Log(title = "流量用户", businessType = BusinessType.UPDATE) @ApiOperation("修改流量用户") @RequiresRoles("admin") @PostMapping("/edit") @@ -118,6 +122,7 @@ public class XhpcInternetUserController extends BaseController { /** * 删除流量用户 */ + @Log(title = "流量用户", businessType = BusinessType.DELETE) @ApiOperation("删除流量用户") @RequiresRoles("admin") @PostMapping("/remove") @@ -154,6 +159,7 @@ public class XhpcInternetUserController extends BaseController { /** * 禁用/启用流量用户 */ + @Log(title = "流量用户-禁用启用", businessType = BusinessType.UPDATE) @ApiOperation("禁用/启用流量用户") @RequiresRoles("admin") @PostMapping("/status") diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcOperatorController.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcOperatorController.java index e3cfe8b1..5a3e9b1e 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcOperatorController.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcOperatorController.java @@ -7,6 +7,8 @@ import com.xhpc.common.core.utils.StringUtils; import com.xhpc.common.core.web.controller.BaseController; import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.core.web.page.TableDataInfo; +import com.xhpc.common.log.annotation.Log; +import com.xhpc.common.log.enums.BusinessType; import com.xhpc.common.security.annotation.PreAuthorize; import com.xhpc.system.api.domain.SysUser; import com.xhpc.user.domain.XhpcOperator; @@ -40,6 +42,7 @@ public class XhpcOperatorController extends BaseController { /** * 新增运营商 */ + @Log(title = "运营商", businessType = BusinessType.INSERT) @ApiOperation("新增运营商") @RequiresRoles("admin") @PostMapping("/add") @@ -101,6 +104,7 @@ public class XhpcOperatorController extends BaseController { /** * 修改运营商 */ + @Log(title = "运营商", businessType = BusinessType.UPDATE) @ApiOperation("修改运营商") @PreAuthorize(hasPermi = "user:operator:edit") @RequiresRoles("admin") @@ -121,6 +125,7 @@ public class XhpcOperatorController extends BaseController { /** * 删除运营商 */ + @Log(title = "运营商", businessType = BusinessType.DELETE) @ApiOperation("删除运营商") @RequiresRoles("admin") @PostMapping("/remove") @@ -157,6 +162,7 @@ public class XhpcOperatorController extends BaseController { /** * 禁用/启用运营商 */ + @Log(title = "运营商-禁用启用", businessType = BusinessType.UPDATE) @ApiOperation("禁用/启用运营商") @RequiresRoles("admin") @PostMapping("/status") diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcOperatorInternetBlacklistController.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcOperatorInternetBlacklistController.java index efc9cb8f..924051c7 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcOperatorInternetBlacklistController.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcOperatorInternetBlacklistController.java @@ -3,6 +3,8 @@ package com.xhpc.user.controller; import com.xhpc.common.core.web.controller.BaseController; import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.core.web.page.TableDataInfo; +import com.xhpc.common.log.annotation.Log; +import com.xhpc.common.log.enums.BusinessType; import com.xhpc.user.domain.XhpcOperatorInternetBlacklist; import com.xhpc.user.service.IXhpcOperatorInternetBlacklistService; import io.swagger.annotations.ApiOperation; @@ -28,6 +30,7 @@ public class XhpcOperatorInternetBlacklistController extends BaseController { /** * 新增运营商设置流量方黑名单 */ + @Log(title = "运营商-设置流量方黑名单", businessType = BusinessType.INSERT) @ApiOperation("新增运营商设置流量方黑名单") //@PreAuthorize(hasPermi = "operator:internet:add") @PostMapping("/add") diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcStationInternetBlacklistController.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcStationInternetBlacklistController.java index 6be2c863..a81417db 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcStationInternetBlacklistController.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcStationInternetBlacklistController.java @@ -3,6 +3,8 @@ package com.xhpc.user.controller; import com.xhpc.common.core.web.controller.BaseController; import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.core.web.page.TableDataInfo; +import com.xhpc.common.log.annotation.Log; +import com.xhpc.common.log.enums.BusinessType; import com.xhpc.user.domain.XhpcStationInternetBlacklist; import com.xhpc.user.service.IXhpcInternetUserService; import com.xhpc.user.service.IXhpcStationInternetBlacklistService; @@ -32,6 +34,7 @@ public class XhpcStationInternetBlacklistController extends BaseController { /** * 新增电站流量方黑名单 */ + @Log(title = "场站-设置流量方黑名单", businessType = BusinessType.INSERT) @ApiOperation("新增电站流量方黑名单") // @PreAuthorize(hasPermi = "station:internet:add") @PostMapping("/add") diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcUserController.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcUserController.java index fc97e669..9a07b170 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcUserController.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcUserController.java @@ -7,6 +7,8 @@ import com.xhpc.common.core.utils.StringUtils; import com.xhpc.common.core.web.controller.BaseController; import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.core.web.page.TableDataInfo; +import com.xhpc.common.log.annotation.Log; +import com.xhpc.common.log.enums.BusinessType; import com.xhpc.common.security.annotation.PreAuthorize; import com.xhpc.system.api.domain.SysRole; import com.xhpc.system.api.domain.SysUser; @@ -52,6 +54,7 @@ public class XhpcUserController extends BaseController { /** * 新增平台用户 */ + @Log(title = "平台用户", businessType = BusinessType.INSERT) @ApiOperation("新增平台用户") @RequiresRoles("admin") @PostMapping("/pc/add") @@ -82,6 +85,7 @@ public class XhpcUserController extends BaseController { /** * 修改平台用户 */ + @Log(title = "平台用户", businessType = BusinessType.UPDATE) @ApiOperation("修改平台用户") @RequiresRoles("admin") @PostMapping("/pc/edit") @@ -122,6 +126,7 @@ public class XhpcUserController extends BaseController { /** * 新增运营商用户 */ + @Log(title = "运营商用户", businessType = BusinessType.INSERT) @ApiOperation("新增运营商用户") @RequiresPermissions("user:operator:add") @PostMapping("/operator/add") @@ -154,6 +159,7 @@ public class XhpcUserController extends BaseController { /** * 修改运营商用户 */ + @Log(title = "运营商用户", businessType = BusinessType.UPDATE) @ApiOperation("修改运营商用户") @RequiresPermissions("user:operator:edit") @PostMapping("/operator/edit") @@ -181,6 +187,7 @@ public class XhpcUserController extends BaseController { /** * 禁用/启用平台和运营商子账号 */ + @Log(title = "平台和运营商子账号-禁用启用", businessType = BusinessType.UPDATE) @ApiOperation("禁用/启用平台和运营商子账号") //@PreAuthorize(hasPermi = "user:pc:status") @PostMapping("/status") @@ -196,6 +203,7 @@ public class XhpcUserController extends BaseController { /** * 禁用/启用平台和运营商子账号 */ + @Log(title = "平台和运营商子账号-禁用启用", businessType = BusinessType.UPDATE) @ApiOperation("禁用/启用平台和运营商子账号") //@PreAuthorize(hasPermi = "user:pc:status") @PostMapping("/remove") @@ -212,6 +220,7 @@ public class XhpcUserController extends BaseController { /** * 重置密码 */ + @Log(title = "重置密码", businessType = BusinessType.UPDATE) @PostMapping("/reset") public AjaxResult reset(@RequestParam Long userId){