From 03afa6221cec34b41569bcf7f116c4e7b0f01946 Mon Sep 17 00:00:00 2001
From: fengjundan <1436525664@qq.com>
Date: Tue, 20 Jul 2021 15:55:12 +0800
Subject: [PATCH] =?UTF-8?q?1=E6=96=B0=E5=A2=9E=E7=94=A8=E6=88=B7=E7=9A=84?=
=?UTF-8?q?=E6=B5=81=E9=87=8Fid=202=E6=96=B0=E5=A2=9E=E6=B5=81=E9=87=8F?=
=?UTF-8?q?=E7=94=A8=E6=88=B7=203=E6=96=B0=E5=A2=9E=E8=BF=90=E8=90=A5?=
=?UTF-8?q?=E5=95=86=E8=AE=BE=E7=BD=AE=E6=B5=81=E9=87=8F=E7=94=A8=E6=88=B7?=
=?UTF-8?q?=E9=BB=91=E5=90=8D=E5=8D=95=204=E6=96=B0=E5=A2=9E=E7=94=B5?=
=?UTF-8?q?=E7=AB=99=E6=B5=81=E9=87=8F=E6=96=B9=E9=BB=91=E5=90=8D=E5=8D=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../com/ruoyi/system/api/domain/SysUser.java | 14 +
.../system/controller/SysUserController.java | 31 +-
...IXhpcOperatorInternetBlacklistService.xml} | 0
.../resources/mapper/system/SysUserMapper.xml | 382 +++++++++---------
.../java/com/xhpc/user/UserApplication.java | 8 +
.../XhpcInternetUserController.java | 139 +++++++
.../controller/XhpcOperatorController.java | 24 +-
...pcOperatorInternetBlacklistController.java | 55 +++
...hpcStationInternetBlacklistController.java | 55 +++
.../user/controller/XhpcUserController.java | 30 +-
.../xhpc/user/domain/XhpcInternetUser.java | 279 +++++++++++++
.../com/xhpc/user/domain/XhpcOperator.java | 175 ++++++--
.../domain/XhpcOperatorInternetBlacklist.java | 47 +++
.../domain/XhpcStationInternetBlacklist.java | 47 +++
.../user/mapper/XhpcInternetUserMapper.java | 75 ++++
.../XhpcOperatorInternetBlacklistMapper.java | 40 ++
.../xhpc/user/mapper/XhpcOperatorMapper.java | 24 +-
.../XhpcStationInternetBlacklistMapper.java | 48 +++
.../com/xhpc/user/mapper/XhpcUserMapper.java | 23 +-
.../RemoteSystemFallbackFactory.java | 34 ++
.../user/openfeign/RemoteSystemService.java | 3 +-
.../service/IXhpcInternetUserService.java | 73 ++++
...IXhpcOperatorInternetBlacklistService.java | 40 ++
.../user/service/IXhpcOperatorService.java | 2 +-
.../IXhpcStationInternetBlacklistService.java | 40 ++
.../xhpc/user/service/IXhpcUserService.java | 30 +-
.../impl/XhpcInternetUserServiceImpl.java | 113 ++++++
...cOperatorInternetBlacklistServiceImpl.java | 81 ++++
.../{ => impl}/XhpcOperatorServiceImpl.java | 12 +-
...pcStationInternetBlacklistServiceImpl.java | 88 ++++
.../{ => impl}/XhpcUserServiceImpl.java | 44 +-
.../src/main/resources/bootstrap.yml | 4 +-
.../mapper/XhpcInternetUserMapper.xml | 289 +++++++++++++
.../XhpcOperatorInternetBlacklistMapper.xml | 43 ++
.../resources/mapper/XhpcOperatorMapper.xml | 28 +-
.../XhpcStationInternetBlacklistMapper.xml | 53 +++
.../main/resources/mapper/XhpcUserMapper.xml | 135 +------
37 files changed, 2153 insertions(+), 455 deletions(-)
rename ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/{RemoteSystemService.xml => IXhpcOperatorInternetBlacklistService.xml} (100%)
create mode 100644 xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcInternetUserController.java
create mode 100644 xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcOperatorInternetBlacklistController.java
create mode 100644 xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcStationInternetBlacklistController.java
create mode 100644 xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/XhpcInternetUser.java
create mode 100644 xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/XhpcOperatorInternetBlacklist.java
create mode 100644 xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/XhpcStationInternetBlacklist.java
create mode 100644 xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcInternetUserMapper.java
create mode 100644 xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcOperatorInternetBlacklistMapper.java
create mode 100644 xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcStationInternetBlacklistMapper.java
create mode 100644 xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/openfeign/RemoteSystemFallbackFactory.java
create mode 100644 xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcInternetUserService.java
create mode 100644 xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcOperatorInternetBlacklistService.java
create mode 100644 xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcStationInternetBlacklistService.java
create mode 100644 xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcInternetUserServiceImpl.java
create mode 100644 xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcOperatorInternetBlacklistServiceImpl.java
rename xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/{ => impl}/XhpcOperatorServiceImpl.java (91%)
create mode 100644 xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcStationInternetBlacklistServiceImpl.java
rename xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/{ => impl}/XhpcUserServiceImpl.java (79%)
create mode 100644 xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcInternetUserMapper.xml
create mode 100644 xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcOperatorInternetBlacklistMapper.xml
create mode 100644 xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcStationInternetBlacklistMapper.xml
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
-
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
\ 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