Commit ae9745bb by dengshichuan

Merge branch 'wdz' into 'develop'

Wdz

See merge request 8timerv2/8timerapiv200!30
parents 5e14da02 8d3a7fc6
...@@ -16,7 +16,6 @@ import java.util.regex.Pattern; ...@@ -16,7 +16,6 @@ import java.util.regex.Pattern;
import cn.timer.api.dto.yggl.YgbintuDto; import cn.timer.api.dto.yggl.YgbintuDto;
import lombok.Getter; import lombok.Getter;
import net.sf.ehcache.search.expression.Between;
/** /**
* @date 2020年3月23日 * @date 2020年3月23日
...@@ -77,7 +76,7 @@ public interface YgEnumInterface { ...@@ -77,7 +76,7 @@ public interface YgEnumInterface {
*/ */
@Getter @Getter
enum jobStatus implements YgEnumInterface{ enum jobStatus implements YgEnumInterface{
ZHENSHI(1,"正式"),SHIYONG(2,"试用"),LIZHIZHONG(3,"离职中"),YILIZHI(4,"已离职"); SHIYONG(1,"试用"),ZHENSHI(2,"正式"),LIZHIZHONG(3,"离职中"),YILIZHI(4,"已离职");
private Integer type; private Integer type;
...@@ -113,29 +112,30 @@ public interface YgEnumInterface { ...@@ -113,29 +112,30 @@ public interface YgEnumInterface {
} }
public static String tranTime(String index) { public static String tranTime(String index) {
DateFormat zhenFormat = new SimpleDateFormat(ZHEN.name); //String str ="2013/11/12";
String result = zhenFormat.format(new Date()); String p = "年|月|日|号|时|/|//-";
if (index == null || index.length() == 0) return result; String result = index.replaceAll(p, "-");
Pattern pattern = Pattern.compile("^[0-9]{8}$"); String p2 = "-$";
if (pattern.matcher(index).matches()) { String result2 = result.replaceAll(p2, "");
result = index.substring(0, 4) + "-" + index.substring(4, 6) + "-" + index.substring(6, 8); return result2;
return result; }
}
String s = index.replaceAll("([1-9]+[0-9]*|0)(\\.[\\d]+)?", "");
for (rzTime item : rzTime.values()) { /*
if (s.indexOf(item.type) != -1) { * public static String tranTime(String index) { DateFormat zhenFormat = new
DateFormat dateFormat = new SimpleDateFormat(item.name); * SimpleDateFormat(ZHEN.name); String result = zhenFormat.format(new Date());
try { * if (index == null || index.length() == 0) return result; Pattern pattern =
result = new SimpleDateFormat(ZHEN.name).format(dateFormat.parse(index)); * Pattern.compile("^[0-9]{8}$"); if (pattern.matcher(index).matches()) { result
return result; * = index.substring(0, 4) + "-" + index.substring(4, 6) + "-" +
} catch (ParseException e) { * index.substring(6, 8); return result; } String s =
e.printStackTrace(); * index.replaceAll("([1-9]+[0-9]*|0)(\\.[\\d]+)?", ""); for (rzTime item :
return result; * rzTime.values()) { if (s.indexOf(item.type) != -1) { DateFormat dateFormat =
} * new SimpleDateFormat(item.name); try { result = new
} * SimpleDateFormat(ZHEN.name).format(dateFormat.parse(index)); return result; }
} * catch (ParseException e) { e.printStackTrace(); return result; } } } return
return result; * result; }
} */
public static String tranTime2(String result) { public static String tranTime2(String result) {
......
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;
}
}
...@@ -1513,7 +1513,6 @@ public class YgglController { ...@@ -1513,7 +1513,6 @@ public class YgglController {
Integer type = ygjgDto.getType(); Integer type = ygjgDto.getType();
Integer upId = ygjgDto.getJgid(); Integer upId = ygjgDto.getJgid();
List<YgjgDto> maps = new ArrayList<YgjgDto>(); List<YgjgDto> maps = new ArrayList<YgjgDto>();
if (type == 1) { // 省份 if (type == 1) { // 省份
List<YgProDto> list = new LambdaQueryChainWrapper<YgProDto>(ygProDtoMapper) List<YgProDto> list = new LambdaQueryChainWrapper<YgProDto>(ygProDtoMapper)
.select(YgProDto::getId, YgProDto::getProvince, YgProDto::getName).orderByAsc(YgProDto::getProvince) .select(YgProDto::getId, YgProDto::getProvince, YgProDto::getName).orderByAsc(YgProDto::getProvince)
......
...@@ -210,6 +210,20 @@ public class ZzglController { ...@@ -210,6 +210,20 @@ public class ZzglController {
// zzglLogDgjlMapper.insert // zzglLogDgjlMapper.insert
return ResultUtil.success(); 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
}
/** /**
* 岗位权限 * 岗位权限
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
package cn.timer.api.dto.yggl; package cn.timer.api.dto.yggl;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Transient; import javax.persistence.Transient;
...@@ -26,7 +28,7 @@ import lombok.NoArgsConstructor; ...@@ -26,7 +28,7 @@ import lombok.NoArgsConstructor;
@Builder @Builder
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
public class YgjgDto implements Serializable { public class YgjgDto implements Serializable{
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -44,4 +46,5 @@ public class YgjgDto implements Serializable { ...@@ -44,4 +46,5 @@ public class YgjgDto implements Serializable {
@TableField(exist = false) @TableField(exist = false)
private String jgname; private String jgname;
} }
...@@ -25,4 +25,5 @@ public class UpEmpDeptDto implements Serializable{ ...@@ -25,4 +25,5 @@ public class UpEmpDeptDto implements Serializable{
@ApiModelProperty(value="是否调岗",example="1") @ApiModelProperty(value="是否调岗",example="1")
private Integer isdg; private Integer isdg;
} }
...@@ -77,7 +77,8 @@ ...@@ -77,7 +77,8 @@
LEFT JOIN zzgl_bmgw_m e ON a.nbmgw_id = e.id 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 LEFT JOIN yggl_main_emp d ON a.update_id = d.emp_num
<where> <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 != ''"> <if test="null != param.query and param.query != ''">
and (c.name like CONCAT('%',#{param.query},'%') or and (c.name like CONCAT('%',#{param.query},'%') or
a.emp_num like CONCAT('%',#{param.query},'%') or a.emp_num like CONCAT('%',#{param.query},'%') or
...@@ -91,7 +92,7 @@ ...@@ -91,7 +92,7 @@
</foreach> </foreach>
</if> </if>
</where> </where>
order by a.create_time DESC GROUP BY `createTime` order by a.create_time DESC
</select> </select>
......
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