修改分页
This commit is contained in:
parent
e2bdce5d6a
commit
3d9040c10c
@ -59,7 +59,19 @@ public class BaseController
|
||||
PageHelper.startPage(pageNum, pageSize, orderBy);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 设置请求分页数据
|
||||
*/
|
||||
protected void startPage(Integer pageNum,Integer pageSize)
|
||||
{
|
||||
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||
|
||||
if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize))
|
||||
{
|
||||
String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
|
||||
PageHelper.startPage(pageNum, pageSize, orderBy);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 响应请求分页数据
|
||||
*/
|
||||
|
||||
@ -0,0 +1,27 @@
|
||||
package com.xhpc.common.core.web.service;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.xhpc.common.core.utils.StringUtils;
|
||||
import com.xhpc.common.core.utils.sql.SqlUtil;
|
||||
import com.xhpc.common.core.web.page.PageDomain;
|
||||
import com.xhpc.common.core.web.page.TableSupport;
|
||||
|
||||
/**
|
||||
* @author yuyang
|
||||
* @date 2022/1/12 10:54
|
||||
*/
|
||||
public class BaseService {
|
||||
|
||||
protected void startPage()
|
||||
{
|
||||
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||
Integer pageNum = pageDomain.getPageNum();
|
||||
Integer pageSize = pageDomain.getPageSize();
|
||||
if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize))
|
||||
{
|
||||
String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
|
||||
PageHelper.startPage(pageNum, pageSize, orderBy);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -38,8 +38,6 @@ public class XhpcChargingPileController extends BaseController {
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(HttpServletRequest request,String name, Integer type, String serialNumber, Long chargingStationId) {
|
||||
|
||||
startPage();
|
||||
List<Map<String, Object>> list = xhpcChargingPileService.selectXhpcChargingPileList(request,name, type, serialNumber, chargingStationId);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ -71,7 +71,6 @@ public class XhpcChargingStationController extends BaseController {
|
||||
//@PreAuthorize(hasPermi = "system:station:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(HttpServletRequest request,String name, String operatorName) {
|
||||
startPage();
|
||||
List<Map<String, Object>> list = xhpcChargingStationService.selectXhpcChargingStationList(request,name, operatorName);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ -39,8 +39,6 @@ public class XhpcTerminalController extends BaseController {
|
||||
//@PreAuthorize(hasPermi = "system:station:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(HttpServletRequest request, String serialNumber, Integer type, Integer status, String workStatus, Long chargingStationId) {
|
||||
|
||||
startPage();
|
||||
List<Map<String, Object>> list = xhpcTerminalService.getXhpcTerminalList(request,serialNumber, type, status, workStatus, chargingStationId);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ -15,6 +15,7 @@ import com.xhpc.common.core.exception.CustomException;
|
||||
import com.xhpc.common.core.utils.SecurityUtils;
|
||||
import com.xhpc.common.core.utils.StringUtils;
|
||||
import com.xhpc.common.core.web.domain.AjaxResult;
|
||||
import com.xhpc.common.core.web.service.BaseService;
|
||||
import com.xhpc.common.domain.XhpcChargingPile;
|
||||
import com.xhpc.common.domain.XhpcChargingStation;
|
||||
import com.xhpc.common.domain.XhpcTerminal;
|
||||
@ -41,7 +42,7 @@ import static com.aliyun.oss.internal.OSSConstants.URL_ENCODING;
|
||||
* @date 2021/7/27 14:36
|
||||
*/
|
||||
@Service
|
||||
public class XhpcChargingPileServiceImpl implements IXhpcChargingPileService {
|
||||
public class XhpcChargingPileServiceImpl extends BaseService implements IXhpcChargingPileService{
|
||||
|
||||
@Autowired
|
||||
private XhpcChargingPileMapper xhpcChargingPileMapper;
|
||||
@ -92,6 +93,7 @@ public class XhpcChargingPileServiceImpl implements IXhpcChargingPileService {
|
||||
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);
|
||||
@ -101,10 +103,9 @@ public class XhpcChargingPileServiceImpl implements IXhpcChargingPileService {
|
||||
}
|
||||
}
|
||||
}else{
|
||||
startPage();
|
||||
list= xhpcChargingPileMapper.selectXhpcChargingPileList(name, type, serialNumber, chargingStationId,userId,0,tenantId);
|
||||
}
|
||||
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@ -12,6 +12,7 @@ import com.xhpc.common.core.domain.R;
|
||||
import com.xhpc.common.core.utils.DateUtils;
|
||||
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.XhpcChargingStation;
|
||||
import com.xhpc.common.domain.XhpcRate;
|
||||
@ -41,7 +42,7 @@ import java.util.regex.Pattern;
|
||||
* @date 2021-07-19
|
||||
*/
|
||||
@Service
|
||||
public class XhpcChargingStationServiceImpl implements IXhpcChargingStationService {
|
||||
public class XhpcChargingStationServiceImpl extends BaseService implements IXhpcChargingStationService {
|
||||
|
||||
@Autowired
|
||||
private XhpcChargingStationMapper xhpcChargingStationMapper;
|
||||
@ -133,6 +134,7 @@ public class XhpcChargingStationServiceImpl implements IXhpcChargingStationServi
|
||||
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());
|
||||
//运营商看自己的场站
|
||||
@ -144,6 +146,7 @@ public class XhpcChargingStationServiceImpl implements IXhpcChargingStationServi
|
||||
}
|
||||
}
|
||||
}else{
|
||||
startPage();
|
||||
list = xhpcChargingStationMapper.selectXhpcChargingStationList(name, operatorName,userId,0,tenantId);
|
||||
}
|
||||
|
||||
|
||||
@ -3,6 +3,7 @@ package com.xhpc.charging.station.service;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.xhpc.charging.station.mapper.XhpcTerminalMapper;
|
||||
import com.xhpc.common.core.web.domain.AjaxResult;
|
||||
import com.xhpc.common.core.web.service.BaseService;
|
||||
import com.xhpc.common.domain.XhpcTerminal;
|
||||
import com.xhpc.common.util.LogUserUtils;
|
||||
import com.xhpc.system.api.model.LoginUser;
|
||||
@ -19,7 +20,7 @@ import java.util.*;
|
||||
* @date 2021-07-20
|
||||
*/
|
||||
@Service
|
||||
public class XhpcTerminalServiceImpl implements IXhpcTerminalService {
|
||||
public class XhpcTerminalServiceImpl extends BaseService implements IXhpcTerminalService {
|
||||
|
||||
@Autowired
|
||||
private XhpcTerminalMapper xhpcTerminalMapper;
|
||||
@ -46,6 +47,7 @@ public class XhpcTerminalServiceImpl implements IXhpcTerminalService {
|
||||
@Override
|
||||
public List<Map<String, Object>> getXhpcTerminalList(HttpServletRequest request, String serialNumber, Integer type, Integer status, String workStatus, Long chargingStationId) {
|
||||
LoginUser logUser = logUserUtils.getLogUser(request);
|
||||
startPage();
|
||||
List<Map<String, Object>> list = xhpcTerminalMapper.getXhpcTerminalList(serialNumber, type, status, workStatus, chargingStationId,logUser.getTenantId());
|
||||
if(list !=null && list.size()>0){
|
||||
for (int i = 0; i <list.size() ; i++) {
|
||||
|
||||
@ -81,4 +81,12 @@ public class UserTypeUtil {
|
||||
* 退款订单审核-有
|
||||
*/
|
||||
public static final Integer REFUND_APPLICATION_ONE = 1;
|
||||
|
||||
|
||||
/**
|
||||
* 系统用户(00 平台管理员 01 运营上 03 子账户)
|
||||
*/
|
||||
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_THREE = "03";
|
||||
}
|
||||
|
||||
@ -54,7 +54,6 @@ public class XhpcChargeOrderController extends BaseController {
|
||||
@GetMapping("/getHistotyChargeOrderMessage")
|
||||
public AjaxResult getHistotyChargeOrderMessage(HttpServletRequest request)
|
||||
{
|
||||
|
||||
return iXhpcChargeOrderService.getHistotyChargeOrderMessage(request);
|
||||
}
|
||||
|
||||
@ -64,7 +63,6 @@ public class XhpcChargeOrderController extends BaseController {
|
||||
@GetMapping("/getHistotyChargeOrderStatusList")
|
||||
public TableDataInfo getHistotyChargeOrderStatusList(HttpServletRequest request)
|
||||
{
|
||||
startPage();
|
||||
List<Map<String, Object>> list = iXhpcChargeOrderService.getHistotyChargeOrderStatusList(request);
|
||||
return getDataTable(list);
|
||||
}
|
||||
@ -107,7 +105,6 @@ public class XhpcChargeOrderController extends BaseController {
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(HttpServletRequest request)
|
||||
{
|
||||
startPage();
|
||||
List<Map<String,Object>> list = xhpcHistoryOrderService.list(request);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ -55,16 +55,7 @@ public class XhpcPileOrderController extends BaseController {
|
||||
@Autowired
|
||||
private UserTypeService userTypeService;
|
||||
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(XhpcPileOrderController.class);
|
||||
/**
|
||||
* 测试
|
||||
*/
|
||||
@GetMapping("/test/chargeOrder/pileStartup")
|
||||
private R test(@RequestParam String orderNo, @RequestParam Integer status, @RequestParam String remark) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 桩启动回调接口
|
||||
|
||||
@ -82,7 +82,6 @@ public class XhpcHistoryOrderController extends BaseController {
|
||||
String affiliationOrganization,String evcsOrderNo,String plateNum,Integer internetId,String internetSerialNumber,String terminalName,String vinCode,String overStartTime,String overEndTime,Long personnelId)
|
||||
|
||||
{
|
||||
startPage();
|
||||
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);
|
||||
return getDataTable(listPage);
|
||||
}
|
||||
@ -426,14 +425,11 @@ public class XhpcHistoryOrderController extends BaseController {
|
||||
@GetMapping("/test")
|
||||
@Scheduled(cron = "0 0/2 * * * ?")
|
||||
public void test(){
|
||||
logger.info(">>>>>>>>>>>>>>>>>>>>>>>小时统计定时任务>>>>>>>>>>>>>>>>>>>>>");
|
||||
logger.info(">>>>>>>>>>>>>>>>>>>>>>>小时统计定时任务>>>>>>>>>>>>>>>>>>>>>");
|
||||
logger.info(">>>>>>>>>>>>>>>>>>>>>>>小时统计定时任务>>>>>>>>>>>>>>>>>>>>>");
|
||||
//小时统计
|
||||
List<XhpcChargeHistoryOrder> list = xhpcHistoryOrderService.getStatistisList(3000,0);
|
||||
if(list !=null && list.size()>0){
|
||||
for (XhpcChargeHistoryOrder xhpc:list) {
|
||||
|
||||
try{
|
||||
//开始时间、结束时间、模型id、状态、用户id、运营商、订单id、场站id、终端id、历史订单id、时间
|
||||
Date startTime = xhpc.getStartTime();
|
||||
@ -508,8 +504,6 @@ public class XhpcHistoryOrderController extends BaseController {
|
||||
@GetMapping("/test8")
|
||||
//@Scheduled(cron = "0 0/5 * * * ?")
|
||||
public void test8(){
|
||||
logger.info(">>>>>>>>>>>>>>>>>>>>>>>小时统计定时任务>>>>>>>>>>>>>>>>>>>>>");
|
||||
logger.info(">>>>>>>>>>>>>>>>>>>>>>>小时统计定时任务>>>>>>>>>>>>>>>>>>>>>");
|
||||
logger.info(">>>>>>>>>>>>>>>>>>>>>>>小时统计定时任务>>>>>>>>>>>>>>>>>>>>>");
|
||||
//获取500条待统计历史订单
|
||||
//跨时段,跨费率,计费模型
|
||||
|
||||
@ -66,7 +66,6 @@ public class XhpcHistoryOrderReconciliationStatusController extends BaseControll
|
||||
@GetMapping("/page")
|
||||
@ApiOperation(value = "流量用户对账分页列表")
|
||||
public TableDataInfo page(@RequestParam Long userId, String serialNumber, String createTimeStart, String createTimeEnd, String chargingStationName, String status) {
|
||||
startPage();
|
||||
List<Map<String, Object>> list = iXhpcHistoryOrderReconciliationStatusService.page(userId, serialNumber, createTimeStart, createTimeEnd, chargingStationName, status);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ -68,7 +68,6 @@ public class XhpcHistoryOrderSortingStatusController extends BaseController {
|
||||
@GetMapping("/page")
|
||||
@ApiOperation(value = "运营商清分分页列表")
|
||||
public TableDataInfo page(@RequestParam Long userId, String serialNumber, String createTimeStart, String createTimeEnd, String chargingStationName, String status) {
|
||||
startPage();
|
||||
List<Map<String, Object>> list = iXhpcHistoryOrderSortingStatusService.page(userId, serialNumber, createTimeStart, createTimeEnd, chargingStationName, status);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ -50,7 +50,6 @@ public class XhpcRealTimeOrderController extends BaseController {
|
||||
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,
|
||||
String affiliationOrganization,String plateNum,Integer internetId,String internetSerialNumber)
|
||||
{
|
||||
startPage();
|
||||
List<Map<String,Object>> list = xhpcRealTimeOrderService.list(phone, transactionNumber, source, chargingStationName,terminalName, operatorId, startTime, endTime,status,userId,type,affiliationOrganization,plateNum,internetId,internetSerialNumber);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ -44,7 +44,6 @@ public class XhpcStatisticsController extends BaseController {
|
||||
@GetMapping("/getTimeIntervalPage")
|
||||
public TableDataInfo getTimeIntervalPage(String chargingStationIds,Long internetUserId, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type)
|
||||
{
|
||||
startPage();
|
||||
List<Map<String, Object>> list = xhpcStatisticsService.getTimeIntervalPage(chargingStationIds,internetUserId,operatorId,startTime,endTime,userId,type);
|
||||
return getDataTable(list);
|
||||
}
|
||||
@ -63,7 +62,6 @@ public class XhpcStatisticsController extends BaseController {
|
||||
@GetMapping("/getDateIntervalPage")
|
||||
public TableDataInfo getDateIntervalPage(String chargingStationIds,Long internetUserId, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type)
|
||||
{
|
||||
startPage();
|
||||
List<Map<String, Object>> list = xhpcStatisticsService.getDateIntervalPage(chargingStationIds,internetUserId,operatorId,startTime,endTime,userId,type);
|
||||
return getDataTable(list);
|
||||
}
|
||||
@ -82,7 +80,6 @@ public class XhpcStatisticsController extends BaseController {
|
||||
@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)
|
||||
{
|
||||
startPage();
|
||||
List<Map<String, Object>> list = xhpcStatisticsService.getStationIntervalPage(chargingStationIds,operatorIds,internetUserId,operatorId,startTime,endTime,userId,type);
|
||||
return getDataTable(list);
|
||||
}
|
||||
@ -100,7 +97,6 @@ public class XhpcStatisticsController extends BaseController {
|
||||
@GetMapping("/getOperatorIntervalPage")
|
||||
public TableDataInfo getOperatorIntervalPage(String operatorIds, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type)
|
||||
{
|
||||
startPage();
|
||||
List<Map<String, Object>> list = xhpcStatisticsService.getOperatorIntervalPage(operatorIds,operatorId,startTime,endTime,userId,type);
|
||||
return getDataTable(list);
|
||||
}
|
||||
@ -138,7 +134,6 @@ public class XhpcStatisticsController extends BaseController {
|
||||
@GetMapping("/getTerminalIntervalPage")
|
||||
public TableDataInfo getTerminalIntervalPage(String chargingStationId,String terminalId,Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type)
|
||||
{
|
||||
startPage();
|
||||
List<Map<String, Object>> list = xhpcStatisticsService.getTerminalIntervalPage(chargingStationId,terminalId,operatorId,startTime,endTime,userId,type);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@ import com.xhpc.common.api.UserTypeService;
|
||||
import com.xhpc.common.core.domain.R;
|
||||
import com.xhpc.common.core.utils.StringUtils;
|
||||
import com.xhpc.common.core.web.domain.AjaxResult;
|
||||
import com.xhpc.common.core.web.service.BaseService;
|
||||
import com.xhpc.common.data.down.StartChargingData;
|
||||
import com.xhpc.common.data.redis.CacheRealtimeData;
|
||||
import com.xhpc.common.data.redis.StaticBeanUtil;
|
||||
@ -20,6 +21,7 @@ import com.xhpc.order.mapper.XhpcChargeOrderMapper;
|
||||
import com.xhpc.order.mapper.XhpcInternetUserMapper;
|
||||
import com.xhpc.order.service.IXhpcChargeOrderService;
|
||||
import com.xhpc.system.api.model.LoginUser;
|
||||
import org.bouncycastle.jcajce.provider.asymmetric.util.BaseAgreementSpi;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -40,7 +42,7 @@ import static com.xhpc.common.data.redis.StaticBeanUtil.genOrder;
|
||||
* @date 2021/8/4 9:54
|
||||
*/
|
||||
@Service
|
||||
public class XhpcChargeOrderServiceImpl implements IXhpcChargeOrderService {
|
||||
public class XhpcChargeOrderServiceImpl extends BaseService implements IXhpcChargeOrderService {
|
||||
|
||||
public static RedisService REDIS;
|
||||
|
||||
@ -87,6 +89,7 @@ public class XhpcChargeOrderServiceImpl implements IXhpcChargeOrderService {
|
||||
@Override
|
||||
public List<Map<String, Object>> getHistotyChargeOrderStatusList(HttpServletRequest request) {
|
||||
LoginUser loginUser = tokenService.getLoginUser(request);
|
||||
startPage();
|
||||
return xhpcChargeOrderMapper.getHistotyChargeOrderStatusList(loginUser.getUserid(),loginUser.getTenantId(),loginUser.getUserType());
|
||||
}
|
||||
|
||||
|
||||
@ -4,6 +4,7 @@ import com.xhpc.common.core.constant.HttpStatus;
|
||||
import com.xhpc.common.core.constant.StatusConstants;
|
||||
import com.xhpc.common.core.utils.StringUtils;
|
||||
import com.xhpc.common.core.web.domain.AjaxResult;
|
||||
import com.xhpc.common.core.web.service.BaseService;
|
||||
import com.xhpc.common.redis.service.RedisService;
|
||||
import com.xhpc.order.domain.XhpcHistoryOrder;
|
||||
import com.xhpc.order.domain.XhpcHistoryOrderReconciliationStatus;
|
||||
@ -23,7 +24,7 @@ import java.util.Map;
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Service
|
||||
public class XhpcHistoryOrderReconciliationStatusServiceImpl implements IXhpcHistoryOrderReconciliationStatusService {
|
||||
public class XhpcHistoryOrderReconciliationStatusServiceImpl extends BaseService implements IXhpcHistoryOrderReconciliationStatusService {
|
||||
|
||||
@Autowired
|
||||
private XhpcHistoryOrderReconciliationStatusMapper xhpcHistoryOrderReconciliationStatusMapper;
|
||||
@ -126,6 +127,7 @@ public class XhpcHistoryOrderReconciliationStatusServiceImpl implements IXhpcHis
|
||||
if (StringUtils.isNotNull(map)) {
|
||||
String privilege = StringUtils.valueOf(map.get("privilege"));
|
||||
if (StringUtils.isNotEmpty(privilege)) {
|
||||
startPage();
|
||||
if (StatusConstants.OPERATION_POWER_TYPE == Integer.parseInt(privilege)) {
|
||||
String operatorId = StringUtils.valueOf(map.get("operatorId"));
|
||||
return xhpcHistoryOrderReconciliationStatusMapper.page(userId, serialNumber, createTimeStart, createTimeEnd, chargingStationName, status, operatorId, null);
|
||||
@ -134,6 +136,7 @@ public class XhpcHistoryOrderReconciliationStatusServiceImpl implements IXhpcHis
|
||||
}
|
||||
}
|
||||
}
|
||||
startPage();
|
||||
return xhpcHistoryOrderReconciliationStatusMapper.page(userId, serialNumber, createTimeStart, createTimeEnd, chargingStationName, status, null, null);
|
||||
}
|
||||
|
||||
|
||||
@ -12,6 +12,7 @@ import com.xhpc.common.api.UserTypeService;
|
||||
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.CacheRealtimeData;
|
||||
import com.xhpc.common.redis.service.RedisService;
|
||||
import com.xhpc.common.security.service.TokenService;
|
||||
@ -47,7 +48,7 @@ import java.util.concurrent.Executors;
|
||||
* @date 2021/8/3 21:23
|
||||
*/
|
||||
@Service
|
||||
public class XhpcHistoryOrderServiceImpl implements IXhpcHistoryOrderService {
|
||||
public class XhpcHistoryOrderServiceImpl extends BaseService implements IXhpcHistoryOrderService {
|
||||
|
||||
@Resource
|
||||
private XhpcHistoryOrderMapper xhpcHistoryOrderMapper;
|
||||
@ -87,6 +88,7 @@ public class XhpcHistoryOrderServiceImpl implements IXhpcHistoryOrderService {
|
||||
if(user !=null && user.getData() !=null){
|
||||
Map<String, Object> userMessage = (Map<String, Object>)user.getData();
|
||||
if (userMessage == null) {
|
||||
startPage();
|
||||
return xhpcHistoryOrderMapper.list(userid,userType,tenantId);
|
||||
}
|
||||
}
|
||||
@ -134,6 +136,7 @@ public class XhpcHistoryOrderServiceImpl implements IXhpcHistoryOrderService {
|
||||
Map<String, Object> landUser = xhpcHistoryOrderMapper.getLandUser(logUserId);
|
||||
if (landUser != null) {
|
||||
if (landUser.get("userType") != null) {
|
||||
startPage();
|
||||
if ("01".equals(landUser.get("userType").toString())) {
|
||||
Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString());
|
||||
//运营商看自己的场站
|
||||
@ -146,6 +149,7 @@ public class XhpcHistoryOrderServiceImpl implements IXhpcHistoryOrderService {
|
||||
}
|
||||
|
||||
} 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);
|
||||
}
|
||||
return list;
|
||||
|
||||
@ -4,6 +4,7 @@ import com.xhpc.common.core.constant.HttpStatus;
|
||||
import com.xhpc.common.core.constant.StatusConstants;
|
||||
import com.xhpc.common.core.utils.StringUtils;
|
||||
import com.xhpc.common.core.web.domain.AjaxResult;
|
||||
import com.xhpc.common.core.web.service.BaseService;
|
||||
import com.xhpc.common.redis.service.RedisService;
|
||||
import com.xhpc.order.domain.XhpcHistoryOrder;
|
||||
import com.xhpc.order.domain.XhpcHistoryOrderSortingStatus;
|
||||
@ -23,7 +24,7 @@ import java.util.Map;
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Service
|
||||
public class XhpcHistoryOrderSortingStatusServiceImpl implements IXhpcHistoryOrderSortingStatusService {
|
||||
public class XhpcHistoryOrderSortingStatusServiceImpl extends BaseService implements IXhpcHistoryOrderSortingStatusService {
|
||||
|
||||
@Autowired
|
||||
private XhpcHistoryOrderSortingStatusMapper xhpcHistoryOrderSortingStatusMapper;
|
||||
@ -127,6 +128,7 @@ public class XhpcHistoryOrderSortingStatusServiceImpl implements IXhpcHistoryOrd
|
||||
if (StringUtils.isNotNull(map)) {
|
||||
String privilege = StringUtils.valueOf(map.get("privilege"));
|
||||
if (StringUtils.isNotEmpty(privilege)) {
|
||||
startPage();
|
||||
if (StatusConstants.OPERATION_POWER_TYPE == Integer.parseInt(privilege)) {
|
||||
String operatorId = StringUtils.valueOf(map.get("operatorId"));
|
||||
return xhpcHistoryOrderSortingStatusMapper.page(userId, serialNumber, createTimeStart, createTimeEnd, chargingStationName, status, operatorId, null);
|
||||
@ -135,6 +137,7 @@ public class XhpcHistoryOrderSortingStatusServiceImpl implements IXhpcHistoryOrd
|
||||
}
|
||||
}
|
||||
}
|
||||
startPage();
|
||||
return xhpcHistoryOrderSortingStatusMapper.page(userId, serialNumber, createTimeStart, createTimeEnd, chargingStationName, status, null, null);
|
||||
}
|
||||
|
||||
|
||||
@ -7,6 +7,7 @@ import com.xhpc.common.api.RefundOrderService;
|
||||
import com.xhpc.common.api.SmsService;
|
||||
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.CacheOrderData;
|
||||
import com.xhpc.common.data.redis.CacheRealtimeData;
|
||||
import com.xhpc.common.redis.service.RedisService;
|
||||
@ -33,7 +34,7 @@ import java.util.concurrent.Executors;
|
||||
* @date 2021/8/7 15:07
|
||||
*/
|
||||
@Service
|
||||
public class XhpcRealTimeOrderServiceImpl implements IXhpcRealTimeOrderService {
|
||||
public class XhpcRealTimeOrderServiceImpl extends BaseService implements IXhpcRealTimeOrderService {
|
||||
|
||||
@Autowired
|
||||
private XhpcRealTimeOrderMapper xhpcRealTimeOrderMapper;
|
||||
@ -84,6 +85,7 @@ public class XhpcRealTimeOrderServiceImpl implements IXhpcRealTimeOrderService {
|
||||
if(logUserId !=1) {
|
||||
Map<String, Object> landUser = xhpcHistoryOrderService.getLandUser(logUserId);
|
||||
if(landUser !=null){
|
||||
startPage();
|
||||
if(landUser.get("userType") !=null){
|
||||
if("01".equals(landUser.get("userType").toString())){
|
||||
Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString());
|
||||
@ -96,6 +98,7 @@ public class XhpcRealTimeOrderServiceImpl implements IXhpcRealTimeOrderService {
|
||||
}
|
||||
}
|
||||
}else{
|
||||
startPage();
|
||||
list = xhpcRealTimeOrderMapper.list(phone,transactionNumber,source,chargingStationName,terminalName,operatorId,startTime,endTime,number,status,logUserId,0,affiliationOrganization,plateNum,internetId,internetSerialNumber);
|
||||
}
|
||||
|
||||
|
||||
@ -7,6 +7,7 @@ import cn.hutool.poi.excel.ExcelUtil;
|
||||
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.order.domain.XhpcStatisticsStation;
|
||||
import com.xhpc.order.domain.XhpcStatisticsTimeInterval;
|
||||
import com.xhpc.order.mapper.XhpcStatisticsServiceMapper;
|
||||
@ -28,7 +29,7 @@ import java.util.*;
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Service
|
||||
public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService {
|
||||
public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStatisticsService {
|
||||
|
||||
@Autowired
|
||||
private XhpcStatisticsServiceMapper xhpcStatisticsServiceMapper;
|
||||
@ -49,6 +50,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService {
|
||||
if(logUserId !=1){
|
||||
Map<String, Object> landUser = xhpcHistoryOrderService.getLandUser(logUserId);
|
||||
if(landUser !=null){
|
||||
startPage();
|
||||
if(landUser.get("userType") !=null){
|
||||
if("01".equals(landUser.get("userType").toString()) || "03".equals(landUser.get("userType").toString())){
|
||||
Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString());
|
||||
@ -61,6 +63,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService {
|
||||
}
|
||||
}
|
||||
}else{
|
||||
startPage();
|
||||
list =xhpcStatisticsServiceMapper.getTimeIntervalPage(chargingStationId, internetUserId, operatorId, startTime, endTime, 0,logUserId);
|
||||
}
|
||||
List<Map<String, Object>> page =new ArrayList<>();
|
||||
@ -171,6 +174,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService {
|
||||
if(logUserId !=1){
|
||||
Map<String, Object> landUser = xhpcHistoryOrderService.getLandUser(logUserId);
|
||||
if(landUser !=null){
|
||||
startPage();
|
||||
if(landUser.get("userType") !=null){
|
||||
if("01".equals(landUser.get("userType").toString())){
|
||||
Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString());
|
||||
@ -183,6 +187,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService {
|
||||
}
|
||||
}
|
||||
}else{
|
||||
startPage();
|
||||
list =xhpcStatisticsServiceMapper.getDateIntervalPage(chargingStationId, internetUserId, operatorId, startTime, endTime, 0,logUserId);
|
||||
}
|
||||
|
||||
@ -209,6 +214,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService {
|
||||
if(logUserId !=1){
|
||||
Map<String, Object> landUser = xhpcHistoryOrderService.getLandUser(logUserId);
|
||||
if(landUser !=null){
|
||||
startPage();
|
||||
if(landUser.get("userType") !=null){
|
||||
if("01".equals(landUser.get("userType").toString()) || "03".equals(landUser.get("userType").toString())){
|
||||
Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString());
|
||||
@ -221,6 +227,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService {
|
||||
}
|
||||
}
|
||||
}else{
|
||||
startPage();
|
||||
list =xhpcStatisticsServiceMapper.getStationIntervalPage(chargingStationId,operatorUserId,internetUserId,operatorId,startTime,endTime,0,logUserId);
|
||||
}
|
||||
|
||||
@ -244,6 +251,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService {
|
||||
if(logUserId !=1){
|
||||
Map<String, Object> landUser = xhpcHistoryOrderService.getLandUser(logUserId);
|
||||
if(landUser !=null){
|
||||
startPage();
|
||||
if(landUser.get("userType") !=null){
|
||||
if("01".equals(landUser.get("userType").toString()) || "03".equals(landUser.get("userType").toString())){
|
||||
Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString());
|
||||
@ -256,6 +264,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService {
|
||||
}
|
||||
}
|
||||
}else{
|
||||
startPage();
|
||||
list =xhpcStatisticsServiceMapper.getOperatorIntervalPage(operatorUserId, operatorId, startTime, endTime, 0,logUserId);
|
||||
}
|
||||
|
||||
@ -286,6 +295,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService {
|
||||
if(logUserId !=1){
|
||||
Map<String, Object> landUser = xhpcHistoryOrderService.getLandUser(logUserId);
|
||||
if(landUser !=null){
|
||||
startPage();
|
||||
if(landUser.get("userType") !=null){
|
||||
if("01".equals(landUser.get("userType").toString())){
|
||||
Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString());
|
||||
@ -298,6 +308,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService {
|
||||
}
|
||||
}
|
||||
}else{
|
||||
startPage();
|
||||
list =xhpcStatisticsServiceMapper.getTerminalIntervalPage(chargingStationId, terminalId, operatorId, startTime, endTime, 0,logUserId);
|
||||
}
|
||||
|
||||
|
||||
@ -228,6 +228,7 @@ public class XhpcRefundAuditController extends BaseController {
|
||||
//@PreAuthorize(hasPermi = "refund:audit:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo page(@RequestParam Long refundOrderId) {
|
||||
startPage();
|
||||
List<Map<String, Object>> list = iXhpcRefundAuditService.list(refundOrderId);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ -32,7 +32,6 @@ public class XhpcUserAccountStatementController extends BaseController {
|
||||
@ApiOperation(value = "用户流水分页列表")
|
||||
@GetMapping("/page")
|
||||
public TableDataInfo page(HttpServletRequest request) {
|
||||
startPage();
|
||||
List<Map<String, Object>> list = iXhpcUserAccountStatementService.page(request);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ import com.xhpc.common.api.UserTypeService;
|
||||
import com.xhpc.common.core.constant.StatusConstants;
|
||||
import com.xhpc.common.core.domain.R;
|
||||
import com.xhpc.common.core.utils.StringUtils;
|
||||
import com.xhpc.common.core.web.service.BaseService;
|
||||
import com.xhpc.common.security.service.TokenService;
|
||||
import com.xhpc.payment.domain.XhpcUserAccountStatement;
|
||||
import com.xhpc.payment.mapper.XhpcUserAccountStatementMapper;
|
||||
@ -26,7 +27,7 @@ import java.util.Map;
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Service
|
||||
public class XhpcUserAccountStatementServiceImpl implements IXhpcUserAccountStatementService {
|
||||
public class XhpcUserAccountStatementServiceImpl extends BaseService implements IXhpcUserAccountStatementService {
|
||||
|
||||
@Autowired
|
||||
private XhpcUserAccountStatementMapper xhpcUserAccountStatementMapper;
|
||||
@ -64,6 +65,7 @@ public class XhpcUserAccountStatementServiceImpl implements IXhpcUserAccountStat
|
||||
if(user !=null && user.getData() !=null){
|
||||
Map<String, Object> userMessage = (Map<String, Object>)user.getData();
|
||||
if (userMessage == null) {
|
||||
startPage();
|
||||
return xhpcUserAccountStatementMapper.page(userid,userType,tenantId);
|
||||
}
|
||||
}
|
||||
|
||||
@ -73,7 +73,6 @@ public class XhpcAppUserController extends BaseController {
|
||||
//@PreAuthorize(hasPermi = "app:user:page")
|
||||
@GetMapping("/page")
|
||||
public TableDataInfo page(HttpServletRequest request,String phone) {
|
||||
startPage();
|
||||
List<Map<String, Object>> list = iXhpcAppUserUserService.selectAppUserList(request,phone);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ -11,6 +11,7 @@ import com.xhpc.user.service.IXhpcCommunityService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -29,9 +30,8 @@ public class XhpcCommunityController extends BaseController {
|
||||
* 社区组树列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(String name) {
|
||||
startPage();
|
||||
List<Map<String, Object>> list = xhpcCommunityService.list(name);
|
||||
public TableDataInfo list(HttpServletRequest request, String name) {
|
||||
List<Map<String, Object>> list = xhpcCommunityService.list(request,name);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
@ -29,9 +29,8 @@ public class XhpcCustomersController extends BaseController {
|
||||
* 大客户组树列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(String name) {
|
||||
startPage();
|
||||
List<Map<String, Object>> list = xhpcCustomersService.list(name);
|
||||
public TableDataInfo list(HttpServletRequest request,String name) {
|
||||
List<Map<String, Object>> list = xhpcCustomersService.list(request,name);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
@ -173,6 +173,7 @@ public class XhpcInternetUserController extends BaseController {
|
||||
//@PreAuthorize(hasPermi = "user:internet:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(String name) {
|
||||
startPage();
|
||||
List<Map<String, Object>> list = iXhpcInternetUserService.list(name);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ -49,6 +49,7 @@ public class XhpcOperatorInternetBlacklistController extends BaseController {
|
||||
//@PreAuthorize(hasPermi = "operator:internet:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(@RequestParam String operatorId) {
|
||||
startPage();
|
||||
List<Map<String, Object>> list = xhpcOperatorInternetBlacklistService.list(operatorId);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ -59,16 +59,15 @@ public class XhpcStationInternetBlacklistController extends BaseController {
|
||||
//@PreAuthorize(hasPermi = "station:internet:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(@RequestParam String internetUserId) {
|
||||
startPage();
|
||||
List<Map<String, Object>> list = iXhpcStationInternetBlacklistService.list(internetUserId);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@GetMapping("/list1")
|
||||
public TableDataInfo list1(@RequestParam String internetUserId) {
|
||||
startPage();
|
||||
List<Map<String, Object>> list = iXhpcStationInternetBlacklistService.list(internetUserId);
|
||||
|
||||
|
||||
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
@ -115,7 +115,6 @@ public class XhpcUserController extends BaseController {
|
||||
//@PreAuthorize(hasPermi = "user:operator:page")
|
||||
@GetMapping("/operator/page")
|
||||
public TableDataInfo operatorPage(String userName, String nickName, Long operatorId) {
|
||||
startPage();
|
||||
List<Map<String, Object>> list = iXhpcUserService.selectOperatorUserList(userName, nickName, operatorId);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@ public interface XhpcCommunityMapper {
|
||||
* @param name 桩名称
|
||||
* @return
|
||||
*/
|
||||
List<Map<String, Object>> list(@Param("name") String name);
|
||||
List<Map<String, Object>> list(@Param("name") String name,@Param("tenantId") String tenantId);
|
||||
|
||||
/**
|
||||
* 添加社区组
|
||||
|
||||
@ -25,7 +25,7 @@ public interface XhpcCustomersMapper {
|
||||
* @param name 桩名称
|
||||
* @return
|
||||
*/
|
||||
List<Map<String, Object>> list(@Param("name") String name,@Param("operatorId") Long operatorId);
|
||||
List<Map<String, Object>> list(@Param("name") String name,@Param("operatorId") Long operatorId,@Param("tenantId") String tenantId);
|
||||
|
||||
/**
|
||||
* 查询大客户组
|
||||
|
||||
@ -5,6 +5,7 @@ import com.xhpc.common.domain.XhpcChargingPile;
|
||||
import com.xhpc.user.domain.XhpcCommunity;
|
||||
import com.xhpc.user.domain.XhpcCommunityPersonnel;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -21,7 +22,7 @@ public interface IXhpcCommunityService {
|
||||
* @param name 桩名称
|
||||
* @return
|
||||
*/
|
||||
List<Map<String, Object>> list(String name);
|
||||
List<Map<String, Object>> list(HttpServletRequest request, String name);
|
||||
|
||||
/**
|
||||
* 新增社区组树
|
||||
|
||||
@ -21,7 +21,7 @@ public interface IXhpcCustomersService {
|
||||
* @param name 桩名称
|
||||
* @return
|
||||
*/
|
||||
List<Map<String, Object>> list(String name);
|
||||
List<Map<String, Object>> list(HttpServletRequest request,String name);
|
||||
|
||||
/**
|
||||
* 新增大客户组树
|
||||
|
||||
@ -11,6 +11,7 @@ import com.xhpc.common.core.enums.UserStatus;
|
||||
import com.xhpc.common.core.utils.SecurityUtils;
|
||||
import com.xhpc.common.core.utils.StringUtils;
|
||||
import com.xhpc.common.core.web.domain.AjaxResult;
|
||||
import com.xhpc.common.core.web.service.BaseService;
|
||||
import com.xhpc.common.redis.service.RedisService;
|
||||
import com.xhpc.common.security.service.TokenService;
|
||||
import com.xhpc.common.util.UserTypeUtil;
|
||||
@ -37,7 +38,7 @@ import java.util.Map;
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Service
|
||||
public class XhpcAppUserServiceImpl implements IXhpcAppUserUserService {
|
||||
public class XhpcAppUserServiceImpl extends BaseService implements IXhpcAppUserUserService {
|
||||
|
||||
@Autowired
|
||||
private XhpcAppUserMapper xhpcAppUserMapper;
|
||||
@ -88,7 +89,7 @@ public class XhpcAppUserServiceImpl implements IXhpcAppUserUserService {
|
||||
@Override
|
||||
public List<Map<String, Object>> selectAppUserList(HttpServletRequest request,String phone) {
|
||||
LoginUser logUser = logUserUtils.getLogUser(request);
|
||||
|
||||
startPage();
|
||||
return xhpcAppUserMapper.selectAppUserList(phone,logUser.getTenantId());
|
||||
}
|
||||
|
||||
|
||||
@ -1,8 +1,12 @@
|
||||
package com.xhpc.user.service.impl;
|
||||
|
||||
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.security.service.TokenService;
|
||||
import com.xhpc.common.util.UserTypeUtil;
|
||||
import com.xhpc.system.api.model.LoginUser;
|
||||
import com.xhpc.user.domain.XhpcCommunity;
|
||||
import com.xhpc.user.domain.XhpcCommunityPersonnel;
|
||||
import com.xhpc.user.mapper.XhpcCommunityMapper;
|
||||
@ -12,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@ -23,23 +28,25 @@ import java.util.Map;
|
||||
* @date 2021/12/20 9:59
|
||||
*/
|
||||
@Service
|
||||
public class XhpcCommunityServiceImpl implements IXhpcCommunityService {
|
||||
public class XhpcCommunityServiceImpl extends BaseService implements IXhpcCommunityService {
|
||||
|
||||
@Autowired
|
||||
private XhpcCommunityMapper xhpcCommunityMapper;
|
||||
@Autowired
|
||||
private IMechanismService mechanismService;
|
||||
@Autowired
|
||||
private TokenService tokenService;
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> list(String name) {
|
||||
public List<Map<String, Object>> list(HttpServletRequest request, String name) {
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
List<Map<String, Object>> list =new ArrayList<>();
|
||||
LoginUser loginUser = tokenService.getLoginUser(request);
|
||||
if(userId !=null){
|
||||
Map<String, Object> landUser = xhpcCommunityMapper.getLandUser(userId);
|
||||
if(landUser !=null && landUser.get("userType") !=null){
|
||||
if("00".equals(landUser.get("userType").toString())){
|
||||
list = xhpcCommunityMapper.list(name);
|
||||
}
|
||||
startPage();
|
||||
String userType = loginUser.getSysUser().getUserType();
|
||||
if(UserTypeUtil.SYS_USER_TYPE_ZERO.equals(userType)){
|
||||
list = xhpcCommunityMapper.list(name,loginUser.getTenantId());
|
||||
}
|
||||
}
|
||||
return list;
|
||||
@ -48,9 +55,9 @@ public class XhpcCommunityServiceImpl implements IXhpcCommunityService {
|
||||
@Override
|
||||
public AjaxResult addCommunity(XhpcCommunity xhpcCommunity) {
|
||||
|
||||
boolean judge = judgeXhpcCommunity(xhpcCommunity);
|
||||
if(!judge){
|
||||
return AjaxResult.error("参数必填");
|
||||
R r= judgeXhpcCommunity(xhpcCommunity);
|
||||
if(r.getCode() !=200){
|
||||
return AjaxResult.error(r.getMsg());
|
||||
}
|
||||
//名称重复不能入库
|
||||
Map<String, Object> communityById = xhpcCommunityMapper.getCommunityById(null, xhpcCommunity.getName(), null);
|
||||
@ -89,9 +96,9 @@ public class XhpcCommunityServiceImpl implements IXhpcCommunityService {
|
||||
@Override
|
||||
public AjaxResult updateCommunity(XhpcCommunity xhpcCommunity) {
|
||||
|
||||
boolean judge = judgeXhpcCommunity(xhpcCommunity);
|
||||
if(!judge){
|
||||
return AjaxResult.error("参数必填");
|
||||
R r = judgeXhpcCommunity(xhpcCommunity);
|
||||
if(r.getCode()!=200){
|
||||
return AjaxResult.error(r.getMsg());
|
||||
}
|
||||
//名称重复不能入库
|
||||
Map<String, Object> communityById = xhpcCommunityMapper.getCommunityById(xhpcCommunity.getCommunityId(), xhpcCommunity.getName(), 2);
|
||||
@ -127,9 +134,9 @@ public class XhpcCommunityServiceImpl implements IXhpcCommunityService {
|
||||
@Override
|
||||
@Transactional
|
||||
public AjaxResult addCommunityPersonnel(XhpcCommunityPersonnel xhpcCommunityPersonnel) {
|
||||
boolean judge = judgeXhpcCommunityPersonnel(xhpcCommunityPersonnel);
|
||||
if(!judge){
|
||||
return AjaxResult.error("参数必填");
|
||||
R r = judgeXhpcCommunityPersonnel(xhpcCommunityPersonnel);
|
||||
if(r.getCode()!=200){
|
||||
return AjaxResult.error(r.getMsg());
|
||||
}
|
||||
String phone = xhpcCommunityPersonnel.getPhone();
|
||||
String account = xhpcCommunityPersonnel.getAccount();
|
||||
@ -162,9 +169,9 @@ public class XhpcCommunityServiceImpl implements IXhpcCommunityService {
|
||||
|
||||
@Override
|
||||
public AjaxResult updateCommunityPersonnel(XhpcCommunityPersonnel xhpcCommunityPersonnel) {
|
||||
boolean judge = judgeXhpcCommunityPersonnel(xhpcCommunityPersonnel);
|
||||
if(!judge){
|
||||
return AjaxResult.error("参数必填");
|
||||
R r = judgeXhpcCommunityPersonnel(xhpcCommunityPersonnel);
|
||||
if(r.getCode()!=200){
|
||||
return AjaxResult.error(r.getMsg());
|
||||
}
|
||||
Long communityPersonnelId = xhpcCommunityPersonnel.getCommunityPersonnelId();
|
||||
String phone = xhpcCommunityPersonnel.getPhone();
|
||||
@ -235,36 +242,36 @@ public class XhpcCommunityServiceImpl implements IXhpcCommunityService {
|
||||
return AjaxResult.error("充值金额必需大于0");
|
||||
}
|
||||
|
||||
public boolean judgeXhpcCommunity(XhpcCommunity xhpcCommunity){
|
||||
public R judgeXhpcCommunity(XhpcCommunity xhpcCommunity){
|
||||
|
||||
if(xhpcCommunity.getName()==null || "".equals(xhpcCommunity.getName())){
|
||||
return false;
|
||||
return R.fail("名称必填");
|
||||
}
|
||||
if(xhpcCommunity.getContactName()==null || "".equals(xhpcCommunity.getContactName())){
|
||||
return false;
|
||||
return R.fail("联系人必填");
|
||||
}
|
||||
if(xhpcCommunity.getContactPhone()==null || "".equals(xhpcCommunity.getContactPhone())){
|
||||
return false;
|
||||
return R.fail("联系人电话必填");
|
||||
}
|
||||
if(xhpcCommunity.getAddress()==null || "".equals(xhpcCommunity.getAddress())){
|
||||
return false;
|
||||
return R.fail("地址必填");
|
||||
}
|
||||
return true;
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
public boolean judgeXhpcCommunityPersonnel(XhpcCommunityPersonnel xhpcCommunityPersonnel){
|
||||
public R judgeXhpcCommunityPersonnel(XhpcCommunityPersonnel xhpcCommunityPersonnel){
|
||||
|
||||
if(xhpcCommunityPersonnel.getName()==null || "".equals(xhpcCommunityPersonnel.getName())){
|
||||
return false;
|
||||
return R.fail("名称必填");
|
||||
}
|
||||
if(xhpcCommunityPersonnel.getAccount()==null || "".equals(xhpcCommunityPersonnel.getAccount()) || !"ST".equals(xhpcCommunityPersonnel.getAccount().substring(0,2))){
|
||||
return false;
|
||||
return R.fail("账号必填且ST开头10位");
|
||||
}
|
||||
if(xhpcCommunityPersonnel.getPhone()==null || "".equals(xhpcCommunityPersonnel.getPhone()) || xhpcCommunityPersonnel.getPhone().length()!=11){
|
||||
return false;
|
||||
return R.fail("绑定手机号必填");
|
||||
}
|
||||
|
||||
return true;
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
package com.xhpc.user.service.impl;
|
||||
|
||||
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.security.service.TokenService;
|
||||
import com.xhpc.common.util.UserTypeUtil;
|
||||
import com.xhpc.system.api.model.LoginUser;
|
||||
@ -27,7 +29,7 @@ import java.util.Map;
|
||||
* @date 2021/12/23 15:53
|
||||
*/
|
||||
@Service
|
||||
public class XhpcCustomersServiceImpl implements IXhpcCustomersService {
|
||||
public class XhpcCustomersServiceImpl extends BaseService implements IXhpcCustomersService {
|
||||
|
||||
@Autowired
|
||||
private XhpcCustomersMapper xhpcCustomersMapper;
|
||||
@ -36,27 +38,24 @@ public class XhpcCustomersServiceImpl implements IXhpcCustomersService {
|
||||
@Autowired
|
||||
private TokenService tokenService;
|
||||
@Override
|
||||
public List<Map<String, Object>> list(String name) {
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
public List<Map<String, Object>> list(HttpServletRequest request,String name) {
|
||||
List<Map<String, Object>> list =new ArrayList<>();
|
||||
if(userId !=null){
|
||||
Map<String, Object> landUser = xhpcCustomersMapper.getLandUser(userId);
|
||||
if(landUser !=null && landUser.get("userType") !=null){
|
||||
if("00".equals(landUser.get("userType").toString()) ){
|
||||
list = xhpcCustomersMapper.list(name,null);
|
||||
LoginUser loginUser = tokenService.getLoginUser(request);
|
||||
startPage();
|
||||
String userType = loginUser.getSysUser().getUserType();
|
||||
if(UserTypeUtil.SYS_USER_TYPE_ZERO.equals(userType)){
|
||||
list = xhpcCustomersMapper.list(name,null,loginUser.getTenantId());
|
||||
}else{
|
||||
list = xhpcCustomersMapper.list(name,Long.parseLong(landUser.get("operatorId").toString()));
|
||||
}
|
||||
}
|
||||
list = xhpcCustomersMapper.list(name,loginUser.getSysUser().getOperatorId(),loginUser.getTenantId());
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult addCustomers(HttpServletRequest request, XhpcCustomers xhpcCustomers) {
|
||||
boolean b = judgeXhpcCustomers(xhpcCustomers);
|
||||
if(!b){
|
||||
return AjaxResult.error("参数比传");
|
||||
R r = judgeXhpcCustomers(xhpcCustomers);
|
||||
if(r.getCode()!=200){
|
||||
return AjaxResult.error(r.getMsg());
|
||||
}
|
||||
//名称重复不能入库
|
||||
Map<String, Object> communityById = xhpcCustomersMapper.getCustomersById(null, xhpcCustomers.getName(), null);
|
||||
@ -113,9 +112,9 @@ public class XhpcCustomersServiceImpl implements IXhpcCustomersService {
|
||||
|
||||
@Override
|
||||
public AjaxResult updateCustomers(XhpcCustomers xhpcCustomers) {
|
||||
boolean b = judgeXhpcCustomers(xhpcCustomers);
|
||||
if(!b){
|
||||
return AjaxResult.error("参数比传");
|
||||
R r = judgeXhpcCustomers(xhpcCustomers);
|
||||
if(r.getCode()!=200){
|
||||
return AjaxResult.error(r.getMsg());
|
||||
}
|
||||
//名称重复不能入库
|
||||
Map<String, Object> customersById = xhpcCustomersMapper.getCustomersById(xhpcCustomers.getCustomersId(), xhpcCustomers.getName(), 2);
|
||||
@ -143,9 +142,9 @@ public class XhpcCustomersServiceImpl implements IXhpcCustomersService {
|
||||
|
||||
@Override
|
||||
public AjaxResult addCustomersPersonnel(XhpcCustomersPersonnel xhpcCustomersPersonnel) {
|
||||
boolean b = judgeXhpcCustomersPersonnel(xhpcCustomersPersonnel);
|
||||
if(b){
|
||||
return AjaxResult.error("参数比传");
|
||||
R r = judgeXhpcCustomersPersonnel(xhpcCustomersPersonnel);
|
||||
if(r.getCode()!=200){
|
||||
return AjaxResult.error(r.getMsg());
|
||||
}
|
||||
String phone = xhpcCustomersPersonnel.getPhone();
|
||||
String account = xhpcCustomersPersonnel.getAccount();
|
||||
@ -182,9 +181,9 @@ public class XhpcCustomersServiceImpl implements IXhpcCustomersService {
|
||||
|
||||
@Override
|
||||
public AjaxResult updateCustomersPersonnel(XhpcCustomersPersonnel xhpcCustomersPersonnel) {
|
||||
boolean b = judgeXhpcCustomersPersonnel(xhpcCustomersPersonnel);
|
||||
if(b){
|
||||
return AjaxResult.error("参数比传");
|
||||
R r = judgeXhpcCustomersPersonnel(xhpcCustomersPersonnel);
|
||||
if(r.getCode()!=200){
|
||||
return AjaxResult.error(r.getMsg());
|
||||
}
|
||||
Long customersPersonnelId = xhpcCustomersPersonnel.getCustomersPersonnelId();
|
||||
String phone = xhpcCustomersPersonnel.getPhone();
|
||||
@ -252,35 +251,35 @@ public class XhpcCustomersServiceImpl implements IXhpcCustomersService {
|
||||
xhpcCustomersMapper.updateCustomersPersonnelStatus(xhpcCustomersPersonnel.getCustomersPersonnelId(),xhpcCustomersPersonnel.getStatus());
|
||||
}
|
||||
|
||||
public boolean judgeXhpcCustomers(XhpcCustomers xhpcCustomers){
|
||||
public R judgeXhpcCustomers(XhpcCustomers xhpcCustomers){
|
||||
|
||||
if(xhpcCustomers.getName()==null || "".equals(xhpcCustomers.getName())){
|
||||
return false;
|
||||
return R.fail("名称必填");
|
||||
}
|
||||
if(xhpcCustomers.getContactName()==null || "".equals(xhpcCustomers.getContactName())){
|
||||
return false;
|
||||
return R.fail("联系人必填");
|
||||
}
|
||||
if(xhpcCustomers.getContactPhone()==null || "".equals(xhpcCustomers.getContactPhone())){
|
||||
return false;
|
||||
return R.fail("联系人电话必填");
|
||||
}
|
||||
if(xhpcCustomers.getAddress()==null || "".equals(xhpcCustomers.getAddress())){
|
||||
return false;
|
||||
return R.fail("地址必填");
|
||||
}
|
||||
return true;
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
public boolean judgeXhpcCustomersPersonnel(XhpcCustomersPersonnel xhpcCustomersPersonnel){
|
||||
public R judgeXhpcCustomersPersonnel(XhpcCustomersPersonnel xhpcCustomersPersonnel){
|
||||
|
||||
if(xhpcCustomersPersonnel.getName()==null || "".equals(xhpcCustomersPersonnel.getName())){
|
||||
return false;
|
||||
return R.fail("名称必填");
|
||||
}
|
||||
if(xhpcCustomersPersonnel.getAccount()==null || "".equals(xhpcCustomersPersonnel.getAccount()) || "BE".equals(xhpcCustomersPersonnel.getAccount().substring(0,2))){
|
||||
return false;
|
||||
return R.fail("账号必填且BE开头10位");
|
||||
}
|
||||
if(xhpcCustomersPersonnel.getPhone()==null || "".equals(xhpcCustomersPersonnel.getPhone()) || xhpcCustomersPersonnel.getPhone().length() !=11){
|
||||
return false;
|
||||
return R.fail("绑定手机号必填");
|
||||
}
|
||||
return true;
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ import com.xhpc.common.core.constant.StatusConstants;
|
||||
import com.xhpc.common.core.constant.UserConstants;
|
||||
import com.xhpc.common.core.utils.SecurityUtils;
|
||||
import com.xhpc.common.core.utils.StringUtils;
|
||||
import com.xhpc.common.core.web.service.BaseService;
|
||||
import com.xhpc.system.api.domain.SysRole;
|
||||
import com.xhpc.system.api.domain.SysUser;
|
||||
import com.xhpc.user.domain.SysUserRole;
|
||||
@ -23,7 +24,7 @@ import java.util.Map;
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Service
|
||||
public class XhpcUserServiceImpl implements IXhpcUserService {
|
||||
public class XhpcUserServiceImpl extends BaseService implements IXhpcUserService {
|
||||
|
||||
@Autowired
|
||||
private XhpcUserMapper xhpcUserMapper;
|
||||
@ -74,6 +75,7 @@ public class XhpcUserServiceImpl implements IXhpcUserService {
|
||||
public List<Map<String, Object>> selectOperatorUserList(String userName, String nickName, Long operatorId) {
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
SysUser sysUser = xhpcUserMapper.selectUserByUserId(userId);
|
||||
startPage();
|
||||
if (StatusConstants.SYSTEM_USER_TYPE.equals(sysUser.getUserType())) {
|
||||
return xhpcUserMapper.selectOperatorUserList(userName, nickName, operatorId,sysUser.getUserType());
|
||||
} else {
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<!--suppress ALL -->
|
||||
<mapper namespace="com.xhpc.user.mapper.XhpcCommunityMapper">
|
||||
|
||||
<resultMap type="com.xhpc.user.domain.XhpcCommunity" id="XhpcCommunityResult">
|
||||
@ -37,6 +38,9 @@
|
||||
<if test="name !=null and name !=''">
|
||||
and name like CONCAT('%',#{name},'%')
|
||||
</if>
|
||||
<if test="tenantId !=null and tenantId !=''">
|
||||
and tenant_id=#{tenantId}
|
||||
</if>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
@ -147,8 +151,8 @@
|
||||
<if test="contactName != null">contact_name = #{contactName},</if>
|
||||
<if test="contactPhone != null">contact_phone = #{contactPhone},</if>
|
||||
<if test="address != null">address = #{address},</if>
|
||||
<if test="dimension != null">address = #{dimension},</if>
|
||||
<if test="status != null">address = #{status},</if>
|
||||
<if test="dimension != null">dimension = #{dimension},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
|
||||
@ -39,6 +39,9 @@
|
||||
<if test="operatorId !=null">
|
||||
and operator_id=#{operatorId}
|
||||
</if>
|
||||
<if test="tenantId !=null and tenantId !=''">
|
||||
and tenant_id=#{tenantId}
|
||||
</if>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
@ -142,8 +145,8 @@
|
||||
<if test="contactName != null">contact_name = #{contactName},</if>
|
||||
<if test="contactPhone != null">contact_phone = #{contactPhone},</if>
|
||||
<if test="address != null">address = #{address},</if>
|
||||
<if test="dimension != null">address = #{dimension},</if>
|
||||
<if test="status != null">address = #{status},</if>
|
||||
<if test="dimension != null">dimension = #{dimension},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user