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
a28cc7ad
Commit
a28cc7ad
authored
Apr 03, 2020
by
东州 翁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
改良人事仪表盘60%
parent
56cd4222
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
363 additions
and
101 deletions
+363
-101
src/main/java/cn/timer/api/config/enuminterface/YgEnumInterface.java
+48
-1
src/main/java/cn/timer/api/controller/yggl/YgglController.java
+57
-1
src/main/java/cn/timer/api/dao/yggl/YgglMainEmpMapper.java
+107
-99
src/main/java/cn/timer/api/dao/yggl/YgtitleDtoMapper.java
+17
-0
src/main/java/cn/timer/api/dto/yggl/YgCartogramDto.java
+22
-0
src/main/java/cn/timer/api/dto/yggl/YgbintuDto.java
+58
-0
src/main/java/cn/timer/api/dto/yggl/YgtitleDto.java
+54
-0
src/main/resources/mapping/yggl/YgglMainEmpMapper.xml
+0
-0
No files found.
src/main/java/cn/timer/api/config/enuminterface/YgEnumInterface.java
View file @
a28cc7ad
...
@@ -9,10 +9,14 @@ import java.text.DateFormat;
...
@@ -9,10 +9,14 @@ import java.text.DateFormat;
import
java.text.ParseException
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.regex.Pattern
;
import
java.util.regex.Pattern
;
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日
...
@@ -168,4 +172,47 @@ public interface YgEnumInterface {
...
@@ -168,4 +172,47 @@ public interface YgEnumInterface {
return
result
.
type
.
toString
();
return
result
.
type
.
toString
();
}
}
}
}
/**
* 工龄
*/
@Getter
enum
workage
implements
YgEnumInterface
{
//NEW(0,183),HALF(1,365),ONE(2,548),ONEHALF(3,730),TWO(4,913),LONG(5,10000);
NEW
(
0
,
183
,
0
),
HALF
(
184
,
365
,
0
),
ONE
(
366
,
548
,
0
),
ONEHALF
(
549
,
730
,
0
),
TWO
(
731
,
1000
,
0
),
LONG
(
1001
,
10000
,
0
);
private
Integer
begin
;
private
Integer
end
;
private
Integer
number
;
workage
(
Integer
begin
,
Integer
end
,
Integer
number
)
{
this
.
begin
=
begin
;
this
.
end
=
end
;
this
.
number
=
number
;
}
public
static
Map
<
String
,
Integer
>
choose
(
List
<
YgbintuDto
>
bintu
)
{
for
(
YgbintuDto
b
:
bintu
)
{
Integer
index
=
b
.
getWorkage
();
for
(
workage
item
:
workage
.
values
())
{
if
(
index
>=
item
.
begin
&&
index
<=
item
.
end
)
{
item
.
number
++;
System
.
out
.
println
(
"item"
+
item
+
":"
+
item
.
number
);
}
}
}
Map
<
String
,
Integer
>
result
=
new
HashMap
<
String
,
Integer
>();
result
.
put
(
"x<0.5"
,
NEW
.
number
);
result
.
put
(
"0.5<x<1"
,
HALF
.
number
);
result
.
put
(
"1<x<1.5"
,
ONE
.
number
);
result
.
put
(
"1.5<x<2"
,
ONEHALF
.
number
);
result
.
put
(
"2<x<3"
,
TWO
.
number
);
result
.
put
(
"x++"
,
LONG
.
number
);
return
result
;
}
}
}
}
src/main/java/cn/timer/api/controller/yggl/YgglController.java
View file @
a28cc7ad
...
@@ -8,6 +8,8 @@ package cn.timer.api.controller.yggl;
...
@@ -8,6 +8,8 @@ package cn.timer.api.controller.yggl;
import
java.text.ParseException
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Iterator
;
import
java.util.Iterator
;
...
@@ -15,6 +17,7 @@ import java.util.List;
...
@@ -15,6 +17,7 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.regex.Matcher
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
import
java.util.regex.Pattern
;
import
java.util.stream.Collectors
;
import
javax.transaction.Transactional
;
import
javax.transaction.Transactional
;
...
@@ -68,19 +71,23 @@ import cn.timer.api.dao.yggl.YgMzDtoMapper;
...
@@ -68,19 +71,23 @@ import cn.timer.api.dao.yggl.YgMzDtoMapper;
import
cn.timer.api.dao.yggl.YgProDtoMapper
;
import
cn.timer.api.dao.yggl.YgProDtoMapper
;
import
cn.timer.api.dao.yggl.YgglMainEmpMapper
;
import
cn.timer.api.dao.yggl.YgglMainEmpMapper
;
import
cn.timer.api.dao.yggl.YgglMainLzbMapper
;
import
cn.timer.api.dao.yggl.YgglMainLzbMapper
;
import
cn.timer.api.dao.yggl.YgtitleDtoMapper
;
import
cn.timer.api.dao.zzgl.ZzglBmgwMMapper
;
import
cn.timer.api.dao.zzgl.ZzglBmgwMMapper
;
import
cn.timer.api.dto.yggl.AddygdaDto
;
import
cn.timer.api.dto.yggl.AddygdaDto
;
import
cn.timer.api.dto.yggl.LzbQueryDto
;
import
cn.timer.api.dto.yggl.LzbQueryDto
;
import
cn.timer.api.dto.yggl.LzygQueryDto
;
import
cn.timer.api.dto.yggl.LzygQueryDto
;
import
cn.timer.api.dto.yggl.YgAreaDto
;
import
cn.timer.api.dto.yggl.YgAreaDto
;
import
cn.timer.api.dto.yggl.YgCartogramDto
;
import
cn.timer.api.dto.yggl.YgCityDto
;
import
cn.timer.api.dto.yggl.YgCityDto
;
import
cn.timer.api.dto.yggl.YgDrjqbDto
;
import
cn.timer.api.dto.yggl.YgDrjqbDto
;
import
cn.timer.api.dto.yggl.YgDrsDto
;
import
cn.timer.api.dto.yggl.YgDrsDto
;
import
cn.timer.api.dto.yggl.YgProDto
;
import
cn.timer.api.dto.yggl.YgProDto
;
import
cn.timer.api.dto.yggl.YgQueryDto
;
import
cn.timer.api.dto.yggl.YgQueryDto
;
import
cn.timer.api.dto.yggl.YgbintuDto
;
import
cn.timer.api.dto.yggl.YgglCartogramDto
;
import
cn.timer.api.dto.yggl.YgglCartogramDto
;
import
cn.timer.api.dto.yggl.YgjgDto
;
import
cn.timer.api.dto.yggl.YgjgDto
;
import
cn.timer.api.dto.yggl.YgmzDto
;
import
cn.timer.api.dto.yggl.YgmzDto
;
import
cn.timer.api.dto.yggl.YgtitleDto
;
import
cn.timer.api.dto.yggl.YgzzDto
;
import
cn.timer.api.dto.yggl.YgzzDto
;
import
cn.timer.api.utils.Md5
;
import
cn.timer.api.utils.Md5
;
import
cn.timer.api.utils.Result
;
import
cn.timer.api.utils.Result
;
...
@@ -122,6 +129,9 @@ public class YgglController {
...
@@ -122,6 +129,9 @@ public class YgglController {
//weng(民族)
//weng(民族)
@Autowired
@Autowired
private
YgMzDtoMapper
ygMzDtoMapper
;
private
YgMzDtoMapper
ygMzDtoMapper
;
//weng(人事仪表盘)
@Autowired
private
YgtitleDtoMapper
ygtitleDtoMapper
;
/**
/**
* 获取员工档案
* 获取员工档案
* @param
* @param
...
@@ -1465,7 +1475,53 @@ public class YgglController {
...
@@ -1465,7 +1475,53 @@ public class YgglController {
return
ResultUtil
.
data
(
map
,
"查询成功"
);
return
ResultUtil
.
data
(
map
,
"查询成功"
);
}
}
/**
/**
* 获取成长记录表
* 员工信息统计图
* @return 成功信息(weng)
*/
@GetMapping
(
"/Cartogram"
)
@ApiOperation
(
value
=
"获取员工管理统计图信息"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
63
)
public
Result
<
Map
<
String
,
Object
>>
ygCartogram
(
@CurrentUser
UserBean
userBean
)
{
List
<
YgbintuDto
>
bintu
=
ygglMainEmpMapper
.
rsybp
();
bintu
.
stream
().
filter
(
bean
->{
if
(
bean
.
getAge
()
==
null
)
{
bean
.
setAge
(-
1
);
}
if
(
bean
.
getBm
()
==
null
)
{
bean
.
setBm
(
"未分配"
);
}
if
(
bean
.
getGw
()
==
null
)
{
bean
.
setGw
(
"未分配"
);
}
if
(
bean
.
getProname
()
==
null
)
{
bean
.
setProname
(
"未分配"
);
}
if
(
bean
.
getEduname
()
==
null
)
{
bean
.
setEduname
(
"未分配"
);
}
if
(
bean
.
getJobStatus
()
==
null
)
{
bean
.
setJobStatus
(-
1
);
}
return
true
;
}).
collect
(
Collectors
.
toList
());
YgtitleDto
title
=
new
LambdaQueryChainWrapper
<
YgtitleDto
>(
ygtitleDtoMapper
).
eq
(
YgtitleDto:
:
getOrgCode
,
userBean
.
getOrgCode
()).
one
();
//Map<String, List<YgbintuDto>> map = bintu.stream().collect(Collectors.groupingBy(YgbintuDto::getGw));岗位
//Map<String, List<YgbintuDto>> map = bintu.stream().collect(Collectors.groupingBy(YgbintuDto::getBm));部门
Map
<
String
,
Map
<
String
,
Long
>>
bmgw
=
bintu
.
stream
().
collect
(
Collectors
.
groupingBy
(
YgbintuDto:
:
getBm
,
Collectors
.
groupingBy
(
YgbintuDto:
:
getGw
,
Collectors
.
counting
())));
Map
<
String
,
List
<
YgbintuDto
>>
edu
=
bintu
.
stream
().
collect
(
Collectors
.
groupingBy
(
YgbintuDto:
:
getEduname
));
Map
<
Integer
,
List
<
YgbintuDto
>>
jobStatus
=
bintu
.
stream
().
collect
(
Collectors
.
groupingBy
(
YgbintuDto:
:
getJobStatus
));
Map
<
String
,
List
<
YgbintuDto
>>
proname
=
bintu
.
stream
().
collect
(
Collectors
.
groupingBy
(
YgbintuDto:
:
getProname
));
Map
<
String
,
Integer
>
workage
=
YgEnumInterface
.
workage
.
choose
(
bintu
);
System
.
out
.
println
(
bmgw
);
System
.
out
.
println
(
edu
);
System
.
out
.
println
(
jobStatus
);
System
.
out
.
println
(
proname
);
System
.
out
.
println
(
workage
);
return
ResultUtil
.
success
();
}
/**
* 获取员工社保公积金
* @param
* @param
* @return
* @return
*/
*/
...
...
src/main/java/cn/timer/api/dao/yggl/YgglMainEmpMapper.java
View file @
a28cc7ad
package
cn
.
timer
.
api
.
dao
.
yggl
;
package
cn
.
timer
.
api
.
dao
.
yggl
;
import
java.util.List
;
import
java.util.List
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
cn.timer.api.bean.yggl.YgglMainEmp
;
import
cn.timer.api.bean.yggl.YgglMainEmp
;
import
cn.timer.api.config.annotation.UserBean
;
import
cn.timer.api.config.annotation.UserBean
;
import
cn.timer.api.dto.yggl.YgQueryDto
;
import
cn.timer.api.dto.yggl.YgCartogramDto
;
import
cn.timer.api.dto.yggl.YgglCartogramDto
;
import
cn.timer.api.dto.yggl.YgQueryDto
;
import
cn.timer.api.dto.yggl.YgbintuDto
;
/**
import
cn.timer.api.dto.yggl.YgglCartogramDto
;
* 员工档案+统计图查询
*
/**
* @author dsc 2019-11-23
* 员工档案+统计图查询
*/
*
@Repository
* @author dsc 2019-11-23
public
interface
YgglMainEmpMapper
extends
BaseMapper
<
YgglMainEmp
>
{
*/
@Repository
/**
public
interface
YgglMainEmpMapper
extends
BaseMapper
<
YgglMainEmp
>
{
* 查询员工信息
/**
* @param userBean
* 人事仪表盘
* @return
* @param userBean
*/
* @return
List
<
YgQueryDto
>
queryEmpMessage
(
UserBean
userBean
);
*/
List
<
YgbintuDto
>
rsybp
();
/**
/**
* 查询在职员工(试用员工人数+正式员工人数)
* 查询员工信息
* @param userBean
* @param userBean
* @return
* @return
*/
*/
YgglCartogramDto
queryInservice
(
UserBean
userBean
);
List
<
YgQueryDto
>
queryEmpMessage
(
UserBean
userBean
);
/**
* 查询当月入职人数
/**
* @param userBean
* 查询在职员工(试用员工人数+正式员工人数)
* @return
* @param userBean
*/
* @return
YgglCartogramDto
queryInduction
(
UserBean
userBean
);
*/
YgglCartogramDto
queryInservice
(
UserBean
userBean
);
/**
* 查询本月转正人数
/**
* @param userBean
* 查询当月入职人数
* @return
* @param userBean
*/
* @return
YgglCartogramDto
queryPositive
(
UserBean
userBean
);
*/
YgglCartogramDto
queryInduction
(
UserBean
userBean
);
/**
* 查询员工平均年龄
/**
* @param userBean
* 查询本月转正人数
* @return
* @param userBean
*/
* @return
YgglCartogramDto
queryAvgAge
(
UserBean
userBean
);
*/
YgglCartogramDto
queryPositive
(
UserBean
userBean
);
/**
* 查询部门名称及人数
/**
* @param userBean
* 查询员工平均年龄
* @return
* @param userBean
*/
* @return
List
<
YgglCartogramDto
>
queryDepartmentNum
(
UserBean
userBean
);
*/
YgglCartogramDto
queryAvgAge
(
UserBean
userBean
);
/**
* 查询岗位名称及人数
/**
* @param userBean
* 查询部门名称及人数
* @return
* @param userBean
*/
* @return
List
<
YgglCartogramDto
>
queryJobsNum
(
UserBean
userBean
);
*/
List
<
YgglCartogramDto
>
queryDepartmentNum
(
UserBean
userBean
);
/**
* 学历及人数查询
/**
* @param userBean
* 查询岗位名称及人数
* @return
* @param userBean
*/
* @return
List
<
YgglCartogramDto
>
queryEducation
(
UserBean
userBean
);
*/
List
<
YgglCartogramDto
>
queryJobsNum
(
UserBean
userBean
);
/**
* 员工年龄分布查询
/**
* @param userBean
* 学历及人数查询
* @return
* @param userBean
*/
* @return
List
<
YgglCartogramDto
>
queryEmpAge
(
UserBean
userBean
);
*/
List
<
YgglCartogramDto
>
queryEducation
(
UserBean
userBean
);
/**
* 籍贯统计(省份)人数分布查询
/**
* @param userBean
* 员工年龄分布查询
* @return
* @param userBean
*/
* @return
List
<
YgglCartogramDto
>
queryNativeplace
(
UserBean
userBean
);
*/
List
<
YgglCartogramDto
>
queryEmpAge
(
UserBean
userBean
);
/**
* 员工工龄分布查询
/**
* @param userBean
* 籍贯统计(省份)人数分布查询
* @return
* @param userBean
*/
* @return
List
<
YgglCartogramDto
>
queryWorkingAge
(
UserBean
userBean
);
*/
}
List
<
YgglCartogramDto
>
queryNativeplace
(
UserBean
userBean
);
/**
* 员工工龄分布查询
* @param userBean
* @return
*/
List
<
YgglCartogramDto
>
queryWorkingAge
(
UserBean
userBean
);
}
src/main/java/cn/timer/api/dao/yggl/YgtitleDtoMapper.java
0 → 100644
View file @
a28cc7ad
package
cn
.
timer
.
api
.
dao
.
yggl
;
import
org.springframework.stereotype.Repository
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
cn.timer.api.dto.yggl.YgtitleDto
;
/**
* 人事仪表盘饼图表
* @author Tang 2019-11-15
*/
@Repository
public
interface
YgtitleDtoMapper
extends
BaseMapper
<
YgtitleDto
>
{
}
src/main/java/cn/timer/api/dto/yggl/YgCartogramDto.java
0 → 100644
View file @
a28cc7ad
/**
* @date 2020年4月1日
* @author 翁东州
* @方法中文名称:
*/
package
cn
.
timer
.
api
.
dto
.
yggl
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* @date 2020年4月1日
* @author 翁东州
* @方法中文名称:
*/
public
class
YgCartogramDto
{
@ApiModelProperty
(
value
=
"统计图--标头 "
,
example
=
"标头"
)
private
YgtitleDto
ygtitleDto
;
@ApiModelProperty
(
value
=
"统计图--饼图和直方图 "
,
example
=
"饼图和直方图"
)
private
YgbintuDto
ygbintuDto
;
}
src/main/java/cn/timer/api/dto/yggl/YgbintuDto.java
0 → 100644
View file @
a28cc7ad
package
cn
.
timer
.
api
.
dto
.
yggl
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* @author Tang 2019-11-15
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
"统计图--饼图和直方图"
)
public
class
YgbintuDto
{
@Id
@GeneratedValue
@TableId
(
type
=
IdType
.
AUTO
)
@ApiModelProperty
(
value
=
"编号"
,
example
=
"1"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"年龄 "
,
example
=
"省编码"
)
private
Integer
age
;
@ApiModelProperty
(
value
=
"部门岗位id"
,
example
=
"市编码"
)
private
Integer
bmgwId
;
@ApiModelProperty
(
value
=
"岗位名"
,
example
=
"市编码"
)
private
String
gw
;
@ApiModelProperty
(
value
=
"部门名"
,
example
=
"市编码"
)
private
String
bm
;
@ApiModelProperty
(
value
=
"籍贯省份"
,
example
=
"名字"
)
private
String
proname
;
@ApiModelProperty
(
value
=
"学历"
,
example
=
"名字"
)
private
String
eduname
;
@ApiModelProperty
(
value
=
"员工状态"
,
example
=
"名字"
)
private
Integer
jobStatus
;
@ApiModelProperty
(
value
=
"工龄天数"
,
example
=
"名字"
)
private
Integer
workage
;
}
src/main/java/cn/timer/api/dto/yggl/YgtitleDto.java
0 → 100644
View file @
a28cc7ad
package
cn
.
timer
.
api
.
dto
.
yggl
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* @author Tang 2019-11-15
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName
(
"yggl_atta_title"
)
@ApiModel
(
"统计图--标头"
)
public
class
YgtitleDto
{
@Id
@GeneratedValue
@TableId
(
type
=
IdType
.
AUTO
)
@ApiModelProperty
(
value
=
"id编号"
,
example
=
"1"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"在职人数"
,
example
=
"1"
)
private
Integer
zaizhi
;
@ApiModelProperty
(
value
=
"本月新入职 "
,
example
=
"1"
)
private
Integer
xinruzhi
;
@ApiModelProperty
(
value
=
"本月离职"
,
example
=
"1"
)
private
Integer
lizhi
;
@ApiModelProperty
(
value
=
"本月转正"
,
example
=
"1"
)
private
Integer
zhuanzhen
;
@ApiModelProperty
(
value
=
"平均年龄"
,
example
=
"22"
)
private
Integer
nianlin
;
@ApiModelProperty
(
value
=
"组织机构代码"
,
example
=
"117"
)
private
Integer
orgCode
;
}
src/main/resources/mapping/yggl/YgglMainEmpMapper.xml
View file @
a28cc7ad
This diff is collapsed.
Click to expand it.
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