Commit 910c3b0a by 东州 翁 Committed by chenzg

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

parent 14d4016e
......@@ -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;
}
}
......@@ -46,7 +46,7 @@ public class ZzglController {
ZzglBmgwMMapper zzglBmgwMMapper;
@Autowired
ZzglLogDgjlMapper zzglLogDgjlMapper;
ZzglLogDgjlMapper zzglLogDgjlMapper;
/**
* 架构树/架构图/导出
......@@ -71,7 +71,7 @@ public class ZzglController {
*/
@GetMapping(value = "/otherlistent/{id}")
@ApiOperation(value = "获取岗位成员列表", httpMethod = "GET", notes = "接口发布说明")
public Result<List<YgglMainEmp>> selectOtherlistent(@CurrentUser UserBean userBean, @PathVariable Integer id) {
public Result<List<YgglMainEmp>> selectOtherlistent(@CurrentUser UserBean userBean, @PathVariable Integer id){
Integer orgCode = userBean.getOrgCode();
ArrayList<Integer> list = new ArrayList<Integer>();
List<ZzglBmgwM> zzglBmgwMs = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper)
......@@ -79,9 +79,6 @@ public class ZzglController {
list.add(id);
ZzglBmgwM.getDepts(list, id, zzglBmgwMs);
ZzglBmgwM messsage = ZzglBmgwM.builder().build().selectOne(new QueryWrapper<ZzglBmgwM>().eq("id", id));
Integer lead = messsage.getLeader(); // 获取部门或岗位领导id
if (list == null || list.size() == 0) {
return ResultUtil.error("部门信息不存在,请先添加部门!");
} else {
......@@ -89,11 +86,11 @@ public class ZzglController {
ygglMainEmpsLambdaQueryWrapper
.select(YgglMainEmp::getId, YgglMainEmp::getEmpNum, YgglMainEmp::getName, YgglMainEmp::getPhone,
YgglMainEmp::getBmgwId)
.eq(YgglMainEmp::getOrgCode, orgCode).and(i -> i.in(YgglMainEmp::getBmgwId, list.toArray()))
.last(lead != null, "order by if (emp_num='" + lead + "',0,1)");
.eq(YgglMainEmp::getOrgCode, orgCode).and(i -> i.in(YgglMainEmp::getBmgwId, list.toArray()));
List<YgglMainEmp> ygglMainEmps = YgglMainEmp.builder().build().selectList(ygglMainEmpsLambdaQueryWrapper);
return ResultUtil.data(ygglMainEmps);
}
}
/**
......@@ -104,8 +101,7 @@ public class ZzglController {
*/
@PostMapping(value = "/listdgjl")
@ApiOperation(value = "获取调岗记录(weng)", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> selectlistdgjl(@CurrentUser UserBean userBean,
@RequestBody LogDgjlsQueryDto logDgjlsQueryDto) {
public Result<Object> selectlistdgjl(@CurrentUser UserBean userBean, @RequestBody LogDgjlsQueryDto logDgjlsQueryDto){
Integer orgCode = userBean.getOrgCode();
ArrayList<Integer> list = new ArrayList<Integer>();
List<ZzglBmgwM> zzglBmgwMs = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper)
......@@ -116,10 +112,10 @@ public class ZzglController {
if (list == null || list.size() == 0) {
return ResultUtil.error("部门信息不存在,请先添加部门!");
} else {
logDgjlsQueryDto.setDeptIdList(list);
logDgjlsQueryDto.setOrgCode(orgCode);
IPage<LogDgjlsDto> page = new Page<LogDgjlsDto>(
logDgjlsQueryDto.getCurrentPage() == null ? 1 : logDgjlsQueryDto.getCurrentPage(),
logDgjlsQueryDto.getTotalPage() == null ? 10 : logDgjlsQueryDto.getTotalPage());
......@@ -159,7 +155,7 @@ public class ZzglController {
*/
@PostMapping(value = "/dept")
@ApiOperation(value = "添加/修改部门", httpMethod = "POST", notes = "接口发布说明")
public Result<ZzglBmgwM> adddept(@CurrentUser UserBean userBean, @RequestBody ZzglBmgwM zzglBmgwM) {
public Result<ZzglBmgwM> adddept(@CurrentUser UserBean userBean, @RequestBody ZzglBmgwM zzglBmgwM){
Boolean a = zzglBmgwM.getId() == null;
if (a && zzglBmgwM.getType() == null)
zzglBmgwM.setType((Integer) 0);
......@@ -168,6 +164,7 @@ public class ZzglController {
if (a)
return ResultUtil.data(zzglBmgwM);
return ResultUtil.success();
}
/**
......@@ -210,7 +207,21 @@ 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
}
/**
* 岗位权限
*
......@@ -224,7 +235,7 @@ public class ZzglController {
ArrayList<Integer> list = new ArrayList<Integer>();
List<ZzglBmgwM> zzglBmgwMs = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper)
.eq(ZzglBmgwM::getOrgCode, orgCode).list();
ZzglBmgwM.getupDepts(list, id, zzglBmgwMs);
ZzglBmgwM.getupDepts(list, id, zzglBmgwMs);
if (list == null || list.size() == 0) {
return ResultUtil.error("部门信息不存在,请先添加部门!");
} else {
......
......@@ -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