代码重构二次
parent
5a91f224cd
commit
51e7c2c0c0
|
@ -1,11 +1,8 @@
|
||||||
package com.muyu.auth;
|
package com.muyu.auth;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
import com.alibaba.druid.spring.boot3.autoconfigure.DruidDataSourceAutoConfigure;
|
import com.alibaba.druid.spring.boot3.autoconfigure.DruidDataSourceAutoConfigure;
|
||||||
import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceAutoConfiguration;
|
import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceAutoConfiguration;
|
||||||
import com.muyu.common.security.annotation.EnableCustomConfig;
|
import com.muyu.common.security.annotation.EnableCustomConfig;
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
@ -16,7 +13,6 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||||
*
|
*
|
||||||
* @author muyu
|
* @author muyu
|
||||||
*/
|
*/
|
||||||
<<<<<<< HEAD
|
|
||||||
@EnableCustomConfig
|
@EnableCustomConfig
|
||||||
@EnableMyFeignClients
|
@EnableMyFeignClients
|
||||||
@SpringBootApplication(
|
@SpringBootApplication(
|
||||||
|
@ -30,12 +26,5 @@ public class CloudAuthApplication {
|
||||||
public static void main (String[] args) {
|
public static void main (String[] args) {
|
||||||
SpringApplication.run(CloudAuthApplication.class, args);
|
SpringApplication.run(CloudAuthApplication.class, args);
|
||||||
System.out.println("CloudAuth 模块启动成功!");
|
System.out.println("CloudAuth 模块启动成功!");
|
||||||
=======
|
|
||||||
@EnableMyFeignClients
|
|
||||||
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
|
|
||||||
public class CloudAuthApplication {
|
|
||||||
public static void main (String[] args) {
|
|
||||||
SpringApplication.run(CloudAuthApplication.class, args);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,11 +10,11 @@ import com.muyu.common.security.auth.AuthUtil;
|
||||||
import com.muyu.common.security.service.TokenService;
|
import com.muyu.common.security.service.TokenService;
|
||||||
import com.muyu.common.security.utils.SecurityUtils;
|
import com.muyu.common.security.utils.SecurityUtils;
|
||||||
import com.muyu.common.system.domain.LoginUser;
|
import com.muyu.common.system.domain.LoginUser;
|
||||||
<<<<<<< HEAD
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
=======
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
@ -29,27 +29,20 @@ import jakarta.servlet.http.HttpServletRequest;
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
public class TokenController {
|
public class TokenController {
|
||||||
<<<<<<< HEAD
|
|
||||||
@Resource
|
@Resource
|
||||||
private TokenService tokenService;
|
private TokenService tokenService;
|
||||||
|
|
||||||
@Resource
|
|
||||||
=======
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private TokenService tokenService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
private SysLoginService sysLoginService;
|
private SysLoginService sysLoginService;
|
||||||
|
|
||||||
@PostMapping("login")
|
@PostMapping("login")
|
||||||
public Result<?> login (@RequestBody LoginBody form) {
|
public Result<?> login (@RequestBody LoginBody form) {
|
||||||
// 用户登录
|
// 用户登录
|
||||||
<<<<<<< HEAD
|
|
||||||
LoginUser userInfo = sysLoginService.login(form);
|
LoginUser userInfo = sysLoginService.login(form);
|
||||||
=======
|
|
||||||
LoginUser userInfo = sysLoginService.login(form.getUsername(), form.getPassword());
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
// 获取登录token
|
// 获取登录token
|
||||||
return Result.success(tokenService.createToken(userInfo));
|
return Result.success(tokenService.createToken(userInfo));
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,23 +1,21 @@
|
||||||
package com.muyu.auth.form;
|
package com.muyu.auth.form;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
/**
|
/**
|
||||||
* 用户登录对象
|
* 用户登录对象
|
||||||
*
|
*
|
||||||
* @author muyu
|
* @author muyu
|
||||||
*/
|
*/
|
||||||
<<<<<<< HEAD
|
|
||||||
@Data
|
@Data
|
||||||
public class LoginBody {
|
public class LoginBody {
|
||||||
|
|
||||||
private String firmCode;
|
private String firmCode;
|
||||||
=======
|
|
||||||
public class LoginBody {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
/**
|
/**
|
||||||
* 用户名
|
* 用户名
|
||||||
*/
|
*/
|
||||||
|
@ -27,8 +25,8 @@ public class LoginBody {
|
||||||
* 用户密码
|
* 用户密码
|
||||||
*/
|
*/
|
||||||
private String password;
|
private String password;
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
|
|
||||||
public String getUsername () {
|
public String getUsername () {
|
||||||
return username;
|
return username;
|
||||||
|
@ -38,12 +36,5 @@ public class LoginBody {
|
||||||
this.username = username;
|
this.username = username;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPassword () {
|
|
||||||
return password;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPassword (String password) {
|
|
||||||
this.password = password;
|
|
||||||
}
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
package com.muyu.auth.service;
|
package com.muyu.auth.service;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
import com.muyu.auth.form.LoginBody;
|
import com.muyu.auth.form.LoginBody;
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import com.muyu.common.core.constant.CacheConstants;
|
import com.muyu.common.core.constant.CacheConstants;
|
||||||
import com.muyu.common.core.constant.Constants;
|
import com.muyu.common.core.constant.Constants;
|
||||||
import com.muyu.common.core.constant.SecurityConstants;
|
import com.muyu.common.core.constant.SecurityConstants;
|
||||||
|
@ -16,25 +13,15 @@ import com.muyu.common.core.utils.StringUtils;
|
||||||
import com.muyu.common.core.utils.ip.IpUtils;
|
import com.muyu.common.core.utils.ip.IpUtils;
|
||||||
import com.muyu.common.redis.service.RedisService;
|
import com.muyu.common.redis.service.RedisService;
|
||||||
import com.muyu.common.security.utils.SecurityUtils;
|
import com.muyu.common.security.utils.SecurityUtils;
|
||||||
<<<<<<< HEAD
|
import com.muyu.common.system.domain.LoginUser;
|
||||||
|
import com.muyu.common.system.domain.SysUser;
|
||||||
import com.muyu.common.system.remote.RemoteSaasService;
|
import com.muyu.common.system.remote.RemoteSaasService;
|
||||||
import com.muyu.common.system.remote.RemoteUserService;
|
import com.muyu.common.system.remote.RemoteUserService;
|
||||||
import com.muyu.common.system.domain.SysUser;
|
import org.springframework.stereotype.Component;
|
||||||
import com.muyu.common.system.domain.LoginUser;
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
|
|
||||||
=======
|
|
||||||
import com.muyu.common.system.remote.RemoteUserService;
|
|
||||||
import com.muyu.common.system.domain.SysUser;
|
|
||||||
import com.muyu.common.system.domain.LoginUser;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
/**
|
/**
|
||||||
* 登录校验方法
|
* 登录校验方法
|
||||||
*
|
*
|
||||||
|
@ -42,7 +29,6 @@ import org.springframework.stereotype.Component;
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
public class SysLoginService {
|
public class SysLoginService {
|
||||||
<<<<<<< HEAD
|
|
||||||
@Resource
|
@Resource
|
||||||
private RemoteUserService remoteUserService;
|
private RemoteUserService remoteUserService;
|
||||||
|
|
||||||
|
@ -67,26 +53,6 @@ public class SysLoginService {
|
||||||
String password = form.getPassword();
|
String password = form.getPassword();
|
||||||
// 用户名或密码为空 错误
|
// 用户名或密码为空 错误
|
||||||
if (StringUtils.isAnyBlank(firmCode, username, password)) {
|
if (StringUtils.isAnyBlank(firmCode, username, password)) {
|
||||||
=======
|
|
||||||
@Autowired
|
|
||||||
private RemoteUserService remoteUserService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private SysPasswordService passwordService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private SysRecordLogService recordLogService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private RedisService redisService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 登录
|
|
||||||
*/
|
|
||||||
public LoginUser login (String username, String password) {
|
|
||||||
// 用户名或密码为空 错误
|
|
||||||
if (StringUtils.isAnyBlank(username, password)) {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "用户/密码必须填写");
|
recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "用户/密码必须填写");
|
||||||
throw new ServiceException("用户/密码必须填写");
|
throw new ServiceException("用户/密码必须填写");
|
||||||
}
|
}
|
||||||
|
@ -109,12 +75,7 @@ public class SysLoginService {
|
||||||
throw new ServiceException("很遗憾,访问IP已被列入系统黑名单");
|
throw new ServiceException("很遗憾,访问IP已被列入系统黑名单");
|
||||||
}
|
}
|
||||||
// 查询用户信息
|
// 查询用户信息
|
||||||
<<<<<<< HEAD
|
|
||||||
Result<LoginUser> userResult = remoteUserService.getUserInfo(firmCode, username, SecurityConstants.INNER);
|
Result<LoginUser> userResult = remoteUserService.getUserInfo(firmCode, username, SecurityConstants.INNER);
|
||||||
=======
|
|
||||||
Result<LoginUser> userResult = remoteUserService.getUserInfo(username, SecurityConstants.INNER);
|
|
||||||
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
if (StringUtils.isNull(userResult) || StringUtils.isNull(userResult.getData())) {
|
if (StringUtils.isNull(userResult) || StringUtils.isNull(userResult.getData())) {
|
||||||
recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "登录用户不存在");
|
recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "登录用户不存在");
|
||||||
throw new ServiceException("登录用户:" + username + " 不存在");
|
throw new ServiceException("登录用户:" + username + " 不存在");
|
||||||
|
@ -124,13 +85,8 @@ public class SysLoginService {
|
||||||
throw new ServiceException(userResult.getMsg());
|
throw new ServiceException(userResult.getMsg());
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
LoginUser loginUser = userResult.getData();
|
LoginUser loginUser = userResult.getData();
|
||||||
SysUser user = loginUser.getSysUser();
|
SysUser user = loginUser.getSysUser();
|
||||||
=======
|
|
||||||
LoginUser userInfo = userResult.getData();
|
|
||||||
SysUser user = userResult.getData().getSysUser();
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
if (UserStatus.DELETED.getCode().equals(user.getDelFlag())) {
|
if (UserStatus.DELETED.getCode().equals(user.getDelFlag())) {
|
||||||
recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "对不起,您的账号已被删除");
|
recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "对不起,您的账号已被删除");
|
||||||
throw new ServiceException("对不起,您的账号:" + username + " 已被删除");
|
throw new ServiceException("对不起,您的账号:" + username + " 已被删除");
|
||||||
|
@ -141,12 +97,8 @@ public class SysLoginService {
|
||||||
}
|
}
|
||||||
passwordService.validate(user, password);
|
passwordService.validate(user, password);
|
||||||
recordLogService.recordLogininfor(username, Constants.LOGIN_SUCCESS, "登录成功");
|
recordLogService.recordLogininfor(username, Constants.LOGIN_SUCCESS, "登录成功");
|
||||||
<<<<<<< HEAD
|
|
||||||
|
|
||||||
return loginUser;
|
return loginUser;
|
||||||
=======
|
|
||||||
return userInfo;
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void logout (String loginName) {
|
public void logout (String loginName) {
|
||||||
|
|
|
@ -6,11 +6,11 @@ import com.muyu.common.core.exception.ServiceException;
|
||||||
import com.muyu.common.redis.service.RedisService;
|
import com.muyu.common.redis.service.RedisService;
|
||||||
import com.muyu.common.security.utils.SecurityUtils;
|
import com.muyu.common.security.utils.SecurityUtils;
|
||||||
import com.muyu.common.system.domain.SysUser;
|
import com.muyu.common.system.domain.SysUser;
|
||||||
<<<<<<< HEAD
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
=======
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
@ -22,22 +22,22 @@ import java.util.concurrent.TimeUnit;
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
public class SysPasswordService {
|
public class SysPasswordService {
|
||||||
<<<<<<< HEAD
|
|
||||||
@Resource
|
@Resource
|
||||||
=======
|
|
||||||
@Autowired
|
@Autowired
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
private RedisService redisService;
|
private RedisService redisService;
|
||||||
|
|
||||||
private int maxRetryCount = CacheConstants.PASSWORD_MAX_RETRY_COUNT;
|
private int maxRetryCount = CacheConstants.PASSWORD_MAX_RETRY_COUNT;
|
||||||
|
|
||||||
private Long lockTime = CacheConstants.PASSWORD_LOCK_TIME;
|
private Long lockTime = CacheConstants.PASSWORD_LOCK_TIME;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
@Resource
|
@Resource
|
||||||
=======
|
|
||||||
@Autowired
|
@Autowired
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
private SysRecordLogService recordLogService;
|
private SysRecordLogService recordLogService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -6,11 +6,11 @@ import com.muyu.common.core.utils.StringUtils;
|
||||||
import com.muyu.common.core.utils.ip.IpUtils;
|
import com.muyu.common.core.utils.ip.IpUtils;
|
||||||
import com.muyu.common.system.remote.RemoteLogService;
|
import com.muyu.common.system.remote.RemoteLogService;
|
||||||
import com.muyu.common.system.domain.SysLogininfor;
|
import com.muyu.common.system.domain.SysLogininfor;
|
||||||
<<<<<<< HEAD
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
=======
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -20,11 +20,11 @@ import org.springframework.stereotype.Component;
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
public class SysRecordLogService {
|
public class SysRecordLogService {
|
||||||
<<<<<<< HEAD
|
|
||||||
@Resource
|
@Resource
|
||||||
=======
|
|
||||||
@Autowired
|
@Autowired
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
private RemoteLogService remoteLogService;
|
private RemoteLogService remoteLogService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -7,11 +7,11 @@ nacos:
|
||||||
addr: 106.54.193.225:8848
|
addr: 106.54.193.225:8848
|
||||||
user-name: nacos
|
user-name: nacos
|
||||||
password: nacos
|
password: nacos
|
||||||
<<<<<<< HEAD
|
|
||||||
namespace: one-saas
|
namespace: one-saas
|
||||||
=======
|
|
||||||
namespace: one
|
namespace: one
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
# Spring
|
# Spring
|
||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
|
@ -44,15 +44,15 @@ spring:
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
shared-configs:
|
shared-configs:
|
||||||
<<<<<<< HEAD
|
|
||||||
# 系统环境Config共享配置
|
# 系统环境Config共享配置
|
||||||
- application-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
- application-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
# 系统共享配置
|
# 系统共享配置
|
||||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
=======
|
|
||||||
# 系统共享配置
|
# 系统共享配置
|
||||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
# 系统环境Config共享配置
|
# 系统环境Config共享配置
|
||||||
- application-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
- application-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
|
|
|
@ -45,12 +45,11 @@ public class SecurityConstants {
|
||||||
* 角色权限
|
* 角色权限
|
||||||
*/
|
*/
|
||||||
public static final String ROLE_PERMISSION = "role_permission";
|
public static final String ROLE_PERMISSION = "role_permission";
|
||||||
<<<<<<< HEAD
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SAAS请求头的key
|
* SAAS请求头的key
|
||||||
*/
|
*/
|
||||||
public static final String SAAS_KEY = "ent-code";
|
public static final String SAAS_KEY = "ent-code";
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,6 @@ public class ServiceNameConstants {
|
||||||
* 文件服务的serviceid
|
* 文件服务的serviceid
|
||||||
*/
|
*/
|
||||||
public static final String FILE_SERVICE = "cloud-file";
|
public static final String FILE_SERVICE = "cloud-file";
|
||||||
<<<<<<< HEAD
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 智能车联服务
|
* 智能车联服务
|
||||||
|
@ -30,6 +29,5 @@ public class ServiceNameConstants {
|
||||||
public static final String ENT_SERVICE = "cloud-ent";
|
public static final String ENT_SERVICE = "cloud-ent";
|
||||||
|
|
||||||
public static final String SAAS_SERVICE = "cloud-system-saas";
|
public static final String SAAS_SERVICE = "cloud-system-saas";
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,7 +80,7 @@ public class SecurityContextHolder {
|
||||||
public static void remove () {
|
public static void remove () {
|
||||||
THREAD_LOCAL.remove();
|
THREAD_LOCAL.remove();
|
||||||
}
|
}
|
||||||
<<<<<<< HEAD
|
|
||||||
|
|
||||||
public static String getSaasKey() {
|
public static String getSaasKey() {
|
||||||
return get(SecurityConstants.SAAS_KEY);
|
return get(SecurityConstants.SAAS_KEY);
|
||||||
|
@ -89,6 +89,5 @@ public class SecurityContextHolder {
|
||||||
set(SecurityConstants.SAAS_KEY,saasKey);
|
set(SecurityConstants.SAAS_KEY,saasKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -162,7 +162,7 @@ public class JwtUtils {
|
||||||
public static String getValue (Claims claims, String key) {
|
public static String getValue (Claims claims, String key) {
|
||||||
return Convert.toStr(claims.get(key), "");
|
return Convert.toStr(claims.get(key), "");
|
||||||
}
|
}
|
||||||
<<<<<<< HEAD
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据身份信息获取SAASKey
|
* 根据身份信息获取SAASKey
|
||||||
|
@ -174,6 +174,5 @@ public class JwtUtils {
|
||||||
public static String getSaasKey(Claims claims) {
|
public static String getSaasKey(Claims claims) {
|
||||||
return getValue(claims, SecurityConstants.SAAS_KEY);
|
return getValue(claims, SecurityConstants.SAAS_KEY);
|
||||||
}
|
}
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,11 +58,8 @@ public class IpUtils {
|
||||||
ip = request.getRemoteAddr();
|
ip = request.getRemoteAddr();
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
return "0:0:0:0:0:0:0:1".equals(ip) ? "106.54.193.225" : getMultistageReverseProxyIp(ip);
|
return "0:0:0:0:0:0:0:1".equals(ip) ? "106.54.193.225" : getMultistageReverseProxyIp(ip);
|
||||||
=======
|
|
||||||
return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : getMultistageReverseProxyIp(ip);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -74,11 +71,10 @@ public class IpUtils {
|
||||||
*/
|
*/
|
||||||
public static boolean internalIp (String ip) {
|
public static boolean internalIp (String ip) {
|
||||||
byte[] addr = textToNumericFormatV4(ip);
|
byte[] addr = textToNumericFormatV4(ip);
|
||||||
<<<<<<< HEAD
|
|
||||||
return internalIp(addr) || "106.54.193.225".equals(ip);
|
return internalIp(addr) || "106.54.193.225".equals(ip);
|
||||||
=======
|
|
||||||
return internalIp(addr) || "127.0.0.1".equals(ip);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -205,11 +201,8 @@ public class IpUtils {
|
||||||
return InetAddress.getLocalHost().getHostAddress();
|
return InetAddress.getLocalHost().getHostAddress();
|
||||||
} catch (UnknownHostException e) {
|
} catch (UnknownHostException e) {
|
||||||
}
|
}
|
||||||
<<<<<<< HEAD
|
|
||||||
return "106.54.193.225";
|
return "106.54.193.225";
|
||||||
=======
|
|
||||||
return "127.0.0.1";
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -18,11 +18,11 @@ import org.aspectj.lang.annotation.Aspect;
|
||||||
import org.aspectj.lang.annotation.Before;
|
import org.aspectj.lang.annotation.Before;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
<<<<<<< HEAD
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
=======
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import org.springframework.core.NamedThreadLocal;
|
import org.springframework.core.NamedThreadLocal;
|
||||||
import org.springframework.http.HttpMethod;
|
import org.springframework.http.HttpMethod;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
@ -52,11 +52,11 @@ public class LogAspect {
|
||||||
*/
|
*/
|
||||||
private static final ThreadLocal<Long> TIME_THREADLOCAL = new NamedThreadLocal<Long>("Cost Time");
|
private static final ThreadLocal<Long> TIME_THREADLOCAL = new NamedThreadLocal<Long>("Cost Time");
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
@Resource
|
@Resource
|
||||||
=======
|
|
||||||
@Autowired
|
@Autowired
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
private AsyncLogService asyncLogService;
|
private AsyncLogService asyncLogService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -90,7 +90,7 @@ public class LogAspect {
|
||||||
|
|
||||||
protected void handleLog (final JoinPoint joinPoint, Log controllerLog, final Exception e, Object jsonResult) {
|
protected void handleLog (final JoinPoint joinPoint, Log controllerLog, final Exception e, Object jsonResult) {
|
||||||
try {
|
try {
|
||||||
// *========数据库日志=========*//
|
// *=数据库日志==*//
|
||||||
SysOperLog operLog = new SysOperLog();
|
SysOperLog operLog = new SysOperLog();
|
||||||
operLog.setStatus(BusinessStatus.SUCCESS.ordinal());
|
operLog.setStatus(BusinessStatus.SUCCESS.ordinal());
|
||||||
// 请求的地址
|
// 请求的地址
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<<<<<<< HEAD
|
|
||||||
com.muyu.common.rabbit.config.RabbitListenerConfig
|
com.muyu.common.rabbit.config.RabbitListenerConfig
|
||||||
com.muyu.common.rabbit.config.RabbitAdminConfig
|
com.muyu.common.rabbit.config.RabbitAdminConfig
|
||||||
com.muyu.common.rabbit.config.RabbitMQMessageConverterConfig
|
com.muyu.common.rabbit.config.RabbitMQMessageConverterConfig
|
||||||
=======
|
|
||||||
com.muyu.common.rabbit.RabbitListenerConfigurer
|
com.muyu.common.rabbit.RabbitListenerConfigurer
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
|
@ -1,16 +1,14 @@
|
||||||
package com.muyu.common.redis.service;
|
package com.muyu.common.redis.service;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
=======
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import org.springframework.data.redis.core.BoundSetOperations;
|
import org.springframework.data.redis.core.BoundSetOperations;
|
||||||
import org.springframework.data.redis.core.HashOperations;
|
import org.springframework.data.redis.core.HashOperations;
|
||||||
import org.springframework.data.redis.core.RedisTemplate;
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
import org.springframework.data.redis.core.ValueOperations;
|
import org.springframework.data.redis.core.ValueOperations;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
@ -22,11 +20,11 @@ import java.util.concurrent.TimeUnit;
|
||||||
@SuppressWarnings(value = {"unchecked", "rawtypes"})
|
@SuppressWarnings(value = {"unchecked", "rawtypes"})
|
||||||
@Component
|
@Component
|
||||||
public class RedisService {
|
public class RedisService {
|
||||||
<<<<<<< HEAD
|
|
||||||
@Resource
|
@Resource
|
||||||
=======
|
|
||||||
@Autowired
|
@Autowired
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
public RedisTemplate redisTemplate;
|
public RedisTemplate redisTemplate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -28,10 +28,10 @@ public class HeaderInterceptor implements AsyncHandlerInterceptor {
|
||||||
}
|
}
|
||||||
|
|
||||||
SecurityContextHolder.setUserId(ServletUtils.getHeader(request, SecurityConstants.DETAILS_USER_ID));
|
SecurityContextHolder.setUserId(ServletUtils.getHeader(request, SecurityConstants.DETAILS_USER_ID));
|
||||||
<<<<<<< HEAD
|
|
||||||
SecurityContextHolder.setSaasKey(ServletUtils.getHeader(request, SecurityConstants.SAAS_KEY));
|
SecurityContextHolder.setSaasKey(ServletUtils.getHeader(request, SecurityConstants.SAAS_KEY));
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
SecurityContextHolder.setUserName(ServletUtils.getHeader(request, SecurityConstants.DETAILS_USERNAME));
|
SecurityContextHolder.setUserName(ServletUtils.getHeader(request, SecurityConstants.DETAILS_USERNAME));
|
||||||
SecurityContextHolder.setUserKey(ServletUtils.getHeader(request, SecurityConstants.USER_KEY));
|
SecurityContextHolder.setUserKey(ServletUtils.getHeader(request, SecurityConstants.USER_KEY));
|
||||||
|
|
||||||
|
|
|
@ -12,11 +12,7 @@ import com.muyu.common.security.utils.SecurityUtils;
|
||||||
import com.muyu.common.system.domain.LoginUser;
|
import com.muyu.common.system.domain.LoginUser;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
<<<<<<< HEAD
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
=======
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
@ -38,11 +34,7 @@ public class TokenService {
|
||||||
private final static long expireTime = CacheConstants.EXPIRATION;
|
private final static long expireTime = CacheConstants.EXPIRATION;
|
||||||
|
|
||||||
private final static String ACCESS_TOKEN = CacheConstants.LOGIN_TOKEN_KEY;
|
private final static String ACCESS_TOKEN = CacheConstants.LOGIN_TOKEN_KEY;
|
||||||
<<<<<<< HEAD
|
|
||||||
@Resource
|
@Resource
|
||||||
=======
|
|
||||||
@Autowired
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
private RedisService redisService;
|
private RedisService redisService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -63,18 +55,11 @@ public class TokenService {
|
||||||
claimsMap.put(SecurityConstants.USER_KEY, token);
|
claimsMap.put(SecurityConstants.USER_KEY, token);
|
||||||
claimsMap.put(SecurityConstants.DETAILS_USER_ID, userId);
|
claimsMap.put(SecurityConstants.DETAILS_USER_ID, userId);
|
||||||
claimsMap.put(SecurityConstants.DETAILS_USERNAME, userName);
|
claimsMap.put(SecurityConstants.DETAILS_USERNAME, userName);
|
||||||
<<<<<<< HEAD
|
|
||||||
claimsMap.put(SecurityConstants.SAAS_KEY,loginUser.getSysUser().getFirmCode());
|
claimsMap.put(SecurityConstants.SAAS_KEY,loginUser.getSysUser().getFirmCode());
|
||||||
// 接口返回信息
|
// 接口返回信息
|
||||||
Map<String, Object> rspMap = new HashMap<String, Object>();
|
Map<String, Object> rspMap = new HashMap<String, Object>();
|
||||||
rspMap.put("access_token", JwtUtils.createToken(claimsMap));
|
rspMap.put("access_token", JwtUtils.createToken(claimsMap));
|
||||||
rspMap.put("ent_code", loginUser.getSysUser().getFirmCode());
|
rspMap.put("ent_code", loginUser.getSysUser().getFirmCode());
|
||||||
=======
|
|
||||||
|
|
||||||
// 接口返回信息
|
|
||||||
Map<String, Object> rspMap = new HashMap<String, Object>();
|
|
||||||
rspMap.put("access_token", JwtUtils.createToken(claimsMap));
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
rspMap.put("expires_in", expireTime);
|
rspMap.put("expires_in", expireTime);
|
||||||
return rspMap;
|
return rspMap;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,13 +30,13 @@ public class SecurityUtils {
|
||||||
return SecurityContextHolder.getUserName();
|
return SecurityContextHolder.getUserName();
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
public static String getSaasKey () {
|
public static String getSaasKey () {
|
||||||
return SecurityContextHolder.getSaasKey();
|
return SecurityContextHolder.getSaasKey();
|
||||||
}
|
}
|
||||||
|
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
/**
|
/**
|
||||||
* 获取用户key
|
* 获取用户key
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -63,9 +63,9 @@ public class LoginUser implements Serializable {
|
||||||
*/
|
*/
|
||||||
private SysUser sysUser;
|
private SysUser sysUser;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
|
|
||||||
|
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,11 +34,11 @@ public class SysDept extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
private Long parentId;
|
private Long parentId;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
private String firmCode;
|
private String firmCode;
|
||||||
|
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
/**
|
/**
|
||||||
* 祖级列表
|
* 祖级列表
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -36,11 +36,11 @@ public class SysRole extends BaseEntity {
|
||||||
@Excel(name = "角色名称")
|
@Excel(name = "角色名称")
|
||||||
private String roleName;
|
private String roleName;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
private String firmCode;
|
private String firmCode;
|
||||||
|
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
/**
|
/**
|
||||||
* 角色权限
|
* 角色权限
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
package com.muyu.common.system.domain;
|
package com.muyu.common.system.domain;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import com.muyu.common.core.annotation.Excel;
|
import com.muyu.common.core.annotation.Excel;
|
||||||
import com.muyu.common.core.annotation.Excel.ColumnType;
|
import com.muyu.common.core.annotation.Excel.ColumnType;
|
||||||
import com.muyu.common.core.annotation.Excel.Type;
|
import com.muyu.common.core.annotation.Excel.Type;
|
||||||
|
@ -34,10 +31,7 @@ import java.util.List;
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
<<<<<<< HEAD
|
|
||||||
@TableName("sys_user")
|
@TableName("sys_user")
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
public class SysUser extends BaseEntity {
|
public class SysUser extends BaseEntity {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ -45,16 +39,11 @@ public class SysUser extends BaseEntity {
|
||||||
* 用户ID
|
* 用户ID
|
||||||
*/
|
*/
|
||||||
@Excel(name = "用户序号", cellType = ColumnType.NUMERIC, prompt = "用户编号")
|
@Excel(name = "用户序号", cellType = ColumnType.NUMERIC, prompt = "用户编号")
|
||||||
<<<<<<< HEAD
|
|
||||||
@TableId(type = IdType.AUTO)
|
@TableId(type = IdType.AUTO)
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
private Integer isAdmin;
|
private Integer isAdmin;
|
||||||
|
|
||||||
=======
|
|
||||||
private Long userId;
|
|
||||||
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
/**
|
/**
|
||||||
* 部门ID
|
* 部门ID
|
||||||
*/
|
*/
|
||||||
|
@ -67,12 +56,9 @@ public class SysUser extends BaseEntity {
|
||||||
@Excel(name = "登录名称")
|
@Excel(name = "登录名称")
|
||||||
private String userName;
|
private String userName;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
|
|
||||||
private String firmCode;
|
private String firmCode;
|
||||||
|
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
/**
|
/**
|
||||||
* 用户昵称
|
* 用户昵称
|
||||||
*/
|
*/
|
||||||
|
@ -159,11 +145,8 @@ public class SysUser extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
private Long roleId;
|
private Long roleId;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
|
|
||||||
|
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
public SysUser (Long userId) {
|
public SysUser (Long userId) {
|
||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
}
|
}
|
||||||
|
@ -172,14 +155,9 @@ public class SysUser extends BaseEntity {
|
||||||
return userId != null && 1L == userId;
|
return userId != null && 1L == userId;
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
|
|
||||||
public boolean isAdmin () {
|
public boolean isAdmin () {
|
||||||
return isAdmin(this.userId) || (this.isAdmin != null && this.isAdmin == 1);
|
return isAdmin(this.userId) || (this.isAdmin != null && this.isAdmin == 1);
|
||||||
=======
|
|
||||||
public boolean isAdmin () {
|
|
||||||
return isAdmin(this.userId);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Xss(message = "用户昵称不能包含脚本字符")
|
@Xss(message = "用户昵称不能包含脚本字符")
|
||||||
|
|
|
@ -3,7 +3,7 @@ package com.muyu.common.system.remote;
|
||||||
import com.muyu.common.core.constant.SecurityConstants;
|
import com.muyu.common.core.constant.SecurityConstants;
|
||||||
import com.muyu.common.core.constant.ServiceNameConstants;
|
import com.muyu.common.core.constant.ServiceNameConstants;
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
<<<<<<< HEAD
|
|
||||||
import com.muyu.common.system.domain.*;
|
import com.muyu.common.system.domain.*;
|
||||||
import com.muyu.common.system.remote.factory.RemoteUserFallbackFactory;
|
import com.muyu.common.system.remote.factory.RemoteUserFallbackFactory;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
@ -12,14 +12,14 @@ import org.springframework.web.bind.annotation.*;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
=======
|
|
||||||
import com.muyu.common.system.domain.SysUser;
|
import com.muyu.common.system.domain.SysUser;
|
||||||
import com.muyu.common.system.remote.factory.RemoteUserFallbackFactory;
|
import com.muyu.common.system.remote.factory.RemoteUserFallbackFactory;
|
||||||
import com.muyu.common.system.domain.LoginUser;
|
import com.muyu.common.system.domain.LoginUser;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
/**
|
/**
|
||||||
* 用户服务
|
* 用户服务
|
||||||
*
|
*
|
||||||
|
@ -27,8 +27,8 @@ import org.springframework.web.bind.annotation.*;
|
||||||
*/
|
*/
|
||||||
@FeignClient(contextId = "remoteUserService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteUserFallbackFactory.class)
|
@FeignClient(contextId = "remoteUserService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteUserFallbackFactory.class)
|
||||||
public interface RemoteUserService {
|
public interface RemoteUserService {
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
/**
|
/**
|
||||||
* 通过用户名查询用户信息
|
* 通过用户名查询用户信息
|
||||||
*
|
*
|
||||||
|
@ -39,7 +39,7 @@ public interface RemoteUserService {
|
||||||
*/
|
*/
|
||||||
@GetMapping("/user/info/{username}")
|
@GetMapping("/user/info/{username}")
|
||||||
public Result<LoginUser> getUserInfo (@PathVariable("username") String username, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
public Result<LoginUser> getUserInfo (@PathVariable("username") String username, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 注册用户信息
|
* 注册用户信息
|
||||||
|
@ -51,7 +51,7 @@ public interface RemoteUserService {
|
||||||
*/
|
*/
|
||||||
@PostMapping("/user/register")
|
@PostMapping("/user/register")
|
||||||
public Result<Boolean> registerUserInfo (@RequestBody SysUser sysUser, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
public Result<Boolean> registerUserInfo (@RequestBody SysUser sysUser, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||||
<<<<<<< HEAD
|
|
||||||
|
|
||||||
@GetMapping("/user/companyList")
|
@GetMapping("/user/companyList")
|
||||||
public Result<List<SysUser>> companyList ();
|
public Result<List<SysUser>> companyList ();
|
||||||
|
@ -121,6 +121,6 @@ public interface RemoteUserService {
|
||||||
*/
|
*/
|
||||||
@PostMapping("/user")
|
@PostMapping("/user")
|
||||||
public Result addUser (@RequestBody SysUser user);
|
public Result addUser (@RequestBody SysUser user);
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,26 +1,26 @@
|
||||||
package com.muyu.common.system.remote.factory;
|
package com.muyu.common.system.remote.factory;
|
||||||
|
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
<<<<<<< HEAD
|
|
||||||
import com.muyu.common.core.web.page.TableDataInfo;
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
import com.muyu.common.system.domain.*;
|
import com.muyu.common.system.domain.*;
|
||||||
import com.muyu.common.system.remote.RemoteUserService;
|
import com.muyu.common.system.remote.RemoteUserService;
|
||||||
=======
|
|
||||||
import com.muyu.common.system.remote.RemoteUserService;
|
import com.muyu.common.system.remote.RemoteUserService;
|
||||||
import com.muyu.common.system.domain.SysUser;
|
import com.muyu.common.system.domain.SysUser;
|
||||||
import com.muyu.common.system.domain.LoginUser;
|
import com.muyu.common.system.domain.LoginUser;
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.cloud.openfeign.FallbackFactory;
|
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
/**
|
/**
|
||||||
* 用户服务降级处理
|
* 用户服务降级处理
|
||||||
*
|
*
|
||||||
|
@ -34,19 +34,19 @@ public class RemoteUserFallbackFactory implements FallbackFactory<RemoteUserServ
|
||||||
public RemoteUserService create (Throwable throwable) {
|
public RemoteUserService create (Throwable throwable) {
|
||||||
log.error("用户服务调用失败:{}", throwable.getMessage());
|
log.error("用户服务调用失败:{}", throwable.getMessage());
|
||||||
return new RemoteUserService() {
|
return new RemoteUserService() {
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
@Override
|
@Override
|
||||||
public Result<LoginUser> getUserInfo (String username, String source) {
|
public Result<LoginUser> getUserInfo (String username, String source) {
|
||||||
return Result.error("获取用户失败:" + throwable.getMessage());
|
return Result.error("获取用户失败:" + throwable.getMessage());
|
||||||
}
|
}
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result<Boolean> registerUserInfo (SysUser sysUser, String source) {
|
public Result<Boolean> registerUserInfo (SysUser sysUser, String source) {
|
||||||
return Result.error("注册用户失败:" + throwable.getMessage());
|
return Result.error("注册用户失败:" + throwable.getMessage());
|
||||||
}
|
}
|
||||||
<<<<<<< HEAD
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result<List<SysUser>> companyList() {
|
public Result<List<SysUser>> companyList() {
|
||||||
|
@ -93,8 +93,8 @@ public class RemoteUserFallbackFactory implements FallbackFactory<RemoteUserServ
|
||||||
return Result.error(throwable);
|
return Result.error(throwable);
|
||||||
}
|
}
|
||||||
|
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
com.muyu.common.system.remote.factory.RemoteUserFallbackFactory
|
com.muyu.common.system.remote.factory.RemoteUserFallbackFactory
|
||||||
com.muyu.common.system.remote.factory.RemoteLogFallbackFactory
|
com.muyu.common.system.remote.factory.RemoteLogFallbackFactory
|
||||||
com.muyu.common.system.remote.factory.RemoteFileFallbackFactory
|
com.muyu.common.system.remote.factory.RemoteFileFallbackFactory
|
||||||
<<<<<<< HEAD
|
|
||||||
com.muyu.common.system.remote.factory.RemoteSaasFallbackFactory
|
com.muyu.common.system.remote.factory.RemoteSaasFallbackFactory
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
|
@ -7,15 +7,9 @@ import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
@Log4j2
|
@Log4j2
|
||||||
<<<<<<< HEAD
|
|
||||||
//@Component
|
|
||||||
public class XXLJobConfig {
|
|
||||||
// @Bean
|
|
||||||
=======
|
|
||||||
@Component
|
@Component
|
||||||
public class XXLJobConfig {
|
public class XXLJobConfig {
|
||||||
@Bean
|
@Bean
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
public XxlJobSpringExecutor xxlJobExecutor(XxlJobProperties xxlJobProperties) {
|
public XxlJobSpringExecutor xxlJobExecutor(XxlJobProperties xxlJobProperties) {
|
||||||
if (StringUtils.isEmpty(xxlJobProperties.getAdminAddresses())){
|
if (StringUtils.isEmpty(xxlJobProperties.getAdminAddresses())){
|
||||||
throw new RuntimeException("请在bootstrap.yml当中配置shared-configs项,xxl-job共享配置[application-xxl-config]");
|
throw new RuntimeException("请在bootstrap.yml当中配置shared-configs项,xxl-job共享配置[application-xxl-config]");
|
||||||
|
|
|
@ -13,9 +13,9 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||||
public class CloudGatewayApplication {
|
public class CloudGatewayApplication {
|
||||||
public static void main (String[] args) {
|
public static void main (String[] args) {
|
||||||
SpringApplication.run(CloudGatewayApplication.class, args);
|
SpringApplication.run(CloudGatewayApplication.class, args);
|
||||||
<<<<<<< HEAD
|
|
||||||
System.out.println("CloudGateway 模块启动成功!");
|
System.out.println("CloudGateway 模块启动成功!");
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
package com.muyu.gateway.config;
|
package com.muyu.gateway.config;
|
||||||
|
|
||||||
import com.muyu.gateway.handler.ValidateCodeHandler;
|
import com.muyu.gateway.handler.ValidateCodeHandler;
|
||||||
<<<<<<< HEAD
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
=======
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
|
@ -20,11 +20,11 @@ import org.springframework.web.reactive.function.server.RouterFunctions;
|
||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
public class RouterFunctionConfiguration {
|
public class RouterFunctionConfiguration {
|
||||||
<<<<<<< HEAD
|
|
||||||
@Resource
|
@Resource
|
||||||
=======
|
|
||||||
@Autowired
|
@Autowired
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
private ValidateCodeHandler validateCodeHandler;
|
private ValidateCodeHandler validateCodeHandler;
|
||||||
|
|
||||||
@SuppressWarnings("rawtypes")
|
@SuppressWarnings("rawtypes")
|
||||||
|
|
|
@ -177,7 +177,7 @@ public class AccessLogFilter implements GlobalFilter, Ordered {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========== 参考 ModifyRequestBodyGatewayFilterFactory 中的方法 ==========
|
// === 参考 ModifyRequestBodyGatewayFilterFactory 中的方法 ===
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 请求装饰器,支持重新计算 headers、body 缓存
|
* 请求装饰器,支持重新计算 headers、body 缓存
|
||||||
|
@ -210,7 +210,7 @@ public class AccessLogFilter implements GlobalFilter, Ordered {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========== 参考 ModifyResponseBodyGatewayFilterFactory 中的方法 ==========
|
// === 参考 ModifyResponseBodyGatewayFilterFactory 中的方法 ===
|
||||||
|
|
||||||
private byte[] readContent(List<? extends DataBuffer> dataBuffers) {
|
private byte[] readContent(List<? extends DataBuffer> dataBuffers) {
|
||||||
// 合并多个流集合,解决返回体分段传输
|
// 合并多个流集合,解决返回体分段传输
|
||||||
|
|
|
@ -12,11 +12,7 @@ import com.muyu.gateway.config.properties.IgnoreWhiteProperties;
|
||||||
import io.jsonwebtoken.Claims;
|
import io.jsonwebtoken.Claims;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
<<<<<<< HEAD
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
=======
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import org.springframework.cloud.gateway.filter.GatewayFilterChain;
|
import org.springframework.cloud.gateway.filter.GatewayFilterChain;
|
||||||
import org.springframework.cloud.gateway.filter.GlobalFilter;
|
import org.springframework.cloud.gateway.filter.GlobalFilter;
|
||||||
import org.springframework.core.Ordered;
|
import org.springframework.core.Ordered;
|
||||||
|
@ -35,17 +31,10 @@ public class AuthFilter implements GlobalFilter, Ordered {
|
||||||
private static final Logger log = LoggerFactory.getLogger(AuthFilter.class);
|
private static final Logger log = LoggerFactory.getLogger(AuthFilter.class);
|
||||||
|
|
||||||
// 排除过滤的 uri 地址,nacos自行添加
|
// 排除过滤的 uri 地址,nacos自行添加
|
||||||
<<<<<<< HEAD
|
|
||||||
@Resource
|
@Resource
|
||||||
private IgnoreWhiteProperties ignoreWhite;
|
private IgnoreWhiteProperties ignoreWhite;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
=======
|
|
||||||
@Autowired
|
|
||||||
private IgnoreWhiteProperties ignoreWhite;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
private RedisService redisService;
|
private RedisService redisService;
|
||||||
|
|
||||||
|
|
||||||
|
@ -74,10 +63,7 @@ public class AuthFilter implements GlobalFilter, Ordered {
|
||||||
}
|
}
|
||||||
String userid = JwtUtils.getUserId(claims);
|
String userid = JwtUtils.getUserId(claims);
|
||||||
String username = JwtUtils.getUserName(claims);
|
String username = JwtUtils.getUserName(claims);
|
||||||
<<<<<<< HEAD
|
|
||||||
String saasKey = JwtUtils.getSaasKey(claims);
|
String saasKey = JwtUtils.getSaasKey(claims);
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
if (StringUtils.isEmpty(userid) || StringUtils.isEmpty(username)) {
|
if (StringUtils.isEmpty(userid) || StringUtils.isEmpty(username)) {
|
||||||
return unauthorizedResponse(exchange, "令牌验证失败");
|
return unauthorizedResponse(exchange, "令牌验证失败");
|
||||||
}
|
}
|
||||||
|
@ -86,10 +72,7 @@ public class AuthFilter implements GlobalFilter, Ordered {
|
||||||
addHeader(mutate, SecurityConstants.USER_KEY, userkey);
|
addHeader(mutate, SecurityConstants.USER_KEY, userkey);
|
||||||
addHeader(mutate, SecurityConstants.DETAILS_USER_ID, userid);
|
addHeader(mutate, SecurityConstants.DETAILS_USER_ID, userid);
|
||||||
addHeader(mutate, SecurityConstants.DETAILS_USERNAME, username);
|
addHeader(mutate, SecurityConstants.DETAILS_USERNAME, username);
|
||||||
<<<<<<< HEAD
|
|
||||||
addHeader(mutate,SecurityConstants.SAAS_KEY,saasKey);
|
addHeader(mutate,SecurityConstants.SAAS_KEY,saasKey);
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
// 内部请求来源参数清除
|
// 内部请求来源参数清除
|
||||||
removeHeader(mutate, SecurityConstants.FROM_SOURCE);
|
removeHeader(mutate, SecurityConstants.FROM_SOURCE);
|
||||||
return chain.filter(exchange.mutate().request(mutate.build()).build());
|
return chain.filter(exchange.mutate().request(mutate.build()).build());
|
||||||
|
|
|
@ -6,11 +6,7 @@ import com.muyu.common.core.utils.ServletUtils;
|
||||||
import com.muyu.common.core.utils.StringUtils;
|
import com.muyu.common.core.utils.StringUtils;
|
||||||
import com.muyu.gateway.config.properties.CaptchaProperties;
|
import com.muyu.gateway.config.properties.CaptchaProperties;
|
||||||
import com.muyu.gateway.service.ValidateCodeService;
|
import com.muyu.gateway.service.ValidateCodeService;
|
||||||
<<<<<<< HEAD
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
=======
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import org.springframework.cloud.gateway.filter.GatewayFilter;
|
import org.springframework.cloud.gateway.filter.GatewayFilter;
|
||||||
import org.springframework.cloud.gateway.filter.factory.AbstractGatewayFilterFactory;
|
import org.springframework.cloud.gateway.filter.factory.AbstractGatewayFilterFactory;
|
||||||
import org.springframework.core.io.buffer.DataBuffer;
|
import org.springframework.core.io.buffer.DataBuffer;
|
||||||
|
@ -33,15 +29,9 @@ public class ValidateCodeFilter extends AbstractGatewayFilterFactory<Object> {
|
||||||
private final static String[] VALIDATE_URL = new String[]{"/auth/login", "/auth/register"};
|
private final static String[] VALIDATE_URL = new String[]{"/auth/login", "/auth/register"};
|
||||||
private static final String CODE = "code";
|
private static final String CODE = "code";
|
||||||
private static final String UUID = "uuid";
|
private static final String UUID = "uuid";
|
||||||
<<<<<<< HEAD
|
|
||||||
@Resource
|
@Resource
|
||||||
private ValidateCodeService validateCodeService;
|
private ValidateCodeService validateCodeService;
|
||||||
@Resource
|
@Resource
|
||||||
=======
|
|
||||||
@Autowired
|
|
||||||
private ValidateCodeService validateCodeService;
|
|
||||||
@Autowired
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
private CaptchaProperties captchaProperties;
|
private CaptchaProperties captchaProperties;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -4,11 +4,11 @@ import com.muyu.common.core.utils.StringUtils;
|
||||||
import com.muyu.common.core.utils.html.EscapeUtil;
|
import com.muyu.common.core.utils.html.EscapeUtil;
|
||||||
import com.muyu.gateway.config.properties.XssProperties;
|
import com.muyu.gateway.config.properties.XssProperties;
|
||||||
import io.netty.buffer.ByteBufAllocator;
|
import io.netty.buffer.ByteBufAllocator;
|
||||||
<<<<<<< HEAD
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
=======
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
import org.springframework.cloud.gateway.filter.GatewayFilterChain;
|
import org.springframework.cloud.gateway.filter.GatewayFilterChain;
|
||||||
import org.springframework.cloud.gateway.filter.GlobalFilter;
|
import org.springframework.cloud.gateway.filter.GlobalFilter;
|
||||||
|
@ -35,11 +35,11 @@ import java.nio.charset.StandardCharsets;
|
||||||
@ConditionalOnProperty(value = "security.xss.enabled", havingValue = "true")
|
@ConditionalOnProperty(value = "security.xss.enabled", havingValue = "true")
|
||||||
public class XssFilter implements GlobalFilter, Ordered {
|
public class XssFilter implements GlobalFilter, Ordered {
|
||||||
// 跨站脚本的 xss 配置,nacos自行添加
|
// 跨站脚本的 xss 配置,nacos自行添加
|
||||||
<<<<<<< HEAD
|
|
||||||
@Resource
|
@Resource
|
||||||
=======
|
|
||||||
@Autowired
|
@Autowired
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
private XssProperties xss;
|
private XssProperties xss;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -3,11 +3,11 @@ package com.muyu.gateway.handler;
|
||||||
import com.muyu.common.core.exception.CaptchaException;
|
import com.muyu.common.core.exception.CaptchaException;
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
import com.muyu.gateway.service.ValidateCodeService;
|
import com.muyu.gateway.service.ValidateCodeService;
|
||||||
<<<<<<< HEAD
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
=======
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.web.reactive.function.BodyInserters;
|
import org.springframework.web.reactive.function.BodyInserters;
|
||||||
|
@ -25,11 +25,11 @@ import java.io.IOException;
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
public class ValidateCodeHandler implements HandlerFunction<ServerResponse> {
|
public class ValidateCodeHandler implements HandlerFunction<ServerResponse> {
|
||||||
<<<<<<< HEAD
|
|
||||||
@Resource
|
@Resource
|
||||||
=======
|
|
||||||
@Autowired
|
@Autowired
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
private ValidateCodeService validateCodeService;
|
private ValidateCodeService validateCodeService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -4,11 +4,11 @@ import cn.hutool.core.net.NetUtil;
|
||||||
import cn.hutool.core.util.ArrayUtil;
|
import cn.hutool.core.util.ArrayUtil;
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import lombok.extern.log4j.Log4j2;
|
import lombok.extern.log4j.Log4j2;
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import org.springframework.cloud.gateway.route.Route;
|
import org.springframework.cloud.gateway.route.Route;
|
||||||
import org.springframework.cloud.gateway.support.ServerWebExchangeUtils;
|
import org.springframework.cloud.gateway.support.ServerWebExchangeUtils;
|
||||||
import org.springframework.core.io.buffer.DataBufferFactory;
|
import org.springframework.core.io.buffer.DataBufferFactory;
|
||||||
|
@ -21,11 +21,11 @@ import reactor.core.publisher.Mono;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Web 工具类
|
* Web 工具类
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
*/
|
*/
|
||||||
@Log4j2
|
@Log4j2
|
||||||
public class WebFrameworkUtils {
|
public class WebFrameworkUtils {
|
||||||
|
@ -78,11 +78,11 @@ public class WebFrameworkUtils {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得客户端 IP
|
* 获得客户端 IP
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
* @param exchange 请求
|
* @param exchange 请求
|
||||||
* @param otherHeaderNames 其它 header 名字的数组
|
* @param otherHeaderNames 其它 header 名字的数组
|
||||||
* @return 客户端 IP
|
* @return 客户端 IP
|
||||||
|
@ -100,10 +100,10 @@ public class WebFrameworkUtils {
|
||||||
return NetUtil.getMultistageReverseProxyIp(ip);
|
return NetUtil.getMultistageReverseProxyIp(ip);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
|
|
||||||
// 方式二,通过 remoteAddress 获取
|
// 方式二,通过 remoteAddress 获取
|
||||||
if (exchange.getRequest().getRemoteAddress() == null) {
|
if (exchange.getRequest().getRemoteAddress() == null) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -114,10 +114,10 @@ public class WebFrameworkUtils {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得请求匹配的 Route 路由
|
* 获得请求匹配的 Route 路由
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
*
|
*
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
* @param exchange 请求
|
* @param exchange 请求
|
||||||
* @return 路由
|
* @return 路由
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -7,11 +7,11 @@ nacos:
|
||||||
addr: 106.54.193.225:8848
|
addr: 106.54.193.225:8848
|
||||||
user-name: nacos
|
user-name: nacos
|
||||||
password: nacos
|
password: nacos
|
||||||
<<<<<<< HEAD
|
|
||||||
namespace: one-saas
|
namespace: one-saas
|
||||||
=======
|
|
||||||
namespace: one
|
namespace: one
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
# Spring
|
# Spring
|
||||||
spring:
|
spring:
|
||||||
|
@ -26,60 +26,60 @@ spring:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: ${nacos.addr}
|
server-addr: ${nacos.addr}
|
||||||
<<<<<<< HEAD
|
|
||||||
# # nacos用户名
|
# # nacos用户名
|
||||||
# username: ${nacos.user-name}
|
# username: ${nacos.user-name}
|
||||||
# # nacos密码
|
# # nacos密码
|
||||||
# password: ${nacos.password}
|
# password: ${nacos.password}
|
||||||
=======
|
|
||||||
# nacos用户名
|
# nacos用户名
|
||||||
username: ${nacos.user-name}
|
username: ${nacos.user-name}
|
||||||
# nacos密码
|
# nacos密码
|
||||||
password: ${nacos.password}
|
password: ${nacos.password}
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
# 命名空间
|
# 命名空间
|
||||||
namespace: ${nacos.namespace}
|
namespace: ${nacos.namespace}
|
||||||
config:
|
config:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: ${nacos.addr}
|
server-addr: ${nacos.addr}
|
||||||
<<<<<<< HEAD
|
|
||||||
# # nacos用户名
|
# # nacos用户名
|
||||||
# username: ${nacos.user-name}
|
# username: ${nacos.user-name}
|
||||||
# # nacos密码
|
# # nacos密码
|
||||||
# password: ${nacos.password}
|
# password: ${nacos.password}
|
||||||
=======
|
|
||||||
# nacos用户名
|
# nacos用户名
|
||||||
username: ${nacos.user-name}
|
username: ${nacos.user-name}
|
||||||
# nacos密码
|
# nacos密码
|
||||||
password: ${nacos.password}
|
password: ${nacos.password}
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
# 命名空间
|
# 命名空间
|
||||||
namespace: ${nacos.namespace}
|
namespace: ${nacos.namespace}
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
shared-configs:
|
shared-configs:
|
||||||
<<<<<<< HEAD
|
|
||||||
# 系统环境Config共享配置
|
# 系统环境Config共享配置
|
||||||
- application-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
- application-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
# 系统共享配置
|
# 系统共享配置
|
||||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
=======
|
|
||||||
# 系统共享配置
|
# 系统共享配置
|
||||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
# 系统环境Config共享配置
|
# 系统环境Config共享配置
|
||||||
- application-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
- application-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
sentinel:
|
sentinel:
|
||||||
# 取消控制台懒加载
|
# 取消控制台懒加载
|
||||||
eager: true
|
eager: true
|
||||||
transport:
|
transport:
|
||||||
# 控制台地址
|
# 控制台地址
|
||||||
<<<<<<< HEAD
|
|
||||||
dashboard: 106.54.193.225:8718
|
dashboard: 106.54.193.225:8718
|
||||||
=======
|
|
||||||
dashboard: 127.0.0.1:8718
|
dashboard: 127.0.0.1:8718
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
# nacos配置持久化
|
# nacos配置持久化
|
||||||
datasource:
|
datasource:
|
||||||
ds1:
|
ds1:
|
||||||
|
|
|
@ -35,7 +35,7 @@ public class CarOneClickOperationController {
|
||||||
*/
|
*/
|
||||||
@PostMapping("/receiveMsg/connect")
|
@PostMapping("/receiveMsg/connect")
|
||||||
public Result<MqttServerModel> receiveMsg(@RequestBody VehicleConnectionReq vehicleConnectionReq){
|
public Result<MqttServerModel> receiveMsg(@RequestBody VehicleConnectionReq vehicleConnectionReq){
|
||||||
log.info("=======>"+vehicleConnectionReq);
|
log.info(">"+vehicleConnectionReq);
|
||||||
MqttServerModel mqttServerModel =carOneClickOperationService.getConnect(vehicleConnectionReq);
|
MqttServerModel mqttServerModel =carOneClickOperationService.getConnect(vehicleConnectionReq);
|
||||||
return Result.success(mqttServerModel);
|
return Result.success(mqttServerModel);
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ public class DeleteSample implements DisposableBean {
|
||||||
@Override
|
@Override
|
||||||
public void destroy() {
|
public void destroy() {
|
||||||
try {
|
try {
|
||||||
log.info("=================开始执行删除实例方法");
|
log.info("===开始执行删除实例方法");
|
||||||
Thread.sleep(10000);
|
Thread.sleep(10000);
|
||||||
aliYunEcsService.deleteInstance();
|
aliYunEcsService.deleteInstance();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
@ -58,7 +58,7 @@ public class Sample implements ApplicationRunner{
|
||||||
// @Override
|
// @Override
|
||||||
// public void destroy(){
|
// public void destroy(){
|
||||||
// try {
|
// try {
|
||||||
// log.info("=================开始执行删除实例方法");
|
// log.info("===开始执行删除实例方法");
|
||||||
// aliYunEcsService.deleteInstance();
|
// aliYunEcsService.deleteInstance();
|
||||||
// redisService.deleteObject("instanceIds");
|
// redisService.deleteObject("instanceIds");
|
||||||
// redisService.deleteObject("instanceList");
|
// redisService.deleteObject("instanceList");
|
||||||
|
|
|
@ -13,9 +13,9 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||||
public class CloudFileApplication {
|
public class CloudFileApplication {
|
||||||
public static void main (String[] args) {
|
public static void main (String[] args) {
|
||||||
SpringApplication.run(CloudFileApplication.class, args);
|
SpringApplication.run(CloudFileApplication.class, args);
|
||||||
<<<<<<< HEAD
|
|
||||||
System.out.println("CloudFile 模块启动成功!");
|
System.out.println("CloudFile 模块启动成功!");
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,11 +6,11 @@ import com.muyu.file.service.ISysFileService;
|
||||||
import com.muyu.common.system.domain.SysFile;
|
import com.muyu.common.system.domain.SysFile;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
<<<<<<< HEAD
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
=======
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestPart;
|
import org.springframework.web.bind.annotation.RequestPart;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
@ -25,11 +25,11 @@ import org.springframework.web.multipart.MultipartFile;
|
||||||
public class SysFileController {
|
public class SysFileController {
|
||||||
private static final Logger log = LoggerFactory.getLogger(SysFileController.class);
|
private static final Logger log = LoggerFactory.getLogger(SysFileController.class);
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
@Resource
|
@Resource
|
||||||
=======
|
|
||||||
@Autowired
|
@Autowired
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
private ISysFileService sysFileService;
|
private ISysFileService sysFileService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -5,14 +5,11 @@ import com.muyu.file.config.MinioConfig;
|
||||||
import com.muyu.file.utils.FileUploadUtils;
|
import com.muyu.file.utils.FileUploadUtils;
|
||||||
import io.minio.MinioClient;
|
import io.minio.MinioClient;
|
||||||
import io.minio.PutObjectArgs;
|
import io.minio.PutObjectArgs;
|
||||||
<<<<<<< HEAD
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
=======
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -22,17 +19,13 @@ import java.io.InputStream;
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class MinioSysFileServiceImpl implements ISysFileService {
|
public class MinioSysFileServiceImpl implements ISysFileService {
|
||||||
<<<<<<< HEAD
|
|
||||||
@Resource
|
@Resource
|
||||||
private MinioConfig minioConfig;
|
private MinioConfig minioConfig;
|
||||||
|
|
||||||
@Resource
|
|
||||||
=======
|
|
||||||
@Autowired
|
|
||||||
private MinioConfig minioConfig;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
private MinioClient client;
|
private MinioClient client;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,21 +1,21 @@
|
||||||
# Tomcat
|
# Tomcat
|
||||||
server:
|
server:
|
||||||
<<<<<<< HEAD
|
|
||||||
port: 9301
|
port: 9301
|
||||||
=======
|
|
||||||
port: 9300
|
port: 9300
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
# nacos线上地址
|
# nacos线上地址
|
||||||
nacos:
|
nacos:
|
||||||
addr: 106.54.193.225:8848
|
addr: 106.54.193.225:8848
|
||||||
user-name: nacos
|
user-name: nacos
|
||||||
password: nacos
|
password: nacos
|
||||||
<<<<<<< HEAD
|
|
||||||
namespace: one-saas
|
namespace: one-saas
|
||||||
=======
|
|
||||||
namespace: one
|
namespace: one
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
# Spring
|
# Spring
|
||||||
spring:
|
spring:
|
||||||
|
|
|
@ -16,9 +16,6 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
public class CloudGenApplication {
|
public class CloudGenApplication {
|
||||||
public static void main (String[] args) {
|
public static void main (String[] args) {
|
||||||
SpringApplication.run(CloudGenApplication.class, args);
|
SpringApplication.run(CloudGenApplication.class, args);
|
||||||
<<<<<<< HEAD
|
|
||||||
System.out.println("CloudGen 模块启动成功!");
|
System.out.println("CloudGen 模块启动成功!");
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,21 +1,14 @@
|
||||||
package com.muyu.gen.controller;
|
package com.muyu.gen.controller;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
import com.muyu.common.core.text.Convert;
|
import com.muyu.common.core.text.Convert;
|
||||||
import com.muyu.common.core.web.controller.BaseController;
|
import com.muyu.common.core.web.controller.BaseController;
|
||||||
=======
|
|
||||||
import com.muyu.common.core.text.Convert;
|
|
||||||
import com.muyu.common.core.web.controller.BaseController;
|
|
||||||
import com.muyu.common.core.domain.Result;
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import com.muyu.common.core.web.page.TableDataInfo;
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
import com.muyu.common.log.annotation.Log;
|
import com.muyu.common.log.annotation.Log;
|
||||||
import com.muyu.common.log.enums.BusinessType;
|
import com.muyu.common.log.enums.BusinessType;
|
||||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||||
import com.muyu.gen.domain.GenTable;
|
import com.muyu.gen.domain.GenTable;
|
||||||
import com.muyu.gen.domain.GenTableColumn;
|
import com.muyu.gen.domain.GenTableColumn;
|
||||||
<<<<<<< HEAD
|
|
||||||
import com.muyu.gen.domain.GenTableResp;
|
import com.muyu.gen.domain.GenTableResp;
|
||||||
import com.muyu.gen.service.IGenTableColumnService;
|
import com.muyu.gen.service.IGenTableColumnService;
|
||||||
import com.muyu.gen.service.IGenTableService;
|
import com.muyu.gen.service.IGenTableService;
|
||||||
|
@ -26,16 +19,6 @@ import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
=======
|
|
||||||
import com.muyu.gen.service.IGenTableColumnService;
|
|
||||||
import com.muyu.gen.service.IGenTableService;
|
|
||||||
import org.apache.commons.io.IOUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -44,7 +27,6 @@ import java.util.Map;
|
||||||
/**
|
/**
|
||||||
* 代码生成 操作处理
|
* 代码生成 操作处理
|
||||||
*
|
*
|
||||||
<<<<<<< HEAD
|
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/gen")
|
@RequestMapping("/gen")
|
||||||
|
@ -58,17 +40,6 @@ public class GenController extends BaseController
|
||||||
private HttpServletResponse response;
|
private HttpServletResponse response;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
=======
|
|
||||||
* @author muyu
|
|
||||||
*/
|
|
||||||
@RequestMapping("/gen")
|
|
||||||
@RestController
|
|
||||||
public class GenController extends BaseController {
|
|
||||||
@Autowired
|
|
||||||
private IGenTableService genTableService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
private IGenTableColumnService genTableColumnService;
|
private IGenTableColumnService genTableColumnService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -76,12 +47,8 @@ public class GenController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("tool:gen:list")
|
@RequiresPermissions("tool:gen:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
<<<<<<< HEAD
|
|
||||||
public Result genList(GenTable genTable)
|
public Result genList(GenTable genTable)
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
public Result<TableDataInfo<GenTable>> genList (GenTable genTable) {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
startPage();
|
startPage();
|
||||||
List<GenTable> list = genTableService.selectGenTableList(genTable);
|
List<GenTable> list = genTableService.selectGenTableList(genTable);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
|
@ -92,12 +59,8 @@ public class GenController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("tool:gen:query")
|
@RequiresPermissions("tool:gen:query")
|
||||||
@GetMapping(value = "/{tableId}")
|
@GetMapping(value = "/{tableId}")
|
||||||
<<<<<<< HEAD
|
|
||||||
public Result getInfo(@PathVariable("tableId") Long tableId)
|
public Result getInfo(@PathVariable("tableId") Long tableId)
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
public Result getInfo (@PathVariable("tableId") Long tableId) {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
GenTable table = genTableService.selectGenTableById(tableId);
|
GenTable table = genTableService.selectGenTableById(tableId);
|
||||||
List<GenTable> tables = genTableService.selectGenTableAll();
|
List<GenTable> tables = genTableService.selectGenTableAll();
|
||||||
List<GenTableColumn> list = genTableColumnService.selectGenTableColumnListByTableId(tableId);
|
List<GenTableColumn> list = genTableColumnService.selectGenTableColumnListByTableId(tableId);
|
||||||
|
@ -108,21 +71,14 @@ public class GenController extends BaseController {
|
||||||
return success(map);
|
return success(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
|
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
/**
|
/**
|
||||||
* 查询数据库列表
|
* 查询数据库列表
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("tool:gen:list")
|
@RequiresPermissions("tool:gen:list")
|
||||||
@GetMapping("/db/list")
|
@GetMapping("/db/list")
|
||||||
<<<<<<< HEAD
|
|
||||||
public Result dataList(GenTable genTable)
|
public Result dataList(GenTable genTable)
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
public Result<TableDataInfo<GenTable>> dataList (GenTable genTable) {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
startPage();
|
startPage();
|
||||||
List<GenTable> list = genTableService.selectDbTableList(genTable);
|
List<GenTable> list = genTableService.selectDbTableList(genTable);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
|
@ -132,7 +88,6 @@ public class GenController extends BaseController {
|
||||||
* 查询数据表字段列表
|
* 查询数据表字段列表
|
||||||
*/
|
*/
|
||||||
@GetMapping(value = "/column/{tableId}")
|
@GetMapping(value = "/column/{tableId}")
|
||||||
<<<<<<< HEAD
|
|
||||||
public Result columnList(@PathVariable("tableId") Long tableId)
|
public Result columnList(@PathVariable("tableId") Long tableId)
|
||||||
{
|
{
|
||||||
TableDataInfo dataInfo = new TableDataInfo();
|
TableDataInfo dataInfo = new TableDataInfo();
|
||||||
|
@ -140,22 +95,11 @@ public class GenController extends BaseController {
|
||||||
dataInfo.setRows(list);
|
dataInfo.setRows(list);
|
||||||
dataInfo.setTotal(list.size());
|
dataInfo.setTotal(list.size());
|
||||||
return success(dataInfo);
|
return success(dataInfo);
|
||||||
=======
|
|
||||||
public Result<TableDataInfo<GenTableColumn>> columnList (Long tableId) {
|
|
||||||
List<GenTableColumn> list = genTableColumnService.selectGenTableColumnListByTableId(tableId);
|
|
||||||
return Result.success(
|
|
||||||
TableDataInfo.<GenTableColumn>builder()
|
|
||||||
.total(list.size())
|
|
||||||
.rows(list)
|
|
||||||
.build()
|
|
||||||
);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导入表结构(保存)
|
* 导入表结构(保存)
|
||||||
*/
|
*/
|
||||||
<<<<<<< HEAD
|
|
||||||
// @RequiresPermissions("tool:gen:import")
|
// @RequiresPermissions("tool:gen:import")
|
||||||
@Log(title = "代码生成", businessType = BusinessType.IMPORT)
|
@Log(title = "代码生成", businessType = BusinessType.IMPORT)
|
||||||
@PostMapping("/importTable")
|
@PostMapping("/importTable")
|
||||||
|
@ -164,15 +108,6 @@ public class GenController extends BaseController {
|
||||||
String[] tableNames = Convert.toStrArray(tables);
|
String[] tableNames = Convert.toStrArray(tables);
|
||||||
// 查询表信息
|
// 查询表信息
|
||||||
List<GenTable> tableList = genTableService.selectDbTableListByNames(tableNames,dbName);
|
List<GenTable> tableList = genTableService.selectDbTableListByNames(tableNames,dbName);
|
||||||
=======
|
|
||||||
@RequiresPermissions("tool:gen:import")
|
|
||||||
@Log(title = "代码生成", businessType = BusinessType.IMPORT)
|
|
||||||
@PostMapping("/importTable")
|
|
||||||
public Result importTableSave (String tables) {
|
|
||||||
String[] tableNames = Convert.toStrArray(tables);
|
|
||||||
// 查询表信息
|
|
||||||
List<GenTable> tableList = genTableService.selectDbTableListByNames(tableNames);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
genTableService.importGenTable(tableList);
|
genTableService.importGenTable(tableList);
|
||||||
return success();
|
return success();
|
||||||
}
|
}
|
||||||
|
@ -183,12 +118,8 @@ public class GenController extends BaseController {
|
||||||
@RequiresPermissions("tool:gen:edit")
|
@RequiresPermissions("tool:gen:edit")
|
||||||
@Log(title = "代码生成", businessType = BusinessType.UPDATE)
|
@Log(title = "代码生成", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
<<<<<<< HEAD
|
|
||||||
public Result editSave(@Validated @RequestBody GenTable genTable)
|
public Result editSave(@Validated @RequestBody GenTable genTable)
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
public Result editSave (@Validated @RequestBody GenTable genTable) {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
genTableService.validateEdit(genTable);
|
genTableService.validateEdit(genTable);
|
||||||
genTableService.updateGenTable(genTable);
|
genTableService.updateGenTable(genTable);
|
||||||
return success();
|
return success();
|
||||||
|
@ -200,12 +131,8 @@ public class GenController extends BaseController {
|
||||||
@RequiresPermissions("tool:gen:remove")
|
@RequiresPermissions("tool:gen:remove")
|
||||||
@Log(title = "代码生成", businessType = BusinessType.DELETE)
|
@Log(title = "代码生成", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{tableIds}")
|
@DeleteMapping("/{tableIds}")
|
||||||
<<<<<<< HEAD
|
|
||||||
public Result remove(@PathVariable("tableIds") Long[] tableIds)
|
public Result remove(@PathVariable("tableIds") Long[] tableIds)
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
public Result remove (@PathVariable("tableIds") Long[] tableIds) {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
genTableService.deleteGenTableByIds(tableIds);
|
genTableService.deleteGenTableByIds(tableIds);
|
||||||
return success();
|
return success();
|
||||||
}
|
}
|
||||||
|
@ -215,12 +142,8 @@ public class GenController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("tool:gen:preview")
|
@RequiresPermissions("tool:gen:preview")
|
||||||
@GetMapping("/preview/{tableId}")
|
@GetMapping("/preview/{tableId}")
|
||||||
<<<<<<< HEAD
|
|
||||||
public Result preview(@PathVariable("tableId") Long tableId) throws IOException
|
public Result preview(@PathVariable("tableId") Long tableId) throws IOException
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
public Result preview (@PathVariable("tableId") Long tableId) throws IOException {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
Map<String, String> dataMap = genTableService.previewCode(tableId);
|
Map<String, String> dataMap = genTableService.previewCode(tableId);
|
||||||
return success(dataMap);
|
return success(dataMap);
|
||||||
}
|
}
|
||||||
|
@ -231,12 +154,8 @@ public class GenController extends BaseController {
|
||||||
@RequiresPermissions("tool:gen:code")
|
@RequiresPermissions("tool:gen:code")
|
||||||
@Log(title = "代码生成", businessType = BusinessType.GENCODE)
|
@Log(title = "代码生成", businessType = BusinessType.GENCODE)
|
||||||
@GetMapping("/download/{tableName}")
|
@GetMapping("/download/{tableName}")
|
||||||
<<<<<<< HEAD
|
|
||||||
public void download(@PathVariable("tableName") String tableName) throws IOException
|
public void download(@PathVariable("tableName") String tableName) throws IOException
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
public void download (HttpServletResponse response, @PathVariable("tableName") String tableName) throws IOException {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
byte[] data = genTableService.downloadCode(tableName);
|
byte[] data = genTableService.downloadCode(tableName);
|
||||||
genCode(response, data);
|
genCode(response, data);
|
||||||
}
|
}
|
||||||
|
@ -247,12 +166,8 @@ public class GenController extends BaseController {
|
||||||
@RequiresPermissions("tool:gen:code")
|
@RequiresPermissions("tool:gen:code")
|
||||||
@Log(title = "代码生成", businessType = BusinessType.GENCODE)
|
@Log(title = "代码生成", businessType = BusinessType.GENCODE)
|
||||||
@GetMapping("/genCode/{tableName}")
|
@GetMapping("/genCode/{tableName}")
|
||||||
<<<<<<< HEAD
|
|
||||||
public Result genCode(@PathVariable("tableName") String tableName)
|
public Result genCode(@PathVariable("tableName") String tableName)
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
public Result genCode (@PathVariable("tableName") String tableName) {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
genTableService.generatorCode(tableName);
|
genTableService.generatorCode(tableName);
|
||||||
return success();
|
return success();
|
||||||
}
|
}
|
||||||
|
@ -262,16 +177,10 @@ public class GenController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("tool:gen:edit")
|
@RequiresPermissions("tool:gen:edit")
|
||||||
@Log(title = "代码生成", businessType = BusinessType.UPDATE)
|
@Log(title = "代码生成", businessType = BusinessType.UPDATE)
|
||||||
<<<<<<< HEAD
|
|
||||||
@GetMapping("/synchDb/{tableName}/{dbName}")
|
@GetMapping("/synchDb/{tableName}/{dbName}")
|
||||||
public Result synchDb(@PathVariable("tableName") String tableName,@PathVariable("dbName") String dbName)
|
public Result synchDb(@PathVariable("tableName") String tableName,@PathVariable("dbName") String dbName)
|
||||||
{
|
{
|
||||||
genTableService.synchDb(tableName,dbName);
|
genTableService.synchDb(tableName,dbName);
|
||||||
=======
|
|
||||||
@GetMapping("/synchDb/{tableName}")
|
|
||||||
public Result synchDb (@PathVariable("tableName") String tableName) {
|
|
||||||
genTableService.synchDb(tableName);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
return success();
|
return success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -281,12 +190,8 @@ public class GenController extends BaseController {
|
||||||
@RequiresPermissions("tool:gen:code")
|
@RequiresPermissions("tool:gen:code")
|
||||||
@Log(title = "代码生成", businessType = BusinessType.GENCODE)
|
@Log(title = "代码生成", businessType = BusinessType.GENCODE)
|
||||||
@GetMapping("/batchGenCode")
|
@GetMapping("/batchGenCode")
|
||||||
<<<<<<< HEAD
|
|
||||||
public void batchGenCode(@RequestParam("tables") String tables) throws IOException
|
public void batchGenCode(@RequestParam("tables") String tables) throws IOException
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
public void batchGenCode (HttpServletResponse response, String tables) throws IOException {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
String[] tableNames = Convert.toStrArray(tables);
|
String[] tableNames = Convert.toStrArray(tables);
|
||||||
byte[] data = genTableService.downloadCode(tableNames);
|
byte[] data = genTableService.downloadCode(tableNames);
|
||||||
genCode(response, data);
|
genCode(response, data);
|
||||||
|
@ -295,7 +200,6 @@ public class GenController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 生成zip文件
|
* 生成zip文件
|
||||||
*/
|
*/
|
||||||
<<<<<<< HEAD
|
|
||||||
private void genCode(HttpServletResponse response, byte[] data) throws IOException
|
private void genCode(HttpServletResponse response, byte[] data) throws IOException
|
||||||
{
|
{
|
||||||
response.reset();
|
response.reset();
|
||||||
|
@ -329,13 +233,4 @@ public class GenController extends BaseController {
|
||||||
List<GenTableColumn> genTableColumns = genTableColumnService.selectDbTableColumnsByName(table, dbName);
|
List<GenTableColumn> genTableColumns = genTableColumnService.selectDbTableColumnsByName(table, dbName);
|
||||||
return Result.success(genTableColumns);
|
return Result.success(genTableColumns);
|
||||||
}
|
}
|
||||||
=======
|
|
||||||
private void genCode (HttpServletResponse response, byte[] data) throws IOException {
|
|
||||||
response.reset();
|
|
||||||
response.setHeader("Content-Disposition", "attachment; filename=\"muyu.zip\"");
|
|
||||||
response.addHeader("Content-Length", String.valueOf(data.length));
|
|
||||||
response.setContentType("application/octet-stream; charset=UTF-8");
|
|
||||||
IOUtils.write(data, response.getOutputStream());
|
|
||||||
}
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,11 +35,8 @@ public class GenTable extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
private Long tableId;
|
private Long tableId;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
private String dbName;
|
private String dbName;
|
||||||
|
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
/**
|
/**
|
||||||
* 表名称
|
* 表名称
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package com.muyu.gen.mapper;
|
package com.muyu.gen.mapper;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
import com.muyu.gen.domain.GenTableColumn;
|
import com.muyu.gen.domain.GenTableColumn;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
@ -14,107 +13,52 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public interface GenTableColumnMapper
|
public interface GenTableColumnMapper
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.muyu.gen.domain.GenTableColumn;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 业务字段 数据层
|
|
||||||
*
|
|
||||||
* @author muyu
|
|
||||||
*/
|
|
||||||
public interface GenTableColumnMapper extends BaseMapper<GenTableColumn> {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
/**
|
/**
|
||||||
* 根据表名称查询列信息
|
* 根据表名称查询列信息
|
||||||
*
|
*
|
||||||
* @param tableName 表名称
|
* @param tableName 表名称
|
||||||
<<<<<<< HEAD
|
|
||||||
* @param dbName
|
* @param dbName
|
||||||
* @return 列信息
|
* @return 列信息
|
||||||
*/
|
*/
|
||||||
public List<GenTableColumn> selectDbTableColumnsByName(@Param("tableName") String tableName, @Param("dbName") String dbName);
|
public List<GenTableColumn> selectDbTableColumnsByName(@Param("tableName") String tableName, @Param("dbName") String dbName);
|
||||||
=======
|
|
||||||
*
|
|
||||||
* @return 列信息
|
|
||||||
*/
|
|
||||||
List<GenTableColumn> selectDbTableColumnsByName (String tableName);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询业务字段列表
|
* 查询业务字段列表
|
||||||
*
|
*
|
||||||
* @param tableId 业务字段编号
|
* @param tableId 业务字段编号
|
||||||
<<<<<<< HEAD
|
|
||||||
* @return 业务字段集合
|
* @return 业务字段集合
|
||||||
*/
|
*/
|
||||||
public List<GenTableColumn> selectGenTableColumnListByTableId(@Param("tableId") Long tableId);
|
public List<GenTableColumn> selectGenTableColumnListByTableId(@Param("tableId") Long tableId);
|
||||||
=======
|
|
||||||
*
|
|
||||||
* @return 业务字段集合
|
|
||||||
*/
|
|
||||||
List<GenTableColumn> selectGenTableColumnListByTableId (Long tableId);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增业务字段
|
* 新增业务字段
|
||||||
*
|
*
|
||||||
* @param genTableColumn 业务字段信息
|
* @param genTableColumn 业务字段信息
|
||||||
<<<<<<< HEAD
|
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertGenTableColumn(GenTableColumn genTableColumn);
|
public int insertGenTableColumn(GenTableColumn genTableColumn);
|
||||||
=======
|
|
||||||
*
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
int insertGenTableColumn (GenTableColumn genTableColumn);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改业务字段
|
* 修改业务字段
|
||||||
*
|
*
|
||||||
* @param genTableColumn 业务字段信息
|
* @param genTableColumn 业务字段信息
|
||||||
<<<<<<< HEAD
|
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateGenTableColumn(GenTableColumn genTableColumn);
|
public int updateGenTableColumn(GenTableColumn genTableColumn);
|
||||||
=======
|
|
||||||
*
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
int updateGenTableColumn (GenTableColumn genTableColumn);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除业务字段
|
* 删除业务字段
|
||||||
*
|
*
|
||||||
* @param genTableColumns 列数据
|
* @param genTableColumns 列数据
|
||||||
<<<<<<< HEAD
|
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteGenTableColumns(@Param("genTableColumns") List<GenTableColumn> genTableColumns);
|
public int deleteGenTableColumns(@Param("genTableColumns") List<GenTableColumn> genTableColumns);
|
||||||
=======
|
|
||||||
*
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
int deleteGenTableColumns (List<GenTableColumn> genTableColumns);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除业务字段
|
* 批量删除业务字段
|
||||||
*
|
*
|
||||||
* @param ids 需要删除的数据ID
|
* @param ids 需要删除的数据ID
|
||||||
<<<<<<< HEAD
|
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteGenTableColumnByIds(@Param("ids") Long[] ids);
|
public int deleteGenTableColumnByIds(@Param("ids") Long[] ids);
|
||||||
=======
|
|
||||||
*
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
int deleteGenTableColumnByIds (Long[] ids);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,151 +1,86 @@
|
||||||
package com.muyu.gen.mapper;
|
package com.muyu.gen.mapper;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
import com.muyu.gen.domain.GenTable;
|
import com.muyu.gen.domain.GenTable;
|
||||||
import com.muyu.gen.domain.GenTableResp;
|
import com.muyu.gen.domain.GenTableResp;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
=======
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.muyu.gen.domain.GenTable;
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 业务 数据层
|
* 业务 数据层
|
||||||
*
|
*
|
||||||
<<<<<<< HEAD
|
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public interface GenTableMapper
|
public interface GenTableMapper
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
* @author muyu
|
|
||||||
*/
|
|
||||||
public interface GenTableMapper extends BaseMapper<GenTable> {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
/**
|
/**
|
||||||
* 查询业务列表
|
* 查询业务列表
|
||||||
*
|
*
|
||||||
* @param genTable 业务信息
|
* @param genTable 业务信息
|
||||||
<<<<<<< HEAD
|
|
||||||
* @return 业务集合
|
* @return 业务集合
|
||||||
*/
|
*/
|
||||||
public List<GenTable> selectGenTableList(GenTable genTable);
|
public List<GenTable> selectGenTableList(GenTable genTable);
|
||||||
=======
|
|
||||||
*
|
|
||||||
* @return 业务集合
|
|
||||||
*/
|
|
||||||
List<GenTable> selectGenTableList (GenTable genTable);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询据库列表
|
* 查询据库列表
|
||||||
*
|
*
|
||||||
* @param genTable 业务信息
|
* @param genTable 业务信息
|
||||||
<<<<<<< HEAD
|
|
||||||
* @return 数据库表集合
|
* @return 数据库表集合
|
||||||
*/
|
*/
|
||||||
public List<GenTable> selectDbTableList(GenTable genTable);
|
public List<GenTable> selectDbTableList(GenTable genTable);
|
||||||
=======
|
|
||||||
*
|
|
||||||
* @return 数据库表集合
|
|
||||||
*/
|
|
||||||
List<GenTable> selectDbTableList (GenTable genTable);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询据库列表
|
* 查询据库列表
|
||||||
*
|
*
|
||||||
* @param tableNames 表名称组
|
* @param tableNames 表名称组
|
||||||
<<<<<<< HEAD
|
|
||||||
* @param dbName
|
* @param dbName
|
||||||
* @return 数据库表集合
|
* @return 数据库表集合
|
||||||
*/
|
*/
|
||||||
public List<GenTable> selectDbTableListByNames(@Param("tableNames") String[] tableNames, @Param("dbName") String dbName);
|
public List<GenTable> selectDbTableListByNames(@Param("tableNames") String[] tableNames, @Param("dbName") String dbName);
|
||||||
=======
|
|
||||||
*
|
|
||||||
* @return 数据库表集合
|
|
||||||
*/
|
|
||||||
List<GenTable> selectDbTableListByNames (String[] tableNames);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询所有表信息
|
* 查询所有表信息
|
||||||
*
|
*
|
||||||
* @return 表信息集合
|
* @return 表信息集合
|
||||||
*/
|
*/
|
||||||
<<<<<<< HEAD
|
|
||||||
public List<GenTable> selectGenTableAll();
|
public List<GenTable> selectGenTableAll();
|
||||||
=======
|
|
||||||
List<GenTable> selectGenTableAll ();
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询表ID业务信息
|
* 查询表ID业务信息
|
||||||
*
|
*
|
||||||
* @param id 业务ID
|
* @param id 业务ID
|
||||||
<<<<<<< HEAD
|
|
||||||
* @return 业务信息
|
* @return 业务信息
|
||||||
*/
|
*/
|
||||||
public GenTable selectGenTableById(@Param("id") Long id);
|
public GenTable selectGenTableById(@Param("id") Long id);
|
||||||
=======
|
|
||||||
*
|
|
||||||
* @return 业务信息
|
|
||||||
*/
|
|
||||||
GenTable selectGenTableById (Long id);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询表名称业务信息
|
* 查询表名称业务信息
|
||||||
*
|
*
|
||||||
* @param tableName 表名称
|
* @param tableName 表名称
|
||||||
<<<<<<< HEAD
|
|
||||||
* @return 业务信息
|
* @return 业务信息
|
||||||
*/
|
*/
|
||||||
public GenTable selectGenTableByName(@Param("tableName") String tableName);
|
public GenTable selectGenTableByName(@Param("tableName") String tableName);
|
||||||
=======
|
|
||||||
*
|
|
||||||
* @return 业务信息
|
|
||||||
*/
|
|
||||||
GenTable selectGenTableByName (String tableName);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增业务
|
* 新增业务
|
||||||
*
|
*
|
||||||
* @param genTable 业务信息
|
* @param genTable 业务信息
|
||||||
<<<<<<< HEAD
|
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertGenTable(GenTable genTable);
|
public int insertGenTable(GenTable genTable);
|
||||||
=======
|
|
||||||
*
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
int insertGenTable (GenTable genTable);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改业务
|
* 修改业务
|
||||||
*
|
*
|
||||||
* @param genTable 业务信息
|
* @param genTable 业务信息
|
||||||
<<<<<<< HEAD
|
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateGenTable(GenTable genTable);
|
public int updateGenTable(GenTable genTable);
|
||||||
=======
|
|
||||||
*
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
int updateGenTable (GenTable genTable);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除业务
|
* 批量删除业务
|
||||||
*
|
*
|
||||||
* @param ids 需要删除的数据ID
|
* @param ids 需要删除的数据ID
|
||||||
<<<<<<< HEAD
|
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteGenTableByIds(@Param("ids") Long[] ids);
|
public int deleteGenTableByIds(@Param("ids") Long[] ids);
|
||||||
|
@ -153,10 +88,4 @@ public interface GenTableMapper extends BaseMapper<GenTable> {
|
||||||
List<String> selDbNameAll();
|
List<String> selDbNameAll();
|
||||||
|
|
||||||
List<GenTableResp> selectDbTableListAll();
|
List<GenTableResp> selectDbTableListAll();
|
||||||
=======
|
|
||||||
*
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
int deleteGenTableByIds (Long[] ids);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,11 +3,7 @@ package com.muyu.gen.service;
|
||||||
import com.muyu.common.core.text.Convert;
|
import com.muyu.common.core.text.Convert;
|
||||||
import com.muyu.gen.domain.GenTableColumn;
|
import com.muyu.gen.domain.GenTableColumn;
|
||||||
import com.muyu.gen.mapper.GenTableColumnMapper;
|
import com.muyu.gen.mapper.GenTableColumnMapper;
|
||||||
<<<<<<< HEAD
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
=======
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -15,7 +11,6 @@ import java.util.List;
|
||||||
/**
|
/**
|
||||||
* 业务字段 服务层实现
|
* 业务字段 服务层实现
|
||||||
*
|
*
|
||||||
<<<<<<< HEAD
|
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
|
@ -35,32 +30,11 @@ public class GenTableColumnServiceImpl implements IGenTableColumnService
|
||||||
{
|
{
|
||||||
return genTableColumnMapper.selectGenTableColumnListByTableId(tableId);
|
return genTableColumnMapper.selectGenTableColumnListByTableId(tableId);
|
||||||
}
|
}
|
||||||
=======
|
|
||||||
* @author muyu
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class GenTableColumnServiceImpl implements IGenTableColumnService {
|
|
||||||
@Autowired
|
|
||||||
private GenTableColumnMapper genTableColumnMapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询业务字段列表
|
|
||||||
*
|
|
||||||
* @param tableId 业务字段编号
|
|
||||||
*
|
|
||||||
* @return 业务字段集合
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<GenTableColumn> selectGenTableColumnListByTableId (Long tableId) {
|
|
||||||
return genTableColumnMapper.selectGenTableColumnListByTableId(tableId);
|
|
||||||
}
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增业务字段
|
* 新增业务字段
|
||||||
*
|
*
|
||||||
* @param genTableColumn 业务字段信息
|
* @param genTableColumn 业务字段信息
|
||||||
<<<<<<< HEAD
|
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@ -96,37 +70,5 @@ public class GenTableColumnServiceImpl implements IGenTableColumnService {
|
||||||
@Override
|
@Override
|
||||||
public List<GenTableColumn> selectDbTableColumnsByName(String table, String dbName) {
|
public List<GenTableColumn> selectDbTableColumnsByName(String table, String dbName) {
|
||||||
return genTableColumnMapper.selectDbTableColumnsByName(table,dbName);
|
return genTableColumnMapper.selectDbTableColumnsByName(table,dbName);
|
||||||
=======
|
|
||||||
*
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int insertGenTableColumn (GenTableColumn genTableColumn) {
|
|
||||||
return genTableColumnMapper.insertGenTableColumn(genTableColumn);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改业务字段
|
|
||||||
*
|
|
||||||
* @param genTableColumn 业务字段信息
|
|
||||||
*
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int updateGenTableColumn (GenTableColumn genTableColumn) {
|
|
||||||
return genTableColumnMapper.updateGenTableColumn(genTableColumn);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除业务字段对象
|
|
||||||
*
|
|
||||||
* @param ids 需要删除的数据ID
|
|
||||||
*
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int deleteGenTableColumnByIds (String ids) {
|
|
||||||
return genTableColumnMapper.deleteGenTableColumnByIds(Convert.toLongArray(ids));
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,10 +10,7 @@ import com.muyu.common.core.utils.StringUtils;
|
||||||
import com.muyu.common.security.utils.SecurityUtils;
|
import com.muyu.common.security.utils.SecurityUtils;
|
||||||
import com.muyu.gen.domain.GenTable;
|
import com.muyu.gen.domain.GenTable;
|
||||||
import com.muyu.gen.domain.GenTableColumn;
|
import com.muyu.gen.domain.GenTableColumn;
|
||||||
<<<<<<< HEAD
|
|
||||||
import com.muyu.gen.domain.GenTableResp;
|
import com.muyu.gen.domain.GenTableResp;
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import com.muyu.gen.mapper.GenTableColumnMapper;
|
import com.muyu.gen.mapper.GenTableColumnMapper;
|
||||||
import com.muyu.gen.mapper.GenTableMapper;
|
import com.muyu.gen.mapper.GenTableMapper;
|
||||||
import com.muyu.gen.util.GenUtils;
|
import com.muyu.gen.util.GenUtils;
|
||||||
|
@ -26,11 +23,7 @@ import org.apache.velocity.VelocityContext;
|
||||||
import org.apache.velocity.app.Velocity;
|
import org.apache.velocity.app.Velocity;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
<<<<<<< HEAD
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
=======
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
@ -49,7 +42,6 @@ import java.util.zip.ZipOutputStream;
|
||||||
/**
|
/**
|
||||||
* 业务 服务层实现
|
* 业务 服务层实现
|
||||||
*
|
*
|
||||||
<<<<<<< HEAD
|
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
|
@ -72,45 +64,6 @@ public class GenTableServiceImpl implements IGenTableService
|
||||||
@Override
|
@Override
|
||||||
public GenTable selectGenTableById(Long id)
|
public GenTable selectGenTableById(Long id)
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
* @author muyu
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class GenTableServiceImpl implements IGenTableService {
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(GenTableServiceImpl.class);
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private GenTableMapper genTableMapper;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private GenTableColumnMapper genTableColumnMapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取代码生成地址
|
|
||||||
*
|
|
||||||
* @param table 业务表信息
|
|
||||||
* @param template 模板文件路径
|
|
||||||
*
|
|
||||||
* @return 生成地址
|
|
||||||
*/
|
|
||||||
public static String getGenPath (GenTable table, String template) {
|
|
||||||
String genPath = table.getGenPath();
|
|
||||||
if (StringUtils.equals(genPath, "/")) {
|
|
||||||
return System.getProperty("user.dir") + File.separator + "src" + File.separator + VelocityUtils.getFileName(template, table);
|
|
||||||
}
|
|
||||||
return genPath + File.separator + VelocityUtils.getFileName(template, table);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询业务信息
|
|
||||||
*
|
|
||||||
* @param id 业务ID
|
|
||||||
*
|
|
||||||
* @return 业务信息
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public GenTable selectGenTableById (Long id) {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
GenTable genTable = genTableMapper.selectGenTableById(id);
|
GenTable genTable = genTableMapper.selectGenTableById(id);
|
||||||
setTableFromOptions(genTable);
|
setTableFromOptions(genTable);
|
||||||
return genTable;
|
return genTable;
|
||||||
|
@ -120,19 +73,11 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||||
* 查询业务列表
|
* 查询业务列表
|
||||||
*
|
*
|
||||||
* @param genTable 业务信息
|
* @param genTable 业务信息
|
||||||
<<<<<<< HEAD
|
|
||||||
* @return 业务集合
|
* @return 业务集合
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<GenTable> selectGenTableList(GenTable genTable)
|
public List<GenTable> selectGenTableList(GenTable genTable)
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
*
|
|
||||||
* @return 业务集合
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<GenTable> selectGenTableList (GenTable genTable) {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
return genTableMapper.selectGenTableList(genTable);
|
return genTableMapper.selectGenTableList(genTable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -140,19 +85,11 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||||
* 查询据库列表
|
* 查询据库列表
|
||||||
*
|
*
|
||||||
* @param genTable 业务信息
|
* @param genTable 业务信息
|
||||||
<<<<<<< HEAD
|
|
||||||
* @return 数据库表集合
|
* @return 数据库表集合
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<GenTable> selectDbTableList(GenTable genTable)
|
public List<GenTable> selectDbTableList(GenTable genTable)
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
*
|
|
||||||
* @return 数据库表集合
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<GenTable> selectDbTableList (GenTable genTable) {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
return genTableMapper.selectDbTableList(genTable);
|
return genTableMapper.selectDbTableList(genTable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -160,7 +97,6 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||||
* 查询据库列表
|
* 查询据库列表
|
||||||
*
|
*
|
||||||
* @param tableNames 表名称组
|
* @param tableNames 表名称组
|
||||||
<<<<<<< HEAD
|
|
||||||
* @param dbName
|
* @param dbName
|
||||||
* @return 数据库表集合
|
* @return 数据库表集合
|
||||||
*/
|
*/
|
||||||
|
@ -168,14 +104,6 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||||
public List<GenTable> selectDbTableListByNames(String[] tableNames, String dbName)
|
public List<GenTable> selectDbTableListByNames(String[] tableNames, String dbName)
|
||||||
{
|
{
|
||||||
return genTableMapper.selectDbTableListByNames(tableNames,dbName);
|
return genTableMapper.selectDbTableListByNames(tableNames,dbName);
|
||||||
=======
|
|
||||||
*
|
|
||||||
* @return 数据库表集合
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<GenTable> selectDbTableListByNames (String[] tableNames) {
|
|
||||||
return genTableMapper.selectDbTableListByNames(tableNames);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -184,12 +112,8 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||||
* @return 表信息集合
|
* @return 表信息集合
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
<<<<<<< HEAD
|
|
||||||
public List<GenTable> selectGenTableAll()
|
public List<GenTable> selectGenTableAll()
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
public List<GenTable> selectGenTableAll () {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
return genTableMapper.selectGenTableAll();
|
return genTableMapper.selectGenTableAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -197,15 +121,10 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||||
* 修改业务
|
* 修改业务
|
||||||
*
|
*
|
||||||
* @param genTable 业务信息
|
* @param genTable 业务信息
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
*
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
<<<<<<< HEAD
|
|
||||||
public void updateGenTable(GenTable genTable)
|
public void updateGenTable(GenTable genTable)
|
||||||
{
|
{
|
||||||
String options = JSON.toJSONString(genTable.getParams());
|
String options = JSON.toJSONString(genTable.getParams());
|
||||||
|
@ -215,14 +134,6 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||||
{
|
{
|
||||||
for (GenTableColumn cenTableColumn : genTable.getColumns())
|
for (GenTableColumn cenTableColumn : genTable.getColumns())
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
public void updateGenTable (GenTable genTable) {
|
|
||||||
String options = JSON.toJSONString(genTable.getParams());
|
|
||||||
genTable.setOptions(options);
|
|
||||||
int row = genTableMapper.updateGenTable(genTable);
|
|
||||||
if (row > 0) {
|
|
||||||
for (GenTableColumn cenTableColumn : genTable.getColumns()) {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
genTableColumnMapper.updateGenTableColumn(cenTableColumn);
|
genTableColumnMapper.updateGenTableColumn(cenTableColumn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -232,20 +143,12 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||||
* 删除业务对象
|
* 删除业务对象
|
||||||
*
|
*
|
||||||
* @param tableIds 需要删除的数据ID
|
* @param tableIds 需要删除的数据ID
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
*
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
<<<<<<< HEAD
|
|
||||||
public void deleteGenTableByIds(Long[] tableIds)
|
public void deleteGenTableByIds(Long[] tableIds)
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
public void deleteGenTableByIds (Long[] tableIds) {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
genTableMapper.deleteGenTableByIds(tableIds);
|
genTableMapper.deleteGenTableByIds(tableIds);
|
||||||
genTableColumnMapper.deleteGenTableColumnByIds(tableIds);
|
genTableColumnMapper.deleteGenTableColumnByIds(tableIds);
|
||||||
}
|
}
|
||||||
|
@ -257,7 +160,6 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
<<<<<<< HEAD
|
|
||||||
public void importGenTable(List<GenTable> tableList)
|
public void importGenTable(List<GenTable> tableList)
|
||||||
{
|
{
|
||||||
String operName = SecurityUtils.getUsername();
|
String operName = SecurityUtils.getUsername();
|
||||||
|
@ -275,31 +177,14 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||||
List<GenTableColumn> genTableColumns = genTableColumnMapper.selectDbTableColumnsByName(tableName, dbName);
|
List<GenTableColumn> genTableColumns = genTableColumnMapper.selectDbTableColumnsByName(tableName, dbName);
|
||||||
for (GenTableColumn column : genTableColumns)
|
for (GenTableColumn column : genTableColumns)
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
public void importGenTable (List<GenTable> tableList) {
|
|
||||||
String operName = SecurityUtils.getUsername();
|
|
||||||
try {
|
|
||||||
for (GenTable table : tableList) {
|
|
||||||
String tableName = table.getTableName();
|
|
||||||
GenUtils.initTable(table, operName);
|
|
||||||
int row = genTableMapper.insertGenTable(table);
|
|
||||||
if (row > 0) {
|
|
||||||
// 保存列信息
|
|
||||||
List<GenTableColumn> genTableColumns = genTableColumnMapper.selectDbTableColumnsByName(tableName);
|
|
||||||
for (GenTableColumn column : genTableColumns) {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
GenUtils.initColumnField(column, table);
|
GenUtils.initColumnField(column, table);
|
||||||
genTableColumnMapper.insertGenTableColumn(column);
|
genTableColumnMapper.insertGenTableColumn(column);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
<<<<<<< HEAD
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
} catch (Exception e) {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
throw new ServiceException("导入失败:" + e.getMessage());
|
throw new ServiceException("导入失败:" + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -308,19 +193,11 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||||
* 预览代码
|
* 预览代码
|
||||||
*
|
*
|
||||||
* @param tableId 表编号
|
* @param tableId 表编号
|
||||||
<<<<<<< HEAD
|
|
||||||
* @return 预览数据列表
|
* @return 预览数据列表
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Map<String, String> previewCode(Long tableId)
|
public Map<String, String> previewCode(Long tableId)
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
*
|
|
||||||
* @return 预览数据列表
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public Map<String, String> previewCode (Long tableId) {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
Map<String, String> dataMap = new LinkedHashMap<>();
|
Map<String, String> dataMap = new LinkedHashMap<>();
|
||||||
// 查询表信息
|
// 查询表信息
|
||||||
GenTable table = genTableMapper.selectGenTableById(tableId);
|
GenTable table = genTableMapper.selectGenTableById(tableId);
|
||||||
|
@ -334,12 +211,8 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||||
|
|
||||||
// 获取模板列表
|
// 获取模板列表
|
||||||
List<String> templates = VelocityUtils.getTemplateList(table.getTplCategory());
|
List<String> templates = VelocityUtils.getTemplateList(table.getTplCategory());
|
||||||
<<<<<<< HEAD
|
|
||||||
for (String template : templates)
|
for (String template : templates)
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
for (String template : templates) {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
// 渲染模板
|
// 渲染模板
|
||||||
StringWriter sw = new StringWriter();
|
StringWriter sw = new StringWriter();
|
||||||
Template tpl = Velocity.getTemplate(template, Constants.UTF8);
|
Template tpl = Velocity.getTemplate(template, Constants.UTF8);
|
||||||
|
@ -353,19 +226,11 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||||
* 生成代码(下载方式)
|
* 生成代码(下载方式)
|
||||||
*
|
*
|
||||||
* @param tableName 表名称
|
* @param tableName 表名称
|
||||||
<<<<<<< HEAD
|
|
||||||
* @return 数据
|
* @return 数据
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public byte[] downloadCode(String tableName)
|
public byte[] downloadCode(String tableName)
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
*
|
|
||||||
* @return 数据
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public byte[] downloadCode (String tableName) {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||||
ZipOutputStream zip = new ZipOutputStream(outputStream);
|
ZipOutputStream zip = new ZipOutputStream(outputStream);
|
||||||
generatorCode(tableName, zip);
|
generatorCode(tableName, zip);
|
||||||
|
@ -379,12 +244,8 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||||
* @param tableName 表名称
|
* @param tableName 表名称
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
<<<<<<< HEAD
|
|
||||||
public void generatorCode(String tableName)
|
public void generatorCode(String tableName)
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
public void generatorCode (String tableName) {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
// 查询表信息
|
// 查询表信息
|
||||||
GenTable table = genTableMapper.selectGenTableByName(tableName);
|
GenTable table = genTableMapper.selectGenTableByName(tableName);
|
||||||
// 设置主子表信息
|
// 设置主子表信息
|
||||||
|
@ -398,20 +259,14 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||||
|
|
||||||
// 获取模板列表
|
// 获取模板列表
|
||||||
List<String> templates = VelocityUtils.getTemplateList(table.getTplCategory());
|
List<String> templates = VelocityUtils.getTemplateList(table.getTplCategory());
|
||||||
<<<<<<< HEAD
|
|
||||||
for (String template : templates)
|
for (String template : templates)
|
||||||
{
|
{
|
||||||
if (!StringUtils.containsAny(template, "sql.vm", "api.js.vm", "index.vue.vm", "index-tree.vue.vm"))
|
if (!StringUtils.containsAny(template, "sql.vm", "api.js.vm", "index.vue.vm", "index-tree.vue.vm"))
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
for (String template : templates) {
|
|
||||||
if (!StringUtils.containsAny(template, "sql.vm", "api.js.vm", "index.vue.vm", "index-tree.vue.vm")) {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
// 渲染模板
|
// 渲染模板
|
||||||
StringWriter sw = new StringWriter();
|
StringWriter sw = new StringWriter();
|
||||||
Template tpl = Velocity.getTemplate(template, Constants.UTF8);
|
Template tpl = Velocity.getTemplate(template, Constants.UTF8);
|
||||||
tpl.merge(context, sw);
|
tpl.merge(context, sw);
|
||||||
<<<<<<< HEAD
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String path = getGenPath(table, template);
|
String path = getGenPath(table, template);
|
||||||
|
@ -419,12 +274,6 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||||
}
|
}
|
||||||
catch (IOException e)
|
catch (IOException e)
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
try {
|
|
||||||
String path = getGenPath(table, template);
|
|
||||||
FileUtils.writeStringToFile(new File(path), sw.toString(), CharsetKit.UTF_8);
|
|
||||||
} catch (IOException e) {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
throw new ServiceException("渲染模板失败,表名:" + table.getTableName());
|
throw new ServiceException("渲染模板失败,表名:" + table.getTableName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -435,85 +284,54 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||||
* 同步数据库
|
* 同步数据库
|
||||||
*
|
*
|
||||||
* @param tableName 表名称
|
* @param tableName 表名称
|
||||||
<<<<<<< HEAD
|
|
||||||
* @param dbName
|
* @param dbName
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void synchDb(String tableName, String dbName)
|
public void synchDb(String tableName, String dbName)
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public void synchDb (String tableName) {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
GenTable table = genTableMapper.selectGenTableByName(tableName);
|
GenTable table = genTableMapper.selectGenTableByName(tableName);
|
||||||
List<GenTableColumn> tableColumns = table.getColumns();
|
List<GenTableColumn> tableColumns = table.getColumns();
|
||||||
Map<String, GenTableColumn> tableColumnMap = tableColumns.stream().collect(Collectors.toMap(GenTableColumn::getColumnName, Function.identity()));
|
Map<String, GenTableColumn> tableColumnMap = tableColumns.stream().collect(Collectors.toMap(GenTableColumn::getColumnName, Function.identity()));
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
List<GenTableColumn> dbTableColumns = genTableColumnMapper.selectDbTableColumnsByName(tableName, dbName);
|
List<GenTableColumn> dbTableColumns = genTableColumnMapper.selectDbTableColumnsByName(tableName, dbName);
|
||||||
if (StringUtils.isEmpty(dbTableColumns))
|
if (StringUtils.isEmpty(dbTableColumns))
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
List<GenTableColumn> dbTableColumns = genTableColumnMapper.selectDbTableColumnsByName(tableName);
|
|
||||||
if (StringUtils.isEmpty(dbTableColumns)) {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
throw new ServiceException("同步数据失败,原表结构不存在");
|
throw new ServiceException("同步数据失败,原表结构不存在");
|
||||||
}
|
}
|
||||||
List<String> dbTableColumnNames = dbTableColumns.stream().map(GenTableColumn::getColumnName).collect(Collectors.toList());
|
List<String> dbTableColumnNames = dbTableColumns.stream().map(GenTableColumn::getColumnName).collect(Collectors.toList());
|
||||||
|
|
||||||
dbTableColumns.forEach(column -> {
|
dbTableColumns.forEach(column -> {
|
||||||
GenUtils.initColumnField(column, table);
|
GenUtils.initColumnField(column, table);
|
||||||
<<<<<<< HEAD
|
|
||||||
if (tableColumnMap.containsKey(column.getColumnName()))
|
if (tableColumnMap.containsKey(column.getColumnName()))
|
||||||
{
|
{
|
||||||
GenTableColumn prevColumn = tableColumnMap.get(column.getColumnName());
|
GenTableColumn prevColumn = tableColumnMap.get(column.getColumnName());
|
||||||
column.setColumnId(prevColumn.getColumnId());
|
column.setColumnId(prevColumn.getColumnId());
|
||||||
if (column.isList())
|
if (column.isList())
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
if (tableColumnMap.containsKey(column.getColumnName())) {
|
|
||||||
GenTableColumn prevColumn = tableColumnMap.get(column.getColumnName());
|
|
||||||
column.setColumnId(prevColumn.getColumnId());
|
|
||||||
if (column.isList()) {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
// 如果是列表,继续保留查询方式/字典类型选项
|
// 如果是列表,继续保留查询方式/字典类型选项
|
||||||
column.setDictType(prevColumn.getDictType());
|
column.setDictType(prevColumn.getDictType());
|
||||||
column.setQueryType(prevColumn.getQueryType());
|
column.setQueryType(prevColumn.getQueryType());
|
||||||
}
|
}
|
||||||
if (StringUtils.isNotEmpty(prevColumn.getIsRequired()) && !column.isPk()
|
if (StringUtils.isNotEmpty(prevColumn.getIsRequired()) && !column.isPk()
|
||||||
&& (column.isInsert() || column.isEdit())
|
&& (column.isInsert() || column.isEdit())
|
||||||
<<<<<<< HEAD
|
|
||||||
&& ((column.isUsableColumn()) || (!column.isSuperColumn())))
|
&& ((column.isUsableColumn()) || (!column.isSuperColumn())))
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
&& ((column.isUsableColumn()) || (!column.isSuperColumn()))) {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
// 如果是(新增/修改&非主键/非忽略及父属性),继续保留必填/显示类型选项
|
// 如果是(新增/修改&非主键/非忽略及父属性),继续保留必填/显示类型选项
|
||||||
column.setIsRequired(prevColumn.getIsRequired());
|
column.setIsRequired(prevColumn.getIsRequired());
|
||||||
column.setHtmlType(prevColumn.getHtmlType());
|
column.setHtmlType(prevColumn.getHtmlType());
|
||||||
}
|
}
|
||||||
genTableColumnMapper.updateGenTableColumn(column);
|
genTableColumnMapper.updateGenTableColumn(column);
|
||||||
<<<<<<< HEAD
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
} else {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
genTableColumnMapper.insertGenTableColumn(column);
|
genTableColumnMapper.insertGenTableColumn(column);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
List<GenTableColumn> delColumns = tableColumns.stream().filter(column -> !dbTableColumnNames.contains(column.getColumnName())).collect(Collectors.toList());
|
List<GenTableColumn> delColumns = tableColumns.stream().filter(column -> !dbTableColumnNames.contains(column.getColumnName())).collect(Collectors.toList());
|
||||||
<<<<<<< HEAD
|
|
||||||
if (StringUtils.isNotEmpty(delColumns))
|
if (StringUtils.isNotEmpty(delColumns))
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
if (StringUtils.isNotEmpty(delColumns)) {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
genTableColumnMapper.deleteGenTableColumns(delColumns);
|
genTableColumnMapper.deleteGenTableColumns(delColumns);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -522,7 +340,6 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||||
* 批量生成代码(下载方式)
|
* 批量生成代码(下载方式)
|
||||||
*
|
*
|
||||||
* @param tableNames 表数组
|
* @param tableNames 表数组
|
||||||
<<<<<<< HEAD
|
|
||||||
* @return 数据
|
* @return 数据
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@ -532,16 +349,6 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||||
ZipOutputStream zip = new ZipOutputStream(outputStream);
|
ZipOutputStream zip = new ZipOutputStream(outputStream);
|
||||||
for (String tableName : tableNames)
|
for (String tableName : tableNames)
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
*
|
|
||||||
* @return 数据
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public byte[] downloadCode (String[] tableNames) {
|
|
||||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
|
||||||
ZipOutputStream zip = new ZipOutputStream(outputStream);
|
|
||||||
for (String tableName : tableNames) {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
generatorCode(tableName, zip);
|
generatorCode(tableName, zip);
|
||||||
}
|
}
|
||||||
IOUtils.closeQuietly(zip);
|
IOUtils.closeQuietly(zip);
|
||||||
|
@ -551,12 +358,8 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||||
/**
|
/**
|
||||||
* 查询表信息并生成代码
|
* 查询表信息并生成代码
|
||||||
*/
|
*/
|
||||||
<<<<<<< HEAD
|
|
||||||
private void generatorCode(String tableName, ZipOutputStream zip)
|
private void generatorCode(String tableName, ZipOutputStream zip)
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
private void generatorCode (String tableName, ZipOutputStream zip) {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
// 查询表信息
|
// 查询表信息
|
||||||
GenTable table = genTableMapper.selectGenTableByName(tableName);
|
GenTable table = genTableMapper.selectGenTableByName(tableName);
|
||||||
// 设置主子表信息
|
// 设置主子表信息
|
||||||
|
@ -570,35 +373,23 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||||
|
|
||||||
// 获取模板列表
|
// 获取模板列表
|
||||||
List<String> templates = VelocityUtils.getTemplateList(table.getTplCategory());
|
List<String> templates = VelocityUtils.getTemplateList(table.getTplCategory());
|
||||||
<<<<<<< HEAD
|
|
||||||
for (String template : templates)
|
for (String template : templates)
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
for (String template : templates) {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
// 渲染模板
|
// 渲染模板
|
||||||
StringWriter sw = new StringWriter();
|
StringWriter sw = new StringWriter();
|
||||||
Template tpl = Velocity.getTemplate(template, Constants.UTF8);
|
Template tpl = Velocity.getTemplate(template, Constants.UTF8);
|
||||||
tpl.merge(context, sw);
|
tpl.merge(context, sw);
|
||||||
<<<<<<< HEAD
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
try {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
// 添加到zip
|
// 添加到zip
|
||||||
zip.putNextEntry(new ZipEntry(VelocityUtils.getFileName(template, table)));
|
zip.putNextEntry(new ZipEntry(VelocityUtils.getFileName(template, table)));
|
||||||
IOUtils.write(sw.toString(), zip, Constants.UTF8);
|
IOUtils.write(sw.toString(), zip, Constants.UTF8);
|
||||||
IOUtils.closeQuietly(sw);
|
IOUtils.closeQuietly(sw);
|
||||||
zip.flush();
|
zip.flush();
|
||||||
zip.closeEntry();
|
zip.closeEntry();
|
||||||
<<<<<<< HEAD
|
|
||||||
}
|
}
|
||||||
catch (IOException e)
|
catch (IOException e)
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
} catch (IOException e) {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
log.error("渲染模板失败,表名:" + table.getTableName(), e);
|
log.error("渲染模板失败,表名:" + table.getTableName(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -610,7 +401,6 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||||
* @param genTable 业务信息
|
* @param genTable 业务信息
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
<<<<<<< HEAD
|
|
||||||
public void validateEdit(GenTable genTable)
|
public void validateEdit(GenTable genTable)
|
||||||
{
|
{
|
||||||
if (GenConstants.TPL_TREE.equals(genTable.getTplCategory()))
|
if (GenConstants.TPL_TREE.equals(genTable.getTplCategory()))
|
||||||
|
@ -637,29 +427,12 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||||
}
|
}
|
||||||
else if (StringUtils.isEmpty(genTable.getSubTableFkName()))
|
else if (StringUtils.isEmpty(genTable.getSubTableFkName()))
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
public void validateEdit (GenTable genTable) {
|
|
||||||
if (GenConstants.TPL_TREE.equals(genTable.getTplCategory())) {
|
|
||||||
String options = JSON.toJSONString(genTable.getParams());
|
|
||||||
JSONObject paramsObj = JSON.parseObject(options);
|
|
||||||
if (StringUtils.isEmpty(paramsObj.getString(GenConstants.TREE_CODE))) {
|
|
||||||
throw new ServiceException("树编码字段不能为空");
|
|
||||||
} else if (StringUtils.isEmpty(paramsObj.getString(GenConstants.TREE_PARENT_CODE))) {
|
|
||||||
throw new ServiceException("树父编码字段不能为空");
|
|
||||||
} else if (StringUtils.isEmpty(paramsObj.getString(GenConstants.TREE_NAME))) {
|
|
||||||
throw new ServiceException("树名称字段不能为空");
|
|
||||||
} else if (GenConstants.TPL_SUB.equals(genTable.getTplCategory())) {
|
|
||||||
if (StringUtils.isEmpty(genTable.getSubTableName())) {
|
|
||||||
throw new ServiceException("关联子表的表名不能为空");
|
|
||||||
} else if (StringUtils.isEmpty(genTable.getSubTableFkName())) {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
throw new ServiceException("子表关联的外键名不能为空");
|
throw new ServiceException("子表关联的外键名不能为空");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> selDbNameAll() {
|
public List<String> selDbNameAll() {
|
||||||
return genTableMapper.selDbNameAll();
|
return genTableMapper.selDbNameAll();
|
||||||
|
@ -671,30 +444,21 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
/**
|
/**
|
||||||
* 设置主键列信息
|
* 设置主键列信息
|
||||||
*
|
*
|
||||||
* @param table 业务表信息
|
* @param table 业务表信息
|
||||||
*/
|
*/
|
||||||
<<<<<<< HEAD
|
|
||||||
public void setPkColumn(GenTable table)
|
public void setPkColumn(GenTable table)
|
||||||
{
|
{
|
||||||
for (GenTableColumn column : table.getColumns())
|
for (GenTableColumn column : table.getColumns())
|
||||||
{
|
{
|
||||||
if (column.isPk())
|
if (column.isPk())
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
public void setPkColumn (GenTable table) {
|
|
||||||
for (GenTableColumn column : table.getColumns()) {
|
|
||||||
if (column.isPk()) {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
table.setPkColumn(column);
|
table.setPkColumn(column);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
<<<<<<< HEAD
|
|
||||||
if (StringUtils.isNull(table.getPkColumn()))
|
if (StringUtils.isNull(table.getPkColumn()))
|
||||||
{
|
{
|
||||||
table.setPkColumn(table.getColumns().get(0));
|
table.setPkColumn(table.getColumns().get(0));
|
||||||
|
@ -705,24 +469,12 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||||
{
|
{
|
||||||
if (column.isPk())
|
if (column.isPk())
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
if (StringUtils.isNull(table.getPkColumn())) {
|
|
||||||
table.setPkColumn(table.getColumns().get(0));
|
|
||||||
}
|
|
||||||
if (GenConstants.TPL_SUB.equals(table.getTplCategory())) {
|
|
||||||
for (GenTableColumn column : table.getSubTable().getColumns()) {
|
|
||||||
if (column.isPk()) {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
table.getSubTable().setPkColumn(column);
|
table.getSubTable().setPkColumn(column);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
<<<<<<< HEAD
|
|
||||||
if (StringUtils.isNull(table.getSubTable().getPkColumn()))
|
if (StringUtils.isNull(table.getSubTable().getPkColumn()))
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
if (StringUtils.isNull(table.getSubTable().getPkColumn())) {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
table.getSubTable().setPkColumn(table.getSubTable().getColumns().get(0));
|
table.getSubTable().setPkColumn(table.getSubTable().getColumns().get(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -733,17 +485,11 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||||
*
|
*
|
||||||
* @param table 业务表信息
|
* @param table 业务表信息
|
||||||
*/
|
*/
|
||||||
<<<<<<< HEAD
|
|
||||||
public void setSubTable(GenTable table)
|
public void setSubTable(GenTable table)
|
||||||
{
|
{
|
||||||
String subTableName = table.getSubTableName();
|
String subTableName = table.getSubTableName();
|
||||||
if (StringUtils.isNotEmpty(subTableName))
|
if (StringUtils.isNotEmpty(subTableName))
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
public void setSubTable (GenTable table) {
|
|
||||||
String subTableName = table.getSubTableName();
|
|
||||||
if (StringUtils.isNotEmpty(subTableName)) {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
table.setSubTable(genTableMapper.selectGenTableByName(subTableName));
|
table.setSubTable(genTableMapper.selectGenTableByName(subTableName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -753,17 +499,11 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||||
*
|
*
|
||||||
* @param genTable 设置后的生成对象
|
* @param genTable 设置后的生成对象
|
||||||
*/
|
*/
|
||||||
<<<<<<< HEAD
|
|
||||||
public void setTableFromOptions(GenTable genTable)
|
public void setTableFromOptions(GenTable genTable)
|
||||||
{
|
{
|
||||||
JSONObject paramsObj = JSON.parseObject(genTable.getOptions());
|
JSONObject paramsObj = JSON.parseObject(genTable.getOptions());
|
||||||
if (StringUtils.isNotNull(paramsObj))
|
if (StringUtils.isNotNull(paramsObj))
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
public void setTableFromOptions (GenTable genTable) {
|
|
||||||
JSONObject paramsObj = JSON.parseObject(genTable.getOptions());
|
|
||||||
if (StringUtils.isNotNull(paramsObj)) {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
String treeCode = paramsObj.getString(GenConstants.TREE_CODE);
|
String treeCode = paramsObj.getString(GenConstants.TREE_CODE);
|
||||||
String treeParentCode = paramsObj.getString(GenConstants.TREE_PARENT_CODE);
|
String treeParentCode = paramsObj.getString(GenConstants.TREE_PARENT_CODE);
|
||||||
String treeName = paramsObj.getString(GenConstants.TREE_NAME);
|
String treeName = paramsObj.getString(GenConstants.TREE_NAME);
|
||||||
|
@ -777,7 +517,6 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||||
genTable.setParentMenuName(parentMenuName);
|
genTable.setParentMenuName(parentMenuName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
<<<<<<< HEAD
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取代码生成地址
|
* 获取代码生成地址
|
||||||
|
@ -795,6 +534,4 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||||
}
|
}
|
||||||
return genPath + File.separator + VelocityUtils.getFileName(template, table);
|
return genPath + File.separator + VelocityUtils.getFileName(template, table);
|
||||||
}
|
}
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,75 +7,41 @@ import java.util.List;
|
||||||
/**
|
/**
|
||||||
* 业务字段 服务层
|
* 业务字段 服务层
|
||||||
*
|
*
|
||||||
<<<<<<< HEAD
|
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public interface IGenTableColumnService
|
public interface IGenTableColumnService
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
* @author muyu
|
|
||||||
*/
|
|
||||||
public interface IGenTableColumnService {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
/**
|
/**
|
||||||
* 查询业务字段列表
|
* 查询业务字段列表
|
||||||
*
|
*
|
||||||
* @param tableId 业务字段编号
|
* @param tableId 业务字段编号
|
||||||
<<<<<<< HEAD
|
|
||||||
* @return 业务字段集合
|
* @return 业务字段集合
|
||||||
*/
|
*/
|
||||||
public List<GenTableColumn> selectGenTableColumnListByTableId(Long tableId);
|
public List<GenTableColumn> selectGenTableColumnListByTableId(Long tableId);
|
||||||
=======
|
|
||||||
*
|
|
||||||
* @return 业务字段集合
|
|
||||||
*/
|
|
||||||
List<GenTableColumn> selectGenTableColumnListByTableId (Long tableId);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增业务字段
|
* 新增业务字段
|
||||||
*
|
*
|
||||||
* @param genTableColumn 业务字段信息
|
* @param genTableColumn 业务字段信息
|
||||||
<<<<<<< HEAD
|
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertGenTableColumn(GenTableColumn genTableColumn);
|
public int insertGenTableColumn(GenTableColumn genTableColumn);
|
||||||
=======
|
|
||||||
*
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
int insertGenTableColumn (GenTableColumn genTableColumn);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改业务字段
|
* 修改业务字段
|
||||||
*
|
*
|
||||||
* @param genTableColumn 业务字段信息
|
* @param genTableColumn 业务字段信息
|
||||||
<<<<<<< HEAD
|
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateGenTableColumn(GenTableColumn genTableColumn);
|
public int updateGenTableColumn(GenTableColumn genTableColumn);
|
||||||
=======
|
|
||||||
*
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
int updateGenTableColumn (GenTableColumn genTableColumn);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除业务字段信息
|
* 删除业务字段信息
|
||||||
*
|
*
|
||||||
* @param ids 需要删除的数据ID
|
* @param ids 需要删除的数据ID
|
||||||
<<<<<<< HEAD
|
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteGenTableColumnByIds(String ids);
|
public int deleteGenTableColumnByIds(String ids);
|
||||||
|
|
||||||
List<GenTableColumn> selectDbTableColumnsByName(String table, String dbName);
|
List<GenTableColumn> selectDbTableColumnsByName(String table, String dbName);
|
||||||
=======
|
|
||||||
*
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
int deleteGenTableColumnByIds (String ids);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
package com.muyu.gen.service;
|
package com.muyu.gen.service;
|
||||||
|
|
||||||
import com.muyu.gen.domain.GenTable;
|
import com.muyu.gen.domain.GenTable;
|
||||||
<<<<<<< HEAD
|
|
||||||
import com.muyu.gen.domain.GenTableResp;
|
import com.muyu.gen.domain.GenTableResp;
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -12,214 +9,121 @@ import java.util.Map;
|
||||||
/**
|
/**
|
||||||
* 业务 服务层
|
* 业务 服务层
|
||||||
*
|
*
|
||||||
<<<<<<< HEAD
|
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public interface IGenTableService
|
public interface IGenTableService
|
||||||
{
|
{
|
||||||
=======
|
|
||||||
* @author muyu
|
|
||||||
*/
|
|
||||||
public interface IGenTableService {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
/**
|
/**
|
||||||
* 查询业务列表
|
* 查询业务列表
|
||||||
*
|
*
|
||||||
* @param genTable 业务信息
|
* @param genTable 业务信息
|
||||||
<<<<<<< HEAD
|
|
||||||
* @return 业务集合
|
* @return 业务集合
|
||||||
*/
|
*/
|
||||||
public List<GenTable> selectGenTableList(GenTable genTable);
|
public List<GenTable> selectGenTableList(GenTable genTable);
|
||||||
=======
|
|
||||||
*
|
|
||||||
* @return 业务集合
|
|
||||||
*/
|
|
||||||
List<GenTable> selectGenTableList (GenTable genTable);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询据库列表
|
* 查询据库列表
|
||||||
*
|
*
|
||||||
* @param genTable 业务信息
|
* @param genTable 业务信息
|
||||||
<<<<<<< HEAD
|
|
||||||
* @return 数据库表集合
|
* @return 数据库表集合
|
||||||
*/
|
*/
|
||||||
public List<GenTable> selectDbTableList(GenTable genTable);
|
public List<GenTable> selectDbTableList(GenTable genTable);
|
||||||
=======
|
|
||||||
*
|
|
||||||
* @return 数据库表集合
|
|
||||||
*/
|
|
||||||
List<GenTable> selectDbTableList (GenTable genTable);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询据库列表
|
* 查询据库列表
|
||||||
*
|
*
|
||||||
* @param tableNames 表名称组
|
* @param tableNames 表名称组
|
||||||
<<<<<<< HEAD
|
|
||||||
* @param dbName
|
* @param dbName
|
||||||
* @return 数据库表集合
|
* @return 数据库表集合
|
||||||
*/
|
*/
|
||||||
public List<GenTable> selectDbTableListByNames(String[] tableNames, String dbName);
|
public List<GenTable> selectDbTableListByNames(String[] tableNames, String dbName);
|
||||||
=======
|
|
||||||
*
|
|
||||||
* @return 数据库表集合
|
|
||||||
*/
|
|
||||||
List<GenTable> selectDbTableListByNames (String[] tableNames);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询所有表信息
|
* 查询所有表信息
|
||||||
*
|
*
|
||||||
* @return 表信息集合
|
* @return 表信息集合
|
||||||
*/
|
*/
|
||||||
<<<<<<< HEAD
|
|
||||||
public List<GenTable> selectGenTableAll();
|
public List<GenTable> selectGenTableAll();
|
||||||
=======
|
|
||||||
List<GenTable> selectGenTableAll ();
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询业务信息
|
* 查询业务信息
|
||||||
*
|
*
|
||||||
* @param id 业务ID
|
* @param id 业务ID
|
||||||
<<<<<<< HEAD
|
|
||||||
* @return 业务信息
|
* @return 业务信息
|
||||||
*/
|
*/
|
||||||
public GenTable selectGenTableById(Long id);
|
public GenTable selectGenTableById(Long id);
|
||||||
=======
|
|
||||||
*
|
|
||||||
* @return 业务信息
|
|
||||||
*/
|
|
||||||
GenTable selectGenTableById (Long id);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改业务
|
* 修改业务
|
||||||
*
|
*
|
||||||
* @param genTable 业务信息
|
* @param genTable 业务信息
|
||||||
<<<<<<< HEAD
|
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public void updateGenTable(GenTable genTable);
|
public void updateGenTable(GenTable genTable);
|
||||||
=======
|
|
||||||
*
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
void updateGenTable (GenTable genTable);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除业务信息
|
* 删除业务信息
|
||||||
*
|
*
|
||||||
* @param tableIds 需要删除的表数据ID
|
* @param tableIds 需要删除的表数据ID
|
||||||
<<<<<<< HEAD
|
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public void deleteGenTableByIds(Long[] tableIds);
|
public void deleteGenTableByIds(Long[] tableIds);
|
||||||
=======
|
|
||||||
*
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
void deleteGenTableByIds (Long[] tableIds);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导入表结构
|
* 导入表结构
|
||||||
*
|
*
|
||||||
* @param tableList 导入表列表
|
* @param tableList 导入表列表
|
||||||
*/
|
*/
|
||||||
<<<<<<< HEAD
|
|
||||||
public void importGenTable(List<GenTable> tableList);
|
public void importGenTable(List<GenTable> tableList);
|
||||||
=======
|
|
||||||
void importGenTable (List<GenTable> tableList);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 预览代码
|
* 预览代码
|
||||||
*
|
*
|
||||||
* @param tableId 表编号
|
* @param tableId 表编号
|
||||||
<<<<<<< HEAD
|
|
||||||
* @return 预览数据列表
|
* @return 预览数据列表
|
||||||
*/
|
*/
|
||||||
public Map<String, String> previewCode(Long tableId);
|
public Map<String, String> previewCode(Long tableId);
|
||||||
=======
|
|
||||||
*
|
|
||||||
* @return 预览数据列表
|
|
||||||
*/
|
|
||||||
Map<String, String> previewCode (Long tableId);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成代码(下载方式)
|
* 生成代码(下载方式)
|
||||||
*
|
*
|
||||||
* @param tableName 表名称
|
* @param tableName 表名称
|
||||||
<<<<<<< HEAD
|
|
||||||
* @return 数据
|
* @return 数据
|
||||||
*/
|
*/
|
||||||
public byte[] downloadCode(String tableName);
|
public byte[] downloadCode(String tableName);
|
||||||
=======
|
|
||||||
*
|
|
||||||
* @return 数据
|
|
||||||
*/
|
|
||||||
byte[] downloadCode (String tableName);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成代码(自定义路径)
|
* 生成代码(自定义路径)
|
||||||
*
|
*
|
||||||
* @param tableName 表名称
|
* @param tableName 表名称
|
||||||
<<<<<<< HEAD
|
|
||||||
* @return 数据
|
* @return 数据
|
||||||
*/
|
*/
|
||||||
public void generatorCode(String tableName);
|
public void generatorCode(String tableName);
|
||||||
=======
|
|
||||||
*
|
|
||||||
* @return 数据
|
|
||||||
*/
|
|
||||||
void generatorCode (String tableName);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 同步数据库
|
* 同步数据库
|
||||||
*
|
*
|
||||||
* @param tableName 表名称
|
* @param tableName 表名称
|
||||||
<<<<<<< HEAD
|
|
||||||
* @param dbName
|
* @param dbName
|
||||||
*/
|
*/
|
||||||
public void synchDb(String tableName, String dbName);
|
public void synchDb(String tableName, String dbName);
|
||||||
=======
|
|
||||||
*/
|
|
||||||
void synchDb (String tableName);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量生成代码(下载方式)
|
* 批量生成代码(下载方式)
|
||||||
*
|
*
|
||||||
* @param tableNames 表数组
|
* @param tableNames 表数组
|
||||||
<<<<<<< HEAD
|
|
||||||
* @return 数据
|
* @return 数据
|
||||||
*/
|
*/
|
||||||
public byte[] downloadCode(String[] tableNames);
|
public byte[] downloadCode(String[] tableNames);
|
||||||
=======
|
|
||||||
*
|
|
||||||
* @return 数据
|
|
||||||
*/
|
|
||||||
byte[] downloadCode (String[] tableNames);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改保存参数校验
|
* 修改保存参数校验
|
||||||
*
|
*
|
||||||
* @param genTable 业务信息
|
* @param genTable 业务信息
|
||||||
*/
|
*/
|
||||||
<<<<<<< HEAD
|
|
||||||
public void validateEdit(GenTable genTable);
|
public void validateEdit(GenTable genTable);
|
||||||
|
|
||||||
List<String> selDbNameAll();
|
List<String> selDbNameAll();
|
||||||
|
|
||||||
List<GenTableResp> selectDbTableListAll();
|
List<GenTableResp> selectDbTableListAll();
|
||||||
=======
|
|
||||||
void validateEdit (GenTable genTable);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,17 +1,12 @@
|
||||||
# Tomcat
|
# Tomcat
|
||||||
server:
|
server:
|
||||||
<<<<<<< HEAD
|
|
||||||
port: 9709
|
port: 9709
|
||||||
=======
|
|
||||||
port: 9202
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
# nacos线上地址
|
# nacos线上地址
|
||||||
nacos:
|
nacos:
|
||||||
addr: 106.54.193.225:8848
|
addr: 47.116.173.119:8848
|
||||||
user-name: nacos
|
user-name: nacos
|
||||||
password: nacos
|
password: nacos
|
||||||
<<<<<<< HEAD
|
|
||||||
namespace: one-saas
|
namespace: one-saas
|
||||||
# SPRING_AMQP_DESERIALIZATION_TRUST_ALL=true spring.amqp.deserialization.trust.all
|
# SPRING_AMQP_DESERIALIZATION_TRUST_ALL=true spring.amqp.deserialization.trust.all
|
||||||
# Spring
|
# Spring
|
||||||
|
@ -20,12 +15,6 @@ spring:
|
||||||
deserialization:
|
deserialization:
|
||||||
trust:
|
trust:
|
||||||
all: true
|
all: true
|
||||||
=======
|
|
||||||
namespace: one
|
|
||||||
|
|
||||||
# Spring
|
|
||||||
spring:
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
main:
|
main:
|
||||||
allow-bean-definition-overriding: true
|
allow-bean-definition-overriding: true
|
||||||
application:
|
application:
|
||||||
|
@ -64,11 +53,8 @@ spring:
|
||||||
- application-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
- application-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
# xxl-job 配置文件
|
# xxl-job 配置文件
|
||||||
- application-xxl-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
- application-xxl-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
<<<<<<< HEAD
|
|
||||||
# rabbit 配置文件
|
# rabbit 配置文件
|
||||||
- application-rabbit-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
- application-rabbit-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
logging:
|
logging:
|
||||||
level:
|
level:
|
||||||
com.muyu.system.mapper: DEBUG
|
com.muyu.system.mapper: DEBUG
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<!DOCTYPE mapper
|
<!DOCTYPE mapper
|
||||||
<<<<<<< HEAD
|
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.muyu.gen.mapper.GenTableColumnMapper">
|
<mapper namespace="com.muyu.gen.mapper.GenTableColumnMapper">
|
||||||
|
@ -32,61 +31,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<sql id="selectGenTableColumnVo">
|
<sql id="selectGenTableColumnVo">
|
||||||
select column_id, table_id, column_name, column_comment, column_type, java_type, java_field, is_pk, is_increment, is_required, is_insert, is_edit, is_list, is_query, query_type, html_type, dict_type, sort, create_by, create_time, update_by, update_time from gen_table_column
|
select column_id, table_id, column_name, column_comment, column_type, java_type, java_field, is_pk, is_increment, is_required, is_insert, is_edit, is_list, is_query, query_type, html_type, dict_type, sort, create_by, create_time, update_by, update_time from gen_table_column
|
||||||
=======
|
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
||||||
<mapper namespace="com.muyu.gen.mapper.GenTableColumnMapper">
|
|
||||||
|
|
||||||
<resultMap type="com.muyu.gen.domain.GenTableColumn" id="GenTableColumnResult">
|
|
||||||
<id property="columnId" column="column_id"/>
|
|
||||||
<result property="tableId" column="table_id"/>
|
|
||||||
<result property="columnName" column="column_name"/>
|
|
||||||
<result property="columnComment" column="column_comment"/>
|
|
||||||
<result property="columnType" column="column_type"/>
|
|
||||||
<result property="javaType" column="java_type"/>
|
|
||||||
<result property="javaField" column="java_field"/>
|
|
||||||
<result property="isPk" column="is_pk"/>
|
|
||||||
<result property="isIncrement" column="is_increment"/>
|
|
||||||
<result property="isRequired" column="is_required"/>
|
|
||||||
<result property="isInsert" column="is_insert"/>
|
|
||||||
<result property="isEdit" column="is_edit"/>
|
|
||||||
<result property="isList" column="is_list"/>
|
|
||||||
<result property="isQuery" column="is_query"/>
|
|
||||||
<result property="queryType" column="query_type"/>
|
|
||||||
<result property="htmlType" column="html_type"/>
|
|
||||||
<result property="dictType" column="dict_type"/>
|
|
||||||
<result property="sort" column="sort"/>
|
|
||||||
<result property="createBy" column="create_by"/>
|
|
||||||
<result property="createTime" column="create_time"/>
|
|
||||||
<result property="updateBy" column="update_by"/>
|
|
||||||
<result property="updateTime" column="update_time"/>
|
|
||||||
</resultMap>
|
|
||||||
|
|
||||||
<sql id="selectGenTableColumnVo">
|
|
||||||
select column_id,
|
|
||||||
table_id,
|
|
||||||
column_name,
|
|
||||||
column_comment,
|
|
||||||
column_type,
|
|
||||||
java_type,
|
|
||||||
java_field,
|
|
||||||
is_pk,
|
|
||||||
is_increment,
|
|
||||||
is_required,
|
|
||||||
is_insert,
|
|
||||||
is_edit,
|
|
||||||
is_list,
|
|
||||||
is_query,
|
|
||||||
query_type,
|
|
||||||
html_type,
|
|
||||||
dict_type,
|
|
||||||
sort,
|
|
||||||
create_by,
|
|
||||||
create_time,
|
|
||||||
update_by,
|
|
||||||
update_time
|
|
||||||
from gen_table_column
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectGenTableColumnListByTableId" parameterType="com.muyu.gen.domain.GenTableColumn" resultMap="GenTableColumnResult">
|
<select id="selectGenTableColumnListByTableId" parameterType="com.muyu.gen.domain.GenTableColumn" resultMap="GenTableColumnResult">
|
||||||
|
@ -96,7 +40,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectDbTableColumnsByName" parameterType="String" resultMap="GenTableColumnResult">
|
<select id="selectDbTableColumnsByName" parameterType="String" resultMap="GenTableColumnResult">
|
||||||
<<<<<<< HEAD
|
|
||||||
select column_name, (case when (is_nullable = 'no' <![CDATA[ && ]]> column_key != 'PRI') then '1' else null end) as is_required, (case when column_key = 'PRI' then '1' else '0' end) as is_pk, ordinal_position as sort, column_comment, (case when extra = 'auto_increment' then '1' else '0' end) as is_increment, column_type
|
select column_name, (case when (is_nullable = 'no' <![CDATA[ && ]]> column_key != 'PRI') then '1' else null end) as is_required, (case when column_key = 'PRI' then '1' else '0' end) as is_pk, ordinal_position as sort, column_comment, (case when extra = 'auto_increment' then '1' else '0' end) as is_increment, column_type
|
||||||
from information_schema.columns where
|
from information_schema.columns where
|
||||||
<include refid="com.muyu.gen.mapper.GenTableMapper.select_dbName"/>
|
<include refid="com.muyu.gen.mapper.GenTableMapper.select_dbName"/>
|
||||||
|
@ -146,63 +89,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||||
sysdate()
|
sysdate()
|
||||||
)
|
)
|
||||||
=======
|
|
||||||
select column_name,
|
|
||||||
(case when (is_nullable = 'no' <![CDATA[ && ]]> column_key != 'PRI') then '1' else null end) as is_required,
|
|
||||||
(case when column_key = 'PRI' then '1' else '0' end) as is_pk,
|
|
||||||
ordinal_position as sort,
|
|
||||||
column_comment,
|
|
||||||
(case when extra = 'auto_increment' then '1' else '0' end) as is_increment,
|
|
||||||
column_type
|
|
||||||
from information_schema.columns
|
|
||||||
where table_schema = (select database())
|
|
||||||
and table_name = (#{tableName})
|
|
||||||
order by ordinal_position
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<insert id="insertGenTableColumn" parameterType="com.muyu.gen.domain.GenTableColumn" useGeneratedKeys="true" keyProperty="columnId">
|
|
||||||
insert into gen_table_column (
|
|
||||||
<if test="tableId != null and tableId != ''">table_id,</if>
|
|
||||||
<if test="columnName != null and columnName != ''">column_name,</if>
|
|
||||||
<if test="columnComment != null and columnComment != ''">column_comment,</if>
|
|
||||||
<if test="columnType != null and columnType != ''">column_type,</if>
|
|
||||||
<if test="javaType != null and javaType != ''">java_type,</if>
|
|
||||||
<if test="javaField != null and javaField != ''">java_field,</if>
|
|
||||||
<if test="isPk != null and isPk != ''">is_pk,</if>
|
|
||||||
<if test="isIncrement != null and isIncrement != ''">is_increment,</if>
|
|
||||||
<if test="isRequired != null and isRequired != ''">is_required,</if>
|
|
||||||
<if test="isInsert != null and isInsert != ''">is_insert,</if>
|
|
||||||
<if test="isEdit != null and isEdit != ''">is_edit,</if>
|
|
||||||
<if test="isList != null and isList != ''">is_list,</if>
|
|
||||||
<if test="isQuery != null and isQuery != ''">is_query,</if>
|
|
||||||
<if test="queryType != null and queryType != ''">query_type,</if>
|
|
||||||
<if test="htmlType != null and htmlType != ''">html_type,</if>
|
|
||||||
<if test="dictType != null and dictType != ''">dict_type,</if>
|
|
||||||
<if test="sort != null">sort,</if>
|
|
||||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
|
||||||
create_time
|
|
||||||
)values(
|
|
||||||
<if test="tableId != null and tableId != ''">#{tableId},</if>
|
|
||||||
<if test="columnName != null and columnName != ''">#{columnName},</if>
|
|
||||||
<if test="columnComment != null and columnComment != ''">#{columnComment},</if>
|
|
||||||
<if test="columnType != null and columnType != ''">#{columnType},</if>
|
|
||||||
<if test="javaType != null and javaType != ''">#{javaType},</if>
|
|
||||||
<if test="javaField != null and javaField != ''">#{javaField},</if>
|
|
||||||
<if test="isPk != null and isPk != ''">#{isPk},</if>
|
|
||||||
<if test="isIncrement != null and isIncrement != ''">#{isIncrement},</if>
|
|
||||||
<if test="isRequired != null and isRequired != ''">#{isRequired},</if>
|
|
||||||
<if test="isInsert != null and isInsert != ''">#{isInsert},</if>
|
|
||||||
<if test="isEdit != null and isEdit != ''">#{isEdit},</if>
|
|
||||||
<if test="isList != null and isList != ''">#{isList},</if>
|
|
||||||
<if test="isQuery != null and isQuery != ''">#{isQuery},</if>
|
|
||||||
<if test="queryType != null and queryType != ''">#{queryType},</if>
|
|
||||||
<if test="htmlType != null and htmlType != ''">#{htmlType},</if>
|
|
||||||
<if test="dictType != null and dictType != ''">#{dictType},</if>
|
|
||||||
<if test="sort != null">#{sort},</if>
|
|
||||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
||||||
sysdate()
|
|
||||||
)
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="updateGenTableColumn" parameterType="com.muyu.gen.domain.GenTableColumn">
|
<update id="updateGenTableColumn" parameterType="com.muyu.gen.domain.GenTableColumn">
|
||||||
|
@ -227,7 +113,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<delete id="deleteGenTableColumnByIds" parameterType="Long">
|
<delete id="deleteGenTableColumnByIds" parameterType="Long">
|
||||||
<<<<<<< HEAD
|
|
||||||
delete from gen_table_column where table_id in (
|
delete from gen_table_column where table_id in (
|
||||||
<foreach collection="ids" item="tableId" separator="," >
|
<foreach collection="ids" item="tableId" separator="," >
|
||||||
#{tableId}
|
#{tableId}
|
||||||
|
@ -242,19 +127,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
#{item.columnId}
|
#{item.columnId}
|
||||||
</foreach>
|
</foreach>
|
||||||
)
|
)
|
||||||
=======
|
|
||||||
delete from gen_table_column where table_id in
|
|
||||||
<foreach collection="array" item="tableId" open="(" separator="," close=")">
|
|
||||||
#{tableId}
|
|
||||||
</foreach>
|
|
||||||
</delete>
|
|
||||||
|
|
||||||
<delete id="deleteGenTableColumns">
|
|
||||||
delete from gen_table_column where column_id in
|
|
||||||
<foreach collection="list" item="item" open="(" separator="," close=")">
|
|
||||||
#{item.columnId}
|
|
||||||
</foreach>
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<!DOCTYPE mapper
|
<!DOCTYPE mapper
|
||||||
<<<<<<< HEAD
|
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.muyu.gen.mapper.GenTableMapper">
|
<mapper namespace="com.muyu.gen.mapper.GenTableMapper">
|
||||||
|
@ -198,298 +197,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||||
sysdate()
|
sysdate()
|
||||||
)
|
)
|
||||||
=======
|
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
||||||
<mapper namespace="com.muyu.gen.mapper.GenTableMapper">
|
|
||||||
|
|
||||||
<resultMap type="com.muyu.gen.domain.GenTable" id="GenTableResult">
|
|
||||||
<id property="tableId" column="table_id"/>
|
|
||||||
<result property="tableName" column="table_name"/>
|
|
||||||
<result property="tableComment" column="table_comment"/>
|
|
||||||
<result property="subTableName" column="sub_table_name"/>
|
|
||||||
<result property="subTableFkName" column="sub_table_fk_name"/>
|
|
||||||
<result property="className" column="class_name"/>
|
|
||||||
<result property="tplCategory" column="tpl_category"/>
|
|
||||||
<result property="packageName" column="package_name"/>
|
|
||||||
<result property="moduleName" column="module_name"/>
|
|
||||||
<result property="businessName" column="business_name"/>
|
|
||||||
<result property="functionName" column="function_name"/>
|
|
||||||
<result property="functionAuthor" column="function_author"/>
|
|
||||||
<result property="genType" column="gen_type"/>
|
|
||||||
<result property="genPath" column="gen_path"/>
|
|
||||||
<result property="options" column="options"/>
|
|
||||||
<result property="createBy" column="create_by"/>
|
|
||||||
<result property="createTime" column="create_time"/>
|
|
||||||
<result property="updateBy" column="update_by"/>
|
|
||||||
<result property="updateTime" column="update_time"/>
|
|
||||||
<result property="remark" column="remark"/>
|
|
||||||
<collection property="columns" javaType="java.util.List" resultMap="GenTableColumnResult"/>
|
|
||||||
</resultMap>
|
|
||||||
|
|
||||||
<resultMap type="com.muyu.gen.domain.GenTableColumn" id="GenTableColumnResult">
|
|
||||||
<id property="columnId" column="column_id"/>
|
|
||||||
<result property="tableId" column="table_id"/>
|
|
||||||
<result property="columnName" column="column_name"/>
|
|
||||||
<result property="columnComment" column="column_comment"/>
|
|
||||||
<result property="columnType" column="column_type"/>
|
|
||||||
<result property="javaType" column="java_type"/>
|
|
||||||
<result property="javaField" column="java_field"/>
|
|
||||||
<result property="isPk" column="is_pk"/>
|
|
||||||
<result property="isIncrement" column="is_increment"/>
|
|
||||||
<result property="isRequired" column="is_required"/>
|
|
||||||
<result property="isInsert" column="is_insert"/>
|
|
||||||
<result property="isEdit" column="is_edit"/>
|
|
||||||
<result property="isList" column="is_list"/>
|
|
||||||
<result property="isQuery" column="is_query"/>
|
|
||||||
<result property="queryType" column="query_type"/>
|
|
||||||
<result property="htmlType" column="html_type"/>
|
|
||||||
<result property="dictType" column="dict_type"/>
|
|
||||||
<result property="sort" column="sort"/>
|
|
||||||
<result property="createBy" column="create_by"/>
|
|
||||||
<result property="createTime" column="create_time"/>
|
|
||||||
<result property="updateBy" column="update_by"/>
|
|
||||||
<result property="updateTime" column="update_time"/>
|
|
||||||
</resultMap>
|
|
||||||
|
|
||||||
<sql id="selectGenTableVo">
|
|
||||||
select table_id,
|
|
||||||
table_name,
|
|
||||||
table_comment,
|
|
||||||
sub_table_name,
|
|
||||||
sub_table_fk_name,
|
|
||||||
class_name,
|
|
||||||
tpl_category,
|
|
||||||
package_name,
|
|
||||||
module_name,
|
|
||||||
business_name,
|
|
||||||
function_name,
|
|
||||||
function_author,
|
|
||||||
gen_type,
|
|
||||||
gen_path,
|
|
||||||
options,
|
|
||||||
create_by,
|
|
||||||
create_time,
|
|
||||||
update_by,
|
|
||||||
update_time,
|
|
||||||
remark
|
|
||||||
from gen_table
|
|
||||||
</sql>
|
|
||||||
|
|
||||||
<select id="selectGenTableList" parameterType="com.muyu.gen.domain.GenTable" resultMap="GenTableResult">
|
|
||||||
<include refid="selectGenTableVo"/>
|
|
||||||
<where>
|
|
||||||
<if test="tableName != null and tableName != ''">
|
|
||||||
AND lower(table_name) like lower(concat('%', #{tableName}, '%'))
|
|
||||||
</if>
|
|
||||||
<if test="tableComment != null and tableComment != ''">
|
|
||||||
AND lower(table_comment) like lower(concat('%', #{tableComment}, '%'))
|
|
||||||
</if>
|
|
||||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
|
||||||
AND date_format(create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
|
||||||
</if>
|
|
||||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
|
||||||
AND date_format(create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
|
||||||
</if>
|
|
||||||
</where>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="selectDbTableList" parameterType="com.muyu.gen.domain.GenTable" resultMap="GenTableResult">
|
|
||||||
select table_name, table_comment, create_time, update_time from information_schema.tables
|
|
||||||
where table_schema = (select database())
|
|
||||||
AND table_name NOT LIKE 'qrtz_%' AND table_name NOT LIKE 'gen_%'
|
|
||||||
AND table_name NOT IN (select table_name from gen_table)
|
|
||||||
<if test="tableName != null and tableName != ''">
|
|
||||||
AND lower(table_name) like lower(concat('%', #{tableName}, '%'))
|
|
||||||
</if>
|
|
||||||
<if test="tableComment != null and tableComment != ''">
|
|
||||||
AND lower(table_comment) like lower(concat('%', #{tableComment}, '%'))
|
|
||||||
</if>
|
|
||||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
|
||||||
AND date_format(create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
|
||||||
</if>
|
|
||||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
|
||||||
AND date_format(create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
|
||||||
</if>
|
|
||||||
order by create_time desc
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="selectDbTableListByNames" resultMap="GenTableResult">
|
|
||||||
select table_name, table_comment, create_time, update_time from information_schema.tables
|
|
||||||
where table_name NOT LIKE 'qrtz_%' and table_name NOT LIKE 'gen_%' and table_schema = (select database())
|
|
||||||
and table_name in
|
|
||||||
<foreach collection="array" item="name" open="(" separator="," close=")">
|
|
||||||
#{name}
|
|
||||||
</foreach>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="selectTableByName" parameterType="String" resultMap="GenTableResult">
|
|
||||||
select table_name, table_comment, create_time, update_time
|
|
||||||
from information_schema.tables
|
|
||||||
where table_comment <![CDATA[ <> ]]> ''
|
|
||||||
and table_schema = (select database())
|
|
||||||
and table_name = #{tableName}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="selectGenTableById" parameterType="Long" resultMap="GenTableResult">
|
|
||||||
SELECT t.table_id,
|
|
||||||
t.table_name,
|
|
||||||
t.table_comment,
|
|
||||||
t.sub_table_name,
|
|
||||||
t.sub_table_fk_name,
|
|
||||||
t.class_name,
|
|
||||||
t.tpl_category,
|
|
||||||
t.package_name,
|
|
||||||
t.module_name,
|
|
||||||
t.business_name,
|
|
||||||
t.function_name,
|
|
||||||
t.function_author,
|
|
||||||
t.gen_type,
|
|
||||||
t.gen_path,
|
|
||||||
t.options,
|
|
||||||
t.remark,
|
|
||||||
c.column_id,
|
|
||||||
c.column_name,
|
|
||||||
c.column_comment,
|
|
||||||
c.column_type,
|
|
||||||
c.java_type,
|
|
||||||
c.java_field,
|
|
||||||
c.is_pk,
|
|
||||||
c.is_increment,
|
|
||||||
c.is_required,
|
|
||||||
c.is_insert,
|
|
||||||
c.is_edit,
|
|
||||||
c.is_list,
|
|
||||||
c.is_query,
|
|
||||||
c.query_type,
|
|
||||||
c.html_type,
|
|
||||||
c.dict_type,
|
|
||||||
c.sort
|
|
||||||
FROM gen_table t
|
|
||||||
LEFT JOIN gen_table_column c ON t.table_id = c.table_id
|
|
||||||
where t.table_id = #{tableId}
|
|
||||||
order by c.sort
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="selectGenTableByName" parameterType="String" resultMap="GenTableResult">
|
|
||||||
SELECT t.table_id,
|
|
||||||
t.table_name,
|
|
||||||
t.table_comment,
|
|
||||||
t.sub_table_name,
|
|
||||||
t.sub_table_fk_name,
|
|
||||||
t.class_name,
|
|
||||||
t.tpl_category,
|
|
||||||
t.package_name,
|
|
||||||
t.module_name,
|
|
||||||
t.business_name,
|
|
||||||
t.function_name,
|
|
||||||
t.function_author,
|
|
||||||
t.gen_type,
|
|
||||||
t.gen_path,
|
|
||||||
t.options,
|
|
||||||
t.remark,
|
|
||||||
c.column_id,
|
|
||||||
c.column_name,
|
|
||||||
c.column_comment,
|
|
||||||
c.column_type,
|
|
||||||
c.java_type,
|
|
||||||
c.java_field,
|
|
||||||
c.is_pk,
|
|
||||||
c.is_increment,
|
|
||||||
c.is_required,
|
|
||||||
c.is_insert,
|
|
||||||
c.is_edit,
|
|
||||||
c.is_list,
|
|
||||||
c.is_query,
|
|
||||||
c.query_type,
|
|
||||||
c.html_type,
|
|
||||||
c.dict_type,
|
|
||||||
c.sort
|
|
||||||
FROM gen_table t
|
|
||||||
LEFT JOIN gen_table_column c ON t.table_id = c.table_id
|
|
||||||
where t.table_name = #{tableName}
|
|
||||||
order by c.sort
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="selectGenTableAll" parameterType="String" resultMap="GenTableResult">
|
|
||||||
SELECT t.table_id,
|
|
||||||
t.table_name,
|
|
||||||
t.table_comment,
|
|
||||||
t.sub_table_name,
|
|
||||||
t.sub_table_fk_name,
|
|
||||||
t.class_name,
|
|
||||||
t.tpl_category,
|
|
||||||
t.package_name,
|
|
||||||
t.module_name,
|
|
||||||
t.business_name,
|
|
||||||
t.function_name,
|
|
||||||
t.function_author,
|
|
||||||
t.options,
|
|
||||||
t.remark,
|
|
||||||
c.column_id,
|
|
||||||
c.column_name,
|
|
||||||
c.column_comment,
|
|
||||||
c.column_type,
|
|
||||||
c.java_type,
|
|
||||||
c.java_field,
|
|
||||||
c.is_pk,
|
|
||||||
c.is_increment,
|
|
||||||
c.is_required,
|
|
||||||
c.is_insert,
|
|
||||||
c.is_edit,
|
|
||||||
c.is_list,
|
|
||||||
c.is_query,
|
|
||||||
c.query_type,
|
|
||||||
c.html_type,
|
|
||||||
c.dict_type,
|
|
||||||
c.sort
|
|
||||||
FROM gen_table t
|
|
||||||
LEFT JOIN gen_table_column c ON t.table_id = c.table_id
|
|
||||||
order by c.sort
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<insert id="insertGenTable" parameterType="com.muyu.gen.domain.GenTable" useGeneratedKeys="true" keyProperty="tableId">
|
|
||||||
insert into gen_table (
|
|
||||||
<if test="tableName != null">table_name,</if>
|
|
||||||
<if test="tableComment != null and tableComment != ''">table_comment,</if>
|
|
||||||
<if test="className != null and className != ''">class_name,</if>
|
|
||||||
<if test="tplCategory != null and tplCategory != ''">tpl_category,</if>
|
|
||||||
<if test="packageName != null and packageName != ''">package_name,</if>
|
|
||||||
<if test="moduleName != null and moduleName != ''">module_name,</if>
|
|
||||||
<if test="businessName != null and businessName != ''">business_name,</if>
|
|
||||||
<if test="functionName != null and functionName != ''">function_name,</if>
|
|
||||||
<if test="functionAuthor != null and functionAuthor != ''">function_author,</if>
|
|
||||||
<if test="genType != null and genType != ''">gen_type,</if>
|
|
||||||
<if test="genPath != null and genPath != ''">gen_path,</if>
|
|
||||||
<if test="remark != null and remark != ''">remark,</if>
|
|
||||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
|
||||||
create_time
|
|
||||||
)values(
|
|
||||||
<if test="tableName != null">#{tableName},</if>
|
|
||||||
<if test="tableComment != null and tableComment != ''">#{tableComment},</if>
|
|
||||||
<if test="className != null and className != ''">#{className},</if>
|
|
||||||
<if test="tplCategory != null and tplCategory != ''">#{tplCategory},</if>
|
|
||||||
<if test="packageName != null and packageName != ''">#{packageName},</if>
|
|
||||||
<if test="moduleName != null and moduleName != ''">#{moduleName},</if>
|
|
||||||
<if test="businessName != null and businessName != ''">#{businessName},</if>
|
|
||||||
<if test="functionName != null and functionName != ''">#{functionName},</if>
|
|
||||||
<if test="functionAuthor != null and functionAuthor != ''">#{functionAuthor},</if>
|
|
||||||
<if test="genType != null and genType != ''">#{genType},</if>
|
|
||||||
<if test="genPath != null and genPath != ''">#{genPath},</if>
|
|
||||||
<if test="remark != null and remark != ''">#{remark},</if>
|
|
||||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
||||||
sysdate()
|
|
||||||
)
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="updateGenTable" parameterType="com.muyu.gen.domain.GenTable">
|
<update id="updateGenTable" parameterType="com.muyu.gen.domain.GenTable">
|
||||||
update gen_table
|
update gen_table
|
||||||
<set>
|
<set>
|
||||||
<<<<<<< HEAD
|
|
||||||
<if test="dbName != null">db_name = #{dbName},</if>
|
<if test="dbName != null">db_name = #{dbName},</if>
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
<if test="tableName != null">table_name = #{tableName},</if>
|
<if test="tableName != null">table_name = #{tableName},</if>
|
||||||
<if test="tableComment != null and tableComment != ''">table_comment = #{tableComment},</if>
|
<if test="tableComment != null and tableComment != ''">table_comment = #{tableComment},</if>
|
||||||
<if test="subTableName != null">sub_table_name = #{subTableName},</if>
|
<if test="subTableName != null">sub_table_name = #{subTableName},</if>
|
||||||
|
@ -498,12 +211,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="functionAuthor != null and functionAuthor != ''">function_author = #{functionAuthor},</if>
|
<if test="functionAuthor != null and functionAuthor != ''">function_author = #{functionAuthor},</if>
|
||||||
<if test="genType != null and genType != ''">gen_type = #{genType},</if>
|
<if test="genType != null and genType != ''">gen_type = #{genType},</if>
|
||||||
<if test="genPath != null and genPath != ''">gen_path = #{genPath},</if>
|
<if test="genPath != null and genPath != ''">gen_path = #{genPath},</if>
|
||||||
<<<<<<< HEAD
|
|
||||||
<if test="tplCategory != null and tplCategory != ''">tpl_category = #{tplCategory},</if> <if test="packageName != null and packageName != ''">package_name = #{packageName},</if>
|
<if test="tplCategory != null and tplCategory != ''">tpl_category = #{tplCategory},</if> <if test="packageName != null and packageName != ''">package_name = #{packageName},</if>
|
||||||
=======
|
|
||||||
<if test="tplCategory != null and tplCategory != ''">tpl_category = #{tplCategory},</if>
|
|
||||||
<if test="packageName != null and packageName != ''">package_name = #{packageName},</if>
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
<if test="moduleName != null and moduleName != ''">module_name = #{moduleName},</if>
|
<if test="moduleName != null and moduleName != ''">module_name = #{moduleName},</if>
|
||||||
<if test="businessName != null and businessName != ''">business_name = #{businessName},</if>
|
<if test="businessName != null and businessName != ''">business_name = #{businessName},</if>
|
||||||
<if test="functionName != null and functionName != ''">function_name = #{functionName},</if>
|
<if test="functionName != null and functionName != ''">function_name = #{functionName},</if>
|
||||||
|
@ -516,18 +224,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<delete id="deleteGenTableByIds" parameterType="Long">
|
<delete id="deleteGenTableByIds" parameterType="Long">
|
||||||
<<<<<<< HEAD
|
|
||||||
delete from gen_table where table_id in (
|
delete from gen_table where table_id in (
|
||||||
<foreach collection="ids" item="tableId" separator="," >
|
<foreach collection="ids" item="tableId" separator="," >
|
||||||
#{tableId}
|
#{tableId}
|
||||||
</foreach>
|
</foreach>
|
||||||
)
|
)
|
||||||
=======
|
|
||||||
delete from gen_table where table_id in
|
|
||||||
<foreach collection="array" item="tableId" open="(" separator="," close=")">
|
|
||||||
#{tableId}
|
|
||||||
</foreach>
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -1,16 +1,9 @@
|
||||||
package ${packageName}.controller;
|
package ${packageName}.controller;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
=======
|
|
||||||
import java.util.List;
|
|
||||||
import java.io.IOException;
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
@ -19,22 +12,14 @@ import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
import com.muyu.common.log.annotation.Log;
|
|
||||||
import com.muyu.common.log.enums.BusinessType;
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||||
import ${packageName}.domain.${ClassName};
|
import ${packageName}.domain.${ClassName};
|
||||||
import ${packageName}.service.I${ClassName}Service;
|
import ${packageName}.service.I${ClassName}Service;
|
||||||
import com.muyu.common.core.web.controller.BaseController;
|
import com.muyu.common.core.web.controller.BaseController;
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||||
<<<<<<< HEAD
|
|
||||||
import com.muyu.common.security.utils.SecurityUtils;
|
import com.muyu.common.security.utils.SecurityUtils;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
#if($table.crud || $table.sub)
|
#if($table.crud || $table.sub)
|
||||||
import com.muyu.common.core.web.page.TableDataInfo;
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
#elseif($table.tree)
|
#elseif($table.tree)
|
||||||
|
@ -50,11 +35,7 @@ import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
@RequestMapping("/${businessName}")
|
@RequestMapping("/${businessName}")
|
||||||
public class ${ClassName}Controller extends BaseController
|
public class ${ClassName}Controller extends BaseController
|
||||||
{
|
{
|
||||||
<<<<<<< HEAD
|
|
||||||
@Resource
|
@Resource
|
||||||
=======
|
|
||||||
@Autowired
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
private I${ClassName}Service ${className}Service;
|
private I${ClassName}Service ${className}Service;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -63,22 +44,14 @@ public class ${ClassName}Controller extends BaseController
|
||||||
@RequiresPermissions("${permissionPrefix}:list")
|
@RequiresPermissions("${permissionPrefix}:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
#if($table.crud || $table.sub)
|
#if($table.crud || $table.sub)
|
||||||
<<<<<<< HEAD
|
|
||||||
public Result<TableDataInfo<${ClassName}>> list(${ClassName} ${className})
|
public Result<TableDataInfo<${ClassName}>> list(${ClassName} ${className})
|
||||||
=======
|
|
||||||
public Result<TableDataInfo> list(${ClassName} ${className})
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
{
|
{
|
||||||
startPage();
|
startPage();
|
||||||
List<${ClassName}> list = ${className}Service.select${ClassName}List(${className});
|
List<${ClassName}> list = ${className}Service.select${ClassName}List(${className});
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
#elseif($table.tree)
|
#elseif($table.tree)
|
||||||
<<<<<<< HEAD
|
|
||||||
public Result<${ClassName}> list(${ClassName} ${className})
|
public Result<${ClassName}> list(${ClassName} ${className})
|
||||||
=======
|
|
||||||
public Result list(${ClassName} ${className})
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
{
|
{
|
||||||
List<${ClassName}> list = ${className}Service.select${ClassName}List(${className});
|
List<${ClassName}> list = ${className}Service.select${ClassName}List(${className});
|
||||||
return success(list);
|
return success(list);
|
||||||
|
@ -89,10 +62,6 @@ public class ${ClassName}Controller extends BaseController
|
||||||
* 导出${functionName}列表
|
* 导出${functionName}列表
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("${permissionPrefix}:export")
|
@RequiresPermissions("${permissionPrefix}:export")
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
@Log(title = "${functionName}", businessType = BusinessType.EXPORT)
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(HttpServletResponse response, ${ClassName} ${className})
|
public void export(HttpServletResponse response, ${ClassName} ${className})
|
||||||
{
|
{
|
||||||
|
@ -106,11 +75,7 @@ public class ${ClassName}Controller extends BaseController
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("${permissionPrefix}:query")
|
@RequiresPermissions("${permissionPrefix}:query")
|
||||||
@GetMapping(value = "/{${pkColumn.javaField}}")
|
@GetMapping(value = "/{${pkColumn.javaField}}")
|
||||||
<<<<<<< HEAD
|
|
||||||
public Result<List<${ClassName}>> getInfo(@PathVariable("${pkColumn.javaField}") ${pkColumn.javaType} ${pkColumn.javaField})
|
public Result<List<${ClassName}>> getInfo(@PathVariable("${pkColumn.javaField}") ${pkColumn.javaType} ${pkColumn.javaField})
|
||||||
=======
|
|
||||||
public Result getInfo(@PathVariable("${pkColumn.javaField}") ${pkColumn.javaType} ${pkColumn.javaField})
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
{
|
{
|
||||||
return success(${className}Service.select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaField}));
|
return success(${className}Service.select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaField}));
|
||||||
}
|
}
|
||||||
|
@ -119,7 +84,6 @@ public class ${ClassName}Controller extends BaseController
|
||||||
* 新增${functionName}
|
* 新增${functionName}
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("${permissionPrefix}:add")
|
@RequiresPermissions("${permissionPrefix}:add")
|
||||||
<<<<<<< HEAD
|
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public Result<Integer> add(
|
public Result<Integer> add(
|
||||||
@Validated @RequestBody ${ClassName} ${className})
|
@Validated @RequestBody ${ClassName} ${className})
|
||||||
|
@ -129,20 +93,12 @@ public class ${ClassName}Controller extends BaseController
|
||||||
}
|
}
|
||||||
${className}.setCreateBy(SecurityUtils.getUsername());
|
${className}.setCreateBy(SecurityUtils.getUsername());
|
||||||
return toAjax(${className}Service.save(${className}));
|
return toAjax(${className}Service.save(${className}));
|
||||||
=======
|
|
||||||
@Log(title = "${functionName}", businessType = BusinessType.INSERT)
|
|
||||||
@PostMapping
|
|
||||||
public Result add(@RequestBody ${ClassName} ${className})
|
|
||||||
{
|
|
||||||
return toAjax(${className}Service.insert${ClassName}(${className}));
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改${functionName}
|
* 修改${functionName}
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("${permissionPrefix}:edit")
|
@RequiresPermissions("${permissionPrefix}:edit")
|
||||||
<<<<<<< HEAD
|
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public Result<Integer> edit(
|
public Result<Integer> edit(
|
||||||
@Validated @RequestBody ${ClassName} ${className})
|
@Validated @RequestBody ${ClassName} ${className})
|
||||||
|
@ -152,31 +108,16 @@ public class ${ClassName}Controller extends BaseController
|
||||||
}
|
}
|
||||||
${className}.setUpdateBy(SecurityUtils.getUsername());
|
${className}.setUpdateBy(SecurityUtils.getUsername());
|
||||||
return toAjax(${className}Service.updateById(${className}));
|
return toAjax(${className}Service.updateById(${className}));
|
||||||
=======
|
|
||||||
@Log(title = "${functionName}", businessType = BusinessType.UPDATE)
|
|
||||||
@PutMapping
|
|
||||||
public Result edit(@RequestBody ${ClassName} ${className})
|
|
||||||
{
|
|
||||||
return toAjax(${className}Service.update${ClassName}(${className}));
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除${functionName}
|
* 删除${functionName}
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("${permissionPrefix}:remove")
|
@RequiresPermissions("${permissionPrefix}:remove")
|
||||||
<<<<<<< HEAD
|
|
||||||
@DeleteMapping("/{${pkColumn.javaField}s}")
|
@DeleteMapping("/{${pkColumn.javaField}s}")
|
||||||
public Result<Integer> remove(@PathVariable("${pkColumn.javaField}s") ${pkColumn.javaType}[] ${pkColumn.javaField}s)
|
public Result<Integer> remove(@PathVariable("${pkColumn.javaField}s") ${pkColumn.javaType}[] ${pkColumn.javaField}s)
|
||||||
{
|
{
|
||||||
${className}Service.removeBatchByIds(Arrays.asList(${pkColumn.javaField}s));
|
${className}Service.removeBatchByIds(Arrays.asList(${pkColumn.javaField}s));
|
||||||
return success();
|
return success();
|
||||||
=======
|
|
||||||
@Log(title = "${functionName}", businessType = BusinessType.DELETE)
|
|
||||||
@DeleteMapping("/{${pkColumn.javaField}s}")
|
|
||||||
public Result remove(@PathVariable("${pkColumn.javaField}s") ${pkColumn.javaType}[] ${pkColumn.javaField}s)
|
|
||||||
{
|
|
||||||
return toAjax(${className}Service.delete${ClassName}By${pkColumn.capJavaField}s(${pkColumn.javaField}s));
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,6 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
#elseif($table.tree)
|
#elseif($table.tree)
|
||||||
import com.muyu.common.core.web.domain.TreeEntity;
|
import com.muyu.common.core.web.domain.TreeEntity;
|
||||||
#end
|
#end
|
||||||
<<<<<<< HEAD
|
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
@ -17,8 +16,6 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ${functionName}对象 ${tableName}
|
* ${functionName}对象 ${tableName}
|
||||||
|
@ -26,16 +23,12 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
* @author ${author}
|
* @author ${author}
|
||||||
* @date ${datetime}
|
* @date ${datetime}
|
||||||
*/
|
*/
|
||||||
<<<<<<< HEAD
|
|
||||||
|
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
#if($table.crud || $table.sub)
|
#if($table.crud || $table.sub)
|
||||||
#set($Entity="BaseEntity")
|
#set($Entity="BaseEntity")
|
||||||
#elseif($table.tree)
|
#elseif($table.tree)
|
||||||
#set($Entity="TreeEntity")
|
#set($Entity="TreeEntity")
|
||||||
#end
|
#end
|
||||||
<<<<<<< HEAD
|
|
||||||
@Data
|
@Data
|
||||||
@Setter
|
@Setter
|
||||||
@Getter
|
@Getter
|
||||||
|
@ -44,10 +37,6 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@TableName("${tableName}")
|
@TableName("${tableName}")
|
||||||
public class ${ClassName} extends ${Entity}{
|
public class ${ClassName} extends ${Entity}{
|
||||||
=======
|
|
||||||
public class ${ClassName} extends ${Entity}
|
|
||||||
{
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
|
@ -69,46 +58,19 @@ public class ${ClassName} extends ${Entity}
|
||||||
@Excel(name = "${comment}")
|
@Excel(name = "${comment}")
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
<<<<<<< HEAD
|
|
||||||
#if($column.javaField == $pkColumn.javaField)
|
#if($column.javaField == $pkColumn.javaField)
|
||||||
@TableId( type = IdType.AUTO)
|
@TableId( type = IdType.AUTO)
|
||||||
#end
|
#end
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
private $column.javaType $column.javaField;
|
private $column.javaType $column.javaField;
|
||||||
|
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
<<<<<<< HEAD
|
|
||||||
|
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
#if($table.sub)
|
#if($table.sub)
|
||||||
/** $table.subTable.functionName信息 */
|
/** $table.subTable.functionName信息 */
|
||||||
private List<${subClassName}> ${subclassName}List;
|
private List<${subClassName}> ${subclassName}List;
|
||||||
|
|
||||||
#end
|
#end
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
#foreach ($column in $columns)
|
|
||||||
#if(!$table.isSuperColumn($column.javaField))
|
|
||||||
#if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]"))
|
|
||||||
#set($AttrName=$column.javaField)
|
|
||||||
#else
|
|
||||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
|
||||||
#end
|
|
||||||
public void set${AttrName}($column.javaType $column.javaField)
|
|
||||||
{
|
|
||||||
this.$column.javaField = $column.javaField;
|
|
||||||
}
|
|
||||||
|
|
||||||
public $column.javaType get${AttrName}()
|
|
||||||
{
|
|
||||||
return $column.javaField;
|
|
||||||
}
|
|
||||||
#end
|
|
||||||
#end
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
#if($table.sub)
|
#if($table.sub)
|
||||||
public List<${subClassName}> get${subClassName}List()
|
public List<${subClassName}> get${subClassName}List()
|
||||||
|
|
|
@ -5,7 +5,6 @@ import ${packageName}.domain.${ClassName};
|
||||||
#if($table.sub)
|
#if($table.sub)
|
||||||
import ${packageName}.domain.${subClassName};
|
import ${packageName}.domain.${subClassName};
|
||||||
#end
|
#end
|
||||||
<<<<<<< HEAD
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@ -18,89 +17,4 @@ import org.apache.ibatis.annotations.Mapper;
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface ${ClassName}Mapper extends BaseMapper<${ClassName}>{
|
public interface ${ClassName}Mapper extends BaseMapper<${ClassName}>{
|
||||||
|
|
||||||
=======
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ${functionName}Mapper接口
|
|
||||||
*
|
|
||||||
* @author ${author}
|
|
||||||
* @date ${datetime}
|
|
||||||
*/
|
|
||||||
public interface ${ClassName}Mapper
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* 查询${functionName}
|
|
||||||
*
|
|
||||||
* @param ${pkColumn.javaField} ${functionName}主键
|
|
||||||
* @return ${functionName}
|
|
||||||
*/
|
|
||||||
public ${ClassName} select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField});
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询${functionName}列表
|
|
||||||
*
|
|
||||||
* @param ${className} ${functionName}
|
|
||||||
* @return ${functionName}集合
|
|
||||||
*/
|
|
||||||
public List<${ClassName}> select${ClassName}List(${ClassName} ${className});
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增${functionName}
|
|
||||||
*
|
|
||||||
* @param ${className} ${functionName}
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int insert${ClassName}(${ClassName} ${className});
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改${functionName}
|
|
||||||
*
|
|
||||||
* @param ${className} ${functionName}
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int update${ClassName}(${ClassName} ${className});
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除${functionName}
|
|
||||||
*
|
|
||||||
* @param ${pkColumn.javaField} ${functionName}主键
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField});
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除${functionName}
|
|
||||||
*
|
|
||||||
* @param ${pkColumn.javaField}s 需要删除的数据主键集合
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int delete${ClassName}By${pkColumn.capJavaField}s(${pkColumn.javaType}[] ${pkColumn.javaField}s);
|
|
||||||
#if($table.sub)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除${subTable.functionName}
|
|
||||||
*
|
|
||||||
* @param ${pkColumn.javaField}s 需要删除的数据主键集合
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int delete${subClassName}By${subTableFkClassName}s(${pkColumn.javaType}[] ${pkColumn.javaField}s);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量新增${subTable.functionName}
|
|
||||||
*
|
|
||||||
* @param ${subclassName}List ${subTable.functionName}列表
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int batch${subClassName}(List<${subClassName}> ${subclassName}List);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过${functionName}主键删除${subTable.functionName}信息
|
|
||||||
*
|
|
||||||
* @param ${pkColumn.javaField} ${functionName}ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int delete${subClassName}By${subTableFkClassName}(${pkColumn.javaType} ${pkColumn.javaField});
|
|
||||||
#end
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,6 @@ package ${packageName}.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import ${packageName}.domain.${ClassName};
|
import ${packageName}.domain.${ClassName};
|
||||||
<<<<<<< HEAD
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -15,20 +14,6 @@ public interface I${ClassName}Service extends IService<${ClassName}> {
|
||||||
/**
|
/**
|
||||||
* 精确查询${functionName}
|
* 精确查询${functionName}
|
||||||
*
|
*
|
||||||
=======
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ${functionName}Service接口
|
|
||||||
*
|
|
||||||
* @author ${author}
|
|
||||||
* @date ${datetime}
|
|
||||||
*/
|
|
||||||
public interface I${ClassName}Service
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* 查询${functionName}
|
|
||||||
*
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
* @param ${pkColumn.javaField} ${functionName}主键
|
* @param ${pkColumn.javaField} ${functionName}主键
|
||||||
* @return ${functionName}
|
* @return ${functionName}
|
||||||
*/
|
*/
|
||||||
|
@ -36,54 +21,17 @@ public interface I${ClassName}Service
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询${functionName}列表
|
* 查询${functionName}列表
|
||||||
<<<<<<< HEAD
|
|
||||||
*
|
*
|
||||||
=======
|
|
||||||
*
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
* @param ${className} ${functionName}
|
* @param ${className} ${functionName}
|
||||||
* @return ${functionName}集合
|
* @return ${functionName}集合
|
||||||
*/
|
*/
|
||||||
public List<${ClassName}> select${ClassName}List(${ClassName} ${className});
|
public List<${ClassName}> select${ClassName}List(${ClassName} ${className});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
<<<<<<< HEAD
|
|
||||||
* 判断 ${functionName} id是否唯一
|
* 判断 ${functionName} id是否唯一
|
||||||
* @param ${className} ${functionName}
|
* @param ${className} ${functionName}
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
Boolean checkIdUnique(${ClassName} ${className});
|
Boolean checkIdUnique(${ClassName} ${className});
|
||||||
|
|
||||||
=======
|
|
||||||
* 新增${functionName}
|
|
||||||
*
|
|
||||||
* @param ${className} ${functionName}
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int insert${ClassName}(${ClassName} ${className});
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改${functionName}
|
|
||||||
*
|
|
||||||
* @param ${className} ${functionName}
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int update${ClassName}(${ClassName} ${className});
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除${functionName}
|
|
||||||
*
|
|
||||||
* @param ${pkColumn.javaField}s 需要删除的${functionName}主键集合
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int delete${ClassName}By${pkColumn.capJavaField}s(${pkColumn.javaType}[] ${pkColumn.javaField}s);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除${functionName}信息
|
|
||||||
*
|
|
||||||
* @param ${pkColumn.javaField} ${functionName}主键
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField});
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,10 +7,6 @@ import com.muyu.common.core.utils.DateUtils;
|
||||||
#break
|
#break
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
#if($table.sub)
|
#if($table.sub)
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -21,13 +17,10 @@ import ${packageName}.domain.${subClassName};
|
||||||
import ${packageName}.mapper.${ClassName}Mapper;
|
import ${packageName}.mapper.${ClassName}Mapper;
|
||||||
import ${packageName}.domain.${ClassName};
|
import ${packageName}.domain.${ClassName};
|
||||||
import ${packageName}.service.I${ClassName}Service;
|
import ${packageName}.service.I${ClassName}Service;
|
||||||
<<<<<<< HEAD
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.muyu.common.core.utils.StringUtils;
|
import com.muyu.common.core.utils.StringUtils;
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ${functionName}Service业务层处理
|
* ${functionName}Service业务层处理
|
||||||
|
@ -36,22 +29,12 @@ import org.springframework.util.Assert;
|
||||||
* @date ${datetime}
|
* @date ${datetime}
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
<<<<<<< HEAD
|
|
||||||
public class ${ClassName}ServiceImpl
|
public class ${ClassName}ServiceImpl
|
||||||
extends ServiceImpl<${ClassName}Mapper, ${ClassName}>
|
extends ServiceImpl<${ClassName}Mapper, ${ClassName}>
|
||||||
implements I${ClassName}Service {
|
implements I${ClassName}Service {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 精确查询${functionName}
|
* 精确查询${functionName}
|
||||||
=======
|
|
||||||
public class ${ClassName}ServiceImpl implements I${ClassName}Service
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private ${ClassName}Mapper ${className}Mapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询${functionName}
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
*
|
*
|
||||||
* @param ${pkColumn.javaField} ${functionName}主键
|
* @param ${pkColumn.javaField} ${functionName}主键
|
||||||
* @return ${functionName}
|
* @return ${functionName}
|
||||||
|
@ -59,7 +42,6 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
|
||||||
@Override
|
@Override
|
||||||
public ${ClassName} select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField})
|
public ${ClassName} select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField})
|
||||||
{
|
{
|
||||||
<<<<<<< HEAD
|
|
||||||
LambdaQueryWrapper<${ClassName}> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<${ClassName}> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
Assert.notNull(${pkColumn.javaField}, "${pkColumn.javaField}不可为空");
|
Assert.notNull(${pkColumn.javaField}, "${pkColumn.javaField}不可为空");
|
||||||
queryWrapper.eq(${ClassName}::get${pkColumn.capJavaField}, ${pkColumn.javaField});
|
queryWrapper.eq(${ClassName}::get${pkColumn.capJavaField}, ${pkColumn.javaField});
|
||||||
|
@ -67,11 +49,6 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
=======
|
|
||||||
return ${className}Mapper.select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaField});
|
|
||||||
}
|
|
||||||
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
/**
|
/**
|
||||||
* 查询${functionName}列表
|
* 查询${functionName}列表
|
||||||
*
|
*
|
||||||
|
@ -81,7 +58,6 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
|
||||||
@Override
|
@Override
|
||||||
public List<${ClassName}> select${ClassName}List(${ClassName} ${className})
|
public List<${ClassName}> select${ClassName}List(${ClassName} ${className})
|
||||||
{
|
{
|
||||||
<<<<<<< HEAD
|
|
||||||
LambdaQueryWrapper<${ClassName}> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<${ClassName}> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
#foreach($column in $columns)
|
#foreach($column in $columns)
|
||||||
#set($queryType=$column.queryType)
|
#set($queryType=$column.queryType)
|
||||||
|
@ -136,120 +112,4 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
|
||||||
return this.count(queryWrapper) > 0;
|
return this.count(queryWrapper) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
=======
|
|
||||||
return ${className}Mapper.select${ClassName}List(${className});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增${functionName}
|
|
||||||
*
|
|
||||||
* @param ${className} ${functionName}
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
#if($table.sub)
|
|
||||||
@Transactional
|
|
||||||
#end
|
|
||||||
@Override
|
|
||||||
public int insert${ClassName}(${ClassName} ${className})
|
|
||||||
{
|
|
||||||
#foreach ($column in $columns)
|
|
||||||
#if($column.javaField == 'createTime')
|
|
||||||
${className}.setCreateTime(DateUtils.getNowDate());
|
|
||||||
#end
|
|
||||||
#end
|
|
||||||
#if($table.sub)
|
|
||||||
int rows = ${className}Mapper.insert${ClassName}(${className});
|
|
||||||
insert${subClassName}(${className});
|
|
||||||
return rows;
|
|
||||||
#else
|
|
||||||
return ${className}Mapper.insert${ClassName}(${className});
|
|
||||||
#end
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改${functionName}
|
|
||||||
*
|
|
||||||
* @param ${className} ${functionName}
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
#if($table.sub)
|
|
||||||
@Transactional
|
|
||||||
#end
|
|
||||||
@Override
|
|
||||||
public int update${ClassName}(${ClassName} ${className})
|
|
||||||
{
|
|
||||||
#foreach ($column in $columns)
|
|
||||||
#if($column.javaField == 'updateTime')
|
|
||||||
${className}.setUpdateTime(DateUtils.getNowDate());
|
|
||||||
#end
|
|
||||||
#end
|
|
||||||
#if($table.sub)
|
|
||||||
${className}Mapper.delete${subClassName}By${subTableFkClassName}(${className}.get${pkColumn.capJavaField}());
|
|
||||||
insert${subClassName}(${className});
|
|
||||||
#end
|
|
||||||
return ${className}Mapper.update${ClassName}(${className});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除${functionName}
|
|
||||||
*
|
|
||||||
* @param ${pkColumn.javaField}s 需要删除的${functionName}主键
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
#if($table.sub)
|
|
||||||
@Transactional
|
|
||||||
#end
|
|
||||||
@Override
|
|
||||||
public int delete${ClassName}By${pkColumn.capJavaField}s(${pkColumn.javaType}[] ${pkColumn.javaField}s)
|
|
||||||
{
|
|
||||||
#if($table.sub)
|
|
||||||
${className}Mapper.delete${subClassName}By${subTableFkClassName}s(${pkColumn.javaField}s);
|
|
||||||
#end
|
|
||||||
return ${className}Mapper.delete${ClassName}By${pkColumn.capJavaField}s(${pkColumn.javaField}s);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除${functionName}信息
|
|
||||||
*
|
|
||||||
* @param ${pkColumn.javaField} ${functionName}主键
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
#if($table.sub)
|
|
||||||
@Transactional
|
|
||||||
#end
|
|
||||||
@Override
|
|
||||||
public int delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField})
|
|
||||||
{
|
|
||||||
#if($table.sub)
|
|
||||||
${className}Mapper.delete${subClassName}By${subTableFkClassName}(${pkColumn.javaField});
|
|
||||||
#end
|
|
||||||
return ${className}Mapper.delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaField});
|
|
||||||
}
|
|
||||||
#if($table.sub)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增${subTable.functionName}信息
|
|
||||||
*
|
|
||||||
* @param ${className} ${functionName}对象
|
|
||||||
*/
|
|
||||||
public void insert${subClassName}(${ClassName} ${className})
|
|
||||||
{
|
|
||||||
List<${subClassName}> ${subclassName}List = ${className}.get${subClassName}List();
|
|
||||||
${pkColumn.javaType} ${pkColumn.javaField} = ${className}.get${pkColumn.capJavaField}();
|
|
||||||
if (StringUtils.isNotNull(${subclassName}List))
|
|
||||||
{
|
|
||||||
List<${subClassName}> list = new ArrayList<${subClassName}>();
|
|
||||||
for (${subClassName} ${subclassName} : ${subclassName}List)
|
|
||||||
{
|
|
||||||
${subclassName}.set${subTableFkClassName}(${pkColumn.javaField});
|
|
||||||
list.add(${subclassName});
|
|
||||||
}
|
|
||||||
if (list.size() > 0)
|
|
||||||
{
|
|
||||||
${className}Mapper.batch${subClassName}(list);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#end
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,12 +17,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
<<<<<<< HEAD
|
|
||||||
public class ${subClassName} extends BaseEntity {
|
public class ${subClassName} extends BaseEntity {
|
||||||
=======
|
|
||||||
public class ${subClassName} extends BaseEntity
|
|
||||||
{
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
#foreach ($column in $subTable.columns)
|
#foreach ($column in $subTable.columns)
|
||||||
|
|
|
@ -170,11 +170,7 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<<<<<<< HEAD
|
|
||||||
|
|
||||||
=======
|
|
||||||
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
<pagination
|
<pagination
|
||||||
v-show="total>0"
|
v-show="total>0"
|
||||||
:total="total"
|
:total="total"
|
||||||
|
@ -357,11 +353,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
<<<<<<< HEAD
|
|
||||||
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "/src/api/${moduleName}/${businessName}";
|
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "/src/api/${moduleName}/${businessName}";
|
||||||
=======
|
|
||||||
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}";
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "${BusinessName}",
|
name: "${BusinessName}",
|
||||||
|
@ -456,13 +448,8 @@ export default {
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
list${BusinessName}(this.queryParams).then(response => {
|
list${BusinessName}(this.queryParams).then(response => {
|
||||||
<<<<<<< HEAD
|
|
||||||
this.${businessName}List = response.data.rows;
|
this.${businessName}List = response.data.rows;
|
||||||
this.total = response.data.total;
|
this.total = response.data.total;
|
||||||
=======
|
|
||||||
this.${businessName}List = response.rows;
|
|
||||||
this.total = response.total;
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -13,11 +13,7 @@ import com.muyu.system.service.SysConfigService;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
<<<<<<< HEAD
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
=======
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
@ -34,11 +30,7 @@ import java.util.List;
|
||||||
@Tag(name = "SysConfigController", description = "系统参数配置")
|
@Tag(name = "SysConfigController", description = "系统参数配置")
|
||||||
public class SysConfigController extends BaseController {
|
public class SysConfigController extends BaseController {
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
@Resource
|
@Resource
|
||||||
=======
|
|
||||||
@Autowired
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
private SysConfigService configService;
|
private SysConfigService configService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -11,11 +11,7 @@ import com.muyu.common.security.utils.SecurityUtils;
|
||||||
import com.muyu.common.system.domain.SysDept;
|
import com.muyu.common.system.domain.SysDept;
|
||||||
import com.muyu.system.service.SysDeptService;
|
import com.muyu.system.service.SysDeptService;
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
<<<<<<< HEAD
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
=======
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
@ -30,11 +26,7 @@ import java.util.List;
|
||||||
@RequestMapping("/dept")
|
@RequestMapping("/dept")
|
||||||
public class SysDeptController extends BaseController {
|
public class SysDeptController extends BaseController {
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
@Resource
|
@Resource
|
||||||
=======
|
|
||||||
@Autowired
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
private SysDeptService deptService;
|
private SysDeptService deptService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -43,10 +35,7 @@ public class SysDeptController extends BaseController {
|
||||||
@RequiresPermissions("system:dept:list")
|
@RequiresPermissions("system:dept:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public Result list (SysDept dept) {
|
public Result list (SysDept dept) {
|
||||||
<<<<<<< HEAD
|
|
||||||
dept.setFirmCode(SecurityUtils.getSaasKey());
|
dept.setFirmCode(SecurityUtils.getSaasKey());
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
List<SysDept> depts = deptService.selectDeptList(dept);
|
List<SysDept> depts = deptService.selectDeptList(dept);
|
||||||
return success(depts);
|
return success(depts);
|
||||||
}
|
}
|
||||||
|
@ -83,11 +72,8 @@ public class SysDeptController extends BaseController {
|
||||||
return error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
return error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
||||||
}
|
}
|
||||||
dept.setCreateBy(SecurityUtils.getUsername());
|
dept.setCreateBy(SecurityUtils.getUsername());
|
||||||
<<<<<<< HEAD
|
|
||||||
SysDept sysDept = deptService.selectDeptById(dept.getParentId());
|
SysDept sysDept = deptService.selectDeptById(dept.getParentId());
|
||||||
dept.setFirmCode(sysDept.getFirmCode());
|
dept.setFirmCode(sysDept.getFirmCode());
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
return toAjax(deptService.insertDept(dept));
|
return toAjax(deptService.insertDept(dept));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,11 +12,7 @@ import com.muyu.common.security.utils.SecurityUtils;
|
||||||
import com.muyu.common.system.domain.SysDictData;
|
import com.muyu.common.system.domain.SysDictData;
|
||||||
import com.muyu.system.service.SysDictDataService;
|
import com.muyu.system.service.SysDictDataService;
|
||||||
import com.muyu.system.service.SysDictTypeService;
|
import com.muyu.system.service.SysDictTypeService;
|
||||||
<<<<<<< HEAD
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
=======
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
@ -32,17 +28,10 @@ import java.util.List;
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/dict/data")
|
@RequestMapping("/dict/data")
|
||||||
public class SysDictDataController extends BaseController {
|
public class SysDictDataController extends BaseController {
|
||||||
<<<<<<< HEAD
|
|
||||||
@Resource
|
@Resource
|
||||||
private SysDictDataService dictDataService;
|
private SysDictDataService dictDataService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
=======
|
|
||||||
@Autowired
|
|
||||||
private SysDictDataService dictDataService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
private SysDictTypeService dictTypeService;
|
private SysDictTypeService dictTypeService;
|
||||||
|
|
||||||
@RequiresPermissions("system:dict:list")
|
@RequiresPermissions("system:dict:list")
|
||||||
|
|
|
@ -10,11 +10,7 @@ import com.muyu.common.security.annotation.RequiresPermissions;
|
||||||
import com.muyu.common.security.utils.SecurityUtils;
|
import com.muyu.common.security.utils.SecurityUtils;
|
||||||
import com.muyu.common.system.domain.SysDictType;
|
import com.muyu.common.system.domain.SysDictType;
|
||||||
import com.muyu.system.service.SysDictTypeService;
|
import com.muyu.system.service.SysDictTypeService;
|
||||||
<<<<<<< HEAD
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
=======
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
@ -29,11 +25,7 @@ import java.util.List;
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/dict/type")
|
@RequestMapping("/dict/type")
|
||||||
public class SysDictTypeController extends BaseController {
|
public class SysDictTypeController extends BaseController {
|
||||||
<<<<<<< HEAD
|
|
||||||
@Resource
|
@Resource
|
||||||
=======
|
|
||||||
@Autowired
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
private SysDictTypeService dictTypeService;
|
private SysDictTypeService dictTypeService;
|
||||||
|
|
||||||
@RequiresPermissions("system:dict:list")
|
@RequiresPermissions("system:dict:list")
|
||||||
|
|
|
@ -12,11 +12,7 @@ import com.muyu.common.security.annotation.InnerAuth;
|
||||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||||
import com.muyu.common.system.domain.SysLogininfor;
|
import com.muyu.common.system.domain.SysLogininfor;
|
||||||
import com.muyu.system.service.SysLogininforService;
|
import com.muyu.system.service.SysLogininforService;
|
||||||
<<<<<<< HEAD
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
=======
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
@ -30,17 +26,10 @@ import java.util.List;
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/logininfor")
|
@RequestMapping("/logininfor")
|
||||||
public class SysLogininforController extends BaseController {
|
public class SysLogininforController extends BaseController {
|
||||||
<<<<<<< HEAD
|
|
||||||
@Resource
|
@Resource
|
||||||
private SysLogininforService logininforService;
|
private SysLogininforService logininforService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
=======
|
|
||||||
@Autowired
|
|
||||||
private SysLogininforService logininforService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
private RedisService redisService;
|
private RedisService redisService;
|
||||||
|
|
||||||
@RequiresPermissions("system:logininfor:list")
|
@RequiresPermissions("system:logininfor:list")
|
||||||
|
|
|
@ -11,11 +11,7 @@ import com.muyu.common.security.utils.SecurityUtils;
|
||||||
import com.muyu.system.domain.SysMenu;
|
import com.muyu.system.domain.SysMenu;
|
||||||
import com.muyu.system.domain.resp.RoleMenuTreeResp;
|
import com.muyu.system.domain.resp.RoleMenuTreeResp;
|
||||||
import com.muyu.system.service.SysMenuService;
|
import com.muyu.system.service.SysMenuService;
|
||||||
<<<<<<< HEAD
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
=======
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
@ -29,11 +25,7 @@ import java.util.List;
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/menu")
|
@RequestMapping("/menu")
|
||||||
public class SysMenuController extends BaseController {
|
public class SysMenuController extends BaseController {
|
||||||
<<<<<<< HEAD
|
|
||||||
@Resource
|
@Resource
|
||||||
=======
|
|
||||||
@Autowired
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
private SysMenuService menuService;
|
private SysMenuService menuService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -9,11 +9,7 @@ import com.muyu.common.security.annotation.RequiresPermissions;
|
||||||
import com.muyu.common.security.utils.SecurityUtils;
|
import com.muyu.common.security.utils.SecurityUtils;
|
||||||
import com.muyu.system.domain.SysNotice;
|
import com.muyu.system.domain.SysNotice;
|
||||||
import com.muyu.system.service.SysNoticeService;
|
import com.muyu.system.service.SysNoticeService;
|
||||||
<<<<<<< HEAD
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
=======
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
@ -27,11 +23,7 @@ import java.util.List;
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/notice")
|
@RequestMapping("/notice")
|
||||||
public class SysNoticeController extends BaseController {
|
public class SysNoticeController extends BaseController {
|
||||||
<<<<<<< HEAD
|
|
||||||
@Resource
|
@Resource
|
||||||
=======
|
|
||||||
@Autowired
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
private SysNoticeService noticeService;
|
private SysNoticeService noticeService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -10,11 +10,7 @@ import com.muyu.common.security.annotation.InnerAuth;
|
||||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||||
import com.muyu.common.system.domain.SysOperLog;
|
import com.muyu.common.system.domain.SysOperLog;
|
||||||
import com.muyu.system.service.SysOperLogService;
|
import com.muyu.system.service.SysOperLogService;
|
||||||
<<<<<<< HEAD
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
=======
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
@ -28,11 +24,7 @@ import java.util.List;
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/operlog")
|
@RequestMapping("/operlog")
|
||||||
public class SysOperlogController extends BaseController {
|
public class SysOperlogController extends BaseController {
|
||||||
<<<<<<< HEAD
|
|
||||||
@Resource
|
@Resource
|
||||||
=======
|
|
||||||
@Autowired
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
private SysOperLogService operLogService;
|
private SysOperLogService operLogService;
|
||||||
|
|
||||||
@RequiresPermissions("system:operlog:list")
|
@RequiresPermissions("system:operlog:list")
|
||||||
|
|
|
@ -10,11 +10,7 @@ import com.muyu.common.security.annotation.RequiresPermissions;
|
||||||
import com.muyu.common.security.utils.SecurityUtils;
|
import com.muyu.common.security.utils.SecurityUtils;
|
||||||
import com.muyu.system.domain.SysPost;
|
import com.muyu.system.domain.SysPost;
|
||||||
import com.muyu.system.service.SysPostService;
|
import com.muyu.system.service.SysPostService;
|
||||||
<<<<<<< HEAD
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
=======
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
@ -29,11 +25,7 @@ import java.util.List;
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/post")
|
@RequestMapping("/post")
|
||||||
public class SysPostController extends BaseController {
|
public class SysPostController extends BaseController {
|
||||||
<<<<<<< HEAD
|
|
||||||
@Resource
|
@Resource
|
||||||
=======
|
|
||||||
@Autowired
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
private SysPostService postService;
|
private SysPostService postService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
package com.muyu.system.controller;
|
package com.muyu.system.controller;
|
||||||
|
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
<<<<<<< HEAD
|
|
||||||
import com.muyu.common.core.utils.ServletUtils;
|
import com.muyu.common.core.utils.ServletUtils;
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import com.muyu.common.core.utils.StringUtils;
|
import com.muyu.common.core.utils.StringUtils;
|
||||||
import com.muyu.common.core.utils.file.FileTypeUtils;
|
import com.muyu.common.core.utils.file.FileTypeUtils;
|
||||||
import com.muyu.common.core.utils.file.MimeTypeUtils;
|
import com.muyu.common.core.utils.file.MimeTypeUtils;
|
||||||
|
@ -19,19 +16,12 @@ import com.muyu.common.system.domain.SysUser;
|
||||||
import com.muyu.common.system.domain.LoginUser;
|
import com.muyu.common.system.domain.LoginUser;
|
||||||
import com.muyu.system.domain.resp.ProfileResp;
|
import com.muyu.system.domain.resp.ProfileResp;
|
||||||
import com.muyu.system.service.SysUserService;
|
import com.muyu.system.service.SysUserService;
|
||||||
<<<<<<< HEAD
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
=======
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -42,7 +32,6 @@ import java.util.Arrays;
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/user/profile")
|
@RequestMapping("/user/profile")
|
||||||
public class SysProfileController extends BaseController {
|
public class SysProfileController extends BaseController {
|
||||||
<<<<<<< HEAD
|
|
||||||
@Resource
|
@Resource
|
||||||
private SysUserService userService;
|
private SysUserService userService;
|
||||||
|
|
||||||
|
@ -53,30 +42,14 @@ public class SysProfileController extends BaseController {
|
||||||
private RemoteFileService remoteFileService;
|
private RemoteFileService remoteFileService;
|
||||||
|
|
||||||
|
|
||||||
=======
|
|
||||||
@Autowired
|
|
||||||
private SysUserService userService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private TokenService tokenService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private RemoteFileService remoteFileService;
|
|
||||||
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
/**
|
/**
|
||||||
* 个人信息
|
* 个人信息
|
||||||
*/
|
*/
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public Result profile () {
|
public Result profile () {
|
||||||
<<<<<<< HEAD
|
|
||||||
String firmCode = SecurityUtils.getSaasKey();
|
String firmCode = SecurityUtils.getSaasKey();
|
||||||
String username = SecurityUtils.getUsername();
|
String username = SecurityUtils.getUsername();
|
||||||
SysUser user = userService.selectUserByUserName(firmCode, username);
|
SysUser user = userService.selectUserByUserName(firmCode, username);
|
||||||
=======
|
|
||||||
String username = SecurityUtils.getUsername();
|
|
||||||
SysUser user = userService.selectUserByUserName(username);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
return Result.success(
|
return Result.success(
|
||||||
ProfileResp.builder()
|
ProfileResp.builder()
|
||||||
.roleGroup( userService.selectUserRoleGroup(username) )
|
.roleGroup( userService.selectUserRoleGroup(username) )
|
||||||
|
@ -118,14 +91,9 @@ public class SysProfileController extends BaseController {
|
||||||
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
|
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping("/updatePwd")
|
@PutMapping("/updatePwd")
|
||||||
public Result updatePwd (String oldPassword, String newPassword) {
|
public Result updatePwd (String oldPassword, String newPassword) {
|
||||||
<<<<<<< HEAD
|
|
||||||
String firmCode = SecurityUtils.getSaasKey();
|
String firmCode = SecurityUtils.getSaasKey();
|
||||||
String username = SecurityUtils.getUsername();
|
String username = SecurityUtils.getUsername();
|
||||||
SysUser user = userService.selectUserByUserName(firmCode, username);
|
SysUser user = userService.selectUserByUserName(firmCode, username);
|
||||||
=======
|
|
||||||
String username = SecurityUtils.getUsername();
|
|
||||||
SysUser user = userService.selectUserByUserName(username);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
String password = user.getPassword();
|
String password = user.getPassword();
|
||||||
if (!SecurityUtils.matchesPassword(oldPassword, password)) {
|
if (!SecurityUtils.matchesPassword(oldPassword, password)) {
|
||||||
return error("修改密码失败,旧密码错误");
|
return error("修改密码失败,旧密码错误");
|
||||||
|
|
|
@ -11,20 +11,12 @@ import com.muyu.common.security.utils.SecurityUtils;
|
||||||
import com.muyu.common.system.domain.SysDept;
|
import com.muyu.common.system.domain.SysDept;
|
||||||
import com.muyu.common.system.domain.SysRole;
|
import com.muyu.common.system.domain.SysRole;
|
||||||
import com.muyu.common.system.domain.SysUser;
|
import com.muyu.common.system.domain.SysUser;
|
||||||
<<<<<<< HEAD
|
|
||||||
import com.muyu.common.system.domain.SysUserRole;
|
import com.muyu.common.system.domain.SysUserRole;
|
||||||
=======
|
|
||||||
import com.muyu.system.domain.SysUserRole;
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import com.muyu.system.domain.resp.DeptTreeResp;
|
import com.muyu.system.domain.resp.DeptTreeResp;
|
||||||
import com.muyu.system.service.SysDeptService;
|
import com.muyu.system.service.SysDeptService;
|
||||||
import com.muyu.system.service.SysRoleService;
|
import com.muyu.system.service.SysRoleService;
|
||||||
import com.muyu.system.service.SysUserService;
|
import com.muyu.system.service.SysUserService;
|
||||||
<<<<<<< HEAD
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
=======
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
@ -39,7 +31,6 @@ import java.util.List;
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/role")
|
@RequestMapping("/role")
|
||||||
public class SysRoleController extends BaseController {
|
public class SysRoleController extends BaseController {
|
||||||
<<<<<<< HEAD
|
|
||||||
@Resource
|
@Resource
|
||||||
private SysRoleService roleService;
|
private SysRoleService roleService;
|
||||||
|
|
||||||
|
@ -47,25 +38,13 @@ public class SysRoleController extends BaseController {
|
||||||
private SysUserService userService;
|
private SysUserService userService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
=======
|
|
||||||
@Autowired
|
|
||||||
private SysRoleService roleService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private SysUserService userService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
private SysDeptService deptService;
|
private SysDeptService deptService;
|
||||||
|
|
||||||
@RequiresPermissions("system:role:list")
|
@RequiresPermissions("system:role:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public Result<TableDataInfo<SysRole>> list (SysRole role) {
|
public Result<TableDataInfo<SysRole>> list (SysRole role) {
|
||||||
startPage();
|
startPage();
|
||||||
<<<<<<< HEAD
|
|
||||||
role.setFirmCode(SecurityUtils.getSaasKey());
|
role.setFirmCode(SecurityUtils.getSaasKey());
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
List<SysRole> list = roleService.selectRoleList(role);
|
List<SysRole> list = roleService.selectRoleList(role);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
@ -96,10 +75,7 @@ public class SysRoleController extends BaseController {
|
||||||
@Log(title = "角色管理", businessType = BusinessType.INSERT)
|
@Log(title = "角色管理", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public Result add (@Validated @RequestBody SysRole role) {
|
public Result add (@Validated @RequestBody SysRole role) {
|
||||||
<<<<<<< HEAD
|
|
||||||
role.setFirmCode(SecurityUtils.getSaasKey());
|
role.setFirmCode(SecurityUtils.getSaasKey());
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
if (!roleService.checkRoleNameUnique(role)) {
|
if (!roleService.checkRoleNameUnique(role)) {
|
||||||
return error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在");
|
return error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在");
|
||||||
} else if (!roleService.checkRoleKeyUnique(role)) {
|
} else if (!roleService.checkRoleKeyUnique(role)) {
|
||||||
|
@ -169,13 +145,9 @@ public class SysRoleController extends BaseController {
|
||||||
@RequiresPermissions("system:role:query")
|
@RequiresPermissions("system:role:query")
|
||||||
@GetMapping("/optionselect")
|
@GetMapping("/optionselect")
|
||||||
public Result optionselect () {
|
public Result optionselect () {
|
||||||
<<<<<<< HEAD
|
|
||||||
SysRole role = new SysRole();
|
SysRole role = new SysRole();
|
||||||
role.setFirmCode(SecurityUtils.getSaasKey());
|
role.setFirmCode(SecurityUtils.getSaasKey());
|
||||||
return success(roleService.selectRoleAll(role));
|
return success(roleService.selectRoleAll(role));
|
||||||
=======
|
|
||||||
return success(roleService.selectRoleAll());
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -19,12 +19,8 @@ import com.muyu.system.domain.resp.UserDetailInfoResp;
|
||||||
import com.muyu.system.domain.resp.UserInfoResp;
|
import com.muyu.system.domain.resp.UserInfoResp;
|
||||||
import com.muyu.system.service.*;
|
import com.muyu.system.service.*;
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
<<<<<<< HEAD
|
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
=======
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
@ -35,24 +31,16 @@ import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* sys用户控制器
|
* sys用户控制器
|
||||||
*
|
*
|
||||||
* @author 胡杨
|
* @author 胡杨
|
||||||
* @date 2024/09/25
|
* @date 2024/09/25
|
||||||
=======
|
|
||||||
/**
|
|
||||||
* 用户信息
|
|
||||||
*
|
|
||||||
* @author muyu
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/user")
|
@RequestMapping("/user")
|
||||||
public class SysUserController extends BaseController {
|
public class SysUserController extends BaseController {
|
||||||
<<<<<<< HEAD
|
|
||||||
@Resource
|
@Resource
|
||||||
private SysUserService userService;
|
private SysUserService userService;
|
||||||
|
|
||||||
|
@ -70,24 +58,6 @@ public class SysUserController extends BaseController {
|
||||||
private SysPermissionService permissionService;
|
private SysPermissionService permissionService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
=======
|
|
||||||
@Autowired
|
|
||||||
private SysUserService userService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private SysRoleService roleService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private SysDeptService deptService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private SysPostService postService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private SysPermissionService permissionService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
private SysConfigService configService;
|
private SysConfigService configService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -97,15 +67,11 @@ public class SysUserController extends BaseController {
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public Result<TableDataInfo<SysUser>> list (SysUser user) {
|
public Result<TableDataInfo<SysUser>> list (SysUser user) {
|
||||||
startPage();
|
startPage();
|
||||||
<<<<<<< HEAD
|
|
||||||
user.setFirmCode(SecurityUtils.getSaasKey());
|
user.setFirmCode(SecurityUtils.getSaasKey());
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
List<SysUser> list = userService.selectUserList(user);
|
List<SysUser> list = userService.selectUserList(user);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
/**
|
/**
|
||||||
* 公司集合
|
* 公司集合
|
||||||
*/
|
*/
|
||||||
|
@ -115,8 +81,6 @@ public class SysUserController extends BaseController {
|
||||||
return Result.success(list);
|
return Result.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
|
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
|
||||||
@RequiresPermissions("system:user:export")
|
@RequiresPermissions("system:user:export")
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
|
@ -147,15 +111,9 @@ public class SysUserController extends BaseController {
|
||||||
* 获取当前用户信息
|
* 获取当前用户信息
|
||||||
*/
|
*/
|
||||||
@InnerAuth
|
@InnerAuth
|
||||||
<<<<<<< HEAD
|
|
||||||
@GetMapping("/info")
|
@GetMapping("/info")
|
||||||
public Result<LoginUser> info (@RequestParam("firmCode") String firmCode,@RequestParam("userName") String userName) {
|
public Result<LoginUser> info (@RequestParam("firmCode") String firmCode,@RequestParam("userName") String userName) {
|
||||||
SysUser sysUser = userService.selectUserByUserName(firmCode, userName);
|
SysUser sysUser = userService.selectUserByUserName(firmCode, userName);
|
||||||
=======
|
|
||||||
@GetMapping("/info/{username}")
|
|
||||||
public Result<LoginUser> info (@PathVariable("username") String username) {
|
|
||||||
SysUser sysUser = userService.selectUserByUserName(username);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
if (StringUtils.isNull(sysUser)) {
|
if (StringUtils.isNull(sysUser)) {
|
||||||
return Result.error("用户名或密码错误");
|
return Result.error("用户名或密码错误");
|
||||||
}
|
}
|
||||||
|
@ -214,7 +172,6 @@ public class SysUserController extends BaseController {
|
||||||
@RequiresPermissions("system:user:query")
|
@RequiresPermissions("system:user:query")
|
||||||
@GetMapping(value = {"/", "/{userId}"})
|
@GetMapping(value = {"/", "/{userId}"})
|
||||||
public Result getInfo (@PathVariable(value = "userId", required = false) Long userId) {
|
public Result getInfo (@PathVariable(value = "userId", required = false) Long userId) {
|
||||||
<<<<<<< HEAD
|
|
||||||
SysUser user = userService.selectUserById(userId);
|
SysUser user = userService.selectUserById(userId);
|
||||||
UserDetailInfoResp.UserDetailInfoRespBuilder<?, ?> builder = UserDetailInfoResp.builder();
|
UserDetailInfoResp.UserDetailInfoRespBuilder<?, ?> builder = UserDetailInfoResp.builder();
|
||||||
SysRole role = new SysRole();
|
SysRole role = new SysRole();
|
||||||
|
@ -222,11 +179,6 @@ public class SysUserController extends BaseController {
|
||||||
role.setFirmCode(user.getFirmCode());
|
role.setFirmCode(user.getFirmCode());
|
||||||
}
|
}
|
||||||
List<SysRole> roles = roleService.selectRoleAll(role);
|
List<SysRole> roles = roleService.selectRoleAll(role);
|
||||||
=======
|
|
||||||
userService.checkUserDataScope(userId);
|
|
||||||
UserDetailInfoResp.UserDetailInfoRespBuilder<?, ?> builder = UserDetailInfoResp.builder();
|
|
||||||
List<SysRole> roles = roleService.selectRoleAll();
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
builder.roles(
|
builder.roles(
|
||||||
SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList())
|
SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList())
|
||||||
)
|
)
|
||||||
|
@ -257,7 +209,6 @@ public class SysUserController extends BaseController {
|
||||||
}
|
}
|
||||||
user.setCreateBy(SecurityUtils.getUsername());
|
user.setCreateBy(SecurityUtils.getUsername());
|
||||||
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
||||||
<<<<<<< HEAD
|
|
||||||
|
|
||||||
String saasKey = SecurityUtils.getSaasKey();
|
String saasKey = SecurityUtils.getSaasKey();
|
||||||
if ("FIRM".equals(saasKey)) {
|
if ("FIRM".equals(saasKey)) {
|
||||||
|
@ -266,13 +217,10 @@ public class SysUserController extends BaseController {
|
||||||
}else {
|
}else {
|
||||||
user.setFirmCode(saasKey);
|
user.setFirmCode(saasKey);
|
||||||
}
|
}
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
return toAjax(userService.insertUser(user));
|
return toAjax(userService.insertUser(user));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
<<<<<<< HEAD
|
|
||||||
* 新增用户角色信息
|
* 新增用户角色信息
|
||||||
*
|
*
|
||||||
* @param user 用户对象
|
* @param user 用户对象
|
||||||
|
@ -293,8 +241,6 @@ public class SysUserController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
* 修改用户
|
* 修改用户
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("system:user:edit")
|
@RequiresPermissions("system:user:edit")
|
||||||
|
@ -361,11 +307,7 @@ public class SysUserController extends BaseController {
|
||||||
@GetMapping("/authRole/{userId}")
|
@GetMapping("/authRole/{userId}")
|
||||||
public Result authRole (@PathVariable("userId") Long userId) {
|
public Result authRole (@PathVariable("userId") Long userId) {
|
||||||
SysUser user = userService.selectUserById(userId);
|
SysUser user = userService.selectUserById(userId);
|
||||||
<<<<<<< HEAD
|
|
||||||
List<SysRole> roles = roleService.selectRolesByUserId(user.getFirmCode(), userId);
|
List<SysRole> roles = roleService.selectRolesByUserId(user.getFirmCode(), userId);
|
||||||
=======
|
|
||||||
List<SysRole> roles = roleService.selectRolesByUserId(userId);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
return Result.success(
|
return Result.success(
|
||||||
AuthRoleResp.builder()
|
AuthRoleResp.builder()
|
||||||
.roles(SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()))
|
.roles(SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()))
|
||||||
|
@ -380,11 +322,7 @@ public class SysUserController extends BaseController {
|
||||||
@RequiresPermissions("system:user:edit")
|
@RequiresPermissions("system:user:edit")
|
||||||
@Log(title = "用户管理", businessType = BusinessType.GRANT)
|
@Log(title = "用户管理", businessType = BusinessType.GRANT)
|
||||||
@PutMapping("/authRole")
|
@PutMapping("/authRole")
|
||||||
<<<<<<< HEAD
|
|
||||||
public Result insertAuthRole (@RequestParam("userId") Long userId, @RequestParam("roleIds") Long[] roleIds) {
|
public Result insertAuthRole (@RequestParam("userId") Long userId, @RequestParam("roleIds") Long[] roleIds) {
|
||||||
=======
|
|
||||||
public Result insertAuthRole (Long userId, Long[] roleIds) {
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
userService.checkUserDataScope(userId);
|
userService.checkUserDataScope(userId);
|
||||||
userService.insertUserAuth(userId, roleIds);
|
userService.insertUserAuth(userId, roleIds);
|
||||||
return success();
|
return success();
|
||||||
|
|
|
@ -12,11 +12,7 @@ import com.muyu.common.security.annotation.RequiresPermissions;
|
||||||
import com.muyu.common.system.domain.LoginUser;
|
import com.muyu.common.system.domain.LoginUser;
|
||||||
import com.muyu.system.domain.SysUserOnline;
|
import com.muyu.system.domain.SysUserOnline;
|
||||||
import com.muyu.system.service.SysUserOnlineService;
|
import com.muyu.system.service.SysUserOnlineService;
|
||||||
<<<<<<< HEAD
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
=======
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -32,17 +28,10 @@ import java.util.List;
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/online")
|
@RequestMapping("/online")
|
||||||
public class SysUserOnlineController extends BaseController {
|
public class SysUserOnlineController extends BaseController {
|
||||||
<<<<<<< HEAD
|
|
||||||
@Resource
|
@Resource
|
||||||
private SysUserOnlineService userOnlineService;
|
private SysUserOnlineService userOnlineService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
=======
|
|
||||||
@Autowired
|
|
||||||
private SysUserOnlineService userOnlineService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
private RedisService redisService;
|
private RedisService redisService;
|
||||||
|
|
||||||
@RequiresPermissions("monitor:online:list")
|
@RequiresPermissions("monitor:online:list")
|
||||||
|
|
|
@ -128,9 +128,6 @@ public interface SysDeptMapper extends BaseMapper<SysDept> {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteDeptById (Long deptId);
|
public int deleteDeptById (Long deptId);
|
||||||
<<<<<<< HEAD
|
|
||||||
|
|
||||||
int updateDeptFirmCode(@Param("deptId") Long deptId);
|
int updateDeptFirmCode(@Param("deptId") Long deptId);
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,10 +2,7 @@ package com.muyu.system.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.muyu.common.system.domain.SysRole;
|
import com.muyu.common.system.domain.SysRole;
|
||||||
<<<<<<< HEAD
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -31,11 +28,7 @@ public interface SysRoleMapper extends BaseMapper<SysRole> {
|
||||||
*
|
*
|
||||||
* @return 角色列表
|
* @return 角色列表
|
||||||
*/
|
*/
|
||||||
<<<<<<< HEAD
|
|
||||||
public List<SysRole> selectRolePermissionByUserId (@Param("firmCode") String firmCode, @Param("userId") Long userId);
|
public List<SysRole> selectRolePermissionByUserId (@Param("firmCode") String firmCode, @Param("userId") Long userId);
|
||||||
=======
|
|
||||||
public List<SysRole> selectRolePermissionByUserId (Long userId);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询所有角色
|
* 查询所有角色
|
||||||
|
@ -78,11 +71,7 @@ public interface SysRoleMapper extends BaseMapper<SysRole> {
|
||||||
*
|
*
|
||||||
* @return 角色信息
|
* @return 角色信息
|
||||||
*/
|
*/
|
||||||
<<<<<<< HEAD
|
|
||||||
public SysRole checkRoleNameUnique (@Param("firmCode") String firmCode, @Param("roleName") String roleName);
|
public SysRole checkRoleNameUnique (@Param("firmCode") String firmCode, @Param("roleName") String roleName);
|
||||||
=======
|
|
||||||
public SysRole checkRoleNameUnique (String roleName);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验角色权限是否唯一
|
* 校验角色权限是否唯一
|
||||||
|
|
|
@ -46,11 +46,7 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
|
||||||
*
|
*
|
||||||
* @return 用户对象信息
|
* @return 用户对象信息
|
||||||
*/
|
*/
|
||||||
<<<<<<< HEAD
|
|
||||||
public SysUser selectUserByUserName (@Param("firmCode") String firmCode, @Param("userName") String userName);
|
public SysUser selectUserByUserName (@Param("firmCode") String firmCode, @Param("userName") String userName);
|
||||||
=======
|
|
||||||
public SysUser selectUserByUserName (String userName);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过用户ID查询用户
|
* 通过用户ID查询用户
|
||||||
|
@ -143,10 +139,7 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public SysUser checkEmailUnique (String email);
|
public SysUser checkEmailUnique (String email);
|
||||||
<<<<<<< HEAD
|
|
||||||
|
|
||||||
List<SysUser> selectCompanyList();
|
List<SysUser> selectCompanyList();
|
||||||
|
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,7 @@
|
||||||
package com.muyu.system.mapper;
|
package com.muyu.system.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
<<<<<<< HEAD
|
|
||||||
import com.muyu.common.system.domain.SysUserPost;
|
import com.muyu.common.system.domain.SysUserPost;
|
||||||
=======
|
|
||||||
import com.muyu.system.domain.SysUserPost;
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,7 @@
|
||||||
package com.muyu.system.mapper;
|
package com.muyu.system.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
<<<<<<< HEAD
|
|
||||||
import com.muyu.common.system.domain.SysUserRole;
|
import com.muyu.common.system.domain.SysUserRole;
|
||||||
=======
|
|
||||||
import com.muyu.system.domain.SysUserRole;
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
<<<<<<< HEAD
|
|
||||||
//package com.muyu.system.rabbit;
|
//package com.muyu.system.rabbit;
|
||||||
//
|
//
|
||||||
//import com.alibaba.fastjson2.JSONObject;
|
//import com.alibaba.fastjson2.JSONObject;
|
||||||
|
@ -52,58 +51,3 @@
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
//}
|
//}
|
||||||
=======
|
|
||||||
package com.muyu.system.rabbit;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
|
||||||
import com.muyu.system.domain.SysConfig;
|
|
||||||
import jakarta.annotation.PostConstruct;
|
|
||||||
import lombok.extern.log4j.Log4j2;
|
|
||||||
import org.springframework.amqp.core.Queue;
|
|
||||||
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
|
|
||||||
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
|
||||||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
@Log4j2
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/rabbit/test")
|
|
||||||
public class RabbitTest {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private RabbitTemplate rabbitTemplate;
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
public Queue initQueue(){
|
|
||||||
return new Queue("rabbit.test.init");
|
|
||||||
}
|
|
||||||
|
|
||||||
@RabbitListener(queues = "rabbit.test.init")
|
|
||||||
public void msg(SysConfig sysConfig){
|
|
||||||
log.info("消息队列:[{}], 消息内容:[{}]", "rabbit.test.init", JSONObject.toJSONString(sysConfig));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostConstruct
|
|
||||||
public void init(){
|
|
||||||
new Thread(() -> {
|
|
||||||
try {
|
|
||||||
Thread.sleep(5000);
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
SysConfig sysConfig = SysConfig.builder()
|
|
||||||
.configId(1L)
|
|
||||||
.configKey("ceshi-key")
|
|
||||||
.configName("测试名称")
|
|
||||||
.configType("测试类型")
|
|
||||||
.configValue("测试值")
|
|
||||||
.build();
|
|
||||||
rabbitTemplate.convertAndSend("rabbit.test.init",sysConfig);
|
|
||||||
}).start();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
|
@ -6,16 +6,10 @@ import com.muyu.system.domain.SysConfig;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
<<<<<<< HEAD
|
|
||||||
* 系统配置服务
|
* 系统配置服务
|
||||||
*
|
*
|
||||||
* @author DongZl
|
* @author DongZl
|
||||||
* @date 2024/09/25
|
* @date 2024/09/25
|
||||||
=======
|
|
||||||
* @author DongZl
|
|
||||||
* @description: 配置plus业务层
|
|
||||||
* @Date 2023-11-13 上午 10:06
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
*/
|
*/
|
||||||
public interface SysConfigService extends IService<SysConfig> {
|
public interface SysConfigService extends IService<SysConfig> {
|
||||||
List<SysConfig> pageQuery (SysConfig config);
|
List<SysConfig> pageQuery (SysConfig config);
|
||||||
|
|
|
@ -2,11 +2,7 @@ package com.muyu.system.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.muyu.common.system.domain.SysRole;
|
import com.muyu.common.system.domain.SysRole;
|
||||||
<<<<<<< HEAD
|
|
||||||
import com.muyu.common.system.domain.SysUserRole;
|
import com.muyu.common.system.domain.SysUserRole;
|
||||||
=======
|
|
||||||
import com.muyu.system.domain.SysUserRole;
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
@ -33,11 +29,7 @@ public interface SysRoleService extends IService<SysRole> {
|
||||||
*
|
*
|
||||||
* @return 角色列表
|
* @return 角色列表
|
||||||
*/
|
*/
|
||||||
<<<<<<< HEAD
|
|
||||||
public List<SysRole> selectRolesByUserId (String firmCode, Long userId);
|
public List<SysRole> selectRolesByUserId (String firmCode, Long userId);
|
||||||
=======
|
|
||||||
public List<SysRole> selectRolesByUserId (Long userId);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户ID查询角色权限
|
* 根据用户ID查询角色权限
|
||||||
|
@ -46,22 +38,14 @@ public interface SysRoleService extends IService<SysRole> {
|
||||||
*
|
*
|
||||||
* @return 权限列表
|
* @return 权限列表
|
||||||
*/
|
*/
|
||||||
<<<<<<< HEAD
|
|
||||||
public Set<String> selectRolePermissionByUserId (String firmCode, Long userId);
|
public Set<String> selectRolePermissionByUserId (String firmCode, Long userId);
|
||||||
=======
|
|
||||||
public Set<String> selectRolePermissionByUserId (Long userId);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询所有角色
|
* 查询所有角色
|
||||||
*
|
*
|
||||||
* @return 角色列表
|
* @return 角色列表
|
||||||
*/
|
*/
|
||||||
<<<<<<< HEAD
|
|
||||||
public List<SysRole> selectRoleAll (SysRole role);
|
public List<SysRole> selectRoleAll (SysRole role);
|
||||||
=======
|
|
||||||
public List<SysRole> selectRoleAll ();
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户ID获取角色选择框列表
|
* 根据用户ID获取角色选择框列表
|
||||||
|
|
|
@ -45,12 +45,8 @@ public interface SysUserService extends IService<SysUser> {
|
||||||
*
|
*
|
||||||
* @return 用户对象信息
|
* @return 用户对象信息
|
||||||
*/
|
*/
|
||||||
<<<<<<< HEAD
|
|
||||||
public SysUser selectUserByUserName (String firmCode, String userName);
|
public SysUser selectUserByUserName (String firmCode, String userName);
|
||||||
|
|
||||||
=======
|
|
||||||
public SysUser selectUserByUserName (String userName);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过用户ID查询用户
|
* 通过用户ID查询用户
|
||||||
|
@ -230,7 +226,6 @@ public interface SysUserService extends IService<SysUser> {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public String importUser (List<SysUser> userList, Boolean isUpdateSupport, String operName);
|
public String importUser (List<SysUser> userList, Boolean isUpdateSupport, String operName);
|
||||||
<<<<<<< HEAD
|
|
||||||
|
|
||||||
List<SysUser> selectCompanyList();
|
List<SysUser> selectCompanyList();
|
||||||
|
|
||||||
|
@ -238,6 +233,4 @@ public interface SysUserService extends IService<SysUser> {
|
||||||
|
|
||||||
void insertUserRole(SysUser user);
|
void insertUserRole(SysUser user);
|
||||||
|
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,11 +8,7 @@ import com.muyu.common.redis.service.RedisService;
|
||||||
import com.muyu.system.domain.SysConfig;
|
import com.muyu.system.domain.SysConfig;
|
||||||
import com.muyu.system.mapper.SysConfigMapper;
|
import com.muyu.system.mapper.SysConfigMapper;
|
||||||
import com.muyu.system.service.SysConfigService;
|
import com.muyu.system.service.SysConfigService;
|
||||||
<<<<<<< HEAD
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
=======
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
|
|
||||||
|
@ -30,11 +26,7 @@ import java.util.Objects;
|
||||||
public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig>
|
public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig>
|
||||||
implements SysConfigService {
|
implements SysConfigService {
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
@Resource
|
@Resource
|
||||||
=======
|
|
||||||
@Autowired
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
private RedisService redisService;
|
private RedisService redisService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -15,14 +15,9 @@ import com.muyu.system.domain.vo.TreeSelect;
|
||||||
import com.muyu.system.mapper.SysDeptMapper;
|
import com.muyu.system.mapper.SysDeptMapper;
|
||||||
import com.muyu.system.mapper.SysRoleMapper;
|
import com.muyu.system.mapper.SysRoleMapper;
|
||||||
import com.muyu.system.service.SysDeptService;
|
import com.muyu.system.service.SysDeptService;
|
||||||
<<<<<<< HEAD
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
=======
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
@ -36,17 +31,10 @@ import java.util.stream.Collectors;
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> implements SysDeptService {
|
public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> implements SysDeptService {
|
||||||
<<<<<<< HEAD
|
|
||||||
@Resource
|
@Resource
|
||||||
private SysDeptMapper deptMapper;
|
private SysDeptMapper deptMapper;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
=======
|
|
||||||
@Autowired
|
|
||||||
private SysDeptMapper deptMapper;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
private SysRoleMapper roleMapper;
|
private SysRoleMapper roleMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -217,10 +205,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
<<<<<<< HEAD
|
|
||||||
@Transactional
|
@Transactional
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
public int insertDept (SysDept dept) {
|
public int insertDept (SysDept dept) {
|
||||||
SysDept info = deptMapper.selectDeptById(dept.getParentId());
|
SysDept info = deptMapper.selectDeptById(dept.getParentId());
|
||||||
// 如果父节点不为正常状态,则不允许新增子节点
|
// 如果父节点不为正常状态,则不允许新增子节点
|
||||||
|
@ -228,13 +213,9 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
|
||||||
throw new ServiceException("部门停用,不允许新增");
|
throw new ServiceException("部门停用,不允许新增");
|
||||||
}
|
}
|
||||||
dept.setAncestors(info.getAncestors() + "," + dept.getParentId());
|
dept.setAncestors(info.getAncestors() + "," + dept.getParentId());
|
||||||
<<<<<<< HEAD
|
|
||||||
deptMapper.insertDept(dept);
|
deptMapper.insertDept(dept);
|
||||||
// 修改saas编码
|
// 修改saas编码
|
||||||
return deptMapper.updateDeptFirmCode(dept.getDeptId());
|
return deptMapper.updateDeptFirmCode(dept.getDeptId());
|
||||||
=======
|
|
||||||
return deptMapper.insertDept(dept);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -5,11 +5,7 @@ import com.muyu.common.security.utils.DictUtils;
|
||||||
import com.muyu.common.system.domain.SysDictData;
|
import com.muyu.common.system.domain.SysDictData;
|
||||||
import com.muyu.system.mapper.SysDictDataMapper;
|
import com.muyu.system.mapper.SysDictDataMapper;
|
||||||
import com.muyu.system.service.SysDictDataService;
|
import com.muyu.system.service.SysDictDataService;
|
||||||
<<<<<<< HEAD
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
=======
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -21,11 +17,7 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class SysDictDataServiceImpl extends ServiceImpl<SysDictDataMapper, SysDictData> implements SysDictDataService {
|
public class SysDictDataServiceImpl extends ServiceImpl<SysDictDataMapper, SysDictData> implements SysDictDataService {
|
||||||
<<<<<<< HEAD
|
|
||||||
@Resource
|
@Resource
|
||||||
=======
|
|
||||||
@Autowired
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
private SysDictDataMapper dictDataMapper;
|
private SysDictDataMapper dictDataMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -10,11 +10,7 @@ import com.muyu.common.system.domain.SysDictType;
|
||||||
import com.muyu.system.mapper.SysDictDataMapper;
|
import com.muyu.system.mapper.SysDictDataMapper;
|
||||||
import com.muyu.system.mapper.SysDictTypeMapper;
|
import com.muyu.system.mapper.SysDictTypeMapper;
|
||||||
import com.muyu.system.service.SysDictTypeService;
|
import com.muyu.system.service.SysDictTypeService;
|
||||||
<<<<<<< HEAD
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
=======
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
@ -31,17 +27,10 @@ import java.util.stream.Collectors;
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class SysDictTypeServiceImpl extends ServiceImpl<SysDictTypeMapper, SysDictType> implements SysDictTypeService {
|
public class SysDictTypeServiceImpl extends ServiceImpl<SysDictTypeMapper, SysDictType> implements SysDictTypeService {
|
||||||
<<<<<<< HEAD
|
|
||||||
@Resource
|
@Resource
|
||||||
private SysDictTypeMapper dictTypeMapper;
|
private SysDictTypeMapper dictTypeMapper;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
=======
|
|
||||||
@Autowired
|
|
||||||
private SysDictTypeMapper dictTypeMapper;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
private SysDictDataMapper dictDataMapper;
|
private SysDictDataMapper dictDataMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -4,11 +4,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.muyu.common.system.domain.SysLogininfor;
|
import com.muyu.common.system.domain.SysLogininfor;
|
||||||
import com.muyu.system.mapper.SysLogininforMapper;
|
import com.muyu.system.mapper.SysLogininforMapper;
|
||||||
import com.muyu.system.service.SysLogininforService;
|
import com.muyu.system.service.SysLogininforService;
|
||||||
<<<<<<< HEAD
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
=======
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -21,11 +17,7 @@ import java.util.List;
|
||||||
@Service
|
@Service
|
||||||
public class SysLogininforServiceImpl extends ServiceImpl<SysLogininforMapper, SysLogininfor> implements SysLogininforService {
|
public class SysLogininforServiceImpl extends ServiceImpl<SysLogininforMapper, SysLogininfor> implements SysLogininforService {
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
@Resource
|
@Resource
|
||||||
=======
|
|
||||||
@Autowired
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
private SysLogininforMapper logininforMapper;
|
private SysLogininforMapper logininforMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -15,11 +15,7 @@ import com.muyu.system.mapper.SysMenuMapper;
|
||||||
import com.muyu.system.mapper.SysRoleMapper;
|
import com.muyu.system.mapper.SysRoleMapper;
|
||||||
import com.muyu.system.mapper.SysRoleMenuMapper;
|
import com.muyu.system.mapper.SysRoleMenuMapper;
|
||||||
import com.muyu.system.service.SysMenuService;
|
import com.muyu.system.service.SysMenuService;
|
||||||
<<<<<<< HEAD
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
=======
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
@ -34,7 +30,6 @@ import java.util.stream.Collectors;
|
||||||
public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> implements SysMenuService {
|
public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> implements SysMenuService {
|
||||||
public static final String PREMISSION_STRING = "perms[\"{0}\"]";
|
public static final String PREMISSION_STRING = "perms[\"{0}\"]";
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
@Resource
|
@Resource
|
||||||
private SysMenuMapper menuMapper;
|
private SysMenuMapper menuMapper;
|
||||||
|
|
||||||
|
@ -42,15 +37,6 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
||||||
private SysRoleMapper roleMapper;
|
private SysRoleMapper roleMapper;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
=======
|
|
||||||
@Autowired
|
|
||||||
private SysMenuMapper menuMapper;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private SysRoleMapper roleMapper;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
private SysRoleMenuMapper roleMenuMapper;
|
private SysRoleMenuMapper roleMenuMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -4,11 +4,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.muyu.system.domain.SysNotice;
|
import com.muyu.system.domain.SysNotice;
|
||||||
import com.muyu.system.mapper.SysNoticeMapper;
|
import com.muyu.system.mapper.SysNoticeMapper;
|
||||||
import com.muyu.system.service.SysNoticeService;
|
import com.muyu.system.service.SysNoticeService;
|
||||||
<<<<<<< HEAD
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
=======
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -20,11 +16,7 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class SysNoticeServiceImpl extends ServiceImpl<SysNoticeMapper, SysNotice> implements SysNoticeService {
|
public class SysNoticeServiceImpl extends ServiceImpl<SysNoticeMapper, SysNotice> implements SysNoticeService {
|
||||||
<<<<<<< HEAD
|
|
||||||
@Resource
|
@Resource
|
||||||
=======
|
|
||||||
@Autowired
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
private SysNoticeMapper noticeMapper;
|
private SysNoticeMapper noticeMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -4,11 +4,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.muyu.common.system.domain.SysOperLog;
|
import com.muyu.common.system.domain.SysOperLog;
|
||||||
import com.muyu.system.mapper.SysOperLogMapper;
|
import com.muyu.system.mapper.SysOperLogMapper;
|
||||||
import com.muyu.system.service.SysOperLogService;
|
import com.muyu.system.service.SysOperLogService;
|
||||||
<<<<<<< HEAD
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
=======
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -20,11 +16,7 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class SysOperLogServiceImpl extends ServiceImpl<SysOperLogMapper, SysOperLog> implements SysOperLogService {
|
public class SysOperLogServiceImpl extends ServiceImpl<SysOperLogMapper, SysOperLog> implements SysOperLogService {
|
||||||
<<<<<<< HEAD
|
|
||||||
@Resource
|
@Resource
|
||||||
=======
|
|
||||||
@Autowired
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
private SysOperLogMapper operLogMapper;
|
private SysOperLogMapper operLogMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -6,11 +6,7 @@ import com.muyu.common.system.domain.SysUser;
|
||||||
import com.muyu.system.service.SysMenuService;
|
import com.muyu.system.service.SysMenuService;
|
||||||
import com.muyu.system.service.SysPermissionService;
|
import com.muyu.system.service.SysPermissionService;
|
||||||
import com.muyu.system.service.SysRoleService;
|
import com.muyu.system.service.SysRoleService;
|
||||||
<<<<<<< HEAD
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
=======
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
@ -25,27 +21,16 @@ import java.util.Set;
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class SysPermissionServiceImpl implements SysPermissionService {
|
public class SysPermissionServiceImpl implements SysPermissionService {
|
||||||
<<<<<<< HEAD
|
|
||||||
@Resource
|
@Resource
|
||||||
private SysRoleService roleService;
|
private SysRoleService roleService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
=======
|
|
||||||
@Autowired
|
|
||||||
private SysRoleService roleService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
private SysMenuService menuService;
|
private SysMenuService menuService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取角色数据权限
|
* 获取角色数据权限
|
||||||
*
|
*
|
||||||
<<<<<<< HEAD
|
|
||||||
* @param user 用户
|
* @param user 用户
|
||||||
=======
|
|
||||||
* @param userId 用户Id
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
*
|
*
|
||||||
* @return 角色权限信息
|
* @return 角色权限信息
|
||||||
*/
|
*/
|
||||||
|
@ -56,11 +41,7 @@ public class SysPermissionServiceImpl implements SysPermissionService {
|
||||||
if (user.isAdmin()) {
|
if (user.isAdmin()) {
|
||||||
roles.add("admin");
|
roles.add("admin");
|
||||||
} else {
|
} else {
|
||||||
<<<<<<< HEAD
|
|
||||||
roles.addAll(roleService.selectRolePermissionByUserId(user.getFirmCode(), user.getUserId()));
|
roles.addAll(roleService.selectRolePermissionByUserId(user.getFirmCode(), user.getUserId()));
|
||||||
=======
|
|
||||||
roles.addAll(roleService.selectRolePermissionByUserId(user.getUserId()));
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
}
|
}
|
||||||
return roles;
|
return roles;
|
||||||
}
|
}
|
||||||
|
@ -68,11 +49,7 @@ public class SysPermissionServiceImpl implements SysPermissionService {
|
||||||
/**
|
/**
|
||||||
* 获取菜单数据权限
|
* 获取菜单数据权限
|
||||||
*
|
*
|
||||||
<<<<<<< HEAD
|
|
||||||
* @param user 用户
|
* @param user 用户
|
||||||
=======
|
|
||||||
* @param userId 用户Id
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
*
|
*
|
||||||
* @return 菜单权限信息
|
* @return 菜单权限信息
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -8,11 +8,7 @@ import com.muyu.system.domain.SysPost;
|
||||||
import com.muyu.system.mapper.SysPostMapper;
|
import com.muyu.system.mapper.SysPostMapper;
|
||||||
import com.muyu.system.mapper.SysUserPostMapper;
|
import com.muyu.system.mapper.SysUserPostMapper;
|
||||||
import com.muyu.system.service.SysPostService;
|
import com.muyu.system.service.SysPostService;
|
||||||
<<<<<<< HEAD
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
=======
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -24,17 +20,10 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class SysPostServiceImpl extends ServiceImpl<SysPostMapper, SysPost> implements SysPostService {
|
public class SysPostServiceImpl extends ServiceImpl<SysPostMapper, SysPost> implements SysPostService {
|
||||||
<<<<<<< HEAD
|
|
||||||
@Resource
|
@Resource
|
||||||
private SysPostMapper postMapper;
|
private SysPostMapper postMapper;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
=======
|
|
||||||
@Autowired
|
|
||||||
private SysPostMapper postMapper;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
private SysUserPostMapper userPostMapper;
|
private SysUserPostMapper userPostMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -11,28 +11,17 @@ import com.muyu.common.system.domain.SysRole;
|
||||||
import com.muyu.common.system.domain.SysUser;
|
import com.muyu.common.system.domain.SysUser;
|
||||||
import com.muyu.system.domain.SysRoleDept;
|
import com.muyu.system.domain.SysRoleDept;
|
||||||
import com.muyu.system.domain.SysRoleMenu;
|
import com.muyu.system.domain.SysRoleMenu;
|
||||||
<<<<<<< HEAD
|
|
||||||
import com.muyu.common.system.domain.SysUserRole;
|
import com.muyu.common.system.domain.SysUserRole;
|
||||||
=======
|
|
||||||
import com.muyu.system.domain.SysUserRole;
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import com.muyu.system.mapper.SysRoleDeptMapper;
|
import com.muyu.system.mapper.SysRoleDeptMapper;
|
||||||
import com.muyu.system.mapper.SysRoleMapper;
|
import com.muyu.system.mapper.SysRoleMapper;
|
||||||
import com.muyu.system.mapper.SysRoleMenuMapper;
|
import com.muyu.system.mapper.SysRoleMenuMapper;
|
||||||
import com.muyu.system.mapper.SysUserRoleMapper;
|
import com.muyu.system.mapper.SysUserRoleMapper;
|
||||||
import com.muyu.system.service.SysRoleService;
|
import com.muyu.system.service.SysRoleService;
|
||||||
<<<<<<< HEAD
|
|
||||||
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
=======
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -42,7 +31,6 @@ import java.util.*;
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements SysRoleService {
|
public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements SysRoleService {
|
||||||
<<<<<<< HEAD
|
|
||||||
@Resource
|
@Resource
|
||||||
private SysRoleMapper roleMapper;
|
private SysRoleMapper roleMapper;
|
||||||
|
|
||||||
|
@ -53,18 +41,6 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
|
||||||
private SysUserRoleMapper userRoleMapper;
|
private SysUserRoleMapper userRoleMapper;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
=======
|
|
||||||
@Autowired
|
|
||||||
private SysRoleMapper roleMapper;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private SysRoleMenuMapper roleMenuMapper;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private SysUserRoleMapper userRoleMapper;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
private SysRoleDeptMapper roleDeptMapper;
|
private SysRoleDeptMapper roleDeptMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -88,17 +64,11 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
|
||||||
* @return 角色列表
|
* @return 角色列表
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
<<<<<<< HEAD
|
|
||||||
public List<SysRole> selectRolesByUserId (String firmCode, Long userId) {
|
public List<SysRole> selectRolesByUserId (String firmCode, Long userId) {
|
||||||
List<SysRole> userRoles = roleMapper.selectRolePermissionByUserId(firmCode, userId);
|
List<SysRole> userRoles = roleMapper.selectRolePermissionByUserId(firmCode, userId);
|
||||||
SysRole sysRole = new SysRole();
|
SysRole sysRole = new SysRole();
|
||||||
sysRole.setFirmCode(firmCode);
|
sysRole.setFirmCode(firmCode);
|
||||||
List<SysRole> roles = selectRoleAll(sysRole);
|
List<SysRole> roles = selectRoleAll(sysRole);
|
||||||
=======
|
|
||||||
public List<SysRole> selectRolesByUserId (Long userId) {
|
|
||||||
List<SysRole> userRoles = roleMapper.selectRolePermissionByUserId(userId);
|
|
||||||
List<SysRole> roles = selectRoleAll();
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
for (SysRole role : roles) {
|
for (SysRole role : roles) {
|
||||||
for (SysRole userRole : userRoles) {
|
for (SysRole userRole : userRoles) {
|
||||||
if (role.getRoleId().longValue() == userRole.getRoleId().longValue()) {
|
if (role.getRoleId().longValue() == userRole.getRoleId().longValue()) {
|
||||||
|
@ -118,13 +88,8 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
|
||||||
* @return 权限列表
|
* @return 权限列表
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
<<<<<<< HEAD
|
|
||||||
public Set<String> selectRolePermissionByUserId (String firmCode, Long userId) {
|
public Set<String> selectRolePermissionByUserId (String firmCode, Long userId) {
|
||||||
List<SysRole> perms = roleMapper.selectRolePermissionByUserId(firmCode, userId);
|
List<SysRole> perms = roleMapper.selectRolePermissionByUserId(firmCode, userId);
|
||||||
=======
|
|
||||||
public Set<String> selectRolePermissionByUserId (Long userId) {
|
|
||||||
List<SysRole> perms = roleMapper.selectRolePermissionByUserId(userId);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
Set<String> permsSet = new HashSet<>();
|
Set<String> permsSet = new HashSet<>();
|
||||||
for (SysRole perm : perms) {
|
for (SysRole perm : perms) {
|
||||||
if (StringUtils.isNotNull(perm)) {
|
if (StringUtils.isNotNull(perm)) {
|
||||||
|
@ -140,13 +105,8 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
|
||||||
* @return 角色列表
|
* @return 角色列表
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
<<<<<<< HEAD
|
|
||||||
public List<SysRole> selectRoleAll (SysRole role) {
|
public List<SysRole> selectRoleAll (SysRole role) {
|
||||||
return SpringUtils.getAopProxy(this).selectRoleList(role);
|
return SpringUtils.getAopProxy(this).selectRoleList(role);
|
||||||
=======
|
|
||||||
public List<SysRole> selectRoleAll () {
|
|
||||||
return SpringUtils.getAopProxy(this).selectRoleList(new SysRole());
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -183,11 +143,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
|
||||||
@Override
|
@Override
|
||||||
public boolean checkRoleNameUnique (SysRole role) {
|
public boolean checkRoleNameUnique (SysRole role) {
|
||||||
Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
|
Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
|
||||||
<<<<<<< HEAD
|
|
||||||
SysRole info = roleMapper.checkRoleNameUnique(role.getFirmCode(), role.getRoleName());
|
SysRole info = roleMapper.checkRoleNameUnique(role.getFirmCode(), role.getRoleName());
|
||||||
=======
|
|
||||||
SysRole info = roleMapper.checkRoleNameUnique(role.getRoleName());
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) {
|
if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) {
|
||||||
return UserConstants.NOT_UNIQUE;
|
return UserConstants.NOT_UNIQUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,31 +11,19 @@ import com.muyu.common.security.utils.SecurityUtils;
|
||||||
import com.muyu.common.system.domain.SysRole;
|
import com.muyu.common.system.domain.SysRole;
|
||||||
import com.muyu.common.system.domain.SysUser;
|
import com.muyu.common.system.domain.SysUser;
|
||||||
import com.muyu.system.domain.SysPost;
|
import com.muyu.system.domain.SysPost;
|
||||||
<<<<<<< HEAD
|
|
||||||
import com.muyu.common.system.domain.SysUserPost;
|
import com.muyu.common.system.domain.SysUserPost;
|
||||||
import com.muyu.common.system.domain.SysUserRole;
|
import com.muyu.common.system.domain.SysUserRole;
|
||||||
=======
|
|
||||||
import com.muyu.system.domain.SysUserPost;
|
|
||||||
import com.muyu.system.domain.SysUserRole;
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import com.muyu.system.mapper.*;
|
import com.muyu.system.mapper.*;
|
||||||
import com.muyu.system.service.SysUserService;
|
import com.muyu.system.service.SysUserService;
|
||||||
import com.muyu.system.service.SysConfigService;
|
import com.muyu.system.service.SysConfigService;
|
||||||
import jakarta.validation.Validator;
|
import jakarta.validation.Validator;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
@ -48,7 +36,6 @@ import java.util.stream.Collectors;
|
||||||
@Service
|
@Service
|
||||||
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements SysUserService {
|
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements SysUserService {
|
||||||
private static final Logger log = LoggerFactory.getLogger(SysUserServiceImpl.class);
|
private static final Logger log = LoggerFactory.getLogger(SysUserServiceImpl.class);
|
||||||
<<<<<<< HEAD
|
|
||||||
@Resource
|
@Resource
|
||||||
protected Validator validator;
|
protected Validator validator;
|
||||||
@Resource
|
@Resource
|
||||||
|
@ -62,21 +49,6 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||||
@Resource
|
@Resource
|
||||||
private SysUserPostMapper userPostMapper;
|
private SysUserPostMapper userPostMapper;
|
||||||
@Resource
|
@Resource
|
||||||
=======
|
|
||||||
@Autowired
|
|
||||||
protected Validator validator;
|
|
||||||
@Autowired
|
|
||||||
private SysUserMapper userMapper;
|
|
||||||
@Autowired
|
|
||||||
private SysRoleMapper roleMapper;
|
|
||||||
@Autowired
|
|
||||||
private SysPostMapper postMapper;
|
|
||||||
@Autowired
|
|
||||||
private SysUserRoleMapper userRoleMapper;
|
|
||||||
@Autowired
|
|
||||||
private SysUserPostMapper userPostMapper;
|
|
||||||
@Autowired
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
private SysConfigService configService;
|
private SysConfigService configService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -126,13 +98,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||||
* @return 用户对象信息
|
* @return 用户对象信息
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
<<<<<<< HEAD
|
|
||||||
public SysUser selectUserByUserName (String firmCode, String userName) {
|
public SysUser selectUserByUserName (String firmCode, String userName) {
|
||||||
return userMapper.selectUserByUserName(firmCode, userName);
|
return userMapper.selectUserByUserName(firmCode, userName);
|
||||||
=======
|
|
||||||
public SysUser selectUserByUserName (String userName) {
|
|
||||||
return userMapper.selectUserByUserName(userName);
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -392,10 +359,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||||
*
|
*
|
||||||
* @param user 用户对象
|
* @param user 用户对象
|
||||||
*/
|
*/
|
||||||
<<<<<<< HEAD
|
|
||||||
@Override
|
@Override
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
public void insertUserRole (SysUser user) {
|
public void insertUserRole (SysUser user) {
|
||||||
this.insertUserRole(user.getUserId(), user.getRoleIds());
|
this.insertUserRole(user.getUserId(), user.getRoleIds());
|
||||||
}
|
}
|
||||||
|
@ -405,10 +369,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||||
*
|
*
|
||||||
* @param user 用户对象
|
* @param user 用户对象
|
||||||
*/
|
*/
|
||||||
<<<<<<< HEAD
|
|
||||||
@Override
|
@Override
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
public void insertUserPost (SysUser user) {
|
public void insertUserPost (SysUser user) {
|
||||||
Long[] posts = user.getPostIds();
|
Long[] posts = user.getPostIds();
|
||||||
if (StringUtils.isNotEmpty(posts)) {
|
if (StringUtils.isNotEmpty(posts)) {
|
||||||
|
@ -504,13 +465,9 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||||
for (SysUser user : userList) {
|
for (SysUser user : userList) {
|
||||||
try {
|
try {
|
||||||
// 验证是否存在这个用户
|
// 验证是否存在这个用户
|
||||||
<<<<<<< HEAD
|
|
||||||
|
|
||||||
String firmCode = SecurityUtils.getSaasKey();
|
String firmCode = SecurityUtils.getSaasKey();
|
||||||
SysUser u = userMapper.selectUserByUserName(firmCode, user.getUserName());
|
SysUser u = userMapper.selectUserByUserName(firmCode, user.getUserName());
|
||||||
=======
|
|
||||||
SysUser u = userMapper.selectUserByUserName(user.getUserName());
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
if (StringUtils.isNull(u)) {
|
if (StringUtils.isNull(u)) {
|
||||||
BeanValidators.validateWithException(validator, user);
|
BeanValidators.validateWithException(validator, user);
|
||||||
user.setPassword(SecurityUtils.encryptPassword(password));
|
user.setPassword(SecurityUtils.encryptPassword(password));
|
||||||
|
@ -547,13 +504,10 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||||
return successMsg.toString();
|
return successMsg.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
@Override
|
@Override
|
||||||
public List<SysUser> selectCompanyList() {
|
public List<SysUser> selectCompanyList() {
|
||||||
|
|
||||||
return userMapper.selectCompanyList();
|
return userMapper.selectCompanyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,14 +4,10 @@ server:
|
||||||
|
|
||||||
# nacos线上地址
|
# nacos线上地址
|
||||||
nacos:
|
nacos:
|
||||||
addr: 106.54.193.225:8848
|
addr: 47.116.173.119:8848
|
||||||
user-name: nacos
|
user-name: nacos
|
||||||
password: nacos
|
password: nacos
|
||||||
<<<<<<< HEAD
|
|
||||||
namespace: one-saas
|
namespace: one-saas
|
||||||
=======
|
|
||||||
namespace: one
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
# SPRING_AMQP_DESERIALIZATION_TRUST_ALL=true spring.amqp.deserialization.trust.all
|
# SPRING_AMQP_DESERIALIZATION_TRUST_ALL=true spring.amqp.deserialization.trust.all
|
||||||
# Spring
|
# Spring
|
||||||
spring:
|
spring:
|
||||||
|
@ -57,12 +53,7 @@ spring:
|
||||||
- application-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
- application-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
# xxl-job 配置文件
|
# xxl-job 配置文件
|
||||||
- application-xxl-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
- application-xxl-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
<<<<<<< HEAD
|
|
||||||
|
|
||||||
=======
|
|
||||||
# rabbit 配置文件
|
|
||||||
- application-rabbit-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
logging:
|
logging:
|
||||||
level:
|
level:
|
||||||
com.muyu.system.mapper: DEBUG
|
com.muyu.system.mapper: DEBUG
|
||||||
|
|
|
@ -8,10 +8,7 @@
|
||||||
<id property="deptId" column="dept_id"/>
|
<id property="deptId" column="dept_id"/>
|
||||||
<result property="parentId" column="parent_id"/>
|
<result property="parentId" column="parent_id"/>
|
||||||
<result property="ancestors" column="ancestors"/>
|
<result property="ancestors" column="ancestors"/>
|
||||||
<<<<<<< HEAD
|
|
||||||
<result property="firmCode" column="firm_code"/>
|
<result property="firmCode" column="firm_code"/>
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
<result property="deptName" column="dept_name"/>
|
<result property="deptName" column="dept_name"/>
|
||||||
<result property="orderNum" column="order_num"/>
|
<result property="orderNum" column="order_num"/>
|
||||||
<result property="leader" column="leader"/>
|
<result property="leader" column="leader"/>
|
||||||
|
@ -30,10 +27,7 @@
|
||||||
select d.dept_id,
|
select d.dept_id,
|
||||||
d.parent_id,
|
d.parent_id,
|
||||||
d.ancestors,
|
d.ancestors,
|
||||||
<<<<<<< HEAD
|
|
||||||
d.firm_code,
|
d.firm_code,
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
d.dept_name,
|
d.dept_name,
|
||||||
d.order_num,
|
d.order_num,
|
||||||
d.leader,
|
d.leader,
|
||||||
|
@ -52,12 +46,9 @@
|
||||||
<if test="deptId != null and deptId != 0">
|
<if test="deptId != null and deptId != 0">
|
||||||
AND dept_id = #{deptId}
|
AND dept_id = #{deptId}
|
||||||
</if>
|
</if>
|
||||||
<<<<<<< HEAD
|
|
||||||
<if test="firmCode != null and firmCode != '' and firmCode != 'FIRM'">
|
<if test="firmCode != null and firmCode != '' and firmCode != 'FIRM'">
|
||||||
AND instr(firm_code, #{firmCode})
|
AND instr(firm_code, #{firmCode})
|
||||||
</if>
|
</if>
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
<if test="parentId != null and parentId != 0">
|
<if test="parentId != null and parentId != 0">
|
||||||
AND parent_id = #{parentId}
|
AND parent_id = #{parentId}
|
||||||
</if>
|
</if>
|
||||||
|
@ -123,17 +114,10 @@
|
||||||
where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1
|
where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
<insert id="insertDept" parameterType="com.muyu.common.system.domain.SysDept" useGeneratedKeys="true" keyProperty="deptId">
|
<insert id="insertDept" parameterType="com.muyu.common.system.domain.SysDept" useGeneratedKeys="true" keyProperty="deptId">
|
||||||
insert into sys_dept(
|
insert into sys_dept(
|
||||||
<if test="parentId != null and parentId != 0">parent_id,</if>
|
<if test="parentId != null and parentId != 0">parent_id,</if>
|
||||||
<if test="firmCode != null and firmCode != ''">firm_code,</if>
|
<if test="firmCode != null and firmCode != ''">firm_code,</if>
|
||||||
=======
|
|
||||||
<insert id="insertDept" parameterType="com.muyu.common.system.domain.SysDept">
|
|
||||||
insert into sys_dept(
|
|
||||||
<if test="deptId != null and deptId != 0">dept_id,</if>
|
|
||||||
<if test="parentId != null and parentId != 0">parent_id,</if>
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
<if test="deptName != null and deptName != ''">dept_name,</if>
|
<if test="deptName != null and deptName != ''">dept_name,</if>
|
||||||
<if test="ancestors != null and ancestors != ''">ancestors,</if>
|
<if test="ancestors != null and ancestors != ''">ancestors,</if>
|
||||||
<if test="orderNum != null">order_num,</if>
|
<if test="orderNum != null">order_num,</if>
|
||||||
|
@ -144,13 +128,8 @@
|
||||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||||
create_time
|
create_time
|
||||||
)values(
|
)values(
|
||||||
<<<<<<< HEAD
|
|
||||||
<if test="parentId != null and parentId != 0">#{parentId},</if>
|
<if test="parentId != null and parentId != 0">#{parentId},</if>
|
||||||
<if test="firmCode != null and firmCode != ''">#{firmCode},</if>
|
<if test="firmCode != null and firmCode != ''">#{firmCode},</if>
|
||||||
=======
|
|
||||||
<if test="deptId != null and deptId != 0">#{deptId},</if>
|
|
||||||
<if test="parentId != null and parentId != 0">#{parentId},</if>
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
<if test="deptName != null and deptName != ''">#{deptName},</if>
|
<if test="deptName != null and deptName != ''">#{deptName},</if>
|
||||||
<if test="ancestors != null and ancestors != ''">#{ancestors},</if>
|
<if test="ancestors != null and ancestors != ''">#{ancestors},</if>
|
||||||
<if test="orderNum != null">#{orderNum},</if>
|
<if test="orderNum != null">#{orderNum},</if>
|
||||||
|
@ -159,11 +138,7 @@
|
||||||
<if test="email != null and email != ''">#{email},</if>
|
<if test="email != null and email != ''">#{email},</if>
|
||||||
<if test="status != null">#{status},</if>
|
<if test="status != null">#{status},</if>
|
||||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||||
<<<<<<< HEAD
|
|
||||||
now()
|
now()
|
||||||
=======
|
|
||||||
sysdate()
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
@ -171,10 +146,7 @@
|
||||||
update sys_dept
|
update sys_dept
|
||||||
<set>
|
<set>
|
||||||
<if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
|
<if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
|
||||||
<<<<<<< HEAD
|
|
||||||
<if test="firmCode != null and firmCode != ''">firm_code = #{firmCode},</if>
|
<if test="firmCode != null and firmCode != ''">firm_code = #{firmCode},</if>
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
<if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
|
<if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
|
||||||
<if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
|
<if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
|
||||||
<if test="orderNum != null">order_num = #{orderNum},</if>
|
<if test="orderNum != null">order_num = #{orderNum},</if>
|
||||||
|
@ -208,15 +180,12 @@
|
||||||
</foreach>
|
</foreach>
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
<update id="updateDeptFirmCode">
|
<update id="updateDeptFirmCode">
|
||||||
update sys_dept
|
update sys_dept
|
||||||
set firm_code = CONCAT(firm_code,'_',#{deptId})
|
set firm_code = CONCAT(firm_code,'_',#{deptId})
|
||||||
where dept_id = #{deptId}
|
where dept_id = #{deptId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
<delete id="deleteDeptById" parameterType="Long">
|
<delete id="deleteDeptById" parameterType="Long">
|
||||||
update sys_dept
|
update sys_dept
|
||||||
set del_flag = '2'
|
set del_flag = '2'
|
||||||
|
|
|
@ -6,10 +6,7 @@
|
||||||
|
|
||||||
<resultMap type="com.muyu.common.system.domain.SysRole" id="SysRoleResult">
|
<resultMap type="com.muyu.common.system.domain.SysRole" id="SysRoleResult">
|
||||||
<id property="roleId" column="role_id"/>
|
<id property="roleId" column="role_id"/>
|
||||||
<<<<<<< HEAD
|
|
||||||
<result property="firmCode" column="firm_code"/>
|
<result property="firmCode" column="firm_code"/>
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
<result property="roleName" column="role_name"/>
|
<result property="roleName" column="role_name"/>
|
||||||
<result property="roleKey" column="role_key"/>
|
<result property="roleKey" column="role_key"/>
|
||||||
<result property="roleSort" column="role_sort"/>
|
<result property="roleSort" column="role_sort"/>
|
||||||
|
@ -27,10 +24,7 @@
|
||||||
|
|
||||||
<sql id="selectRoleVo">
|
<sql id="selectRoleVo">
|
||||||
select distinct r.role_id,
|
select distinct r.role_id,
|
||||||
<<<<<<< HEAD
|
|
||||||
r.firm_code,
|
r.firm_code,
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
r.role_name,
|
r.role_name,
|
||||||
r.role_key,
|
r.role_key,
|
||||||
r.role_sort,
|
r.role_sort,
|
||||||
|
@ -59,12 +53,9 @@
|
||||||
<if test="status != null and status != ''">
|
<if test="status != null and status != ''">
|
||||||
AND r.status = #{status}
|
AND r.status = #{status}
|
||||||
</if>
|
</if>
|
||||||
<<<<<<< HEAD
|
|
||||||
<if test="firmCode != null and firmCode != '' and firmCode != 'FIRM'">
|
<if test="firmCode != null and firmCode != '' and firmCode != 'FIRM'">
|
||||||
AND r.firm_code = #{firmCode}
|
AND r.firm_code = #{firmCode}
|
||||||
</if>
|
</if>
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
<if test="roleKey != null and roleKey != ''">
|
<if test="roleKey != null and roleKey != ''">
|
||||||
AND r.role_key like concat('%', #{roleKey}, '%')
|
AND r.role_key like concat('%', #{roleKey}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
@ -79,15 +70,9 @@
|
||||||
order by r.role_sort
|
order by r.role_sort
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
<select id="selectRolePermissionByUserId" resultMap="SysRoleResult">
|
<select id="selectRolePermissionByUserId" resultMap="SysRoleResult">
|
||||||
<include refid="selectRoleVo"/>
|
<include refid="selectRoleVo"/>
|
||||||
WHERE r.firm_code = #{firmCode} AND r.del_flag = '0' and ur.user_id = #{userId}
|
WHERE r.firm_code = #{firmCode} AND r.del_flag = '0' and ur.user_id = #{userId}
|
||||||
=======
|
|
||||||
<select id="selectRolePermissionByUserId" parameterType="Long" resultMap="SysRoleResult">
|
|
||||||
<include refid="selectRoleVo"/>
|
|
||||||
WHERE r.del_flag = '0' and ur.user_id = #{userId}
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectRoleAll" resultMap="SysRoleResult">
|
<select id="selectRoleAll" resultMap="SysRoleResult">
|
||||||
|
@ -114,11 +99,7 @@
|
||||||
|
|
||||||
<select id="checkRoleNameUnique" parameterType="String" resultMap="SysRoleResult">
|
<select id="checkRoleNameUnique" parameterType="String" resultMap="SysRoleResult">
|
||||||
<include refid="selectRoleVo"/>
|
<include refid="selectRoleVo"/>
|
||||||
<<<<<<< HEAD
|
|
||||||
where r.firm_code = #{firmCode} AND r.role_name=#{roleName} and r.del_flag = '0' limit 1
|
where r.firm_code = #{firmCode} AND r.role_name=#{roleName} and r.del_flag = '0' limit 1
|
||||||
=======
|
|
||||||
where r.role_name=#{roleName} and r.del_flag = '0' limit 1
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="checkRoleKeyUnique" parameterType="String" resultMap="SysRoleResult">
|
<select id="checkRoleKeyUnique" parameterType="String" resultMap="SysRoleResult">
|
||||||
|
@ -129,10 +110,7 @@
|
||||||
<insert id="insertRole" parameterType="com.muyu.common.system.domain.SysRole" useGeneratedKeys="true" keyProperty="roleId">
|
<insert id="insertRole" parameterType="com.muyu.common.system.domain.SysRole" useGeneratedKeys="true" keyProperty="roleId">
|
||||||
insert into sys_role(
|
insert into sys_role(
|
||||||
<if test="roleId != null and roleId != 0">role_id,</if>
|
<if test="roleId != null and roleId != 0">role_id,</if>
|
||||||
<<<<<<< HEAD
|
|
||||||
<if test="firmCode != null and firmCode != ''">firm_code,</if>
|
<if test="firmCode != null and firmCode != ''">firm_code,</if>
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
<if test="roleName != null and roleName != ''">role_name,</if>
|
<if test="roleName != null and roleName != ''">role_name,</if>
|
||||||
<if test="roleKey != null and roleKey != ''">role_key,</if>
|
<if test="roleKey != null and roleKey != ''">role_key,</if>
|
||||||
<if test="roleSort != null">role_sort,</if>
|
<if test="roleSort != null">role_sort,</if>
|
||||||
|
@ -145,10 +123,7 @@
|
||||||
create_time
|
create_time
|
||||||
)values(
|
)values(
|
||||||
<if test="roleId != null and roleId != 0">#{roleId},</if>
|
<if test="roleId != null and roleId != 0">#{roleId},</if>
|
||||||
<<<<<<< HEAD
|
|
||||||
<if test="firmCode != null and firmCode != ''">#{firmCode},</if>
|
<if test="firmCode != null and firmCode != ''">#{firmCode},</if>
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
<if test="roleName != null and roleName != ''">#{roleName},</if>
|
<if test="roleName != null and roleName != ''">#{roleName},</if>
|
||||||
<if test="roleKey != null and roleKey != ''">#{roleKey},</if>
|
<if test="roleKey != null and roleKey != ''">#{roleKey},</if>
|
||||||
<if test="roleSort != null">#{roleSort},</if>
|
<if test="roleSort != null">#{roleSort},</if>
|
||||||
|
@ -165,10 +140,7 @@
|
||||||
<update id="updateRole" parameterType="com.muyu.common.system.domain.SysRole">
|
<update id="updateRole" parameterType="com.muyu.common.system.domain.SysRole">
|
||||||
update sys_role
|
update sys_role
|
||||||
<set>
|
<set>
|
||||||
<<<<<<< HEAD
|
|
||||||
<if test="firmCode != null and firmCode != ''">firm_code = #{firmCode},</if>
|
<if test="firmCode != null and firmCode != ''">firm_code = #{firmCode},</if>
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
<if test="roleName != null and roleName != ''">role_name = #{roleName},</if>
|
<if test="roleName != null and roleName != ''">role_name = #{roleName},</if>
|
||||||
<if test="roleKey != null and roleKey != ''">role_key = #{roleKey},</if>
|
<if test="roleKey != null and roleKey != ''">role_key = #{roleKey},</if>
|
||||||
<if test="roleSort != null">role_sort = #{roleSort},</if>
|
<if test="roleSort != null">role_sort = #{roleSort},</if>
|
||||||
|
|
|
@ -6,13 +6,9 @@
|
||||||
|
|
||||||
<resultMap type="com.muyu.common.system.domain.SysUser" id="SysUserResult">
|
<resultMap type="com.muyu.common.system.domain.SysUser" id="SysUserResult">
|
||||||
<id property="userId" column="user_id"/>
|
<id property="userId" column="user_id"/>
|
||||||
<<<<<<< HEAD
|
|
||||||
<result property="isAdmin" column="is_admin"/>
|
<result property="isAdmin" column="is_admin"/>
|
||||||
<result property="deptId" column="dept_id"/>
|
<result property="deptId" column="dept_id"/>
|
||||||
<result property="firmCode" column="firm_code"/>
|
<result property="firmCode" column="firm_code"/>
|
||||||
=======
|
|
||||||
<result property="deptId" column="dept_id"/>
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
<result property="userName" column="user_name"/>
|
<result property="userName" column="user_name"/>
|
||||||
<result property="nickName" column="nick_name"/>
|
<result property="nickName" column="nick_name"/>
|
||||||
<result property="email" column="email"/>
|
<result property="email" column="email"/>
|
||||||
|
@ -54,13 +50,9 @@
|
||||||
|
|
||||||
<sql id="selectUserVo">
|
<sql id="selectUserVo">
|
||||||
select u.user_id,
|
select u.user_id,
|
||||||
<<<<<<< HEAD
|
|
||||||
u.is_admin,
|
u.is_admin,
|
||||||
u.dept_id,
|
u.dept_id,
|
||||||
u.firm_code,
|
u.firm_code,
|
||||||
=======
|
|
||||||
u.dept_id,
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
u.user_name,
|
u.user_name,
|
||||||
u.nick_name,
|
u.nick_name,
|
||||||
u.email,
|
u.email,
|
||||||
|
@ -95,25 +87,17 @@
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectUserList" parameterType="com.muyu.common.system.domain.SysUser" resultMap="SysUserResult">
|
<select id="selectUserList" parameterType="com.muyu.common.system.domain.SysUser" resultMap="SysUserResult">
|
||||||
<<<<<<< HEAD
|
|
||||||
select u.user_id, u.dept_id,u.is_admin, u.nick_name,u.firm_code, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status,
|
select u.user_id, u.dept_id,u.is_admin, u.nick_name,u.firm_code, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status,
|
||||||
u.del_flag,u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user
|
u.del_flag,u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user
|
||||||
=======
|
|
||||||
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status,
|
|
||||||
u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
u
|
u
|
||||||
left join sys_dept d on u.dept_id = d.dept_id
|
left join sys_dept d on u.dept_id = d.dept_id
|
||||||
where u.del_flag = '0'
|
where u.del_flag = '0'
|
||||||
<if test="userId != null and userId != 0">
|
<if test="userId != null and userId != 0">
|
||||||
AND u.user_id = #{userId}
|
AND u.user_id = #{userId}
|
||||||
</if>
|
</if>
|
||||||
<<<<<<< HEAD
|
|
||||||
<if test="firmCode != null and firmCode != '' and firmCode != 'FIRM'">
|
<if test="firmCode != null and firmCode != '' and firmCode != 'FIRM'">
|
||||||
AND u.firm_code like concat('%', #{firmCode}, '%')
|
AND u.firm_code like concat('%', #{firmCode}, '%')
|
||||||
</if>
|
</if>
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
<if test="userName != null and userName != ''">
|
<if test="userName != null and userName != ''">
|
||||||
AND u.user_name like concat('%', #{userName}, '%')
|
AND u.user_name like concat('%', #{userName}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
@ -138,11 +122,7 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectAllocatedList" parameterType="com.muyu.common.system.domain.SysUser" resultMap="SysUserResult">
|
<select id="selectAllocatedList" parameterType="com.muyu.common.system.domain.SysUser" resultMap="SysUserResult">
|
||||||
<<<<<<< HEAD
|
|
||||||
select distinct u.user_id,u.is_admin, u.dept_id,u.firm_code, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
|
select distinct u.user_id,u.is_admin, u.dept_id,u.firm_code, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
|
||||||
=======
|
|
||||||
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
from sys_user u
|
from sys_user u
|
||||||
left join sys_dept d on u.dept_id = d.dept_id
|
left join sys_dept d on u.dept_id = d.dept_id
|
||||||
left join sys_user_role ur on u.user_id = ur.user_id
|
left join sys_user_role ur on u.user_id = ur.user_id
|
||||||
|
@ -159,11 +139,7 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectUnallocatedList" parameterType="com.muyu.common.system.domain.SysUser" resultMap="SysUserResult">
|
<select id="selectUnallocatedList" parameterType="com.muyu.common.system.domain.SysUser" resultMap="SysUserResult">
|
||||||
<<<<<<< HEAD
|
|
||||||
select distinct u.user_id,u.is_admin, u.dept_id,u.firm_code, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
|
select distinct u.user_id,u.is_admin, u.dept_id,u.firm_code, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
|
||||||
=======
|
|
||||||
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
from sys_user u
|
from sys_user u
|
||||||
left join sys_dept d on u.dept_id = d.dept_id
|
left join sys_dept d on u.dept_id = d.dept_id
|
||||||
left join sys_user_role ur on u.user_id = ur.user_id
|
left join sys_user_role ur on u.user_id = ur.user_id
|
||||||
|
@ -183,11 +159,7 @@
|
||||||
|
|
||||||
<select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult">
|
<select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult">
|
||||||
<include refid="selectUserVo"/>
|
<include refid="selectUserVo"/>
|
||||||
<<<<<<< HEAD
|
|
||||||
where u.firm_code = #{firmCode} and u.user_name = #{userName} and u.del_flag = '0'
|
where u.firm_code = #{firmCode} and u.user_name = #{userName} and u.del_flag = '0'
|
||||||
=======
|
|
||||||
where u.user_name = #{userName} and u.del_flag = '0'
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
|
<select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
|
||||||
|
@ -219,24 +191,17 @@
|
||||||
limit 1
|
limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
<select id="selectCompanyList" resultType="com.muyu.common.system.domain.SysUser">
|
<select id="selectCompanyList" resultType="com.muyu.common.system.domain.SysUser">
|
||||||
select * from sys_user
|
select * from sys_user
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
<insert id="insertUser" parameterType="com.muyu.common.system.domain.SysUser" useGeneratedKeys="true" keyProperty="userId">
|
<insert id="insertUser" parameterType="com.muyu.common.system.domain.SysUser" useGeneratedKeys="true" keyProperty="userId">
|
||||||
insert into sys_user(
|
insert into sys_user(
|
||||||
<if test="userId != null and userId != 0">user_id,</if>
|
<if test="userId != null and userId != 0">user_id,</if>
|
||||||
<if test="deptId != null and deptId != 0">dept_id,</if>
|
<if test="deptId != null and deptId != 0">dept_id,</if>
|
||||||
<<<<<<< HEAD
|
|
||||||
<if test="isAdmin != null and isAdmin != 0">is_admin,</if>
|
<if test="isAdmin != null and isAdmin != 0">is_admin,</if>
|
||||||
<if test="userName != null and userName != ''">user_name,</if>
|
<if test="userName != null and userName != ''">user_name,</if>
|
||||||
<if test="firmCode != null and firmCode != ''">firm_code,</if>
|
<if test="firmCode != null and firmCode != ''">firm_code,</if>
|
||||||
=======
|
|
||||||
<if test="userName != null and userName != ''">user_name,</if>
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
<if test="nickName != null and nickName != ''">nick_name,</if>
|
<if test="nickName != null and nickName != ''">nick_name,</if>
|
||||||
<if test="email != null and email != ''">email,</if>
|
<if test="email != null and email != ''">email,</if>
|
||||||
<if test="avatar != null and avatar != ''">avatar,</if>
|
<if test="avatar != null and avatar != ''">avatar,</if>
|
||||||
|
@ -250,13 +215,9 @@
|
||||||
)values(
|
)values(
|
||||||
<if test="userId != null and userId != ''">#{userId},</if>
|
<if test="userId != null and userId != ''">#{userId},</if>
|
||||||
<if test="deptId != null and deptId != ''">#{deptId},</if>
|
<if test="deptId != null and deptId != ''">#{deptId},</if>
|
||||||
<<<<<<< HEAD
|
|
||||||
<if test="isAdmin != null and isAdmin != ''">#{isAdmin},</if>
|
<if test="isAdmin != null and isAdmin != ''">#{isAdmin},</if>
|
||||||
<if test="userName != null and userName != ''">#{userName},</if>
|
<if test="userName != null and userName != ''">#{userName},</if>
|
||||||
<if test="firmCode != null and firmCode != ''">#{firmCode},</if>
|
<if test="firmCode != null and firmCode != ''">#{firmCode},</if>
|
||||||
=======
|
|
||||||
<if test="userName != null and userName != ''">#{userName},</if>
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
<if test="nickName != null and nickName != ''">#{nickName},</if>
|
<if test="nickName != null and nickName != ''">#{nickName},</if>
|
||||||
<if test="email != null and email != ''">#{email},</if>
|
<if test="email != null and email != ''">#{email},</if>
|
||||||
<if test="avatar != null and avatar != ''">#{avatar},</if>
|
<if test="avatar != null and avatar != ''">#{avatar},</if>
|
||||||
|
@ -275,10 +236,7 @@
|
||||||
<set>
|
<set>
|
||||||
<if test="deptId != null and deptId != 0">dept_id = #{deptId},</if>
|
<if test="deptId != null and deptId != 0">dept_id = #{deptId},</if>
|
||||||
<if test="userName != null and userName != ''">user_name = #{userName},</if>
|
<if test="userName != null and userName != ''">user_name = #{userName},</if>
|
||||||
<<<<<<< HEAD
|
|
||||||
<if test="firmCode != null and firmCode != ''">firm_code = #{firmCode},</if>
|
<if test="firmCode != null and firmCode != ''">firm_code = #{firmCode},</if>
|
||||||
=======
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
|
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
|
||||||
<if test="email != null ">email = #{email},</if>
|
<if test="email != null ">email = #{email},</if>
|
||||||
<if test="phonenumber != null ">phonenumber = #{phonenumber},</if>
|
<if test="phonenumber != null ">phonenumber = #{phonenumber},</if>
|
||||||
|
|
|
@ -4,11 +4,7 @@
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.muyu.system.mapper.SysUserPostMapper">
|
<mapper namespace="com.muyu.system.mapper.SysUserPostMapper">
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
<resultMap type="com.muyu.common.system.domain.SysUserPost" id="SysUserPostResult">
|
<resultMap type="com.muyu.common.system.domain.SysUserPost" id="SysUserPostResult">
|
||||||
=======
|
|
||||||
<resultMap type="com.muyu.system.domain.SysUserPost" id="SysUserPostResult">
|
|
||||||
>>>>>>> 813460c (1..)
|
|
||||||
<result property="userId" column="user_id"/>
|
<result property="userId" column="user_id"/>
|
||||||
<result property="postId" column="post_id"/>
|
<result property="postId" column="post_id"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue