kaiyu
2021-04-23 726b056fc2d3b51acdeb0b5fbaf74c8886acc2ac
screen-manage
更新时间格式
8 files modified
52 ■■■■ changed files
screen-common/src/main/java/com/moral/constant/ResponseCodeEnum.java 7 ●●●●● patch | view | raw | blame | history
screen-common/src/main/java/com/moral/util/AESUtils.java 2 ●●● patch | view | raw | blame | history
screen-common/src/main/java/com/moral/util/RegexUtils.java 13 ●●●●● patch | view | raw | blame | history
screen-manage/src/main/java/com/moral/api/pojo/form/account/AccountInsertForm.java 13 ●●●●● patch | view | raw | blame | history
screen-manage/src/main/java/com/moral/api/pojo/form/account/AccountUpdateForm.java 10 ●●●●● patch | view | raw | blame | history
screen-manage/src/main/java/com/moral/api/pojo/vo/account/AccountQueryVO.java 3 ●●●● patch | view | raw | blame | history
screen-manage/src/main/java/com/moral/api/pojo/vo/account/AccountVO.java 2 ●●●●● patch | view | raw | blame | history
screen-manage/src/main/java/com/moral/api/pojo/vo/manageLog/ManageLogQueryVO.java 2 ●●● patch | view | raw | blame | history
screen-common/src/main/java/com/moral/constant/ResponseCodeEnum.java
@@ -22,9 +22,9 @@
    PASSWORD_ERROR(-8,"密码错误"),
    MOBILE_INVALID(-9,"手机号无效"),
    EMAIL_INVALID(-10,"邮箱无效"),
    ACCOUNT_INVALID(-11,"用户名无效"),
    ACCOUNT_INVALID(-11,"账号无效"),
    PASSWORD_INVALID(-12,"密码无效"),
    ACCOUNT_IS_EXPIRE(-13,"用户已过期"),
    ACCOUNT_IS_EXPIRE(-13,"账号已过期"),
    ORGANIZATION_NOT_EXIST(-14,"组织不存在"),
    ORGANIZATION_EXIST(-15,"组织已经存在"),
    ORGANIZATION_PARENT_NOT_EXIST(-16,"父组织不存在"),
@@ -40,7 +40,8 @@
    DICTTYPE_NOT_EXIST(-26,"字典类型不存在"),
    DICTTYPE_EXIST(-27,"字典类型已经存在"),
    DICTDATA_KEY_EXIST(-28,"字典数据Key已经存在"),
    DICTDATA_KEY_NOT_EXIST(-29,"字典数据Key不存在")
    DICTDATA_KEY_NOT_EXIST(-29,"字典数据Key不存在"),
    USERNAME_INVALID(-30,"用户名称无效")
    ;
    private final Integer code;
    private final String  msg;
screen-common/src/main/java/com/moral/util/AESUtils.java
@@ -81,7 +81,7 @@
    }
    public static void main(String[] args) {
        System.out.println(encrypt("123456","AD42F7787B035B7580000EF93BE20BAD"));
        System.out.println(encrypt("chenkaiyu111","AD42F7787B035B7580000EF93BE20BAD"));
    }
}
screen-common/src/main/java/com/moral/util/RegexUtils.java
@@ -195,4 +195,17 @@
        return Pattern.matches(regex, ipAddress);
    }
    /**
    * @Description: 判断字符串是否包含中文
            * @Param: [str]
            * @return: boolean
            * @Author: 陈凯裕
            * @Date: 2021/4/21
            */
    public static boolean checkContainChinese(String str){
        Pattern p = Pattern.compile("[\u4e00-\u9fa5]");
        Matcher matcher = p.matcher(str);
        return matcher.find();
    }
}
screen-manage/src/main/java/com/moral/api/pojo/form/account/AccountInsertForm.java
@@ -53,10 +53,16 @@
    public AccountDTO paramValid(){
        AccountDTO dto = new AccountDTO();
        //判断用户名是否符合条件
        //判断账号是否符合条件
        if(!RegexUtils.checkAccount(account)){
            dto.setCode(ResponseCodeEnum.ACCOUNT_INVALID.getCode());
            dto.setMsg(ResponseCodeEnum.ACCOUNT_INVALID.getMsg());
            return dto;
        }
        //判断用户名是否符合条件
        if(!RegexUtils.checkChinese(userName)||userName.contains(" ")){
            dto.setCode(ResponseCodeEnum.USERNAME_INVALID.getCode());
            dto.setMsg(ResponseCodeEnum.USERNAME_INVALID.getMsg());
            return dto;
        }
        //判断密码是否符合条件
@@ -66,20 +72,25 @@
            return dto;
        }
        //判断手机号是否符合条件
        if (!ObjectUtils.isEmpty(mobile)) {
        if(!RegexUtils.checkMobile(mobile)){
            dto.setCode(ResponseCodeEnum.MOBILE_INVALID.getCode());
            dto.setMsg(ResponseCodeEnum.MOBILE_INVALID.getMsg());
            return dto;
        }
        }
        //判断邮箱是否符合条件
        if (!ObjectUtils.isEmpty(email)) {
        if(!RegexUtils.checkEmail(email)){
            dto.setCode(ResponseCodeEnum.EMAIL_INVALID.getCode());
            dto.setMsg(ResponseCodeEnum.EMAIL_INVALID.getMsg());
            return dto;
        }
        }
        dto.setCode(ResponseCodeEnum.SUCCESS.getCode());
        dto.setMsg(ResponseCodeEnum.SUCCESS.getMsg());
        return dto;
    }
    public ManageAccount formConvertEntity(){
screen-manage/src/main/java/com/moral/api/pojo/form/account/AccountUpdateForm.java
@@ -52,6 +52,14 @@
    public AccountDTO paramValid() {
        AccountDTO dto = new AccountDTO();
        //判断用户名是否有效
        if(!ObjectUtils.isEmpty(userName)){
            if(!RegexUtils.checkChinese(userName)||userName.contains(" ")){
                dto.setCode(ResponseCodeEnum.USERNAME_INVALID.getCode());
                dto.setMsg(ResponseCodeEnum.USERNAME_INVALID.getMsg());
                return dto;
            }
        }
        //判断手机号是否符合条件
        if (!ObjectUtils.isEmpty(mobile)) {
            if (!RegexUtils.checkMobile(mobile)) {
@@ -92,4 +100,6 @@
        manageAccount.setWechat(wechat);
        return manageAccount;
    }
}
screen-manage/src/main/java/com/moral/api/pojo/vo/account/AccountQueryVO.java
@@ -63,7 +63,7 @@
    public static AccountVO convertToQueryPage(AccountDTO dto) {
        if (dto.getAccount() == null)
            return null;
        AccountInsertVO vo = new AccountInsertVO();
        AccountVO vo = new AccountVO();
        ManageAccount account = dto.getAccount();
        List<ManageRole> roles = dto.getRoles();
        if(!ObjectUtils.isEmpty(roles)){
@@ -75,6 +75,7 @@
            });
        }
        vo.setId(account.getId());
        vo.setAccount(account.getAccount());
        vo.setUserName(account.getUserName());
        vo.setEmail(account.getEmail());
        vo.setMobile(account.getMobile());
screen-manage/src/main/java/com/moral/api/pojo/vo/account/AccountVO.java
@@ -27,6 +27,8 @@
    private String userName;
    private String account;
    private String email;
    private String mobile;
screen-manage/src/main/java/com/moral/api/pojo/vo/manageLog/ManageLogQueryVO.java
@@ -72,7 +72,7 @@
        //处理时间以及content
        String[] contentArray = content.split(";");
        List<String> contentList = Arrays.asList(contentArray);
        String createTimeStr = DateUtils.dateToDateString(createTime, "yyyy-MM-dd");
        String createTimeStr = DateUtils.dateToDateString(createTime, "yyyy-MM-dd HH:mm:ss");
        vo.setAccount(account);
        vo.setContent(contentList);