diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingPileServiceImpl.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingPileServiceImpl.java index 4b3f54e5..1ccc4f00 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingPileServiceImpl.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingPileServiceImpl.java @@ -92,7 +92,7 @@ public class XhpcChargingPileServiceImpl implements IXhpcChargingPileService { Map 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{ diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java index 7a7181bc..856838be 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java @@ -133,7 +133,7 @@ public class XhpcChargingStationServiceImpl implements IXhpcChargingStationServi Map 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); diff --git a/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingPileMapper.xml b/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingPileMapper.xml index ea372367..97e08fc5 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingPileMapper.xml +++ b/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingPileMapper.xml @@ -33,6 +33,7 @@ + select charging_pile_id, @@ -320,42 +321,44 @@ diff --git a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/api/UserTypeService.java b/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/api/UserTypeService.java index c83715d0..0df29642 100644 --- a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/api/UserTypeService.java +++ b/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/api/UserTypeService.java @@ -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); } diff --git a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/api/factory/UserTypeFallbackFactory.java b/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/api/factory/UserTypeFallbackFactory.java index 2d845883..242ff7e3 100644 --- a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/api/factory/UserTypeFallbackFactory.java +++ b/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/api/factory/UserTypeFallbackFactory.java @@ -20,7 +20,7 @@ public class UserTypeFallbackFactory implements FallbackFactory 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()); } }; diff --git a/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcSmsController.java b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcSmsController.java index 94f968b1..3d765ae4 100644 --- a/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcSmsController.java +++ b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcSmsController.java @@ -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 map = (Map)user.getData(); return xhpcSmsService.getLogonPhoneCode(map.get("phone").toString(), signatureName, templateId,map.get("account").toString()); diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcChargeOrderServiceImpl.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcChargeOrderServiceImpl.java index a2b41aaa..7fa31b56 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcChargeOrderServiceImpl.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcChargeOrderServiceImpl.java @@ -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, "请重新登录"); } diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcHistoryOrderServiceImpl.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcHistoryOrderServiceImpl.java index b0f62396..2fd53660 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcHistoryOrderServiceImpl.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcHistoryOrderServiceImpl.java @@ -113,7 +113,7 @@ public class XhpcHistoryOrderServiceImpl implements IXhpcHistoryOrderService { Map 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); diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcRealTimeOrderServiceImpl.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcRealTimeOrderServiceImpl.java index bc31dfa8..ef3fe177 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcRealTimeOrderServiceImpl.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcRealTimeOrderServiceImpl.java @@ -84,7 +84,7 @@ public class XhpcRealTimeOrderServiceImpl implements IXhpcRealTimeOrderService { Map 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); diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcStatisticsServiceImpl.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcStatisticsServiceImpl.java index d01a8e44..96dc351a 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcStatisticsServiceImpl.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcStatisticsServiceImpl.java @@ -172,7 +172,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService { Map 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 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 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 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 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)); diff --git a/xhpc-modules/xhpc-user/pom.xml b/xhpc-modules/xhpc-user/pom.xml index fb9a0938..234db4e5 100644 --- a/xhpc-modules/xhpc-user/pom.xml +++ b/xhpc-modules/xhpc-user/pom.xml @@ -87,6 +87,10 @@ shiro-core 1.4.2 + + com.ruoyi + ruoyi-common-log + diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcAppUserController.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcAppUserController.java index 49dc6a12..84cc89dc 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcAppUserController.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcAppUserController.java @@ -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> list = iXhpcAppUserUserService.selectAppUserList(phone); + List> 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 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(); - } - } - - - } diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCommonController.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCommonController.java index 4ce0bc3d..e9f532e4 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCommonController.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCommonController.java @@ -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(); } diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCommunityController.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCommunityController.java index 6c486e31..8accd938 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCommunityController.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCommunityController.java @@ -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); diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/XhpcCommunity.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/XhpcCommunity.java index 7ec02213..465ec492 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/XhpcCommunity.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/XhpcCommunity.java @@ -68,7 +68,7 @@ public class XhpcCommunity extends BaseEntity { * 数据维度 0 地区 1.运营商 2. 运营商地区 */ @NotEmpty(message = "数据维度不能为空") - private Integer dimension; + private String dimension; /** * 是否有不参与合作的场站 (0 没有 1有) diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/XhpcCustomers.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/XhpcCustomers.java index e7d2c72f..b51efe35 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/XhpcCustomers.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/XhpcCustomers.java @@ -67,7 +67,7 @@ public class XhpcCustomers extends BaseEntity { * 数据维度 0 地区 1.运营商 2. 运营商地区 */ @NotEmpty(message = "数据维度不能为空") - private Integer dimension; + private String dimension; /** * 是否有不参与合作的场站 (0 没有 1有) diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/MechanismMapper.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/MechanismMapper.java index 7fd0d75d..b84cdff2 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/MechanismMapper.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/MechanismMapper.java @@ -61,7 +61,7 @@ public interface MechanismMapper { /** * 添加数据维度 */ - int addMechanism(@Param("chargingStationIds") List chargingStationIds,@Param("mechanismId")Long mechanismId,@Param("source")Integer source); + int insertMechanism(@Param("chargingStationIds") List chargingStationIds,@Param("mechanismId")Long mechanismId,@Param("source")Integer source); /** * 增加一条平台充值记录 diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcAppUserMapper.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcAppUserMapper.java index 9e84dad4..9c8953b6 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcAppUserMapper.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcAppUserMapper.java @@ -52,7 +52,7 @@ public interface XhpcAppUserMapper { * @param phone 手机号 * @return 结果 */ - public List> selectAppUserList(@Param("phone") String phone); + public List> selectAppUserList(@Param("phone") String phone,@Param("tenantId") String tenantId); public Map 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); /** * 修改社区用户信息 diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcCommonMapper.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcCommonMapper.java index e229d9cc..6f8814aa 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcCommonMapper.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcCommonMapper.java @@ -14,15 +14,15 @@ public interface XhpcCommonMapper { /** * C端用户信息 */ - Map getAppUser(@Param("phone") String phone,@Param("userId")Long userId); + Map getAppUser(@Param("phone") String phone,@Param("userId")Long userId,@Param("tenantId") String tenantId); /** * 社区端用户信息 */ - Map getCommunityUser(@Param("phone") String phone,@Param("userId")Long userId,@Param("serialNumber")String serialNumber); + Map getCommunityUser(@Param("phone") String phone,@Param("userId")Long userId,@Param("serialNumber")String serialNumber,@Param("tenantId") String tenantId); /** * B端用户信息 */ - Map getCustomersUser(@Param("phone") String phone,@Param("userId")Long userId,@Param("serialNumber")String serialNumber); + Map getCustomersUser(@Param("phone") String phone,@Param("userId")Long userId,@Param("serialNumber")String serialNumber,@Param("tenantId") String tenantId); } diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcAppUserUserService.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcAppUserUserService.java index 87be4a99..15814e66 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcAppUserUserService.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcAppUserUserService.java @@ -38,7 +38,7 @@ public interface IXhpcAppUserUserService { * @param phone 手机号 * @return 结果 */ - public List> selectAppUserList(String phone); + public List> selectAppUserList(HttpServletRequest request,String phone); public Map userSum(String phone); diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcCommonService.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcCommonService.java index 9718d4d9..3cf0b017 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcCommonService.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcCommonService.java @@ -11,5 +11,5 @@ public interface IXhpcCommonService { /** * 根据用户手机号获取用户信息 */ - Map getLandUser(String phone,Long userId,Integer type,String serialNumber); + Map getLandUser(String phone,Long userId,Integer type,String serialNumber,String tenantId); } diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/IMechanismServiceImpl.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/IMechanismServiceImpl.java index 412261a8..f73238fd 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/IMechanismServiceImpl.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/IMechanismServiceImpl.java @@ -37,7 +37,7 @@ public class IMechanismServiceImpl implements IMechanismService { Map 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 chargingStationIds, Long mechanismId, Integer source) { - return mechanismMapper.addMechanism(chargingStationIds, mechanismId, source); + return mechanismMapper.insertMechanism(chargingStationIds, mechanismId, source); } @Override diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcAppUserServiceImpl.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcAppUserServiceImpl.java index 1e228198..da124abf 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcAppUserServiceImpl.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcAppUserServiceImpl.java @@ -86,8 +86,10 @@ public class XhpcAppUserServiceImpl implements IXhpcAppUserUserService { * @return 结果 */ @Override - public List> selectAppUserList(String phone) { - return xhpcAppUserMapper.selectAppUserList(phone); + public List> 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 map = (Map)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 map = (Map)user.getData(); //发票、留言板、版本、客服电话 diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCommonServiceImpl.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCommonServiceImpl.java index f4851edb..01555ce1 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCommonServiceImpl.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCommonServiceImpl.java @@ -20,13 +20,13 @@ public class XhpcCommonServiceImpl implements IXhpcCommonService { private XhpcCommonMapper xhpcCommonMapper; @Override - public Map getLandUser(String phone,Long userId, Integer type,String serialNumber) { + public Map 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<>(); } diff --git a/xhpc-modules/xhpc-user/src/main/resources/mapper/MechanismMapper.xml b/xhpc-modules/xhpc-user/src/main/resources/mapper/MechanismMapper.xml index 5908be56..a651dab8 100644 --- a/xhpc-modules/xhpc-user/src/main/resources/mapper/MechanismMapper.xml +++ b/xhpc-modules/xhpc-user/src/main/resources/mapper/MechanismMapper.xml @@ -132,7 +132,7 @@ update xhpc_mechanism set del_flag =1 where mechanism_id=#{mechanismId} and source=#{source } - + insert into xhpc_mechanism (charging_station_id,mechanism_id,source) VALUES #{item},#{mechanismId},#{source} diff --git a/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcAppUserMapper.xml b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcAppUserMapper.xml index 763961c4..01d4a3b6 100644 --- a/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcAppUserMapper.xml +++ b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcAppUserMapper.xml @@ -50,7 +50,7 @@ avatar, - + tenant_id, @@ -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 @@ and xau.phone like concat('%', #{phone}, '%') + + and xau.tenant_id=#{tenantId} + ORDER BY xau.create_time DESC @@ -259,6 +262,9 @@ status, + + tenant_id + @@ -279,6 +285,9 @@ #{status}, + + #{tenantId}, + diff --git a/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcCommonMapper.xml b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcCommonMapper.xml index 8ee46909..b3339669 100644 --- a/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcCommonMapper.xml +++ b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcCommonMapper.xml @@ -32,6 +32,9 @@ and app_user_id =#{userId} + + and tenant_id =#{tenantId} +