增加租户查询条件
This commit is contained in:
parent
a3981c6802
commit
be90bec557
@ -6,6 +6,8 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.xhpc.common.security.service.TokenService;
|
||||
import com.xhpc.system.api.model.LoginUser;
|
||||
import com.xhpc.system.domain.SysRoleDept;
|
||||
import com.xhpc.system.domain.SysRoleMenu;
|
||||
import com.xhpc.system.domain.SysUserRole;
|
||||
@ -43,6 +45,8 @@ public class SysRoleServiceImpl implements ISysRoleService
|
||||
|
||||
@Autowired
|
||||
private SysRoleDeptMapper roleDeptMapper;
|
||||
@Autowired
|
||||
private TokenService tokenService;
|
||||
|
||||
/**
|
||||
* 根据条件分页查询角色数据
|
||||
@ -54,6 +58,8 @@ public class SysRoleServiceImpl implements ISysRoleService
|
||||
@DataScope(deptAlias = "d")
|
||||
public List<SysRole> selectRoleList(SysRole role)
|
||||
{
|
||||
LoginUser loginUser = tokenService.getLoginUser();
|
||||
role.setTenantId(loginUser.getTenantId());
|
||||
return roleMapper.selectRoleList(role);
|
||||
}
|
||||
|
||||
|
||||
@ -75,7 +75,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);
|
||||
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);
|
||||
|
||||
/**
|
||||
* 获取费率时段
|
||||
|
||||
@ -60,7 +60,7 @@ public interface XhpcRealTimeOrderMapper {
|
||||
* @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,
|
||||
@Param("affiliationOrganization")String affiliationOrganization,@Param("plateNum")String plateNum,@Param("internetId")Integer internetId,@Param("internetSerialNumber")String internetSerialNumber);
|
||||
@Param("affiliationOrganization")String affiliationOrganization,@Param("plateNum")String plateNum,@Param("internetId")Integer internetId,@Param("internetSerialNumber")String internetSerialNumber,@Param("tenantId")String tenantId);
|
||||
|
||||
/**
|
||||
* 实时订单详情接口(PC端)
|
||||
|
||||
@ -218,6 +218,8 @@ 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 != 1) {
|
||||
@ -228,17 +230,17 @@ public class XhpcHistoryOrderServiceImpl extends BaseService implements IXhpcHis
|
||||
if ("01".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);
|
||||
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);
|
||||
} 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);
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} 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);
|
||||
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);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@ -261,6 +263,9 @@ 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 != 1) {
|
||||
@ -270,15 +275,15 @@ public class XhpcHistoryOrderServiceImpl extends BaseService implements IXhpcHis
|
||||
if ("01".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);
|
||||
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);
|
||||
} 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);
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
} 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);
|
||||
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);
|
||||
}
|
||||
|
||||
// 通过工具类创建writer,默认创建xls格式
|
||||
|
||||
@ -13,6 +13,7 @@ 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;
|
||||
import com.xhpc.common.security.service.TokenService;
|
||||
import com.xhpc.common.util.EvcsUtil;
|
||||
import com.xhpc.common.util.UserTypeUtil;
|
||||
import com.xhpc.order.domain.*;
|
||||
@ -20,6 +21,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.model.LoginUser;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -60,6 +62,9 @@ public class XhpcRealTimeOrderServiceImpl extends BaseService implements IXhpcRe
|
||||
@Autowired
|
||||
private UserTypeService userTypeService;
|
||||
|
||||
@Autowired
|
||||
private TokenService tokenService;
|
||||
|
||||
|
||||
private final ExecutorService executorService = Executors.newFixedThreadPool(20);
|
||||
|
||||
@ -88,6 +93,8 @@ public class XhpcRealTimeOrderServiceImpl extends BaseService implements IXhpcRe
|
||||
if(type ==null || userId ==null){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
LoginUser loginUser = tokenService.getLoginUser();
|
||||
String tenantId = loginUser.getTenantId();
|
||||
if(logUserId !=1) {
|
||||
Map<String, Object> landUser = xhpcHistoryOrderService.getLandUser(logUserId);
|
||||
if(landUser !=null){
|
||||
@ -96,16 +103,16 @@ public class XhpcRealTimeOrderServiceImpl extends BaseService implements IXhpcRe
|
||||
if("01".equals(landUser.get("userType").toString())){
|
||||
Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString());
|
||||
//运营商看自己的场站
|
||||
list = xhpcRealTimeOrderMapper.list(phone,transactionNumber,source,chargingStationName,terminalName,operatorId,startTime,endTime,number,status,logOperatorId,1,affiliationOrganization,plateNum,internetId,internetSerialNumber);
|
||||
list = xhpcRealTimeOrderMapper.list(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);
|
||||
list = xhpcRealTimeOrderMapper.list(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);
|
||||
list = xhpcRealTimeOrderMapper.list(phone,transactionNumber,source,chargingStationName,terminalName,operatorId,startTime,endTime,number,status,logUserId,0,affiliationOrganization,plateNum,internetId,internetSerialNumber,tenantId);
|
||||
}
|
||||
|
||||
return list;
|
||||
|
||||
@ -784,6 +784,9 @@
|
||||
<if test="personnelId !=null">
|
||||
and ho.user_id=#{personnelId}
|
||||
</if>
|
||||
<if test="tenantId !=null and '' !=tenantId">
|
||||
and ho.tenant_id=#{tenantId}
|
||||
</if>
|
||||
order by ho.create_time desc
|
||||
</select>
|
||||
|
||||
|
||||
@ -448,6 +448,9 @@
|
||||
<if test="plateNum !=null and plateNum !=''">
|
||||
and co.Plate_num like concat('%', #{plateNum}, '%')
|
||||
</if>
|
||||
<if test="tenantId !=null and tenantId !=''">
|
||||
and co.tenant_id =#{tenantId}
|
||||
</if>
|
||||
<if test="source !=null">
|
||||
and co.source =#{source}
|
||||
</if>
|
||||
|
||||
@ -47,7 +47,7 @@ public interface XhpcRechargeOrderMapper {
|
||||
* @param createTimeEnd
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> page(@Param("phone") String phone, @Param("rechargeOrderNumber") String rechargeOrderNumber, @Param("status") String status, @Param("createTimeStart") String createTimeStart, @Param("createTimeEnd") String createTimeEnd,@Param("type")Integer type,@Param("source")Integer source,@Param("userId")Integer userId);
|
||||
public List<Map<String, Object>> page(@Param("phone") String phone, @Param("rechargeOrderNumber") String rechargeOrderNumber, @Param("status") String status, @Param("createTimeStart") String createTimeStart, @Param("createTimeEnd") String createTimeEnd,@Param("type")Integer type,@Param("source")Integer source,@Param("userId")Integer userId,@Param("tenantId")String tenantId);
|
||||
|
||||
/**
|
||||
* 统计
|
||||
@ -59,7 +59,7 @@ public interface XhpcRechargeOrderMapper {
|
||||
* @param createTimeEnd
|
||||
* @return
|
||||
*/
|
||||
public String sumMoney(@Param("phone")String phone,@Param("rechargeOrderNumber") String rechargeOrderNumber,@Param("status") String status,@Param("createTimeStart") String createTimeStart,@Param("createTimeEnd") String createTimeEnd,@Param("type")Integer type,@Param("source")Integer source,@Param("userId")Integer userId);
|
||||
public String sumMoney(@Param("phone")String phone,@Param("rechargeOrderNumber") String rechargeOrderNumber,@Param("status") String status,@Param("createTimeStart") String createTimeStart,@Param("createTimeEnd") String createTimeEnd,@Param("type")Integer type,@Param("source")Integer source,@Param("userId")Integer userId,@Param("tenantId")String tenantId);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -63,7 +63,7 @@ public interface XhpcRefundOrderMapper {
|
||||
* @param createTimeEnd
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> page(@Param("phone") String phone, @Param("refundOrderNumber") String refundOrderNumber, @Param("status") String status, @Param("createTimeStart") String createTimeStart, @Param("createTimeEnd") String createTimeEnd,@Param("type")Integer type,@Param("source")Integer source,@Param("userId")Integer userId);
|
||||
public List<Map<String, Object>> page(@Param("phone") String phone, @Param("refundOrderNumber") String refundOrderNumber, @Param("status") String status, @Param("createTimeStart") String createTimeStart, @Param("createTimeEnd") String createTimeEnd,@Param("type")Integer type,@Param("source")Integer source,@Param("userId")Integer userId,@Param("tenantId")String tenantId);
|
||||
|
||||
|
||||
/**
|
||||
@ -76,7 +76,7 @@ public interface XhpcRefundOrderMapper {
|
||||
* @param createTimeEnd
|
||||
* @return
|
||||
*/
|
||||
public String sumMoney(@Param("phone") String phone, @Param("refundOrderNumber") String refundOrderNumber, @Param("status") String status, @Param("createTimeStart") String createTimeStart, @Param("createTimeEnd") String createTimeEnd,@Param("type")Integer type);
|
||||
public String sumMoney(@Param("phone") String phone, @Param("refundOrderNumber") String refundOrderNumber, @Param("status") String status, @Param("createTimeStart") String createTimeStart, @Param("createTimeEnd") String createTimeEnd,@Param("type")Integer type,@Param("tenantId")String tenantId);
|
||||
|
||||
|
||||
|
||||
|
||||
@ -5,8 +5,10 @@ import cn.hutool.poi.excel.ExcelUtil;
|
||||
import cn.hutool.poi.excel.ExcelWriter;
|
||||
import com.xhpc.common.core.constant.StatusConstants;
|
||||
import com.xhpc.common.domain.XhpcRechargeOrder;
|
||||
import com.xhpc.common.security.service.TokenService;
|
||||
import com.xhpc.payment.mapper.XhpcRechargeOrderMapper;
|
||||
import com.xhpc.payment.service.IXhpcRechargeOrderService;
|
||||
import com.xhpc.system.api.model.LoginUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -29,6 +31,8 @@ public class XhpcRechargeOrderServiceImpl implements IXhpcRechargeOrderService {
|
||||
|
||||
@Autowired
|
||||
private XhpcRechargeOrderMapper xhpcRechargeOrderMapper;
|
||||
@Autowired
|
||||
private TokenService tokenService;
|
||||
|
||||
@Autowired
|
||||
private XhpcUserAccountStatementServiceImpl xhpcUserAccountStatementService;
|
||||
@ -68,13 +72,15 @@ public class XhpcRechargeOrderServiceImpl implements IXhpcRechargeOrderService {
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String, Object>> page(String phone, String rechargeOrderNumber, String status, String createTimeStart, String createTimeEnd,Integer type,Integer source,Integer userId) {
|
||||
return xhpcRechargeOrderMapper.page(phone, rechargeOrderNumber, status, createTimeStart, createTimeEnd,type,source,userId);
|
||||
LoginUser loginUser = tokenService.getLoginUser();
|
||||
return xhpcRechargeOrderMapper.page(phone, rechargeOrderNumber, status, createTimeStart, createTimeEnd,type,source,userId,loginUser.getTenantId());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void export(HttpServletResponse response, String phone, String rechargeOrderNumber, String status, String createTimeStart, String createTimeEnd, Integer type,Integer source,Integer userId) throws IOException {
|
||||
List<Map<String, Object>> list = xhpcRechargeOrderMapper.page(phone, rechargeOrderNumber, status, createTimeStart, createTimeEnd,type,source,userId);
|
||||
LoginUser loginUser = tokenService.getLoginUser();
|
||||
List<Map<String, Object>> list = xhpcRechargeOrderMapper.page(phone, rechargeOrderNumber, status, createTimeStart, createTimeEnd,type,source,userId,loginUser.getTenantId());
|
||||
|
||||
// 通过工具类创建writer,默认创建xls格式
|
||||
ExcelWriter writer = ExcelUtil.getWriter(true);
|
||||
@ -116,8 +122,8 @@ public class XhpcRechargeOrderServiceImpl implements IXhpcRechargeOrderService {
|
||||
|
||||
@Override
|
||||
public String sumMoney(String phone, String rechargeOrderNumber, String status, String createTimeStart, String createTimeEnd, Integer type,Integer source,Integer userId) {
|
||||
|
||||
return xhpcRechargeOrderMapper.sumMoney(phone, rechargeOrderNumber, status, createTimeStart, createTimeEnd, type,source,userId);
|
||||
LoginUser loginUser = tokenService.getLoginUser();
|
||||
return xhpcRechargeOrderMapper.sumMoney(phone, rechargeOrderNumber, status, createTimeStart, createTimeEnd, type,source,userId,loginUser.getTenantId());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -9,12 +9,14 @@ 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.domain.AjaxResult;
|
||||
import com.xhpc.common.security.service.TokenService;
|
||||
import com.xhpc.common.util.UserTypeUtil;
|
||||
import com.xhpc.payment.domain.XhpcAppUser;
|
||||
import com.xhpc.common.domain.XhpcRefundOrder;
|
||||
import com.xhpc.payment.mapper.XhpcRefundOrderMapper;
|
||||
import com.xhpc.payment.mapper.XhpcUserAccountStatementMapper;
|
||||
import com.xhpc.payment.service.IXhpcRefundOrderService;
|
||||
import com.xhpc.system.api.model.LoginUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -42,6 +44,9 @@ public class XhpcRefundOrderServiceImpl implements IXhpcRefundOrderService {
|
||||
@Autowired
|
||||
private UserTypeService userTypeService;
|
||||
|
||||
@Autowired
|
||||
private TokenService tokenService;
|
||||
|
||||
/**
|
||||
* 更新 退款订单
|
||||
*
|
||||
@ -76,13 +81,15 @@ public class XhpcRefundOrderServiceImpl implements IXhpcRefundOrderService {
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String, Object>> page(String phone, String rechargeOrderNumber, String status, String createTimeStart, String createTimeEnd,Integer type,Integer source,Integer userId) {
|
||||
return xhpcRefundOrderMapper.page(phone, rechargeOrderNumber, status, createTimeStart, createTimeEnd,type,source,userId);
|
||||
LoginUser loginUser = tokenService.getLoginUser();
|
||||
return xhpcRefundOrderMapper.page(phone, rechargeOrderNumber, status, createTimeStart, createTimeEnd,type,source,userId,loginUser.getTenantId());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void export(HttpServletResponse response, String phone, String refundOrderNumber, String status, String createTimeStart, String createTimeEnd, Integer type,Integer source,Integer userId) throws IOException {
|
||||
List<Map<String, Object>> list = xhpcRefundOrderMapper.page(phone, refundOrderNumber, status, createTimeStart, createTimeEnd,type,source,userId);
|
||||
LoginUser loginUser = tokenService.getLoginUser();
|
||||
List<Map<String, Object>> list = xhpcRefundOrderMapper.page(phone, refundOrderNumber, status, createTimeStart, createTimeEnd,type,source,userId,loginUser.getTenantId());
|
||||
|
||||
// 通过工具类创建writer,默认创建xls格式
|
||||
ExcelWriter writer = ExcelUtil.getWriter(true);
|
||||
@ -122,8 +129,8 @@ public class XhpcRefundOrderServiceImpl implements IXhpcRefundOrderService {
|
||||
|
||||
@Override
|
||||
public String sumMoney(String phone, String refundOrderNumber, String status, String createTimeStart, String createTimeEnd, Integer type) {
|
||||
|
||||
return xhpcRefundOrderMapper.sumMoney(phone, refundOrderNumber, status, createTimeStart, createTimeEnd, type);
|
||||
LoginUser loginUser = tokenService.getLoginUser();
|
||||
return xhpcRefundOrderMapper.sumMoney(phone, refundOrderNumber, status, createTimeStart, createTimeEnd, type,loginUser.getTenantId());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -203,6 +203,9 @@
|
||||
<if test="type != null and type != ''">
|
||||
AND xro.type = #{type}
|
||||
</if>
|
||||
<if test="tenantId != null and tenantId != ''">
|
||||
AND xro.tenant_id = #{tenantId}
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
and xro.user_id=#{userId}
|
||||
</if>
|
||||
@ -218,6 +221,9 @@
|
||||
<if test="phone != null and phone != ''">
|
||||
and xau.phone like concat('%', #{phone}, '%')
|
||||
</if>
|
||||
<if test="tenantId != null and tenantId != ''">
|
||||
and xro.tenant_id =#{tenantId}
|
||||
</if>
|
||||
<if test="rechargeOrderNumber != null and rechargeOrderNumber != ''">
|
||||
and xro.recharge_order_number like concat('%', #{rechargeOrderNumber}, '%')
|
||||
</if>
|
||||
|
||||
@ -220,6 +220,9 @@
|
||||
<if test="source != null">
|
||||
and xro.source=#{source}
|
||||
</if>
|
||||
<if test="tenantId != null and tenantId != ''">
|
||||
and xro.tenant_id=#{tenantId}
|
||||
</if>
|
||||
<if test="refundOrderNumber != null and refundOrderNumber != ''">
|
||||
and xro.refund_order_number like concat('%', #{refundOrderNumber}, '%')
|
||||
</if>
|
||||
@ -252,6 +255,9 @@
|
||||
<if test="phone != null and phone != ''">
|
||||
and xau.phone like concat('%', #{phone}, '%')
|
||||
</if>
|
||||
<if test="tenantId != null and tenantId != ''">
|
||||
and xro.tenant_id=#{tenantId}
|
||||
</if>
|
||||
<if test="refundOrderNumber != null and refundOrderNumber != ''">
|
||||
and xro.refund_order_number like concat('%', #{refundOrderNumber}, '%')
|
||||
</if>
|
||||
|
||||
@ -11,7 +11,9 @@ import com.xhpc.common.core.web.page.TableDataInfo;
|
||||
import com.xhpc.common.log.annotation.Log;
|
||||
import com.xhpc.common.log.enums.BusinessType;
|
||||
import com.xhpc.common.security.annotation.PreAuthorize;
|
||||
import com.xhpc.common.security.service.TokenService;
|
||||
import com.xhpc.system.api.domain.SysUser;
|
||||
import com.xhpc.system.api.model.LoginUser;
|
||||
import com.xhpc.user.domain.XhpcInternetUser;
|
||||
import com.xhpc.user.service.IXhpcInternetUserService;
|
||||
import com.xhpc.user.service.IXhpcStationInternetBlacklistService;
|
||||
@ -42,27 +44,32 @@ public class XhpcInternetUserController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IXhpcStationInternetBlacklistService xhpcStationInternetBlacklistService;
|
||||
|
||||
@Autowired
|
||||
private TokenService tokenService;
|
||||
/**
|
||||
* 新增流量用户
|
||||
*/
|
||||
@Log(title = "流量用户", businessType = BusinessType.INSERT)
|
||||
@ApiOperation("新增流量用户")
|
||||
@RequiresRoles("admin")
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@Valid @RequestBody XhpcInternetUser xhpcInternetUser) {
|
||||
|
||||
LoginUser loginUser = tokenService.getLoginUser();
|
||||
SysUser sysUser = new SysUser();
|
||||
sysUser.setUserName(xhpcInternetUser.getPhone());
|
||||
sysUser.setNickName(xhpcInternetUser.getName());
|
||||
sysUser.setPhonenumber(xhpcInternetUser.getPhone());
|
||||
sysUser.setDeptId(103L);
|
||||
sysUser.setDeptId(loginUser.getSysUser().getDeptId());
|
||||
sysUser.setSex("0");
|
||||
sysUser.setUserType(StatusConstants.INTERNET_USER_TYPE);
|
||||
sysUser.setDataPowerType(StatusConstants.INTERNET_POWER_TYPE);
|
||||
sysUser.setCreateBy(SecurityUtils.getUsername());
|
||||
sysUser.setPassword("123456");
|
||||
sysUser.setTenantId(loginUser.getTenantId());
|
||||
sysUser.setAvatar("https://xhpc-bucket1.oss-cn-hangzhou.aliyuncs.com/avatar/logo.png");
|
||||
Long[] role = new Long[1];
|
||||
role[0] = 4L;
|
||||
role[0] = xhpcInternetUser.getRoleId();
|
||||
sysUser.setRoleIds(role);
|
||||
if (iXhpcUserService.checkUserNameUnique(sysUser.getUserName(),null) > 0) {
|
||||
return AjaxResult.error("新增用户'" + sysUser.getUserName() + "'失败,登录账号已存在");
|
||||
@ -75,6 +82,7 @@ public class XhpcInternetUserController extends BaseController {
|
||||
if(count>0){
|
||||
return AjaxResult.error("operatorId已存在");
|
||||
}
|
||||
xhpcInternetUser.setTenantId(loginUser.getTenantId());
|
||||
iXhpcInternetUserService.insert(xhpcInternetUser);
|
||||
sysUser.setInternetUserId(xhpcInternetUser.getInternetUserId());
|
||||
iXhpcUserService.insertUser(sysUser);
|
||||
@ -86,7 +94,6 @@ public class XhpcInternetUserController extends BaseController {
|
||||
*/
|
||||
@Log(title = "流量用户", businessType = BusinessType.UPDATE)
|
||||
@ApiOperation("修改流量用户")
|
||||
@RequiresRoles("admin")
|
||||
@PostMapping("/edit")
|
||||
public AjaxResult edit(@Valid @RequestBody XhpcInternetUser xhpcInternetUser) {
|
||||
if (null == xhpcInternetUser.getInternetUserId()) {
|
||||
@ -124,7 +131,6 @@ public class XhpcInternetUserController extends BaseController {
|
||||
*/
|
||||
@Log(title = "流量用户", businessType = BusinessType.DELETE)
|
||||
@ApiOperation("删除流量用户")
|
||||
@RequiresRoles("admin")
|
||||
@PostMapping("/remove")
|
||||
public AjaxResult remove(@RequestBody Map<String, Object> map) {
|
||||
String ids = StringUtils.valueOf(map.get("ids"));
|
||||
@ -161,7 +167,6 @@ public class XhpcInternetUserController extends BaseController {
|
||||
*/
|
||||
@Log(title = "流量用户-禁用启用", businessType = BusinessType.UPDATE)
|
||||
@ApiOperation("禁用/启用流量用户")
|
||||
@RequiresRoles("admin")
|
||||
@PostMapping("/status")
|
||||
public AjaxResult status(@RequestBody Map<String, Object> map) {
|
||||
String internetUserId = StringUtils.valueOf(map.get("internetUserId"));
|
||||
|
||||
@ -10,8 +10,10 @@ import com.xhpc.common.core.web.page.TableDataInfo;
|
||||
import com.xhpc.common.log.annotation.Log;
|
||||
import com.xhpc.common.log.enums.BusinessType;
|
||||
import com.xhpc.common.security.annotation.PreAuthorize;
|
||||
import com.xhpc.common.security.service.TokenService;
|
||||
import com.xhpc.system.api.domain.SysRole;
|
||||
import com.xhpc.system.api.domain.SysUser;
|
||||
import com.xhpc.system.api.model.LoginUser;
|
||||
import com.xhpc.user.service.IXhpcOperatorService;
|
||||
import com.xhpc.user.service.IXhpcUserService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@ -39,6 +41,9 @@ public class XhpcUserController extends BaseController {
|
||||
@Autowired
|
||||
private IXhpcOperatorService iXhpcOperatorService;
|
||||
|
||||
@Autowired
|
||||
private TokenService tokenService;
|
||||
|
||||
|
||||
/**
|
||||
* 获取平台用户分页列表
|
||||
@ -59,6 +64,7 @@ public class XhpcUserController extends BaseController {
|
||||
@RequiresRoles("admin")
|
||||
@PostMapping("/pc/add")
|
||||
public AjaxResult pcAdd(@RequestBody SysUser sysUser) {
|
||||
LoginUser loginUser = tokenService.getLoginUser();
|
||||
if (iXhpcUserService.checkUserNameUnique(sysUser.getUserName(),null) > 0) {
|
||||
return AjaxResult.error("新增用户'" + sysUser.getUserName() + "'失败,登录账号已存在");
|
||||
}
|
||||
@ -68,7 +74,8 @@ public class XhpcUserController extends BaseController {
|
||||
role.setRoleSort("1");
|
||||
iXhpcUserService.insertRole(role);
|
||||
sysUser.setPhonenumber(sysUser.getUserName());
|
||||
sysUser.setDeptId(103L);
|
||||
sysUser.setTenantId(loginUser.getTenantId());
|
||||
sysUser.setDeptId(loginUser.getSysUser().getDeptId());
|
||||
sysUser.setDataPowerType(StatusConstants.ALL_POWER_TYPE);
|
||||
sysUser.setUserType(StatusConstants.SYSTEM_USER_TYPE);
|
||||
sysUser.setCreateBy(SecurityUtils.getUsername());
|
||||
|
||||
@ -138,6 +138,11 @@ public class XhpcInternetUser extends BaseEntity {
|
||||
@NotBlank(message = "operatorId不能为空")
|
||||
private String operatorIdEvcs;
|
||||
|
||||
/**
|
||||
* 角色id
|
||||
*/
|
||||
private Long roleId;
|
||||
|
||||
public String getOperatorIdEvcs() {
|
||||
|
||||
return operatorIdEvcs;
|
||||
@ -299,4 +304,8 @@ public class XhpcInternetUser extends BaseEntity {
|
||||
public void setDelFlag(String delFlag) {
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public Long getRoleId() {
|
||||
return roleId;
|
||||
}
|
||||
}
|
||||
|
||||
@ -56,7 +56,7 @@ public interface XhpcAppUserMapper {
|
||||
public List<Map<String, Object>> selectAppUserList(@Param("phone") String phone,@Param("tenantId") String tenantId);
|
||||
|
||||
|
||||
public Map<String, Object> userSum(@Param("phone")String phone,@Param("time")String time);
|
||||
public Map<String, Object> userSum(@Param("phone")String phone,@Param("time")String time,@Param("tenantId") String tenantId);
|
||||
|
||||
/**
|
||||
* 手机号查询C端用户信息
|
||||
|
||||
@ -55,7 +55,7 @@ public interface XhpcInternetUserMapper {
|
||||
* @param contactPhone 联系人电话
|
||||
* @return 结果
|
||||
*/
|
||||
public List<Map<String, Object>> selectInternetList(@Param("name") String name, @Param("contactName") String contactName, @Param("contactPhone") String contactPhone, @Param("createTimeStart") String createTimeStart, @Param("createTimeEnd") String createTimeEnd);
|
||||
public List<Map<String, Object>> selectInternetList(@Param("name") String name, @Param("contactName") String contactName, @Param("contactPhone") String contactPhone, @Param("createTimeStart") String createTimeStart, @Param("createTimeEnd") String createTimeEnd,@Param("tenantId")String tenantId);
|
||||
|
||||
/**
|
||||
* 通过流量用户ID查询用户
|
||||
|
||||
@ -46,7 +46,7 @@ public interface XhpcUserMapper {
|
||||
* @param nickName 用户昵称
|
||||
* @return 结果
|
||||
*/
|
||||
public List<Map<String, Object>> selectPcUserList(@Param("userName") String userName, @Param("nickName") String nickName);
|
||||
public List<Map<String, Object>> selectPcUserList(@Param("userName") String userName, @Param("nickName") String nickName,@Param("tenantId")String tenantId);
|
||||
|
||||
/**
|
||||
* 平台用户详情
|
||||
@ -63,7 +63,7 @@ public interface XhpcUserMapper {
|
||||
* @param nickName 用户昵称
|
||||
* @return 结果
|
||||
*/
|
||||
public List<Map<String, Object>> selectOperatorUserList(@Param("userName") String userName, @Param("nickName") String nickName, @Param("operatorId") Long operatorId,@Param("userrType")String userrType);
|
||||
public List<Map<String, Object>> selectOperatorUserList(@Param("userName") String userName, @Param("nickName") String nickName, @Param("operatorId") Long operatorId,@Param("userrType")String userrType,@Param("tenantId")String tenantId);
|
||||
|
||||
/**
|
||||
* 运营商用户详情
|
||||
|
||||
@ -95,12 +95,12 @@ public class XhpcAppUserServiceImpl extends BaseService implements IXhpcAppUserU
|
||||
|
||||
@Override
|
||||
public Map<String, Object> userSum(String phone) {
|
||||
|
||||
LoginUser logUser = tokenService.getLoginUser();
|
||||
//最近30天用户的活跃度
|
||||
Date newDate = DateUtil.offset(new Date(), DateField.DAY_OF_MONTH, -30);
|
||||
String time = DateUtil.format(newDate, "yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
return xhpcAppUserMapper.userSum(phone,time);
|
||||
return xhpcAppUserMapper.userSum(phone,time,logUser.getTenantId());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -216,6 +216,12 @@ public class XhpcAppUserServiceImpl extends BaseService implements IXhpcAppUserU
|
||||
*/
|
||||
@Transactional
|
||||
public R<?> appLogin(String username, String type, String openid, String tenantId) {
|
||||
//统一沉睡300毫秒防止重复提交
|
||||
try {
|
||||
Thread.sleep(300);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// 用户名或密码为空 错误
|
||||
if (StringUtils.isAnyBlank(username)) {
|
||||
return R.fail(HttpStatus.NOT_NULL, "用户必须填写");
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
package com.xhpc.user.service.impl;
|
||||
|
||||
import com.xhpc.common.core.constant.UserConstants;
|
||||
import com.xhpc.common.security.service.TokenService;
|
||||
import com.xhpc.system.api.domain.SysUser;
|
||||
import com.xhpc.system.api.model.LoginUser;
|
||||
import com.xhpc.user.domain.XhpcInternetUser;
|
||||
import com.xhpc.user.mapper.XhpcInternetUserMapper;
|
||||
import com.xhpc.user.mapper.XhpcOperatorMapper;
|
||||
@ -31,6 +33,8 @@ public class XhpcInternetUserServiceImpl implements IXhpcInternetUserService {
|
||||
@Autowired
|
||||
private XhpcOperatorMapper xhpcOperatorMapper;
|
||||
|
||||
@Autowired
|
||||
private TokenService tokenService;
|
||||
/**
|
||||
* 新增任务
|
||||
*
|
||||
@ -97,7 +101,8 @@ public class XhpcInternetUserServiceImpl implements IXhpcInternetUserService {
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String, Object>> selectInternetList(String name, String contactName, String contactPhone, String createTimeStart, String createTimeEnd) {
|
||||
return xhpcInternetUserMapper.selectInternetList(name, contactName, contactPhone, createTimeStart, createTimeEnd);
|
||||
LoginUser loginUser = tokenService.getLoginUser();
|
||||
return xhpcInternetUserMapper.selectInternetList(name, contactName, contactPhone, createTimeStart, createTimeEnd,loginUser.getTenantId());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -5,8 +5,10 @@ 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.common.security.service.TokenService;
|
||||
import com.xhpc.system.api.domain.SysRole;
|
||||
import com.xhpc.system.api.domain.SysUser;
|
||||
import com.xhpc.system.api.model.LoginUser;
|
||||
import com.xhpc.user.domain.SysUserRole;
|
||||
import com.xhpc.user.mapper.XhpcUserMapper;
|
||||
import com.xhpc.user.service.IXhpcUserService;
|
||||
@ -28,6 +30,8 @@ public class XhpcUserServiceImpl extends BaseService implements IXhpcUserService
|
||||
|
||||
@Autowired
|
||||
private XhpcUserMapper xhpcUserMapper;
|
||||
@Autowired
|
||||
private TokenService tokenService;
|
||||
|
||||
/**
|
||||
* 批量删除用户信息
|
||||
@ -49,7 +53,8 @@ public class XhpcUserServiceImpl extends BaseService implements IXhpcUserService
|
||||
* @return 结果
|
||||
*/
|
||||
public List<Map<String, Object>> selectPcUserList(String userName, String nickName) {
|
||||
return xhpcUserMapper.selectPcUserList(userName, nickName);
|
||||
LoginUser loginUser = tokenService.getLoginUser();
|
||||
return xhpcUserMapper.selectPcUserList(userName, nickName,loginUser.getTenantId());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -77,9 +82,9 @@ public class XhpcUserServiceImpl extends BaseService implements IXhpcUserService
|
||||
SysUser sysUser = xhpcUserMapper.selectUserByUserId(userId);
|
||||
startPage();
|
||||
if (StatusConstants.SYSTEM_USER_TYPE.equals(sysUser.getUserType())) {
|
||||
return xhpcUserMapper.selectOperatorUserList(userName, nickName, operatorId,sysUser.getUserType());
|
||||
return xhpcUserMapper.selectOperatorUserList(userName, nickName, operatorId,sysUser.getUserType(),sysUser.getTenantId());
|
||||
} else {
|
||||
return xhpcUserMapper.selectOperatorUserList(userName, nickName, sysUser.getOperatorId(),sysUser.getUserType());
|
||||
return xhpcUserMapper.selectOperatorUserList(userName, nickName, sysUser.getOperatorId(),sysUser.getUserType(),sysUser.getTenantId());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -216,6 +216,9 @@
|
||||
<if test="phone != null and phone != ''">
|
||||
and xau.phone like concat('%', #{phone}, '%')
|
||||
</if>
|
||||
<if test="tenantId !=null and tenantId !=''">
|
||||
and xau.tenant_id =#{tenantId}
|
||||
</if>
|
||||
ORDER BY xau.create_time DESC
|
||||
</select>
|
||||
|
||||
|
||||
@ -108,7 +108,10 @@
|
||||
remark,
|
||||
</if>
|
||||
<if test="null != operatorIdEvcs and '' != operatorIdEvcs">
|
||||
operator_id_evcs
|
||||
operator_id_evcs,
|
||||
</if>
|
||||
<if test="null != tenantId and '' != tenantId">
|
||||
tenant_id
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
@ -182,7 +185,10 @@
|
||||
#{remark},
|
||||
</if>
|
||||
<if test="null != operatorIdEvcs and '' != operatorIdEvcs">
|
||||
#{operatorIdEvcs}
|
||||
#{operatorIdEvcs},
|
||||
</if>
|
||||
<if test="null != tenantId and '' != tenantId">
|
||||
#{tenantId}
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
@ -265,6 +271,9 @@
|
||||
<if test="name != null and name != ''">
|
||||
and xiu.name like concat('%', #{name}, '%')
|
||||
</if>
|
||||
<if test="tenantId !=null and ''!=tenantId">
|
||||
and xiu.tenant_id =#{tenantId}
|
||||
</if>
|
||||
<if test="contactName != null and contactName != ''">
|
||||
and xiu.contact_name like concat('%', #{contactName}, '%')
|
||||
</if>
|
||||
|
||||
@ -27,6 +27,7 @@
|
||||
<result column="update_by" property="updateBy"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="remark" property="remark"/>
|
||||
<result column="tenant_id" property="tenantId"/>
|
||||
</resultMap>
|
||||
|
||||
<update id="update" parameterType="com.xhpc.system.api.domain.SysUser">
|
||||
@ -80,6 +81,9 @@
|
||||
<if test="userName != null and userName != ''">
|
||||
and user_name like concat('%', #{userName}, '%')
|
||||
</if>
|
||||
<if test="tenantId !=null and ''!=tenantId">
|
||||
and tenant_id=#{tenantId}
|
||||
</if>
|
||||
<if test="nickName != null and nickName != ''">
|
||||
and nick_name like concat('%', #{nickName}, '%')
|
||||
</if>
|
||||
@ -109,6 +113,9 @@
|
||||
<if test="userName != null and userName != ''">
|
||||
and su.user_name like concat('%', #{userName}, '%')
|
||||
</if>
|
||||
<if test="tenantId !=null and tenantId !=''">
|
||||
and su.tenant_id =#{tenantId}
|
||||
</if>
|
||||
<if test="nickName != null and nickName != ''">
|
||||
and su.nick_name like concat('%', #{nickName}, '%')
|
||||
</if>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user