增加日志和租户条件

This commit is contained in:
yuyang 2022-01-12 16:24:45 +08:00
parent 3d9040c10c
commit 830d13a927
29 changed files with 374 additions and 255 deletions

View File

@ -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;
}

View File

@ -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){

View File

@ -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){

View File

@ -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){

View File

@ -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){

View File

@ -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) {

View File

@ -19,7 +19,6 @@
<!-- 通用查询映射结果 -->
<update id="deleteAgreementItem">
update xhpc_agreement set del_flag=1 where agreement_id=#{agreementId}
</update>

View File

@ -34,7 +34,6 @@
</select>
<delete id="deleteBy">
delete from et_auth_sec_token
where id = #{id}
</delete>

View File

@ -99,6 +99,10 @@
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
</dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common-log</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.apache.poi</groupId>-->
<!-- <artifactId>poi-ooxml</artifactId>-->

View File

@ -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

View File

@ -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<String, Object> map) {

View File

@ -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<String, Object> map) {

View File

@ -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<Map<String, Object>> list = xhpcStatisticsService.getTimeIntervalPage(chargingStationIds,internetUserId,operatorId,startTime,endTime,userId,type);
List<Map<String, Object>> 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<Map<String, Object>> list = xhpcStatisticsService.getDateIntervalPage(chargingStationIds,internetUserId,operatorId,startTime,endTime,userId,type);
List<Map<String, Object>> 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<Map<String, Object>> list = xhpcStatisticsService.getStationIntervalPage(chargingStationIds,operatorIds,internetUserId,operatorId,startTime,endTime,userId,type);
List<Map<String, Object>> 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<Map<String, Object>> list = xhpcStatisticsService.getOperatorIntervalPage(operatorIds,operatorId,startTime,endTime,userId,type);
List<Map<String, Object>> 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<Map<String, Object>> list = xhpcStatisticsService.getInternetUserIntervalPage(internetUserIds,internetUserId,startTime,endTime,userId,type);
List<Map<String, Object>> 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<Map<String, Object>> list = xhpcStatisticsService.getTerminalIntervalPage(chargingStationId,terminalId,operatorId,startTime,endTime,userId,type);
List<Map<String, Object>> 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<Map<String, Object>> list = xhpcStatisticsService.getSumSourceList(startTime,endTime,internetUserIds,userId, type,chargingStationIds);
List<Map<String, Object>> 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);
}
}

View File

@ -27,7 +27,7 @@ public interface XhpcStatisticsServiceMapper {
* @param type 1 平台 2 运营商 3流量方
* @return
*/
List<Map<String, Object>> getTimeIntervalPage(@Param("chargingStationIds") List<String> 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<Map<String, Object>> getTimeIntervalPage(@Param("chargingStationIds") List<String> 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<Map<String, Object>> getDateIntervalPage(@Param("chargingStationIds") List<String> 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<Map<String, Object>> getDateIntervalPage(@Param("chargingStationIds") List<String> 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<Map<String, Object>> getStationIntervalPage(@Param("chargingStationIds") List<String> chargingStationIds,@Param("operatorUserId") List<String> 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<Map<String, Object>> getStationIntervalPage(@Param("chargingStationIds") List<String> chargingStationIds,@Param("operatorUserId") List<String> 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<Map<String, Object>> getOperatorIntervalPage(@Param("operatorUserId") List<String> operatorUserId,@Param("operatorId") Long operatorId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("type") Integer type,@Param("userId") Long userId);
List<Map<String, Object>> getOperatorIntervalPage(@Param("operatorUserId") List<String> 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<Map<String, Object>> getInternetUserIntervalPage(@Param("internetIds") List<String> internetIds,@Param("internetUserId") Long internetUserId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("type") Integer type,@Param("userId") Long userId);
List<Map<String, Object>> getInternetUserIntervalPage(@Param("internetIds") List<String> 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<Map<String, Object>> 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<Map<String, Object>> 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<Map<String, Object>> getChargingStationList(@Param("operatorId")Long operatorId,@Param("userId")Long userId,@Param("type")Integer type);
List<Map<String, Object>> 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<Map<String, Object>> getOperatorList(@Param("operatorId")Long operatorId,@Param("userId")Long userId,@Param("type")Integer type);
List<Map<String, Object>> 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<Map<String, Object>> getInternetUserIList(@Param("internetUserId")Long internetUserId,@Param("userId")Long userId,@Param("type")Integer type);
List<Map<String, Object>> 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<Map<String, Object>> getTerminalList(@Param("chargingStationId")Long chargingStationId,@Param("userId")Long userId,@Param("type")Integer type);
List<Map<String, Object>> 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<Map<String,String>> getInternetList(@Param("userId")Long userId);
List<Map<String,String>> getInternetList(@Param("userId")Long userId,@Param("tenantId")String tenantId);
/**
@ -153,7 +153,7 @@ public interface XhpcStatisticsServiceMapper {
* @param type 1 平台 2 运营商 3流量方
* @return
*/
List<Map<String,Object>> getSumSourceList(@Param("startTime")String startTime, @Param("endTime")String endTime,@Param("sourceIds")List<String> sourceIds, @Param("userId")Long userId, @Param("type")Integer type,@Param("chargingStationIdList")List<String> chargingStationIdList);
List<Map<String,Object>> getSumSourceList(@Param("startTime")String startTime, @Param("endTime")String endTime,@Param("sourceIds")List<String> sourceIds, @Param("userId")Long userId, @Param("type")Integer type,@Param("chargingStationIdList")List<String> chargingStationIdList,@Param("tenantId")String tenantId);
/**
* 获取登陆用户信息

View File

@ -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<Map<String, Object>> getTimeIntervalPage(String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type);
List<Map<String, Object>> 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<Map<String, Object>> getDateIntervalPage(String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type);
List<Map<String, Object>> 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<Map<String, Object>> getStationIntervalPage(String chargingStationIds,String operatorIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type);
List<Map<String, Object>> 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<Map<String, Object>> getOperatorIntervalPage(String operatorIds,Long operatorId, String startTime, String endTime, Long userId, Integer type);
List<Map<String, Object>> 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<Map<String, Object>> getInternetUserIntervalPage(String internetUserIds, Long internetUserId, String startTime, String endTime, Long userId, Integer type);
List<Map<String, Object>> 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<Map<String, Object>> getTerminalIntervalPage(String chargingStationId, String terminalId, Long operatorId, String startTime, String endTime, Long userId, Integer type);
List<Map<String, Object>> 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<Map<String, Object>> getSumSourceList(String startTime, String endTime, String sourceIds,Long userId,Integer type, String chargingStationIds);
List<Map<String, Object>> 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;
}

View File

@ -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<Map<String, Object>> getTimeIntervalPage(String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) {
public List<Map<String, Object>> 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<Map<String, Object>> list =new ArrayList<>();
if(logUserId !=1){
Map<String, Object> landUser = xhpcHistoryOrderService.getLandUser(logUserId);
if(landUser !=null){
SysUser sysUser = loginUser.getSysUser();
String tenantId = loginUser.getTenantId();
Long sysUserId = sysUser.getUserId();
if(!UserTypeUtil.SYS_USER_TYPE_ADMIN.equals(sysUser.getUserId())){
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());
if(UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())){
Long logOperatorId = sysUser.getOperatorId();
//运营商看自己的场站
list = xhpcStatisticsServiceMapper.getTimeIntervalPage(chargingStationId, internetUserId, operatorId, startTime, endTime, 1,logOperatorId);
list = xhpcStatisticsServiceMapper.getTimeIntervalPage(chargingStationId, internetUserId, operatorId, startTime, endTime, 1,logOperatorId,tenantId);
}else{
//查询赋值的场站
list = xhpcStatisticsServiceMapper.getTimeIntervalPage(chargingStationId, internetUserId, operatorId, startTime, endTime, 2,logUserId);
}
}
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<Map<String, Object>> 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<Map<String, Object>> getDateIntervalPage(String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) {
public List<Map<String, Object>> 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<Map<String, Object>> list =new ArrayList<>();
if(logUserId !=1){
Map<String, Object> landUser = xhpcHistoryOrderService.getLandUser(logUserId);
if(landUser !=null){
if(!UserTypeUtil.SYS_USER_TYPE_ADMIN.equals(sysUser.getUserId())){
startPage();
if(landUser.get("userType") !=null){
if("01".equals(landUser.get("userType").toString())){
Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString());
if(UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())){
Long logOperatorId = sysUser.getOperatorId();
//运营商看自己的场站
list = xhpcStatisticsServiceMapper.getDateIntervalPage(chargingStationId, internetUserId, operatorId, startTime, endTime, 1,logOperatorId);
list = xhpcStatisticsServiceMapper.getDateIntervalPage(chargingStationId, internetUserId, operatorId, startTime, endTime, 1,logOperatorId,tenantId);
}else{
//查询赋值的场站
list = xhpcStatisticsServiceMapper.getDateIntervalPage(chargingStationId, internetUserId, operatorId, startTime, endTime, 2,logUserId);
}
}
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<Map<String, Object>> getStationIntervalPage(String chargingStationIds, String operatorIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) {
public List<Map<String, Object>> 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<Map<String, Object>> list =new ArrayList<>();
if(logUserId !=1){
Map<String, Object> landUser = xhpcHistoryOrderService.getLandUser(logUserId);
if(landUser !=null){
if(!UserTypeUtil.SYS_USER_TYPE_ADMIN.equals(sysUser.getUserId())){
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());
if(UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())){
Long logOperatorId = sysUser.getOperatorId();
//运营商看自己的场站
list = xhpcStatisticsServiceMapper.getStationIntervalPage(chargingStationId,operatorUserId,internetUserId,operatorId,startTime,endTime,1,logOperatorId);
list = xhpcStatisticsServiceMapper.getStationIntervalPage(chargingStationId,operatorUserId,internetUserId,operatorId,startTime,endTime,1,logOperatorId,tenantId);
}else{
//查询赋值的场站
list = xhpcStatisticsServiceMapper.getStationIntervalPage(chargingStationId,operatorUserId,internetUserId,operatorId,startTime,endTime,2,logUserId);
}
}
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<Map<String, Object>> getOperatorIntervalPage(String operatorIds, Long operatorId, String startTime, String endTime, Long userId, Integer type) {
public List<Map<String, Object>> 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<Map<String, Object>> list =new ArrayList<>();
if(logUserId !=1){
Map<String, Object> landUser = xhpcHistoryOrderService.getLandUser(logUserId);
if(landUser !=null){
if(!UserTypeUtil.SYS_USER_TYPE_ADMIN.equals(sysUser.getUserId())){
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());
if(UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())){
Long logOperatorId = sysUser.getOperatorId();
//运营商看自己的场站
list = xhpcStatisticsServiceMapper.getOperatorIntervalPage(operatorUserId, operatorId, startTime, endTime, 1,logOperatorId);
list = xhpcStatisticsServiceMapper.getOperatorIntervalPage(operatorUserId, operatorId, startTime, endTime, 1,logOperatorId,tenantId);
}else{
//查询赋值的场站
list = xhpcStatisticsServiceMapper.getOperatorIntervalPage(operatorUserId, operatorId, startTime, endTime, 2,logUserId);
}
}
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<Map<String, Object>> getInternetUserIntervalPage(String internetUserIds, Long internetUserId, String startTime, String endTime, Long userId, Integer type) {
public List<Map<String, Object>> 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<Map<String, Object>> getTerminalIntervalPage(String chargingStationId, String terminalId, Long operatorId, String startTime, String endTime, Long userId, Integer type) {
public List<Map<String, Object>> 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<Map<String, Object>> list =new ArrayList<>();
if(logUserId !=1){
Map<String, Object> landUser = xhpcHistoryOrderService.getLandUser(logUserId);
if(landUser !=null){
SysUser sysUser = loginUser.getSysUser();
String tenantId = loginUser.getTenantId();
Long sysUserId = sysUser.getUserId();
if(!UserTypeUtil.SYS_USER_TYPE_ADMIN.equals(sysUser.getUserId())){
startPage();
if(landUser.get("userType") !=null){
if("01".equals(landUser.get("userType").toString())){
Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString());
if(UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())){
Long logOperatorId = sysUser.getOperatorId();
//运营商看自己的场站
list = xhpcStatisticsServiceMapper.getTerminalIntervalPage(chargingStationId, terminalId, operatorId, startTime, endTime, 1,logOperatorId);
list = xhpcStatisticsServiceMapper.getTerminalIntervalPage(chargingStationId, terminalId, operatorId, startTime, endTime, 1,logOperatorId,tenantId);
}else{
//查询赋值的场站
list = xhpcStatisticsServiceMapper.getTerminalIntervalPage(chargingStationId, terminalId, operatorId, startTime, endTime, 2,logUserId);
}
}
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,99 +315,90 @@ 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<String, Object> 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());
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));
return AjaxResult.success(xhpcStatisticsServiceMapper.getChargingStationList(operatorId, logOperatorId, 1,tenantId));
}else{
//查询赋值的场站
return AjaxResult.success(xhpcStatisticsServiceMapper.getChargingStationList(operatorId, logUserId, 2));
}
}
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<String, Object> 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());
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));
return AjaxResult.success(xhpcStatisticsServiceMapper.getOperatorList(operatorId, logOperatorId, 1,tenantId));
}else{
//查询赋值的场站
return AjaxResult.success(xhpcStatisticsServiceMapper.getOperatorList(operatorId, logUserId, 2));
}
}
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) {
public AjaxResult getTerminalList(HttpServletRequest request,Long chargingStationId, Long userId, Integer type) {
//获取登陆用户
Long logUserId = SecurityUtils.getUserId();
if(logUserId !=1){
Map<String, Object> 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());
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));
return AjaxResult.success(xhpcStatisticsServiceMapper.getTerminalList(chargingStationId, logOperatorId, 1,tenantId));
}else{
//查询赋值的场站
return AjaxResult.success(xhpcStatisticsServiceMapper.getTerminalList(chargingStationId, logUserId, 2));
}
}
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<Map<String, String>> list = new ArrayList<>();
Map<String, Object> landUser = xhpcStatisticsServiceMapper.getLandUser(logUserId);
if (landUser != null) {
if (landUser.get("userType") != null && "02".equals(landUser.get("userType").toString())) {
list = xhpcStatisticsServiceMapper.getInternetList(logUserId);
if (UserTypeUtil.SYS_USER_TYPE_TWO.equals(sysUser.getUserType())) {
list = xhpcStatisticsServiceMapper.getInternetList(sysUserId,tenantId);
}else{
list = xhpcStatisticsServiceMapper.getInternetList(null);
list = xhpcStatisticsServiceMapper.getInternetList(null,tenantId);
Map<String, String> map1 =new HashMap<>();
Map<String, String> map2 =new HashMap<>();
map1.put("name","微信");
@ -419,12 +408,11 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati
list.add(map1);
list.add(map2);
}
}
return AjaxResult.success(list);
}
@Override
public List<Map<String, Object>> getSumSourceList(String startTime, String endTime, String sourceIds, Long userId, Integer type,String chargingStationIds) {
public List<Map<String, Object>> getSumSourceList(HttpServletRequest request,String startTime, String endTime, String sourceIds, Long userId, Integer type,String chargingStationIds) {
List<String> 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<Map<String, Object>> 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<Map<String, Object>> 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<Map<String, Object>> 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<Map<String, Object>> 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<Map<String, Object>> 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<Map<String, Object>> 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<Map<String, Object>> 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<Map<String, Object>> 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<Map<String, Object>> list = getSumSourceList(startTime, endTime, sourceIds, userId, type,chargingStationIds);
List<Map<String, Object>> 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<Map<String, Object>> 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<Map<String, Object>> list = getTerminalIntervalPage(request,chargingStationId, terminalId, operatorId, startTime, endTime, userId, type);
// 通过工具类创建writer默认创建xls格式
ExcelWriter writer = ExcelUtil.getWriter(true);

View File

@ -101,6 +101,9 @@
<if test="type==2">
and charging_station_id in (select charging_station_id from xhpc_user_privilege where user_id=#{userId})
</if>
<if test="tenantId !=null and tenantId !=''">
and tenant_id = #{tenantId}
</if>
group by status
order by status
</select>
@ -145,6 +148,9 @@
<if test="type==2">
and charging_station_id in (select charging_station_id from xhpc_user_privilege where user_id=#{userId})
</if>
<if test="tenantId !=null and tenantId !=''">
and tenant_id = #{tenantId}
</if>
group by DATE_FORMAT(create_time,'%Y-%m-%d')
order by DATE_FORMAT(create_time,'%Y-%m-%d') desc
</select>
@ -199,6 +205,9 @@
#{operatorId}
</foreach>
</if>
<if test="tenantId !=null and tenantId !=''">
and ss.tenant_id = #{tenantId}
</if>
group by ss.charging_station_id
</select>
@ -244,6 +253,9 @@
<if test="type==2">
and ss.charging_station_id in (select charging_station_id from xhpc_user_privilege where user_id=#{userId})
</if>
<if test="tenantId !=null and tenantId !=''">
and ss.tenant_id = #{tenantId}
</if>
group by ss.operator_id
</select>
@ -286,6 +298,9 @@
<if test="type==3">
and ss.internet_user_id =#{internetUserId}
</if>
<if test="tenantId !=null and tenantId !=''">
and ss.tenant_id = #{tenantId}
</if>
group by ss.internet_user_id
</select>
@ -333,6 +348,9 @@
<if test="type==2">
and ss.charging_station_id in (select charging_station_id from xhpc_user_privilege where user_id=#{userId})
</if>
<if test="tenantId !=null and tenantId !=''">
and ss.tenant_id = #{tenantId}
</if>
group by ss.terminal_id
</select>
@ -348,6 +366,9 @@
<if test="type==2">
and charging_station_id in (select charging_station_id from xhpc_user_privilege where user_id=#{userId})
</if>
<if test="tenantId !=null and tenantId !=''">
and tenant_id = #{tenantId}
</if>
</select>
@ -357,13 +378,15 @@
name as operatorName
from xhpc_operator
where 1=1
<if test="type==1">
and operator_id in (select operator_id from xhpc_charging_station where operator_id=#{userId})
</if>
<if test="type==2">
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}))
</if>
<if test="tenantId !=null and tenantId !=''">
and tenant_id = #{tenantId}
</if>
</select>
<select id="getInternetUserIList" resultType="map">
@ -375,6 +398,9 @@
<if test="type==2">
and internet_user_id =#{internetUserId}
</if>
<if test="tenantId !=null and tenantId !=''">
and tenant_id = #{tenantId}
</if>
</select>
<select id="getTerminalList" resultType="map">
@ -389,7 +415,9 @@
<if test="type==2">
and charging_station_id in (select charging_station_id from xhpc_user_privilege where user_id=#{userId})
</if>
<if test="tenantId !=null and tenantId !=''">
and tenant_id = #{tenantId}
</if>
</select>
<insert id="addStatisticsTime">
@ -766,6 +794,9 @@
<if test="userId !=null">
and internet_user_id=#{userId}
</if>
<if test="tenantId !=null and tenantId !=''">
and tenant_id = #{tenantId}
</if>
</select>
<select id="getLandUser" resultType="map">
@ -814,6 +845,9 @@
#{chargingStationId}
</foreach>
</if>
<if test="tenantId !=null and tenantId !=''">
and ss.tenant_id = #{tenantId}
</if>
group by ss.charging_mode
</select>
</mapper>

View File

@ -81,6 +81,10 @@
<version>3.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common-log</artifactId>
</dependency>
</dependencies>
<build>

View File

@ -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 = "支付宝支付")

View File

@ -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 = "微信支付")

View File

@ -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

View File

@ -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 = "申请退款")

View File

@ -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);

View File

@ -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);

View File

@ -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")

View File

@ -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")

View File

@ -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")

View File

@ -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")

View File

@ -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){