diff --git a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysUser.java b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysUser.java index 736d66cb..81f38823 100644 --- a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysUser.java +++ b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysUser.java @@ -68,6 +68,12 @@ public class SysUser extends BaseEntity @Excel(name = "权限类型", readConverterExp = "0=所有,1=运营商所有,2=子账号,3=流量账号") private Integer dataPowerType; + /** + * 流量用户id + */ + private Long internetUserId; + + /** 用户头像 */ private String avatar; @@ -351,6 +357,14 @@ public class SysUser extends BaseEntity this.userType = userType; } + public Long getInternetUserId() { + return internetUserId; + } + + public void setInternetUserId(Long internetUserId) { + this.internetUserId = internetUserId; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java index db88224d..e812738a 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java @@ -1,21 +1,5 @@ package com.ruoyi.system.controller; -import java.io.IOException; -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; -import javax.servlet.http.HttpServletResponse; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.multipart.MultipartFile; import com.ruoyi.common.core.constant.UserConstants; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.utils.SecurityUtils; @@ -34,6 +18,16 @@ import com.ruoyi.system.service.ISysPermissionService; import com.ruoyi.system.service.ISysPostService; import com.ruoyi.system.service.ISysRoleService; import com.ruoyi.system.service.ISysUserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; /** * 用户信息 @@ -176,11 +170,6 @@ public class SysUserController extends BaseController { return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,手机号码已存在"); } - else if (StringUtils.isNotEmpty(user.getEmail()) - && UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user))) - { - return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在"); - } user.setCreateBy(SecurityUtils.getUsername()); user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); return toAjax(userService.insertUser(user)); diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/RemoteSystemService.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/IXhpcOperatorInternetBlacklistService.xml similarity index 100% rename from ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/RemoteSystemService.xml rename to ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/IXhpcOperatorInternetBlacklistService.xml diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml index 3bf4e221..de18a303 100644 --- a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -1,51 +1,52 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - + + + + + + + select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, @@ -56,164 +57,177 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join sys_user_role ur on u.user_id = ur.user_id left join sys_role r on r.role_id = ur.role_id - + - - - - - - - - - - + + + + + + + + + + - - select user_id, phonenumber from sys_user where phonenumber = #{phonenumber} limit 1 - - select user_id, email from sys_user where email = #{email} limit 1 - - - insert into sys_user( - user_id, - dept_id, - user_name, - nick_name, - email, - avatar, - phonenumber, - sex, - password, - status, - create_by, - remark, - create_time - )values( - #{userId}, - #{deptId}, - #{userName}, - #{nickName}, - #{email}, - #{avatar}, - #{phonenumber}, - #{sex}, - #{password}, - #{status}, - #{createBy}, - #{remark}, - sysdate() - ) - - - - update sys_user - - dept_id = #{deptId}, - user_name = #{userName}, - nick_name = #{nickName}, - email = #{email}, - phonenumber = #{phonenumber}, - sex = #{sex}, - avatar = #{avatar}, - password = #{password}, - status = #{status}, - login_ip = #{loginIp}, - login_date = #{loginDate}, - update_by = #{updateBy}, - remark = #{remark}, - update_time = sysdate() - - where user_id = #{userId} - - - + + + insert into sys_user( + user_id, + dept_id, + user_name, + nick_name, + email, + avatar, + phonenumber, + operator_id, + internet_user_id, + data_power_type, + sex, + password, + status, + create_by, + remark, + create_time + )values( + #{userId}, + #{deptId}, + #{userName}, + #{nickName}, + #{email}, + #{avatar}, + #{phonenumber}, + #{operatorId}, + #{internetUserId}, + #{dataPowerType}, + #{sex}, + #{password}, + #{status}, + #{createBy}, + #{remark}, + sysdate() + ) + + + + update sys_user + + dept_id = #{deptId}, + user_name = #{userName}, + nick_name = #{nickName}, + email = #{email}, + phonenumber = #{phonenumber}, + operator_id = #{operatorId}, + internet_user_id = #{internetUserId}, + data_power_type = #{dataPowerType}, + sex = #{sex}, + avatar = #{avatar}, + password = #{password}, + status = #{status}, + login_ip = #{loginIp}, + login_date = #{loginDate}, + update_by = #{updateBy}, + remark = #{remark}, + update_time = sysdate() + + where user_id = #{userId} + + + update sys_user set status = #{status} where user_id = #{userId} - - + + update sys_user set avatar = #{avatar} where user_name = #{userName} - - + + update sys_user set password = #{password} where user_name = #{userName} - - + + update sys_user set del_flag = '2' where user_id = #{userId} - - - update sys_user set del_flag = '2' where user_id in - - #{userId} - - - + + + update sys_user set del_flag = '2' where user_id in + + #{userId} + + + \ No newline at end of file diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/UserApplication.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/UserApplication.java index 63a96a6b..85f75015 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/UserApplication.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/UserApplication.java @@ -1,9 +1,17 @@ package com.xhpc.user; +import com.ruoyi.common.security.annotation.EnableCustomConfig; +import com.ruoyi.common.security.annotation.EnableRyFeignClients; +import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.openfeign.EnableFeignClients; +@EnableCustomConfig +@EnableRyFeignClients +@EnableFeignClients @SpringBootApplication +@MapperScan("com.xhpc.user.mapper") public class UserApplication { public static void main(String[] args) { diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcInternetUserController.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcInternetUserController.java new file mode 100644 index 00000000..d5df7e1d --- /dev/null +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcInternetUserController.java @@ -0,0 +1,139 @@ +package com.xhpc.user.controller; + +import com.ruoyi.common.core.utils.SecurityUtils; +import com.ruoyi.common.core.web.controller.BaseController; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.common.core.web.page.TableDataInfo; +import com.ruoyi.common.security.annotation.PreAuthorize; +import com.ruoyi.system.api.domain.SysUser; +import com.xhpc.user.domain.XhpcInternetUser; +import com.xhpc.user.openfeign.RemoteSystemService; +import com.xhpc.user.service.IXhpcInternetUserService; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + +/** + * 流量用户 + * + * @author ruoyi + */ +@RestController +@RequestMapping("/internet") +public class XhpcInternetUserController extends BaseController { + + @Autowired + private IXhpcInternetUserService iXhpcInternetUserService; + + @Autowired + private RemoteSystemService remoteSystemService; + + + /** + * 新增流量用户 + */ + @ApiOperation("新增流量用户") + @PreAuthorize(hasPermi = "user:internet:add") + @PostMapping("/add") + public AjaxResult add(@RequestBody XhpcInternetUser xhpcInternetUser) { + SysUser sysUser = new SysUser(); + sysUser.setUserName(xhpcInternetUser.getPhone()); + sysUser.setNickName(xhpcInternetUser.getName()); + sysUser.setPhonenumber(xhpcInternetUser.getPhone()); + sysUser.setDeptId(103l); + sysUser.setSex("0"); + sysUser.setUserType("02"); + sysUser.setDataPowerType(3); + sysUser.setCreateBy(SecurityUtils.getUsername()); + sysUser.setPassword(SecurityUtils.encryptPassword(xhpcInternetUser.getPhone())); + AjaxResult ajaxResult = remoteSystemService.addUser(sysUser); + if (null != ajaxResult && !"200".equals(ajaxResult.get("code"))) { + return ajaxResult; + } + return toAjax(iXhpcInternetUserService.insert(xhpcInternetUser)); + } + + /** + * 修改流量用户 + */ + @ApiOperation("修改流量用户") + @PreAuthorize(hasPermi = "user:internet:edit") + @PostMapping("/edit") + public AjaxResult edit(@RequestBody XhpcInternetUser xhpcInternetUser) { + if (null == xhpcInternetUser.getInternetUserId()) { + return AjaxResult.error("用户id不能为空"); + } + SysUser sysUser = new SysUser(); + sysUser.setUserName(xhpcInternetUser.getPhone()); + sysUser.setNickName(xhpcInternetUser.getName()); + sysUser.setPhonenumber(xhpcInternetUser.getPhone()); + sysUser.setDeptId(103l); + sysUser.setSex("0"); + sysUser.setUserType("02"); + sysUser.setDataPowerType(3); + sysUser.setCreateBy(SecurityUtils.getUsername()); + sysUser.setPassword(SecurityUtils.encryptPassword(xhpcInternetUser.getPhone())); + AjaxResult ajaxResult = remoteSystemService.editUser(sysUser); + if (null != ajaxResult && !"200".equals(ajaxResult.get("code"))) { + return ajaxResult; + } + return toAjax(iXhpcInternetUserService.update(xhpcInternetUser)); + } + + /** + * 删除流量用户 + */ + @ApiOperation("删除流量用户") + @PreAuthorize(hasPermi = "user:internet:remove") + @PostMapping("/remove") + public AjaxResult remove(@RequestBody Long[] ids) { + iXhpcInternetUserService.deleteByIds(ids); + return AjaxResult.success(); + } + + /** + * 流量用户详情 + */ + @ApiOperation("流量用户详情") + @PreAuthorize(hasPermi = "user:internet:info") + @GetMapping("/info") + public AjaxResult info(@RequestBody Long internetUserId) { + return AjaxResult.success(iXhpcInternetUserService.info(internetUserId)); + } + + /** + * 流量用户分页列表 + */ + @PreAuthorize(hasPermi = "system:internet:page") + @GetMapping("/page") + public TableDataInfo page(String name, String contactName, String contactPhone) { + startPage(); + List> list = iXhpcInternetUserService.selectInternetList(name, contactName, contactPhone); + return getDataTable(list); + } + + /** + * 禁用/启用流量用户 + */ + @ApiOperation("禁用/启用流量用户") + @PreAuthorize(hasPermi = "user:internet:status") + @PostMapping("/status") + public AjaxResult status(@RequestBody Long id) { + iXhpcInternetUserService.status(id); + return AjaxResult.success(); + } + + /** + * 流量用户列表 + */ + @ApiOperation("流量用户列表") + @PreAuthorize(hasPermi = "user:internet:list") + @GetMapping("/list") + public TableDataInfo list(String name) { + List> list = iXhpcInternetUserService.list(name); + return getDataTable(list); + } +} diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcOperatorController.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcOperatorController.java index 9791718e..3e781980 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcOperatorController.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcOperatorController.java @@ -46,6 +46,7 @@ public class XhpcOperatorController extends BaseController { sysUser.setPhonenumber(xhpcOperator.getPhone()); sysUser.setDeptId(103l); sysUser.setSex("0"); + sysUser.setUserType("01"); sysUser.setDataPowerType(1); sysUser.setCreateBy(SecurityUtils.getUsername()); sysUser.setPassword(SecurityUtils.encryptPassword(xhpcOperator.getPhone())); @@ -69,6 +70,21 @@ public class XhpcOperatorController extends BaseController { if (null == xhpcOperator.getOperatorId()) { return AjaxResult.error("运营商id不能为空"); } + SysUser sysUser = new SysUser(); + sysUser.setUserName(xhpcOperator.getPhone()); + sysUser.setNickName(xhpcOperator.getName()); + sysUser.setEmail(xhpcOperator.getEmail()); + sysUser.setPhonenumber(xhpcOperator.getPhone()); + sysUser.setDeptId(103l); + sysUser.setSex("0"); + sysUser.setUserType("01"); + sysUser.setDataPowerType(1); + sysUser.setCreateBy(SecurityUtils.getUsername()); + sysUser.setPassword(SecurityUtils.encryptPassword(xhpcOperator.getPhone())); + AjaxResult ajaxResult = remoteSystemService.editUser(sysUser); + if (null != ajaxResult && !"200".equals(ajaxResult.get("code"))) { + return ajaxResult; + } if (UserConstants.NOT_UNIQUE.equals(iXhpcOperatorService.checkAccountUnique(xhpcOperator))) { return AjaxResult.error("用户'" + xhpcOperator.getPhone() + "'失败,登录账号已存在"); } @@ -97,11 +113,11 @@ public class XhpcOperatorController extends BaseController { } /** - * 获取运营商列表 + * 获取运营商分页列表 */ - @PreAuthorize(hasPermi = "system:operator:list") - @GetMapping("/list") - public TableDataInfo list(String name, String contactName, String contactPhone) { + @PreAuthorize(hasPermi = "system:operator:page") + @GetMapping("/page") + public TableDataInfo page(String name, String contactName, String contactPhone) { startPage(); List> list = iXhpcOperatorService.selectOperatorList(name, contactName, contactPhone); return getDataTable(list); diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcOperatorInternetBlacklistController.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcOperatorInternetBlacklistController.java new file mode 100644 index 00000000..841a1852 --- /dev/null +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcOperatorInternetBlacklistController.java @@ -0,0 +1,55 @@ +package com.xhpc.user.controller; + +import com.ruoyi.common.core.web.controller.BaseController; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.common.core.web.page.TableDataInfo; +import com.ruoyi.common.security.annotation.PreAuthorize; +import com.xhpc.user.domain.XhpcOperatorInternetBlacklist; +import com.xhpc.user.service.IXhpcOperatorInternetBlacklistService; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + +/** + * 流量用户 + * + * @author ruoyi + */ +@RestController +@RequestMapping("/operator/internet") +public class XhpcOperatorInternetBlacklistController extends BaseController { + + @Autowired + private IXhpcOperatorInternetBlacklistService xhpcOperatorInternetBlacklistService; + + /** + * 新增流量用户 + */ + @ApiOperation("新增流量用户") + @PreAuthorize(hasPermi = "operator:internet:add") + @PostMapping("/add") + public AjaxResult add(@RequestBody List list) { + if (null != list && list.size() > 0) { + Long operatorId = list.get(0).getOperatorId(); + xhpcOperatorInternetBlacklistService.deleteByIds(operatorId); + for (XhpcOperatorInternetBlacklist xhpcOperatorInternetBlacklist : list) { + xhpcOperatorInternetBlacklistService.insert(xhpcOperatorInternetBlacklist); + } + } + return AjaxResult.success(); + } + + /** + * 通过运营商id查询流量方黑名单(包含已选择的黑名单) + */ + @ApiOperation("通过运营商id查询流量方黑名单") + @PreAuthorize(hasPermi = "operator:internet:list") + @GetMapping("/list") + public TableDataInfo list(@RequestParam String operatorId) { + List> list = xhpcOperatorInternetBlacklistService.list(operatorId); + return getDataTable(list); + } +} diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcStationInternetBlacklistController.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcStationInternetBlacklistController.java new file mode 100644 index 00000000..e38917d3 --- /dev/null +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcStationInternetBlacklistController.java @@ -0,0 +1,55 @@ +package com.xhpc.user.controller; + +import com.ruoyi.common.core.web.controller.BaseController; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.common.core.web.page.TableDataInfo; +import com.ruoyi.common.security.annotation.PreAuthorize; +import com.xhpc.user.domain.XhpcStationInternetBlacklist; +import com.xhpc.user.service.IXhpcStationInternetBlacklistService; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + +/** + * 流量用户 + * + * @author ruoyi + */ +@RestController +@RequestMapping("/station/internet") +public class XhpcStationInternetBlacklistController extends BaseController { + + @Autowired + private IXhpcStationInternetBlacklistService iXhpcStationInternetBlacklistService; + + /** + * 新增电站流量方黑名单 + */ + @ApiOperation("新增电站流量方黑名单") + @PreAuthorize(hasPermi = "station:internet:add") + @PostMapping("/add") + public AjaxResult add(@RequestBody List list) { + if (null != list && list.size() > 0) { + Long internetUserId = list.get(0).getInternetUserId(); + iXhpcStationInternetBlacklistService.deleteByIds(internetUserId); + for (XhpcStationInternetBlacklist xhpcStationInternetBlacklist : list) { + iXhpcStationInternetBlacklistService.insert(xhpcStationInternetBlacklist); + } + } + return AjaxResult.success(); + } + + /** + * 通过流量用户id查询电站流量方黑名单(包含已选择的黑名单) + */ + @ApiOperation("通过运营商id查询流量方黑名单") + @PreAuthorize(hasPermi = "station:internet:list") + @GetMapping("/list") + public TableDataInfo list(@RequestParam String internetUserId) { + List> list = iXhpcStationInternetBlacklistService.list(internetUserId); + return getDataTable(list); + } +} diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcUserController.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcUserController.java index d9661d89..b1a35e3b 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcUserController.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcUserController.java @@ -31,11 +31,11 @@ public class XhpcUserController extends BaseController { private RemoteSystemService remoteSystemService; /** - * 获取平台用户列表 + * 获取平台用户分页列表 */ - @PreAuthorize(hasPermi = "user:pc:list") - @GetMapping("/pc/list") - public TableDataInfo pcList(String userName, String nickName) { + @PreAuthorize(hasPermi = "user:pc:page") + @GetMapping("/pc/page") + public TableDataInfo pcpage(String userName, String nickName) { startPage(); List> list = iXhpcUserService.selectPcUserList(userName, nickName); return getDataTable(list); @@ -51,6 +51,7 @@ public class XhpcUserController extends BaseController { sysUser.setPhonenumber(sysUser.getUserName()); sysUser.setDeptId(103l); sysUser.setDataPowerType(1); + sysUser.setUserType("00"); sysUser.setCreateBy(SecurityUtils.getUsername()); AjaxResult ajaxResult = remoteSystemService.addUser(sysUser); if (null != ajaxResult && !"200".equals(ajaxResult.get("code"))) { @@ -88,11 +89,11 @@ public class XhpcUserController extends BaseController { /** - * 获取运营上用户列表 + * 获取运营上用户分页列表 */ - @PreAuthorize(hasPermi = "user:operator:list") - @GetMapping("/operator/list") - public TableDataInfo operatorList(String userName, String nickName, Long operatorId) { + @PreAuthorize(hasPermi = "user:operator:page") + @GetMapping("/operator/page") + public TableDataInfo operatorPage(String userName, String nickName, Long operatorId) { startPage(); List> list = iXhpcUserService.selectOperatorUserList(userName, nickName, operatorId); return getDataTable(list); @@ -111,7 +112,7 @@ public class XhpcUserController extends BaseController { sysUser.setPhonenumber(sysUser.getUserName()); sysUser.setDeptId(103l); sysUser.setDataPowerType(1); - sysUser.setUserType("01"); + sysUser.setUserType("03"); sysUser.setCreateBy(SecurityUtils.getUsername()); AjaxResult ajaxResult = remoteSystemService.addUser(sysUser); if (null != ajaxResult && !"200".equals(ajaxResult.get("code"))) { @@ -149,4 +150,15 @@ public class XhpcUserController extends BaseController { public AjaxResult operatorInfo(@RequestBody Long userId) { return AjaxResult.success(iXhpcUserService.operatorInfo(userId)); } + + /** + * 禁用/启用平台和运营商子账号 + */ + @ApiOperation("禁用/启用平台和运营商子账号") + @PreAuthorize(hasPermi = "user:pc:status") + @PostMapping("/status") + public AjaxResult status(@RequestBody Long userId) { + iXhpcUserService.status(userId); + return AjaxResult.success(); + } } diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/XhpcInternetUser.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/XhpcInternetUser.java new file mode 100644 index 00000000..57d7ccc7 --- /dev/null +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/XhpcInternetUser.java @@ -0,0 +1,279 @@ +package com.xhpc.user.domain; + +import com.ruoyi.common.core.web.domain.BaseEntity; + +import javax.validation.constraints.NotBlank; +import java.util.Date; + + +/** + * 流量用户 xhpc_internet_user + * + * @author ruoyi + */ +public class XhpcInternetUser extends BaseEntity { + + /** + * 用户id + */ + @NotBlank(message = "用户id不能为空") + private Long internetUserId; + + /** + * 名称 + */ + @NotBlank(message = "名称不能为空") + private String name; + + /** + * 手机号码(帐号) + */ + @NotBlank(message = "手机号码不能为空") + private String phone; + + /** + * 联系人 + */ + @NotBlank(message = "联系人不能为空") + private String contactName; + + /** + * 联系人电话 + */ + @NotBlank(message = "联系人电话不能为空") + private String contactPhone; + + /** + * 开户行 + */ + @NotBlank(message = "开户行不能为空") + private String openBank; + + /** + * 卡号 + */ + @NotBlank(message = "卡号不能为空") + private Integer cardNumber; + + /** + * 合作开始时间 + */ + @NotBlank(message = "合作开始时间不能为空") + private Date cooperationStartTime; + + /** + * 合作结束时间 + */ + @NotBlank(message = "合作结束时间不能为空") + private Date cooperationEndTime; + + /** + * 余额 + */ + @NotBlank(message = "余额不能为空") + private Double money; + + /** + * 地址code + */ + @NotBlank(message = "地址不能为空") + private Integer areaCode; + + /** + * 地址 + */ + @NotBlank(message = "地址不能为空") + private String address; + + /** + * 详细地址 + */ + @NotBlank(message = "详细地址不能为空") + private String detailedAddress; + + /** + * 提成类型(0总金额提成 1服务费提成) + */ + @NotBlank(message = "提成类型不能为空") + private Integer commissionType; + + /** + * 提成率 + */ + @NotBlank(message = "提成率不能为空") + private Double commissionRate; + + /** + * 经度 + */ + @NotBlank(message = "经度不能为空") + private String longitude; + + /** + * 纬度 + */ + @NotBlank(message = "纬度不能为空") + private String latitude; + + /** + * 帐号状态 + */ + private Integer status; + + /** + * 删除标志(0代表存在 2代表删除) + */ + private String delFlag; + + public Long getInternetUserId() { + return internetUserId; + } + + public void setInternetUserId(Long internetUserId) { + this.internetUserId = internetUserId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public String getContactName() { + return contactName; + } + + public void setContactName(String contactName) { + this.contactName = contactName; + } + + public String getContactPhone() { + return contactPhone; + } + + public void setContactPhone(String contactPhone) { + this.contactPhone = contactPhone; + } + + public String getOpenBank() { + return openBank; + } + + public void setOpenBank(String openBank) { + this.openBank = openBank; + } + + public Integer getCardNumber() { + return cardNumber; + } + + public void setCardNumber(Integer cardNumber) { + this.cardNumber = cardNumber; + } + + public Date getCooperationStartTime() { + return cooperationStartTime; + } + + public void setCooperationStartTime(Date cooperationStartTime) { + this.cooperationStartTime = cooperationStartTime; + } + + public Date getCooperationEndTime() { + return cooperationEndTime; + } + + public void setCooperationEndTime(Date cooperationEndTime) { + this.cooperationEndTime = cooperationEndTime; + } + + public Double getMoney() { + return money; + } + + public void setMoney(Double money) { + this.money = money; + } + + public Integer getAreaCode() { + return areaCode; + } + + public void setAreaCode(Integer areaCode) { + this.areaCode = areaCode; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getDetailedAddress() { + return detailedAddress; + } + + public void setDetailedAddress(String detailedAddress) { + this.detailedAddress = detailedAddress; + } + + public Integer getCommissionType() { + return commissionType; + } + + public void setCommissionType(Integer commissionType) { + this.commissionType = commissionType; + } + + public Double getCommissionRate() { + return commissionRate; + } + + public void setCommissionRate(Double commissionRate) { + this.commissionRate = commissionRate; + } + + public String getLongitude() { + return longitude; + } + + public void setLongitude(String longitude) { + this.longitude = longitude; + } + + public String getLatitude() { + return latitude; + } + + public void setLatitude(String latitude) { + this.latitude = latitude; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public String getDelFlag() { + return delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } +} diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/XhpcOperator.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/XhpcOperator.java index c5a65d81..c6769a17 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/XhpcOperator.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/XhpcOperator.java @@ -1,19 +1,16 @@ package com.xhpc.user.domain; -import lombok.Data; +import com.ruoyi.common.core.web.domain.BaseEntity; import org.hibernate.validator.constraints.Length; import javax.validation.constraints.NotBlank; -import java.util.Date; /** * 运营商表 xhpc_operator * * @author ruoyi */ -@Data -public class XhpcOperator { - private static final long serialVersionUID = 1L; +public class XhpcOperator extends BaseEntity { /** * 运营商id @@ -129,28 +126,156 @@ public class XhpcOperator { */ private Integer delFlag; - /** - * 创建时间 - */ - private Date createTime; - /** - * 创建者 - */ - private String createBy; + public Long getOperatorId() { + return operatorId; + } - /** - * 更新时间 - */ - private Date updateTime; + public void setOperatorId(Long operatorId) { + this.operatorId = operatorId; + } - /** - * 更新者 - */ - private String updateBy; + public String getName() { + return name; + } - /** - * 备注 - */ - private String remark; + public void setName(String name) { + this.name = name; + } + + public String getContactName() { + return contactName; + } + + public void setContactName(String contactName) { + this.contactName = contactName; + } + + public String getContactPhone() { + return contactPhone; + } + + public void setContactPhone(String contactPhone) { + this.contactPhone = contactPhone; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public Integer getAttribute() { + return attribute; + } + + public void setAttribute(Integer attribute) { + this.attribute = attribute; + } + + public String getAreaCode() { + return areaCode; + } + + public void setAreaCode(String areaCode) { + this.areaCode = areaCode; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getLongitude() { + return longitude; + } + + public void setLongitude(String longitude) { + this.longitude = longitude; + } + + public String getLatitude() { + return latitude; + } + + public void setLatitude(String latitude) { + this.latitude = latitude; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public Integer getCommissionType() { + return commissionType; + } + + public void setCommissionType(Integer commissionType) { + this.commissionType = commissionType; + } + + public Double getPlatformCommissionRate() { + return platformCommissionRate; + } + + public void setPlatformCommissionRate(Double platformCommissionRate) { + this.platformCommissionRate = platformCommissionRate; + } + + public Double getMaintenanceCommissionRate() { + return maintenanceCommissionRate; + } + + public void setMaintenanceCommissionRate(Double maintenanceCommissionRate) { + this.maintenanceCommissionRate = maintenanceCommissionRate; + } + + public String getBusinessLicenseId() { + return businessLicenseId; + } + + public void setBusinessLicenseId(String businessLicenseId) { + this.businessLicenseId = businessLicenseId; + } + + public Integer getWithdrawalTime() { + return withdrawalTime; + } + + public void setWithdrawalTime(Integer withdrawalTime) { + this.withdrawalTime = withdrawalTime; + } + + public String getSoc() { + return soc; + } + + public void setSoc(String soc) { + this.soc = soc; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Integer getDelFlag() { + return delFlag; + } + + public void setDelFlag(Integer delFlag) { + this.delFlag = delFlag; + } } \ No newline at end of file diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/XhpcOperatorInternetBlacklist.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/XhpcOperatorInternetBlacklist.java new file mode 100644 index 00000000..13f49591 --- /dev/null +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/XhpcOperatorInternetBlacklist.java @@ -0,0 +1,47 @@ +package com.xhpc.user.domain; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 运营商设置流量方黑名单 xhpc_operator_internet_blacklist + * + * @author ruoyi + */ +public class XhpcOperatorInternetBlacklist implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 运营商id + */ + @NotBlank(message = "运营商id不能为空") + private Long operatorId; + + /** + * 流量用户id + */ + @NotBlank(message = "流量用户id不能为空") + private Long internetUserId; + + + public XhpcOperatorInternetBlacklist() { + } + + public Long getOperatorId() { + return operatorId; + } + + public void setOperatorId(Long operatorId) { + this.operatorId = operatorId; + } + + public Long getInternetUserId() { + return internetUserId; + } + + public void setInternetUserId(Long internetUserId) { + this.internetUserId = internetUserId; + } + +} diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/XhpcStationInternetBlacklist.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/XhpcStationInternetBlacklist.java new file mode 100644 index 00000000..69a03f98 --- /dev/null +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/XhpcStationInternetBlacklist.java @@ -0,0 +1,47 @@ +package com.xhpc.user.domain; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 流量用户设置流量方黑名单 xhpc_operator_internet_blacklist + * + * @author ruoyi + */ +public class XhpcStationInternetBlacklist implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 流量用户id + */ + @NotBlank(message = "流量用户id不能为空") + private Long internetUserId; + + /** + * 电站id + */ + @NotBlank(message = "电站id不能为空") + private Long chargingStationId; + + + public XhpcStationInternetBlacklist() { + } + + public Long getInternetUserId() { + return internetUserId; + } + + public void setInternetUserId(Long internetUserId) { + this.internetUserId = internetUserId; + } + + public Long getChargingStationId() { + return chargingStationId; + } + + public void setChargingStationId(Long chargingStationId) { + this.chargingStationId = chargingStationId; + } + +} diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcInternetUserMapper.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcInternetUserMapper.java new file mode 100644 index 00000000..c7f2103f --- /dev/null +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcInternetUserMapper.java @@ -0,0 +1,75 @@ +package com.xhpc.user.mapper; + +import com.ruoyi.system.api.domain.SysUser; +import com.xhpc.user.domain.XhpcInternetUser; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 流量用户信息 数据层 + * + * @author ruoyi + */ +public interface XhpcInternetUserMapper { + + /** + * 修改流量用户信息 + * + * @param xhpcInternetUser 流量用户信息 + * @return 结果 + */ + public int update(XhpcInternetUser xhpcInternetUser); + + /** + * 新增流量用户信息 + * + * @param xhpcInternetUser 流量用户信息 + * @return 结果 + */ + public int insert(XhpcInternetUser xhpcInternetUser); + + /** + * 批量删除流量用户信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteByIds(Long[] ids); + + + /** + * 查询流量用户详情 + * + * @param internetUserId 流量用户id + * @return 结果 + */ + public Map info(@Param("internetUserId") Long internetUserId); + + /** + * 流量用户分页列表 + * + * @param name 流量用户名称 + * @param contactName 联系人 + * @param contactPhone 联系人电话 + * @return 结果 + */ + public List> selectInternetList(@Param("name") String name, @Param("contactName") String contactName, @Param("contactPhone") String contactPhone); + + /** + * 通过流量用户ID查询用户 + * + * @param internetUserId 流量用户ID + * @return 结果 + */ + public SysUser getUserByInternetUserId(@Param("internetUserId") Long internetUserId); + + /** + * 流量用户列表 + * + * @param name 流量用户名称 + * @return 结果 + */ + public List> list(@Param("name") String name); +} diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcOperatorInternetBlacklistMapper.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcOperatorInternetBlacklistMapper.java new file mode 100644 index 00000000..8f97752b --- /dev/null +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcOperatorInternetBlacklistMapper.java @@ -0,0 +1,40 @@ +package com.xhpc.user.mapper; + +import com.xhpc.user.domain.XhpcOperatorInternetBlacklist; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 运营商设置流量方黑名单 数据层 + * + * @author ruoyi + */ +public interface XhpcOperatorInternetBlacklistMapper { + + /** + * 新增运营商设置流量方黑名单信息 + * + * @param xhpcOperatorInternetBlacklist 运营商设置流量方黑名单信息 + * @return 结果 + */ + public int insert(XhpcOperatorInternetBlacklist xhpcOperatorInternetBlacklist); + + /** + * 批量删除运营商设置流量方黑名单 + * + * @param operatorId 需要删除的数据ID + * @return 结果 + */ + public int deleteByIds(@Param("operatorId") Long operatorId); + + + /** + * 运营商设置流量方黑名单列表 + * + * @param operatorId 运营商ID + * @return 结果 + */ + public List> list(@Param("operatorId") Long operatorId); +} diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcOperatorMapper.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcOperatorMapper.java index 6346f5ca..257801f6 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcOperatorMapper.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcOperatorMapper.java @@ -2,6 +2,7 @@ package com.xhpc.user.mapper; import com.ruoyi.system.api.domain.SysUser; import com.xhpc.user.domain.XhpcOperator; +import org.apache.ibatis.annotations.Param; import java.util.List; import java.util.Map; @@ -43,7 +44,7 @@ public interface XhpcOperatorMapper { * @param phone 用户手机号 * @return 结果 */ - public XhpcOperator checkAccountUnique(String phone); + public XhpcOperator checkAccountUnique(@Param("phone") String phone); /** * 查询运营商详情 @@ -51,17 +52,17 @@ public interface XhpcOperatorMapper { * @param operatorId 运营商id * @return 结果 */ - public Map info(Long operatorId); + public Map info(@Param("operatorId") Long operatorId); /** - * 获取运营商列表 + * 获取运营商分页列表 * * @param name 运营商名称 * @param contactName 联系人 * @param contactPhone 联系人电话 * @return 结果 */ - public List> selectOperatorList(String name, String contactName, String contactPhone); + public List> selectOperatorList(@Param("name") String name, @Param("contactName") String contactName, @Param("contactPhone") String contactPhone); /** * 通过用户ID删除用户和角色关联 @@ -69,7 +70,7 @@ public interface XhpcOperatorMapper { * @param userId 用户ID * @return 结果 */ - public int deleteUserRoleByUserId(Long userId); + public int deleteUserRoleByUserId(@Param("userId") Long userId); /** * 通过用户ID删除用户和岗位关联 @@ -77,7 +78,7 @@ public interface XhpcOperatorMapper { * @param userId 用户ID * @return 结果 */ - public int deleteUserPostByUserId(Long userId); + public int deleteUserPostByUserId(@Param("userId") Long userId); /** * 通过用户ID删除用户 @@ -85,7 +86,7 @@ public interface XhpcOperatorMapper { * @param userId 用户ID * @return 结果 */ - public int deleteUserById(Long userId, String delFlag); + public int deleteUserById(@Param("userId") Long userId, @Param("delFlag") String delFlag); /** * 通过运营商ID查询用户 @@ -93,5 +94,12 @@ public interface XhpcOperatorMapper { * @param operatorId 运营商ID * @return 结果 */ - public SysUser getUserByOperatorId(Long operatorId); + public SysUser getUserByOperatorId(@Param("operatorId") Long operatorId); + + /** + * 查询运营商列表 + * + * @return 结果 + */ + public List> getOperatorId(); } diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcStationInternetBlacklistMapper.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcStationInternetBlacklistMapper.java new file mode 100644 index 00000000..c0d26eb3 --- /dev/null +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcStationInternetBlacklistMapper.java @@ -0,0 +1,48 @@ +package com.xhpc.user.mapper; + +import com.xhpc.user.domain.XhpcStationInternetBlacklist; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 流量用户设置流量方黑名单 数据层 + * + * @author ruoyi + */ +public interface XhpcStationInternetBlacklistMapper { + + /** + * 新增流量用户设置流量方黑名单信息 + * + * @param xhpcStationInternetBlacklist 流量用户设置流量方黑名单信息 + * @return 结果 + */ + public int insert(XhpcStationInternetBlacklist xhpcStationInternetBlacklist); + + /** + * 批量删除流量用户设置流量方黑名单 + * + * @param internetUserId 需要删除的数据ID + * @return 结果 + */ + public int deleteByIds(@Param("internetUserId") Long internetUserId); + + + /** + * 流量用户设置流量方黑名单列表 + * + * @param internetUserId 流量用户ID + * @return 结果 + */ + public List> list(@Param("internetUserId") Long internetUserId); + + /** + * 通过运营商id查询电站列表 + * + * @param operatorId 运营商ID + * @return 结果 + */ + public List> getXhpcChargingStation(@Param("operatorId") Long operatorId); +} diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcUserMapper.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcUserMapper.java index a23c4a1c..f6bdd331 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcUserMapper.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcUserMapper.java @@ -1,6 +1,7 @@ package com.xhpc.user.mapper; import com.ruoyi.system.api.domain.SysUser; +import org.apache.ibatis.annotations.Param; import java.util.List; import java.util.Map; @@ -20,14 +21,6 @@ public interface XhpcUserMapper { */ public int update(SysUser sysUser); - /** - * 新增用户信息 - * - * @param sysUser 用户信息 - * @return 结果 - */ - public int insert(SysUser sysUser); - /** * 批量删除用户信息 * @@ -42,16 +35,16 @@ public interface XhpcUserMapper { * @param userId 用户id * @return 结果 */ - public SysUser selectUserByUserId(Long userId); + public SysUser selectUserByUserId(@Param("userId") Long userId); /** - * 获取平台用户列表 + * 获取平台用户分页列表 * * @param userName 用户账号 * @param nickName 用户昵称 * @return 结果 */ - public List> selectPcUserList(String userName, String nickName); + public List> selectPcUserList(@Param("userName") String userName, @Param("nickName") String nickName); /** * 平台用户详情 @@ -59,16 +52,16 @@ public interface XhpcUserMapper { * @param userId 用户id * @return 结果 */ - public Map pcInfo(Long userId); + public Map pcInfo(@Param("userId") Long userId); /** - * 获取运营商用户列表 + * 获取运营商用户分页列表 * * @param userName 用户账号 * @param nickName 用户昵称 * @return 结果 */ - public List> selectOperatorUserList(String userName, String nickName, Long operatorId, String createBy); + public List> selectOperatorUserList(@Param("userName") String userName, @Param("nickName") String nickName, @Param("operatorId") Long operatorId, @Param("createBy") String createBy); /** * 运营商用户详情 @@ -76,5 +69,5 @@ public interface XhpcUserMapper { * @param userId 用户id * @return 结果 */ - public Map operatorInfo(Long userId); + public Map operatorInfo(@Param("userId") Long userId); } diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/openfeign/RemoteSystemFallbackFactory.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/openfeign/RemoteSystemFallbackFactory.java new file mode 100644 index 00000000..f615b967 --- /dev/null +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/openfeign/RemoteSystemFallbackFactory.java @@ -0,0 +1,34 @@ +package com.xhpc.user.openfeign; + +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.system.api.domain.SysUser; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.cloud.openfeign.FallbackFactory; +import org.springframework.stereotype.Component; + +/** + * 用户服务降级处理 + * + * @author ruoyi + */ +@Component +public class RemoteSystemFallbackFactory implements FallbackFactory { + private static final Logger log = LoggerFactory.getLogger(RemoteSystemFallbackFactory.class); + + @Override + public RemoteSystemService create(Throwable throwable) { + log.error("用户服务调用失败:{}", throwable.getMessage()); + return new RemoteSystemService() { + @Override + public AjaxResult addUser(SysUser sysUser) { + return AjaxResult.error(throwable.getMessage()); + } + + @Override + public AjaxResult editUser(SysUser sysUser) { + return AjaxResult.error(throwable.getMessage()); + } + }; + } +} diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/openfeign/RemoteSystemService.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/openfeign/RemoteSystemService.java index 770b106b..ad1d6169 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/openfeign/RemoteSystemService.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/openfeign/RemoteSystemService.java @@ -3,7 +3,6 @@ package com.xhpc.user.openfeign; import com.ruoyi.common.core.constant.ServiceNameConstants; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.system.api.domain.SysUser; -import com.ruoyi.system.api.factory.RemoteFileFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; @@ -14,7 +13,7 @@ import org.springframework.web.bind.annotation.RequestBody; * * @author ruoyi */ -@FeignClient(contextId = "remoteSystemService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteFileFallbackFactory.class) +@FeignClient(contextId = "remoteSystemService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteSystemFallbackFactory.class) public interface RemoteSystemService { /** * 新增用户 diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcInternetUserService.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcInternetUserService.java new file mode 100644 index 00000000..27b67bb2 --- /dev/null +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcInternetUserService.java @@ -0,0 +1,73 @@ +package com.xhpc.user.service; + +import com.xhpc.user.domain.XhpcInternetUser; + +import java.util.List; +import java.util.Map; + + +/** + * 流量用户信息 服务层 + * + * @author ruoyi + */ +public interface IXhpcInternetUserService { + + /** + * 新增任务 + * + * @param xhpcInternetUser 流量用户信息 + * @return 结果 + */ + public int insert(XhpcInternetUser xhpcInternetUser); + + /** + * 更新任务 + * + * @param xhpcInternetUser 流量用户信息 + * @return 结果 + */ + public int update(XhpcInternetUser xhpcInternetUser); + + /** + * 批量删除流量用户信息 + * + * @param ids 需要删除的流量用户ID + * @return 结果 + */ + public void deleteByIds(Long[] ids); + + /** + * 流量用户详情 + * + * @param internetUserId 流量用户id + * @return 结果 + */ + public Map info(Long internetUserId); + + /** + * 流量用户分页列表 + * + * @param name 流量用户名称 + * @param contactName 联系人 + * @param contactPhone 联系人电话 + * @return 结果 + */ + public List> selectInternetList(String name, String contactName, String contactPhone); + + /** + * 禁用/启用流量用户 + * + * @param internetUserId 流量用户id + * @return 结果 + */ + public void status(Long internetUserId); + + /** + * 流量用户列表 + * + * @param name 流量用户名称 + * @return 结果 + */ + public List> list(String name); +} \ No newline at end of file diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcOperatorInternetBlacklistService.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcOperatorInternetBlacklistService.java new file mode 100644 index 00000000..d26d5be6 --- /dev/null +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcOperatorInternetBlacklistService.java @@ -0,0 +1,40 @@ +package com.xhpc.user.service; + +import com.xhpc.user.domain.XhpcOperatorInternetBlacklist; + +import java.util.List; +import java.util.Map; + + +/** + * 运营商设置流量方黑名单 服务层 + * + * @author ruoyi + */ +public interface IXhpcOperatorInternetBlacklistService { + + /** + * 新增任务 + * + * @param xhpcOperatorInternetBlacklist 运营商设置流量方黑名单信息 + * @return 结果 + */ + public int insert(XhpcOperatorInternetBlacklist xhpcOperatorInternetBlacklist); + + /** + * 批量删除流运营商设置流量方黑名单信息 + * + * @param operatorId 需要删除的运营商ID + * @return 结果 + */ + public void deleteByIds(Long operatorId); + + + /** + * 运营商设置流量方黑名单信息列表 + * + * @param operatorId 运营商ID + * @return 结果 + */ + public List> list(String operatorId); +} \ No newline at end of file diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcOperatorService.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcOperatorService.java index 81da7c3b..00ca7d8d 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcOperatorService.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcOperatorService.java @@ -54,7 +54,7 @@ public interface IXhpcOperatorService { public Map info(Long operatorId); /** - * 获取运营商列表 + * 获取运营商分页列表 * * @param name 运营商名称 * @param contactName 联系人 diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcStationInternetBlacklistService.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcStationInternetBlacklistService.java new file mode 100644 index 00000000..88691dda --- /dev/null +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcStationInternetBlacklistService.java @@ -0,0 +1,40 @@ +package com.xhpc.user.service; + +import com.xhpc.user.domain.XhpcStationInternetBlacklist; + +import java.util.List; +import java.util.Map; + + +/** + * 运营商设置流量方黑名单 服务层 + * + * @author ruoyi + */ +public interface IXhpcStationInternetBlacklistService { + + /** + * 新增任务 + * + * @param xhpcStationInternetBlacklist 运营商设置流量方黑名单信息 + * @return 结果 + */ + public int insert(XhpcStationInternetBlacklist xhpcStationInternetBlacklist); + + /** + * 批量删除流运营商设置流量方黑名单信息 + * + * @param internetUserId 需要删除的数据ID + * @return 结果 + */ + public void deleteByIds(Long internetUserId); + + + /** + * 运营商设置流量方黑名单信息列表 + * + * @param internetUserId 流量用户ID + * @return 结果 + */ + public List> list(String internetUserId); +} \ No newline at end of file diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcUserService.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcUserService.java index 8d7a36c8..0cc64952 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcUserService.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcUserService.java @@ -1,7 +1,5 @@ package com.xhpc.user.service; -import com.ruoyi.system.api.domain.SysUser; - import java.util.List; import java.util.Map; @@ -13,22 +11,6 @@ import java.util.Map; */ public interface IXhpcUserService { - /** - * 新增用户信息 - * - * @param sysUser 用户信息 - * @return 结果 - */ - public int insert(SysUser sysUser); - - /** - * 更新用户信息 - * - * @param sysUser 用户信息 - * @return 结果 - */ - public int update(SysUser sysUser); - /** * 批量删除用户信息 * @@ -38,7 +20,7 @@ public interface IXhpcUserService { public void deleteByIds(Long[] ids); /** - * 获取平台用户列表 + * 获取平台用户分页列表 * * @param userName 用户账号 * @param nickName 用户昵称 @@ -55,7 +37,7 @@ public interface IXhpcUserService { public Map pcInfo(Long userId); /** - * 获取运营商用户列表 + * 获取运营商用户分页列表 * * @param userName 用户账号 * @param nickName 用户昵称 @@ -72,4 +54,12 @@ public interface IXhpcUserService { * @return 结果 */ public Map operatorInfo(Long userId); + + /** + * 禁用/启用平台和运营商子账号 + * + * @param userId 用户id + * @return 结果 + */ + public void status(Long userId); } \ No newline at end of file diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcInternetUserServiceImpl.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcInternetUserServiceImpl.java new file mode 100644 index 00000000..667b481f --- /dev/null +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcInternetUserServiceImpl.java @@ -0,0 +1,113 @@ +package com.xhpc.user.service.impl; + +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.system.api.domain.SysUser; +import com.xhpc.user.domain.XhpcInternetUser; +import com.xhpc.user.mapper.XhpcInternetUserMapper; +import com.xhpc.user.mapper.XhpcUserMapper; +import com.xhpc.user.service.IXhpcInternetUserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; + +/** + * 流量用户信息 服务层 + * + * @author ruoyi + */ +@Service +public class XhpcInternetUserServiceImpl implements IXhpcInternetUserService { + + @Autowired + private XhpcInternetUserMapper xhpcInternetUserMapper; + + @Autowired + private XhpcUserMapper xhpcUserMapper; + + /** + * 新增任务 + * + * @param xhpcInternetUser 流量用户信息 + */ + @Override + public int insert(XhpcInternetUser xhpcInternetUser) { + return xhpcInternetUserMapper.insert(xhpcInternetUser); + } + + /** + * 更新流量用户 + * + * @param xhpcInternetUser 流量用户信息 + */ + @Override + public int update(XhpcInternetUser xhpcInternetUser) { + return xhpcInternetUserMapper.update(xhpcInternetUser); + } + + /** + * 批量删除流量用户信息 + * + * @param ids 需要删除的流量用户ID + * @return 结果 + */ + @Override + public void deleteByIds(Long[] ids) { + xhpcInternetUserMapper.deleteByIds(ids); + } + + /** + * 流量用户详情 + * + * @param internetUserId 流量用户id + * @return 结果 + */ + @Override + public Map info(Long internetUserId) { + return xhpcInternetUserMapper.info(internetUserId); + } + + /** + * 流量用户分页列表 + * + * @param name 流量用户名称 + * @param contactName 联系人 + * @param contactPhone 联系人电话 + * @return 结果 + */ + @Override + public List> selectInternetList(String name, String contactName, String contactPhone) { + return xhpcInternetUserMapper.selectInternetList(name, contactName, contactPhone); + } + + /** + * 禁用/启用流量用户 + * + * @param internetUserId 流量用户id + * @return 结果 + */ + @Override + public void status(Long internetUserId) { + SysUser sysUser = xhpcInternetUserMapper.getUserByInternetUserId(internetUserId); + sysUser.setStatus("1".equals(sysUser.getStatus()) ? "0" : "1"); + xhpcUserMapper.update(sysUser); + Map map = xhpcInternetUserMapper.info(internetUserId); + String status = StringUtils.valueOf(map.get("status")); + XhpcInternetUser xhpcInternetUser = new XhpcInternetUser(); + xhpcInternetUser.setInternetUserId(internetUserId); + xhpcInternetUser.setStatus("0".equals(sysUser.getStatus()) ? 1 : 0); + update(xhpcInternetUser); + } + + /** + * 流量用户列表 + * + * @param name 流量用户名称 + * @return 结果 + */ + @Override + public List> list(String name) { + return xhpcInternetUserMapper.list(name); + } +} \ No newline at end of file diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcOperatorInternetBlacklistServiceImpl.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcOperatorInternetBlacklistServiceImpl.java new file mode 100644 index 00000000..fb16440a --- /dev/null +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcOperatorInternetBlacklistServiceImpl.java @@ -0,0 +1,81 @@ +package com.xhpc.user.service.impl; + +import com.ruoyi.common.core.utils.StringUtils; +import com.xhpc.user.domain.XhpcOperatorInternetBlacklist; +import com.xhpc.user.mapper.XhpcInternetUserMapper; +import com.xhpc.user.mapper.XhpcOperatorInternetBlacklistMapper; +import com.xhpc.user.service.IXhpcOperatorInternetBlacklistService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; + +/** + * 流量用户信息 服务层 + * + * @author ruoyi + */ +@Service +public class XhpcOperatorInternetBlacklistServiceImpl implements IXhpcOperatorInternetBlacklistService { + + @Autowired + private XhpcOperatorInternetBlacklistMapper xhpcOperatorInternetBlacklistMapper; + + @Autowired + private XhpcInternetUserMapper xhpcInternetUserMapper; + + /** + * 新增任务 + * + * @param xhpcOperatorInternetBlacklist 流量用户信息 + */ + @Override + public int insert(XhpcOperatorInternetBlacklist xhpcOperatorInternetBlacklist) { + return xhpcOperatorInternetBlacklistMapper.insert(xhpcOperatorInternetBlacklist); + } + + + /** + * 批量删除流量用户信息 + * + * @param operatorId 需要删除的运营商ID + * @return 结果 + */ + @Override + public void deleteByIds(Long operatorId) { + xhpcOperatorInternetBlacklistMapper.deleteByIds(operatorId); + } + + + /** + * 流量用户列表 + * + * @param operatorId 运营商ID + * @return 结果 + */ + @Override + public List> list(String operatorId) { + List> list = xhpcInternetUserMapper.list(null); + if (null != list && list.size() > 0) { + List> blacklist = xhpcOperatorInternetBlacklistMapper.list(Long.parseLong(operatorId)); + boolean bool = false; + if (null != blacklist && blacklist.size() > 0) { + bool = true; + } + for (Map map : list) { + map.put("isBlack", 0); + if (bool) { + for (Map map1 : blacklist) { + String internetUserId = StringUtils.valueOf(map.get("internetUserId")); + String internetUserId1 = StringUtils.valueOf(map1.get("internetUserId")); + if (internetUserId.equals(internetUserId1)) { + map.put("isBlack", 1); + } + } + } + } + } + return list; + } +} \ No newline at end of file diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/XhpcOperatorServiceImpl.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcOperatorServiceImpl.java similarity index 91% rename from xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/XhpcOperatorServiceImpl.java rename to xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcOperatorServiceImpl.java index 3cd474c8..46d7d2ff 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/XhpcOperatorServiceImpl.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcOperatorServiceImpl.java @@ -1,10 +1,12 @@ -package com.xhpc.user.service; +package com.xhpc.user.service.impl; import com.ruoyi.common.core.constant.UserConstants; import com.ruoyi.common.core.utils.StringUtils; import com.ruoyi.system.api.domain.SysUser; import com.xhpc.user.domain.XhpcOperator; import com.xhpc.user.mapper.XhpcOperatorMapper; +import com.xhpc.user.mapper.XhpcUserMapper; +import com.xhpc.user.service.IXhpcOperatorService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -22,6 +24,9 @@ public class XhpcOperatorServiceImpl implements IXhpcOperatorService { @Autowired private XhpcOperatorMapper xhpcOperatorMapper; + @Autowired + private XhpcUserMapper xhpcUserMapper; + /** * 新增任务 * @@ -85,7 +90,7 @@ public class XhpcOperatorServiceImpl implements IXhpcOperatorService { } /** - * 获取运营商列表 + * 获取运营商分页列表 * * @param name 运营商名称 * @param contactName 联系人 @@ -121,7 +126,8 @@ public class XhpcOperatorServiceImpl implements IXhpcOperatorService { @Override public void status(Long operatorId) { SysUser sysUser = xhpcOperatorMapper.getUserByOperatorId(operatorId); - xhpcOperatorMapper.deleteUserById(sysUser.getUserId(), "2".equals(sysUser.getStatus()) ? "0" : "2"); + sysUser.setStatus("1".equals(sysUser.getStatus()) ? "0" : "1"); + xhpcUserMapper.update(sysUser); Map map = xhpcOperatorMapper.info(operatorId); String status = StringUtils.valueOf(map.get("status")); XhpcOperator xhpcOperator = new XhpcOperator(); diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcStationInternetBlacklistServiceImpl.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcStationInternetBlacklistServiceImpl.java new file mode 100644 index 00000000..13ab2ec2 --- /dev/null +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcStationInternetBlacklistServiceImpl.java @@ -0,0 +1,88 @@ +package com.xhpc.user.service.impl; + +import com.ruoyi.common.core.utils.StringUtils; +import com.xhpc.user.domain.XhpcStationInternetBlacklist; +import com.xhpc.user.mapper.XhpcOperatorMapper; +import com.xhpc.user.mapper.XhpcStationInternetBlacklistMapper; +import com.xhpc.user.service.IXhpcStationInternetBlacklistService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; + +/** + * 流量用户设置流量方黑名单 服务层 + * + * @author ruoyi + */ +@Service +public class XhpcStationInternetBlacklistServiceImpl implements IXhpcStationInternetBlacklistService { + + @Autowired + private XhpcStationInternetBlacklistMapper xhpcStationInternetBlacklistMapper; + + @Autowired + private XhpcOperatorMapper xhpcOperatorMapper; + + /** + * 新增流量用户设置流量方黑名单信息 + * + * @param xhpcStationInternetBlacklist 流量用户设置流量方黑名单信息 + */ + @Override + public int insert(XhpcStationInternetBlacklist xhpcStationInternetBlacklist) { + return xhpcStationInternetBlacklistMapper.insert(xhpcStationInternetBlacklist); + } + + + /** + * 批量删除流量用户设置流量方黑名单信息 + * + * @param internetUserId 需要删除的数据ID + * @return 结果 + */ + @Override + public void deleteByIds(Long internetUserId) { + xhpcStationInternetBlacklistMapper.deleteByIds(internetUserId); + } + + + /** + * 流量用户设置流量方黑名单信息列表 + * + * @param internetUserId 流量用户ID + * @return 结果 + */ + @Override + public List> list(String internetUserId) { + List> list = xhpcOperatorMapper.getOperatorId(); + if (null != list && list.size() > 0) { + List> blacklist = xhpcStationInternetBlacklistMapper.list(Long.parseLong(internetUserId)); + boolean bool = false; + if (null != blacklist && blacklist.size() > 0) { + bool = true; + } + for (Map map : list) { + String operatorId = StringUtils.valueOf(map.get("operatorId")); + List> listXhpcChargingStation = xhpcStationInternetBlacklistMapper.getXhpcChargingStation(Long.parseLong(operatorId)); + if (null != listXhpcChargingStation && listXhpcChargingStation.size() > 0) { + for (Map xhpcChargingStation : listXhpcChargingStation) { + xhpcChargingStation.put("isBlack", 0); + if (bool) { + for (Map map1 : blacklist) { + String chargingStationId = StringUtils.valueOf(xhpcChargingStation.get("chargingStationId")); + String chargingStationId1 = StringUtils.valueOf(map1.get("chargingStationId")); + if (chargingStationId.equals(chargingStationId1)) { + xhpcChargingStation.put("isBlack", 1); + } + } + } + } + map.put("listXhpcChargingStation", listXhpcChargingStation); + } + } + } + return list; + } +} \ No newline at end of file diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/XhpcUserServiceImpl.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcUserServiceImpl.java similarity index 79% rename from xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/XhpcUserServiceImpl.java rename to xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcUserServiceImpl.java index 086b7f55..37db2636 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/XhpcUserServiceImpl.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcUserServiceImpl.java @@ -1,11 +1,12 @@ -package com.xhpc.user.service; +package com.xhpc.user.service.impl; import com.ruoyi.common.core.utils.SecurityUtils; import com.ruoyi.system.api.domain.SysUser; import com.xhpc.user.mapper.XhpcUserMapper; +import com.xhpc.user.service.IXhpcUserService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import javax.annotation.Resource; import java.util.List; import java.util.Map; @@ -17,29 +18,9 @@ import java.util.Map; @Service public class XhpcUserServiceImpl implements IXhpcUserService { - @Resource + @Autowired private XhpcUserMapper xhpcUserMapper; - /** - * 新增用户信息 - * - * @param sysUser 用户信息 - */ - @Override - public int insert(SysUser sysUser) { - return xhpcUserMapper.insert(sysUser); - } - - /** - * 更新用户信息 - * - * @param sysUser 用户信息 - */ - @Override - public int update(SysUser sysUser) { - return xhpcUserMapper.update(sysUser); - } - /** * 批量删除用户信息 * @@ -52,7 +33,7 @@ public class XhpcUserServiceImpl implements IXhpcUserService { } /** - * 获取平台用户列表 + * 获取平台用户分页列表 * * @param userName 用户账号 * @param nickName 用户昵称 @@ -74,7 +55,7 @@ public class XhpcUserServiceImpl implements IXhpcUserService { } /** - * 获取运营商用户列表 + * 获取运营商用户分页列表 * * @param userName 用户账号 * @param nickName 用户昵称 @@ -102,4 +83,17 @@ public class XhpcUserServiceImpl implements IXhpcUserService { public Map operatorInfo(Long userId) { return xhpcUserMapper.operatorInfo(userId); } + + /** + * 禁用/启用平台和运营商子账号 + * + * @param userId 用户id + * @return 结果 + */ + @Override + public void status(Long userId) { + SysUser sysUser = xhpcUserMapper.selectUserByUserId(userId); + sysUser.setStatus("1".equals(sysUser.getStatus()) ? "0" : "1"); + xhpcUserMapper.update(sysUser); + } } \ No newline at end of file diff --git a/xhpc-modules/xhpc-user/src/main/resources/bootstrap.yml b/xhpc-modules/xhpc-user/src/main/resources/bootstrap.yml index 78fafcdf..1a40ab4f 100644 --- a/xhpc-modules/xhpc-user/src/main/resources/bootstrap.yml +++ b/xhpc-modules/xhpc-user/src/main/resources/bootstrap.yml @@ -1,10 +1,10 @@ ppsvc: server: 0.0.0.0 - port: 8887 + port: 8888 # Tomcat server: - port: ${random.int(1300,1400)} + port: 8887 # Spring spring: diff --git a/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcInternetUserMapper.xml b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcInternetUserMapper.xml new file mode 100644 index 00000000..bcfc797f --- /dev/null +++ b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcInternetUserMapper.xml @@ -0,0 +1,289 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into xhpc_internet_user( + + internet_user_id, + + + name, + + + phone, + + + contact_name, + + + contact_phone, + + + open_bank, + + + card_number, + + + cooperation_start_time, + + + cooperation_end_time, + + + money, + + + area_code, + + + address, + + + detailed_address, + + + commission_type, + + + commission_rate, + + + longitude, + + + latitude, + + + status, + + + del_flag, + + + create_by, + + + create_time, + + + update_by, + + + update_time, + + + remark + + )values( + + #{internetUserId}, + + + #{name}, + + + #{phone}, + + + #{contactName}, + + + #{contactPhone}, + + + #{openBank}, + + + #{cardNumber}, + + + #{cooperationStartTime}, + + + #{cooperationEndTime}, + + + #{money}, + + + #{areaCode}, + + + #{address}, + + + #{detailedAddress}, + + + #{commissionType}, + + + #{commissionRate}, + + + #{longitude}, + + + #{latitude}, + + + #{status}, + + + #{delFlag}, + + + #{createBy}, + + + #{createTime}, + + + #{updateBy}, + + + #{updateTime}, + + + #{remark} + + + + + UPDATE xhpc_internet_user + + name = #{name}, + phone = #{phone}, + contact_name = #{contactName}, + contact_phone = #{contactPhone}, + open_bank = #{openBank}, + card_number = #{cardNumber}, + cooperation_start_time = + #{cooperationStartTime}, + + cooperation_end_time = + #{cooperationEndTime}, + + money = #{money}, + area_code = #{areaCode}, + address = #{address}, + detailed_address = #{detailedAddress}, + commission_type = #{commissionType}, + commission_rate = #{commissionRate}, + longitude = #{longitude}, + latitude = #{latitude}, + status = #{status}, + del_flag = #{delFlag}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark} + + WHERE internet_user_id = #{internetUserId} + + + + delete from xhpc_internet_user where internet_user_id in + + #{internetUserId} + + + + + + + + + + + \ No newline at end of file diff --git a/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcOperatorInternetBlacklistMapper.xml b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcOperatorInternetBlacklistMapper.xml new file mode 100644 index 00000000..7f6ed21a --- /dev/null +++ b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcOperatorInternetBlacklistMapper.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + insert into xhpc_operator_internet_blacklist( + + operator_id, + + + internet_user_id + + )values( + + #{operatorId}, + + + #{internetUserId} + + + + + delete from xhpc_operator_internet_blacklist where operator_id = #{operatorId} + + + + \ No newline at end of file diff --git a/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcOperatorMapper.xml b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcOperatorMapper.xml index 53a82961..c14fca92 100644 --- a/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcOperatorMapper.xml +++ b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcOperatorMapper.xml @@ -32,7 +32,7 @@ - xo.operator_id, xo.name, xo.contact_name contactName, xo.contact_phone contactPhone, + xo.operator_id operatorId, xo.name, xo.contact_name contactName, xo.contact_phone contactPhone, xo.phone, xo.attribute, xo.area_code areaCode, xo.address, xo.longitude, xo.latitude, xo.email, xo.commission_type commissionType, xo.platform_commission_rate platformCommissionRate, @@ -253,13 +253,23 @@ + where xo.del_flag = 0 + + and xo.name like concat(concat('%', #{name}), '%') + + + and xo.contact_name like concat(concat('%', #{contactName}), '%') + + + and xo.contact_phone like concat(concat('%', #{contactPhone}), '%') + + ORDER BY xo.update_time DESC + delete from sys_user_role where user_id=#{userId} @@ -278,4 +288,14 @@ from sys_user where del_flag = 0 and operator_id = #{operatorId} + + \ No newline at end of file diff --git a/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcStationInternetBlacklistMapper.xml b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcStationInternetBlacklistMapper.xml new file mode 100644 index 00000000..96691c56 --- /dev/null +++ b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcStationInternetBlacklistMapper.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + insert into xhpc_operator_internet_blacklist( + + internet_user_id, + + + charging_station_id + + )values( + + #{internetUserId}, + + + #{chargingStationId} + + + + + delete from xhpc_station_internet_blacklist where internet_user_id = #{internetUserId} + + + + + + \ No newline at end of file diff --git a/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcUserMapper.xml b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcUserMapper.xml index 9afee628..b62a3043 100644 --- a/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcUserMapper.xml +++ b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcUserMapper.xml @@ -12,6 +12,7 @@ + @@ -27,138 +28,6 @@ - - - insert into sys_user( - - user_id, - - - dept_id, - - - user_name, - - - nick_name, - - - user_type, - - - email, - - - phonenumber, - - - operator_id, - - - sex, - - - avatar, - - - password, - - - data_power_type, - - - status, - - - del_flag, - - - login_ip, - - - login_date, - - - create_by, - - - create_time, - - - update_by, - - - update_time, - - - remark - - )values( - - #{userId}, - - - #{deptId}, - - - #{userName}, - - - #{nickName}, - - - #{userType}, - - - #{email}, - - - #{phonenumber}, - - - #{operatorId}, - - - #{sex}, - - - #{avatar}, - - - #{password}, - - - #{dataPowerType}, - - - #{status}, - - - #{delFlag}, - - - #{loginIp}, - - - #{loginDate}, - - - #{createBy}, - - - #{createTime}, - - - #{updateBy}, - - - #{updateTime}, - - - #{remark} - - - UPDATE sys_user @@ -212,6 +81,7 @@ and nick_name like concat(concat('%', #{nickName}), '%') + ORDER BY update_time DESC