增加校时校价,增加租户、运营商搜索
This commit is contained in:
parent
ff1e8baad5
commit
d175cc15fe
@ -469,10 +469,11 @@ public class XhpcDataBigScreenServiceImpl implements XhpcDataBigScreenService {
|
||||
|
||||
private R<Map<String, Object>> getMapR(List<Long> chargingStationIdList,List<String> tenantIdList, Map<String, Object> map) {
|
||||
List<String> terminal = xhpcChargingStationMapper.getTerminal(chargingStationIdList, tenantIdList);
|
||||
|
||||
int total =terminal.size();//离线
|
||||
int offLine =0;//离线
|
||||
int fault =0;//故障
|
||||
int freeTime =0;//空闲
|
||||
int insertGun =0;//插枪
|
||||
int charge =0;//充电
|
||||
int unknown =0;//未知
|
||||
if(terminal !=null && terminal.size()>0){
|
||||
@ -485,9 +486,12 @@ public class XhpcDataBigScreenServiceImpl implements XhpcDataBigScreenService {
|
||||
}else if(cacheMap.containsKey("status") &&
|
||||
"故障".equals(cacheMap.get("status").toString())){
|
||||
fault++;
|
||||
}else if(cacheMap.containsKey("status") &&
|
||||
"空闲".equals(cacheMap.get("status").toString())){
|
||||
}else if("空闲".equals(cacheMap.get("status").toString())){
|
||||
if("是".equals(cacheMap.get("vehicleGunStatus").toString())){
|
||||
insertGun++;
|
||||
}else{
|
||||
freeTime++;
|
||||
}
|
||||
}else{
|
||||
charge++;
|
||||
}
|
||||
@ -501,6 +505,8 @@ public class XhpcDataBigScreenServiceImpl implements XhpcDataBigScreenService {
|
||||
map.put("freeTime",freeTime);
|
||||
map.put("charge",charge);
|
||||
map.put("unknown",unknown);
|
||||
map.put("total",total);
|
||||
map.put("insertGun",insertGun);
|
||||
return R.ok(map);
|
||||
}
|
||||
|
||||
|
||||
@ -491,9 +491,11 @@
|
||||
|
||||
<select id="getWorkOrderTerminal" resultType="map">
|
||||
select
|
||||
*
|
||||
title,
|
||||
create_time as createTime,
|
||||
status
|
||||
from xhpc_work_order
|
||||
where status=1
|
||||
where 1=1
|
||||
<if test="tenantIds !=null and tenantIds.size()>0">
|
||||
and tenant_id in
|
||||
<foreach collection="tenantIds" open="(" item="tenantId" separator="," close=")" >
|
||||
@ -501,12 +503,13 @@
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="chargingStationIds !=null and chargingStationIds.size()>0">
|
||||
and serial_number in (select serial_number from xhpc_terminal where charging_station_id in
|
||||
and find_in_set((select serial_number from xhpc_terminal where charging_station_id in
|
||||
<foreach collection="tenantIds" open="(" item="tenantId" separator="," close=")" >
|
||||
#{tenantId}
|
||||
</foreach>
|
||||
)charging_station_id in
|
||||
),serial_number)
|
||||
</if>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@ -1,6 +1,8 @@
|
||||
package com.xhpc.charging.station.controller;
|
||||
|
||||
import com.xhpc.charging.station.service.IXhpcChargingPileService;
|
||||
import com.xhpc.common.api.PowerPileService;
|
||||
import com.xhpc.common.core.domain.R;
|
||||
import com.xhpc.common.core.utils.SecurityUtils;
|
||||
import com.xhpc.common.core.utils.poi.ExcelUtil;
|
||||
import com.xhpc.common.core.web.controller.BaseController;
|
||||
@ -9,10 +11,12 @@ import com.xhpc.common.core.web.page.TableDataInfo;
|
||||
import com.xhpc.common.domain.XhpcChargingPile;
|
||||
import com.xhpc.common.log.annotation.Log;
|
||||
import com.xhpc.common.log.enums.BusinessType;
|
||||
import com.xhpc.common.redis.service.RedisService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -27,6 +31,10 @@ public class XhpcChargingPileController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IXhpcChargingPileService xhpcChargingPileService;
|
||||
@Autowired
|
||||
private PowerPileService powerPileService;
|
||||
@Autowired
|
||||
RedisService redisService;
|
||||
|
||||
/**
|
||||
* 桩列表
|
||||
@ -37,8 +45,8 @@ public class XhpcChargingPileController extends BaseController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(HttpServletRequest request,String name, Integer type, String serialNumber, Long chargingStationId) {
|
||||
List<Map<String, Object>> list = xhpcChargingPileService.selectXhpcChargingPileList(request,name, type, serialNumber, chargingStationId);
|
||||
public TableDataInfo list(HttpServletRequest request,String tenantId,Long operatorId,String name, Integer type, String serialNumber, Long chargingStationId) {
|
||||
List<Map<String, Object>> list = xhpcChargingPileService.selectXhpcChargingPileList(request,tenantId,operatorId,name, type, serialNumber, chargingStationId);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ -142,4 +150,31 @@ public class XhpcChargingPileController extends BaseController {
|
||||
return xhpcChargingPileService.generateQrCode(chargingStationId, pileId);
|
||||
}
|
||||
|
||||
|
||||
//下发校时校价
|
||||
@GetMapping("/configRmReply")
|
||||
public AjaxResult configRmReply(String serialNumber) {
|
||||
|
||||
if(serialNumber==null || "".equals(serialNumber)){
|
||||
return AjaxResult.error("桩号为空");
|
||||
}
|
||||
R r = powerPileService.configTimeNRateModel(serialNumber);
|
||||
if(r.getCode() !=200){
|
||||
return AjaxResult.error("下发校时校价失败,请重新下发");
|
||||
}
|
||||
return AjaxResult.success("下发校时校价成功");
|
||||
}
|
||||
|
||||
@GetMapping("/configRmReplyMessage")
|
||||
public AjaxResult configRmReplyMessage(String serialNumber) {
|
||||
if(serialNumber==null || "".equals(serialNumber)){
|
||||
return AjaxResult.error("桩号为空");
|
||||
}
|
||||
String configRateReply = redisService.getCacheObject("pile:" + serialNumber + ".configRateReply");
|
||||
if(configRateReply==null || "".equals(configRateReply)){
|
||||
return AjaxResult.success("未下发");
|
||||
}
|
||||
return AjaxResult.success(configRateReply);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -70,8 +70,8 @@ public class XhpcChargingStationController extends BaseController {
|
||||
*/
|
||||
//@PreAuthorize(hasPermi = "system:station:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(HttpServletRequest request,String name, String operatorName) {
|
||||
List<Map<String, Object>> list = xhpcChargingStationService.selectXhpcChargingStationList(request,name, operatorName);
|
||||
public TableDataInfo list(HttpServletRequest request,String tenantId,Long operatorId,Long chargingStationId,String name, String operatorName) {
|
||||
List<Map<String, Object>> list = xhpcChargingStationService.selectXhpcChargingStationList(request,tenantId,operatorId,chargingStationId,name, operatorName);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
@ -26,8 +26,8 @@ public class XhpcDownCodeController extends BaseController {
|
||||
private Environment environment;
|
||||
|
||||
@GetMapping(value = "/listStations")
|
||||
public TableDataInfo listStations(String stationName){
|
||||
return getDataTable(iXhpcDownCodeService.listStations(stationName));
|
||||
public TableDataInfo listStations(String tenantId,Long operatorId,Long chargingStationId,String stationName){
|
||||
return getDataTable(iXhpcDownCodeService.listStations(tenantId,operatorId,chargingStationId,stationName));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/listPiles")
|
||||
|
||||
@ -36,9 +36,9 @@ public class XhpcTimingChargingModelController extends BaseController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(HttpServletRequest request, String reason, Integer status, String startTime, String endTime, Long chargingStationId) {
|
||||
|
||||
List<Map<String, Object>> list = xhpcTimingChargingModelService.list(request,reason, status, startTime,endTime, chargingStationId);
|
||||
public TableDataInfo list(HttpServletRequest request,String tenantId,Long operatorId, String reason, Integer status, String startTime, String endTime, Long chargingStationId) {
|
||||
startPage();
|
||||
List<Map<String, Object>> list = xhpcTimingChargingModelService.list(request,tenantId,operatorId,reason, status, startTime,endTime, chargingStationId);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@ public interface XhpcChargingPileMapper {
|
||||
* @param name 桩名称
|
||||
* @return
|
||||
*/
|
||||
List<Map<String, Object>> selectXhpcChargingPileList(@Param("name") String name, @Param("type") Integer type, @Param("serialNumber") String serialNumber, @Param("chargingStationId") Long chargingStationId,@Param("operatorId")Long operatorId,@Param("number")Integer number,@Param("tenantId") String tenantId);
|
||||
List<Map<String, Object>> selectXhpcChargingPileList(@Param("operatorId")Long operatorId,@Param("name") String name, @Param("type") Integer type, @Param("serialNumber") String serialNumber, @Param("chargingStationId") Long chargingStationId,@Param("logOperatorId")Long logOperatorId,@Param("number")Integer number,@Param("tenantId") String tenantId);
|
||||
|
||||
|
||||
int getCountXhpcChargingPile(@Param("chargingStationId") Long chargingStationId,@Param("tenantId") String tenantId);
|
||||
|
||||
@ -43,7 +43,7 @@ public interface XhpcChargingStationMapper {
|
||||
* @param operatorName 运营商名称
|
||||
* @return 电站集合
|
||||
*/
|
||||
List<Map<String, Object>> selectXhpcChargingStationList(@Param("name") String name, @Param("operatorName") String operatorName,@Param("operatorId")Long operatorId,@Param("type")Integer type,@Param("tenantId")String tenantId);
|
||||
List<Map<String, Object>> selectXhpcChargingStationList(@Param("operatorId")Long operatorId,@Param("chargingStationId")Long chargingStationId,@Param("name") String name, @Param("operatorName") String operatorName,@Param("logOperatorId")Long logOperatorId,@Param("type")Integer type,@Param("tenantId")String tenantId);
|
||||
|
||||
/**
|
||||
* 新增电站
|
||||
|
||||
@ -14,7 +14,7 @@ import java.util.Map;
|
||||
@Mapper
|
||||
public interface XhpcDownCodeMapper {
|
||||
|
||||
List<Map<String, Object>> selectStationsBy(@Param(value = "stationName") String stationName,@Param("type") Integer type,@Param("userId") Long userId,@Param("tenantId") String tenantId);
|
||||
List<Map<String, Object>> selectStationsBy(@Param(value = "operatorId")Long operatorId,@Param(value = "chargingStationId")Long chargingStationId,@Param(value = "stationName") String stationName,@Param("type") Integer type,@Param("userId") Long userId,@Param("tenantId") String tenantId);
|
||||
|
||||
List<Map<String, Object>> selectPilesBy(@Param(value = "stationId") Long stationId);
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@ import java.util.Map;
|
||||
*/
|
||||
public interface XhpcTimingChargingModelMapper {
|
||||
|
||||
List<Map<String, Object>> list(@Param("reason")String reason,@Param("status") Integer status,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("chargingStationId") Long chargingStationId,@Param("tenantId")String tenantId);
|
||||
List<Map<String, Object>> list(@Param("operatorId")Long operatorId,@Param("reason")String reason,@Param("status") Integer status,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("chargingStationId") Long chargingStationId,@Param("logOperatorId")Long logOperatorId,@Param("type")Integer type,@Param("tenantId")String tenantId);
|
||||
|
||||
int insertXhpcTimingChargingModel(XhpcTimingChargingModel xhpcTimingChargingModel);
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@ public interface IXhpcChargingPileService {
|
||||
* @param name 桩名称
|
||||
* @return
|
||||
*/
|
||||
List<Map<String, Object>> selectXhpcChargingPileList(HttpServletRequest request,String name, Integer type, String serialNumber, Long chargingStationId);
|
||||
List<Map<String, Object>> selectXhpcChargingPileList(HttpServletRequest request,String tenantId,Long operatorId,String name, Integer type, String serialNumber, Long chargingStationId);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -54,7 +54,7 @@ public interface IXhpcChargingStationService {
|
||||
* @param operatorName 运营商名称
|
||||
* @return 电站集合
|
||||
*/
|
||||
List<Map<String, Object>> selectXhpcChargingStationList(HttpServletRequest request, String name, String operatorName);
|
||||
List<Map<String, Object>> selectXhpcChargingStationList(HttpServletRequest request,String tenantId,Long operatorId,Long chargingStationId, String name, String operatorName);
|
||||
|
||||
/**
|
||||
* 新增电站
|
||||
|
||||
@ -10,7 +10,7 @@ import java.util.Map;
|
||||
*/
|
||||
public interface IXhpcDownCodeService {
|
||||
|
||||
List<Map<String, Object>> listStations(String stationName);
|
||||
List<Map<String, Object>> listStations(String tenantId,Long operatorId,Long chargingStationId,String stationName);
|
||||
|
||||
List<Map<String, Object>> listPiles(Long stationId);
|
||||
|
||||
|
||||
@ -15,7 +15,7 @@ import java.util.Map;
|
||||
*/
|
||||
public interface IXhpcTimingChargingModelService {
|
||||
|
||||
List<Map<String, Object>> list(HttpServletRequest request, String reason, Integer status, String startTime, String endTime, Long chargingStationId);
|
||||
List<Map<String, Object>> list(HttpServletRequest request,String tenantId,Long operatorId, String reason, Integer status, String startTime, String endTime, Long chargingStationId);
|
||||
|
||||
R addXhpcTimingChargingModel(HttpServletRequest request, XhpcTimingChargingModelDto xhpcTimingChargingModelDto);
|
||||
|
||||
|
||||
@ -24,6 +24,7 @@ import com.xhpc.common.domain.XhpcTerminal;
|
||||
import com.xhpc.common.enums.ConnectorTypeEnum;
|
||||
import com.xhpc.common.enums.PileEquipmentTypeEnum;
|
||||
import com.xhpc.common.enums.PowerTypeEnum;
|
||||
import com.xhpc.common.redis.service.RedisService;
|
||||
import com.xhpc.common.security.service.TokenService;
|
||||
import com.xhpc.common.util.LogUserUtils;
|
||||
import com.xhpc.system.api.domain.SysUser;
|
||||
@ -57,7 +58,6 @@ public class XhpcChargingPileServiceImpl extends BaseService implements IXhpcCha
|
||||
private XhpcTerminalMapper xhpcTerminalMapper;
|
||||
@Autowired
|
||||
private PowerPileService powerPileService;
|
||||
|
||||
@Autowired
|
||||
private Environment environment;
|
||||
@Autowired
|
||||
@ -65,11 +65,11 @@ public class XhpcChargingPileServiceImpl extends BaseService implements IXhpcCha
|
||||
@Autowired
|
||||
private IXhpcChargingStationService xhpcChargingStationService;
|
||||
@Autowired
|
||||
private LogUserUtils logUserUtils;
|
||||
@Autowired
|
||||
private TokenService tokenService;
|
||||
@Autowired
|
||||
private TenantService tenantService;
|
||||
@Autowired
|
||||
RedisService redisService;
|
||||
|
||||
//字母集合
|
||||
private static Map letterMap;
|
||||
@ -94,30 +94,44 @@ public class XhpcChargingPileServiceImpl extends BaseService implements IXhpcCha
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String, Object>> selectXhpcChargingPileList(HttpServletRequest request, String name, Integer type, String serialNumber, Long chargingStationId) {
|
||||
public List<Map<String, Object>> selectXhpcChargingPileList(HttpServletRequest request,String tenantId,Long operatorId, String name, Integer type, String serialNumber, Long chargingStationId) {
|
||||
|
||||
LoginUser loginUser = tokenService.getLoginUser();
|
||||
//获取登陆用户
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
Long userId = loginUser.getUserid();
|
||||
//桩的统计、该时段金额
|
||||
List<Map<String, Object>> list =new ArrayList<>();
|
||||
LoginUser logUser = logUserUtils.getLogUser(request);
|
||||
String tenantId = logUser.getTenantId();
|
||||
|
||||
if(userId !=1) {
|
||||
Map<String, Object> landUser = xhpcChargingStationService.getLandUser(userId);
|
||||
if(landUser !=null){
|
||||
if(landUser.get("userType") !=null){
|
||||
startPage();
|
||||
if("01".equals(landUser.get("userType").toString())){
|
||||
Long operatorId = Long.valueOf(landUser.get("operatorId").toString());
|
||||
list= xhpcChargingPileMapper.selectXhpcChargingPileList(name, type, serialNumber, chargingStationId,operatorId,1,tenantId);
|
||||
Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString());
|
||||
list= xhpcChargingPileMapper.selectXhpcChargingPileList(operatorId,name, type, serialNumber, chargingStationId,logOperatorId,1,tenantId);
|
||||
}else{
|
||||
list= xhpcChargingPileMapper.selectXhpcChargingPileList(name, type, serialNumber, chargingStationId,userId,2,tenantId);
|
||||
list= xhpcChargingPileMapper.selectXhpcChargingPileList(operatorId,name, type, serialNumber, chargingStationId,userId,2,tenantId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
startPage();
|
||||
list= xhpcChargingPileMapper.selectXhpcChargingPileList(name, type, serialNumber, chargingStationId,userId,0,tenantId);
|
||||
list= xhpcChargingPileMapper.selectXhpcChargingPileList(operatorId,name, type, serialNumber, chargingStationId,userId,0,tenantId);
|
||||
}
|
||||
|
||||
if(list !=null && list.size()>0){
|
||||
for (Map<String, Object> map: list ) {
|
||||
if(map.get("serialNumber") !=null){
|
||||
String serialNumberMap =map.get("serialNumber").toString();
|
||||
String configRateReply = redisService.getCacheObject("pile:" + serialNumberMap + ".configRateReply");
|
||||
if(configRateReply==null || "".equals(configRateReply)){
|
||||
map.put("configRmReply","未下发");
|
||||
}else{
|
||||
map.put("configRmReply",configRateReply);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@ -17,7 +17,10 @@ import com.xhpc.common.core.web.service.BaseService;
|
||||
import com.xhpc.common.data.redis.CacheRateModel;
|
||||
import com.xhpc.common.domain.*;
|
||||
import com.xhpc.common.redis.service.RedisService;
|
||||
import com.xhpc.common.security.service.TokenService;
|
||||
import com.xhpc.common.util.LogUserUtils;
|
||||
import com.xhpc.common.util.UserTypeUtil;
|
||||
import com.xhpc.system.api.domain.SysUser;
|
||||
import com.xhpc.system.api.model.LoginUser;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -56,6 +59,8 @@ public class XhpcChargingStationServiceImpl extends BaseService implements IXhpc
|
||||
private LogUserUtils logUserUtils;
|
||||
@Autowired
|
||||
private TenantService tenantService;
|
||||
@Autowired
|
||||
private TokenService tokenService;
|
||||
|
||||
@Autowired
|
||||
private XhpcChargingStationPushStatusMapper xhpcChargingStationPushStatusMapper;
|
||||
@ -153,36 +158,31 @@ public class XhpcChargingStationServiceImpl extends BaseService implements IXhpc
|
||||
* @return 电站
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String, Object>> selectXhpcChargingStationList(HttpServletRequest request, String name, String operatorName) {
|
||||
public List<Map<String, Object>> selectXhpcChargingStationList(HttpServletRequest request,String tenantId,Long operatorId,Long chargingStationId, String name, String operatorName) {
|
||||
//获取登陆用户
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
LoginUser loginUser = tokenService.getLoginUser(request);
|
||||
SysUser sysUser = loginUser.getSysUser();
|
||||
Long sysUserId = sysUser.getUserId();
|
||||
//桩的统计、该时段金额
|
||||
List<Map<String, Object>> list =new ArrayList<>();
|
||||
LoginUser logUser = logUserUtils.getLogUser(request);
|
||||
String tenantId = logUser.getSysUser().getTenantId();
|
||||
if(userId !=1) {
|
||||
Map<String, Object> landUser = xhpcChargingStationMapper.getLandUser(userId);
|
||||
if(landUser !=null){
|
||||
if(landUser.get("userType") !=null){
|
||||
startPage();
|
||||
if("01".equals(landUser.get("userType").toString())){
|
||||
Long operatorId = 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();
|
||||
//运营商看自己的场站
|
||||
list = xhpcChargingStationMapper.selectXhpcChargingStationList(name, operatorName,operatorId,1,tenantId);
|
||||
list = xhpcChargingStationMapper.selectXhpcChargingStationList(operatorId,chargingStationId,name,operatorName,logOperatorId,1,tenantId);
|
||||
}else{
|
||||
//查询赋值的场站
|
||||
list = xhpcChargingStationMapper.selectXhpcChargingStationList(name, operatorName,userId,2,tenantId);
|
||||
}
|
||||
}
|
||||
list = xhpcChargingStationMapper.selectXhpcChargingStationList(operatorId,chargingStationId,name,operatorName,sysUserId,2,tenantId);
|
||||
}
|
||||
}else{
|
||||
startPage();
|
||||
list = xhpcChargingStationMapper.selectXhpcChargingStationList(name, operatorName,userId,0,tenantId);
|
||||
list = xhpcChargingStationMapper.selectXhpcChargingStationList(operatorId,chargingStationId,name, operatorName,sysUserId,0,tenantId);
|
||||
}
|
||||
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
Map<String, Object> map = list.get(i);
|
||||
Long chargingStationId = Long.valueOf(map.get("chargingStationId").toString());
|
||||
Long chargingStationIdMap = Long.valueOf(map.get("chargingStationId").toString());
|
||||
//获取该时段电费
|
||||
//HH:mm:ss
|
||||
String tiem = DateUtil.formatTime(new Date());
|
||||
@ -191,11 +191,11 @@ public class XhpcChargingStationServiceImpl extends BaseService implements IXhpc
|
||||
map.put("url",imgIds[0]);
|
||||
}
|
||||
|
||||
Map<String, Object> xhpcRateTime = xhpcRateTimeService.getXhpcRateTime(tiem, chargingStationId);
|
||||
Map<String, Object> xhpcRateTime = xhpcRateTimeService.getXhpcRateTime(tiem, chargingStationIdMap);
|
||||
if (xhpcRateTime != null) {
|
||||
map.putAll(xhpcRateTime);
|
||||
}
|
||||
map =getTerminalStatusSum(map, chargingStationId,0);
|
||||
map =getTerminalStatusSum(map, chargingStationIdMap,0);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@ -43,25 +43,25 @@ public class XhpcDownCodeServiceImpl extends BaseService implements IXhpcDownCod
|
||||
private static final Logger logger = LoggerFactory.getLogger(XhpcDownCodeServiceImpl.class);
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> listStations(String stationName) {
|
||||
public List<Map<String, Object>> listStations(String tenantId,Long operatorId,Long chargingStationId,String stationName) {
|
||||
LoginUser loginUser = tokenService.getLoginUser();
|
||||
List<Map<String, Object>> list =new ArrayList<>();
|
||||
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 = xhpcDownCodeMapper.selectStationsBy(stationName,1,logOperatorId,loginUser.getTenantId());
|
||||
list = xhpcDownCodeMapper.selectStationsBy(operatorId,chargingStationId,stationName,1,logOperatorId,tenantId);
|
||||
}else{
|
||||
//查询赋值的场站
|
||||
list = xhpcDownCodeMapper.selectStationsBy(stationName,2,sysUserId,loginUser.getTenantId());
|
||||
list = xhpcDownCodeMapper.selectStationsBy(operatorId,chargingStationId,stationName,2,sysUserId,tenantId);
|
||||
}
|
||||
}else{
|
||||
startPage();
|
||||
list = xhpcDownCodeMapper.selectStationsBy(stationName,0,sysUserId,loginUser.getTenantId());
|
||||
list = xhpcDownCodeMapper.selectStationsBy(operatorId,chargingStationId,stationName,0,sysUserId,tenantId);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@ -8,10 +8,14 @@ import com.xhpc.common.api.dto.XhpcRateDto;
|
||||
import com.xhpc.common.api.dto.XhpcRateTimeDto;
|
||||
import com.xhpc.common.api.dto.XhpcTimingChargingModelDto;
|
||||
import com.xhpc.common.core.domain.R;
|
||||
import com.xhpc.common.core.utils.SecurityUtils;
|
||||
import com.xhpc.common.core.web.domain.AjaxResult;
|
||||
import com.xhpc.common.core.web.service.BaseService;
|
||||
import com.xhpc.common.data.redis.CacheRateModel;
|
||||
import com.xhpc.common.domain.*;
|
||||
import com.xhpc.common.security.service.TokenService;
|
||||
import com.xhpc.common.util.UserTypeUtil;
|
||||
import com.xhpc.system.api.domain.SysUser;
|
||||
import com.xhpc.system.api.model.LoginUser;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -51,14 +55,26 @@ public class XhpcTimingChargingModelServiceImpl extends BaseService implements I
|
||||
private static final Logger logger = LoggerFactory.getLogger(XhpcTimingChargingModelServiceImpl.class);
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> list(HttpServletRequest request, String reason, Integer status, String startTime, String endTime, Long chargingStationId) {
|
||||
public List<Map<String, Object>> list(HttpServletRequest request,String tenantId,Long operatorId, String reason, Integer status, String startTime, String endTime, Long chargingStationId) {
|
||||
|
||||
LoginUser loginUser = tokenService.getLoginUser(request);
|
||||
if(loginUser !=null){
|
||||
startPage();
|
||||
return xhpcTimingChargingModelMapper.list(reason,status,startTime,endTime,chargingStationId,loginUser.getTenantId());
|
||||
SysUser sysUser = loginUser.getSysUser();
|
||||
|
||||
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 xhpcTimingChargingModelMapper.list(operatorId,reason,status,startTime,endTime,chargingStationId,logOperatorId, 1,tenantId);
|
||||
}else{
|
||||
//查询赋值的场站
|
||||
return xhpcTimingChargingModelMapper.list(operatorId,reason,status,startTime,endTime,chargingStationId,sysUserId, 1,tenantId);
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}else{
|
||||
return xhpcTimingChargingModelMapper.list(operatorId,reason,status,startTime,endTime,chargingStationId,sysUserId, 1,tenantId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -94,6 +94,9 @@
|
||||
<if test="name !=null and name !=''">
|
||||
and cp.name like CONCAT('%',#{name},'%')
|
||||
</if>
|
||||
<if test="operatorId !=null">
|
||||
and st.operator_id =#{operatorId}
|
||||
</if>
|
||||
<if test="type !=null and type !=''">
|
||||
and cp.type=#{type}
|
||||
</if>
|
||||
@ -104,10 +107,10 @@
|
||||
and cp.charging_station_id=#{chargingStationId}
|
||||
</if>
|
||||
<if test="number !=0 and number ==1">
|
||||
and cp.charging_station_id in(select charging_station_id from xhpc_charging_station where operator_id=#{operatorId})
|
||||
and cp.charging_station_id in(select charging_station_id from xhpc_charging_station where operator_id=#{logOperatorId})
|
||||
</if>
|
||||
<if test="number !=0 and number ==2">
|
||||
and cp.charging_station_id in(select charging_station_id from xhpc_user_privilege where user_id=#{operatorId})
|
||||
and cp.charging_station_id in(select charging_station_id from xhpc_user_privilege where user_id=#{logOperatorId})
|
||||
</if>
|
||||
<if test="tenantId !=null and tenantId !=''">
|
||||
and cp.tenant_id=#{tenantId}
|
||||
|
||||
@ -82,11 +82,17 @@
|
||||
<if test="operatorName !=null and operatorName !=''">
|
||||
and ope.name like CONCAT('%',#{operatorName},'%')
|
||||
</if>
|
||||
<if test="operatorId !=null">
|
||||
and cs.operator_id = #{operatorId}
|
||||
</if>
|
||||
<if test="chargingStationId !=null">
|
||||
and cs.charging_station_id = #{chargingStationId}
|
||||
</if>
|
||||
<if test="type ==1">
|
||||
and cs.charging_station_id in(select charging_station_id from xhpc_charging_station where operator_id=#{operatorId})
|
||||
and cs.charging_station_id in(select charging_station_id from xhpc_charging_station where operator_id=#{logOperatorId})
|
||||
</if>
|
||||
<if test="type ==2">
|
||||
and cs.charging_station_id in(select charging_station_id from xhpc_user_privilege where user_id=#{operatorId})
|
||||
and cs.charging_station_id in(select charging_station_id from xhpc_user_privilege where user_id=#{logOperatorId})
|
||||
</if>
|
||||
<if test="tenantId !=null and tenantId !=''">
|
||||
and cs.tenant_id=#{tenantId}
|
||||
|
||||
@ -9,9 +9,14 @@
|
||||
xo.name as operatorName, count(xt.terminal_id) as number
|
||||
from xhpc_charging_station as xcs left join xhpc_operator as xo
|
||||
on xcs.operator_id = xo.operator_id
|
||||
left join xhpc_terminal as xt
|
||||
on xcs.charging_station_id = xt.charging_station_id
|
||||
left join xhpc_terminal as xt on xcs.charging_station_id = xt.charging_station_id
|
||||
where xo.del_flag = 0 and xt.del_flag = 0
|
||||
<if test="operatorId !=null">
|
||||
and xcs.operator_id =#{operatorId}
|
||||
</if>
|
||||
<if test="chargingStationId !=null">
|
||||
and xcs.charging_station_id =#{chargingStationId}
|
||||
</if>
|
||||
<if test="null != stationName and '' != stationName">
|
||||
and xcs.name like concat('%',#{stationName},'%')
|
||||
</if>
|
||||
|
||||
@ -92,6 +92,9 @@
|
||||
from xhpc_timing_charging_model as tcm
|
||||
left join xhpc_charging_station as cs on cs.charging_station_id = tcm.charging_station_id
|
||||
where tcm.del_flag =0
|
||||
<if test="operatorId !=null">
|
||||
and cs.operator_id = #{operatorId}
|
||||
</if>
|
||||
<if test="chargingStationId !=null">
|
||||
and tcm.charging_station_id = #{chargingStationId}
|
||||
</if>
|
||||
@ -110,6 +113,12 @@
|
||||
<if test="tenantId !=null and '' !=tenantId">
|
||||
and tcm.tenant_id =#{tenantId}
|
||||
</if>
|
||||
<if test="type ==1">
|
||||
and cs.charging_station_id in(select charging_station_id from xhpc_charging_station where operator_id=#{logOperatorId})
|
||||
</if>
|
||||
<if test="type ==2">
|
||||
and cs.charging_station_id in(select charging_station_id from xhpc_user_privilege where user_id=#{logOperatorId})
|
||||
</if>
|
||||
order by tcm.status asc, tcm.create_time desc
|
||||
</select>
|
||||
|
||||
|
||||
@ -72,11 +72,11 @@ public class XhpcHistoryOrderController extends BaseController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getListPage")
|
||||
public TableDataInfo getListPage(String phone,String transactionNumber,@RequestParam("status")Integer status,String chargingStationName,Long operatorId,Integer source,String beginStartTime,String beginEndTime,@RequestParam("userId") Long userId, Integer type,
|
||||
public TableDataInfo getListPage(String tenantId,Long chargingStationId,Long chargingPileId,Long terminalId, String phone,String transactionNumber,@RequestParam("status")Integer status,String chargingStationName,Long operatorId,Integer source,String beginStartTime,String beginEndTime,@RequestParam("userId") Long userId, Integer type,
|
||||
String affiliationOrganization,String evcsOrderNo,String plateNum,Integer internetId,String internetSerialNumber,String terminalName,String vinCode,String overStartTime,String overEndTime,Long personnelId, Integer confirmResult)
|
||||
|
||||
{
|
||||
List<Map<String, Object>> listPage = xhpcHistoryOrderService.getListPage(phone, transactionNumber, status, chargingStationName, operatorId, source, beginStartTime, beginEndTime, userId, type, affiliationOrganization,evcsOrderNo,plateNum,internetId,internetSerialNumber,terminalName,vinCode,overStartTime,overEndTime,personnelId,confirmResult);
|
||||
List<Map<String, Object>> listPage = xhpcHistoryOrderService.getListPage(tenantId,chargingStationId,chargingPileId,terminalId,phone, transactionNumber, status, chargingStationName, operatorId, source, beginStartTime, beginEndTime, userId, type, affiliationOrganization,evcsOrderNo,plateNum,internetId,internetSerialNumber,terminalName,vinCode,overStartTime,overEndTime,personnelId,confirmResult);
|
||||
return getDataTable(listPage);
|
||||
}
|
||||
|
||||
@ -98,6 +98,10 @@ public class XhpcHistoryOrderController extends BaseController {
|
||||
*/
|
||||
@PostMapping("/export")
|
||||
public void getExport(HttpServletResponse response,
|
||||
String tenantId,
|
||||
Long chargingStationId,
|
||||
Long chargingPileId,
|
||||
Long terminalId,
|
||||
String phone,
|
||||
String transactionNumber,
|
||||
@RequestParam("status")Integer status,
|
||||
@ -120,7 +124,7 @@ public class XhpcHistoryOrderController extends BaseController {
|
||||
Long personnelId,
|
||||
Integer confirmResult) throws IOException {
|
||||
|
||||
xhpcHistoryOrderService.export(response, phone, transactionNumber, status, chargingStationName, operatorId, source, beginStartTime, beginEndTime, userId, type,affiliationOrganization,evcsOrderNo,plateNum,internetId,internetSerialNumber,terminalName,vinCode,overStartTime,overEndTime,personnelId,confirmResult);
|
||||
xhpcHistoryOrderService.export(response,tenantId,chargingStationId,chargingPileId,terminalId, phone, transactionNumber, status, chargingStationName, operatorId, source, beginStartTime, beginEndTime, userId, type,affiliationOrganization,evcsOrderNo,plateNum,internetId,internetSerialNumber,terminalName,vinCode,overStartTime,overEndTime,personnelId,confirmResult);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -47,10 +47,10 @@ public class XhpcRealTimeOrderController extends BaseController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(String phone,String transactionNumber,Integer source,String chargingStationName,String terminalName,Long operatorId,String startTime,String endTime,@RequestParam("status") Integer status,@RequestParam("userId") Long userId,@RequestParam("type") Integer type,
|
||||
public TableDataInfo list(String tenantId,Long chargingStationId,Long chargingPileId,Long terminalId, String phone,String transactionNumber,Integer source,String chargingStationName,String terminalName,Long operatorId,String startTime,String endTime,Integer status,Long userId, Integer type,
|
||||
String affiliationOrganization,String plateNum,Integer internetId,String internetSerialNumber)
|
||||
{
|
||||
List<Map<String,Object>> list = xhpcRealTimeOrderService.list(phone, transactionNumber, source, chargingStationName,terminalName, operatorId, startTime, endTime,status,userId,type,affiliationOrganization,plateNum,internetId,internetSerialNumber);
|
||||
List<Map<String,Object>> list = xhpcRealTimeOrderService.list(tenantId,chargingStationId,chargingPileId,terminalId,phone, transactionNumber, source, chargingStationName,terminalName, operatorId, startTime, endTime,status,userId,type,affiliationOrganization,plateNum,internetId,internetSerialNumber);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
@ -147,21 +147,17 @@ public class XhpcStatisticsController extends BaseController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getChargingStationList")
|
||||
public AjaxResult getChargingStationList(HttpServletRequest request,Long operatorId, @RequestParam("userId") Long userId, @RequestParam("type")Integer type)
|
||||
public AjaxResult getChargingStationList(HttpServletRequest request,String tenantId,Long operatorId,Long userId,Integer type)
|
||||
{
|
||||
if (type == null || type==3) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
return xhpcStatisticsService.getChargingStationList(request,operatorId, userId, type);
|
||||
|
||||
return xhpcStatisticsService.getChargingStationList(request,tenantId,operatorId, userId, type);
|
||||
}
|
||||
|
||||
@GetMapping("/getChargingPileList")
|
||||
public AjaxResult getChargingPileList(HttpServletRequest request,Long chargingStationId,Long operatorId, @RequestParam("userId") Long userId, @RequestParam("type")Integer type)
|
||||
public AjaxResult getChargingPileList(HttpServletRequest request,String tenantId,Long chargingStationId,Long operatorId, Long userId,Integer type)
|
||||
{
|
||||
if (type == null || type==3) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
return xhpcStatisticsService.getChargingPileList(request,chargingStationId,operatorId, userId, type);
|
||||
|
||||
return xhpcStatisticsService.getChargingPileList(request,tenantId,chargingStationId,operatorId, userId, type);
|
||||
}
|
||||
|
||||
|
||||
@ -173,11 +169,8 @@ public class XhpcStatisticsController extends BaseController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getOperatorList")
|
||||
public AjaxResult getOperatorList(HttpServletRequest request,Long operatorId, @RequestParam("userId") Long userId, @RequestParam("type")Integer type,String tenantId)
|
||||
public AjaxResult getOperatorList(HttpServletRequest request,Long operatorId, Long userId,Integer type,String tenantId)
|
||||
{
|
||||
if (type == null || type==3) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
return xhpcStatisticsService.getOperatorList(request,operatorId, userId, type,tenantId);
|
||||
}
|
||||
|
||||
@ -200,11 +193,8 @@ public class XhpcStatisticsController extends BaseController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getInternetUserIList")
|
||||
public AjaxResult getInternetUserIList(HttpServletRequest request,Long internetUserId, @RequestParam("userId") Long userId, @RequestParam("type")Integer type)
|
||||
public AjaxResult getInternetUserIList(HttpServletRequest request,Long internetUserId, Long userId,Integer type)
|
||||
{
|
||||
if (type == null || type==2) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
return xhpcStatisticsService.getInternetUserIList(request,internetUserId, userId, type);
|
||||
}
|
||||
|
||||
@ -216,11 +206,9 @@ public class XhpcStatisticsController extends BaseController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getTerminalList")
|
||||
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(request,chargingStationId, userId, type);
|
||||
public AjaxResult getTerminalList(HttpServletRequest request,String tenantId,Long operatorId,Long chargingStationId,Long chargingPileId,Long userId, Integer type) {
|
||||
|
||||
return xhpcStatisticsService.getTerminalList(request,tenantId,operatorId,chargingStationId,chargingPileId, userId, type);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -230,7 +218,7 @@ public class XhpcStatisticsController extends BaseController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getSourceList")
|
||||
public AjaxResult getSourceList(HttpServletRequest request,@RequestParam("userId") Long userId, @RequestParam("type") Integer type) {
|
||||
public AjaxResult getSourceList(HttpServletRequest request, Long userId, Integer type) {
|
||||
return xhpcStatisticsService.getSourceList(request,userId, type);
|
||||
}
|
||||
|
||||
|
||||
@ -76,7 +76,7 @@ public interface XhpcHistoryOrderMapper {
|
||||
* 历史订单记录(PC)
|
||||
* @return
|
||||
*/
|
||||
List<Map<String,Object>> getListPage(@Param("phone")String phone,@Param("transactionNumber")String transactionNumber,@Param("status")Integer status,@Param("chargingStationName")String chargingStationName,@Param("operatorId")Long operatorId,@Param("source")Integer source,@Param("beginStartTime")String beginStartTime,@Param("beginEndTime")String beginEndTime,@Param("userId")Long userId,@Param("type")Integer type,@Param("number")Integer number,@Param("affiliationOrganization")String affiliationOrganization,@Param("evcsOrderNo")String evcsOrderNo,@Param("plateNum")String plateNum,@Param("internetId")Integer internetId,@Param("internetSerialNumber")String internetSerialNumber,@Param("terminalName")String terminalName,@Param("vinCode")String vinCode,@Param("overStartTime")String overStartTime,@Param("overEndTime")String overEndTime,@Param("personnelId")Long personnelId,@Param("confirmResult")Integer confirmResult,@Param("tenantId")String tenantId,@Param("isNotNull")Integer isNotNull);
|
||||
List<Map<String,Object>> getListPage(@Param("chargingStationId")Long chargingStationId,@Param("chargingPileId")Long chargingPileId,@Param("terminalId")Long terminalId,@Param("phone")String phone,@Param("transactionNumber")String transactionNumber,@Param("status")Integer status,@Param("chargingStationName")String chargingStationName,@Param("operatorId")Long operatorId,@Param("source")Integer source,@Param("beginStartTime")String beginStartTime,@Param("beginEndTime")String beginEndTime,@Param("userId")Long userId,@Param("type")Integer type,@Param("number")Integer number,@Param("affiliationOrganization")String affiliationOrganization,@Param("evcsOrderNo")String evcsOrderNo,@Param("plateNum")String plateNum,@Param("internetId")Integer internetId,@Param("internetSerialNumber")String internetSerialNumber,@Param("terminalName")String terminalName,@Param("vinCode")String vinCode,@Param("overStartTime")String overStartTime,@Param("overEndTime")String overEndTime,@Param("personnelId")Long personnelId,@Param("confirmResult")Integer confirmResult,@Param("tenantId")String tenantId,@Param("isNotNull")Integer isNotNull);
|
||||
|
||||
/**
|
||||
* 获取费率时段
|
||||
|
||||
@ -62,7 +62,7 @@ public interface XhpcRealTimeOrderMapper {
|
||||
* @param number 0 都没有 1 phone 有 2 用户类型有 3 都有
|
||||
* @return
|
||||
*/
|
||||
List<Map<String,Object>> list(@Param("phone") String phone,@Param("transactionNumber") String transactionNumber,@Param("source") Integer source,@Param("chargingStationName") String chargingStationName,@Param("terminalName")String terminalName,@Param("operatorId") Long operatorId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("number") Integer number,@Param("status")Integer status,@Param("userId")Long userId,@Param("type")Integer type,
|
||||
List<Map<String,Object>> list(@Param("chargingStationId")Long chargingStationId,@Param("chargingPileId")Long chargingPileId,@Param("terminalId")Long terminalId,@Param("phone") String phone,@Param("transactionNumber") String transactionNumber,@Param("source") Integer source,@Param("chargingStationName") String chargingStationName,@Param("terminalName")String terminalName,@Param("operatorId") Long operatorId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("number") Integer number,@Param("status")Integer status,@Param("userId")Long userId,@Param("type")Integer type,
|
||||
@Param("affiliationOrganization")String affiliationOrganization,@Param("plateNum")String plateNum,@Param("internetId")Integer internetId,@Param("internetSerialNumber")String internetSerialNumber,@Param("tenantId")String tenantId);
|
||||
|
||||
/**
|
||||
|
||||
@ -134,7 +134,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,@Param("tenantId")String tenantId);
|
||||
List<Map<String, Object>> getTerminalList(@Param("operatorId")Long operatorId,@Param("chargingStationId")Long chargingStationId,@Param("chargingPileId")Long chargingPileId,@Param("userId")Long userId,@Param("type")Integer type,@Param("tenantId")String tenantId);
|
||||
|
||||
/**
|
||||
* 机构统计
|
||||
|
||||
@ -56,14 +56,14 @@ public interface IXhpcHistoryOrderService {
|
||||
* 历史订单记录(PC)
|
||||
* @return
|
||||
*/
|
||||
List<Map<String,Object>> getListPage(String phone,String transactionNumber,Integer status,String chargingStationName,Long operatorId,Integer source,String beginStartTime,String beginEndTime,Long userId,Integer type,String affiliationOrganization,String evcsOrderNo,String plateNum,Integer internetId,String internetSerialNumber,String terminalName,String vinCode,String overStartTime,String overEndTime,Long personnelId,Integer confirmResult);
|
||||
List<Map<String,Object>> getListPage(String tenantId,Long chargingStationId,Long chargingPileId,Long terminalId, String phone,String transactionNumber,Integer status,String chargingStationName,Long operatorId,Integer source,String beginStartTime,String beginEndTime,Long userId,Integer type,String affiliationOrganization,String evcsOrderNo,String plateNum,Integer internetId,String internetSerialNumber,String terminalName,String vinCode,String overStartTime,String overEndTime,Long personnelId,Integer confirmResult);
|
||||
|
||||
|
||||
/**
|
||||
* 历史订单记录导出(PC)
|
||||
* @return
|
||||
*/
|
||||
void export(HttpServletResponse response, String phone, String transactionNumber, Integer status, String chargingStationName, Long operatorId, Integer source, String beginStartTime, String beginEndTime, Long userId, Integer type,String affiliationOrganization,String evcsOrderNo,String plateNum,Integer internetId,String internetSerialNumber,String terminalName,String vinCode,String overStartTime,String overEndTime,Long personnelId,Integer confirmResult) throws IOException;
|
||||
void export(HttpServletResponse response,String tenantId,Long chargingStationId,Long chargingPileId,Long terminalId, String phone, String transactionNumber, Integer status, String chargingStationName, Long operatorId, Integer source, String beginStartTime, String beginEndTime, Long userId, Integer type,String affiliationOrganization,String evcsOrderNo,String plateNum,Integer internetId,String internetSerialNumber,String terminalName,String vinCode,String overStartTime,String overEndTime,Long personnelId,Integer confirmResult) throws IOException;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -31,7 +31,7 @@ public interface IXhpcRealTimeOrderService {
|
||||
* @param type 1 平台 2 运营商 3流量方
|
||||
* @return
|
||||
*/
|
||||
List<Map<String,Object>> list(String phone,String transactionNumber,Integer source,String chargingStationName,String terminalName,Long operatorId,String startTime,String endTime,Integer status,Long userId,Integer type,String affiliationOrganization,String plateNum,Integer internetId,String internetSerialNumber);
|
||||
List<Map<String,Object>> list(String tenantId,Long chargingStationId,Long chargingPileId,Long terminalId,String phone,String transactionNumber,Integer source,String chargingStationName,String terminalName,Long operatorId,String startTime,String endTime,Integer status,Long userId,Integer type,String affiliationOrganization,String plateNum,Integer internetId,String internetSerialNumber);
|
||||
|
||||
/**
|
||||
* 实时订单详情接口(PC端)
|
||||
|
||||
@ -106,7 +106,7 @@ public interface IXhpcStatisticsService {
|
||||
* @param type 1 平台 2 运营商 3流量方
|
||||
* @return
|
||||
*/
|
||||
AjaxResult getChargingStationList(HttpServletRequest request,Long operatorId,Long userId,Integer type);
|
||||
AjaxResult getChargingStationList(HttpServletRequest request,String tenantId,Long operatorId,Long userId,Integer type);
|
||||
|
||||
/**
|
||||
* 电桩列表
|
||||
@ -115,7 +115,7 @@ public interface IXhpcStatisticsService {
|
||||
* @param type 1 平台 2 运营商 3流量方
|
||||
* @return
|
||||
*/
|
||||
AjaxResult getChargingPileList(HttpServletRequest request,Long chargingStationId,Long operatorId,Long userId,Integer type);
|
||||
AjaxResult getChargingPileList(HttpServletRequest request,String tenantId,Long chargingStationId,Long operatorId,Long userId,Integer type);
|
||||
|
||||
/**
|
||||
* 运营商列表
|
||||
@ -146,7 +146,7 @@ public interface IXhpcStatisticsService {
|
||||
* @param type 1 平台 2 运营商 3流量方
|
||||
* @return
|
||||
*/
|
||||
AjaxResult getTerminalList(HttpServletRequest request,Long chargingStationId,Long userId,Integer type);
|
||||
AjaxResult getTerminalList(HttpServletRequest request,String tenantId,Long operatorId,Long chargingStationId,Long chargingPileId,Long userId,Integer type);
|
||||
|
||||
/**
|
||||
* 订单来源列表
|
||||
|
||||
@ -216,7 +216,7 @@ public class XhpcHistoryOrderServiceImpl extends BaseService implements IXhpcHis
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getListPage(String phone, String transactionNumber, Integer status, String chargingStationName, Long operatorId, Integer source, String beginStartTime, String beginEndTime, Long userId, Integer type,String affiliationOrganization,String evcsOrderNo,String plateNum,Integer internetId,String internetSerialNumber,String terminalName,String vinCode,String overStartTime,String overEndTime,Long personnelId,Integer confirmResult) {
|
||||
public List<Map<String, Object>> getListPage(String tenantId,Long chargingStationId,Long chargingPileId,Long terminalId, String phone, String transactionNumber, Integer status, String chargingStationName, Long operatorId, Integer source, String beginStartTime, String beginEndTime, Long userId, Integer type,String affiliationOrganization,String evcsOrderNo,String plateNum,Integer internetId,String internetSerialNumber,String terminalName,String vinCode,String overStartTime,String overEndTime,Long personnelId,Integer confirmResult) {
|
||||
|
||||
Integer number = 0;
|
||||
//电话和用户类型都不为null number =3
|
||||
@ -233,7 +233,6 @@ public class XhpcHistoryOrderServiceImpl extends BaseService implements IXhpcHis
|
||||
//获取登陆用户
|
||||
Long logUserId = SecurityUtils.getUserId();
|
||||
LoginUser loginUser = tokenService.getLoginUser();
|
||||
String tenantId = loginUser.getTenantId();
|
||||
//桩的统计、该时段金额
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
if (userId != UserTypeUtil.USER_ID) {
|
||||
@ -244,24 +243,24 @@ public class XhpcHistoryOrderServiceImpl extends BaseService implements IXhpcHis
|
||||
if (UserTypeUtil.SYS_USER_TYPE_ONE.equals(landUser.get("userType").toString())) {
|
||||
Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString());
|
||||
//运营商看自己的场站
|
||||
list = xhpcHistoryOrderMapper.getListPage(phone, transactionNumber, 1, chargingStationName, operatorId, source, beginStartTime, beginEndTime, logOperatorId, type, number,affiliationOrganization,evcsOrderNo,plateNum,internetId,internetSerialNumber,terminalName,vinCode,overStartTime,overEndTime,personnelId,confirmResult,tenantId,0);
|
||||
list = xhpcHistoryOrderMapper.getListPage(chargingStationId,chargingPileId,terminalId,phone, transactionNumber, 1, chargingStationName, operatorId, source, beginStartTime, beginEndTime, logOperatorId, type, number,affiliationOrganization,evcsOrderNo,plateNum,internetId,internetSerialNumber,terminalName,vinCode,overStartTime,overEndTime,personnelId,confirmResult,tenantId,0);
|
||||
} else {
|
||||
//查询赋值的场站
|
||||
list = xhpcHistoryOrderMapper.getListPage(phone, transactionNumber, 2, chargingStationName, operatorId, source, beginStartTime, beginEndTime, logUserId, type, number,affiliationOrganization,evcsOrderNo,plateNum,internetId,internetSerialNumber,terminalName,vinCode,overStartTime,overEndTime,personnelId,confirmResult,tenantId,0);
|
||||
list = xhpcHistoryOrderMapper.getListPage(chargingStationId,chargingPileId,terminalId,phone, transactionNumber, 2, chargingStationName, operatorId, source, beginStartTime, beginEndTime, logUserId, type, number,affiliationOrganization,evcsOrderNo,plateNum,internetId,internetSerialNumber,terminalName,vinCode,overStartTime,overEndTime,personnelId,confirmResult,tenantId,0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
startPage();
|
||||
list = xhpcHistoryOrderMapper.getListPage(phone, transactionNumber, 0, chargingStationName, operatorId, source, beginStartTime, beginEndTime, userId, type, number,affiliationOrganization,evcsOrderNo,plateNum,internetId,internetSerialNumber,terminalName,vinCode,overStartTime,overEndTime,personnelId,confirmResult,tenantId,0);
|
||||
list = xhpcHistoryOrderMapper.getListPage(chargingStationId,chargingPileId,terminalId,phone, transactionNumber, 0, chargingStationName, operatorId, source, beginStartTime, beginEndTime, userId, type, number,affiliationOrganization,evcsOrderNo,plateNum,internetId,internetSerialNumber,terminalName,vinCode,overStartTime,overEndTime,personnelId,confirmResult,tenantId,0);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void export(HttpServletResponse response, String phone, String transactionNumber, Integer status, String chargingStationName, Long operatorId, Integer source, String beginStartTime, String beginEndTime, Long userId, Integer type,String affiliationOrganization,String evcsOrderNo,String plateNum,Integer internetId,String internetSerialNumber,String terminalName,String vinCode,String overStartTime,String overEndTime,Long personnelId,Integer confirmResult) throws IOException {
|
||||
public void export(HttpServletResponse response,String tenantId,Long chargingStationId,Long chargingPileId,Long terminalId, String phone, String transactionNumber, Integer status, String chargingStationName, Long operatorId, Integer source, String beginStartTime, String beginEndTime, Long userId, Integer type,String affiliationOrganization,String evcsOrderNo,String plateNum,Integer internetId,String internetSerialNumber,String terminalName,String vinCode,String overStartTime,String overEndTime,Long personnelId,Integer confirmResult) throws IOException {
|
||||
|
||||
Integer number = 0;
|
||||
//电话和用户类型都不为null number =3
|
||||
@ -278,7 +277,6 @@ public class XhpcHistoryOrderServiceImpl extends BaseService implements IXhpcHis
|
||||
//获取登陆用户
|
||||
Long logUserId = SecurityUtils.getUserId();
|
||||
LoginUser loginUser = tokenService.getLoginUser();
|
||||
String tenantId = loginUser.getTenantId();
|
||||
|
||||
//桩的统计、该时段金额
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
@ -289,15 +287,15 @@ public class XhpcHistoryOrderServiceImpl extends BaseService implements IXhpcHis
|
||||
if (UserTypeUtil.SYS_USER_TYPE_ONE.equals(landUser.get("userType").toString())) {
|
||||
Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString());
|
||||
//运营商看自己的场站
|
||||
list = xhpcHistoryOrderMapper.getListPage(phone, transactionNumber, 1, chargingStationName, operatorId, source, beginStartTime, beginEndTime, logOperatorId, type, number,affiliationOrganization,evcsOrderNo,plateNum,internetId,internetSerialNumber,terminalName,vinCode,overStartTime,overEndTime,personnelId,confirmResult,tenantId,1);
|
||||
list = xhpcHistoryOrderMapper.getListPage(chargingStationId,chargingPileId,terminalId,phone, transactionNumber, 1, chargingStationName, operatorId, source, beginStartTime, beginEndTime, logOperatorId, type, number,affiliationOrganization,evcsOrderNo,plateNum,internetId,internetSerialNumber,terminalName,vinCode,overStartTime,overEndTime,personnelId,confirmResult,tenantId,1);
|
||||
} else {
|
||||
//查询赋值的场站
|
||||
list = xhpcHistoryOrderMapper.getListPage(phone, transactionNumber, 2, chargingStationName, operatorId, source, beginStartTime, beginEndTime, logUserId, type, number,affiliationOrganization,evcsOrderNo,plateNum,internetId,internetSerialNumber,terminalName,vinCode,overStartTime,overEndTime,personnelId,confirmResult,tenantId,1);
|
||||
list = xhpcHistoryOrderMapper.getListPage(chargingStationId,chargingPileId,terminalId,phone, transactionNumber, 2, chargingStationName, operatorId, source, beginStartTime, beginEndTime, logUserId, type, number,affiliationOrganization,evcsOrderNo,plateNum,internetId,internetSerialNumber,terminalName,vinCode,overStartTime,overEndTime,personnelId,confirmResult,tenantId,1);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
list = xhpcHistoryOrderMapper.getListPage(phone, transactionNumber, 0, chargingStationName, operatorId, source, beginStartTime, beginEndTime, userId, type, number,affiliationOrganization,evcsOrderNo,plateNum,internetId,internetSerialNumber,terminalName,vinCode,overStartTime,overEndTime,personnelId,confirmResult,tenantId,1);
|
||||
list = xhpcHistoryOrderMapper.getListPage(chargingStationId,chargingPileId,terminalId,phone, transactionNumber, 0, chargingStationName, operatorId, source, beginStartTime, beginEndTime, userId, type, number,affiliationOrganization,evcsOrderNo,plateNum,internetId,internetSerialNumber,terminalName,vinCode,overStartTime,overEndTime,personnelId,confirmResult,tenantId,1);
|
||||
}
|
||||
|
||||
// 通过工具类创建writer,默认创建xls格式
|
||||
|
||||
@ -25,6 +25,7 @@ import com.xhpc.order.mapper.XhpcRealTimeOrderMapper;
|
||||
import com.xhpc.order.service.IXhpcChargeOrderService;
|
||||
import com.xhpc.order.service.IXhpcHistoryOrderService;
|
||||
import com.xhpc.order.service.IXhpcRealTimeOrderService;
|
||||
import com.xhpc.system.api.domain.SysUser;
|
||||
import com.xhpc.system.api.model.LoginUser;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -80,11 +81,8 @@ public class XhpcRealTimeOrderServiceImpl extends BaseService implements IXhpcRe
|
||||
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> list(String phone, String transactionNumber, Integer source, String chargingStationName, String terminalName, Long operatorId, String startTime, String endTime,Integer status,Long userId,Integer type,String affiliationOrganization,String plateNum,Integer internetId,String internetSerialNumber) {
|
||||
public List<Map<String, Object>> list(String tenantId,Long chargingStationId,Long chargingPileId,Long terminalId,String phone, String transactionNumber, Integer source, String chargingStationName, String terminalName, Long operatorId, String startTime, String endTime,Integer status,Long userId,Integer type,String affiliationOrganization,String plateNum,Integer internetId,String internetSerialNumber) {
|
||||
|
||||
|
||||
//获取登陆用户
|
||||
Long logUserId = SecurityUtils.getUserId();
|
||||
//桩的统计、该时段金额
|
||||
List<Map<String, Object>> list =new ArrayList<>();
|
||||
|
||||
@ -102,25 +100,21 @@ public class XhpcRealTimeOrderServiceImpl extends BaseService implements IXhpcRe
|
||||
return new ArrayList<>();
|
||||
}
|
||||
LoginUser loginUser = tokenService.getLoginUser();
|
||||
String tenantId = loginUser.getTenantId();
|
||||
if(logUserId !=1) {
|
||||
Map<String, Object> landUser = xhpcHistoryOrderService.getLandUser(logUserId);
|
||||
if(landUser !=null){
|
||||
SysUser sysUser = loginUser.getSysUser();
|
||||
Long logUserId = loginUser.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 = xhpcRealTimeOrderMapper.list(phone,transactionNumber,source,chargingStationName,terminalName,operatorId,startTime,endTime,number,status,logOperatorId,1,affiliationOrganization,plateNum,internetId,internetSerialNumber,tenantId);
|
||||
list = xhpcRealTimeOrderMapper.list(chargingStationId,chargingPileId,terminalId,phone,transactionNumber,source,chargingStationName,terminalName,operatorId,startTime,endTime,number,status,logOperatorId,1,affiliationOrganization,plateNum,internetId,internetSerialNumber,tenantId);
|
||||
}else{
|
||||
//查询赋值的场站
|
||||
list = xhpcRealTimeOrderMapper.list(phone,transactionNumber,source,chargingStationName,terminalName,operatorId,startTime,endTime,number,status,logUserId,2,affiliationOrganization,plateNum,internetId,internetSerialNumber,tenantId);
|
||||
}
|
||||
}
|
||||
list = xhpcRealTimeOrderMapper.list(chargingStationId,chargingPileId,terminalId,phone,transactionNumber,source,chargingStationName,terminalName,operatorId,startTime,endTime,number,status,logUserId,2,affiliationOrganization,plateNum,internetId,internetSerialNumber,tenantId);
|
||||
}
|
||||
}else{
|
||||
startPage();
|
||||
list = xhpcRealTimeOrderMapper.list(phone,transactionNumber,source,chargingStationName,terminalName,operatorId,startTime,endTime,number,status,logUserId,0,affiliationOrganization,plateNum,internetId,internetSerialNumber,tenantId);
|
||||
list = xhpcRealTimeOrderMapper.list(chargingStationId,chargingPileId,terminalId,phone,transactionNumber,source,chargingStationName,terminalName,operatorId,startTime,endTime,number,status,logUserId,0,affiliationOrganization,plateNum,internetId,internetSerialNumber,tenantId);
|
||||
}
|
||||
|
||||
return list;
|
||||
@ -182,7 +176,9 @@ public class XhpcRealTimeOrderServiceImpl extends BaseService implements IXhpcRe
|
||||
Map<String, Object> message = xhpcRealTimeOrderMapper.getMessage(realTimeOrderId);
|
||||
try{
|
||||
if(message ==null || message.get("chargeOrderId") ==null){
|
||||
return AjaxResult.success(new HashMap<>());
|
||||
message.put("powerPriceTotal",0);
|
||||
message.put("servicePriceTotal",0);
|
||||
return message;
|
||||
}
|
||||
//获取开始充电时间、结束时间、计费模型、充电度数、已充金额
|
||||
XhpcChargeOrder chargeOrder = xhpcChargeOrderService.getChargingOrderId(Long.parseLong(message.get("chargeOrderId").toString()));
|
||||
@ -242,7 +238,7 @@ public class XhpcRealTimeOrderServiceImpl extends BaseService implements IXhpcRe
|
||||
if(startRealTimeOrder ==null){
|
||||
message.put("powerPriceTotal",0);
|
||||
message.put("servicePriceTotal",0);
|
||||
return AjaxResult.success(message);
|
||||
return message;
|
||||
}
|
||||
XhpcRealTimeOrder endRealTimeOrder = xhpcRealTimeOrderMapper.getChargingOrderId(chargeOrder.getChargeOrderId(), 2);
|
||||
|
||||
|
||||
@ -286,14 +286,27 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati
|
||||
return xhpcStatisticsServiceMapper.getInternetUserIntervalPage(internetIds, internetUserId, startTime, endTime, type,sysUserId,tenantId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 终端统计
|
||||
*
|
||||
* @param request
|
||||
* @param chargingStationId 电站id
|
||||
* @param terminalId 终端di
|
||||
* @param operatorId 运营商id
|
||||
* @param startTime 订单开始时间
|
||||
* @param endTime 订单结束时间
|
||||
* @param userId 用户id
|
||||
* @param type 1 平台 2 运营商 3流量方
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String, Object>> getTerminalIntervalPage(HttpServletRequest request, String chargingStationId, String terminalId, Long operatorId, String startTime, String endTime, Long userId, Integer type) {
|
||||
//获取登陆用户
|
||||
LoginUser loginUser = tokenService.getLoginUser(request);
|
||||
List<Map<String, Object>> list =new ArrayList<>();
|
||||
SysUser sysUser = loginUser.getSysUser();
|
||||
String tenantId = loginUser.getTenantId();
|
||||
Long sysUserId = sysUser.getUserId();
|
||||
String tenantId = loginUser.getTenantId();
|
||||
if(!UserTypeUtil.SYS_USER_TYPE_ADMIN.equals(sysUser.getUserId())){
|
||||
startPage();
|
||||
if(UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())){
|
||||
@ -313,24 +326,24 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public AjaxResult getChargingStationList(HttpServletRequest request,Long operatorId, Long userId, Integer type) {
|
||||
public AjaxResult getChargingStationList(HttpServletRequest request,String tenantId,Long operatorId, 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.getChargingStationList(operatorId, logOperatorId, 1,null));
|
||||
return AjaxResult.success(xhpcStatisticsServiceMapper.getChargingStationList(operatorId, logOperatorId, 1,tenantId));
|
||||
}else{
|
||||
//查询赋值的场站
|
||||
return AjaxResult.success(xhpcStatisticsServiceMapper.getChargingStationList(operatorId, sysUserId, 2,null));
|
||||
return AjaxResult.success(xhpcStatisticsServiceMapper.getChargingStationList(operatorId, sysUserId, 2,tenantId));
|
||||
}
|
||||
}else{
|
||||
return AjaxResult.success(xhpcStatisticsServiceMapper.getChargingStationList(operatorId, sysUserId, 0,null));
|
||||
return AjaxResult.success(xhpcStatisticsServiceMapper.getChargingStationList(operatorId, sysUserId, 0,tenantId));
|
||||
}
|
||||
}
|
||||
|
||||
@ -345,23 +358,22 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult getChargingPileList(HttpServletRequest request, Long chargingStationId, Long operatorId, Long userId, Integer type) {
|
||||
public AjaxResult getChargingPileList(HttpServletRequest request,String tenantId, Long chargingStationId, Long operatorId, 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.getChargingPileList(chargingStationId,operatorId, logOperatorId, 1,null));
|
||||
return AjaxResult.success(xhpcStatisticsServiceMapper.getChargingPileList(chargingStationId,operatorId, logOperatorId, 1,tenantId));
|
||||
}else{
|
||||
//查询赋值的场站
|
||||
return AjaxResult.success(xhpcStatisticsServiceMapper.getChargingPileList(chargingStationId,operatorId, sysUserId, 2,null));
|
||||
return AjaxResult.success(xhpcStatisticsServiceMapper.getChargingPileList(chargingStationId,operatorId, sysUserId, 2,tenantId));
|
||||
}
|
||||
}else{
|
||||
return AjaxResult.success(xhpcStatisticsServiceMapper.getChargingPileList(chargingStationId,operatorId, sysUserId, 0,null));
|
||||
return AjaxResult.success(xhpcStatisticsServiceMapper.getChargingPileList(chargingStationId,operatorId, sysUserId, 0,tenantId));
|
||||
}
|
||||
}
|
||||
|
||||
@ -375,21 +387,21 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati
|
||||
if(UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())){
|
||||
Long logOperatorId = sysUser.getOperatorId();
|
||||
//运营商看自己的场站
|
||||
if(tenantId !=null && "".equals(tenantId)){
|
||||
if(tenantId !=null && !"".equals(tenantId)){
|
||||
return AjaxResult.success(xhpcStatisticsServiceMapper.getOperatorList(operatorId, logOperatorId, 1,tenantId));
|
||||
}else{
|
||||
return AjaxResult.success(xhpcStatisticsServiceMapper.getOperatorList(operatorId, logOperatorId, 1,null));
|
||||
}
|
||||
}else{
|
||||
//查询赋值的场站
|
||||
if(tenantId !=null && "".equals(tenantId)){
|
||||
if(tenantId !=null && !"".equals(tenantId)){
|
||||
return AjaxResult.success(xhpcStatisticsServiceMapper.getOperatorList(operatorId, sysUserId, 2,tenantId));
|
||||
}else{
|
||||
return AjaxResult.success(xhpcStatisticsServiceMapper.getOperatorList(operatorId, sysUserId, 2,null));
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if(tenantId !=null && "".equals(tenantId)){
|
||||
if(tenantId !=null && !"".equals(tenantId)){
|
||||
return AjaxResult.success(xhpcStatisticsServiceMapper.getOperatorList(operatorId, sysUserId, 0,tenantId));
|
||||
}else{
|
||||
return AjaxResult.success(xhpcStatisticsServiceMapper.getOperatorList(operatorId, sysUserId, 0,null));
|
||||
@ -427,23 +439,22 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getTerminalList(HttpServletRequest request,Long chargingStationId, Long userId, Integer type) {
|
||||
public AjaxResult getTerminalList(HttpServletRequest request,String tenantId,Long operatorId,Long chargingStationId,Long chargingPileId, 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,null));
|
||||
return AjaxResult.success(xhpcStatisticsServiceMapper.getTerminalList(operatorId,chargingStationId,chargingPileId, logOperatorId, 1,tenantId));
|
||||
}else{
|
||||
//查询赋值的场站
|
||||
return AjaxResult.success(xhpcStatisticsServiceMapper.getTerminalList(chargingStationId, sysUserId, 2,null));
|
||||
return AjaxResult.success(xhpcStatisticsServiceMapper.getTerminalList(operatorId,chargingStationId,chargingPileId, sysUserId, 2,tenantId));
|
||||
}
|
||||
}else{
|
||||
return AjaxResult.success(xhpcStatisticsServiceMapper.getTerminalList(chargingStationId, sysUserId, 0,null));
|
||||
return AjaxResult.success(xhpcStatisticsServiceMapper.getTerminalList(operatorId,chargingStationId,chargingPileId, sysUserId, 0,tenantId));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -718,6 +718,15 @@
|
||||
) ut on ut.history_order_id = ho.history_order_id
|
||||
</if>
|
||||
where ho.status =0 and ho.del_flag=0
|
||||
<if test="chargingStationId !=null">
|
||||
and ho.charging_station_id=#{chargingStationId}
|
||||
</if>
|
||||
<if test="chargingPileId !=null">
|
||||
and ho.terminal_id in (select terminal_id from xhpc_terminal where charging_pile_id=#{chargingPileId} and del_flag=0)
|
||||
</if>
|
||||
<if test="terminalId !=null">
|
||||
and ho.terminal_id=#{terminalId}
|
||||
</if>
|
||||
<if test="confirmResult !=null">
|
||||
and ho.confirm_Result =#{confirmResult}
|
||||
</if>
|
||||
|
||||
@ -441,6 +441,15 @@
|
||||
and co.source =1
|
||||
and inu.internet_user_id=#{internetId}
|
||||
</if>
|
||||
<if test="chargingStationId!=null">
|
||||
and co.charging_station_id=#{chargingStationId}
|
||||
</if>
|
||||
<if test="chargingPileId!=null">
|
||||
and co.terminal_id in (select terminal_id from xhpc_terminal where charging_pile_id =#{chargingPileId} and del_flag =0)
|
||||
</if>
|
||||
<if test="terminalId!=null">
|
||||
and co.terminal_id=#{terminalId}
|
||||
</if>
|
||||
<if test="internetSerialNumber !=null and internetSerialNumber !=''">
|
||||
and co.source =1
|
||||
and inu.name like concat('%', #{internetSerialNumber}, '%')
|
||||
|
||||
@ -382,7 +382,7 @@
|
||||
name as stationName,
|
||||
charging_station_id as chargingStationId
|
||||
from xhpc_charging_station
|
||||
where 1=1
|
||||
where del_flag =0
|
||||
<if test="type==1">
|
||||
and charging_station_id in (select charging_station_id from xhpc_charging_station where operator_id=#{userId})
|
||||
</if>
|
||||
@ -403,7 +403,7 @@
|
||||
cp.charging_pile_id as chargingPileId
|
||||
from xhpc_charging_pile as cp
|
||||
left join xhpc_charging_station cs on cs.charging_station_id = cp.charging_station_id
|
||||
where 1=1
|
||||
where cp.del_flag =0
|
||||
<if test="type==1">
|
||||
and cp.charging_station_id in (select charging_station_id from xhpc_charging_station where operator_id=#{userId})
|
||||
</if>
|
||||
@ -424,7 +424,7 @@
|
||||
operator_id as operatorId,
|
||||
name as operatorName
|
||||
from xhpc_operator
|
||||
where 1=1
|
||||
where del_flag =0
|
||||
<if test="type==1">
|
||||
and operator_id in (select operator_id from xhpc_charging_station where operator_id=#{userId})
|
||||
</if>
|
||||
@ -442,7 +442,7 @@
|
||||
xt.tenant_name as tenantName
|
||||
from xhpc_operator as xo
|
||||
join xhpc_tenant as xt on xt.tenant_id = xo.tenant_id
|
||||
where 1=1
|
||||
where xt.is_deleted =0 and xo.del_flag =0
|
||||
<if test="type==1">
|
||||
and xo.operator_id=#{userId}
|
||||
</if>
|
||||
@ -473,9 +473,16 @@
|
||||
name as terminalName
|
||||
from xhpc_terminal
|
||||
where del_flag =0
|
||||
|
||||
<if test="chargingStationId!=null">
|
||||
and charging_station_id=#{chargingStationId}
|
||||
</if>
|
||||
<if test="chargingPileId!=null">
|
||||
and charging_pile_id=#{chargingPileId}
|
||||
</if>
|
||||
<if test="operatorId !=null">
|
||||
and charging_station_id in (select charging_station_id from xhpc_charging_station where operator_id=#{operatorId})
|
||||
</if>
|
||||
<if test="type==1">
|
||||
and charging_station_id in (select charging_station_id from xhpc_charging_station where operator_id=#{userId})
|
||||
</if>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user