Compare commits
No commits in common. "main" and "hc_tempTwo" have entirely different histories.
main
...
hc_tempTwo
|
|
@ -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;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -73,20 +73,14 @@ public class SysDept extends BaseEntity {
|
|||
* 父部门名称
|
||||
*/
|
||||
private String parentName;
|
||||
|
||||
//权限模版ID
|
||||
private Long menuTemplateId;
|
||||
|
||||
/**
|
||||
* 省
|
||||
*/
|
||||
private String province;
|
||||
|
||||
/**
|
||||
* 市
|
||||
*/
|
||||
private String city;
|
||||
|
||||
/**
|
||||
* 县
|
||||
*/
|
||||
|
|
@ -97,52 +91,6 @@ public class SysDept extends BaseEntity {
|
|||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 公司简称
|
||||
*/
|
||||
private String deptAbbreviation;
|
||||
|
||||
/**
|
||||
* 公司概述
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* logo
|
||||
*/
|
||||
private String logo;
|
||||
|
||||
//公司管理员用户ID
|
||||
private Long adminUserId;
|
||||
|
||||
/**
|
||||
* 公司用户初始密码
|
||||
*/
|
||||
private String initPassword;
|
||||
|
||||
private SysUser sysUser;
|
||||
|
||||
/**
|
||||
* 所属公司ID
|
||||
*/
|
||||
private Long companyId;
|
||||
|
||||
private Long userCount;
|
||||
|
||||
/**
|
||||
*角色名称
|
||||
*/
|
||||
private String roleName;
|
||||
|
||||
private String keyWord;
|
||||
|
||||
public Long getMenuTemplateId() {
|
||||
return menuTemplateId;
|
||||
}
|
||||
|
||||
public void setMenuTemplateId(Long menuTemplateId) {
|
||||
this.menuTemplateId = menuTemplateId;
|
||||
}
|
||||
|
||||
public void setCity(String city) {
|
||||
this.city = city;
|
||||
|
|
@ -169,6 +117,8 @@ public class SysDept extends BaseEntity {
|
|||
return city;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getProvince() {
|
||||
return province;
|
||||
}
|
||||
|
|
@ -177,87 +127,6 @@ public class SysDept extends BaseEntity {
|
|||
this.province = province;
|
||||
}
|
||||
|
||||
public String getDeptAbbreviation() {
|
||||
return deptAbbreviation;
|
||||
}
|
||||
|
||||
public void setDeptAbbreviation(String deptAbbreviation) {
|
||||
this.deptAbbreviation = deptAbbreviation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getLogo() {
|
||||
return logo;
|
||||
}
|
||||
|
||||
public void setLogo(String logo) {
|
||||
this.logo = logo;
|
||||
}
|
||||
|
||||
public Long getAdminUserId() {
|
||||
return adminUserId;
|
||||
}
|
||||
|
||||
public void setAdminUserId(Long adminUserId) {
|
||||
this.adminUserId = adminUserId;
|
||||
}
|
||||
|
||||
public String getInitPassword() {
|
||||
return initPassword;
|
||||
}
|
||||
|
||||
public void setInitPassword(String initPassword) {
|
||||
this.initPassword = initPassword;
|
||||
}
|
||||
|
||||
public SysUser getSysUser() {
|
||||
return sysUser;
|
||||
}
|
||||
|
||||
public void setSysUser(SysUser sysUser) {
|
||||
this.sysUser = sysUser;
|
||||
}
|
||||
|
||||
public Long getCompanyId() {
|
||||
return companyId;
|
||||
}
|
||||
|
||||
public void setCompanyId(Long companyId) {
|
||||
this.companyId = companyId;
|
||||
}
|
||||
|
||||
public Long getUserCount() {
|
||||
return userCount;
|
||||
}
|
||||
|
||||
public void setUserCount(Long userCount) {
|
||||
this.userCount = userCount;
|
||||
}
|
||||
|
||||
public String getRoleName() {
|
||||
return roleName;
|
||||
}
|
||||
|
||||
public void setRoleName(String roleName) {
|
||||
this.roleName = roleName;
|
||||
}
|
||||
|
||||
public String getKeyWord() {
|
||||
return keyWord;
|
||||
}
|
||||
|
||||
public void setKeyWord(String keyWord) {
|
||||
this.keyWord = keyWord;
|
||||
}
|
||||
|
||||
/**
|
||||
* 子部门
|
||||
|
|
|
|||
|
|
@ -72,8 +72,6 @@ public class SysMenu extends BaseEntity
|
|||
/** 系统类型 */
|
||||
private String systemType;
|
||||
|
||||
private Long templateId;
|
||||
|
||||
public Long getMenuId()
|
||||
{
|
||||
return menuId;
|
||||
|
|
@ -249,14 +247,6 @@ public class SysMenu extends BaseEntity
|
|||
this.systemType = systemType;
|
||||
}
|
||||
|
||||
public Long getTemplateId() {
|
||||
return templateId;
|
||||
}
|
||||
|
||||
public void setTemplateId(Long templateId) {
|
||||
this.templateId = templateId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
|
|
|
|||
|
|
@ -35,9 +35,6 @@ public class SysPost extends BaseEntity
|
|||
@Excel(name = "岗位名称")
|
||||
private String postName;
|
||||
|
||||
/** 所属公司ID */
|
||||
private Long companyId;
|
||||
|
||||
/** 岗位排序 */
|
||||
@Excel(name = "岗位排序")
|
||||
private Integer postSort;
|
||||
|
|
@ -83,14 +80,6 @@ public class SysPost extends BaseEntity
|
|||
this.postName = postName;
|
||||
}
|
||||
|
||||
public Long getCompanyId() {
|
||||
return companyId;
|
||||
}
|
||||
|
||||
public void setCompanyId(Long companyId) {
|
||||
this.companyId = companyId;
|
||||
}
|
||||
|
||||
@NotNull(message = "显示顺序不能为空")
|
||||
public Integer getPostSort()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -65,11 +65,6 @@ public class SysRole extends BaseEntity
|
|||
/** 部门组(数据权限) */
|
||||
private Long[] deptIds;
|
||||
|
||||
/**
|
||||
* 所属公司ID
|
||||
*/
|
||||
private Long companyId;
|
||||
|
||||
/** 角色菜单权限 */
|
||||
private Set<String> permissions;
|
||||
|
||||
|
|
@ -221,14 +216,6 @@ public class SysRole extends BaseEntity
|
|||
this.deptIds = deptIds;
|
||||
}
|
||||
|
||||
public Long getCompanyId() {
|
||||
return companyId;
|
||||
}
|
||||
|
||||
public void setCompanyId(Long companyId) {
|
||||
this.companyId = companyId;
|
||||
}
|
||||
|
||||
public Set<String> getPermissions()
|
||||
{
|
||||
return permissions;
|
||||
|
|
|
|||
|
|
@ -1,28 +0,0 @@
|
|||
package com.bonus.system.api.domain;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 权限模板对象 sys_template
|
||||
*
|
||||
* @author bonus
|
||||
* @date 2020-07-09
|
||||
*/
|
||||
@Data
|
||||
public class SysTemplate extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
/** 模板名称 */
|
||||
@Excel(name = "模板名称")
|
||||
private String name;
|
||||
|
||||
private List<Long> menuIds;
|
||||
|
||||
}
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
package com.bonus.system.api.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 系统模板菜单表(SysTempMenu)实体类
|
||||
*
|
||||
* @author bonus
|
||||
* @since 2020-07-09 13:38:36
|
||||
*/
|
||||
public class SysTemplateMenu implements Serializable {
|
||||
private static final long serialVersionUID = 904598953972609708L;
|
||||
/**
|
||||
* 模板ID
|
||||
*/
|
||||
private Long tempId;
|
||||
/**
|
||||
* 菜单ID
|
||||
*/
|
||||
private Long menuId;
|
||||
|
||||
|
||||
public Long getTempId() {
|
||||
return tempId;
|
||||
}
|
||||
|
||||
public void setTempId(Long tempId) {
|
||||
this.tempId = tempId;
|
||||
}
|
||||
|
||||
public Long getMenuId() {
|
||||
return menuId;
|
||||
}
|
||||
|
||||
public void setMenuId(Long menuId) {
|
||||
this.menuId = menuId;
|
||||
}
|
||||
}
|
||||
|
|
@ -41,7 +41,10 @@
|
|||
</dependency>
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- bonus Common Security-->
|
||||
<dependency>
|
||||
|
|
|
|||
|
|
@ -78,17 +78,11 @@ public class TokenController {
|
|||
@Resource
|
||||
private RemoteConfigService configService;
|
||||
|
||||
@Value("${third-party-login.iws.webAppId}")
|
||||
private String iwsWebAppId;
|
||||
@Value("${third-party-login.iws.appId}")
|
||||
private String iwsAppId;
|
||||
|
||||
@Value("${third-party-login.iws.webUrl}")
|
||||
private String iwsWebUrl;
|
||||
|
||||
@Value("${third-party-login.iws.h5AppId}")
|
||||
private String iwsH5AppId;
|
||||
|
||||
@Value("${third-party-login.iws.h5Url}")
|
||||
private String iwsH5Url;
|
||||
@Value("${third-party-login.iws.url}")
|
||||
private String iwsUrl;
|
||||
|
||||
@PostMapping("isAdmin")
|
||||
public R<?> isAdmin(@RequestBody LoginBody form) {
|
||||
|
|
@ -160,29 +154,68 @@ public class TokenController {
|
|||
|
||||
/**
|
||||
* i皖送登录
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("iwsLogin")
|
||||
public R<?> iwsLogin(@RequestBody LoginBody form) {
|
||||
public R<?> iwsLogin(@RequestBody HttpServletRequest req) {
|
||||
//获取i皖送传过来的票据
|
||||
String ticket = form.getTicket();
|
||||
String ticket = req.getParameter("ticket");
|
||||
log.info("ticket=" + ticket);
|
||||
if (StringUtils.isNotEmpty(ticket)) {
|
||||
LoginUser loginUser = new LoginUser();
|
||||
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);
|
||||
} else if (form.getSysType()!=null && "0".equals(form.getSysType())) {
|
||||
loginUser = sysLoginService.iwsWebLogin(ticket,iwsWebAppId,iwsWebUrl);
|
||||
}else {
|
||||
throw new ServiceException("登录失败,请稍后重试");
|
||||
//获取系统标识,这里可以放到配置文件中
|
||||
//String appId = "ec3fce308fcc407a79e1f09938ba16ab";
|
||||
//调用i皖送平台进行认证获取用户信息
|
||||
//String url = "http://sgwpdm.ah.sgcc.com.cn/iws/workplat/auth/auth-by-ticket?ticket={ticket}&appId={appId}";
|
||||
RestTemplate restTemplate = new RestTemplate();
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
paramMap.put("ticket", ticket);
|
||||
paramMap.put("appId", iwsAppId);
|
||||
ResponseEntity<String> authResponse = restTemplate.getForEntity(iwsUrl, String.class, paramMap);
|
||||
log.info("authResponse:" + authResponse.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");
|
||||
LoginUser loginUser = new LoginUser();
|
||||
SysUser sysUser = new SysUser();
|
||||
sysUser.setUserName(data.get("userName").toString());
|
||||
loginUser.setSysUser(sysUser);
|
||||
//通过用户名获取人员信息
|
||||
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(data.get("name").toString());
|
||||
registerBody.setMobile(data.get("mobile").toString());
|
||||
sysUser.setPassword(SecurityConstants.PASSWORD);
|
||||
//新用户注册
|
||||
try {
|
||||
sysLoginService.register(registerBody);
|
||||
//查询用户信息
|
||||
userResult = remoteUserService.getUserInfo(sysUser.getUserName(), SecurityConstants.INNER);
|
||||
loginUser = userResult.getData();
|
||||
sysUser = loginUser.getSysUser();
|
||||
//初始化一个角色
|
||||
Long[] roleIds = new Long[5];
|
||||
// 将数组的第一个元素赋值为 2
|
||||
roleIds[0] = 2L;
|
||||
remoteUserService.insertAuthRole(sysUser.getUserId(),roleIds,SecurityConstants.INNER);
|
||||
}catch (Exception e){
|
||||
throw new ServiceException("登录失败,请稍后重试");
|
||||
}
|
||||
}else {
|
||||
loginUser = userResult.getData();
|
||||
sysUser = loginUser.getSysUser();
|
||||
}
|
||||
logService.saveLogin(sysUser.getUserName(), "登录", "登录成功", null, "成功");
|
||||
//生成系统token
|
||||
return R.ok(tokenService.createToken(loginUser));
|
||||
}
|
||||
logService.saveLogin(loginUser.getSysUser().getUserName(), "登录", "登录成功", null, "成功");
|
||||
//生成系统token
|
||||
return R.ok(tokenService.createToken(loginUser));
|
||||
|
||||
}
|
||||
return R.fail("登录失败!");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,17 +38,4 @@ public class LoginBody {
|
|||
|
||||
private String mobileCodeType;
|
||||
|
||||
/**
|
||||
* i皖送使用的ticket
|
||||
*/
|
||||
private String ticket;
|
||||
|
||||
/**
|
||||
* 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, "用户名/密码错误", "登录用户不存在");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
package com.bonus.auth.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.bonus.auth.config.VerificationCodeType;
|
||||
import com.bonus.auth.factory.VerificationCodeStrategyFactory;
|
||||
import com.bonus.auth.form.RegisterBody;
|
||||
|
|
@ -14,29 +13,22 @@ import com.bonus.common.core.utils.encryption.Sm4Utils;
|
|||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.config.SystemConfig;
|
||||
import com.bonus.system.api.RemoteConfigService;
|
||||
import com.bonus.system.api.RemoteUserService;
|
||||
import com.bonus.system.api.domain.SysUser;
|
||||
import com.bonus.system.api.model.LoginUser;
|
||||
import com.hankcs.hanlp.HanLP;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 登录校验方法
|
||||
* 提供登录、注册、验证码获取等服务
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class SysLoginService {
|
||||
@Resource
|
||||
@Autowired
|
||||
private RemoteUserService remoteUserService;
|
||||
|
||||
|
||||
|
|
@ -52,9 +44,6 @@ public class SysLoginService {
|
|||
@Autowired
|
||||
private SystemConfig systemConfig;
|
||||
|
||||
@Resource
|
||||
private RemoteConfigService configService;
|
||||
|
||||
/**
|
||||
* 获取验证码
|
||||
*
|
||||
|
|
@ -93,7 +82,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 +117,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 +145,6 @@ public class SysLoginService {
|
|||
recordLogService.saveLogs(registerBody.getUsername(), startTime, "注册异常", e.getMessage(), null, "失败");
|
||||
throw new ServiceException("注册失败,请稍后重试");
|
||||
}
|
||||
log.info("结束进行注册===============");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -197,124 +184,4 @@ public class SysLoginService {
|
|||
return pinyin;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* i皖送Web端登录
|
||||
* @param ticket
|
||||
* @param iwsWebAppId
|
||||
* @param iwsWebUrl
|
||||
* @return
|
||||
*/
|
||||
public LoginUser iwsWebLogin(String ticket, String iwsWebAppId, String iwsWebUrl) {
|
||||
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())){
|
||||
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);
|
||||
}
|
||||
return loginUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* 先查,如果没有进行创建
|
||||
* @param sysUser
|
||||
* @param loginUser
|
||||
*/
|
||||
private LoginUser 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);
|
||||
|
||||
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()))
|
||||
{
|
||||
registerBody.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());
|
||||
//初始化一个角色
|
||||
Long[] roleIds = new Long[5];
|
||||
// 将数组的第一个元素赋值为 2
|
||||
roleIds[0] = 2L;
|
||||
log.info("开始绑定角色信息{}",roleIds);
|
||||
remoteUserService.insertAuthRole(sysUserNew.getUserId(),roleIds,SecurityConstants.INNER);
|
||||
log.info("角色信息绑定成功!");
|
||||
}catch (Exception e){
|
||||
throw new ServiceException("登录失败,请稍后重试");
|
||||
}
|
||||
}else {
|
||||
loginUserNew = userResult.getData();
|
||||
}
|
||||
return loginUserNew;
|
||||
}
|
||||
|
||||
/**
|
||||
* i皖送H5端登录
|
||||
* @param ticket
|
||||
* @param iwsH5AppId
|
||||
* @param iwsH5Url
|
||||
* @return
|
||||
*/
|
||||
public LoginUser iwsH5Login(String ticket, String iwsH5AppId, String iwsH5Url) {
|
||||
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())){
|
||||
|
||||
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);
|
||||
}
|
||||
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
|
||||
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 38081
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: smart_site
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: smart_site
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
|
||||
#加密组件
|
||||
jasypt:
|
||||
encryptor:
|
||||
password: Encrypt
|
||||
|
||||
|
|
@ -47,4 +47,8 @@ public class SecurityConstants
|
|||
*/
|
||||
public static final String ROLE_PERMISSION = "role_permission";
|
||||
|
||||
/**
|
||||
* i皖送初始化密码
|
||||
*/
|
||||
public static final String PASSWORD = "Iws@20241219";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public class MimeTypeUtils
|
|||
|
||||
public static final String[] DEFAULT_ALLOWED_EXTENSION = {
|
||||
// 图片
|
||||
"bmp", "gif", "jpg", "jpeg", "png", "svg",
|
||||
"bmp", "gif", "jpg", "jpeg", "png",
|
||||
// word excel powerpoint
|
||||
"doc", "docx", "xls", "xlsx","csv", "ppt", "pptx", "html", "htm", "txt",
|
||||
// 压缩文件
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 38080
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: smart_site
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: smart_site
|
||||
# 配置文件格式
|
||||
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}
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 39300
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: smart_site
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: smart_site
|
||||
# 配置文件格式
|
||||
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));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,10 +1,7 @@
|
|||
package com.bonus.system.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
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;
|
||||
|
|
@ -14,9 +11,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 +104,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 +129,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("系统异常");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -156,62 +155,4 @@ public class SysDeptController extends BaseController
|
|||
}
|
||||
return error("系统异常");
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据登录用户获取公司详细信息
|
||||
*/
|
||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("system:dept:query"))
|
||||
@GetMapping(value = "/company_info")
|
||||
public AjaxResult getCompanyInfo() {
|
||||
try{
|
||||
Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
|
||||
return success(deptService.selectDeptById(companyId));
|
||||
} catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return error("系统异常");
|
||||
}
|
||||
|
||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("system:dept:query"))
|
||||
@GetMapping("/deptList")
|
||||
@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<>();
|
||||
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);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return getDataTableError(deptList1);
|
||||
}
|
||||
|
||||
@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("系统异常");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,10 +6,8 @@ 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.RequiresPermissionsOrInnerAuth;
|
||||
import com.bonus.system.api.domain.SysDept;
|
||||
import com.bonus.system.api.domain.SysMenu;
|
||||
import com.bonus.system.domain.UserMenuParams;
|
||||
import com.bonus.system.service.ISysDeptService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
|
@ -42,9 +40,6 @@ public class SysMenuController extends BaseController
|
|||
@Autowired
|
||||
private ISysMenuService menuService;
|
||||
|
||||
@Autowired
|
||||
private ISysDeptService deptService;
|
||||
|
||||
/**
|
||||
* 获取当前用户的菜单列表
|
||||
*/
|
||||
|
|
@ -204,8 +199,7 @@ public class SysMenuController extends BaseController
|
|||
try{
|
||||
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
SysDept sysDept = deptService.selectDeptById(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
|
||||
UserMenuParams userMenuParams = new UserMenuParams(userId, systemType, sysDept.getMenuTemplateId());
|
||||
UserMenuParams userMenuParams = new UserMenuParams(userId, systemType);
|
||||
List<SysMenu> menus = menuService.selectMenuTreeByUserIdAndSystemType(userMenuParams);
|
||||
return success(menuService.buildMenus(menus));
|
||||
}catch (Exception e){
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ 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.RequiresPermissionsOrInnerAuth;
|
||||
import com.bonus.config.SystemConfig;
|
||||
import com.bonus.system.api.domain.SysPost;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -41,9 +40,6 @@ public class SysPostController extends BaseController {
|
|||
@Autowired
|
||||
private ISysPostService postService;
|
||||
|
||||
@Autowired
|
||||
SystemConfig systemConfig;
|
||||
|
||||
/**
|
||||
* 获取岗位列表
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -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,22 +1,22 @@
|
|||
package com.bonus.system.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author wangvivi
|
||||
*/
|
||||
@Data
|
||||
@Setter
|
||||
@Getter
|
||||
public class UserMenuParams {
|
||||
private Long userId;
|
||||
private Long systemType;
|
||||
private Long templateId;
|
||||
|
||||
UserMenuParams(){}
|
||||
|
||||
public UserMenuParams(Long userId, Long systemType, Long templateId){
|
||||
public UserMenuParams(Long userId, Long systemType){
|
||||
this.userId = userId;
|
||||
this.systemType = systemType;
|
||||
this.templateId = templateId;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
}
|
||||
|
|
@ -1,8 +1,6 @@
|
|||
package com.bonus.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.bonus.system.api.domain.SysUser;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.bonus.system.api.domain.SysDept;
|
||||
|
||||
|
|
@ -21,15 +19,6 @@ public interface SysDeptMapper
|
|||
*/
|
||||
public List<SysDept> selectDeptList(SysDept dept);
|
||||
|
||||
List<SysDept> getDeptList(SysDept dept);
|
||||
|
||||
/**
|
||||
* 获取省市县区
|
||||
* @param areaVo
|
||||
* @return
|
||||
*/
|
||||
// List<AreaVo> getArea(AreaVo areaVo);
|
||||
|
||||
/**
|
||||
* 查询部门人员树列表
|
||||
*
|
||||
|
|
@ -55,14 +44,6 @@ public interface SysDeptMapper
|
|||
*/
|
||||
public SysDept selectDeptById(Long deptId);
|
||||
|
||||
/**
|
||||
* 根据部门ID查询信息
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @return 部门信息
|
||||
*/
|
||||
public SysDept selectActiveDeptById(Long deptId);
|
||||
|
||||
/**
|
||||
* 根据ID查询所有子部门
|
||||
*
|
||||
|
|
@ -142,22 +123,4 @@ public interface SysDeptMapper
|
|||
* @return 结果
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,10 +63,9 @@ public interface SysMenuMapper
|
|||
* 根据用户ID查询菜单
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @param templateId 权限模板ID
|
||||
* @return 菜单列表
|
||||
*/
|
||||
public List<SysMenu> selectMenuTreeByUserId(@Param("userId") Long userId, @Param("templateId")Long templateId);
|
||||
public List<SysMenu> selectMenuTreeByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 根据用户ID查询菜单
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ public interface SysPostMapper
|
|||
*
|
||||
* @return 岗位列表
|
||||
*/
|
||||
public List<SysPost> selectPostAll(SysPost sysPost);
|
||||
public List<SysPost> selectPostAll();
|
||||
|
||||
/**
|
||||
* 通过岗位ID查询岗位信息
|
||||
|
|
@ -85,16 +85,16 @@ public interface SysPostMapper
|
|||
/**
|
||||
* 校验岗位名称
|
||||
*
|
||||
* @param post
|
||||
* @param postName 岗位名称
|
||||
* @return 结果
|
||||
*/
|
||||
public SysPost checkPostNameUnique(SysPost post);
|
||||
public SysPost checkPostNameUnique(String postName);
|
||||
|
||||
/**
|
||||
* 校验岗位编码
|
||||
*
|
||||
* @param post
|
||||
* @param postCode 岗位编码
|
||||
* @return 结果
|
||||
*/
|
||||
public SysPost checkPostCodeUnique(SysPost post);
|
||||
public SysPost checkPostCodeUnique(String postCode);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,18 +60,18 @@ public interface SysRoleMapper
|
|||
/**
|
||||
* 校验角色名称是否唯一
|
||||
*
|
||||
* @param role 角色名称
|
||||
* @param roleName 角色名称
|
||||
* @return 角色信息
|
||||
*/
|
||||
public SysRole checkRoleNameUnique(SysRole role);
|
||||
public SysRole checkRoleNameUnique(String roleName);
|
||||
|
||||
/**
|
||||
* 校验角色权限是否唯一
|
||||
*
|
||||
* @param role 角色权限
|
||||
* @param roleKey 角色权限
|
||||
* @return 角色信息
|
||||
*/
|
||||
public SysRole checkRoleKeyUnique(SysRole role);
|
||||
public SysRole checkRoleKeyUnique(String roleKey);
|
||||
|
||||
/**
|
||||
* 修改角色信息
|
||||
|
|
|
|||
|
|
@ -1,61 +0,0 @@
|
|||
package com.bonus.system.mapper;
|
||||
|
||||
import com.bonus.system.api.domain.SysTemplate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 权限模板Mapper接口
|
||||
*
|
||||
* @author bonus
|
||||
* @date 2025-01-05
|
||||
*/
|
||||
public interface SysTemplateMapper
|
||||
{
|
||||
/**
|
||||
* 查询权限模板
|
||||
*
|
||||
* @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);
|
||||
|
||||
/**
|
||||
* 删除权限模板
|
||||
*
|
||||
* @param id 权限模板ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysTemplateById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除权限模板
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysTemplateByIds(Long[] ids);
|
||||
}
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
package com.bonus.system.mapper;
|
||||
|
||||
import com.bonus.system.api.domain.SysTemplateMenu;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 系统模板菜单表(SysTempMenu)表数据库访问层
|
||||
*
|
||||
* @author bonus
|
||||
* @since 2025-01-05
|
||||
*/
|
||||
public interface SysTemplateMenuMapper {
|
||||
|
||||
|
||||
/**
|
||||
* 查询指定行数据
|
||||
*
|
||||
* @param
|
||||
* @param
|
||||
* @return 对象列表
|
||||
*/
|
||||
List<SysTemplateMenu> queryAll();
|
||||
|
||||
|
||||
/**
|
||||
* 通过实体作为筛选条件查询
|
||||
*
|
||||
* @param tempId
|
||||
* @return 对象列表
|
||||
*/
|
||||
List<Long> queryMenuIdByTemplateId(Long tempId);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param sysTemplateMenu 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insert(SysTemplateMenu sysTemplateMenu);
|
||||
|
||||
int batchInsert(@Param("list") List<SysTemplateMenu> list);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param sysTemplateMenu 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int update(SysTemplateMenu sysTemplateMenu);
|
||||
|
||||
/**
|
||||
* 根据模板删除菜单信息
|
||||
*
|
||||
* @param tempId
|
||||
* @return
|
||||
*/
|
||||
int deleteByTempId(@Param("tempId") Long 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);
|
||||
|
||||
}
|
||||
|
|
@ -20,10 +20,6 @@ public interface ISysDeptService
|
|||
*/
|
||||
public List<SysDept> selectDeptList(SysDept dept);
|
||||
|
||||
public List<SysDept> getDeptList(SysDept dept);
|
||||
|
||||
public List<SysDept> getCompanyUserCount();
|
||||
|
||||
/**
|
||||
* 查询部门树结构信息
|
||||
*
|
||||
|
|
@ -72,8 +68,6 @@ public interface ISysDeptService
|
|||
*/
|
||||
public SysDept selectDeptById(Long deptId);
|
||||
|
||||
public SysDept selectActiveDeptById(Long deptId);
|
||||
|
||||
/**
|
||||
* 根据ID查询所有子部门(正常状态)
|
||||
*
|
||||
|
|
@ -136,11 +130,4 @@ public interface ISysDeptService
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteDeptById(Long deptId);
|
||||
|
||||
/**
|
||||
* 注销或恢复公司
|
||||
*
|
||||
* @param dept 当前公司
|
||||
*/
|
||||
public int turnOnOffDeptById(SysDept dept);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,41 +0,0 @@
|
|||
package com.bonus.system.service;
|
||||
|
||||
import com.bonus.system.api.domain.SysTemplateMenu;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 系统模板菜单表(SysTemplateMenu)表服务接口
|
||||
*
|
||||
* @author bonus
|
||||
* @since 2025-01-05
|
||||
*/
|
||||
public interface ISysTemplateMenuService {
|
||||
|
||||
/**
|
||||
* 查询多条数据
|
||||
*
|
||||
* @param
|
||||
* @param
|
||||
* @return 对象列表
|
||||
*/
|
||||
public List<Long> queryMenuIdByTemplateId(Long tempId);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param sysTemplateMenu 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
SysTemplateMenu insert(SysTemplateMenu sysTemplateMenu);
|
||||
|
||||
public int batchInsert(List<SysTemplateMenu> list);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param sysTemplateMenu 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
SysTemplateMenu update(SysTemplateMenu sysTemplateMenu);
|
||||
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,20 +1,16 @@
|
|||
package com.bonus.system.service.impl;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import com.bonus.config.SystemConfig;
|
||||
import com.bonus.system.api.domain.*;
|
||||
import com.bonus.system.domain.SysRoleMenu;
|
||||
import com.bonus.system.mapper.*;
|
||||
import com.bonus.system.mapper.SysUserMapper;
|
||||
import com.bonus.common.datascope.utils.CommonDataPermissionInfo;
|
||||
import com.bonus.system.service.ISysUserService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.bonus.common.core.constant.UserConstants;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
|
|
@ -23,11 +19,13 @@ import com.bonus.common.core.utils.SpringUtils;
|
|||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.datascope.annotation.DataScope;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.system.api.domain.SysDept;
|
||||
import com.bonus.system.api.domain.SysRole;
|
||||
import com.bonus.system.api.domain.SysUser;
|
||||
import com.bonus.system.domain.vo.TreeSelect;
|
||||
import com.bonus.system.mapper.SysDeptMapper;
|
||||
import com.bonus.system.mapper.SysRoleMapper;
|
||||
import com.bonus.system.service.ISysDeptService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 部门管理 服务实现
|
||||
|
|
@ -35,7 +33,6 @@ import javax.annotation.Resource;
|
|||
* @author bonus
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class SysDeptServiceImpl implements ISysDeptService
|
||||
{
|
||||
@Autowired
|
||||
|
|
@ -47,25 +44,6 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
@Autowired
|
||||
private SysRoleMapper roleMapper;
|
||||
|
||||
@Resource
|
||||
private SysUserRoleMapper userRoleMapper;
|
||||
|
||||
@Resource
|
||||
private SysRoleMenuMapper roleMenuMapper;
|
||||
|
||||
@Resource
|
||||
SysTemplateMenuMapper sysTemplateMenuMapper;
|
||||
|
||||
@Resource
|
||||
private SysRoleDeptMapper roleDeptMapper;
|
||||
|
||||
@Lazy
|
||||
@Autowired
|
||||
ISysUserService userService;
|
||||
|
||||
@Resource
|
||||
private SystemConfig systemConfig;
|
||||
|
||||
/**
|
||||
* 查询部门管理数据
|
||||
*
|
||||
|
|
@ -86,20 +64,9 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
String str = dept.getDeptName().replace("\\", "\\\\").replace("%", "\\%").replace("_", "\\_");
|
||||
dept.setDeptName(str);
|
||||
}
|
||||
dept.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
|
||||
return deptMapper.selectDeptList(dept);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysDept> getDeptList(SysDept dept) {
|
||||
return deptMapper.getDeptList(dept);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysDept> getCompanyUserCount() {
|
||||
return deptMapper.getCompanyUserCount();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询部门树结构信息
|
||||
*
|
||||
|
|
@ -203,18 +170,7 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
@Override
|
||||
public SysDept selectDeptById(Long deptId)
|
||||
{
|
||||
SysDept sysDept = deptMapper.selectDeptById(deptId);
|
||||
if (systemConfig.isAddRootCompany() && Objects.nonNull(sysDept.getParentId()) && sysDept.getParentId().equals(0L)) {
|
||||
SysUser sysUser = deptMapper.selectCompanyAdminByDept(deptId);
|
||||
sysDept.setSysUser(sysUser);
|
||||
}
|
||||
return sysDept;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysDept selectActiveDeptById(Long deptId)
|
||||
{
|
||||
return deptMapper.selectActiveDeptById(deptId);
|
||||
return deptMapper.selectDeptById(deptId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -303,32 +259,22 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int insertDept(SysDept dept)
|
||||
{
|
||||
//增加根公司的处理
|
||||
if (dept.getParentId() == null){
|
||||
dept.setParentId(0L);
|
||||
dept.setAncestors("0");
|
||||
dept.setStatus("0");//默认启用
|
||||
int result = deptMapper.insertDept(dept);
|
||||
if (SecurityUtils.isAdmin(SecurityUtils.getUserId()) && systemConfig.isAddRootCompany() && result > 0) {
|
||||
if (StringUtils.isNotNull(dept.getSysUser()) && !userService.checkUserNameUnique(dept.getSysUser())) {
|
||||
throw new ServiceException("新增公司管理员用户'" + dept.getSysUser().getUserName() + "'失败,登录账号已存在");
|
||||
}
|
||||
SysUser user = createCompanyAdminUser(dept);
|
||||
createCompanyAdminRole(dept, user);
|
||||
}
|
||||
return result;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
SysDept info = deptMapper.selectDeptById(dept.getParentId());
|
||||
// 如果父节点不为正常状态,则不允许新增子节点
|
||||
if (!UserConstants.DEPT_NORMAL.equals(info.getStatus())) {
|
||||
throw new ServiceException("部门停用,不允许新增");
|
||||
}
|
||||
dept.setAncestors(info.getAncestors() + "," + dept.getParentId());
|
||||
return deptMapper.insertDept(dept);
|
||||
}
|
||||
return deptMapper.insertDept(dept);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -338,7 +284,6 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int updateDept(SysDept dept)
|
||||
{
|
||||
SysDept newParentDept = deptMapper.selectDeptById(dept.getParentId());
|
||||
|
|
@ -357,17 +302,6 @@ 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);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
@ -415,17 +349,6 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
return deptMapper.deleteDeptById(deptId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 注销或恢复公司
|
||||
*
|
||||
* @param dept 当前公司
|
||||
*/
|
||||
@Override
|
||||
public int turnOnOffDeptById(SysDept dept)
|
||||
{
|
||||
return deptMapper.turnOnOffDeptById(dept);
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归列表
|
||||
*/
|
||||
|
|
@ -468,63 +391,5 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
{
|
||||
return getChildList(list, t).size() > 0 ? true : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建公司管理员用户
|
||||
* @param dept
|
||||
*/
|
||||
private SysUser createCompanyAdminUser(SysDept dept) {
|
||||
log.info("创建公司管理员用户:{}",dept);
|
||||
SysUser user = dept.getSysUser();
|
||||
user.setCreateBy(SecurityUtils.getUsername());
|
||||
user.setPassword(SecurityUtils.encryptPassword(dept.getInitPassword()));
|
||||
user.setDeptId(dept.getDeptId());
|
||||
user.setLoginType("0"); //后台
|
||||
userMapper.insertUser(user);
|
||||
dept.setAdminUserId(user.getUserId());
|
||||
deptMapper.updateDept(dept);
|
||||
return user;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建公司管理员并分配角色菜单等
|
||||
*/
|
||||
private void createCompanyAdminRole(SysDept sysDept, SysUser user) {
|
||||
log.info("部门信息{},公司管理员用户{}",sysDept,user);
|
||||
SysRole role = new SysRole();
|
||||
role.setRoleKey("company_admin");
|
||||
role.setRoleName("公司管理员");
|
||||
role.setRemark("公司管理员");
|
||||
role.setCompanyId(sysDept.getDeptId());
|
||||
role.setRoleSort(0);
|
||||
role.setStatus("0");
|
||||
role.setCreateBy(SecurityUtils.getUsername());
|
||||
roleMapper.insertRole(role);
|
||||
log.info("创建的角色id为:{}",role.getRoleId());
|
||||
|
||||
//用户绑定角色
|
||||
SysUserRole sysUserRole = new SysUserRole();
|
||||
sysUserRole.setUserId(user.getUserId());
|
||||
sysUserRole.setRoleId(role.getRoleId());
|
||||
List<SysUserRole> sysUserRoleList = new ArrayList<SysUserRole>();
|
||||
sysUserRoleList.add(sysUserRole);
|
||||
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());
|
||||
SysRoleMenu sysRoleMenu = null;
|
||||
for (Long menuId : menuIds) {
|
||||
sysRoleMenu = new SysRoleMenu();
|
||||
sysRoleMenu.setRoleId(roleId);
|
||||
sysRoleMenu.setMenuId(menuId);
|
||||
sysRoleMenulist.add(sysRoleMenu);
|
||||
}
|
||||
roleMenuMapper.batchRoleMenu(sysRoleMenulist);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,10 +9,8 @@ import java.util.List;
|
|||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.bonus.system.api.domain.SysDept;
|
||||
import com.bonus.system.api.domain.SysMenu;
|
||||
import com.bonus.system.domain.UserMenuParams;
|
||||
import com.bonus.system.mapper.SysDeptMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.bonus.common.core.constant.Constants;
|
||||
|
|
@ -47,9 +45,6 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|||
@Autowired
|
||||
private SysRoleMenuMapper roleMenuMapper;
|
||||
|
||||
@Autowired
|
||||
private SysDeptMapper deptMapper;
|
||||
|
||||
/**
|
||||
* 根据用户查询系统菜单列表
|
||||
*
|
||||
|
|
@ -75,8 +70,6 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|||
String str = menu.getMenuName().replace("\\", "\\\\").replace("%", "\\%").replace("_", "\\_");
|
||||
menu.setMenuName(str);
|
||||
}
|
||||
SysDept sysDept = deptMapper.selectDeptById(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
|
||||
menu.setTemplateId(sysDept.getMenuTemplateId());
|
||||
List<SysMenu> menuList = menuMapper.selectMenuList(menu);
|
||||
return menuList;
|
||||
}
|
||||
|
|
@ -139,8 +132,7 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|||
}
|
||||
else
|
||||
{
|
||||
SysDept sysDept = deptMapper.selectDeptById(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
|
||||
menus = menuMapper.selectMenuTreeByUserId(userId, sysDept.getMenuTemplateId());
|
||||
menus = menuMapper.selectMenuTreeByUserId(userId);
|
||||
}
|
||||
return getChildPerms(menus, 0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package com.bonus.system.service.impl;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.system.api.domain.SysPost;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -44,7 +43,7 @@ public class SysPostServiceImpl implements ISysPostService
|
|||
String str = post.getPostName().replace("\\", "\\\\").replace("%", "\\%").replace("_", "\\_");
|
||||
post.setPostName(str);
|
||||
}
|
||||
post.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
|
||||
|
||||
return postMapper.selectPostList(post);
|
||||
}
|
||||
|
||||
|
|
@ -56,9 +55,7 @@ public class SysPostServiceImpl implements ISysPostService
|
|||
@Override
|
||||
public List<SysPost> selectPostAll()
|
||||
{
|
||||
SysPost sysPost = new SysPost();
|
||||
sysPost.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
|
||||
return postMapper.selectPostAll(sysPost);
|
||||
return postMapper.selectPostAll();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -94,10 +91,8 @@ public class SysPostServiceImpl implements ISysPostService
|
|||
@Override
|
||||
public boolean checkPostNameUnique(SysPost post)
|
||||
{
|
||||
Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
|
||||
post.setCompanyId(companyId);
|
||||
Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId();
|
||||
SysPost info = postMapper.checkPostNameUnique(post);
|
||||
SysPost info = postMapper.checkPostNameUnique(post.getPostName());
|
||||
if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue())
|
||||
{
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
|
|
@ -114,10 +109,8 @@ public class SysPostServiceImpl implements ISysPostService
|
|||
@Override
|
||||
public boolean checkPostCodeUnique(SysPost post)
|
||||
{
|
||||
Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
|
||||
post.setCompanyId(companyId);
|
||||
Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId();
|
||||
SysPost info = postMapper.checkPostCodeUnique(post);
|
||||
SysPost info = postMapper.checkPostCodeUnique(post.getPostCode());
|
||||
if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue())
|
||||
{
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
@ -77,7 +73,6 @@ public class SysRoleServiceImpl implements ISysRoleService
|
|||
String str = role.getRoleKey().replace("\\", "\\\\").replace("%", "\\%").replace("_", "\\_");
|
||||
role.setRoleKey(str);
|
||||
}
|
||||
role.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
|
||||
return roleMapper.selectRoleList(role);
|
||||
}
|
||||
|
||||
|
|
@ -171,10 +166,8 @@ public class SysRoleServiceImpl implements ISysRoleService
|
|||
@Override
|
||||
public boolean checkRoleNameUnique(SysRole role)
|
||||
{
|
||||
Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
|
||||
role.setCompanyId(companyId);
|
||||
Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
|
||||
SysRole info = roleMapper.checkRoleNameUnique(role);
|
||||
SysRole info = roleMapper.checkRoleNameUnique(role.getRoleName());
|
||||
if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue())
|
||||
{
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
|
|
@ -191,10 +184,8 @@ public class SysRoleServiceImpl implements ISysRoleService
|
|||
@Override
|
||||
public boolean checkRoleKeyUnique(SysRole role)
|
||||
{
|
||||
Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
|
||||
role.setCompanyId(companyId);
|
||||
Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
|
||||
SysRole info = roleMapper.checkRoleKeyUnique(role);
|
||||
SysRole info = roleMapper.checkRoleKeyUnique(role.getRoleKey());
|
||||
if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue())
|
||||
{
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
|
|
@ -262,7 +253,6 @@ public class SysRoleServiceImpl implements ISysRoleService
|
|||
public int insertRole(SysRole role)
|
||||
{
|
||||
// 新增角色信息
|
||||
role.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
|
||||
roleMapper.insertRole(role);
|
||||
return insertRoleMenu(role);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,67 +0,0 @@
|
|||
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 org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 系统模板菜单表(SysTempMenu)表服务实现类
|
||||
*
|
||||
* @author bonus
|
||||
* @since 2025-01-05
|
||||
*/
|
||||
@Service("sysTempMenuService")
|
||||
public class SysTemplateMenuServiceImpl implements ISysTemplateMenuService {
|
||||
@Resource
|
||||
private SysTemplateMenuMapper sysTemplateMenuMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 查询多条数据
|
||||
*
|
||||
* @param
|
||||
* @param
|
||||
* @return 对象列表
|
||||
*/
|
||||
@Override
|
||||
public List<Long> queryMenuIdByTemplateId(Long tempId) {
|
||||
return this.sysTemplateMenuMapper.queryMenuIdByTemplateId(tempId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param sysTemplateMenu
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public SysTemplateMenu insert(SysTemplateMenu sysTemplateMenu) {
|
||||
this.sysTemplateMenuMapper.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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param sysTemplateMenu 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public SysTemplateMenu update(SysTemplateMenu sysTemplateMenu) {
|
||||
this.sysTemplateMenuMapper.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);
|
||||
}
|
||||
}
|
||||
|
|
@ -109,7 +109,6 @@ public class SysUserServiceImpl implements ISysUserService {
|
|||
String phone =user.getPhonenumber().replace("\\", "\\\\").replace("%", "\\%").replace("_", "\\_");
|
||||
user.setPhonenumber(phone);
|
||||
}
|
||||
user.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
|
||||
List<SysUser> sysUsers = userMapper.selectUserList(user);
|
||||
return sysUsers;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,26 +0,0 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 38082
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: smart_site
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: smart_site
|
||||
# 配置文件格式
|
||||
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>
|
||||
|
|
@ -20,16 +20,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="menuTemplateId" column="menu_template_id" />
|
||||
<result property="province" column="province" />
|
||||
<result property="city" column="city" />
|
||||
<result property="district" column="district" />
|
||||
<result property="address" column="address" />
|
||||
<result property="deptAbbreviation" column="dept_abbreviation" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="logo" column="logo" />
|
||||
<result property="adminUserId" column="admin_user_id" />
|
||||
<result property="initPassword" column="init_password" />
|
||||
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDeptVo">
|
||||
|
|
@ -44,42 +39,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
d.status,
|
||||
d.del_flag,
|
||||
d.create_by,
|
||||
d.create_time
|
||||
d.create_time,
|
||||
d.province,
|
||||
d.city,
|
||||
d.district,
|
||||
d.address
|
||||
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.dept_abbreviation,
|
||||
d.remark,
|
||||
d.logo,
|
||||
d.admin_user_id,
|
||||
d.init_password
|
||||
from sys_dept d
|
||||
</sql>
|
||||
|
||||
<select id="selectDeptList" parameterType="com.bonus.system.api.domain.SysDept" resultMap="SysDeptResult">
|
||||
<include refid="selectDeptVo"/>
|
||||
where d.del_flag = '0'
|
||||
<if test="companyId != null and companyId != 0">
|
||||
AND (find_in_set(#{companyId}, ancestors) or dept_id = #{companyId})
|
||||
</if>
|
||||
<if test="deptId != null and deptId != 0">
|
||||
AND dept_id = #{deptId}
|
||||
</if>
|
||||
|
|
@ -97,17 +67,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
order by d.parent_id, d.order_num
|
||||
</select>
|
||||
|
||||
<select id="getDeptList" resultType="com.bonus.system.api.domain.SysDept">
|
||||
select * from sys_dept sd where parent_id='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">
|
||||
SELECT
|
||||
d.dept_id AS deptId,
|
||||
|
|
@ -156,13 +115,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">
|
||||
|
|
@ -187,7 +141,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertDept" parameterType="com.bonus.system.api.domain.SysDept" useGeneratedKeys="true" keyProperty="deptId">
|
||||
<insert id="insertDept" parameterType="com.bonus.system.api.domain.SysDept">
|
||||
insert into sys_dept(
|
||||
<if test="deptId != null and deptId != 0">dept_id,</if>
|
||||
<if test="parentId != null and parentId != 0">parent_id,</if>
|
||||
|
|
@ -201,12 +155,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="city != null and city != ''">city,</if>
|
||||
<if test="district != null and district != ''">district,</if>
|
||||
<if test="address != null and address != ''">address,</if>
|
||||
<if test="deptAbbreviation != null and deptAbbreviation != ''">dept_abbreviation,</if>
|
||||
<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="menuTemplateId != null">menu_template_id,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
)values(
|
||||
|
|
@ -222,12 +171,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="city != null and city != ''">#{city},</if>
|
||||
<if test="district != null and district != ''">#{district},</if>
|
||||
<if test="address != null and address != ''">#{address},</if>
|
||||
<if test="deptAbbreviation != null and deptAbbreviation != ''">#{deptAbbreviation},</if>
|
||||
<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="menuTemplateId != null">#{menuTemplateId},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
|
|
@ -247,12 +191,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="city != null">city = #{city},</if>
|
||||
<if test="district != null">district = #{district},</if>
|
||||
<if test="address != null">address = #{address},</if>
|
||||
<if test="deptAbbreviation != null and deptAbbreviation != ''">dept_abbreviation = #{deptAbbreviation},</if>
|
||||
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
||||
<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 +222,4 @@ 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
|
||||
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'
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -29,27 +29,21 @@
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectMenuVo">
|
||||
select sm.menu_id, sm.menu_name, sm.parent_id, sm.order_num, sm.path, sm.component, sm.`query`, sm.is_frame,
|
||||
sm.is_cache, sm.menu_type, sm.visible, sm.status, ifnull(sm.perms,'') as perms, sm.icon, sm.create_time, sm.system_type
|
||||
from sys_menu sm
|
||||
select menu_id, menu_name, parent_id, order_num, path, component, `query`, is_frame, is_cache, menu_type, visible, status, ifnull(perms,'') as perms, icon, create_time, system_type
|
||||
from sys_menu
|
||||
</sql>
|
||||
|
||||
<select id="selectMenuList" parameterType="com.bonus.system.api.domain.SysMenu" resultMap="SysMenuResult">
|
||||
<include refid="selectMenuVo"/>
|
||||
<where>
|
||||
<if test="menuName != null and menuName != ''">
|
||||
AND sm.menu_name like concat('%', #{menuName}, '%')
|
||||
AND menu_name like concat('%', #{menuName}, '%')
|
||||
</if>
|
||||
<if test="visible != null and visible != ''">
|
||||
AND sm.visible = #{visible}
|
||||
AND visible = #{visible}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND sm.status = #{status}
|
||||
</if>
|
||||
<if test="templateId != null">
|
||||
and exists (
|
||||
select 0 from sys_template_menu stm where stm.temp_id = #{templateId} and stm.menu_id = sm.menu_id
|
||||
)
|
||||
AND status = #{status}
|
||||
</if>
|
||||
</where>
|
||||
order by parent_id, order_num
|
||||
|
|
@ -77,15 +71,10 @@
|
|||
<if test="status != null and status != ''">
|
||||
AND m.status = #{status}
|
||||
</if>
|
||||
<if test="templateId != null">
|
||||
and exists (
|
||||
select 0 from sys_template_menu stm where stm.temp_id = #{templateId} and stm.menu_id = m.menu_id
|
||||
)
|
||||
</if>
|
||||
order by m.parent_id, m.order_num
|
||||
</select>
|
||||
|
||||
<select id="selectMenuTreeByUserId" resultMap="SysMenuResult">
|
||||
<select id="selectMenuTreeByUserId" parameterType="Long" resultMap="SysMenuResult">
|
||||
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
||||
from sys_menu m
|
||||
left join sys_role_menu rm on m.menu_id = rm.menu_id
|
||||
|
|
@ -93,11 +82,6 @@
|
|||
left join sys_role ro on ur.role_id = ro.role_id
|
||||
left join sys_user u on ur.user_id = u.user_id
|
||||
where u.user_id = #{userId} and m.menu_type in ('M', 'C') and m.status = 0 AND ro.status = 0
|
||||
<if test="templateId != null">
|
||||
AND exists (
|
||||
select 0 from sys_template_menu stm where stm.temp_id = #{templateId} and stm.menu_id = m.menu_id
|
||||
)
|
||||
</if>
|
||||
order by m.parent_id, m.order_num
|
||||
</select>
|
||||
|
||||
|
|
@ -109,11 +93,6 @@
|
|||
left join sys_role ro on ur.role_id = ro.role_id
|
||||
left join sys_user u on ur.user_id = u.user_id
|
||||
where u.user_id = #{userId} and m.menu_type in ('M', 'C') and m.status = 0 AND ro.status = 0 AND FIND_IN_SET(#{systemType}, m.system_type)
|
||||
<if test="templateId != null">
|
||||
AND exists (
|
||||
select 0 from sys_template_menu stm where stm.temp_id = #{templateId} and stm.menu_id = m.menu_id
|
||||
)
|
||||
</if>
|
||||
order by m.parent_id, m.order_num
|
||||
</select>
|
||||
|
||||
|
|
@ -153,7 +132,7 @@
|
|||
|
||||
<select id="selectMenuById" parameterType="Long" resultMap="SysMenuResult">
|
||||
<include refid="selectMenuVo"/>
|
||||
where sm.menu_id = #{menuId}
|
||||
where menu_id = #{menuId}
|
||||
</select>
|
||||
|
||||
<select id="hasChildByMenuId" resultType="Integer">
|
||||
|
|
@ -162,7 +141,7 @@
|
|||
|
||||
<select id="checkMenuNameUnique" parameterType="com.bonus.system.api.domain.SysMenu" resultMap="SysMenuResult">
|
||||
<include refid="selectMenuVo"/>
|
||||
where sm.menu_name=#{menuName} and sm.parent_id = #{parentId} limit 1
|
||||
where menu_name=#{menuName} and parent_id = #{parentId} limit 1
|
||||
</select>
|
||||
|
||||
<update id="updateMenu" parameterType="com.bonus.system.api.domain.SysMenu">
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="postCode" column="post_code" />
|
||||
<result property="postName" column="post_name" />
|
||||
<result property="postSort" column="post_sort" />
|
||||
<result property="companyId" column="company_id" />
|
||||
<result property="status" column="status" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
|
|
@ -19,16 +18,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectPostVo">
|
||||
select post_id, post_code, post_name, post_sort, company_id, status, create_by, create_time, remark
|
||||
select post_id, post_code, post_name, post_sort, status, create_by, create_time, remark
|
||||
from sys_post
|
||||
</sql>
|
||||
|
||||
<select id="selectPostList" parameterType="com.bonus.system.api.domain.SysPost" resultMap="SysPostResult">
|
||||
<include refid="selectPostVo"/>
|
||||
<where>
|
||||
<if test="companyId != null and companyId != 0">
|
||||
AND company_id = #{companyId}
|
||||
</if>
|
||||
<if test="postCode != null and postCode != ''">
|
||||
AND post_code like concat('%', #{postCode}, '%')
|
||||
</if>
|
||||
|
|
@ -42,12 +38,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
order by post_sort
|
||||
</select>
|
||||
|
||||
<select id="selectPostAll" parameterType="com.bonus.system.api.domain.SysPost" resultMap="SysPostResult">
|
||||
<select id="selectPostAll" resultMap="SysPostResult">
|
||||
<include refid="selectPostVo"/>
|
||||
where 1=1
|
||||
<if test="companyId != null and companyId != 0">
|
||||
AND company_id = #{companyId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectPostById" parameterType="Long" resultMap="SysPostResult">
|
||||
|
|
@ -64,29 +56,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
|
||||
<select id="selectPostsByUserName" parameterType="String" resultMap="SysPostResult">
|
||||
select p.post_id, p.post_name, p.post_code, p.company_id
|
||||
select p.post_id, p.post_name, p.post_code
|
||||
from sys_post p
|
||||
left join sys_user_post up on up.post_id = p.post_id
|
||||
left join sys_user u on u.user_id = up.user_id
|
||||
where u.user_name = #{userName}
|
||||
</select>
|
||||
|
||||
<select id="checkPostNameUnique" parameterType="com.bonus.system.api.domain.SysPost" resultMap="SysPostResult">
|
||||
<select id="checkPostNameUnique" parameterType="String" resultMap="SysPostResult">
|
||||
<include refid="selectPostVo"/>
|
||||
where post_name=#{postName}
|
||||
<if test="companyId != null and companyId != 0">
|
||||
AND company_id = #{companyId}
|
||||
</if>
|
||||
limit 1
|
||||
where post_name=#{postName} limit 1
|
||||
</select>
|
||||
|
||||
<select id="checkPostCodeUnique" parameterType="com.bonus.system.api.domain.SysPost" resultMap="SysPostResult">
|
||||
<select id="checkPostCodeUnique" parameterType="String" resultMap="SysPostResult">
|
||||
<include refid="selectPostVo"/>
|
||||
where post_code=#{postCode}
|
||||
<if test="companyId != null and companyId != 0">
|
||||
AND company_id = #{companyId}
|
||||
</if>
|
||||
limit 1
|
||||
where post_code=#{postCode} limit 1
|
||||
</select>
|
||||
|
||||
<update id="updatePost" parameterType="com.bonus.system.api.domain.SysPost">
|
||||
|
|
@ -95,7 +79,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="postCode != null and postCode != ''">post_code = #{postCode},</if>
|
||||
<if test="postName != null and postName != ''">post_name = #{postName},</if>
|
||||
<if test="postSort != null">post_sort = #{postSort},</if>
|
||||
<if test="companyId != null">company_id = #{companyId},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
|
|
@ -110,7 +93,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="postCode != null and postCode != ''">post_code,</if>
|
||||
<if test="postName != null and postName != ''">post_name,</if>
|
||||
<if test="postSort != null">post_sort,</if>
|
||||
<if test="companyId != null">company_id,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
|
|
@ -120,7 +102,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="postCode != null and postCode != ''">#{postCode},</if>
|
||||
<if test="postName != null and postName != ''">#{postName},</if>
|
||||
<if test="postSort != null">#{postSort},</if>
|
||||
<if test="companyId != null">#{companyId},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="dataScope" column="data_scope" />
|
||||
<result property="menuCheckStrictly" column="menu_check_strictly" />
|
||||
<result property="deptCheckStrictly" column="dept_check_strictly" />
|
||||
<result property="companyId" column="company_id" />
|
||||
<result property="status" column="status" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
|
|
@ -25,7 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<sql id="selectRoleVo">
|
||||
select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.menu_check_strictly, r.dept_check_strictly,
|
||||
r.company_id, r.status, r.del_flag, r.create_time, r.remark, r.is_built_in
|
||||
r.status, r.del_flag, r.create_time, r.remark, r.is_built_in
|
||||
from sys_role r
|
||||
left join sys_user_role ur on ur.role_id = r.role_id
|
||||
left join sys_user u on u.user_id = ur.user_id
|
||||
|
|
@ -41,9 +40,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="roleName != null and roleName != ''">
|
||||
AND r.role_name like concat('%', #{roleName}, '%')
|
||||
</if>
|
||||
<if test="companyId != null">
|
||||
AND r.company_id = #{companyId}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND r.status = #{status}
|
||||
</if>
|
||||
|
|
@ -88,22 +84,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
WHERE r.del_flag = '0' and u.user_name = #{userName}
|
||||
</select>
|
||||
|
||||
<select id="checkRoleNameUnique" parameterType="com.bonus.system.api.domain.SysRole" resultMap="SysRoleResult">
|
||||
<select id="checkRoleNameUnique" parameterType="String" resultMap="SysRoleResult">
|
||||
<include refid="selectRoleVo"/>
|
||||
where r.role_name=#{roleName} and r.del_flag = '0'
|
||||
<if test="companyId != null and companyId != 0">
|
||||
AND company_id = #{companyId}
|
||||
</if>
|
||||
limit 1
|
||||
where r.role_name=#{roleName} and r.del_flag = '0' limit 1
|
||||
</select>
|
||||
|
||||
<select id="checkRoleKeyUnique" parameterType="com.bonus.system.api.domain.SysRole" resultMap="SysRoleResult">
|
||||
<select id="checkRoleKeyUnique" parameterType="String" resultMap="SysRoleResult">
|
||||
<include refid="selectRoleVo"/>
|
||||
where r.role_key=#{roleKey} and r.del_flag = '0'
|
||||
<if test="companyId != null and companyId != 0">
|
||||
AND company_id = #{companyId}
|
||||
</if>
|
||||
limit 1
|
||||
where r.role_key=#{roleKey} and r.del_flag = '0' limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertRole" parameterType="com.bonus.system.api.domain.SysRole" useGeneratedKeys="true" keyProperty="roleId">
|
||||
|
|
@ -115,7 +103,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="dataScope != null and dataScope != ''">data_scope,</if>
|
||||
<if test="menuCheckStrictly != null">menu_check_strictly,</if>
|
||||
<if test="deptCheckStrictly != null">dept_check_strictly,</if>
|
||||
<if test="companyId != null">company_id,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
|
|
@ -129,7 +116,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="dataScope != null and dataScope != ''">#{dataScope},</if>
|
||||
<if test="menuCheckStrictly != null">#{menuCheckStrictly},</if>
|
||||
<if test="deptCheckStrictly != null">#{deptCheckStrictly},</if>
|
||||
<if test="companyId != null">#{companyId},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
|
|
@ -147,7 +133,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="dataScope != null and dataScope != ''">data_scope = #{dataScope},</if>
|
||||
<if test="menuCheckStrictly != null">menu_check_strictly = #{menuCheckStrictly},</if>
|
||||
<if test="deptCheckStrictly != null">dept_check_strictly = #{deptCheckStrictly},</if>
|
||||
<if test="companyId != null">company_id = #{companyId},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
|
|
|
|||
|
|
@ -1,71 +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.SysTemplateMapper">
|
||||
|
||||
<resultMap type="com.bonus.system.api.domain.SysTemplate" id="SysTemplateResult">
|
||||
<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
|
||||
</sql>
|
||||
|
||||
<select id="selectSysTemplateList" parameterType="com.bonus.system.api.domain.SysTemplate" resultMap="SysTemplateResult">
|
||||
<include refid="selectSysTemplateVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysTemplateById" parameterType="Long" resultMap="SysTemplateResult">
|
||||
<include refid="selectSysTemplateVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSysTemplate" parameterType="com.bonus.system.api.domain.SysTemplate" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sys_template
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<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="name != null and name != ''">#{name},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysTemplate" parameterType="com.bonus.system.api.domain.SysTemplate">
|
||||
update sys_template
|
||||
<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>
|
||||
|
||||
<delete id="deleteSysTemplateById" parameterType="java.lang.String">
|
||||
delete from sys_template where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysTemplateByIds" parameterType="Long">
|
||||
delete from sys_template where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -1,58 +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.SysTemplateMenuMapper">
|
||||
|
||||
<resultMap type="com.bonus.system.api.domain.SysTemplateMenu" id="SysTemplateMenuMap">
|
||||
<result property="tempId" column="temp_id" />
|
||||
<result property="menuId" column="menu_id" />
|
||||
</resultMap>
|
||||
|
||||
<!--查询指定行数据-->
|
||||
<select id="queryAllByLimit" resultMap="SysTemplateMenuMap">
|
||||
select
|
||||
temp_id, menu_id
|
||||
from sys_template_menu
|
||||
limit #{offset}, #{limit}
|
||||
</select>
|
||||
|
||||
<!--通过实体作为筛选条件查询-->
|
||||
<select id="queryMenuIdByTemplateId" resultType="Long">
|
||||
select
|
||||
menu_id
|
||||
from
|
||||
sys_template_menu
|
||||
where
|
||||
temp_id = #{tempId}
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="" useGeneratedKeys="true">
|
||||
insert into sys_template_menu(temp_id, menu_id)
|
||||
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
|
||||
<set>
|
||||
<if test="tempId != null">
|
||||
temp_id = #{tempId},
|
||||
</if>
|
||||
<if test="menuId != null">
|
||||
menu_id = #{menuId},
|
||||
</if>
|
||||
</set>
|
||||
where = #{}
|
||||
</update>
|
||||
|
||||
<delete id="deleteByTempId" parameterType="Long">
|
||||
delete from sys_template_menu where temp_id = #{tempId}
|
||||
</delete>
|
||||
</mapper>
|
||||
|
|
@ -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">
|
||||
|
|
@ -131,9 +130,6 @@
|
|||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
AND date_format(u.create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="companyId != null and companyId != 0">
|
||||
AND (find_in_set(#{companyId}, ancestors) or u.dept_id = #{companyId})
|
||||
</if>
|
||||
<if test="deptId != null and deptId != 0">
|
||||
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId},
|
||||
ancestors) ))
|
||||
|
|
@ -214,11 +210,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
|
||||
# 共享配置
|
||||
|
|
|
|||
|
|
@ -55,10 +55,3 @@ INSERT INTO `sys_menu` VALUES (2023, '修改', 2020, 3, '#', '', NULL, 1, 0, 'F'
|
|||
INSERT INTO `sys_menu` VALUES (2024, '删除', 2020, 4, '#', '', NULL, 1, 0, 'F', '0', '0', 'system:whitelist:remove', '#', 'admin', '2024-11-06 06:23:22', 'bonus_admin', '2024-11-06 06:25:20', '', '0');
|
||||
INSERT INTO `sys_menu` VALUES (2025, '导出', 2020, 5, '#', '', NULL, 1, 0, 'F', '0', '0', 'system:whitelist:export', '#', 'admin', '2024-11-06 06:23:22', 'bonus_admin', '2024-11-06 06:25:28', '', '0');
|
||||
INSERT INTO `sys_menu` VALUES (2026, '用户锁定', 1, 7, 'lockUser', 'system/lockUser/index', NULL, 1, 0, 'C', '0', '0', NULL, 'radio', 'bonus_admin', '2024-11-07 03:10:44', '', NULL, '', '0');
|
||||
|
||||
|
||||
INSERT INTO sys_config (config_name,config_key,config_value,config_type,create_by,create_time,update_by,update_time,remark) VALUES
|
||||
('登录失败锁定-次数','sys.login.failed.times','5','Y','admin','2024-11-05 01:22:10','',NULL,NULL),
|
||||
('登录失败锁定-时间','sys.login.failed.locktime','20','Y','admin','2024-11-05 01:24:37','',NULL,NULL),
|
||||
('系统并发访问限制','sys.backend.concurrency','100','Y','admin','2024-11-05 03:23:01','admin','2024-11-06 01:22:16',NULL),
|
||||
('系统会话时长','sys.visit.tokentime','29','Y','admin','2024-11-06 01:23:35','admin','2024-11-06 01:23:49',NULL);
|
||||
|
|
@ -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