Compare commits
30 Commits
main
...
addcompany
| Author | SHA1 | Date |
|---|---|---|
|
|
c01eeb505d | |
|
|
c802aa082e | |
|
|
5021c02115 | |
|
|
4dfc5570cb | |
|
|
3e5b0245af | |
|
|
093093e650 | |
|
|
6004d6ab3b | |
|
|
8c6494baef | |
|
|
66cf195033 | |
|
|
b29ee64423 | |
|
|
53f6e98185 | |
|
|
8920722356 | |
|
|
79bf7f5f4a | |
|
|
fa3016819b | |
|
|
e3a6759569 | |
|
|
7251823161 | |
|
|
e36d04ec40 | |
|
|
3796dd92ef | |
|
|
340a724dfc | |
|
|
f5ae2fb1a2 | |
|
|
9847f0b275 | |
|
|
366bb2fc8a | |
|
|
a7aadb246f | |
|
|
0a1498e973 | |
|
|
c8f8231ec8 | |
|
|
508a4bd302 | |
|
|
1566d127ec | |
|
|
8494438c24 | |
|
|
4ce1078a1b | |
|
|
49996f6530 |
|
|
@ -1,69 +0,0 @@
|
|||
package com.bonus.system.api.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】对象 sys_address
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-01-06
|
||||
*/
|
||||
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
public class SysAddress extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 自增编号 */
|
||||
private Long id;
|
||||
|
||||
/** 平台ID */
|
||||
@Excel(name = "平台ID")
|
||||
@ApiModelProperty(value = "平台ID")
|
||||
private Long platformId;
|
||||
|
||||
/** 县镇市省编码,省、直辖市两位;普通市、直辖(区、县)两位;普通县两位;镇、乡3位;村委会3位;共12位 */
|
||||
@Excel(name = "县镇市省编码,省、直辖市两位;普通市、直辖", readConverterExp = "区=、县")
|
||||
private String code;
|
||||
|
||||
/** 父级code */
|
||||
@Excel(name = "父级code")
|
||||
@ApiModelProperty(value = "父级code")
|
||||
private String parentCode;
|
||||
|
||||
/** 地区名称 */
|
||||
@Excel(name = "地区名称")
|
||||
@ApiModelProperty(value = "地区名称")
|
||||
private String name;
|
||||
|
||||
/** 纬度 */
|
||||
@Excel(name = "纬度")
|
||||
@ApiModelProperty(value = "纬度")
|
||||
private BigDecimal latitude;
|
||||
|
||||
/** 经度 */
|
||||
@Excel(name = "经度")
|
||||
@ApiModelProperty(value = "经度")
|
||||
private BigDecimal longitude;
|
||||
|
||||
/** 等级:1省 2市 3县/县级市/区 4镇/街道 5村/社区 */
|
||||
@Excel(name = "等级:1省 2市 3县/县级市/区 4镇/街道 5村/社区")
|
||||
@ApiModelProperty(value = "等级:1省 2市 3县/县级市/区 4镇/街道 5村/社区")
|
||||
private Integer level;
|
||||
|
||||
/** 区域划分 1:华北 2:华东 3:华中 4:华南 5:东北 6:西北 7:西南 8:港澳台 9:海外 */
|
||||
@Excel(name = "区域划分 1:华北 2:华东 3:华中 4:华南 5:东北 6:西北 7:西南 8:港澳台 9:海外")
|
||||
@ApiModelProperty(value = "区域划分 1:华北 2:华东 3:华中 4:华南 5:东北 6:西北 7:西南 8:港澳台 9:海外")
|
||||
private Integer region;
|
||||
|
||||
/** 状态:0启用 2已作废 */
|
||||
private String delFlag;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -81,12 +81,10 @@ public class SysDept extends BaseEntity {
|
|||
* 省
|
||||
*/
|
||||
private String province;
|
||||
|
||||
/**
|
||||
* 市
|
||||
*/
|
||||
private String city;
|
||||
|
||||
/**
|
||||
* 县
|
||||
*/
|
||||
|
|
@ -127,8 +125,6 @@ public class SysDept extends BaseEntity {
|
|||
*/
|
||||
private Long companyId;
|
||||
|
||||
private Long userCount;
|
||||
|
||||
/**
|
||||
*角色名称
|
||||
*/
|
||||
|
|
@ -169,6 +165,8 @@ public class SysDept extends BaseEntity {
|
|||
return city;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getProvince() {
|
||||
return province;
|
||||
}
|
||||
|
|
@ -235,14 +233,6 @@ public class SysDept extends BaseEntity {
|
|||
this.companyId = companyId;
|
||||
}
|
||||
|
||||
public Long getUserCount() {
|
||||
return userCount;
|
||||
}
|
||||
|
||||
public void setUserCount(Long userCount) {
|
||||
this.userCount = userCount;
|
||||
}
|
||||
|
||||
public String getRoleName() {
|
||||
return roleName;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,12 +17,12 @@ public class SysTemplate extends BaseEntity
|
|||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/** 模板名称 */
|
||||
@Excel(name = "模板名称")
|
||||
private String name;
|
||||
|
||||
private List<Long> menuIds;
|
||||
private List<Integer> menuIds;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,10 @@
|
|||
</dependency>
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- bonus Common Security-->
|
||||
<dependency>
|
||||
|
|
|
|||
|
|
@ -169,17 +169,15 @@ public class TokenController {
|
|||
log.info("ticket=" + ticket);
|
||||
if (StringUtils.isNotEmpty(ticket)) {
|
||||
LoginUser loginUser = new LoginUser();
|
||||
SysUser sysUser = new SysUser();
|
||||
if (form.getSysType()!=null && "1".equals(form.getSysType())){
|
||||
log.info("app端登录");
|
||||
//loginUser = sysLoginService.iwsH5Login(ticket,iwsH5AppId,iwsH5Url);
|
||||
//h5和web端调用同一个接口
|
||||
loginUser = sysLoginService.iwsWebLogin(ticket,iwsH5AppId,iwsWebUrl);
|
||||
sysLoginService.iwsH5Login(ticket,iwsH5AppId,iwsH5Url,loginUser,sysUser);
|
||||
} else if (form.getSysType()!=null && "0".equals(form.getSysType())) {
|
||||
loginUser = sysLoginService.iwsWebLogin(ticket,iwsWebAppId,iwsWebUrl);
|
||||
sysLoginService.iwsWebLogin(ticket,iwsWebAppId,iwsWebUrl,loginUser,sysUser);
|
||||
}else {
|
||||
throw new ServiceException("登录失败,请稍后重试");
|
||||
}
|
||||
logService.saveLogin(loginUser.getSysUser().getUserName(), "登录", "登录成功", null, "成功");
|
||||
logService.saveLogin(sysUser.getUserName(), "登录", "登录成功", null, "成功");
|
||||
//生成系统token
|
||||
return R.ok(tokenService.createToken(loginUser));
|
||||
|
||||
|
|
|
|||
|
|
@ -47,8 +47,4 @@ public class LoginBody {
|
|||
* i皖送登录方式 0:web端登录 1:H5登录
|
||||
*/
|
||||
private String sysType;
|
||||
/**
|
||||
* i皖送登录数据库中没有用心信息的时候给个默认公司
|
||||
*/
|
||||
private Long deptId;
|
||||
}
|
||||
}
|
||||
|
|
@ -25,7 +25,6 @@ import java.time.LocalDateTime;
|
|||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@Component
|
||||
|
|
@ -253,9 +252,6 @@ public class PasswordValidatorService {
|
|||
*/
|
||||
public void validateUserResult(String username, R<LoginUser> userResult) {
|
||||
if (userResult == null || userResult.getData() == null || R.FAIL == userResult.getCode()) {
|
||||
if (Objects.nonNull(userResult)) {
|
||||
logAndThrowError(username, userResult.getMsg(), userResult.getMsg());
|
||||
}
|
||||
logAndThrowError(username, "用户名/密码错误", "登录用户不存在");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,7 +93,6 @@ public class SysLoginService {
|
|||
* @param registerBody 注册信息
|
||||
*/
|
||||
public void register(RegisterBody registerBody) {
|
||||
log.info("开始进行注册===============");
|
||||
long startTime = System.currentTimeMillis(); // 记录开始时间
|
||||
String result = convertAndAppend(registerBody.getNickName(), registerBody.getMobile());
|
||||
int contactType = getContactType(registerBody.getMobile());
|
||||
|
|
@ -129,7 +128,7 @@ public class SysLoginService {
|
|||
SysUser sysUser = new SysUser();
|
||||
sysUser.setUserName(registerBody.getUsername());
|
||||
sysUser.setNickName(registerBody.getNickName());
|
||||
sysUser.setDeptId(registerBody.getDeptId());
|
||||
|
||||
if (systemConfig.getRegistersConfig().isApprovalStatus()){
|
||||
sysUser.setApprovalStatus("0");
|
||||
sysUser.setStatus("1");
|
||||
|
|
@ -157,7 +156,6 @@ public class SysLoginService {
|
|||
recordLogService.saveLogs(registerBody.getUsername(), startTime, "注册异常", e.getMessage(), null, "失败");
|
||||
throw new ServiceException("注册失败,请稍后重试");
|
||||
}
|
||||
log.info("结束进行注册===============");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -205,30 +203,26 @@ public class SysLoginService {
|
|||
* @param iwsWebUrl
|
||||
* @return
|
||||
*/
|
||||
public LoginUser iwsWebLogin(String ticket, String iwsWebAppId, String iwsWebUrl) {
|
||||
public void iwsWebLogin(String ticket, String iwsWebAppId, String iwsWebUrl,LoginUser loginUser,SysUser sysUser) {
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
LoginUser loginUser = new LoginUser();
|
||||
SysUser sysUser = new SysUser();
|
||||
paramMap.put("ticket", ticket);
|
||||
paramMap.put("appId", iwsWebAppId);
|
||||
RestTemplate restTemplate = new RestTemplate();
|
||||
ResponseEntity<String> authResponse = restTemplate.getForEntity(iwsWebUrl, String.class, paramMap);
|
||||
log.info("authResponse:" + authResponse.toString());
|
||||
// 根据ResponseEntity<String> responseEntity对象,获取body部分,body为json格式字符串
|
||||
String content = authResponse.getBody();
|
||||
// 将json字符串转化为json对象
|
||||
JSONObject json = JSONObject.parseObject(content);
|
||||
// 取出data部分对象
|
||||
JSONObject data = json.getJSONObject("data");
|
||||
|
||||
if ("200".equals(json.getInteger("code").toString())){
|
||||
if ("200".equals(authResponse.getStatusCode())){
|
||||
// 根据ResponseEntity<String> responseEntity对象,获取body部分,body为json格式字符串
|
||||
String content = authResponse.getBody();
|
||||
// 将json字符串转化为json对象
|
||||
JSONObject json = JSONObject.parseObject(content);
|
||||
// 取出data部分对象
|
||||
JSONObject data = json.getJSONObject("data");
|
||||
sysUser.setUserName(data.get("userName").toString());
|
||||
sysUser.setNickName(data.get("name").toString());
|
||||
sysUser.setPhonenumber(data.get("mobile").toString());
|
||||
loginUser.setSysUser(sysUser);
|
||||
loginUser = createUser(sysUser,loginUser);
|
||||
createUser(sysUser,loginUser);
|
||||
}
|
||||
return loginUser;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -236,51 +230,40 @@ public class SysLoginService {
|
|||
* @param sysUser
|
||||
* @param loginUser
|
||||
*/
|
||||
private LoginUser createUser(SysUser sysUser, LoginUser loginUser) {
|
||||
private void createUser(SysUser sysUser, LoginUser loginUser) {
|
||||
//通过用户名获取人员信息
|
||||
LoginUser loginUserNew = new LoginUser();
|
||||
SysUser sysUserNew = new SysUser();
|
||||
String resultName = convertAndAppend(sysUser.getNickName(), sysUser.getPhonenumber());
|
||||
R<LoginUser> userResult = remoteUserService.getUserInfo(resultName, SecurityConstants.INNER);
|
||||
|
||||
R<LoginUser> userResult = remoteUserService.getUserInfo(sysUser.getUserName(), SecurityConstants.INNER);
|
||||
if (userResult.getData() == null || R.FAIL == userResult.getCode()) {
|
||||
log.info("登录用户不存在,进行创建----");
|
||||
RegisterBody registerBody = new RegisterBody();
|
||||
registerBody.setUsername(sysUser.getUserName());
|
||||
registerBody.setNickName(sysUser.getNickName());
|
||||
registerBody.setMobile(sysUser.getPhonenumber());
|
||||
registerBody.setDeptId(1L);
|
||||
registerBody.setPassword("Bonus@Max2024");
|
||||
//获取配置中的初始密码
|
||||
AjaxResult result = configService.getConfigKey("sys.user.initPassword");
|
||||
if ("200".equals(result.get("code").toString()))
|
||||
if (result.isSuccess())
|
||||
{
|
||||
registerBody.setPassword(result.get("msg").toString());
|
||||
sysUser.setPassword(result.get("msg").toString());
|
||||
}
|
||||
log.info("开始进行注册{}",registerBody);
|
||||
//新用户注册
|
||||
try {
|
||||
register(registerBody);
|
||||
log.info("注册成功!");
|
||||
//查询用户信息
|
||||
userResult = remoteUserService.getUserInfo(resultName, SecurityConstants.INNER);
|
||||
loginUserNew = userResult.getData();
|
||||
sysUserNew = loginUserNew.getSysUser();
|
||||
log.info("获取用户信息成功!{}",loginUserNew.getSysUser());
|
||||
userResult = remoteUserService.getUserInfo(sysUser.getUserName(), SecurityConstants.INNER);
|
||||
loginUser = userResult.getData();
|
||||
sysUser = loginUser.getSysUser();
|
||||
//初始化一个角色
|
||||
Long[] roleIds = new Long[5];
|
||||
// 将数组的第一个元素赋值为 2
|
||||
roleIds[0] = 2L;
|
||||
log.info("开始绑定角色信息{}",roleIds);
|
||||
remoteUserService.insertAuthRole(sysUserNew.getUserId(),roleIds,SecurityConstants.INNER);
|
||||
log.info("角色信息绑定成功!");
|
||||
remoteUserService.insertAuthRole(sysUser.getUserId(),roleIds,SecurityConstants.INNER);
|
||||
}catch (Exception e){
|
||||
throw new ServiceException("登录失败,请稍后重试");
|
||||
}
|
||||
}else {
|
||||
loginUserNew = userResult.getData();
|
||||
loginUser = userResult.getData();
|
||||
sysUser = loginUser.getSysUser();
|
||||
}
|
||||
return loginUserNew;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -290,31 +273,26 @@ public class SysLoginService {
|
|||
* @param iwsH5Url
|
||||
* @return
|
||||
*/
|
||||
public LoginUser iwsH5Login(String ticket, String iwsH5AppId, String iwsH5Url) {
|
||||
public void iwsH5Login(String ticket, String iwsH5AppId, String iwsH5Url,LoginUser loginUser,SysUser sysUser) {
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
LoginUser loginUser = new LoginUser();
|
||||
SysUser sysUser = new SysUser();
|
||||
paramMap.put("ticket", ticket);
|
||||
paramMap.put("appId", iwsH5AppId);
|
||||
RestTemplate restTemplate = new RestTemplate();
|
||||
ResponseEntity<String> authResponse = restTemplate.getForEntity(iwsH5Url, String.class, paramMap);
|
||||
log.info("authResponse:" + authResponse.toString());
|
||||
// 根据ResponseEntity<String> responseEntity对象,获取body部分,body为json格式字符串
|
||||
String content = authResponse.getBody();
|
||||
// 将json字符串转化为json对象
|
||||
JSONObject json = JSONObject.parseObject(content);
|
||||
// 取出data部分对象
|
||||
JSONObject data = json.getJSONObject("data");
|
||||
log.info("返回的数据:" + data);
|
||||
if ("200".equals(json.getInteger("code").toString())){
|
||||
|
||||
if ("200".equals(authResponse.getStatusCode())){
|
||||
// 根据ResponseEntity<String> responseEntity对象,获取body部分,body为json格式字符串
|
||||
String content = authResponse.getBody();
|
||||
// 将json字符串转化为json对象
|
||||
JSONObject json = JSONObject.parseObject(content);
|
||||
// 取出data部分对象
|
||||
JSONObject data = json.getJSONObject("data");
|
||||
JSONObject userInfo = data.getJSONObject("userInfo");
|
||||
sysUser.setUserName(userInfo.get("userName").toString());
|
||||
sysUser.setNickName(userInfo.get("name").toString());
|
||||
sysUser.setPhonenumber(userInfo.get("mobile").toString());
|
||||
loginUser.setSysUser(sysUser);
|
||||
loginUser = createUser(sysUser,loginUser);
|
||||
createUser(sysUser,loginUser);
|
||||
}
|
||||
return loginUser;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,16 +8,12 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: bonus-ai
|
||||
username: nacos
|
||||
password: nacos
|
||||
server-addr: 192.168.0.14:8848
|
||||
namespace: f648524d-0a7b-449e-8f92-64e05236fd51
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: bonus-ai
|
||||
username: nacos
|
||||
password: nacos
|
||||
server-addr: 192.168.0.14:8848
|
||||
namespace: f648524d-0a7b-449e-8f92-64e05236fd51
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
|||
|
|
@ -1,27 +0,0 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 58081
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: jyy_canteen
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: jyy_canteen
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
|
||||
#加密组件
|
||||
jasypt:
|
||||
encryptor:
|
||||
password: Encrypt
|
||||
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 58081
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: smart_canteen
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: smart_canteen
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
|
||||
#加密组件
|
||||
jasypt:
|
||||
encryptor:
|
||||
password: Encrypt
|
||||
|
||||
|
|
@ -63,9 +63,9 @@ public class SafeUtil {
|
|||
* @return 如果包含特殊脚本字符返回true,否则返回false
|
||||
*/
|
||||
public static boolean checkScript(String mark) {
|
||||
if (mark != null && !"".equals(mark)) {
|
||||
return match(SAFE_SCRIPT_PATTERN, mark.toLowerCase().trim());
|
||||
}
|
||||
// if (mark != null && !"".equals(mark)) {
|
||||
// return match(SAFE_SCRIPT_PATTERN, mark.toLowerCase().trim());
|
||||
// }
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ public class DateUtilsTest {
|
|||
|
||||
@Test
|
||||
public void testGetMonthOrDay() {
|
||||
String monthOrDay = DateUtils.getMonthOrDay(28, "/");
|
||||
String monthOrDay = DateUtils.getMonthOrDay(30, "/");
|
||||
assertNotNull(monthOrDay);
|
||||
assertTrue(monthOrDay.matches("\\d{2}/\\d{2}"));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,9 +40,6 @@ public class AuthLogic
|
|||
/** 管理员角色权限标识 */
|
||||
private static final String SUPER_ADMIN = "admin";
|
||||
|
||||
/** 管理员角色权限标识 */
|
||||
private static final String COMPANY_ADMIN = "company_admin";
|
||||
|
||||
public TokenService tokenService = SpringUtils.getBean(TokenService.class);
|
||||
|
||||
|
||||
|
|
@ -432,6 +429,6 @@ public class AuthLogic
|
|||
public boolean hasRole(Collection<String> roles, String role)
|
||||
{
|
||||
return roles.stream().filter(StringUtils::hasText)
|
||||
.anyMatch(x -> SUPER_ADMIN.equals(x) || COMPANY_ADMIN.equals(x) || PatternMatchUtils.simpleMatch(x, role));
|
||||
.anyMatch(x -> SUPER_ADMIN.equals(x) || PatternMatchUtils.simpleMatch(x, role));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,8 +25,7 @@ import static org.springframework.http.MediaType.MULTIPART_FORM_DATA_VALUE;
|
|||
public class ParamSecureHandler implements AsyncHandlerInterceptor {
|
||||
|
||||
private static final String [] WHITE_URL = {
|
||||
"/login", "/isAdmin", "/isLogin" ,"/register","/user/register","/operlog/addLogs","/job/edit",
|
||||
"/user","/user/resetPwd","/user/profile/updatePwd","/user/confirmPassword","/dept","/dept/edit"};
|
||||
"/login", "/isAdmin", "/isLogin" ,"/register","/user/register","/operlog/addLogs","/job/edit","/user","/user/resetPwd","/user/profile/updatePwd","/user/confirmPassword"};
|
||||
private String rnd = null;
|
||||
|
||||
public static String ur = "/";
|
||||
|
|
|
|||
|
|
@ -52,8 +52,11 @@
|
|||
</dependency>
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Loadbalancer -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
|
|
|
|||
|
|
@ -7,16 +7,12 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: bonus-ai
|
||||
username: nacos
|
||||
password: nacos
|
||||
server-addr: 192.168.0.14:8848
|
||||
namespace: f648524d-0a7b-449e-8f92-64e05236fd51
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: bonus-ai
|
||||
username: nacos
|
||||
password: nacos
|
||||
server-addr: 192.168.0.14:8848
|
||||
namespace: f648524d-0a7b-449e-8f92-64e05236fd51
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
@ -27,13 +23,13 @@ spring:
|
|||
eager: true
|
||||
transport:
|
||||
# 控制台地址
|
||||
dashboard: 192.168.0.16:18858
|
||||
dashboard: 192.168.0.14:18858
|
||||
# nacos配置持久化
|
||||
datasource:
|
||||
ds1:
|
||||
nacos:
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: bonus-ai
|
||||
server-addr: 192.168.0.14:8848
|
||||
namespace: f648524d-0a7b-449e-8f92-64e05236fd51
|
||||
dataId: sentinel-bonus-gateway
|
||||
groupId: DEFAULT_GROUP
|
||||
data-type: json
|
||||
|
|
|
|||
|
|
@ -1,43 +0,0 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 58080
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: jyy_canteen
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: jyy_canteen
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
sentinel:
|
||||
# 取消控制台懒加载
|
||||
eager: true
|
||||
transport:
|
||||
# 控制台地址
|
||||
dashboard: 127.0.0.1:18858
|
||||
# nacos配置持久化
|
||||
datasource:
|
||||
ds1:
|
||||
nacos:
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: sgzb_bns
|
||||
dataId: sentinel-bonus-gateway
|
||||
groupId: DEFAULT_GROUP
|
||||
data-type: json
|
||||
rule-type: gw-flow
|
||||
|
||||
#加密组件
|
||||
jasypt:
|
||||
encryptor:
|
||||
password: Encrypt
|
||||
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 58080
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: smart_canteen
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: smart_canteen
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
sentinel:
|
||||
# 取消控制台懒加载
|
||||
eager: true
|
||||
transport:
|
||||
# 控制台地址
|
||||
dashboard: 127.0.0.1:18858
|
||||
# nacos配置持久化
|
||||
datasource:
|
||||
ds1:
|
||||
nacos:
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: sgzb_bns
|
||||
dataId: sentinel-bonus-gateway
|
||||
groupId: DEFAULT_GROUP
|
||||
data-type: json
|
||||
rule-type: gw-flow
|
||||
|
||||
#加密组件
|
||||
jasypt:
|
||||
encryptor:
|
||||
password: Encrypt
|
||||
|
||||
|
|
@ -36,10 +36,10 @@
|
|||
</dependency>
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
<!--<dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>-->
|
||||
</dependency>
|
||||
|
||||
<!-- FastDFS -->
|
||||
<dependency>
|
||||
|
|
@ -116,4 +116,4 @@
|
|||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
</project>
|
||||
|
|
@ -105,9 +105,7 @@ public class FaceGroupsServiceImpl implements FaceGroupsService {
|
|||
try {
|
||||
for (Long groupId : groupIds) {
|
||||
FaceGroupsEntity faceGroupsEntity = faceGroupsMapper.selectFaceGroupsByGroupId(groupId);
|
||||
if (ObjectUtils.isNotEmpty(faceGroupsEntity)) {
|
||||
int i = faceGroupsMapper.deleteFaceDataByGroupCode(faceGroupsEntity.getGroupCode());
|
||||
}
|
||||
int i = faceGroupsMapper.deleteFaceDataByGroupCode(faceGroupsEntity.getGroupCode());
|
||||
}
|
||||
int rows = faceGroupsMapper.deleteFaceGroupsByGroupIds(groupIds);
|
||||
return rows > 0 ? AjaxResult.success() : AjaxResult.error();
|
||||
|
|
|
|||
|
|
@ -16,47 +16,50 @@
|
|||
</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- FastDFS -->
|
||||
<dependency>
|
||||
<groupId>com.github.tobato</groupId>
|
||||
<artifactId>fastdfs-client</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- Minio -->
|
||||
<dependency>
|
||||
<groupId>io.minio</groupId>
|
||||
<artifactId>minio</artifactId>
|
||||
<version>${minio.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- bonus Api System -->
|
||||
<dependency>
|
||||
<groupId>com.bonus</groupId>
|
||||
<artifactId>bonus-api-system</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- bonus Common Swagger -->
|
||||
<dependency>
|
||||
<groupId>com.bonus</groupId>
|
||||
|
|
@ -133,5 +136,5 @@
|
|||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
||||
</project>
|
||||
|
|
@ -6,16 +6,14 @@ server:
|
|||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
username: nacos
|
||||
password: nacos
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: bonus-ai
|
||||
server-addr: 192.168.0.14:8848
|
||||
namespace: f648524d-0a7b-449e-8f92-64e05236fd51
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: bonus-ai
|
||||
server-addr: 192.168.0.14:8848
|
||||
namespace: f648524d-0a7b-449e-8f92-64e05236fd51
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
|||
|
|
@ -1,21 +0,0 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 59300
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: jyy_canteen
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: jyy_canteen
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 59300
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: smart_canteen
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: smart_canteen
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
|
|
@ -16,53 +16,56 @@
|
|||
</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Swagger UI -->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>${swagger.fox.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- Apache Velocity -->
|
||||
<dependency>
|
||||
<groupId>org.apache.velocity</groupId>
|
||||
<artifactId>velocity-engine-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- bonus Common Log -->
|
||||
<dependency>
|
||||
<groupId>com.bonus</groupId>
|
||||
<artifactId>bonus-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- bonus Common Swagger -->
|
||||
<dependency>
|
||||
<groupId>com.bonus</groupId>
|
||||
|
|
@ -92,5 +95,5 @@
|
|||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
||||
</project>
|
||||
|
|
@ -16,34 +16,38 @@
|
|||
</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Swagger UI -->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>${swagger.fox.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- Quartz -->
|
||||
<dependency>
|
||||
<groupId>org.quartz-scheduler</groupId>
|
||||
|
|
@ -55,19 +59,19 @@
|
|||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- bonus Common Log -->
|
||||
<dependency>
|
||||
<groupId>com.bonus</groupId>
|
||||
<artifactId>bonus-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- bonus Common Swagger -->
|
||||
<dependency>
|
||||
<groupId>com.bonus</groupId>
|
||||
|
|
@ -79,10 +83,6 @@
|
|||
<artifactId>jasypt-spring-boot-starter</artifactId>
|
||||
<version>${jasypt-spring-boot-starter.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.bonus</groupId>
|
||||
<artifactId>bonus-api-system</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
@ -101,5 +101,5 @@
|
|||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
||||
</project>
|
||||
|
|
@ -8,13 +8,13 @@
|
|||
<version>24.12.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
<artifactId>bonus-system</artifactId>
|
||||
|
||||
<description>
|
||||
bonus-modules-system系统模块
|
||||
</description>
|
||||
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!--加密依赖包-->
|
||||
|
|
@ -28,57 +28,57 @@
|
|||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
<!-- <dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>-->
|
||||
|
||||
</dependency>
|
||||
|
||||
<!-- Swagger UI -->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>${swagger.fox.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- bonus Common DataSource -->
|
||||
<dependency>
|
||||
<groupId>com.bonus</groupId>
|
||||
<artifactId>bonus-common-datasource</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- bonus Common DataScope -->
|
||||
<dependency>
|
||||
<groupId>com.bonus</groupId>
|
||||
<artifactId>bonus-common-datascope</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- bonus Common Log -->
|
||||
<dependency>
|
||||
<groupId>com.bonus</groupId>
|
||||
<artifactId>bonus-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
<!-- bonus Common Swagger -->
|
||||
<dependency>
|
||||
<groupId>com.bonus</groupId>
|
||||
|
|
@ -128,5 +128,5 @@
|
|||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
||||
</project>
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
package com.bonus.system.controller;
|
||||
|
||||
import com.bonus.system.api.domain.SysAddress;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.bonus.system.service.ISysAddressService;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 地址管理Controller
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-01-06
|
||||
*/
|
||||
@Api(tags = "地址管理接口")
|
||||
@RestController
|
||||
@RequestMapping("/address")
|
||||
public class SysAddressController extends BaseController {
|
||||
@Autowired
|
||||
private ISysAddressService sysAddressService;
|
||||
|
||||
/**
|
||||
* 查询地址列表
|
||||
*/
|
||||
@ApiOperation(value = "查询地址列表")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(SysAddress sysAddress) {
|
||||
List<SysAddress> list = sysAddressService.selectSysAddressList(sysAddress);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取地址详细信息
|
||||
*/
|
||||
@ApiOperation(value = "获取地址详细信息")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(sysAddressService.selectSysAddressById(id));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -14,9 +14,11 @@ import lombok.extern.slf4j.Slf4j;
|
|||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
|
@ -105,15 +107,15 @@ public class SysDeptController extends BaseController
|
|||
return toAjax(deptService.insertDept(dept));
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
return error("系统异常, " + e.getMessage());
|
||||
}
|
||||
return error("系统异常");
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改部门
|
||||
*/
|
||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("system:dept:edit"))
|
||||
@PostMapping("/edit")
|
||||
@PostMapping("/edit")
|
||||
@SysLog(title = "部门管理", businessType = OperaType.UPDATE,logType = 0,module = "系统管理->部门管理")
|
||||
public AjaxResult edit(@Validated @RequestBody SysDept dept) {
|
||||
try{
|
||||
|
|
@ -130,8 +132,8 @@ public class SysDeptController extends BaseController
|
|||
return toAjax(deptService.updateDept(dept));
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
return error("系统异常, " + e.getMessage());
|
||||
}
|
||||
return error("系统异常");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -172,46 +174,21 @@ public class SysDeptController extends BaseController
|
|||
return error("系统异常");
|
||||
}
|
||||
|
||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("system:dept:query"))
|
||||
@GetMapping("/deptList")
|
||||
@SysLog(title = "获取公司列表", businessType = OperaType.QUERY,logType = 0,module = "系统管理->获取公司列表")
|
||||
@SysLog(title = "获取公司列表", businessType = OperaType.QUERY,logType = 0,module = "系统管理->部门管理")
|
||||
public TableDataInfo deptList(SysDept dept) {
|
||||
if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())) {
|
||||
throw new ServiceException("抱歉,您无权查看公司列表!");
|
||||
}
|
||||
List<SysDept> deptList1 = new ArrayList<>();
|
||||
List<SysDept> deptList = new ArrayList<>();
|
||||
try{
|
||||
startPage();
|
||||
dept.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
|
||||
deptList1 = deptService.getDeptList(dept);
|
||||
List<SysDept> deptList2 = deptService.getCompanyUserCount();
|
||||
for (SysDept dept1 : deptList1) {
|
||||
for (SysDept dept2 : deptList2) {
|
||||
if (dept1.getDeptId().equals(dept2.getCompanyId())) {
|
||||
dept1.setUserCount(dept2.getUserCount());
|
||||
}
|
||||
}
|
||||
}
|
||||
return getDataTable(deptList1);
|
||||
deptList = deptService.getDeptList(dept);
|
||||
return getDataTable(deptList);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return getDataTableError(deptList1);
|
||||
return getDataTableError(deptList);
|
||||
}
|
||||
|
||||
@PostMapping("/turnOnOff")
|
||||
@SysLog(title = "注销或恢复公司", businessType = OperaType.UPDATE,logType = 0,module = "系统管理->注销或恢复公司")
|
||||
public AjaxResult turnOnOff(@Validated @RequestBody SysDept dept) {
|
||||
try{
|
||||
if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())) {
|
||||
throw new ServiceException("抱歉,您无权注销或恢复公司!");
|
||||
}
|
||||
log.info("公司信息{}",dept.getDeptId());
|
||||
return toAjax(deptService.turnOnOffDeptById(dept));
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return error("系统异常");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,148 +0,0 @@
|
|||
package com.bonus.system.controller;
|
||||
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import com.bonus.common.security.annotation.InnerAuth;
|
||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import com.bonus.common.security.annotation.RequiresPermissionsOrInnerAuth;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.system.api.domain.SysMenu;
|
||||
import com.bonus.system.api.domain.SysTemplate;
|
||||
import com.bonus.system.api.domain.SysTemplateMenu;
|
||||
import com.bonus.system.service.ISysMenuService;
|
||||
import com.bonus.system.service.ISysTemplateMenuService;
|
||||
import com.bonus.system.service.ISysTemplateService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 权限模板Controller
|
||||
*
|
||||
* @author bonus
|
||||
* @date 2025-01-05
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/template")
|
||||
@Slf4j
|
||||
public class SysTemplateController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private ISysTemplateService sysTemplateService;
|
||||
|
||||
@Autowired
|
||||
private ISysTemplateMenuService sysTemplateMenuService;
|
||||
|
||||
@Autowired
|
||||
private ISysMenuService menuService;
|
||||
|
||||
/**
|
||||
* 查询权限模板列表
|
||||
*/
|
||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("system:template:list"))
|
||||
@SysLog(title = "权限模板管理", businessType = OperaType.EXPORT,logType = 0,module = "公司管理->权限模板管理")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysTemplate sysTemplate) {
|
||||
if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())) {
|
||||
throw new ServiceException("抱歉,您无权查看公司权限列表!");
|
||||
}
|
||||
startPage();
|
||||
List<SysTemplate> list = sysTemplateService.selectSysTemplateList(sysTemplate);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载对应角色菜单列表树
|
||||
*/
|
||||
@GetMapping(value = "/templateMenuTreeselect/{tempId}")
|
||||
public AjaxResult templateMenuTreeselect(@PathVariable("tempId") Long tempId) {
|
||||
if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())) {
|
||||
throw new ServiceException("抱歉,您无权查看公司权限菜单列表!");
|
||||
}
|
||||
try{
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
List<SysMenu> menus = menuService.selectMenuList(userId);
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("checkedKeys", sysTemplateMenuService.queryMenuIdByTemplateId(tempId));
|
||||
ajax.put("menus", menuService.buildMenuTreeSelect(menus));
|
||||
return ajax;
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return error("系统异常");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出权限模板列表
|
||||
*/
|
||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("system:template:list"))
|
||||
@SysLog(title = "权限模板管理", businessType = OperaType.EXPORT,logType = 0,module = "公司管理->权限模板管理")
|
||||
@GetMapping("/export")
|
||||
public void export(HttpServletResponse response, SysTemplate sysTemplate) {
|
||||
if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())) {
|
||||
throw new ServiceException("抱歉,您无权查看公司权限列表!");
|
||||
}
|
||||
List<SysTemplate> list = sysTemplateService.selectSysTemplateList(sysTemplate);
|
||||
ExcelUtil<SysTemplate> util = new ExcelUtil<SysTemplate>(SysTemplate.class);
|
||||
util.exportExcel(response, list, "template");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取权限模板详细信息
|
||||
*/
|
||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("system:template:list"))
|
||||
@SysLog(title = "权限模板管理", businessType = OperaType.EXPORT,logType = 0,module = "公司管理->权限模板管理")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())) {
|
||||
throw new ServiceException("抱歉,您无权查看公司权限列表!");
|
||||
}
|
||||
return AjaxResult.success(sysTemplateService.selectSysTemplateById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增权限模板
|
||||
*/
|
||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("system:template:add"))
|
||||
@SysLog(title = "权限模板管理", businessType = OperaType.INSERT,logType = 0,module = "公司管理->权限模板管理")
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SysTemplate sysTemplate) {
|
||||
if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())) {
|
||||
throw new ServiceException("抱歉,您无权添加公司权限列表!");
|
||||
}
|
||||
return toAjax(sysTemplateService.insertSysTemplate(sysTemplate));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改权限模板
|
||||
*/
|
||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("system:template:edit"))
|
||||
@SysLog(title = "权限模板管理", businessType = OperaType.UPDATE,logType = 0,module = "公司管理->权限模板管理")
|
||||
@PostMapping("/edit")
|
||||
public AjaxResult edit(@RequestBody SysTemplate sysTemplate) {
|
||||
if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())) {
|
||||
throw new ServiceException("抱歉,您无权更新公司权限列表!");
|
||||
}
|
||||
return toAjax(sysTemplateService.updateSysTemplate(sysTemplate));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除权限模板
|
||||
*/
|
||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("system:template:edit"))
|
||||
@SysLog(title = "权限模板管理", businessType = OperaType.DELETE,logType = 0,module = "公司管理->权限模板管理")
|
||||
@PostMapping("/delete/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())) {
|
||||
throw new ServiceException("抱歉,您无权删除公司权限列表!");
|
||||
}
|
||||
return toAjax(sysTemplateService.deleteSysTemplateByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
package com.bonus.system.controller;
|
||||
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import com.bonus.common.security.annotation.InnerAuth;
|
||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import com.bonus.common.security.annotation.RequiresPermissionsOrInnerAuth;
|
||||
import com.bonus.system.api.domain.SysTemplateMenu;
|
||||
import com.bonus.system.service.ISysTemplateMenuService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 权限模板菜单Controller
|
||||
*
|
||||
* @author bonus
|
||||
* @date 2025-01-05
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/template_menu")
|
||||
public class SysTemplateMenuController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private ISysTemplateMenuService sysTemplateMenuService;
|
||||
|
||||
/**
|
||||
* 查询权限模板菜单
|
||||
*/
|
||||
// @RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("system:template:list"))
|
||||
// @SysLog(title = "权限模板菜单管理", businessType = OperaType.QUERY,logType = 0,module = "公司管理->权限模板菜单管理")
|
||||
// @GetMapping("/list")
|
||||
// public TableDataInfo list() {
|
||||
// //startPage();
|
||||
// List<SysTemplateMenu> list = sysTemplateMenuService.queryAll();
|
||||
// return getDataTable(list);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 新增权限模板菜单
|
||||
*/
|
||||
// @RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("system:template:add"))
|
||||
// @SysLog(title = "权限模板菜单管理", businessType = OperaType.INSERT,logType = 0,module = "公司管理->权限模板菜单管理")
|
||||
// @PostMapping
|
||||
// public AjaxResult add(@RequestBody List<SysTemplateMenu> list) {
|
||||
// return toAjax(sysTemplateMenuService.batchInsert(list));
|
||||
// }
|
||||
}
|
||||
|
|
@ -140,10 +140,6 @@ public class SysUserController extends BaseController {
|
|||
if (StringUtils.isNull(sysUser)) {
|
||||
return R.fail("用户名或密码错误");
|
||||
}
|
||||
SysDept sysDept = deptService.selectActiveDeptById(sysUser.getCompanyId());
|
||||
if (StringUtils.isNull(sysDept)) {
|
||||
return R.fail("用户所在公司停用或注销");
|
||||
}
|
||||
// 角色集合
|
||||
Set<String> roles = permissionService.getRolePermission(sysUser);
|
||||
// 权限集合
|
||||
|
|
@ -166,10 +162,6 @@ public class SysUserController extends BaseController {
|
|||
if (StringUtils.isNull(sysUser)) {
|
||||
return R.fail("用户名或密码错误");
|
||||
}
|
||||
SysDept sysDept = deptService.selectActiveDeptById(sysUser.getCompanyId());
|
||||
if (StringUtils.isNull(sysDept)) {
|
||||
return R.fail("用户所在公司停用或注销");
|
||||
}
|
||||
// 角色集合
|
||||
Set<String> roles = permissionService.getRolePermission(sysUser);
|
||||
// 权限集合
|
||||
|
|
@ -191,10 +183,6 @@ public class SysUserController extends BaseController {
|
|||
if (StringUtils.isNull(sysUser)) {
|
||||
return R.fail("用户名或密码错误");
|
||||
}
|
||||
SysDept sysDept = deptService.selectActiveDeptById(sysUser.getCompanyId());
|
||||
if (StringUtils.isNull(sysDept)) {
|
||||
return R.fail("用户所在公司停用或注销");
|
||||
}
|
||||
// 角色集合
|
||||
Set<String> roles = permissionService.getRolePermission(sysUser);
|
||||
// 权限集合
|
||||
|
|
|
|||
|
|
@ -1,31 +0,0 @@
|
|||
package com.bonus.system.mapper;
|
||||
|
||||
import com.bonus.system.api.domain.SysAddress;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 地址管理Mapper接口
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-01-06
|
||||
*/
|
||||
public interface SysAddressMapper {
|
||||
|
||||
/**
|
||||
* 查询地址管理列表
|
||||
*
|
||||
* @param sysAddress 地址管理
|
||||
* @return 地址管理集合
|
||||
*/
|
||||
public List<SysAddress> selectSysAddressList(SysAddress sysAddress);
|
||||
|
||||
/**
|
||||
* 查询地址管理
|
||||
*
|
||||
* @param id 地址管理主键
|
||||
* @return 地址管理
|
||||
*/
|
||||
public SysAddress selectSysAddressById(Long id);
|
||||
|
||||
}
|
||||
|
|
@ -23,13 +23,6 @@ public interface SysDeptMapper
|
|||
|
||||
List<SysDept> getDeptList(SysDept dept);
|
||||
|
||||
/**
|
||||
* 获取省市县区
|
||||
* @param areaVo
|
||||
* @return
|
||||
*/
|
||||
// List<AreaVo> getArea(AreaVo areaVo);
|
||||
|
||||
/**
|
||||
* 查询部门人员树列表
|
||||
*
|
||||
|
|
@ -55,14 +48,6 @@ public interface SysDeptMapper
|
|||
*/
|
||||
public SysDept selectDeptById(Long deptId);
|
||||
|
||||
/**
|
||||
* 根据部门ID查询信息
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @return 部门信息
|
||||
*/
|
||||
public SysDept selectActiveDeptById(Long deptId);
|
||||
|
||||
/**
|
||||
* 根据ID查询所有子部门
|
||||
*
|
||||
|
|
@ -143,21 +128,10 @@ public interface SysDeptMapper
|
|||
*/
|
||||
public int deleteDeptById(Long deptId);
|
||||
|
||||
/**
|
||||
* 注销或恢复公司
|
||||
*
|
||||
* @param dept 当前公司
|
||||
*/
|
||||
public int turnOnOffDeptById(SysDept dept);
|
||||
|
||||
public List<SysDept> getCompanyUserCount();
|
||||
|
||||
/**
|
||||
* 获取公司管理员详情
|
||||
* @param deptId
|
||||
* @return
|
||||
*/
|
||||
public SysUser selectCompanyAdminByDept(@Param("deptId") Long deptId);
|
||||
|
||||
public int getDeptCountByMenuTemplateId(@Param("tempId") Long tempId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ public interface SysTemplateMapper
|
|||
* @param id 权限模板ID
|
||||
* @return 权限模板
|
||||
*/
|
||||
public SysTemplate selectSysTemplateById(Long id);
|
||||
public SysTemplate selectSysTemplateById(String id);
|
||||
|
||||
/**
|
||||
* 查询权限模板列表
|
||||
|
|
@ -57,5 +57,5 @@ public interface SysTemplateMapper
|
|||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysTemplateByIds(Long[] ids);
|
||||
public int deleteSysTemplateByIds(String[] ids);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package com.bonus.system.mapper;
|
||||
|
||||
|
||||
import com.bonus.system.api.domain.SysTemplateMenu;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -16,38 +18,36 @@ public interface SysTemplateMenuMapper {
|
|||
/**
|
||||
* 查询指定行数据
|
||||
*
|
||||
* @param
|
||||
* @param
|
||||
* @param offset 查询起始位置
|
||||
* @param limit 查询条数
|
||||
* @return 对象列表
|
||||
*/
|
||||
List<SysTemplateMenu> queryAll();
|
||||
List<SysTemplateMenu> queryAllByLimit(@Param("offset") int offset, @Param("limit") int limit);
|
||||
|
||||
|
||||
/**
|
||||
* 通过实体作为筛选条件查询
|
||||
*
|
||||
* @param tempId
|
||||
* @param sysTempMenu 实例对象
|
||||
* @return 对象列表
|
||||
*/
|
||||
List<Long> queryMenuIdByTemplateId(Long tempId);
|
||||
List<SysTemplateMenu> queryAll(SysTemplateMenu sysTempMenu);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param sysTemplateMenu 实例对象
|
||||
* @param sysTempMenu 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insert(SysTemplateMenu sysTemplateMenu);
|
||||
|
||||
int batchInsert(@Param("list") List<SysTemplateMenu> list);
|
||||
int insert(SysTemplateMenu sysTempMenu);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param sysTemplateMenu 实例对象
|
||||
* @param sysTempMenu 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int update(SysTemplateMenu sysTemplateMenu);
|
||||
int update(SysTemplateMenu sysTempMenu);
|
||||
|
||||
/**
|
||||
* 根据模板删除菜单信息
|
||||
|
|
@ -55,5 +55,5 @@ public interface SysTemplateMenuMapper {
|
|||
* @param tempId
|
||||
* @return
|
||||
*/
|
||||
int deleteByTempId(@Param("tempId") Long tempId);
|
||||
int deleteByTempId(@Param("tempId") String tempId);
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
package com.bonus.system.service;
|
||||
|
||||
import com.bonus.system.api.domain.SysAddress;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 地址管理Service接口
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-01-06
|
||||
*/
|
||||
public interface ISysAddressService {
|
||||
|
||||
/**
|
||||
* 查询地址管理列表
|
||||
*
|
||||
* @param sysAddress 地址管理
|
||||
* @return 地址管理集合
|
||||
*/
|
||||
public List<SysAddress> selectSysAddressList(SysAddress sysAddress);
|
||||
|
||||
/**
|
||||
* 查询地址管理
|
||||
*
|
||||
* @param id 地址管理主键
|
||||
* @return 地址管理
|
||||
*/
|
||||
public SysAddress selectSysAddressById(Long id);
|
||||
|
||||
}
|
||||
|
|
@ -22,8 +22,6 @@ public interface ISysDeptService
|
|||
|
||||
public List<SysDept> getDeptList(SysDept dept);
|
||||
|
||||
public List<SysDept> getCompanyUserCount();
|
||||
|
||||
/**
|
||||
* 查询部门树结构信息
|
||||
*
|
||||
|
|
@ -72,8 +70,6 @@ public interface ISysDeptService
|
|||
*/
|
||||
public SysDept selectDeptById(Long deptId);
|
||||
|
||||
public SysDept selectActiveDeptById(Long deptId);
|
||||
|
||||
/**
|
||||
* 根据ID查询所有子部门(正常状态)
|
||||
*
|
||||
|
|
@ -136,11 +132,4 @@ public interface ISysDeptService
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteDeptById(Long deptId);
|
||||
|
||||
/**
|
||||
* 注销或恢复公司
|
||||
*
|
||||
* @param dept 当前公司
|
||||
*/
|
||||
public int turnOnOffDeptById(SysDept dept);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,48 +0,0 @@
|
|||
package com.bonus.system.service;
|
||||
|
||||
import com.bonus.system.api.domain.SysTemplate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 权限模板Service接口
|
||||
*
|
||||
* @author bonus
|
||||
* @date 2025-01-05
|
||||
*/
|
||||
public interface ISysTemplateService
|
||||
{
|
||||
/**
|
||||
* 查询权限模板
|
||||
*
|
||||
* @param id 权限模板ID
|
||||
* @return 权限模板
|
||||
*/
|
||||
public SysTemplate selectSysTemplateById(Long id);
|
||||
|
||||
/**
|
||||
* 查询权限模板列表
|
||||
*
|
||||
* @param sysTemplate 权限模板
|
||||
* @return 权限模板集合
|
||||
*/
|
||||
public List<SysTemplate> selectSysTemplateList(SysTemplate sysTemplate);
|
||||
|
||||
/**
|
||||
* 新增权限模板
|
||||
*
|
||||
* @param sysTemplate 权限模板
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysTemplate(SysTemplate sysTemplate);
|
||||
|
||||
/**
|
||||
* 修改权限模板
|
||||
*
|
||||
* @param sysTemplate 权限模板
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysTemplate(SysTemplate sysTemplate);
|
||||
|
||||
public int deleteSysTemplateByIds(Long[] ids);
|
||||
|
||||
}
|
||||
|
|
@ -9,16 +9,16 @@ import java.util.List;
|
|||
* @author bonus
|
||||
* @since 2025-01-05
|
||||
*/
|
||||
public interface ISysTemplateMenuService {
|
||||
public interface SysTemplateMenuService {
|
||||
|
||||
/**
|
||||
* 查询多条数据
|
||||
*
|
||||
* @param
|
||||
* @param
|
||||
* @param offset 查询起始位置
|
||||
* @param limit 查询条数
|
||||
* @return 对象列表
|
||||
*/
|
||||
public List<Long> queryMenuIdByTemplateId(Long tempId);
|
||||
List<SysTemplateMenu> queryAllByLimit(int offset, int limit);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
|
|
@ -28,8 +28,6 @@ public interface ISysTemplateMenuService {
|
|||
*/
|
||||
SysTemplateMenu insert(SysTemplateMenu sysTemplateMenu);
|
||||
|
||||
public int batchInsert(List<SysTemplateMenu> list);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
package com.bonus.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.bonus.system.api.domain.SysAddress;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.bonus.system.mapper.SysAddressMapper;
|
||||
import com.bonus.system.service.ISysAddressService;
|
||||
|
||||
/**
|
||||
* 地址管理Service业务层处理
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-01-06
|
||||
*/
|
||||
@Service
|
||||
public class SysAddressServiceImpl implements ISysAddressService {
|
||||
@Autowired
|
||||
private SysAddressMapper sysAddressMapper;
|
||||
|
||||
/**
|
||||
* 查询地址管理列表
|
||||
*
|
||||
* @param sysAddress 地址管理
|
||||
* @return 地址管理
|
||||
*/
|
||||
@Override
|
||||
public List<SysAddress> selectSysAddressList(SysAddress sysAddress) {
|
||||
return sysAddressMapper.selectSysAddressList(sysAddress);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询地址管理
|
||||
*
|
||||
* @param id 地址管理主键
|
||||
* @return 地址管理
|
||||
*/
|
||||
@Override
|
||||
public SysAddress selectSysAddressById(Long id) {
|
||||
return sysAddressMapper.selectSysAddressById(id);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -4,9 +4,11 @@ import java.util.*;
|
|||
import java.util.stream.Collectors;
|
||||
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import com.bonus.common.core.utils.encryption.Sm4Utils;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import com.bonus.config.SystemConfig;
|
||||
import com.bonus.system.api.domain.*;
|
||||
import com.bonus.system.domain.SysRoleDept;
|
||||
import com.bonus.system.domain.SysRoleMenu;
|
||||
import com.bonus.system.mapper.*;
|
||||
import com.bonus.common.datascope.utils.CommonDataPermissionInfo;
|
||||
|
|
@ -25,7 +27,6 @@ import com.bonus.common.datascope.annotation.DataScope;
|
|||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.system.domain.vo.TreeSelect;
|
||||
import com.bonus.system.service.ISysDeptService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
|
|
@ -95,11 +96,6 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
return deptMapper.getDeptList(dept);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysDept> getCompanyUserCount() {
|
||||
return deptMapper.getCompanyUserCount();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询部门树结构信息
|
||||
*
|
||||
|
|
@ -211,12 +207,6 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
return sysDept;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysDept selectActiveDeptById(Long deptId)
|
||||
{
|
||||
return deptMapper.selectActiveDeptById(deptId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID查询所有子部门(正常状态)
|
||||
*
|
||||
|
|
@ -303,7 +293,6 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int insertDept(SysDept dept)
|
||||
{
|
||||
//增加根公司的处理
|
||||
|
|
@ -311,8 +300,9 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
dept.setParentId(0L);
|
||||
dept.setAncestors("0");
|
||||
dept.setStatus("0");//默认启用
|
||||
dept.setMenuTemplateId(1L);//TODO 将来用前端传的模版ID
|
||||
int result = deptMapper.insertDept(dept);
|
||||
if (SecurityUtils.isAdmin(SecurityUtils.getUserId()) && systemConfig.isAddRootCompany() && result > 0) {
|
||||
if (systemConfig.isAddRootCompany() && result > 0) {
|
||||
if (StringUtils.isNotNull(dept.getSysUser()) && !userService.checkUserNameUnique(dept.getSysUser())) {
|
||||
throw new ServiceException("新增公司管理员用户'" + dept.getSysUser().getUserName() + "'失败,登录账号已存在");
|
||||
}
|
||||
|
|
@ -338,7 +328,6 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int updateDept(SysDept dept)
|
||||
{
|
||||
SysDept newParentDept = deptMapper.selectDeptById(dept.getParentId());
|
||||
|
|
@ -358,15 +347,8 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
updateParentDeptStatusNormal(dept);
|
||||
}
|
||||
//判断是否需要修改公司管理员用户信息
|
||||
if (SecurityUtils.isAdmin(SecurityUtils.getUserId()) && systemConfig.isAddRootCompany() && Objects.nonNull(dept.getParentId()) && dept.getParentId().equals(0L)){
|
||||
SysUser companyAdminUser = dept.getSysUser();
|
||||
if (Objects.nonNull(companyAdminUser.getRoleId())) {
|
||||
companyAdminUser.setUpdateBy(SecurityUtils.getUsername());
|
||||
companyAdminUser.setUpdateTime(DateUtils.getNowDate());
|
||||
roleMenuMapper.deleteRoleMenuByRoleId(companyAdminUser.getRoleId());
|
||||
batchInsertRoleMenuFromTemplate(dept, companyAdminUser.getRoleId());
|
||||
userMapper.updateUser(companyAdminUser);
|
||||
}
|
||||
if (systemConfig.isAddRootCompany() && Objects.nonNull(dept.getParentId()) && dept.getParentId().equals(0L)){
|
||||
updateCompanyAdminUserAndRole(dept);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
@ -415,17 +397,6 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
return deptMapper.deleteDeptById(deptId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 注销或恢复公司
|
||||
*
|
||||
* @param dept 当前公司
|
||||
*/
|
||||
@Override
|
||||
public int turnOnOffDeptById(SysDept dept)
|
||||
{
|
||||
return deptMapper.turnOnOffDeptById(dept);
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归列表
|
||||
*/
|
||||
|
|
@ -502,6 +473,14 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
roleMapper.insertRole(role);
|
||||
log.info("创建的角色id为:{}",role.getRoleId());
|
||||
|
||||
//绑定管理员角色和公司关系
|
||||
List<SysRoleDept> roleDeptList = new ArrayList<>();
|
||||
SysRoleDept rd = new SysRoleDept();
|
||||
rd.setRoleId(Long.valueOf(role.getRoleId()));
|
||||
rd.setDeptId(sysDept.getDeptId());
|
||||
roleDeptList.add(rd);
|
||||
roleDeptMapper.batchRoleDept(roleDeptList);
|
||||
|
||||
//用户绑定角色
|
||||
SysUserRole sysUserRole = new SysUserRole();
|
||||
sysUserRole.setUserId(user.getUserId());
|
||||
|
|
@ -511,20 +490,32 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
userRoleMapper.batchUserRole(sysUserRoleList);
|
||||
|
||||
//对初始化管理员赋值菜单权限
|
||||
batchInsertRoleMenuFromTemplate(sysDept, role.getRoleId());
|
||||
}
|
||||
|
||||
private void batchInsertRoleMenuFromTemplate(SysDept sysDept, Long roleId) {
|
||||
List<SysRoleMenu> sysRoleMenulist = new ArrayList<>();
|
||||
List<Long> menuIds = sysTemplateMenuMapper.queryMenuIdByTemplateId(sysDept.getMenuTemplateId());
|
||||
SysTemplateMenu sysTemplateMenu = new SysTemplateMenu();
|
||||
sysTemplateMenu.setTempId(sysDept.getMenuTemplateId());
|
||||
List<SysTemplateMenu> sysTemplateMenus = sysTemplateMenuMapper.queryAll(sysTemplateMenu);
|
||||
SysRoleMenu sysRoleMenu = null;
|
||||
for (Long menuId : menuIds) {
|
||||
for (SysTemplateMenu stm : sysTemplateMenus) {
|
||||
sysRoleMenu = new SysRoleMenu();
|
||||
sysRoleMenu.setRoleId(roleId);
|
||||
sysRoleMenu.setMenuId(menuId);
|
||||
sysRoleMenu.setRoleId(role.getRoleId());
|
||||
sysRoleMenu.setMenuId(stm.getMenuId());
|
||||
sysRoleMenulist.add(sysRoleMenu);
|
||||
}
|
||||
roleMenuMapper.batchRoleMenu(sysRoleMenulist);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改公司管理员用户和角色信息
|
||||
* @param dept
|
||||
*/
|
||||
private void updateCompanyAdminUserAndRole(SysDept dept) {
|
||||
SysUser oldCompanyAdmin = deptMapper.selectCompanyAdminByDept(dept.getDeptId());
|
||||
SysUser user = dept.getSysUser();
|
||||
user.setUpdateBy(SecurityUtils.getUsername());
|
||||
user.setUpdateTime(DateUtils.getNowDate());
|
||||
user.setDeptId(dept.getDeptId());
|
||||
user.setUserId(oldCompanyAdmin.getUserId());
|
||||
userMapper.updateUser(user);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -60,12 +60,8 @@ public class SysRoleServiceImpl implements ISysRoleService
|
|||
public List<SysRole> selectRoleList(SysRole role)
|
||||
{
|
||||
try {
|
||||
String beginTime = (String) role.getParams().get("beginTime");
|
||||
String endTime = (String) role.getParams().get("endTime");
|
||||
BaseEntity entity = CommonDataPermissionInfo.backMissionInfo(role.getParams().get("dataScope").toString());
|
||||
BeanUtils.copyProperties(entity, role);
|
||||
role.getParams().put("beginTime", beginTime);
|
||||
role.getParams().put("endTime", endTime);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,9 +2,8 @@ package com.bonus.system.service.impl;
|
|||
|
||||
import com.bonus.system.api.domain.SysTemplateMenu;
|
||||
import com.bonus.system.mapper.SysTemplateMenuMapper;
|
||||
import com.bonus.system.service.ISysTemplateMenuService;
|
||||
import com.bonus.system.service.SysTemplateMenuService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -15,44 +14,35 @@ import java.util.List;
|
|||
* @since 2025-01-05
|
||||
*/
|
||||
@Service("sysTempMenuService")
|
||||
public class SysTemplateMenuServiceImpl implements ISysTemplateMenuService {
|
||||
public class SysTemplateMenuServiceImpl implements SysTemplateMenuService {
|
||||
@Resource
|
||||
private SysTemplateMenuMapper sysTemplateMenuMapper;
|
||||
private SysTemplateMenuMapper sysTempMenuMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 查询多条数据
|
||||
*
|
||||
* @param
|
||||
* @param
|
||||
* @param offset 查询起始位置
|
||||
* @param limit 查询条数
|
||||
* @return 对象列表
|
||||
*/
|
||||
@Override
|
||||
public List<Long> queryMenuIdByTemplateId(Long tempId) {
|
||||
return this.sysTemplateMenuMapper.queryMenuIdByTemplateId(tempId);
|
||||
public List<SysTemplateMenu> queryAllByLimit(int offset, int limit) {
|
||||
return this.sysTempMenuMapper.queryAllByLimit(offset, limit);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param sysTemplateMenu
|
||||
* @param sysTemplateMenu 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public SysTemplateMenu insert(SysTemplateMenu sysTemplateMenu) {
|
||||
this.sysTemplateMenuMapper.insert(sysTemplateMenu);
|
||||
this.sysTempMenuMapper.insert(sysTemplateMenu);
|
||||
return sysTemplateMenu;
|
||||
}
|
||||
|
||||
public int batchInsert(List<SysTemplateMenu> list) {
|
||||
int result = 0;
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
sysTemplateMenuMapper.deleteByTempId(list.get(0).getTempId());
|
||||
result = sysTemplateMenuMapper.batchInsert(list);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
|
|
@ -61,7 +51,7 @@ public class SysTemplateMenuServiceImpl implements ISysTemplateMenuService {
|
|||
*/
|
||||
@Override
|
||||
public SysTemplateMenu update(SysTemplateMenu sysTemplateMenu) {
|
||||
this.sysTemplateMenuMapper.update(sysTemplateMenu);
|
||||
this.sysTempMenuMapper.update(sysTemplateMenu);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,126 +0,0 @@
|
|||
package com.bonus.system.service.impl;
|
||||
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.system.api.domain.SysTemplate;
|
||||
import com.bonus.system.api.domain.SysTemplateMenu;
|
||||
import com.bonus.system.mapper.SysDeptMapper;
|
||||
import com.bonus.system.mapper.SysTemplateMapper;
|
||||
import com.bonus.system.mapper.SysTemplateMenuMapper;
|
||||
import com.bonus.system.service.ISysTemplateService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 权限模板Service业务层处理
|
||||
*
|
||||
* @author bonus
|
||||
* @date 2025-01-05
|
||||
*/
|
||||
@Service
|
||||
public class SysTemplateServiceImpl implements ISysTemplateService {
|
||||
|
||||
@Autowired
|
||||
private SysTemplateMapper sysTemplateMapper;
|
||||
|
||||
@Autowired
|
||||
private SysTemplateMenuMapper sysTemplateMenuMapper;
|
||||
|
||||
@Autowired
|
||||
SysDeptMapper sysDeptMapper;
|
||||
|
||||
/**
|
||||
* 查询权限模板
|
||||
*
|
||||
* @param id 权限模板ID
|
||||
* @return 权限模板
|
||||
*/
|
||||
@Override
|
||||
public SysTemplate selectSysTemplateById(Long id) {
|
||||
return sysTemplateMapper.selectSysTemplateById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询权限模板列表
|
||||
*
|
||||
* @param sysTemplate 权限模板
|
||||
* @return 权限模板
|
||||
*/
|
||||
@Override
|
||||
public List<SysTemplate> selectSysTemplateList(SysTemplate sysTemplate) {
|
||||
return sysTemplateMapper.selectSysTemplateList(sysTemplate);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增权限模板
|
||||
*
|
||||
* @param sysTemplate 权限模板
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int insertSysTemplate(SysTemplate sysTemplate) {
|
||||
sysTemplate.setCreateBy(SecurityUtils.getUsername());
|
||||
List<Long> menuIds = sysTemplate.getMenuIds();
|
||||
if (CollectionUtils.isEmpty(menuIds)) {
|
||||
throw new ServiceException("权限不能为空");
|
||||
}
|
||||
sysTemplateMapper.insertSysTemplate(sysTemplate);
|
||||
resetSysTempMenus(sysTemplate, menuIds);
|
||||
return resetSysTempMenus(sysTemplate, menuIds);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改权限模板
|
||||
*
|
||||
* @param sysTemplate 权限模板
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int updateSysTemplate(SysTemplate sysTemplate) {
|
||||
sysTemplate.setUpdateBy(SecurityUtils.getUsername());
|
||||
List<Long> menuIds = sysTemplate.getMenuIds();
|
||||
if (CollectionUtils.isEmpty(menuIds)) {
|
||||
throw new ServiceException("权限不能为空");
|
||||
}
|
||||
resetSysTempMenus(sysTemplate, menuIds);
|
||||
return sysTemplateMapper.updateSysTemplate(sysTemplate);
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置模板对应的菜单
|
||||
*/
|
||||
private int resetSysTempMenus(SysTemplate sysTemplate, List<Long> menuIds) {
|
||||
sysTemplateMenuMapper.deleteByTempId(sysTemplate.getId());
|
||||
List<SysTemplateMenu> list = new ArrayList<>();
|
||||
SysTemplateMenu sysTempMenu = null;
|
||||
for (Long menuId : menuIds) {
|
||||
sysTempMenu = new SysTemplateMenu();
|
||||
sysTempMenu.setTempId(sysTemplate.getId());
|
||||
sysTempMenu.setMenuId(menuId);
|
||||
list.add(sysTempMenu);
|
||||
}
|
||||
return sysTemplateMenuMapper.batchInsert(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int deleteSysTemplateByIds(Long[] ids) {
|
||||
for (Long tempId : ids) {
|
||||
Integer count = sysDeptMapper.getDeptCountByMenuTemplateId(tempId);
|
||||
if (null != count && count > 0) {
|
||||
SysTemplate sysTemplate = sysTemplateMapper.selectSysTemplateById(tempId);
|
||||
throw new ServiceException(sysTemplate.getName() + "下存在公司,请重新分配模板后再尝试删除");
|
||||
}
|
||||
sysTemplateMenuMapper.deleteByTempId(tempId);
|
||||
}
|
||||
return sysTemplateMapper.deleteSysTemplateByIds(ids);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 58082
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: jyy_canteen
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: jyy_canteen
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
|
||||
#加密组件
|
||||
jasypt:
|
||||
encryptor:
|
||||
password: Encrypt
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 58082
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: smart_canteen
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: smart_canteen
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
|
||||
#加密组件
|
||||
jasypt:
|
||||
encryptor:
|
||||
password: Encrypt
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.system.mapper.SysAddressMapper">
|
||||
<resultMap type="com.bonus.system.api.domain.SysAddress" id="SysAddressResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="platformId" column="platform_id" />
|
||||
<result property="code" column="code" />
|
||||
<result property="parentCode" column="parent_code" />
|
||||
<result property="name" column="name" />
|
||||
<result property="latitude" column="latitude" />
|
||||
<result property="longitude" column="longitude" />
|
||||
<result property="level" column="level" />
|
||||
<result property="region" column="region" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysAddressVo">
|
||||
select id, platform_id, code, parent_code, name, latitude, longitude, level, region, create_time, update_time, del_flag from sys_address
|
||||
</sql>
|
||||
|
||||
<select id="selectSysAddressList" parameterType="com.bonus.system.api.domain.SysAddress" resultMap="SysAddressResult">
|
||||
<include refid="selectSysAddressVo"/>
|
||||
where parent_code = #{parentCode}
|
||||
</select>
|
||||
|
||||
<select id="selectSysAddressById" parameterType="Long" resultMap="SysAddressResult">
|
||||
<include refid="selectSysAddressVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -44,35 +44,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
d.status,
|
||||
d.del_flag,
|
||||
d.create_by,
|
||||
d.create_time
|
||||
from sys_dept d
|
||||
</sql>
|
||||
|
||||
<sql id="selectDeptVoWithMoreInfo">
|
||||
select d.dept_id,
|
||||
d.parent_id,
|
||||
d.ancestors,
|
||||
d.dept_name,
|
||||
d.order_num,
|
||||
d.leader,
|
||||
d.phone,
|
||||
d.email,
|
||||
d.status,
|
||||
d.del_flag,
|
||||
d.create_by,
|
||||
d.create_time,
|
||||
d.menu_template_id,
|
||||
d.province,
|
||||
d.city,
|
||||
d.district,
|
||||
d.address,
|
||||
d.create_time,
|
||||
d.menu_template_id,
|
||||
d.province,
|
||||
d.city,
|
||||
d.district,
|
||||
d.address,
|
||||
d.dept_abbreviation,
|
||||
d.remark,
|
||||
d.logo,
|
||||
d.admin_user_id,
|
||||
d.init_password
|
||||
from sys_dept d
|
||||
</sql>
|
||||
from sys_dept d
|
||||
</sql>
|
||||
|
||||
<select id="selectDeptList" parameterType="com.bonus.system.api.domain.SysDept" resultMap="SysDeptResult">
|
||||
<include refid="selectDeptVo"/>
|
||||
|
|
@ -98,14 +82,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
|
||||
<select id="getDeptList" resultType="com.bonus.system.api.domain.SysDept">
|
||||
select * from sys_dept sd where parent_id='0'
|
||||
select * from sys_dept sd where parent_id='0' and del_flag='0'
|
||||
<if test="companyId != null and companyId != 0">
|
||||
AND dept_id != #{companyId}
|
||||
</if>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and sd.dept_name like concat('%', #{keyWord}, '%')
|
||||
</if>
|
||||
Order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectDeptUserList" resultType="com.bonus.system.api.domain.SysDept">
|
||||
|
|
@ -156,13 +139,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
|
||||
<select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult">
|
||||
<include refid="selectDeptVoWithMoreInfo"/>
|
||||
where d.dept_id = #{deptId}
|
||||
</select>
|
||||
|
||||
<select id="selectActiveDeptById" parameterType="Long" resultMap="SysDeptResult">
|
||||
<include refid="selectDeptVoWithMoreInfo"/>
|
||||
where d.dept_id = #{deptId} and d.status = '0' and d.del_flag = '0'
|
||||
<include refid="selectDeptVo"/>
|
||||
where dept_id = #{deptId}
|
||||
</select>
|
||||
|
||||
<select id="checkDeptExistUser" parameterType="Long" resultType="int">
|
||||
|
|
@ -205,8 +183,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="logo != null and logo != ''">logo,</if>
|
||||
<if test="initPassword != null and initPassword != ''">init_password,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="menuTemplateId != null">menu_template_id,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
)values(
|
||||
|
|
@ -226,8 +204,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="logo != null and logo != ''">#{logo},</if>
|
||||
<if test="initPassword != null and initPassword != ''">#{initPassword},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="menuTemplateId != null">#{menuTemplateId},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
|
|
@ -252,7 +230,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="logo != null and logo != ''">logo = #{logo},</if>
|
||||
<if test="adminUserId != null and adminUserId != 0">admin_user_id = #{adminUserId},</if>
|
||||
<if test="initPassword != null and initPassword != ''">init_password = #{initPassword},</if>
|
||||
<if test="menuTemplateId != null and menuTemplateId != ''">menu_template_id = #{menuTemplateId},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
|
|
@ -284,37 +261,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
update sys_dept set del_flag = '2' where dept_id = #{deptId}
|
||||
</delete>
|
||||
|
||||
<delete id="turnOnOffDeptById" parameterType="com.bonus.system.api.domain.SysDept">
|
||||
update sys_dept set del_flag = #{delFlag} where dept_id = #{deptId}
|
||||
</delete>
|
||||
|
||||
<select id="getCompanyUserCount" resultType="com.bonus.system.api.domain.SysDept">
|
||||
SELECT
|
||||
CASE sd.ancestors
|
||||
WHEN ('0') THEN
|
||||
sd.dept_id
|
||||
ELSE
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(sd.ancestors, ',', 2), ',', -1)
|
||||
END as company_id,
|
||||
count(su.user_id) as user_count
|
||||
FROM `sys_user` su
|
||||
left join sys_dept sd on su.dept_id=sd.dept_id
|
||||
where su.del_flag='0'
|
||||
group by company_id
|
||||
</select>
|
||||
|
||||
<select id="selectCompanyAdminByDept" resultType="com.bonus.system.api.domain.SysUser">
|
||||
select su.nick_name as nickName, su.user_name as userName, su.phonenumber as phonenumber,
|
||||
su.user_id as userId, sd.dept_id as deptId, sur.role_id
|
||||
su.user_id as userId, sd.dept_id as deptId
|
||||
from sys_dept sd
|
||||
left join sys_user su on su.user_id = sd.admin_user_id
|
||||
left join sys_user_role sur on su.user_id = sur.user_id
|
||||
left join sys_role sr on sr.role_id = sur.role_id
|
||||
where sd.dept_id = #{deptId} and sr.role_key = 'company_admin'
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<select id="getDeptCountByMenuTemplateId" resultType="Integer">
|
||||
SELECT count(1) FROM `sys_dept` where parent_id = 0 and menu_template_id = #{tempId} and del_flag = '0'
|
||||
left join sys_user su on su.user_id = sd.admin_user_id
|
||||
where sd.dept_id = #{deptId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -8,14 +8,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="remark" column="remark" />
|
||||
<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="selectSysTemplateVo">
|
||||
select id, name, remark, create_by, create_time, update_by, update_time from sys_template
|
||||
select id, name, remark from sys_template
|
||||
</sql>
|
||||
|
||||
<select id="selectSysTemplateList" parameterType="com.bonus.system.api.domain.SysTemplate" resultMap="SysTemplateResult">
|
||||
|
|
@ -25,24 +21,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysTemplateById" parameterType="Long" resultMap="SysTemplateResult">
|
||||
<select id="selectSysTemplateById" parameterType="java.lang.String" resultMap="SysTemplateResult">
|
||||
<include refid="selectSysTemplateVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSysTemplate" parameterType="com.bonus.system.api.domain.SysTemplate" useGeneratedKeys="true" keyProperty="id">
|
||||
<insert id="insertSysTemplate" parameterType="com.bonus.system.api.domain.SysTemplate">
|
||||
insert into sys_template
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="name != null and name != ''">name,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
|
@ -51,8 +45,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">name = #{name},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
|
@ -61,7 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
delete from sys_template where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysTemplateByIds" parameterType="Long">
|
||||
<delete id="deleteSysTemplateByIds" parameterType="java.lang.String">
|
||||
delete from sys_template where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
<result property="menuId" column="menu_id" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
<!--查询指定行数据-->
|
||||
<select id="queryAllByLimit" resultMap="SysTemplateMenuMap">
|
||||
select
|
||||
|
|
@ -16,13 +17,18 @@
|
|||
</select>
|
||||
|
||||
<!--通过实体作为筛选条件查询-->
|
||||
<select id="queryMenuIdByTemplateId" resultType="Long">
|
||||
<select id="queryAll" resultMap="SysTemplateMenuMap">
|
||||
select
|
||||
menu_id
|
||||
from
|
||||
sys_template_menu
|
||||
where
|
||||
temp_id = #{tempId}
|
||||
temp_id, menu_id
|
||||
from sys_template_menu
|
||||
<where>
|
||||
<if test="tempId != null">
|
||||
and temp_id = #{tempId}
|
||||
</if>
|
||||
<if test="menuId != null">
|
||||
and menu_id = #{menuId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
|
|
@ -31,13 +37,6 @@
|
|||
values (#{tempId}, #{menuId})
|
||||
</insert>
|
||||
|
||||
<insert id="batchInsert">
|
||||
insert into sys_template_menu(temp_id, menu_id) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
(#{item.tempId},#{item.menuId})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!--通过主键修改数据-->
|
||||
<update id="update">
|
||||
update sys_template_menu
|
||||
|
|
|
|||
|
|
@ -96,7 +96,6 @@
|
|||
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_role r on r.role_id = ur.role_id
|
||||
left join sys_dept sd on r.company_id = sd.dept_id
|
||||
</sql>
|
||||
|
||||
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
|
|
@ -214,11 +213,11 @@
|
|||
|
||||
<select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult">
|
||||
<include refid="selectUserVo"/>
|
||||
where u.del_flag = '0' AND u.user_name = #{userName}
|
||||
where u.del_flag = '0'AND u.user_name = #{userName}
|
||||
</select>
|
||||
<select id="selectUserByPhoneNumber" resultMap="SysUserResult">
|
||||
<include refid="selectUserVo"/>
|
||||
where u.del_flag = '0'AND u.phonenumber = #{phoneNumber} AND sd.del_flag = '0' AND sd.status = '0'
|
||||
where u.del_flag = '0'AND u.phonenumber = #{phoneNumber}
|
||||
</select>
|
||||
<select id="selectUserByEmail" resultMap="SysUserResult">
|
||||
<include refid="selectUserVo"/>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
<version>24.12.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
<artifactId>bonus-visual-monitor</artifactId>
|
||||
|
||||
<description>
|
||||
|
|
@ -15,26 +15,20 @@
|
|||
</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
|
||||
<!-- SpringBoot Admin -->
|
||||
<dependency>
|
||||
<groupId>de.codecentric</groupId>
|
||||
<artifactId>spring-boot-admin-starter-server</artifactId>
|
||||
<version>${spring-boot-admin.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
|
|
@ -46,13 +40,13 @@
|
|||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- SpringBoot Web -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- Spring Security -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
|
@ -82,5 +76,5 @@
|
|||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
||||
</project>
|
||||
|
|
@ -12,16 +12,14 @@ spring:
|
|||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
username: nacos
|
||||
password: nacos
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
export deploy_path=/data/ceshi/gqk/Bonus-Cloud
|
||||
export deploy_path=/opt/webapps/bonus-cloud
|
||||
|
||||
export app_workspace=/home/jenkins/workspace/Bonus-Cloud
|
||||
|
||||
|
|
@ -12,15 +12,15 @@ app_source_jars=(
|
|||
"bonus-modules/bonus-gen/target/bonus-gen.jar"
|
||||
"bonus-modules/bonus-face/target/bonus-face.jar"
|
||||
"bonus-modules/bonus-job/target/bonus-job.jar"
|
||||
"bonus-modules/bonus-oss/target/bonus-oss.jar"
|
||||
"bonus-modules/bonus-system/target/bonus-system.jar"
|
||||
"bonus-visual/bonus-monitor/target/bonus-visual-monitor.jar"
|
||||
)
|
||||
|
||||
for source_jar in "${app_source_jars[@]}"; do
|
||||
scp -P 22 -r root@192.168.0.56:${app_workspace}/${source_jar} $deploy_path
|
||||
cp -f ${app_workspace}/${source_jar} $deploy_path
|
||||
echo "copied ${app_workspace}/${source_jar} to $deploy_path"
|
||||
done
|
||||
|
||||
# Define an array of JAR files to run
|
||||
jars=("bonus-auth.jar --spring.config.location=file:auth_bootstrap.yml"
|
||||
"bonus-gateway.jar --spring.config.location=file:gateway_bootstrap.yml"
|
||||
|
|
@ -60,7 +60,7 @@ cd $deploy_path || { echo "Failed to change directory to $deploy_path"; exit 1;
|
|||
# Iterate over the JAR files array
|
||||
for jar in "${jars[@]}"; do
|
||||
echo "Starting $jar"
|
||||
nohup java -jar $jar >/dev/null 2>&1 &
|
||||
nohup /usr/lib/jvm/jdk1.8.0_381/bin/java -jar $jar >/dev/null 2>&1 &
|
||||
done
|
||||
|
||||
echo "All JARs have been run successfully."
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ server:
|
|||
port: 18087
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
spring:
|
||||
application:
|
||||
# 应用名称
|
||||
name: bonus-face
|
||||
|
|
@ -12,16 +12,14 @@ spring:
|
|||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
username: nacos
|
||||
password: nacos
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
|||
|
|
@ -12,16 +12,14 @@ spring:
|
|||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
username: nacos
|
||||
password: nacos
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
|||
|
|
@ -13,16 +13,14 @@ spring:
|
|||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
username: nacos
|
||||
password: nacos
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
|||
|
|
@ -12,16 +12,14 @@ spring:
|
|||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
username: nacos
|
||||
password: nacos
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
|||
|
|
@ -12,16 +12,14 @@ spring:
|
|||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
username: nacos
|
||||
password: nacos
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
|||
|
|
@ -1,36 +1,49 @@
|
|||
#!/bin/bash
|
||||
P_ID=$(pgrep -f BonusAuthApplication)
|
||||
if [ -z "$P_ID" ]; then
|
||||
echo "BonusAuthApplication is not running"
|
||||
else
|
||||
kill -9 "$P_ID"
|
||||
fi
|
||||
|
||||
# Define an array of JAR files to run
|
||||
jars=("bonus-auth.jar --spring.config.location=file:auth_bootstrap.yml"
|
||||
"bonus-gateway.jar --spring.config.location=file:gateway_bootstrap.yml"
|
||||
"bonus-system.jar --spring.config.location=file:system_bootstrap.yml"
|
||||
"bonus-gen.jar --spring.config.location=file:gen_bootstrap.yml"
|
||||
"bonus-job.jar --spring.config.location=file:job_bootstrap.yml"
|
||||
"bonus-file.jar --spring.config.location=file:file_bootstrap.yml"
|
||||
"bonus-visual-monitor.jar --spring.config.location=file:visual_bootstrap.yml"
|
||||
"bonus-face.jar --spring.config.location=file:face_bootstrap.yml")
|
||||
P_ID=$(pgrep -f BonusFileApplication)
|
||||
if [ -z "$P_ID" ]; then
|
||||
echo "BonusFileApplication is not running"
|
||||
else
|
||||
kill -9 "$P_ID"
|
||||
fi
|
||||
|
||||
# 遍历数组并检查每个JAR文件的进程
|
||||
for jar_with_args in "${jars[@]}"; do
|
||||
# 提取JAR文件名(不包括参数)
|
||||
jar=$(echo $jar_with_args | awk '{print $1}')
|
||||
P_ID=$(pgrep -f BonusGatewayApplication)
|
||||
if [ -z "$P_ID" ]; then
|
||||
echo "BonusGatewayApplication is not running"
|
||||
else
|
||||
kill -9 "$P_ID"
|
||||
fi
|
||||
|
||||
P_ID=$(pgrep -f BonusGenApplication)
|
||||
if [ -z "$P_ID" ]; then
|
||||
echo "BonusGenApplication is not running"
|
||||
else
|
||||
kill -9 "$P_ID"
|
||||
fi
|
||||
|
||||
P_ID=$(pgrep -f BonusJobApplication)
|
||||
if [ -z "$P_ID" ]; then
|
||||
echo "BonusJobApplication is not running"
|
||||
else
|
||||
kill -9 "$P_ID"
|
||||
fi
|
||||
|
||||
P_ID=$(pgrep -f BonusMonitorApplication)
|
||||
if [ -z "$P_ID" ]; then
|
||||
echo "BonusMonitorApplication is not running"
|
||||
else
|
||||
kill -9 "$P_ID"
|
||||
fi
|
||||
|
||||
P_ID=$(pgrep -f BonusSystemApplication)
|
||||
if [ -z "$P_ID" ]; then
|
||||
echo "BonusSystemApplication is not running"
|
||||
else
|
||||
kill -9 "$P_ID"
|
||||
fi
|
||||
|
||||
# 检查进程是否启动
|
||||
echo "原应用程序1 $jar "
|
||||
pids=$(pgrep -f $jar || true)
|
||||
echo "原应用程序2 $jar "
|
||||
if [ -n "$pids" ]; then
|
||||
echo "$jar is running with PID(s): $pids"
|
||||
# 杀死进程
|
||||
for pid in $pids; do
|
||||
kill -9 $pid
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Process $pid for $jar killed successfully"
|
||||
else
|
||||
echo "Failed to kill process $pid for $jar"
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo "$jar is not running"
|
||||
fi
|
||||
done
|
||||
|
|
@ -12,16 +12,14 @@ spring:
|
|||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
username: nacos
|
||||
password: nacos
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
|||
|
|
@ -12,16 +12,14 @@ spring:
|
|||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
username: nacos
|
||||
password: nacos
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
|||
|
|
@ -0,0 +1,82 @@
|
|||
SET NAMES utf8mb4;
|
||||
|
||||
-- 菜单模版ID
|
||||
alter table sys_dept add menu_template_id bigint(20) null comment '菜单模版ID';
|
||||
-- 公司管理员用户ID
|
||||
alter table sys_dept add admin_user_id bigint(20) null comment '公司管理员用户ID';
|
||||
-- 公司用户初始密码
|
||||
alter table sys_dept add init_password varchar(255) null comment '公司用户初始密码';
|
||||
-- 省
|
||||
alter table sys_dept add province varchar(50) null comment '省';
|
||||
-- 市
|
||||
alter table sys_dept add city varchar(50) null comment '市';
|
||||
-- 县
|
||||
alter table sys_dept add district varchar(50) null comment '县';
|
||||
-- 详细地址
|
||||
alter table sys_dept add address varchar(255) null comment '详细地址';
|
||||
-- 公司简称
|
||||
alter table sys_dept add dept_abbreviation varchar(255) null comment '公司简称';
|
||||
-- 公司概述
|
||||
alter table sys_dept add remark varchar(255) null comment '公司概述';
|
||||
-- 公司logo
|
||||
alter table sys_dept add logo varchar(255) null comment '公司logo';
|
||||
|
||||
|
||||
-- 所属公司ID
|
||||
alter table sys_role add company_id bigint null comment '所属公司ID';
|
||||
|
||||
-- 所属公司ID
|
||||
alter table sys_post
|
||||
add company_id bigint null comment '所属公司ID';
|
||||
|
||||
|
||||
-- 系统模板表
|
||||
create table sys_template
|
||||
(
|
||||
id bigint auto_increment
|
||||
primary key,
|
||||
name varchar(50) not null comment '模板名称',
|
||||
remark varchar(200) null comment '备注'
|
||||
)
|
||||
comment '权限模板表' charset = utf8
|
||||
row_format = DYNAMIC;
|
||||
|
||||
-- 插入菜单默认模板
|
||||
INSERT INTO sys_template (id, name, remark) VALUES (1, 'default_menu_template', '默认公司菜单模板');
|
||||
|
||||
-- 系统模板菜单表
|
||||
create table sys_template_menu
|
||||
(
|
||||
temp_id bigint not null comment '模板ID',
|
||||
menu_id bigint not null comment '菜单ID'
|
||||
)
|
||||
comment '系统模板菜单表' charset = utf8
|
||||
row_format = DYNAMIC;
|
||||
|
||||
-- 插入菜单模板数据
|
||||
INSERT INTO bns_cloud_smart_site.sys_template_menu (temp_id, menu_id) VALUES (1, 1);
|
||||
INSERT INTO bns_cloud_smart_site.sys_template_menu (temp_id, menu_id) VALUES (1, 100);
|
||||
INSERT INTO bns_cloud_smart_site.sys_template_menu (temp_id, menu_id) VALUES (1, 101);
|
||||
INSERT INTO bns_cloud_smart_site.sys_template_menu (temp_id, menu_id) VALUES (1, 103);
|
||||
INSERT INTO bns_cloud_smart_site.sys_template_menu (temp_id, menu_id) VALUES (1, 1007);
|
||||
INSERT INTO bns_cloud_smart_site.sys_template_menu (temp_id, menu_id) VALUES (1, 1008);
|
||||
INSERT INTO bns_cloud_smart_site.sys_template_menu (temp_id, menu_id) VALUES (1, 1009);
|
||||
INSERT INTO bns_cloud_smart_site.sys_template_menu (temp_id, menu_id) VALUES (1, 1010);
|
||||
INSERT INTO bns_cloud_smart_site.sys_template_menu (temp_id, menu_id) VALUES (1, 1011);
|
||||
INSERT INTO bns_cloud_smart_site.sys_template_menu (temp_id, menu_id) VALUES (1, 1016);
|
||||
INSERT INTO bns_cloud_smart_site.sys_template_menu (temp_id, menu_id) VALUES (1, 1017);
|
||||
INSERT INTO bns_cloud_smart_site.sys_template_menu (temp_id, menu_id) VALUES (1, 1018);
|
||||
INSERT INTO bns_cloud_smart_site.sys_template_menu (temp_id, menu_id) VALUES (1, 1019);
|
||||
INSERT INTO bns_cloud_smart_site.sys_template_menu (temp_id, menu_id) VALUES (1, 1000);
|
||||
INSERT INTO bns_cloud_smart_site.sys_template_menu (temp_id, menu_id) VALUES (1, 1001);
|
||||
INSERT INTO bns_cloud_smart_site.sys_template_menu (temp_id, menu_id) VALUES (1, 1002);
|
||||
INSERT INTO bns_cloud_smart_site.sys_template_menu (temp_id, menu_id) VALUES (1, 1003);
|
||||
INSERT INTO bns_cloud_smart_site.sys_template_menu (temp_id, menu_id) VALUES (1, 1004);
|
||||
INSERT INTO bns_cloud_smart_site.sys_template_menu (temp_id, menu_id) VALUES (1, 1005);
|
||||
INSERT INTO bns_cloud_smart_site.sys_template_menu (temp_id, menu_id) VALUES (1, 1006);
|
||||
INSERT INTO bns_cloud_smart_site.sys_template_menu (temp_id, menu_id) VALUES (1, 104);
|
||||
INSERT INTO bns_cloud_smart_site.sys_template_menu (temp_id, menu_id) VALUES (1, 1020);
|
||||
INSERT INTO bns_cloud_smart_site.sys_template_menu (temp_id, menu_id) VALUES (1, 1021);
|
||||
INSERT INTO bns_cloud_smart_site.sys_template_menu (temp_id, menu_id) VALUES (1, 1022);
|
||||
INSERT INTO bns_cloud_smart_site.sys_template_menu (temp_id, menu_id) VALUES (1, 1023);
|
||||
INSERT INTO bns_cloud_smart_site.sys_template_menu (temp_id, menu_id) VALUES (1, 1024);
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
-- 菜单模版ID
|
||||
alter table sys_dept add menu_template_id bigint(20) null comment '菜单模版ID';
|
||||
-- 公司管理员用户ID
|
||||
alter table sys_dept add admin_user_id bigint(20) null comment '公司管理员用户ID';
|
||||
-- 公司用户初始密码
|
||||
alter table sys_dept add init_password varchar(255) null comment '公司用户初始密码';
|
||||
-- 省
|
||||
alter table sys_dept add province varchar(50) null comment '省';
|
||||
-- 市
|
||||
alter table sys_dept add city varchar(50) null comment '市';
|
||||
-- 县
|
||||
alter table sys_dept add district varchar(50) null comment '县';
|
||||
-- 详细地址
|
||||
alter table sys_dept add address varchar(255) null comment '详细地址';
|
||||
-- 公司简称
|
||||
alter table sys_dept add dept_abbreviation varchar(255) null comment '公司简称';
|
||||
-- 公司概述
|
||||
alter table sys_dept add remark varchar(255) null comment '公司概述';
|
||||
-- 公司logo
|
||||
alter table sys_dept add logo varchar(255) null comment '公司logo';
|
||||
|
||||
|
||||
-- 所属公司ID
|
||||
alter table sys_role add company_id bigint null comment '所属公司ID';
|
||||
|
||||
-- 所属公司ID
|
||||
alter table sys_post add company_id bigint null comment '所属公司ID';
|
||||
|
||||
|
||||
INSERT INTO `sys_menu` (menu_id, menu_name, parent_id, order_num, path, component, query, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark, system_type) VALUES (12098, '公司管理', 12103, 0, 'company-manage', 'company-manage', null, 1, 1, 'C', '0', '0', 'system:dept:list', 'cascader', 'admin', '2024-12-31 09:30:21', 'admin', '2025-01-08 17:49:16', '', '0');
|
||||
INSERT INTO `sys_menu` (menu_id, menu_name, parent_id, order_num, path, component, query, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark, system_type) VALUES (12099, '公司查询', 12098, 1, '', null, null, 1, 0, 'F', '0', '0', 'system:dept:query', '#', 'admin', '2025-01-02 13:18:27', 'admin', '2025-01-02 13:21:39', '', '0');
|
||||
INSERT INTO `sys_menu` (menu_id, menu_name, parent_id, order_num, path, component, query, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark, system_type) VALUES (12100, '公司新增', 12098, 2, '', null, null, 1, 0, 'F', '0', '0', 'system:dept:add', '#', 'admin', '2025-01-02 13:19:24', '', null, '', '0');
|
||||
INSERT INTO `sys_menu` (menu_id, menu_name, parent_id, order_num, path, component, query, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark, system_type) VALUES (12101, '公司修改', 12098, 3, '', null, null, 1, 0, 'F', '0', '0', 'system:dept:edit', '#', 'admin', '2025-01-02 13:19:51', 'admin', '2025-01-02 13:20:19', '', '0');
|
||||
INSERT INTO `sys_menu` (menu_id, menu_name, parent_id, order_num, path, component, query, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark, system_type) VALUES (12102, '公司删除', 12098, 4, '', null, null, 1, 0, 'F', '0', '0', 'system:dept:remove', '#', 'admin', '2025-01-02 13:21:19', '', null, '', '0');
|
||||
INSERT INTO `sys_menu` (menu_id, menu_name, parent_id, order_num, path, component, query, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark, system_type) VALUES (12103, '平台管理', 0, 97, 'platform', null, null, 1, 0, 'M', '1', '0', '', 'international', 'admin', '2025-01-05 09:30:33', 'admin', '2025-01-08 09:51:49', '', '0,1,2');
|
||||
INSERT INTO `sys_menu` (menu_id, menu_name, parent_id, order_num, path, component, query, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark, system_type) VALUES (12104, '权限模板', 12103, 1, 'menu/template', 'permission-template', null, 1, 1, 'C', '0', '0', '', 'client', 'admin', '2025-01-05 09:35:15', 'admin', '2025-01-08 17:50:04', '', '0');
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue