Compare commits
2 Commits
fa2ee8c7fd
...
a341eb2d5a
Author | SHA1 | Date |
---|---|---|
|
a341eb2d5a | |
|
0f35fb536e |
1
pom.xml
1
pom.xml
|
@ -219,7 +219,6 @@
|
||||||
<module>yanzhu-flowable</module>
|
<module>yanzhu-flowable</module>
|
||||||
<module>yanzhu-manage</module>
|
<module>yanzhu-manage</module>
|
||||||
<module>yanzhu-mapper</module>
|
<module>yanzhu-mapper</module>
|
||||||
<module>yanzhu-wechat</module>
|
|
||||||
</modules>
|
</modules>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ server:
|
||||||
port: 8080
|
port: 8080
|
||||||
servlet:
|
servlet:
|
||||||
# 应用的访问路径
|
# 应用的访问路径
|
||||||
context-path: /prjapi
|
context-path: /yanZhuProject
|
||||||
tomcat:
|
tomcat:
|
||||||
# tomcat的URI编码
|
# tomcat的URI编码
|
||||||
uri-encoding: UTF-8
|
uri-encoding: UTF-8
|
||||||
|
|
|
@ -105,6 +105,19 @@ public class TokenService
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除用户身份信息
|
||||||
|
*/
|
||||||
|
public void delLoginUser(HttpServletRequest request)
|
||||||
|
{
|
||||||
|
String token = getToken(request);
|
||||||
|
if (StringUtils.isNotEmpty(token))
|
||||||
|
{
|
||||||
|
String userKey = getTokenKey(token);
|
||||||
|
redisCache.deleteObject(userKey);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建令牌
|
* 创建令牌
|
||||||
*
|
*
|
||||||
|
@ -153,6 +166,26 @@ public class TokenService
|
||||||
redisCache.setCacheObject(userKey, loginUser, expireTime, TimeUnit.MINUTES);
|
redisCache.setCacheObject(userKey, loginUser, expireTime, TimeUnit.MINUTES);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 移动端主动刷新令牌有效期
|
||||||
|
*
|
||||||
|
* @param token 登录token
|
||||||
|
*/
|
||||||
|
public void refreshMobileToken(String token)
|
||||||
|
{
|
||||||
|
Claims claims = parseToken(token);
|
||||||
|
// 解析对应的权限以及用户信息
|
||||||
|
String uuid = (String) claims.get(Constants.LOGIN_USER_KEY);
|
||||||
|
String userKey = getTokenKey(uuid);
|
||||||
|
LoginUser user = redisCache.getCacheObject(userKey);
|
||||||
|
user.setLoginTime(System.currentTimeMillis());
|
||||||
|
int mobileExpireTime = expireTime * 3650 * 60 ;
|
||||||
|
user.setExpireTime(user.getLoginTime() + mobileExpireTime * MILLIS_MINUTE);
|
||||||
|
// 根据uuid将loginUser缓存
|
||||||
|
redisCache.setCacheObject(userKey, user, mobileExpireTime, TimeUnit.MINUTES);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置用户代理信息
|
* 设置用户代理信息
|
||||||
*
|
*
|
||||||
|
|
|
@ -50,6 +50,10 @@
|
||||||
<groupId>com.yanzhu</groupId>
|
<groupId>com.yanzhu</groupId>
|
||||||
<artifactId>yanzhu-framework</artifactId>
|
<artifactId>yanzhu-framework</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.yanzhu</groupId>
|
||||||
|
<artifactId>yanzhu-flowable</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package com.yanzhu.base.controller;
|
package com.yanzhu.web;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.yanzhu.project.controller;
|
package com.yanzhu.web;
|
||||||
|
|
||||||
import com.yanzhu.common.core.controller.BaseController;
|
import com.yanzhu.common.core.controller.BaseController;
|
||||||
import com.yanzhu.common.core.domain.AjaxResult;
|
import com.yanzhu.common.core.domain.AjaxResult;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.yanzhu.project.controller;
|
package com.yanzhu.web;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.yanzhu.project.controller;
|
package com.yanzhu.web;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.yanzhu.project.controller;
|
package com.yanzhu.web;
|
||||||
|
|
||||||
import com.yanzhu.common.core.controller.BaseController;
|
import com.yanzhu.common.core.controller.BaseController;
|
||||||
import com.yanzhu.common.core.domain.AjaxResult;
|
import com.yanzhu.common.core.domain.AjaxResult;
|
|
@ -276,7 +276,7 @@ public class WxFlowableController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据条件统计所有流任务
|
* 根据条件统计所有流程任务
|
||||||
* @param flowTaskEntity
|
* @param flowTaskEntity
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
|
@ -0,0 +1,100 @@
|
||||||
|
package com.yanzhu.wechat.controller;
|
||||||
|
|
||||||
|
import com.yanzhu.common.annotation.Anonymous;
|
||||||
|
import com.yanzhu.common.annotation.Log;
|
||||||
|
import com.yanzhu.common.annotation.RateLimiter;
|
||||||
|
import com.yanzhu.common.constant.Constants;
|
||||||
|
import com.yanzhu.common.core.controller.BaseController;
|
||||||
|
import com.yanzhu.common.core.domain.AjaxResult;
|
||||||
|
import com.yanzhu.common.core.domain.model.LoginBody;
|
||||||
|
import com.yanzhu.common.core.redis.RedisCache;
|
||||||
|
import com.yanzhu.common.enums.BusinessType;
|
||||||
|
import com.yanzhu.common.enums.LimitType;
|
||||||
|
import com.yanzhu.common.enums.OperatorType;
|
||||||
|
import com.yanzhu.framework.web.service.SysLoginService;
|
||||||
|
import com.yanzhu.framework.web.service.TokenService;
|
||||||
|
import com.yanzhu.system.domain.vo.UpdatePwdVo;
|
||||||
|
import com.yanzhu.system.service.ISysUserService;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @version : V1.0
|
||||||
|
* @ClassName: LoginController
|
||||||
|
* @Description: 用户登录
|
||||||
|
* @Auther: JiangYuQi
|
||||||
|
* @Date: 2020/7/7 18:03
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/wxApi")
|
||||||
|
public class WxLoginController extends BaseController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RedisCache redisCache;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysLoginService loginService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private TokenService tokenService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysUserService sysUserService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录方法
|
||||||
|
*
|
||||||
|
* @param loginBody 登录信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "账号密码登录")
|
||||||
|
@RateLimiter(count = 10, limitType = LimitType.IP)
|
||||||
|
@Anonymous
|
||||||
|
@PostMapping("/login")
|
||||||
|
public AjaxResult login(@RequestBody LoginBody loginBody)
|
||||||
|
{
|
||||||
|
AjaxResult ajax = AjaxResult.success();
|
||||||
|
// 生成令牌
|
||||||
|
String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),loginBody.getUuid());
|
||||||
|
// 移动端这里刷新token有效期为长期
|
||||||
|
tokenService.refreshMobileToken(token);
|
||||||
|
ajax.put(Constants.TOKEN, token);
|
||||||
|
return ajax;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户修改密码
|
||||||
|
*
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "修改密码")
|
||||||
|
@RateLimiter(count = 10, limitType = LimitType.IP)
|
||||||
|
@Log(title = "用户修改密码", businessType = BusinessType.UPDATE, operatorType = OperatorType.MOBILE)
|
||||||
|
@PostMapping("/updatePwd")
|
||||||
|
public AjaxResult updatePwd(@RequestBody @Valid UpdatePwdVo updatePwdVo)
|
||||||
|
{
|
||||||
|
sysUserService.updatePwd(updatePwdVo);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户退出登录
|
||||||
|
*
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "退出登录")
|
||||||
|
@RateLimiter(count = 10, limitType = LimitType.IP)
|
||||||
|
@Log(title = "用户退出登录", businessType = BusinessType.UPDATE, operatorType = OperatorType.MOBILE)
|
||||||
|
@PostMapping("/loginOut")
|
||||||
|
public AjaxResult loginOut(HttpServletRequest request)
|
||||||
|
{
|
||||||
|
tokenService.delLoginUser(request);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -10,9 +10,15 @@ import com.yanzhu.common.core.domain.entity.SysRole;
|
||||||
import com.yanzhu.common.core.domain.entity.SysUser;
|
import com.yanzhu.common.core.domain.entity.SysUser;
|
||||||
import com.yanzhu.common.core.page.TableDataInfo;
|
import com.yanzhu.common.core.page.TableDataInfo;
|
||||||
import com.yanzhu.common.core.redis.RedisCache;
|
import com.yanzhu.common.core.redis.RedisCache;
|
||||||
|
import com.yanzhu.common.enums.ShiFouEnum;
|
||||||
import com.yanzhu.common.utils.DictUtils;
|
import com.yanzhu.common.utils.DictUtils;
|
||||||
|
import com.yanzhu.common.utils.SecurityUtils;
|
||||||
import com.yanzhu.common.utils.StringUtils;
|
import com.yanzhu.common.utils.StringUtils;
|
||||||
|
import com.yanzhu.project.domain.ProProjectInfo;
|
||||||
import com.yanzhu.project.service.IProProjectApplyService;
|
import com.yanzhu.project.service.IProProjectApplyService;
|
||||||
|
import com.yanzhu.project.service.IProProjectInfoService;
|
||||||
|
import com.yanzhu.sur.domain.SurMenuConfig;
|
||||||
|
import com.yanzhu.sur.service.ISurMenuConfigService;
|
||||||
import com.yanzhu.system.service.ISysDeptService;
|
import com.yanzhu.system.service.ISysDeptService;
|
||||||
import com.yanzhu.system.service.ISysPostService;
|
import com.yanzhu.system.service.ISysPostService;
|
||||||
import com.yanzhu.system.service.ISysRoleService;
|
import com.yanzhu.system.service.ISysRoleService;
|
||||||
|
@ -47,9 +53,15 @@ public class WxPublicsController extends BaseController
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysDeptService deptService;
|
private ISysDeptService deptService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISurMenuConfigService surMenuConfigService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IBaseAssetsTypeService baseAssetsTypeService;
|
private IBaseAssetsTypeService baseAssetsTypeService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IProProjectInfoService proProjectInfoService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IProProjectApplyService proProjectApplyService;
|
private IProProjectApplyService proProjectApplyService;
|
||||||
|
|
||||||
|
@ -65,14 +77,14 @@ public class WxPublicsController extends BaseController
|
||||||
/**
|
/**
|
||||||
* 查询物资类型
|
* 查询物资类型
|
||||||
*/
|
*/
|
||||||
@GetMapping("/findAllByCategory/{category}")
|
@GetMapping("/v1/findAllByCategory/{category}")
|
||||||
public AjaxResult findAllByCategory(@PathVariable String category)
|
public AjaxResult findAllByCategory(@PathVariable String category)
|
||||||
{
|
{
|
||||||
SysUser sysUser = super.getLoginUser().getUser();
|
SysUser sysUser = super.getLoginUser().getUser();
|
||||||
String key = "YANZHU.BASE.ASSETSTYPE.findAllByCategory." + sysUser.getParDeptId() + "." + category;
|
String key = "YANZHU.BASE.ASSETSTYPE.findAllByCategory." + sysUser.getParDeptId() + "." + category;
|
||||||
Object object = redisCache.getCacheObject(key);
|
Object object = redisCache.getCacheObject(key);
|
||||||
if (object != null) {
|
if (object != null) {
|
||||||
return success(object);
|
//return success(object);
|
||||||
}
|
}
|
||||||
List<BaseAssetsType> list = baseAssetsTypeService.findAllByCategory(category);
|
List<BaseAssetsType> list = baseAssetsTypeService.findAllByCategory(category);
|
||||||
redisCache.setCacheObject(key, list, Constants.BASE_DATA_EXPIRATION, TimeUnit.MINUTES);
|
redisCache.setCacheObject(key, list, Constants.BASE_DATA_EXPIRATION, TimeUnit.MINUTES);
|
||||||
|
@ -117,4 +129,59 @@ public class WxPublicsController extends BaseController
|
||||||
return success(DictUtils.getDictCache(key));
|
return success(DictUtils.getDictCache(key));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询角色菜单列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/v1/selectRoleMenuList")
|
||||||
|
public AjaxResult selectRoleMenuList(SurMenuConfig surMenuConfig)
|
||||||
|
{
|
||||||
|
SysUser sysUser = super.getLoginUser().getUser();
|
||||||
|
if(!SysUser.isAdmin(sysUser.getUserId())){
|
||||||
|
surMenuConfig.setUsername(sysUser.getPhonenumber());
|
||||||
|
}
|
||||||
|
String key = "YANZHU.SUR.V1.selectRoleMenuList." + sysUser.getUserId() ;
|
||||||
|
Object object = redisCache.getCacheObject(key);
|
||||||
|
if (object != null) {
|
||||||
|
return success(object);
|
||||||
|
}
|
||||||
|
List<SurMenuConfig> list = surMenuConfigService.selectRoleMenuList(surMenuConfig);
|
||||||
|
redisCache.setCacheObject(key, list, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES);
|
||||||
|
return success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询我的部门列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/v1/findMyDeptList")
|
||||||
|
public AjaxResult findMyDeptList(){
|
||||||
|
Long parDeptId = super.getLoginUser().getUser().getParDeptId();
|
||||||
|
String key = "YANZHU.DEPT.V1.findMyDeptList." + parDeptId;
|
||||||
|
Object object = redisCache.getCacheObject(key);
|
||||||
|
if (object != null) {
|
||||||
|
return success(object);
|
||||||
|
}
|
||||||
|
List<SysDept> list = deptService.findChildList(parDeptId);
|
||||||
|
redisCache.setCacheObject(key, list, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES);
|
||||||
|
return success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询我的部门列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/v1/findMyProjectList")
|
||||||
|
public AjaxResult findMyProjectList(){
|
||||||
|
Long parDeptId = super.getLoginUser().getUser().getParDeptId();
|
||||||
|
String key = "YANZHU.PROJ.V1.findMyProjectList." + parDeptId;
|
||||||
|
Object object = redisCache.getCacheObject(key);
|
||||||
|
if (object != null) {
|
||||||
|
return success(object);
|
||||||
|
}
|
||||||
|
ProProjectInfo proProjectInfo = new ProProjectInfo();
|
||||||
|
proProjectInfo.setDeptId(parDeptId);
|
||||||
|
proProjectInfo.setIsDel(ShiFouEnum.FOU.getCode());
|
||||||
|
List<ProProjectInfo> list = proProjectInfoService.selectProProjectInfoList(proProjectInfo);
|
||||||
|
redisCache.setCacheObject(key, list, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES);
|
||||||
|
return success(list);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -53,6 +53,10 @@ public class ProProjectApplyDetail extends BaseEntity
|
||||||
@Excel(name = "资产单位")
|
@Excel(name = "资产单位")
|
||||||
private String assetsUnit;
|
private String assetsUnit;
|
||||||
|
|
||||||
|
/** 规格型号 */
|
||||||
|
@Excel(name = "规格型号")
|
||||||
|
private String assetsVersion;
|
||||||
|
|
||||||
/** 数量 */
|
/** 数量 */
|
||||||
@Excel(name = "数量")
|
@Excel(name = "数量")
|
||||||
private Long number;
|
private Long number;
|
||||||
|
@ -164,7 +168,15 @@ public class ProProjectApplyDetail extends BaseEntity
|
||||||
this.number = number;
|
this.number = number;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getNumber()
|
public String getAssetsVersion() {
|
||||||
|
return assetsVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAssetsVersion(String assetsVersion) {
|
||||||
|
this.assetsVersion = assetsVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getNumber()
|
||||||
{
|
{
|
||||||
return number;
|
return number;
|
||||||
}
|
}
|
||||||
|
@ -226,6 +238,7 @@ public class ProProjectApplyDetail extends BaseEntity
|
||||||
.append("assetsId", getAssetsId())
|
.append("assetsId", getAssetsId())
|
||||||
.append("assetsName", getAssetsName())
|
.append("assetsName", getAssetsName())
|
||||||
.append("assetsUnit", getAssetsUnit())
|
.append("assetsUnit", getAssetsUnit())
|
||||||
|
.append("assetsVersion", getAssetsVersion())
|
||||||
.append("number", getNumber())
|
.append("number", getNumber())
|
||||||
.append("useTime", getUseTime())
|
.append("useTime", getUseTime())
|
||||||
.append("useReason", getUseReason())
|
.append("useReason", getUseReason())
|
||||||
|
|
|
@ -148,12 +148,17 @@ public class ProProjectApplyServiceImpl implements IProProjectApplyService
|
||||||
proProjectApplyDetail.setSuperTypeKey(proProjectApply.getApplyType());
|
proProjectApplyDetail.setSuperTypeKey(proProjectApply.getApplyType());
|
||||||
proProjectApplyDetail.setSuperTypeName(superTypeName);
|
proProjectApplyDetail.setSuperTypeName(superTypeName);
|
||||||
//资产
|
//资产
|
||||||
BaseAssetsType baseAssetsType = baseAssetsTypeMapper.selectBaseAssetsTypeById(proProjectApplyDetail.getAssetsId());
|
if(StringUtils.isEmpty(proProjectApplyDetail.getAssetsName())){
|
||||||
proProjectApplyDetail.setAssetsName(baseAssetsType.getName());
|
BaseAssetsType baseAssetsType = baseAssetsTypeMapper.selectBaseAssetsTypeById(proProjectApplyDetail.getAssetsId());
|
||||||
//资产类型
|
proProjectApplyDetail.setAssetsName(baseAssetsType.getName());
|
||||||
BaseAssetsType parentAssetsType = baseAssetsTypeMapper.selectBaseAssetsTypeById(baseAssetsType.getParentId());
|
//为空时,重新查询并赋值
|
||||||
proProjectApplyDetail.setTypeId(parentAssetsType.getId());
|
if(proProjectApplyDetail.getTypeId()==null || StringUtils.isEmpty(proProjectApplyDetail.getTypeName())){
|
||||||
proProjectApplyDetail.setTypeName(parentAssetsType.getName());
|
//资产类型
|
||||||
|
BaseAssetsType parentAssetsType = baseAssetsTypeMapper.selectBaseAssetsTypeById(baseAssetsType.getParentId());
|
||||||
|
proProjectApplyDetail.setTypeId(parentAssetsType.getId());
|
||||||
|
proProjectApplyDetail.setTypeName(parentAssetsType.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
proProjectApplyDetail.setIsDel(ShiFouEnum.FOU.getCode());
|
proProjectApplyDetail.setIsDel(ShiFouEnum.FOU.getCode());
|
||||||
list.add(proProjectApplyDetail);
|
list.add(proProjectApplyDetail);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,157 @@
|
||||||
|
package com.yanzhu.sur.domain;
|
||||||
|
|
||||||
|
import com.yanzhu.common.annotation.Excel;
|
||||||
|
import com.yanzhu.common.core.domain.BaseEntity;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 菜单配置对象 sur_menu_config
|
||||||
|
*
|
||||||
|
* @author JiangYuQi
|
||||||
|
* @date 2023-08-24
|
||||||
|
*/
|
||||||
|
public class SurMenuConfig extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** $column.columnComment */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 菜单名称 */
|
||||||
|
@Excel(name = "菜单名称")
|
||||||
|
private String menuName;
|
||||||
|
|
||||||
|
/** 菜单标识 */
|
||||||
|
@Excel(name = "菜单标识")
|
||||||
|
private String menuIdenti;
|
||||||
|
|
||||||
|
/** 菜单图片 */
|
||||||
|
@Excel(name = "菜单图片")
|
||||||
|
private String menuImg;
|
||||||
|
|
||||||
|
/** 菜单地址 */
|
||||||
|
@Excel(name = "菜单地址")
|
||||||
|
private String menuUrl;
|
||||||
|
|
||||||
|
/** 删除状态(0 未删除 1 已删除) */
|
||||||
|
private Long delFlag;
|
||||||
|
|
||||||
|
/** 菜单排序 */
|
||||||
|
@Excel(name = "菜单排序")
|
||||||
|
private Integer menuSort;
|
||||||
|
|
||||||
|
/** 菜单分类 */
|
||||||
|
@Excel(name = "菜单分类")
|
||||||
|
private String menuType;
|
||||||
|
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
/** 菜单配置角色信息 */
|
||||||
|
private List<SurMenuConfigRole> surMenuConfigRoleList;
|
||||||
|
|
||||||
|
public void setId(Long id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
public void setMenuName(String menuName)
|
||||||
|
{
|
||||||
|
this.menuName = menuName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMenuName()
|
||||||
|
{
|
||||||
|
return menuName;
|
||||||
|
}
|
||||||
|
public void setMenuIdenti(String menuIdenti)
|
||||||
|
{
|
||||||
|
this.menuIdenti = menuIdenti;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMenuIdenti()
|
||||||
|
{
|
||||||
|
return menuIdenti;
|
||||||
|
}
|
||||||
|
public void setMenuImg(String menuImg)
|
||||||
|
{
|
||||||
|
this.menuImg = menuImg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMenuImg()
|
||||||
|
{
|
||||||
|
return menuImg;
|
||||||
|
}
|
||||||
|
public void setMenuUrl(String menuUrl)
|
||||||
|
{
|
||||||
|
this.menuUrl = menuUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMenuUrl()
|
||||||
|
{
|
||||||
|
return menuUrl;
|
||||||
|
}
|
||||||
|
public void setDelFlag(Long delFlag)
|
||||||
|
{
|
||||||
|
this.delFlag = delFlag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getDelFlag()
|
||||||
|
{
|
||||||
|
return delFlag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<SurMenuConfigRole> getSurMenuConfigRoleList()
|
||||||
|
{
|
||||||
|
return surMenuConfigRoleList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSurMenuConfigRoleList(List<SurMenuConfigRole> surMenuConfigRoleList)
|
||||||
|
{
|
||||||
|
this.surMenuConfigRoleList = surMenuConfigRoleList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getMenuSort() {
|
||||||
|
return menuSort;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMenuSort(Integer menuSort) {
|
||||||
|
this.menuSort = menuSort;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMenuType() {
|
||||||
|
return menuType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMenuType(String menuType) {
|
||||||
|
this.menuType = menuType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUsername() {
|
||||||
|
return username;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsername(String username) {
|
||||||
|
this.username = username;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("id", getId())
|
||||||
|
.append("menuName", getMenuName())
|
||||||
|
.append("menuIdenti", getMenuIdenti())
|
||||||
|
.append("menuImg", getMenuImg())
|
||||||
|
.append("menuUrl", getMenuUrl())
|
||||||
|
.append("delFlag", getDelFlag())
|
||||||
|
.append("createTime", getCreateTime())
|
||||||
|
.append("surMenuConfigRoleList", getSurMenuConfigRoleList())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,64 @@
|
||||||
|
package com.yanzhu.sur.domain;
|
||||||
|
|
||||||
|
import com.yanzhu.common.annotation.Excel;
|
||||||
|
import com.yanzhu.common.core.domain.BaseEntity;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 菜单配置角色对象 sur_menu_config_role
|
||||||
|
*
|
||||||
|
* @author JiangYuQi
|
||||||
|
* @date 2023-08-24
|
||||||
|
*/
|
||||||
|
public class SurMenuConfigRole extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 菜单关系主键 */
|
||||||
|
@Excel(name = "菜单关系主键")
|
||||||
|
private Long smcid;
|
||||||
|
|
||||||
|
/** 角色主键 */
|
||||||
|
@Excel(name = "角色主键")
|
||||||
|
private Long roleId;
|
||||||
|
|
||||||
|
/** 角色名称 */
|
||||||
|
@Excel(name = "角色名称")
|
||||||
|
private String roleName;
|
||||||
|
|
||||||
|
public void setSmcid(Long smcid)
|
||||||
|
{
|
||||||
|
this.smcid = smcid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getSmcid()
|
||||||
|
{
|
||||||
|
return smcid;
|
||||||
|
}
|
||||||
|
public void setRoleId(Long roleId)
|
||||||
|
{
|
||||||
|
this.roleId = roleId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getRoleId()
|
||||||
|
{
|
||||||
|
return roleId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRoleName() {
|
||||||
|
return roleName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRoleName(String roleName) {
|
||||||
|
this.roleName = roleName;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("smcid", getSmcid())
|
||||||
|
.append("roleId", getRoleId())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,95 @@
|
||||||
|
package com.yanzhu.sur.mapper;
|
||||||
|
|
||||||
|
import com.yanzhu.sur.domain.SurMenuConfig;
|
||||||
|
import com.yanzhu.sur.domain.SurMenuConfigRole;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 菜单配置Mapper接口
|
||||||
|
*
|
||||||
|
* @author JiangYuQi
|
||||||
|
* @date 2023-08-24
|
||||||
|
*/
|
||||||
|
public interface SurMenuConfigMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询菜单配置
|
||||||
|
*
|
||||||
|
* @param id 菜单配置主键
|
||||||
|
* @return 菜单配置
|
||||||
|
*/
|
||||||
|
public SurMenuConfig selectSurMenuConfigById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询菜单配置列表
|
||||||
|
*
|
||||||
|
* @param surMenuConfig 菜单配置
|
||||||
|
* @return 菜单配置集合
|
||||||
|
*/
|
||||||
|
public List<SurMenuConfig> selectSurMenuConfigList(SurMenuConfig surMenuConfig);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增菜单配置
|
||||||
|
*
|
||||||
|
* @param surMenuConfig 菜单配置
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertSurMenuConfig(SurMenuConfig surMenuConfig);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改菜单配置
|
||||||
|
*
|
||||||
|
* @param surMenuConfig 菜单配置
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateSurMenuConfig(SurMenuConfig surMenuConfig);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除菜单配置
|
||||||
|
*
|
||||||
|
* @param id 菜单配置主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteSurMenuConfigById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除菜单配置
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteSurMenuConfigByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除菜单配置角色
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteSurMenuConfigRoleBySmcids(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量新增菜单配置角色
|
||||||
|
*
|
||||||
|
* @param surMenuConfigRoleList 菜单配置角色列表
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int batchSurMenuConfigRole(List<SurMenuConfigRole> surMenuConfigRoleList);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过菜单配置主键删除菜单配置角色信息
|
||||||
|
*
|
||||||
|
* @param id 菜单配置ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteSurMenuConfigRoleBySmcid(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户查询菜单信息
|
||||||
|
* @param surMenuConfig
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<SurMenuConfig> selectRoleMenuList(SurMenuConfig surMenuConfig);
|
||||||
|
}
|
|
@ -0,0 +1,70 @@
|
||||||
|
package com.yanzhu.sur.service;
|
||||||
|
|
||||||
|
import com.yanzhu.sur.domain.SurMenuConfig;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 菜单配置Service接口
|
||||||
|
*
|
||||||
|
* @author JiangYuQi
|
||||||
|
* @date 2023-08-24
|
||||||
|
*/
|
||||||
|
public interface ISurMenuConfigService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询菜单配置
|
||||||
|
*
|
||||||
|
* @param id 菜单配置主键
|
||||||
|
* @return 菜单配置
|
||||||
|
*/
|
||||||
|
public SurMenuConfig selectSurMenuConfigById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询菜单配置列表
|
||||||
|
*
|
||||||
|
* @param surMenuConfig 菜单配置
|
||||||
|
* @return 菜单配置集合
|
||||||
|
*/
|
||||||
|
public List<SurMenuConfig> selectSurMenuConfigList(SurMenuConfig surMenuConfig);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增菜单配置
|
||||||
|
*
|
||||||
|
* @param surMenuConfig 菜单配置
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertSurMenuConfig(SurMenuConfig surMenuConfig);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改菜单配置
|
||||||
|
*
|
||||||
|
* @param surMenuConfig 菜单配置
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateSurMenuConfig(SurMenuConfig surMenuConfig);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除菜单配置
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的菜单配置主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteSurMenuConfigByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除菜单配置信息
|
||||||
|
*
|
||||||
|
* @param id 菜单配置主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteSurMenuConfigById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户查询菜单信息
|
||||||
|
* @param surMenuConfig
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<SurMenuConfig> selectRoleMenuList(SurMenuConfig surMenuConfig);
|
||||||
|
}
|
|
@ -0,0 +1,144 @@
|
||||||
|
package com.yanzhu.sur.service.impl;
|
||||||
|
|
||||||
|
import com.yanzhu.common.utils.DateUtils;
|
||||||
|
import com.yanzhu.common.utils.SecurityUtils;
|
||||||
|
import com.yanzhu.common.utils.StringUtils;
|
||||||
|
import com.yanzhu.sur.domain.SurMenuConfig;
|
||||||
|
import com.yanzhu.sur.domain.SurMenuConfigRole;
|
||||||
|
import com.yanzhu.sur.mapper.SurMenuConfigMapper;
|
||||||
|
import com.yanzhu.sur.service.ISurMenuConfigService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 菜单配置Service业务层处理
|
||||||
|
*
|
||||||
|
* @author JiangYuQi
|
||||||
|
* @date 2023-08-24
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SurMenuConfigServiceImpl implements ISurMenuConfigService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private SurMenuConfigMapper surMenuConfigMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询菜单配置
|
||||||
|
*
|
||||||
|
* @param id 菜单配置主键
|
||||||
|
* @return 菜单配置
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public SurMenuConfig selectSurMenuConfigById(Long id)
|
||||||
|
{
|
||||||
|
return surMenuConfigMapper.selectSurMenuConfigById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询菜单配置列表
|
||||||
|
*
|
||||||
|
* @param surMenuConfig 菜单配置
|
||||||
|
* @return 菜单配置
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<SurMenuConfig> selectSurMenuConfigList(SurMenuConfig surMenuConfig)
|
||||||
|
{
|
||||||
|
return surMenuConfigMapper.selectSurMenuConfigList(surMenuConfig);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增菜单配置
|
||||||
|
*
|
||||||
|
* @param surMenuConfig 菜单配置
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Transactional
|
||||||
|
@Override
|
||||||
|
public int insertSurMenuConfig(SurMenuConfig surMenuConfig)
|
||||||
|
{
|
||||||
|
surMenuConfig.setCreateTime(DateUtils.getNowDate());
|
||||||
|
int rows = surMenuConfigMapper.insertSurMenuConfig(surMenuConfig);
|
||||||
|
insertSurMenuConfigRole(surMenuConfig);
|
||||||
|
return rows;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改菜单配置
|
||||||
|
*
|
||||||
|
* @param surMenuConfig 菜单配置
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Transactional
|
||||||
|
@Override
|
||||||
|
public int updateSurMenuConfig(SurMenuConfig surMenuConfig)
|
||||||
|
{
|
||||||
|
surMenuConfigMapper.deleteSurMenuConfigRoleBySmcid(surMenuConfig.getId());
|
||||||
|
insertSurMenuConfigRole(surMenuConfig);
|
||||||
|
return surMenuConfigMapper.updateSurMenuConfig(surMenuConfig);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除菜单配置
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的菜单配置主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Transactional
|
||||||
|
@Override
|
||||||
|
public int deleteSurMenuConfigByIds(Long[] ids)
|
||||||
|
{
|
||||||
|
surMenuConfigMapper.deleteSurMenuConfigRoleBySmcids(ids);
|
||||||
|
return surMenuConfigMapper.deleteSurMenuConfigByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除菜单配置信息
|
||||||
|
*
|
||||||
|
* @param id 菜单配置主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Transactional
|
||||||
|
@Override
|
||||||
|
public int deleteSurMenuConfigById(Long id)
|
||||||
|
{
|
||||||
|
surMenuConfigMapper.deleteSurMenuConfigRoleBySmcid(id);
|
||||||
|
return surMenuConfigMapper.deleteSurMenuConfigById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增菜单配置角色信息
|
||||||
|
*
|
||||||
|
* @param surMenuConfig 菜单配置对象
|
||||||
|
*/
|
||||||
|
public void insertSurMenuConfigRole(SurMenuConfig surMenuConfig)
|
||||||
|
{
|
||||||
|
List<SurMenuConfigRole> surMenuConfigRoleList = surMenuConfig.getSurMenuConfigRoleList();
|
||||||
|
Long id = surMenuConfig.getId();
|
||||||
|
if (StringUtils.isNotNull(surMenuConfigRoleList))
|
||||||
|
{
|
||||||
|
List<SurMenuConfigRole> list = new ArrayList<SurMenuConfigRole>();
|
||||||
|
for (SurMenuConfigRole surMenuConfigRole : surMenuConfigRoleList)
|
||||||
|
{
|
||||||
|
surMenuConfigRole.setSmcid(id);
|
||||||
|
list.add(surMenuConfigRole);
|
||||||
|
}
|
||||||
|
if (list.size() > 0)
|
||||||
|
{
|
||||||
|
surMenuConfigMapper.batchSurMenuConfigRole(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户查询菜单信息
|
||||||
|
* @param surMenuConfig
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<SurMenuConfig> selectRoleMenuList(SurMenuConfig surMenuConfig) {
|
||||||
|
return surMenuConfigMapper.selectRoleMenuList(surMenuConfig);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,141 @@
|
||||||
|
<?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.yanzhu.sur.mapper.SurMenuConfigMapper">
|
||||||
|
|
||||||
|
<resultMap type="SurMenuConfig" id="SurMenuConfigResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="menuName" column="menu_name" />
|
||||||
|
<result property="menuIdenti" column="menu_identi" />
|
||||||
|
<result property="menuImg" column="menu_img" />
|
||||||
|
<result property="menuUrl" column="menu_url" />
|
||||||
|
<result property="delFlag" column="del_flag" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="menuSort" column="menu_sort" />
|
||||||
|
<result property="menuType" column="menu_type" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<resultMap id="SurMenuConfigSurMenuConfigRoleResult" type="SurMenuConfig" extends="SurMenuConfigResult">
|
||||||
|
<collection property="surMenuConfigRoleList" notNullColumn="sub_smcid" javaType="java.util.List" resultMap="SurMenuConfigRoleResult" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<resultMap type="SurMenuConfigRole" id="SurMenuConfigRoleResult">
|
||||||
|
<result property="smcid" column="sub_smcid" />
|
||||||
|
<result property="roleId" column="sub_role_id" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectSurMenuConfigVo">
|
||||||
|
select id, menu_name, menu_identi, menu_img, menu_url, del_flag, create_time, menu_type, menu_sort from sur_menu_config
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectSurMenuConfigList" parameterType="SurMenuConfig" resultMap="SurMenuConfigResult">
|
||||||
|
<include refid="selectSurMenuConfigVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="menuName != null and menuName != ''"> and menu_name like concat('%', #{menuName}, '%')</if>
|
||||||
|
<if test="menuIdenti != null and menuIdenti != ''"> and menu_identi = #{menuIdenti}</if>
|
||||||
|
<if test="menuImg != null and menuImg != ''"> and menu_img = #{menuImg}</if>
|
||||||
|
<if test="menuUrl != null and menuUrl != ''"> and menu_url = #{menuUrl}</if>
|
||||||
|
<if test="delFlag != null "> and del_flag = #{delFlag}</if>
|
||||||
|
<if test="menuType != null "> and menu_type = #{menuType}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectSurMenuConfigById" parameterType="Long" resultMap="SurMenuConfigSurMenuConfigRoleResult">
|
||||||
|
select a.id, a.menu_name, a.menu_identi, a.menu_img, a.menu_url, a.del_flag, a.create_time,menu_type,menu_sort,
|
||||||
|
b.smcid as sub_smcid, b.role_id as sub_role_id
|
||||||
|
from sur_menu_config a
|
||||||
|
left join sur_menu_config_role b on b.smcid = a.id
|
||||||
|
where a.id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertSurMenuConfig" parameterType="SurMenuConfig" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into sur_menu_config
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="menuName != null">menu_name,</if>
|
||||||
|
<if test="menuIdenti != null">menu_identi,</if>
|
||||||
|
<if test="menuImg != null">menu_img,</if>
|
||||||
|
<if test="menuUrl != null">menu_url,</if>
|
||||||
|
<if test="delFlag != null">del_flag,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="menuSort != null">menu_sort,</if>
|
||||||
|
<if test="menuType != null">menu_type,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="menuName != null">#{menuName},</if>
|
||||||
|
<if test="menuIdenti != null">#{menuIdenti},</if>
|
||||||
|
<if test="menuImg != null">#{menuImg},</if>
|
||||||
|
<if test="menuUrl != null">#{menuUrl},</if>
|
||||||
|
<if test="delFlag != null">#{delFlag},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="menuSort != null">#{menuSort},</if>
|
||||||
|
<if test="menuType != null">#{menuType},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateSurMenuConfig" parameterType="SurMenuConfig">
|
||||||
|
update sur_menu_config
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="menuName != null">menu_name = #{menuName},</if>
|
||||||
|
<if test="menuIdenti != null">menu_identi = #{menuIdenti},</if>
|
||||||
|
<if test="menuImg != null">menu_img = #{menuImg},</if>
|
||||||
|
<if test="menuUrl != null">menu_url = #{menuUrl},</if>
|
||||||
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||||
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
|
<if test="menuSort != null">menu_sort = #{menuSort},</if>
|
||||||
|
<if test="menuType != null">menu_type = #{menuType},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteSurMenuConfigById" parameterType="Long">
|
||||||
|
delete from sur_menu_config where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteSurMenuConfigByIds" parameterType="String">
|
||||||
|
delete from sur_menu_config where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteSurMenuConfigRoleBySmcids" parameterType="String">
|
||||||
|
delete from sur_menu_config_role where smcid in
|
||||||
|
<foreach item="smcid" collection="array" open="(" separator="," close=")">
|
||||||
|
#{smcid}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteSurMenuConfigRoleBySmcid" parameterType="Long">
|
||||||
|
delete from sur_menu_config_role where smcid = #{smcid}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<insert id="batchSurMenuConfigRole">
|
||||||
|
insert into sur_menu_config_role( smcid, role_id) values
|
||||||
|
<foreach item="item" index="index" collection="list" separator=",">
|
||||||
|
( #{item.smcid}, #{item.roleId})
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<!--查询角色相关菜单-->
|
||||||
|
<select id="selectRoleMenuList" parameterType="SurMenuConfig" resultMap="SurMenuConfigResult">
|
||||||
|
SELECT
|
||||||
|
DISTINCT smc.id,
|
||||||
|
smc.menu_name,
|
||||||
|
smc.menu_identi,
|
||||||
|
smc.menu_img,
|
||||||
|
smc.menu_url,
|
||||||
|
smc.menu_sort
|
||||||
|
FROM
|
||||||
|
sur_menu_config smc
|
||||||
|
LEFT JOIN sur_menu_config_role smcr ON smcr.smcid = smc.id
|
||||||
|
LEFT JOIN sys_role sr ON sr.role_id = smcr.role_id
|
||||||
|
LEFT JOIN sys_user_role ur ON sr.role_id = ur.role_id
|
||||||
|
LEFT JOIN sys_user su ON ur.user_id = su.user_id
|
||||||
|
WHERE smc.del_flag = 0
|
||||||
|
<if test="username != null and username != ''"> and su.phonenumber = #{username}</if>
|
||||||
|
<if test="menuType != null and menuType != ''"> and smc.menu_type=#{type}</if>
|
||||||
|
<if test="menuType == null or menuType == ''"> and (smc.menu_type = '' or smc.menu_type is null) </if>
|
||||||
|
order by smc.menu_sort asc
|
||||||
|
</select>
|
||||||
|
</mapper>
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.yanzhu.system.domain.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改密码
|
||||||
|
*
|
||||||
|
* @author yanZhu
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class UpdatePwdVo {
|
||||||
|
|
||||||
|
/** 旧密码 */
|
||||||
|
@NotBlank(message = "旧密码不能为空")
|
||||||
|
private String oldPsw;
|
||||||
|
|
||||||
|
/** 新密码 */
|
||||||
|
@NotBlank(message = "新密码不能为空")
|
||||||
|
private String newPsw;
|
||||||
|
|
||||||
|
/** 确认密码 */
|
||||||
|
@NotBlank(message = "确认密码不能为空")
|
||||||
|
private String cfmPsw;
|
||||||
|
}
|
|
@ -115,4 +115,5 @@ public interface SysDeptMapper
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteDeptById(Long deptId);
|
public int deleteDeptById(Long deptId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,4 +121,12 @@ public interface ISysDeptService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteDeptById(Long deptId);
|
public int deleteDeptById(Long deptId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询子部门列表
|
||||||
|
*
|
||||||
|
* @param deptId 部门ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public List<SysDept> findChildList(Long deptId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
package com.yanzhu.system.service;
|
package com.yanzhu.system.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import com.yanzhu.common.core.domain.entity.SysUser;
|
import com.yanzhu.common.core.domain.entity.SysUser;
|
||||||
|
import com.yanzhu.system.domain.vo.UpdatePwdVo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户 业务层
|
* 用户 业务层
|
||||||
|
@ -203,4 +206,12 @@ public interface ISysUserService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName);
|
public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户修改密码
|
||||||
|
*
|
||||||
|
* @param updatePwdVo 密码信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public void updatePwd(UpdatePwdVo updatePwdVo);
|
||||||
}
|
}
|
||||||
|
|
|
@ -335,4 +335,16 @@ public class SysDeptServiceImpl implements ISysDeptService
|
||||||
{
|
{
|
||||||
return getChildList(list, t).size() > 0;
|
return getChildList(list, t).size() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询子部门列表
|
||||||
|
*
|
||||||
|
* @param deptId 部门ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public List<SysDept> findChildList(Long deptId) {
|
||||||
|
SysDept sysDept = new SysDept();
|
||||||
|
sysDept.setParentId(deptId);
|
||||||
|
return deptMapper.selectDeptList(sysDept);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,11 @@ package com.yanzhu.system.service.impl;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import javax.validation.Validator;
|
import javax.validation.Validator;
|
||||||
|
|
||||||
|
import com.yanzhu.system.domain.vo.UpdatePwdVo;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -541,4 +544,23 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
}
|
}
|
||||||
return successMsg.toString();
|
return successMsg.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户修改密码
|
||||||
|
*
|
||||||
|
* @param updatePwdVo 密码信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void updatePwd(UpdatePwdVo updatePwdVo){
|
||||||
|
if(!SecurityUtils.matchesPassword(updatePwdVo.getOldPsw(),updatePwdVo.getCfmPsw())) {
|
||||||
|
throw new ServiceException("旧密码错误,请重新输入!");
|
||||||
|
}
|
||||||
|
if(!Objects.equals(updatePwdVo.getNewPsw(),updatePwdVo.getCfmPsw())){
|
||||||
|
throw new ServiceException("两次密码不一致,请重新输入!");
|
||||||
|
}
|
||||||
|
SysUser sysUser = SecurityUtils.getLoginUser().getUser();
|
||||||
|
sysUser.setPassword(SecurityUtils.encryptPassword(updatePwdVo.getCfmPsw()));
|
||||||
|
userMapper.updateUser(sysUser);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ VUE_APP_TITLE = 研筑临时项目管理系统
|
||||||
ENV = 'development'
|
ENV = 'development'
|
||||||
|
|
||||||
# 研筑临时项目管理系统/开发环境
|
# 研筑临时项目管理系统/开发环境
|
||||||
VUE_APP_BASE_API = '/prjapi'
|
VUE_APP_BASE_API = '/yanZhuProject'
|
||||||
|
|
||||||
# 路由懒加载
|
# 路由懒加载
|
||||||
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||||
|
|
|
@ -5,4 +5,4 @@ VUE_APP_TITLE = 研筑临时项目管理系统
|
||||||
ENV = 'production'
|
ENV = 'production'
|
||||||
|
|
||||||
# 研筑临时项目管理系统/生产环境
|
# 研筑临时项目管理系统/生产环境
|
||||||
VUE_APP_BASE_API = '/prjapi'
|
VUE_APP_BASE_API = '/yanZhuProject'
|
||||||
|
|
|
@ -1,89 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
<parent>
|
|
||||||
<artifactId>yanzhu</artifactId>
|
|
||||||
<groupId>com.yanzhu</groupId>
|
|
||||||
<version>3.8.7</version>
|
|
||||||
</parent>
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
|
|
||||||
<artifactId>yanzhu-wechat</artifactId>
|
|
||||||
|
|
||||||
<properties>
|
|
||||||
<maven.compiler.source>17</maven.compiler.source>
|
|
||||||
<maven.compiler.target>17</maven.compiler.target>
|
|
||||||
</properties>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
|
|
||||||
<!-- Mysql驱动包 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>mysql</groupId>
|
|
||||||
<artifactId>mysql-connector-java</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- 核心模块-->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.yanzhu</groupId>
|
|
||||||
<artifactId>yanzhu-framework</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- 系统模块-->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.yanzhu</groupId>
|
|
||||||
<artifactId>yanzhu-flowable</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- 系统模块-->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.yanzhu</groupId>
|
|
||||||
<artifactId>yanzhu-system</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- 系统模块-->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.yanzhu</groupId>
|
|
||||||
<artifactId>yanzhu-mapper</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.projectlombok</groupId>
|
|
||||||
<artifactId>lombok</artifactId>
|
|
||||||
<optional>true</optional>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
|
||||||
<version>2.1.1.RELEASE</version>
|
|
||||||
<configuration>
|
|
||||||
<fork>true</fork> <!-- 如果没有该配置,devtools不会生效 -->
|
|
||||||
</configuration>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<goals>
|
|
||||||
<goal>repackage</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-war-plugin</artifactId>
|
|
||||||
<version>3.1.0</version>
|
|
||||||
<configuration>
|
|
||||||
<failOnMissingWebXml>false</failOnMissingWebXml>
|
|
||||||
<warName>${project.artifactId}</warName>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
<finalName>${project.artifactId}</finalName>
|
|
||||||
</build>
|
|
||||||
|
|
||||||
</project>
|
|
|
@ -1,30 +0,0 @@
|
||||||
package com.yanzhu;
|
|
||||||
|
|
||||||
import org.springframework.boot.SpringApplication;
|
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
||||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 启动程序
|
|
||||||
*
|
|
||||||
* @author yanZhu
|
|
||||||
*/
|
|
||||||
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
|
|
||||||
public class WxYanZhuApplication
|
|
||||||
{
|
|
||||||
public static void main(String[] args)
|
|
||||||
{
|
|
||||||
// System.setProperty("spring.devtools.restart.enabled", "false");
|
|
||||||
SpringApplication.run(WxYanZhuApplication.class, args);
|
|
||||||
System.out.println("(♥◠‿◠)ノ゙ 研筑临时项目小程序服务启动成功 ლ(´ڡ`ლ)゙ \n" +
|
|
||||||
" .-------. ____ __ \n" +
|
|
||||||
" | _ _ \\ \\ \\ / / \n" +
|
|
||||||
" | ( ' ) | \\ _. / ' \n" +
|
|
||||||
" |(_ o _) / _( )_ .' \n" +
|
|
||||||
" | (_,_).' __ ___(_ o _)' \n" +
|
|
||||||
" | |\\ \\ | || |(_,_)' \n" +
|
|
||||||
" | | \\ `' /| `-' / \n" +
|
|
||||||
" | | \\ / \\ / \n" +
|
|
||||||
" ''-' `'-' `-..-' ");
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,18 +0,0 @@
|
||||||
package com.yanzhu;
|
|
||||||
|
|
||||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
|
||||||
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* web容器中进行部署
|
|
||||||
*
|
|
||||||
* @author yanZhu
|
|
||||||
*/
|
|
||||||
public class WxYanzhuServletInitializer extends SpringBootServletInitializer
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
protected SpringApplicationBuilder configure(SpringApplicationBuilder application)
|
|
||||||
{
|
|
||||||
return application.sources(WxYanZhuApplication.class);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,95 +0,0 @@
|
||||||
package com.yanzhu.wechat.common;
|
|
||||||
|
|
||||||
import com.google.code.kaptcha.Producer;
|
|
||||||
import com.yanzhu.common.config.YanZhuConfig;
|
|
||||||
import com.yanzhu.common.constant.CacheConstants;
|
|
||||||
import com.yanzhu.common.constant.Constants;
|
|
||||||
import com.yanzhu.common.core.domain.AjaxResult;
|
|
||||||
import com.yanzhu.common.core.redis.RedisCache;
|
|
||||||
import com.yanzhu.common.utils.sign.Base64;
|
|
||||||
import com.yanzhu.common.utils.uuid.IdUtils;
|
|
||||||
import com.yanzhu.system.service.ISysConfigService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.util.FastByteArrayOutputStream;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import javax.imageio.ImageIO;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import java.awt.image.BufferedImage;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 验证码操作处理
|
|
||||||
*
|
|
||||||
* @author yanZhu
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
public class CaptchaController
|
|
||||||
{
|
|
||||||
@Resource(name = "captchaProducer")
|
|
||||||
private Producer captchaProducer;
|
|
||||||
|
|
||||||
@Resource(name = "captchaProducerMath")
|
|
||||||
private Producer captchaProducerMath;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private RedisCache redisCache;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ISysConfigService configService;
|
|
||||||
/**
|
|
||||||
* 生成验证码
|
|
||||||
*/
|
|
||||||
@GetMapping("/captchaImage")
|
|
||||||
public AjaxResult getCode(HttpServletResponse response) throws IOException
|
|
||||||
{
|
|
||||||
AjaxResult ajax = AjaxResult.success();
|
|
||||||
boolean captchaEnabled = configService.selectCaptchaEnabled();
|
|
||||||
ajax.put("captchaEnabled", captchaEnabled);
|
|
||||||
if (!captchaEnabled)
|
|
||||||
{
|
|
||||||
return ajax;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 保存验证码信息
|
|
||||||
String uuid = IdUtils.simpleUUID();
|
|
||||||
String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + uuid;
|
|
||||||
|
|
||||||
String capStr = null, code = null;
|
|
||||||
BufferedImage image = null;
|
|
||||||
|
|
||||||
// 生成验证码
|
|
||||||
String captchaType = YanZhuConfig.getCaptchaType();
|
|
||||||
if ("math".equals(captchaType))
|
|
||||||
{
|
|
||||||
String capText = captchaProducerMath.createText();
|
|
||||||
capStr = capText.substring(0, capText.lastIndexOf("@"));
|
|
||||||
code = capText.substring(capText.lastIndexOf("@") + 1);
|
|
||||||
image = captchaProducerMath.createImage(capStr);
|
|
||||||
}
|
|
||||||
else if ("char".equals(captchaType))
|
|
||||||
{
|
|
||||||
capStr = code = captchaProducer.createText();
|
|
||||||
image = captchaProducer.createImage(capStr);
|
|
||||||
}
|
|
||||||
|
|
||||||
redisCache.setCacheObject(verifyKey, code, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES);
|
|
||||||
// 转换流信息写出
|
|
||||||
FastByteArrayOutputStream os = new FastByteArrayOutputStream();
|
|
||||||
try
|
|
||||||
{
|
|
||||||
ImageIO.write(image, "jpg", os);
|
|
||||||
}
|
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
return AjaxResult.error(e.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
ajax.put("uuid", uuid);
|
|
||||||
ajax.put("img", Base64.encode(os.toByteArray()));
|
|
||||||
return ajax;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,164 +0,0 @@
|
||||||
package com.yanzhu.wechat.common;
|
|
||||||
|
|
||||||
import com.yanzhu.common.config.YanZhuConfig;
|
|
||||||
import com.yanzhu.common.constant.Constants;
|
|
||||||
import com.yanzhu.common.core.domain.AjaxResult;
|
|
||||||
import com.yanzhu.common.utils.StringUtils;
|
|
||||||
import com.yanzhu.common.utils.file.FileUploadUtils;
|
|
||||||
import com.yanzhu.common.utils.file.FileUtils;
|
|
||||||
import com.yanzhu.framework.config.ServerConfig;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.http.MediaType;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通用请求处理
|
|
||||||
*
|
|
||||||
* @author yanZhu
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/wxApi/common")
|
|
||||||
public class CommonController
|
|
||||||
{
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(CommonController.class);
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ServerConfig serverConfig;
|
|
||||||
|
|
||||||
private static final String FILE_DELIMETER = ",";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通用下载请求
|
|
||||||
*
|
|
||||||
* @param fileName 文件名称
|
|
||||||
* @param delete 是否删除
|
|
||||||
*/
|
|
||||||
@GetMapping("/download")
|
|
||||||
public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (!FileUtils.checkAllowDownload(fileName))
|
|
||||||
{
|
|
||||||
throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName));
|
|
||||||
}
|
|
||||||
String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
|
|
||||||
String filePath = YanZhuConfig.getDownloadPath() + fileName;
|
|
||||||
|
|
||||||
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
|
|
||||||
FileUtils.setAttachmentResponseHeader(response, realFileName);
|
|
||||||
FileUtils.writeBytes(filePath, response.getOutputStream());
|
|
||||||
if (delete)
|
|
||||||
{
|
|
||||||
FileUtils.deleteFile(filePath);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
log.error("下载文件失败", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通用上传请求(单个)
|
|
||||||
*/
|
|
||||||
@PostMapping("/upload")
|
|
||||||
public AjaxResult uploadFile(MultipartFile file) throws Exception
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// 上传文件路径
|
|
||||||
String filePath = YanZhuConfig.getUploadPath();
|
|
||||||
// 上传并返回新文件名称
|
|
||||||
String fileName = FileUploadUtils.upload(filePath, file);
|
|
||||||
String url = serverConfig.getUrl() + fileName;
|
|
||||||
AjaxResult ajax = AjaxResult.success();
|
|
||||||
ajax.put("url", url);
|
|
||||||
ajax.put("fileName", fileName);
|
|
||||||
ajax.put("newFileName", FileUtils.getName(fileName));
|
|
||||||
ajax.put("originalFilename", file.getOriginalFilename());
|
|
||||||
return ajax;
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
return AjaxResult.error(e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通用上传请求(多个)
|
|
||||||
*/
|
|
||||||
@PostMapping("/uploads")
|
|
||||||
public AjaxResult uploadFiles(List<MultipartFile> files) throws Exception
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// 上传文件路径
|
|
||||||
String filePath = YanZhuConfig.getUploadPath();
|
|
||||||
List<String> urls = new ArrayList<String>();
|
|
||||||
List<String> fileNames = new ArrayList<String>();
|
|
||||||
List<String> newFileNames = new ArrayList<String>();
|
|
||||||
List<String> originalFilenames = new ArrayList<String>();
|
|
||||||
for (MultipartFile file : files)
|
|
||||||
{
|
|
||||||
// 上传并返回新文件名称
|
|
||||||
String fileName = FileUploadUtils.upload(filePath, file);
|
|
||||||
String url = serverConfig.getUrl() + fileName;
|
|
||||||
urls.add(url);
|
|
||||||
fileNames.add(fileName);
|
|
||||||
newFileNames.add(FileUtils.getName(fileName));
|
|
||||||
originalFilenames.add(file.getOriginalFilename());
|
|
||||||
}
|
|
||||||
AjaxResult ajax = AjaxResult.success();
|
|
||||||
ajax.put("urls", StringUtils.join(urls, FILE_DELIMETER));
|
|
||||||
ajax.put("fileNames", StringUtils.join(fileNames, FILE_DELIMETER));
|
|
||||||
ajax.put("newFileNames", StringUtils.join(newFileNames, FILE_DELIMETER));
|
|
||||||
ajax.put("originalFilenames", StringUtils.join(originalFilenames, FILE_DELIMETER));
|
|
||||||
return ajax;
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
return AjaxResult.error(e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 本地资源通用下载
|
|
||||||
*/
|
|
||||||
@GetMapping("/download/resource")
|
|
||||||
public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response)
|
|
||||||
throws Exception
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (!FileUtils.checkAllowDownload(resource))
|
|
||||||
{
|
|
||||||
throw new Exception(StringUtils.format("资源文件({})非法,不允许下载。 ", resource));
|
|
||||||
}
|
|
||||||
// 本地资源路径
|
|
||||||
String localPath = YanZhuConfig.getProfile();
|
|
||||||
// 数据库资源地址
|
|
||||||
String downloadPath = localPath + StringUtils.substringAfter(resource, Constants.RESOURCE_PREFIX);
|
|
||||||
// 下载名称
|
|
||||||
String downloadName = StringUtils.substringAfterLast(downloadPath, "/");
|
|
||||||
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
|
|
||||||
FileUtils.setAttachmentResponseHeader(response, downloadName);
|
|
||||||
FileUtils.writeBytes(downloadPath, response.getOutputStream());
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
log.error("下载文件失败", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,55 +0,0 @@
|
||||||
package com.yanzhu.wechat.controller;
|
|
||||||
|
|
||||||
import com.yanzhu.common.annotation.RateLimiter;
|
|
||||||
import com.yanzhu.common.constant.Constants;
|
|
||||||
import com.yanzhu.common.core.controller.BaseController;
|
|
||||||
import com.yanzhu.common.core.domain.AjaxResult;
|
|
||||||
import com.yanzhu.common.core.domain.model.LoginBody;
|
|
||||||
import com.yanzhu.common.core.redis.RedisCache;
|
|
||||||
import com.yanzhu.common.enums.LimitType;
|
|
||||||
import com.yanzhu.framework.web.service.SysLoginService;
|
|
||||||
import com.yanzhu.framework.web.service.TokenService;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @version : V1.0
|
|
||||||
* @ClassName: LoginController
|
|
||||||
* @Description: 用户登录
|
|
||||||
* @Auther: JiangYuQi
|
|
||||||
* @Date: 2020/7/7 18:03
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
public class WxLoginController extends BaseController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private RedisCache redisCache;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private SysLoginService loginService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private TokenService tokenService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 登录方法
|
|
||||||
*
|
|
||||||
* @param loginBody 登录信息
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "账号密码登录")
|
|
||||||
@RateLimiter(count = 10, limitType = LimitType.IP)
|
|
||||||
@PostMapping("/login")
|
|
||||||
public AjaxResult login(@RequestBody LoginBody loginBody)
|
|
||||||
{
|
|
||||||
AjaxResult ajax = AjaxResult.success();
|
|
||||||
// 生成令牌
|
|
||||||
String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),loginBody.getUuid());
|
|
||||||
ajax.put(Constants.TOKEN, token);
|
|
||||||
return ajax;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1 +0,0 @@
|
||||||
restart.include.json=/com.alibaba.fastjson2.*.jar
|
|
|
@ -1,117 +0,0 @@
|
||||||
# 项目相关配置
|
|
||||||
yanzhu:
|
|
||||||
# 名称
|
|
||||||
name: ProjectName
|
|
||||||
# 版本
|
|
||||||
version: 3.8.7
|
|
||||||
# 版权年份
|
|
||||||
copyrightYear: 2023
|
|
||||||
# 文件路径 示例( Windows配置D:/yanZhu/uploadPath,Linux配置 /home/yanZhu/uploadPath)
|
|
||||||
profile: D:/data/yanzhu
|
|
||||||
# 获取ip地址开关
|
|
||||||
addressEnabled: false
|
|
||||||
# 验证码类型 math 数字计算 char 字符验证
|
|
||||||
captchaType: math
|
|
||||||
|
|
||||||
# 开发环境配置
|
|
||||||
server:
|
|
||||||
# 服务器的HTTP端口,默认为8080
|
|
||||||
port: 8089
|
|
||||||
servlet:
|
|
||||||
# 应用的访问路径
|
|
||||||
context-path: /yanZhuProject
|
|
||||||
tomcat:
|
|
||||||
# tomcat的URI编码
|
|
||||||
uri-encoding: UTF-8
|
|
||||||
# 连接数满后的排队数,默认为100
|
|
||||||
accept-count: 1000
|
|
||||||
threads:
|
|
||||||
# tomcat最大线程数,默认为200
|
|
||||||
max: 800
|
|
||||||
# Tomcat启动初始化的线程数,默认值10
|
|
||||||
min-spare: 100
|
|
||||||
|
|
||||||
# 数据源配置
|
|
||||||
spring:
|
|
||||||
datasource:
|
|
||||||
type: com.alibaba.druid.pool.DruidDataSource
|
|
||||||
driverClassName: com.mysql.cj.jdbc.Driver
|
|
||||||
druid:
|
|
||||||
# 主库数据源
|
|
||||||
master:
|
|
||||||
url: jdbc:mysql://cd-cynosdbmysql-grp-9rqrhxsm.sql.tencentcdb.com:27981/yanzhu_project?useSSL=false&characterEncoding=UTF-8&serverTimezone=GMT%2B8
|
|
||||||
username: root
|
|
||||||
password: Sxyanzhu@cf
|
|
||||||
# 从库数据源
|
|
||||||
slave:
|
|
||||||
# 从数据源开关/默认关闭
|
|
||||||
enabled: false
|
|
||||||
url:
|
|
||||||
username:
|
|
||||||
password:
|
|
||||||
# 初始连接数
|
|
||||||
initialSize: 5
|
|
||||||
# 最小连接池数量
|
|
||||||
minIdle: 10
|
|
||||||
# 最大连接池数量
|
|
||||||
maxActive: 20
|
|
||||||
# 配置获取连接等待超时的时间
|
|
||||||
maxWait: 60000
|
|
||||||
# 配置连接超时时间
|
|
||||||
connectTimeout: 30000
|
|
||||||
# 配置网络超时时间
|
|
||||||
socketTimeout: 60000
|
|
||||||
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
|
||||||
timeBetweenEvictionRunsMillis: 60000
|
|
||||||
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
|
||||||
minEvictableIdleTimeMillis: 300000
|
|
||||||
# 配置一个连接在池中最大生存的时间,单位是毫秒
|
|
||||||
maxEvictableIdleTimeMillis: 900000
|
|
||||||
# 配置检测连接是否有效
|
|
||||||
validationQuery: SELECT 1 FROM DUAL
|
|
||||||
testWhileIdle: true
|
|
||||||
testOnBorrow: false
|
|
||||||
testOnReturn: false
|
|
||||||
webStatFilter:
|
|
||||||
enabled: true
|
|
||||||
statViewServlet:
|
|
||||||
enabled: true
|
|
||||||
# 设置白名单,不填则允许所有访问
|
|
||||||
allow:
|
|
||||||
url-pattern: /druid/*
|
|
||||||
# 控制台管理用户名和密码
|
|
||||||
login-username: yanzhu
|
|
||||||
login-password: Sxyanzhu@yanzhu+mz
|
|
||||||
filter:
|
|
||||||
stat:
|
|
||||||
enabled: true
|
|
||||||
# 慢SQL记录
|
|
||||||
log-slow-sql: true
|
|
||||||
slow-sql-millis: 1000
|
|
||||||
merge-sql: true
|
|
||||||
wall:
|
|
||||||
config:
|
|
||||||
multi-statement-allow: true
|
|
||||||
|
|
||||||
# redis 配置
|
|
||||||
redis:
|
|
||||||
# 地址
|
|
||||||
host: 127.0.0.1
|
|
||||||
# 端口,默认为6379
|
|
||||||
port: 6379
|
|
||||||
# 数据库索引
|
|
||||||
database: 0
|
|
||||||
# 密码
|
|
||||||
password: 123456
|
|
||||||
# 连接超时时间
|
|
||||||
timeout: 10s
|
|
||||||
lettuce:
|
|
||||||
pool:
|
|
||||||
# 连接池中的最小空闲连接
|
|
||||||
min-idle: 0
|
|
||||||
# 连接池中的最大空闲连接
|
|
||||||
max-idle: 8
|
|
||||||
# 连接池的最大数据库连接数
|
|
||||||
max-active: 8
|
|
||||||
# #连接池最大阻塞等待时间(使用负值表示没有限制)
|
|
||||||
max-wait: -1ms
|
|
|
@ -1,117 +0,0 @@
|
||||||
# 项目相关配置
|
|
||||||
yanZhu:
|
|
||||||
# 名称
|
|
||||||
name: ProjectName
|
|
||||||
# 版本
|
|
||||||
version: 3.8.7
|
|
||||||
# 版权年份
|
|
||||||
copyrightYear: 2023
|
|
||||||
# 文件路径 示例( Windows配置D:/yanZhu/uploadPath,Linux配置 /home/yanZhu/uploadPath)
|
|
||||||
profile: /data/yanzhu
|
|
||||||
# 获取ip地址开关
|
|
||||||
addressEnabled: false
|
|
||||||
# 验证码类型 math 数字计算 char 字符验证
|
|
||||||
captchaType: math
|
|
||||||
|
|
||||||
# 开发环境配置
|
|
||||||
server:
|
|
||||||
# 服务器的HTTP端口,默认为8080
|
|
||||||
port: 8089
|
|
||||||
servlet:
|
|
||||||
# 应用的访问路径
|
|
||||||
context-path: /yanZhuProject
|
|
||||||
tomcat:
|
|
||||||
# tomcat的URI编码
|
|
||||||
uri-encoding: UTF-8
|
|
||||||
# 连接数满后的排队数,默认为100
|
|
||||||
accept-count: 1000
|
|
||||||
threads:
|
|
||||||
# tomcat最大线程数,默认为200
|
|
||||||
max: 800
|
|
||||||
# Tomcat启动初始化的线程数,默认值10
|
|
||||||
min-spare: 100
|
|
||||||
|
|
||||||
# 数据源配置
|
|
||||||
spring:
|
|
||||||
datasource:
|
|
||||||
type: com.alibaba.druid.pool.DruidDataSource
|
|
||||||
driverClassName: com.mysql.cj.jdbc.Driver
|
|
||||||
druid:
|
|
||||||
# 主库数据源
|
|
||||||
master:
|
|
||||||
url: jdbc:mysql://cd-cynosdbmysql-grp-9rqrhxsm.sql.tencentcdb.com:27981/yanzhu_project?useSSL=false&characterEncoding=UTF-8&serverTimezone=GMT%2B8
|
|
||||||
username: root
|
|
||||||
password: Sxyanzhu@cf
|
|
||||||
# 从库数据源
|
|
||||||
slave:
|
|
||||||
# 从数据源开关/默认关闭
|
|
||||||
enabled: false
|
|
||||||
url:
|
|
||||||
username:
|
|
||||||
password:
|
|
||||||
# 初始连接数
|
|
||||||
initialSize: 5
|
|
||||||
# 最小连接池数量
|
|
||||||
minIdle: 10
|
|
||||||
# 最大连接池数量
|
|
||||||
maxActive: 20
|
|
||||||
# 配置获取连接等待超时的时间
|
|
||||||
maxWait: 60000
|
|
||||||
# 配置连接超时时间
|
|
||||||
connectTimeout: 30000
|
|
||||||
# 配置网络超时时间
|
|
||||||
socketTimeout: 60000
|
|
||||||
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
|
||||||
timeBetweenEvictionRunsMillis: 60000
|
|
||||||
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
|
||||||
minEvictableIdleTimeMillis: 300000
|
|
||||||
# 配置一个连接在池中最大生存的时间,单位是毫秒
|
|
||||||
maxEvictableIdleTimeMillis: 900000
|
|
||||||
# 配置检测连接是否有效
|
|
||||||
validationQuery: SELECT 1 FROM DUAL
|
|
||||||
testWhileIdle: true
|
|
||||||
testOnBorrow: false
|
|
||||||
testOnReturn: false
|
|
||||||
webStatFilter:
|
|
||||||
enabled: true
|
|
||||||
statViewServlet:
|
|
||||||
enabled: true
|
|
||||||
# 设置白名单,不填则允许所有访问
|
|
||||||
allow:
|
|
||||||
url-pattern: /druid/*
|
|
||||||
# 控制台管理用户名和密码
|
|
||||||
login-username: yanzhu
|
|
||||||
login-password: Sxyanzhu@yanzhu+mz
|
|
||||||
filter:
|
|
||||||
stat:
|
|
||||||
enabled: true
|
|
||||||
# 慢SQL记录
|
|
||||||
log-slow-sql: true
|
|
||||||
slow-sql-millis: 1000
|
|
||||||
merge-sql: true
|
|
||||||
wall:
|
|
||||||
config:
|
|
||||||
multi-statement-allow: true
|
|
||||||
|
|
||||||
# redis 配置
|
|
||||||
redis:
|
|
||||||
# 地址
|
|
||||||
host: 127.0.0.1
|
|
||||||
# 端口,默认为6379
|
|
||||||
port: 6379
|
|
||||||
# 数据库索引
|
|
||||||
database: 0
|
|
||||||
# 密码
|
|
||||||
password: 123456
|
|
||||||
# 连接超时时间
|
|
||||||
timeout: 10s
|
|
||||||
lettuce:
|
|
||||||
pool:
|
|
||||||
# 连接池中的最小空闲连接
|
|
||||||
min-idle: 0
|
|
||||||
# 连接池中的最大空闲连接
|
|
||||||
max-idle: 8
|
|
||||||
# 连接池的最大数据库连接数
|
|
||||||
max-active: 8
|
|
||||||
# #连接池最大阻塞等待时间(使用负值表示没有限制)
|
|
||||||
max-wait: -1ms
|
|
|
@ -1,81 +0,0 @@
|
||||||
# 日志配置
|
|
||||||
logging:
|
|
||||||
level:
|
|
||||||
com.yanzhu: debug
|
|
||||||
org.springframework: warn
|
|
||||||
|
|
||||||
# 用户配置
|
|
||||||
user:
|
|
||||||
password:
|
|
||||||
# 密码最大错误次数
|
|
||||||
maxRetryCount: 5
|
|
||||||
# 密码锁定时间(默认10分钟)
|
|
||||||
lockTime: 10
|
|
||||||
|
|
||||||
# Spring配置
|
|
||||||
spring:
|
|
||||||
# 资源信息
|
|
||||||
messages:
|
|
||||||
# 国际化资源文件路径
|
|
||||||
basename: i18n/messages
|
|
||||||
profiles:
|
|
||||||
active: druid
|
|
||||||
# 文件上传
|
|
||||||
servlet:
|
|
||||||
multipart:
|
|
||||||
# 单个文件大小
|
|
||||||
max-file-size: 10MB
|
|
||||||
# 设置总上传的文件大小
|
|
||||||
max-request-size: 20MB
|
|
||||||
# 服务模块
|
|
||||||
devtools:
|
|
||||||
restart:
|
|
||||||
# 热部署开关
|
|
||||||
enabled: true
|
|
||||||
|
|
||||||
# token配置
|
|
||||||
token:
|
|
||||||
# 令牌自定义标识
|
|
||||||
header: Authorization
|
|
||||||
# 令牌密钥
|
|
||||||
secret: abcdefghijklmnopqrstuvwxyz
|
|
||||||
# 令牌有效期(默认30分钟)
|
|
||||||
expireTime: 365000
|
|
||||||
|
|
||||||
# MyBatis配置
|
|
||||||
mybatis:
|
|
||||||
# 搜索指定包别名
|
|
||||||
typeAliasesPackage: com.yanzhu.**.domain
|
|
||||||
# 配置mapper的扫描,找到所有的mapper.xml映射文件
|
|
||||||
mapperLocations: classpath*:mapper/**/*Mapper.xml
|
|
||||||
# 加载全局的配置文件
|
|
||||||
configLocation: classpath:mybatis/mybatis-config.xml
|
|
||||||
|
|
||||||
# PageHelper分页插件
|
|
||||||
pagehelper:
|
|
||||||
helperDialect: mysql
|
|
||||||
supportMethodsArguments: true
|
|
||||||
params: count=countSql
|
|
||||||
|
|
||||||
# Swagger配置
|
|
||||||
swagger:
|
|
||||||
# 是否开启swagger
|
|
||||||
enabled: true
|
|
||||||
# 请求前缀
|
|
||||||
pathMapping: /dev-api
|
|
||||||
|
|
||||||
# 防止XSS攻击
|
|
||||||
xss:
|
|
||||||
# 过滤开关
|
|
||||||
enabled: true
|
|
||||||
# 排除链接(多个用逗号分隔)
|
|
||||||
excludes: /system/notice,/flowable/definition/save
|
|
||||||
# 匹配链接
|
|
||||||
urlPatterns: /*
|
|
||||||
|
|
||||||
# flowable相关表
|
|
||||||
flowable:
|
|
||||||
# true 会对数据库中所有表进行更新操作。如果表不存在,则自动创建(建议开发时使用)
|
|
||||||
database-schema-update: false
|
|
||||||
# 关闭定时任务JOB
|
|
||||||
async-executor-activate: false
|
|
|
@ -1,24 +0,0 @@
|
||||||
Application Version: ${yanzhu.version}
|
|
||||||
Spring Boot Version: ${spring-boot.version}
|
|
||||||
////////////////////////////////////////////////////////////////////
|
|
||||||
// _ooOoo_ //
|
|
||||||
// o8888888o //
|
|
||||||
// 88" . "88 //
|
|
||||||
// (| ^_^ |) //
|
|
||||||
// O\ = /O //
|
|
||||||
// ____/`---'\____ //
|
|
||||||
// .' \\| |// `. //
|
|
||||||
// / \\||| : |||// \ //
|
|
||||||
// / _||||| -:- |||||- \ //
|
|
||||||
// | | \\\ - /// | | //
|
|
||||||
// | \_| ''\---/'' | | //
|
|
||||||
// \ .-\__ `-` ___/-. / //
|
|
||||||
// ___`. .' /--.--\ `. . ___ //
|
|
||||||
// ."" '< `.___\_<|>_/___.' >'"". //
|
|
||||||
// | | : `- \`.;`\ _ /`;.`/ - ` : | | //
|
|
||||||
// \ \ `-. \_ __\ /__ _/ .-` / / //
|
|
||||||
// ========`-.____`-.___\_____/___.-`____.-'======== //
|
|
||||||
// `=---=' //
|
|
||||||
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ //
|
|
||||||
// 佛祖保佑 永不宕机 永无BUG //
|
|
||||||
////////////////////////////////////////////////////////////////////
|
|
|
@ -1,38 +0,0 @@
|
||||||
#错误消息
|
|
||||||
not.null=* 必须填写
|
|
||||||
user.jcaptcha.error=验证码错误
|
|
||||||
user.jcaptcha.expire=验证码已失效
|
|
||||||
user.not.exists=用户不存在/密码错误
|
|
||||||
user.password.not.match=用户不存在/密码错误
|
|
||||||
user.password.retry.limit.count=密码输入错误{0}次
|
|
||||||
user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定{1}分钟
|
|
||||||
user.password.delete=对不起,您的账号已被删除
|
|
||||||
user.blocked=用户已封禁,请联系管理员
|
|
||||||
role.blocked=角色已封禁,请联系管理员
|
|
||||||
login.blocked=很遗憾,访问IP已被列入系统黑名单
|
|
||||||
user.logout.success=退出成功
|
|
||||||
|
|
||||||
length.not.valid=长度必须在{min}到{max}个字符之间
|
|
||||||
|
|
||||||
user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成,且必须以非数字开头
|
|
||||||
user.password.not.valid=* 5-50个字符
|
|
||||||
|
|
||||||
user.email.not.valid=邮箱格式错误
|
|
||||||
user.mobile.phone.number.not.valid=手机号格式错误
|
|
||||||
user.login.success=登录成功
|
|
||||||
user.register.success=注册成功
|
|
||||||
user.notfound=请重新登录
|
|
||||||
user.forcelogout=管理员强制退出,请重新登录
|
|
||||||
user.unknown.error=未知错误,请重新登录
|
|
||||||
|
|
||||||
##文件上传消息
|
|
||||||
upload.exceed.maxSize=上传的文件大小超出限制的文件大小!<br/>允许的文件最大大小是:{0}MB!
|
|
||||||
upload.filename.exceed.length=上传的文件名最长{0}个字符
|
|
||||||
|
|
||||||
##权限
|
|
||||||
no.permission=您没有数据的权限,请联系管理员添加权限 [{0}]
|
|
||||||
no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}]
|
|
||||||
no.update.permission=您没有修改数据的权限,请联系管理员添加权限 [{0}]
|
|
||||||
no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}]
|
|
||||||
no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}]
|
|
||||||
no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}]
|
|
|
@ -1,106 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<configuration>
|
|
||||||
<!-- 日志存放路径 -->
|
|
||||||
<property name="log.path" value="/Users/2y/zhj/logs" />
|
|
||||||
|
|
||||||
<!-- 彩色日志 -->
|
|
||||||
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>
|
|
||||||
<conversionRule conversionWord="wex"
|
|
||||||
converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/>
|
|
||||||
<conversionRule conversionWord="wEx"
|
|
||||||
converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/>
|
|
||||||
|
|
||||||
<!-- <!– 日志输出格式 –>-->
|
|
||||||
<!-- <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />-->
|
|
||||||
|
|
||||||
<!-- Console 设置默认输出格式 -->
|
|
||||||
<property name="CONSOLE_LOG_PATTERN"
|
|
||||||
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
|
|
||||||
<!-- 控制台输出 -->
|
|
||||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
|
||||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
|
||||||
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符 -->
|
|
||||||
<!-- <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50}:%L - %msg%n</pattern>-->
|
|
||||||
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
|
|
||||||
</encoder>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<!-- 系统日志输出 -->
|
|
||||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
|
||||||
<file>${log.path}/sys-info.log</file>
|
|
||||||
<!-- 循环政策:基于时间创建日志文件 -->
|
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
|
||||||
<!-- 日志文件名格式 -->
|
|
||||||
<fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
|
||||||
<!-- 日志最大的历史 60天 -->
|
|
||||||
<maxHistory>60</maxHistory>
|
|
||||||
</rollingPolicy>
|
|
||||||
<encoder>
|
|
||||||
<pattern>${log.pattern}</pattern>
|
|
||||||
</encoder>
|
|
||||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
|
||||||
<!-- 过滤的级别 -->
|
|
||||||
<level>INFO</level>
|
|
||||||
<!-- 匹配时的操作:接收(记录) -->
|
|
||||||
<onMatch>ACCEPT</onMatch>
|
|
||||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
|
||||||
<onMismatch>DENY</onMismatch>
|
|
||||||
</filter>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
|
||||||
<file>${log.path}/sys-error.log</file>
|
|
||||||
<!-- 循环政策:基于时间创建日志文件 -->
|
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
|
||||||
<!-- 日志文件名格式 -->
|
|
||||||
<fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
|
||||||
<!-- 日志最大的历史 60天 -->
|
|
||||||
<maxHistory>60</maxHistory>
|
|
||||||
</rollingPolicy>
|
|
||||||
<encoder>
|
|
||||||
<pattern>${log.pattern}</pattern>
|
|
||||||
</encoder>
|
|
||||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
|
||||||
<!-- 过滤的级别 -->
|
|
||||||
<level>ERROR</level>
|
|
||||||
<!-- 匹配时的操作:接收(记录) -->
|
|
||||||
<onMatch>ACCEPT</onMatch>
|
|
||||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
|
||||||
<onMismatch>DENY</onMismatch>
|
|
||||||
</filter>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<!-- 用户访问日志输出 -->
|
|
||||||
<appender name="sys-user" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
|
||||||
<file>${log.path}/sys-user.log</file>
|
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
|
||||||
<!-- 按天回滚 daily -->
|
|
||||||
<fileNamePattern>${log.path}/sys-user.%d{yyyy-MM-dd}.log</fileNamePattern>
|
|
||||||
<!-- 日志最大的历史 60天 -->
|
|
||||||
<maxHistory>60</maxHistory>
|
|
||||||
</rollingPolicy>
|
|
||||||
<encoder>
|
|
||||||
<pattern>${log.pattern}</pattern>
|
|
||||||
</encoder>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<!-- 系统模块日志级别控制 -->
|
|
||||||
<logger name="com.yanzhu" level="info" />
|
|
||||||
<!-- Spring日志级别控制 -->
|
|
||||||
<logger name="org.springframework" level="warn" />
|
|
||||||
|
|
||||||
<root level="info">
|
|
||||||
<appender-ref ref="console" />
|
|
||||||
</root>
|
|
||||||
|
|
||||||
<!--系统操作日志-->
|
|
||||||
<root level="info">
|
|
||||||
<appender-ref ref="file_info" />
|
|
||||||
<appender-ref ref="file_error" />
|
|
||||||
</root>
|
|
||||||
|
|
||||||
<!--系统用户操作日志-->
|
|
||||||
<logger name="sys-user" level="info">
|
|
||||||
<appender-ref ref="sys-user"/>
|
|
||||||
</logger>
|
|
||||||
</configuration>
|
|
|
@ -1,20 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
<!DOCTYPE configuration
|
|
||||||
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
|
|
||||||
"http://mybatis.org/dtd/mybatis-3-config.dtd">
|
|
||||||
<configuration>
|
|
||||||
<!-- 全局参数 -->
|
|
||||||
<settings>
|
|
||||||
<!-- 使全局的映射器启用或禁用缓存 -->
|
|
||||||
<setting name="cacheEnabled" value="true" />
|
|
||||||
<!-- 允许JDBC 支持自动生成主键 -->
|
|
||||||
<setting name="useGeneratedKeys" value="true" />
|
|
||||||
<!-- 配置默认的执行器.SIMPLE就是普通执行器;REUSE执行器会重用预处理语句(prepared statements);BATCH执行器将重用语句并执行批量更新 -->
|
|
||||||
<setting name="defaultExecutorType" value="SIMPLE" />
|
|
||||||
<!-- 指定 MyBatis 所用日志的具体实现 -->
|
|
||||||
<setting name="logImpl" value="SLF4J" />
|
|
||||||
<!-- 使用驼峰命名法转换字段 -->
|
|
||||||
<!-- <setting name="mapUnderscoreToCamelCase" value="true"/> -->
|
|
||||||
</settings>
|
|
||||||
|
|
||||||
</configuration>
|
|
Loading…
Reference in New Issue