Commit 8070bfa4 by 东州 翁

1.应前端更新了正式,试用字段顺序 2.根据审批要求写了一个修改,删除员工部门的方法用于调岗离职 3.写了一个正则的验证字符串工具类。

parent c18eda80
......@@ -76,7 +76,7 @@ public interface YgEnumInterface {
*/
@Getter
enum jobStatus implements YgEnumInterface{
ZHENSHI(1,"正式"),SHIYONG(2,"试用"),LIZHIZHONG(3,"离职中"),YILIZHI(4,"已离职");
SHIYONG(1,"试用"),ZHENSHI(2,"正式"),LIZHIZHONG(3,"离职中"),YILIZHI(4,"已离职");
private Integer type;
......
package cn.timer.api.config.enums;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import lombok.Getter;
/**
* @date 2020年4月15日
* @author 翁东州
* @scene 使用场景:字符串的正则验证
*/
@Getter
public enum Regular {
/**
* 不超过20字符
*/
CHARS20("CHARS20","(\\s|\\S){0,20}"),
/**
* 不超过500字符
*/
CHARS500("CHARS500","(\\s|\\S){0,500}"),
/**
* 手机号码
*/
PHONE("PHONE","^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(17[013678])|(18[0,5-9]))\\d{8}$"),
/**
* 身份证
*/
IDCARD("IDCARD","(^\\d{15}$)|(^\\d{18}$)|(^\\d{17}(\\d|X|x)$)"),
/**
* 账号是否合法
*/
TOFZHANHAO("TOFZHANHAO","^[a-zA-Z][a-zA-Z0-9_]{4,15}$"),
/**
* 密码是否合法
*/
TOFPW("TOFPW","^[a-zA-Z]\\w{5,17}$"),
/**
* 强密码
*/
SHPW("SHPW","^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])[a-zA-Z0-9]{8,10}$"),
//纯汉字输入
CHINESE("CHINESE","[\\u4E00-\\u9FA5]*"),
/**
* 邮箱
*/
EMAIL("EMAIL","^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$"),
/**
* 域名
*/
DNS("DNS","[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+\\.?"),
/**
* 非负整数
*/
FUNUM("FUNUM","^(0|[1-9][0-9]*)$"),
/**
* xml文件命名
*/
XML("XML","^([a-zA-Z]+-?)+[a-zA-Z0-9]+\\.(xml|XML|Xml)$"),
/**
* QQ
*/
QQ("QQ","[1-9][0-9]{4,}"),
/**
* 邮政
*/
YOUZHEN("YOUZHEN","[1-9]\\d{5}(?!\\d)"),
/**
* IP
*/
IPADDRESS("IPADDRESS","\\d+\\.\\d+\\.\\d+\\.\\d+"),
/**
* IP255.255.255.255
*/
IP255("IP255","((?:(?:25[0-5]|2[0-4]\\d|[01]?\\d?\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d?\\d))"),
/**
* IP-V4
*/
IPV4("IPV4","\\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\b"),
/**
* IP-V6
*/
IPV6("IPV6","(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))"),
/**
* 子网掩码
*/
SUBM("SUBM","((?:(?:25[0-5]|2[0-4]\\d|[01]?\\d?\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d?\\d))"),
/**
* yyyy-mm-dd 平闰年校验
*/
YMD("YMD","^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$"),
/**
* 身份证校验码看isIdCard
*/
IDSTRING("IDSTRING","(^[1-9]\\d{5}(18|19|20)\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$)|(^[1-9]\\d{5}\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}$)");
private String name;
private String regex;
Regular(String name,String regex) {
this.name = name;
this.regex = regex;
}
/**
* @return true/false
* @input 需要验证的字符串
* @regular 需要验证的枚举类型
*/
public static boolean match(String input,Regular regular) {
String regex = regular.getRegex();
Pattern p = Pattern.compile(regex);
Matcher m = p.matcher(input);
boolean tof = m.matches();
return tof;
}
}
......@@ -207,6 +207,20 @@ public class ZzglController {
// zzglLogDgjlMapper.insert
return ResultUtil.success();
}
//修改/删除员工部门(供审批管理使用)
public void updatelistempdeptforspgl (Integer empNum,Integer orgCode, UpEmpDeptDto upEmpDeptDto) {
Integer dpetId = upEmpDeptDto.getDpetId();
List<Integer> empNums = new ArrayList<Integer>();
empNums.add(empNum);
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build();
// zzglLogDgjlMapper
UpdateWrapper<YgglMainEmp> updateWrapper = new UpdateWrapper<YgglMainEmp>();
updateWrapper.set("bmgw_id", dpetId).eq("org_code", orgCode).in("emp_num", empNum);
zzglLogDgjlMapper.insertbyaddemp(empNums, empNum, dpetId, orgCode,
dpetId == null || dpetId == 0 ? "岗位删除员工" : upEmpDeptDto.getIsdg() == null ? "岗位添加员工" : "员工调岗");
ygglMainEmp.update(updateWrapper);
// zzglLogDgjlMapper.insert
}
/**
* 岗位权限
......
......@@ -25,4 +25,5 @@ public class UpEmpDeptDto implements Serializable{
@ApiModelProperty(value="是否调岗",example="1")
private Integer isdg;
}
......@@ -77,7 +77,8 @@
LEFT JOIN zzgl_bmgw_m e ON a.nbmgw_id = e.id
LEFT JOIN yggl_main_emp d ON a.update_id = d.emp_num
<where>
a.org_code = #{param.orgCode}
a.org_code = #{param.orgCode} AND c.org_code = #{param.orgCode} AND b.org_code = #{param.orgCode}
AND e.org_code = #{param.orgCode} AND d.org_code = #{param.orgCode}
<if test="null != param.query and param.query != ''">
and (c.name like CONCAT('%',#{param.query},'%') or
a.emp_num like CONCAT('%',#{param.query},'%') or
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment