修改权限,增加租户id

This commit is contained in:
yuyang 2022-01-04 10:19:03 +08:00
parent 2cfb84e681
commit 423b53624c
27 changed files with 122 additions and 102 deletions

View File

@ -92,7 +92,7 @@ public class XhpcChargingPileServiceImpl implements IXhpcChargingPileService {
Map<String, Object> landUser = xhpcChargingStationService.getLandUser(userId);
if(landUser !=null){
if(landUser.get("userType") !=null){
if("01".equals(landUser.get("userType").toString()) || "03".equals(landUser.get("userType").toString())){
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);
}else{

View File

@ -133,7 +133,7 @@ public class XhpcChargingStationServiceImpl implements IXhpcChargingStationServi
Map<String, Object> landUser = xhpcChargingStationMapper.getLandUser(userId);
if(landUser !=null){
if(landUser.get("userType") !=null){
if("01".equals(landUser.get("userType").toString()) || "03".equals(landUser.get("userType").toString())){
if("01".equals(landUser.get("userType").toString())){
Long operatorId = Long.valueOf(landUser.get("operatorId").toString());
//运营商看自己的场站
list = xhpcChargingStationMapper.selectXhpcChargingStationList(name, operatorName,operatorId,1,tenantId);

View File

@ -33,6 +33,7 @@
<result property="updateBy" column="update_by"/>
<result property="remark" column="remark"/>
<result property="brandModel" column="brand_model"/>
<result property="chargingStationName" column="charging_station_name"/>
</resultMap>
<sql id="selectXhpcChargingPileVo">
select charging_pile_id,
@ -320,42 +321,44 @@
<select id="selectXhpcChargingPileById" resultMap="BaseResultMap">
select
charging_pile_id,
charging_station_id,
name,
national_standard,
power,
auxiliary_power_supply,
input_voltage,
max_voltage,
min_voltage,
max_electric_current,
min_electric_current,
serial_number,
type,
program_version,
network_link_type,
gun_number,
communication_protocol_version,
communication_operator,
sim_card,
rate_model_id,
status,
del_flag,
create_time,
create_by,
update_time,
update_by,
remark,
rate_model_id,
brand_model,
production_date productionDate,
manufacture_name manufactureName,
connector_type connectorType,
current,
equipment_type equipmentType
from xhpc_charging_pile
where charging_pile_id = #{chargingPileId}
xcp.charging_pile_id,
xcp.charging_station_id,
xcp.name,
xcp.national_standard,
xcp.power,
xcp.auxiliary_power_supply,
xcp.input_voltage,
xcp.max_voltage,
xcp.min_voltage,
xcp.max_electric_current,
xcp.min_electric_current,
xcp.serial_number,
xcp.type,
xcp.program_version,
xcp.network_link_type,
xcp.gun_number,
xcp.communication_protocol_version,
xcp.communication_operator,
xcp.sim_card,
xcp.rate_model_id,
xcp.status,
xcp.del_flag,
xcp.create_time,
xcp.create_by,
xcp.update_time,
xcp.update_by,
xcp.remark,
xcp.rate_model_id,
xcp.brand_model,
xcp.production_date productionDate,
xcp.manufacture_name manufactureName,
xcp.connector_type connectorType,
xcp.current,
xcp.equipment_type equipmentType,
xcs.name as charging_station_name
from xhpc_charging_pile xcp
left join xhpc_charging_station as xcs on xcs.charging_station_id = xcp.charging_station_id
where xcp.charging_pile_id = #{chargingPileId}
</select>
<update id="updaeXhpcChargingPile" parameterType="Integer">

View File

@ -20,5 +20,5 @@ public interface UserTypeService {
* @return
*/
@GetMapping("/common/getUser")
R getUser(@RequestParam(value = "phone")String phone,@RequestParam(value = "userId")Long userId,@RequestParam(value = "userType")Integer userType,@RequestParam(value = "serialNumber")String serialNumber);
R getUser(@RequestParam(value = "phone")String phone,@RequestParam(value = "userId")Long userId,@RequestParam(value = "userType")Integer userType,@RequestParam(value = "serialNumber")String serialNumber,@RequestParam(value = "tenantId")String tenantId);
}

View File

@ -20,7 +20,7 @@ public class UserTypeFallbackFactory implements FallbackFactory<UserTypeService>
logger.error("用户服务调用失败:{} //fallback", cause.getMessage());
return new UserTypeService() {
@Override
public R getUser(String phone, Long userId, Integer userType,String serialNumber) {
public R getUser(String phone, Long userId, Integer userType,String serialNumber,String tenantId) {
return R.fail("用户信息获取失败:" + cause.getMessage());
}
};

View File

@ -29,7 +29,7 @@ public class XhpcSmsController extends BaseController {
* 注册获取手机号验证码
*/
@GetMapping(value = "/getLogonPhoneCode")
public AjaxResult getLogonPhoneCode(@RequestParam("phone") String phone) {
public AjaxResult getLogonPhoneCode(@RequestParam("phone") String phone,@RequestParam("tenantId")String tenantId) {
String signatureName = null;
String templateId = null;
@ -42,7 +42,7 @@ public class XhpcSmsController extends BaseController {
//C端用户
return xhpcSmsService.getLogonPhoneCode(phone, signatureName, templateId,null);
}else if (UserTypeUtil.COMMUNIT.equals(phone.substring(0,2)) || UserTypeUtil.CUSTOMERS.equals(phone.substring(0,2))){
R user = userTypeService.getUser(phone, null, null, null);
R user = userTypeService.getUser(phone, null, null, null,tenantId);
if(user !=null && user.getData() !=null){
Map<String, Object> map = (Map<String, Object>)user.getData();
return xhpcSmsService.getLogonPhoneCode(map.get("phone").toString(), signatureName, templateId,map.get("account").toString());

View File

@ -98,7 +98,7 @@ public class XhpcChargeOrderServiceImpl implements IXhpcChargeOrderService {
Integer userType = loginUser.getUserType();
Long userid = loginUser.getUserid();
String openId = loginUser.getOpenId();
R user = userTypeService.getUser(null, userid, userType, terminalSerialNumber);
R user = userTypeService.getUser(null, userid, userType, terminalSerialNumber,loginUser.getTenantId());
if(userId !=userid || user ==null || user.getData() ==null){
return AjaxResult.error(UserTypeUtil.LOGIN_TYPE, "请重新登录");
}

View File

@ -113,7 +113,7 @@ public class XhpcHistoryOrderServiceImpl implements IXhpcHistoryOrderService {
Map<String, Object> landUser = xhpcHistoryOrderMapper.getLandUser(logUserId);
if (landUser != null) {
if (landUser.get("userType") != null) {
if ("01".equals(landUser.get("userType").toString()) || "03".equals(landUser.get("userType").toString())) {
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);

View File

@ -84,7 +84,7 @@ public class XhpcRealTimeOrderServiceImpl implements IXhpcRealTimeOrderService {
Map<String, Object> landUser = xhpcHistoryOrderService.getLandUser(logUserId);
if(landUser !=null){
if(landUser.get("userType") !=null){
if("01".equals(landUser.get("userType").toString()) || "03".equals(landUser.get("userType").toString())){
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);

View File

@ -172,7 +172,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService {
Map<String, Object> landUser = xhpcHistoryOrderService.getLandUser(logUserId);
if(landUser !=null){
if(landUser.get("userType") !=null){
if("01".equals(landUser.get("userType").toString()) || "03".equals(landUser.get("userType").toString())){
if("01".equals(landUser.get("userType").toString())){
Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString());
//运营商看自己的场站
list = xhpcStatisticsServiceMapper.getDateIntervalPage(chargingStationId, internetUserId, operatorId, startTime, endTime, 1,logOperatorId);
@ -287,7 +287,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService {
Map<String, Object> landUser = xhpcHistoryOrderService.getLandUser(logUserId);
if(landUser !=null){
if(landUser.get("userType") !=null){
if("01".equals(landUser.get("userType").toString()) || "03".equals(landUser.get("userType").toString())){
if("01".equals(landUser.get("userType").toString())){
Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString());
//运营商看自己的场站
list = xhpcStatisticsServiceMapper.getTerminalIntervalPage(chargingStationId, terminalId, operatorId, startTime, endTime, 1,logOperatorId);
@ -314,7 +314,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService {
Map<String, Object> landUser = xhpcHistoryOrderService.getLandUser(logUserId);
if(landUser !=null){
if(landUser.get("userType") !=null){
if("01".equals(landUser.get("userType").toString()) || "03".equals(landUser.get("userType").toString())){
if("01".equals(landUser.get("userType").toString())){
Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString());
//运营商看自己的场站
return AjaxResult.success(xhpcStatisticsServiceMapper.getChargingStationList(operatorId, logOperatorId, 1));
@ -338,7 +338,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService {
Map<String, Object> landUser = xhpcHistoryOrderService.getLandUser(logUserId);
if(landUser !=null){
if(landUser.get("userType") !=null){
if("01".equals(landUser.get("userType").toString()) || "03".equals(landUser.get("userType").toString())){
if("01".equals(landUser.get("userType").toString())){
Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString());
//运营商看自己的场站
return AjaxResult.success(xhpcStatisticsServiceMapper.getOperatorList(operatorId, logOperatorId, 1));
@ -368,7 +368,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService {
Map<String, Object> landUser = xhpcHistoryOrderService.getLandUser(logUserId);
if(landUser !=null){
if(landUser.get("userType") !=null){
if("01".equals(landUser.get("userType").toString()) || "03".equals(landUser.get("userType").toString())){
if("01".equals(landUser.get("userType").toString())){
Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString());
//运营商看自己的场站
return AjaxResult.success(xhpcStatisticsServiceMapper.getTerminalList(chargingStationId, logOperatorId, 1));

View File

@ -87,6 +87,10 @@
<artifactId>shiro-core</artifactId>
<version>1.4.2</version>
</dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common-log</artifactId>
</dependency>
</dependencies>

View File

@ -16,6 +16,8 @@ import com.xhpc.common.core.utils.sign.Base64;
import com.xhpc.common.core.web.controller.BaseController;
import com.xhpc.common.core.web.domain.AjaxResult;
import com.xhpc.common.core.web.page.TableDataInfo;
import com.xhpc.common.log.annotation.Log;
import com.xhpc.common.log.enums.BusinessType;
import com.xhpc.user.service.IXhpcAppUserUserService;
import io.swagger.annotations.ApiOperation;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
@ -70,15 +72,16 @@ public class XhpcAppUserController extends BaseController {
*/
//@PreAuthorize(hasPermi = "app:user:page")
@GetMapping("/page")
public TableDataInfo page(String phone) {
public TableDataInfo page(HttpServletRequest request,String phone) {
startPage();
List<Map<String, Object>> list = iXhpcAppUserUserService.selectAppUserList(phone);
List<Map<String, Object>> list = iXhpcAppUserUserService.selectAppUserList(request,phone);
return getDataTable(list);
}
/**
* 禁用/启用C端用户
*/
@Log(title = "C端用户--(禁用/启用)", businessType = BusinessType.UPDATE)
@ApiOperation("禁用/启用C端用户")
//@PreAuthorize(hasPermi = "app:user:status")
@PostMapping("/status")
@ -110,6 +113,7 @@ public class XhpcAppUserController extends BaseController {
/**
* C端用户注册
*/
@Log(title = "C端用户--注册", businessType = BusinessType.INSERT)
@ApiOperation("注册")
@PostMapping("/register")
public R<?> register(@RequestBody Map<String, Object> map) {
@ -304,16 +308,4 @@ public class XhpcAppUserController extends BaseController {
return R.fail(HttpStatus.ERROR_STATUS, "修改失败");
}
public static void main(String[] args) {
try {
}catch (Exception e){
e.printStackTrace();
}
}
}

View File

@ -3,16 +3,12 @@ package com.xhpc.user.controller;
import com.xhpc.common.core.web.controller.BaseController;
import com.xhpc.common.core.web.domain.AjaxResult;
import com.xhpc.common.util.UserTypeUtil;
import com.xhpc.user.dto.MechanismDto;
import com.xhpc.user.service.IXhpcCommonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 公共的内
* @author yuyang
@ -34,21 +30,21 @@ public class XhpcCommonController extends BaseController {
* @return
*/
@GetMapping(value = "/getUser")
public AjaxResult getMechanism(String phone,Long userId,Integer userType,String serialNumber) {
public AjaxResult getMechanism(String phone,Long userId,Integer userType,String serialNumber,String tenantId) {
if(phone !=null || "".equals(phone)){
if(!UserTypeUtil.COMMUNIT.equals(phone.substring(0,2)) && !UserTypeUtil.CUSTOMERS.equals(phone.substring(0,2))){
//C端用户
return AjaxResult.success(xhpcCommonService.getLandUser(phone,null,0,serialNumber));
return AjaxResult.success(xhpcCommonService.getLandUser(phone,null,0,serialNumber,tenantId));
}else if (UserTypeUtil.COMMUNIT.equals(phone.substring(0,2))){
//社区用户
return AjaxResult.success(xhpcCommonService.getLandUser(phone,null,2,serialNumber));
return AjaxResult.success(xhpcCommonService.getLandUser(phone,null,2,serialNumber,tenantId));
}else if (UserTypeUtil.CUSTOMERS.equals(phone.substring(0,2))){
//大客户用户
return AjaxResult.success(xhpcCommonService.getLandUser(phone,null,3,serialNumber));
return AjaxResult.success(xhpcCommonService.getLandUser(phone,null,3,serialNumber,tenantId));
}
}else{
return AjaxResult.success(xhpcCommonService.getLandUser(null,userId,userType,serialNumber));
return AjaxResult.success(xhpcCommonService.getLandUser(null,userId,userType,serialNumber,tenantId));
}
return AjaxResult.error();
}

View File

@ -3,6 +3,8 @@ package com.xhpc.user.controller;
import com.xhpc.common.core.web.controller.BaseController;
import com.xhpc.common.core.web.domain.AjaxResult;
import com.xhpc.common.core.web.page.TableDataInfo;
import com.xhpc.common.log.annotation.Log;
import com.xhpc.common.log.enums.BusinessType;
import com.xhpc.user.domain.XhpcCommunity;
import com.xhpc.user.domain.XhpcCommunityPersonnel;
import com.xhpc.user.service.IXhpcCommunityService;
@ -38,6 +40,7 @@ public class XhpcCommunityController extends BaseController {
*
* @return
*/
@Log(title = "社区", businessType = BusinessType.INSERT)
@PostMapping(value = "/addCommunity")
public AjaxResult addCommunity(@RequestBody XhpcCommunity xhpcCommunity) {
return xhpcCommunityService.addCommunity(xhpcCommunity);

View File

@ -68,7 +68,7 @@ public class XhpcCommunity extends BaseEntity {
* 数据维度 0 地区 1.运营商 2. 运营商地区
*/
@NotEmpty(message = "数据维度不能为空")
private Integer dimension;
private String dimension;
/**
* 是否有不参与合作的场站 0 没有 1有

View File

@ -67,7 +67,7 @@ public class XhpcCustomers extends BaseEntity {
* 数据维度 0 地区 1.运营商 2. 运营商地区
*/
@NotEmpty(message = "数据维度不能为空")
private Integer dimension;
private String dimension;
/**
* 是否有不参与合作的场站 0 没有 1有

View File

@ -61,7 +61,7 @@ public interface MechanismMapper {
/**
* 添加数据维度
*/
int addMechanism(@Param("chargingStationIds") List<String> chargingStationIds,@Param("mechanismId")Long mechanismId,@Param("source")Integer source);
int insertMechanism(@Param("chargingStationIds") List<String> chargingStationIds,@Param("mechanismId")Long mechanismId,@Param("source")Integer source);
/**
* 增加一条平台充值记录

View File

@ -52,7 +52,7 @@ public interface XhpcAppUserMapper {
* @param phone 手机号
* @return 结果
*/
public List<Map<String, Object>> selectAppUserList(@Param("phone") String phone);
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);
@ -80,7 +80,7 @@ public interface XhpcAppUserMapper {
/**
* 记录登录用户的最后一次数据
*/
int addUserLoginTime(@Param("appUserId")Long appUserId, @Param("account")String account, @Param("userType")Integer userType, @Param("openId")String openId,@Param("type")Integer type,@Param("status")Integer status);
int addUserLoginTime(@Param("appUserId")Long appUserId, @Param("account")String account, @Param("userType")Integer userType, @Param("openId")String openId,@Param("type")Integer type,@Param("status")Integer status,@Param("tenantId")String tenantId);
/**
* 修改社区用户信息

View File

@ -14,15 +14,15 @@ public interface XhpcCommonMapper {
/**
* C端用户信息
*/
Map<String, Object> getAppUser(@Param("phone") String phone,@Param("userId")Long userId);
Map<String, Object> getAppUser(@Param("phone") String phone,@Param("userId")Long userId,@Param("tenantId") String tenantId);
/**
* 社区端用户信息
*/
Map<String, Object> getCommunityUser(@Param("phone") String phone,@Param("userId")Long userId,@Param("serialNumber")String serialNumber);
Map<String, Object> getCommunityUser(@Param("phone") String phone,@Param("userId")Long userId,@Param("serialNumber")String serialNumber,@Param("tenantId") String tenantId);
/**
* B端用户信息
*/
Map<String, Object> getCustomersUser(@Param("phone") String phone,@Param("userId")Long userId,@Param("serialNumber")String serialNumber);
Map<String, Object> getCustomersUser(@Param("phone") String phone,@Param("userId")Long userId,@Param("serialNumber")String serialNumber,@Param("tenantId") String tenantId);
}

View File

@ -38,7 +38,7 @@ public interface IXhpcAppUserUserService {
* @param phone 手机号
* @return 结果
*/
public List<Map<String, Object>> selectAppUserList(String phone);
public List<Map<String, Object>> selectAppUserList(HttpServletRequest request,String phone);
public Map<String, Object> userSum(String phone);

View File

@ -11,5 +11,5 @@ public interface IXhpcCommonService {
/**
* 根据用户手机号获取用户信息
*/
Map<String, Object> getLandUser(String phone,Long userId,Integer type,String serialNumber);
Map<String, Object> getLandUser(String phone,Long userId,Integer type,String serialNumber,String tenantId);
}

View File

@ -37,7 +37,7 @@ public class IMechanismServiceImpl implements IMechanismService {
Map<String, Object> landUser = mechanismMapper.getLandUser(logUserId);
if(landUser !=null){
if(landUser.get("userType") !=null){
if("01".equals(landUser.get("userType").toString()) || "03".equals(landUser.get("userType").toString())){
if("01".equals(landUser.get("userType").toString())){
Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString());
logUserId=logOperatorId;
type =1;
@ -65,7 +65,7 @@ public class IMechanismServiceImpl implements IMechanismService {
@Override
public int addMechanism(List<String> chargingStationIds, Long mechanismId, Integer source) {
return mechanismMapper.addMechanism(chargingStationIds, mechanismId, source);
return mechanismMapper.insertMechanism(chargingStationIds, mechanismId, source);
}
@Override

View File

@ -86,8 +86,10 @@ public class XhpcAppUserServiceImpl implements IXhpcAppUserUserService {
* @return 结果
*/
@Override
public List<Map<String, Object>> selectAppUserList(String phone) {
return xhpcAppUserMapper.selectAppUserList(phone);
public List<Map<String, Object>> selectAppUserList(HttpServletRequest request,String phone) {
LoginUser logUser = logUserUtils.getLogUser(request);
return xhpcAppUserMapper.selectAppUserList(phone,logUser.getTenantId());
}
@Override
@ -166,6 +168,7 @@ public class XhpcAppUserServiceImpl implements IXhpcAppUserUserService {
String password = phone.substring(phone.length() - 6);
xhpcAppUser.setPassword(SecurityUtils.encryptPassword(password));
xhpcAppUser.setCreateTime(new Date());
xhpcAppUser.setTenantId(tenantId);
xhpcAppUserMapper.insert(xhpcAppUser);
redisService.deleteObject("pvToken:"+phone);
return appLogin(phone, type, openid, tenantId);
@ -221,7 +224,7 @@ public class XhpcAppUserServiceImpl implements IXhpcAppUserUserService {
//判断账号
String sub = username.substring(0, 2);
if (UserTypeUtil.COMMUNIT.equals(sub) || UserTypeUtil.CUSTOMERS.equals(sub)){
R user = userTypeService.getUser(username, null, null, null);
R user = userTypeService.getUser(username, null, null, null,tenantId);
if(user !=null && user.getData() !=null){
Map<String, Object> map = (Map<String, Object>)user.getData();
LoginUser userInfo = new LoginUser();
@ -252,7 +255,7 @@ public class XhpcAppUserServiceImpl implements IXhpcAppUserUserService {
}
}
//添加最后一次登录数据
xhpcAppUserMapper.addUserLoginTime(appUserId,username,userInfo.getUserType(),openid,Integer.valueOf(type),null);
xhpcAppUserMapper.addUserLoginTime(appUserId,username,userInfo.getUserType(),openid,Integer.valueOf(type),null,tenantId);
redisService.deleteObject("pvToken:" + username);
// 获取登录token
@ -315,7 +318,7 @@ public class XhpcAppUserServiceImpl implements IXhpcAppUserUserService {
redisService.deleteObject("pvToken:" + user.getPhone());
//添加最后一次登录数据
xhpcAppUserMapper.addUserLoginTime(user.getAppUserId(),username,userInfo.getUserType(),openid,Integer.valueOf(type),UserConstants.LOGIN);
xhpcAppUserMapper.addUserLoginTime(user.getAppUserId(),username,userInfo.getUserType(),openid,Integer.valueOf(type),UserConstants.LOGIN,tenantId);
// 获取登录token
return R.ok(tokenService.createToken(userInfo));
}
@ -335,7 +338,8 @@ public class XhpcAppUserServiceImpl implements IXhpcAppUserUserService {
Integer userType = loginUser.getUserType();
Long userid = loginUser.getUserid();
String openId = loginUser.getOpenId();
R user = userTypeService.getUser(null, userid, userType, null);
String tenantId = loginUser.getTenantId();
R user = userTypeService.getUser(null, userid, userType, null,tenantId);
if(user !=null && user.getData() !=null){
if(UserTypeUtil.USER_TYPE==userType){
XhpcAppUser appUser = xhpcAppUserMapper.getAppUserByPhone(username);
@ -347,7 +351,7 @@ public class XhpcAppUserServiceImpl implements IXhpcAppUserUserService {
}
xhpcAppUserMapper.update(appUser);
//添加最后一次登录数据
xhpcAppUserMapper.addUserLoginTime(appUser.getAppUserId(),username,userType,openId,Integer.valueOf(type),UserConstants.NO_LOGIN);
xhpcAppUserMapper.addUserLoginTime(appUser.getAppUserId(),username,userType,openId,Integer.valueOf(type),UserConstants.NO_LOGIN,tenantId);
}
}else if(UserTypeUtil.COMMUNIT_TYPE==userType){
if (StatusConstants.OPERATION_WX_TYPE.equals(type)) {
@ -356,7 +360,7 @@ public class XhpcAppUserServiceImpl implements IXhpcAppUserUserService {
xhpcAppUserMapper.updateCommunityPersonnel(userid,null,null,null,UserConstants.NO_LOGIN);
}
//添加最后一次登录数据
xhpcAppUserMapper.addUserLoginTime(userid,username,userType,openId,Integer.valueOf(type),UserConstants.NO_LOGIN);
xhpcAppUserMapper.addUserLoginTime(userid,username,userType,openId,Integer.valueOf(type),UserConstants.NO_LOGIN,tenantId);
}else if(UserTypeUtil.CUSTOMERS_TYPE==userType){
if (StatusConstants.OPERATION_WX_TYPE.equals(type)) {
xhpcAppUserMapper.updateCustomersPersonnel(userid,null,null,UserConstants.NO_LOGIN,null);
@ -364,7 +368,7 @@ public class XhpcAppUserServiceImpl implements IXhpcAppUserUserService {
xhpcAppUserMapper.updateCustomersPersonnel(userid,null,null,null,UserConstants.NO_LOGIN);
}
//添加最后一次登录数据
xhpcAppUserMapper.addUserLoginTime(userid,username,userType,openId,Integer.valueOf(type),UserConstants.NO_LOGIN);
xhpcAppUserMapper.addUserLoginTime(userid,username,userType,openId,Integer.valueOf(type),UserConstants.NO_LOGIN,tenantId);
}
}
// 删除用户缓存记录
@ -407,7 +411,7 @@ public class XhpcAppUserServiceImpl implements IXhpcAppUserUserService {
//根据不同的用户类型查询不同的信息
Long userid = loginUser.getUserid();
Integer userType = loginUser.getUserType();
R user = userTypeService.getUser(null, loginUser.getUserid(), loginUser.getUserType(), null);
R user = userTypeService.getUser(null, loginUser.getUserid(), loginUser.getUserType(), null,loginUser.getTenantId());
if(user !=null && user.getData() !=null){
Map<String, Object> map = (Map<String, Object>)user.getData();
//发票留言板版本客服电话

View File

@ -20,13 +20,13 @@ public class XhpcCommonServiceImpl implements IXhpcCommonService {
private XhpcCommonMapper xhpcCommonMapper;
@Override
public Map<String, Object> getLandUser(String phone,Long userId, Integer type,String serialNumber) {
public Map<String, Object> getLandUser(String phone,Long userId, Integer type,String serialNumber,String tenantId) {
if(type==0){
return xhpcCommonMapper.getAppUser(phone,userId);
return xhpcCommonMapper.getAppUser(phone,userId,tenantId);
}else if(type==2){
return xhpcCommonMapper.getCommunityUser(phone,userId,serialNumber);
return xhpcCommonMapper.getCommunityUser(phone,userId,serialNumber,tenantId);
}else if(type==3){
return xhpcCommonMapper.getCustomersUser(phone,userId,serialNumber);
return xhpcCommonMapper.getCustomersUser(phone,userId,serialNumber,tenantId);
}
return new HashMap<>();
}

View File

@ -132,7 +132,7 @@
<update id="updateMechanism">
update xhpc_mechanism set del_flag =1 where mechanism_id=#{mechanismId} and source=#{source }
</update>
<insert id="addMechanism">
<insert id="insertMechanism">
insert into xhpc_mechanism (charging_station_id,mechanism_id,source) VALUES
<foreach collection="chargingStationIds" item="item" open="(" separator="),(" close=")">
#{item},#{mechanismId},#{source}

View File

@ -50,7 +50,7 @@
<if test="null != avatar and '' != avatar">
avatar,
</if>
<if test="null != tenantId ">
<if test="null != tenantId and tenantId !=''">
tenant_id,
</if>
<if test="null != balance and '' != balance">
@ -181,7 +181,7 @@
weixin_login weixinlogin,alipay_login alipayLogin,is_refund_application isRefundApplication,
alipay_open_id alipayOpenId, avatar, balance, password,
`status`,create_by createBy ,create_time createTime,
update_time updateTime, update_by updateBy,
update_time updateTime, update_by updateBy,tenant_id tenantId,
del_flag delflag, remark,soc,
CASE WHEN `status` = 0 THEN '正常' else '禁用' end statusName
from xhpc_app_user
@ -200,6 +200,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>
@ -259,6 +262,9 @@
<if test="null != status">
status,
</if>
<if test="tenantId !=null and tenantId !=''">
tenant_id
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="null != appUserId">
@ -279,6 +285,9 @@
<if test="null != status">
#{status},
</if>
<if test="tenantId !=null and tenantId !=''">
#{tenantId},
</if>
</trim>
</insert>

View File

@ -32,6 +32,9 @@
<if test="userId !=null">
and app_user_id =#{userId}
</if>
<if test="tenantId !=null and tenantId !=''">
and tenant_id =#{tenantId}
</if>
</select>
<select id="getCommunityUser" resultType="map">
@ -64,6 +67,9 @@
<if test="userId !=null">
and community_personnel_id =#{userId}
</if>
<if test="tenantId !=null and tenantId !=''">
and tenant_id =#{tenantId}
</if>
</select>
<select id="getCustomersUser" resultType="map">
@ -96,5 +102,8 @@
<if test="userId !=null">
and customers_personnel_id =#{userId}
</if>
<if test="tenantId !=null and tenantId !=''">
and tenant_id =#{tenantId}
</if>
</select>
</mapper>