Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
8
8timerapiv200
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
8timerv2
8timerapiv200
Commits
b9de4438
Commit
b9de4438
authored
Apr 17, 2020
by
邓实川
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
http://120.24.24.239:8082/8timerv2/8timerapiv200.git
into dsc
parents
9b7c838b
ae9745bb
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
168 additions
and
30 deletions
+168
-30
src/main/java/cn/timer/api/config/enuminterface/YgEnumInterface.java
+24
-24
src/main/java/cn/timer/api/config/enums/Regular.java
+120
-0
src/main/java/cn/timer/api/controller/yggl/YgglController.java
+0
-1
src/main/java/cn/timer/api/controller/zzgl/ZzglController.java
+16
-2
src/main/java/cn/timer/api/dto/yggl/YgjgDto.java
+4
-1
src/main/java/cn/timer/api/dto/zzgl/UpEmpDeptDto.java
+1
-0
src/main/resources/mapping/zzgl/ZzglLogDgjlMapper.xml
+3
-2
No files found.
src/main/java/cn/timer/api/config/enuminterface/YgEnumInterface.java
View file @
b9de4438
...
...
@@ -16,7 +16,6 @@ import java.util.regex.Pattern;
import
cn.timer.api.dto.yggl.YgbintuDto
;
import
lombok.Getter
;
import
net.sf.ehcache.search.expression.Between
;
/**
* @date 2020年3月23日
...
...
@@ -77,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
;
...
...
@@ -113,31 +112,32 @@ public interface YgEnumInterface {
}
public
static
String
tranTime
(
String
index
)
{
DateFormat
zhenFormat
=
new
SimpleDateFormat
(
ZHEN
.
name
);
String
result
=
zhenFormat
.
format
(
new
Date
());
if
(
index
==
null
||
index
.
length
()
==
0
)
return
result
;
Pattern
pattern
=
Pattern
.
compile
(
"^[0-9]{8}$"
);
if
(
pattern
.
matcher
(
index
).
matches
())
{
result
=
index
.
substring
(
0
,
4
)
+
"-"
+
index
.
substring
(
4
,
6
)
+
"-"
+
index
.
substring
(
6
,
8
);
return
result
;
}
String
s
=
index
.
replaceAll
(
"([1-9]+[0-9]*|0)(\\.[\\d]+)?"
,
""
);
for
(
rzTime
item
:
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
result
;
//String str ="2013/11/12";
String
p
=
"年|月|日|号|时|/|//-"
;
String
result
=
index
.
replaceAll
(
p
,
"-"
);
String
p2
=
"-$"
;
String
result2
=
result
.
replaceAll
(
p2
,
""
);
return
result2
;
}
/*
* public static String tranTime(String index) { DateFormat zhenFormat = new
* SimpleDateFormat(ZHEN.name); String result = zhenFormat.format(new Date());
* if (index == null || index.length() == 0) return result; Pattern pattern =
* Pattern.compile("^[0-9]{8}$"); if (pattern.matcher(index).matches()) { result
* = index.substring(0, 4) + "-" + index.substring(4, 6) + "-" +
* index.substring(6, 8); return result; } String s =
* index.replaceAll("([1-9]+[0-9]*|0)(\\.[\\d]+)?", ""); for (rzTime item :
* 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
* result; }
*/
public
static
String
tranTime2
(
String
result
)
{
String
isYear
=
"^(?:(?!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 )$"
;
Pattern
pattern
=
Pattern
.
compile
(
isYear
);
...
...
src/main/java/cn/timer/api/config/enums/Regular.java
0 → 100644
View file @
b9de4438
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
;
}
}
src/main/java/cn/timer/api/controller/yggl/YgglController.java
View file @
b9de4438
...
...
@@ -1513,7 +1513,6 @@ public class YgglController {
Integer
type
=
ygjgDto
.
getType
();
Integer
upId
=
ygjgDto
.
getJgid
();
List
<
YgjgDto
>
maps
=
new
ArrayList
<
YgjgDto
>();
if
(
type
==
1
)
{
// 省份
List
<
YgProDto
>
list
=
new
LambdaQueryChainWrapper
<
YgProDto
>(
ygProDtoMapper
)
.
select
(
YgProDto:
:
getId
,
YgProDto:
:
getProvince
,
YgProDto:
:
getName
).
orderByAsc
(
YgProDto:
:
getProvince
)
...
...
src/main/java/cn/timer/api/controller/zzgl/ZzglController.java
View file @
b9de4438
...
...
@@ -210,7 +210,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 +238,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
{
...
...
src/main/java/cn/timer/api/dto/yggl/YgjgDto.java
View file @
b9de4438
...
...
@@ -6,6 +6,8 @@
package
cn
.
timer
.
api
.
dto
.
yggl
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.List
;
import
javax.persistence.Transient
;
...
...
@@ -26,7 +28,7 @@ import lombok.NoArgsConstructor;
@Builder
@AllArgsConstructor
@NoArgsConstructor
public
class
YgjgDto
implements
Serializable
{
public
class
YgjgDto
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
...
...
@@ -44,4 +46,5 @@ public class YgjgDto implements Serializable {
@TableField
(
exist
=
false
)
private
String
jgname
;
}
src/main/java/cn/timer/api/dto/zzgl/UpEmpDeptDto.java
View file @
b9de4438
...
...
@@ -25,4 +25,5 @@ public class UpEmpDeptDto implements Serializable{
@ApiModelProperty
(
value
=
"是否调岗"
,
example
=
"1"
)
private
Integer
isdg
;
}
src/main/resources/mapping/zzgl/ZzglLogDgjlMapper.xml
View file @
b9de4438
...
...
@@ -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
...
...
@@ -91,7 +92,7 @@
</foreach>
</if>
</where>
order by a.create_time DESC
GROUP BY `createTime`
order by a.create_time DESC
</select>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment