Parcourir la Source

考勤日报、月报、详情、异常等

wangchao 4 ans auparavant
Parent
commit
cc97907d41

+ 99 - 2
security-protection-service/pom.xml

@ -11,8 +11,9 @@
11 11
    <parent>
12 12
        <artifactId>components</artifactId>
13 13
        <groupId>com.ai.bss</groupId>
14
        <version>2.1-SNAPSHOT</version>
14
        <version>2.1.5-SNAPSHOT</version>
15 15
    </parent>
16
16 17
    <dependencies>
17 18
        <dependency>
18 19
            <groupId>com.github.pagehelper</groupId>
@ -35,8 +36,48 @@
35 36
36 37
        <dependency>
37 38
            <groupId>com.ai.bss</groupId>
39
            <artifactId>work-tool-service-api</artifactId>
40
            <version>2.1.5-SNAPSHOT</version>
41
        </dependency>
42
43
        <dependency>
44
            <groupId>com.ai.bss</groupId>
45
            <artifactId>work-tool-service</artifactId>
46
            <version>2.1.5-SNAPSHOT</version>
47
        </dependency>
48
49
        <dependency>
50
            <groupId>com.ai.bss</groupId>
51
            <artifactId>worker-service</artifactId>
52
            <version>2.1.5-SNAPSHOT</version>
53
            <exclusions>
54
                <exclusion>
55
                    <groupId>org.springframework.boot</groupId>
56
                    <artifactId>
57
                        spring-boot-starter-security
58
                    </artifactId>
59
                </exclusion>
60
            </exclusions>
61
        </dependency>
62
63
        <dependency>
64
            <groupId>com.ai.bss</groupId>
65
            <artifactId>characteristic-spec-service</artifactId>
66
            <version>2.1.5-SNAPSHOT</version>
67
        </dependency>
68
69
        <dependency>
70
            <groupId>com.ai.bss</groupId>
71
            <artifactId>work-attendance-service-api</artifactId>
72
            <version>2.1.5-SNAPSHOT</version>
73
        </dependency>
74
75
76
77
        <dependency>
78
            <groupId>com.ai.bss</groupId>
38 79
            <artifactId>system-user-service</artifactId>
39
            <version>2.1-SNAPSHOT</version>
80
            <version>2.1.5-SNAPSHOT</version>
40 81
            <exclusions>
41 82
                <exclusion>
42 83
                    <groupId>org.springframework.boot</groupId>
@ -46,6 +87,62 @@
46 87
                </exclusion>
47 88
            </exclusions>
48 89
        </dependency>
90
91
        <!-- uspa登录拦截效验-->
92
        <!--   <dependency>
93
                    <groupId>com.ai.bss</groupId>
94
                    <artifactId>sso-util</artifactId>
95
                    <version>1.0.0-RELEASE</version>
96
                </dependency>-->
97
        <dependency>
98
            <groupId>com.wframe</groupId>
99
            <artifactId>sso-util</artifactId>
100
            <version>1.2</version>
101
        </dependency>
102
103
        <!--	<dependency>
104
                     <groupId>com.ai.ipu</groupId>
105
                     <artifactId>ipu-data</artifactId>
106
                     <version>3.1-SNAPSHOT</version>
107
                     <scope>compile</scope>
108
                 </dependency>
109
                 <dependency>
110
                     <groupId>com.ai.ipu</groupId>
111
                     <artifactId>ipu-basic</artifactId>
112
                     <version>3.1-SNAPSHOT</version>
113
                     <scope>compile</scope>
114
                 </dependency>
115
                 <dependency>
116
                     <groupId>com.ai.wade</groupId>
117
                     <artifactId>wade-common</artifactId>
118
                     <version>1.0</version>
119
                     <scope>compile</scope>
120
                 </dependency>
121
                <dependency>
122
                    <groupId>com.ai.ipu</groupId>
123
                    <artifactId>ipu-common</artifactId>
124
                    <version>3.1-SNAPSHOT</version>
125
                    <scope>compile</scope>
126
                </dependency>
127
                <dependency>
128
                    <groupId>org.apache.poi</groupId>
129
                    <artifactId>poi-ooxml</artifactId>
130
                    <version>3.14</version>
131
                    <scope>compile</scope>
132
                </dependency>-->
133
134
        <!-- 缓存 -->
135
        <dependency>
136
            <groupId>com.ai.ipu</groupId>
137
            <artifactId>ipu-cache</artifactId>
138
            <version>3.1-SNAPSHOT</version>
139
            <exclusions>
140
                <exclusion>
141
                    <groupId>org.apache.logging.log4j</groupId>
142
                    <artifactId>log4j-slf4j-impl</artifactId>
143
                </exclusion>
144
            </exclusions>
145
        </dependency>
49 146
    </dependencies>
50 147
51 148
    <repositories>

+ 120 - 0
security-protection-service/src/main/java/com/ai/bss/security/protection/controller/AttendanceReportController.java

@ -0,0 +1,120 @@
1
package com.ai.bss.security.protection.controller;
2
3
4
import com.ai.abc.api.model.CommonRequest;
5
import com.ai.abc.api.model.CommonResponse;
6
import com.ai.bss.components.common.model.PageBean;
7
import com.ai.bss.security.protection.service.interfaces.AttendanceReportService;
8
import com.ai.bss.security.protection.util.EbcConstant;
9
import com.github.pagehelper.PageInfo;
10
import org.slf4j.Logger;
11
import org.slf4j.LoggerFactory;
12
import org.springframework.beans.factory.annotation.Autowired;
13
import org.springframework.stereotype.Controller;
14
import org.springframework.web.bind.annotation.RequestBody;
15
import org.springframework.web.bind.annotation.RequestMapping;
16
import org.springframework.web.bind.annotation.ResponseBody;
17
18
import java.util.Date;
19
import java.util.HashMap;
20
import java.util.List;
21
import java.util.Map;
22
23
/**
24
 * 考勤报表
25
 */
26
@Controller
27
@RequestMapping("/attendanceReport")
28
public class AttendanceReportController {
29
	Logger logger = LoggerFactory.getLogger(AttendanceReportController.class);
30
31
	@Autowired
32
	AttendanceReportService attendanceReportService;
33
34
	/**
35
	 * 分页查询考勤报表日报
36
	 * @param request 组合条件
37
	 *                                workDay : 日报日期 (yyyy-MM-dd格式),必选
38
	 *                                orgId:所属组织ID
39
	 *                                id:个人编码(员工编码)
40
	 *                                nameAsLike:姓名(模糊匹配)
41
	 *                                mainJobPositionId: 职位
42
	 */
43
44
	@ResponseBody
45
	@RequestMapping("/queryDailyAttendanceReport")
46
	public CommonResponse<PageBean<Map<String,Object>>> queryDailyAttendanceReport(@RequestBody CommonRequest<Map<String, Object>> request) throws Exception {
47
		// 当前页数
48
		int pageNumber = request.getPageNumber() < 1 ? 1 : request.getPageNumber();
49
		// 每页条数
50
		int pageSize = request.getPageSize() < 1 ? EbcConstant.DEFAULT_PAGE_SIZE : request.getPageSize();
51
52
		Map<String, Object> params = request.getData() == null ? new HashMap<String, Object>() : request.getData();
53
		CommonResponse<PageBean<Map<String,Object>>> commonResponse = attendanceReportService.queryDailyAttendanceReport(params, pageNumber, pageSize);
54
55
56
		return commonResponse;
57
58
	}
59
60
	/**
61
	 * 分页查询考勤报表月报
62
	 *  							month :月份 (yyyy-MM格式),必选
63
	 *                              orgId:所属组织ID,必选
64
	 *                              id:个人编码(员工编码)
65
	 *                              nameAsLike:姓名(模糊匹配)
66
	 *                              mainJobPositionId: 职位
67
	 */
68
69
	@ResponseBody
70
	@RequestMapping("/queryMonthlyAttendanceReport")
71
	public CommonResponse<PageBean<Map<String,Object>>> queryMonthlyAttendanceReport(@RequestBody CommonRequest<Map<String, Object>> request) throws Exception {
72
		// 当前页数
73
		int pageNumber = request.getPageNumber() < 1 ? 1 : request.getPageNumber();
74
		// 每页条数
75
		int pageSize = request.getPageSize() < 1 ? EbcConstant.DEFAULT_PAGE_SIZE : request.getPageSize();
76
77
		Map<String, Object> params = request.getData() == null ? new HashMap<String, Object>() : request.getData();
78
		CommonResponse<PageBean<Map<String,Object>>> commonResponse= attendanceReportService.queryMonthlyAttendanceReport(params, pageNumber, pageSize);
79
80
		return commonResponse;
81
82
	}
83
84
85
	/**
86
	 * 分页查询异常考勤
87
	 */
88
	@ResponseBody
89
	@RequestMapping("/queryPageAbnormalAttendance")
90
	public CommonResponse<PageBean<Map<String,Object>>> queryPageAbnormalAttendance(@RequestBody CommonRequest<Map<String, Object>> request) throws Exception {
91
		// 当前页数
92
		int pageNumber = request.getPageNumber() < 1 ? 1 : request.getPageNumber();
93
		// 每页条数
94
		int pageSize = request.getPageSize() < 1 ? EbcConstant.DEFAULT_PAGE_SIZE : request.getPageSize();
95
96
		Map<String, Object> params = request.getData() == null ? new HashMap<String, Object>() : request.getData();
97
		CommonResponse<PageBean<Map<String,Object>>> commonResponse= attendanceReportService.queryPageAbnormalAttendance(params, pageNumber, pageSize);
98
99
		return commonResponse;
100
101
102
	}
103
104
	/**
105
	 * 查询考勤详情
106
	 *  						id:个人编码(员工编码)
107
	 *                          beginDay:开始日期
108
	 *                          endDay: 结束日期
109
	 */
110
111
	@ResponseBody
112
	@RequestMapping("/queryAttendanceDetailReport")
113
	public CommonResponse<List<Map<String, Object>>> queryAttendanceDetailReport(@RequestBody CommonRequest<Map<String, Object>> request) throws Exception {
114
		Map<String, Object> params = request.getData() == null ? new HashMap<String, Object>() : request.getData();
115
		CommonResponse<List<Map<String, Object>>> commonResponse = attendanceReportService.queryAttendanceDetailReport(params);
116
		return commonResponse;
117
118
119
	}
120
}

+ 0 - 46
security-protection-service/src/main/java/com/ai/bss/security/protection/controller/abnormalAttendanceController.java

@ -1,46 +0,0 @@
1
package com.ai.bss.security.protection.controller;
2
3
import com.ai.bss.security.protection.service.interfaces.AreaInRecordService;
4
import com.github.pagehelper.PageInfo;
5
import org.slf4j.Logger;
6
import org.slf4j.LoggerFactory;
7
import org.springframework.beans.factory.annotation.Autowired;
8
import org.springframework.stereotype.Controller;
9
import org.springframework.web.bind.annotation.RequestMapping;
10
import org.springframework.web.bind.annotation.ResponseBody;
11
12
import java.util.Date;
13
import java.util.Map;
14
15
/**
16
 * 异常考勤
17
 */
18
@Controller
19
@RequestMapping("/abnormalAttendance")
20
public class abnormalAttendanceController {
21
	Logger logger = LoggerFactory.getLogger(abnormalAttendanceController.class);
22
23
	@Autowired
24
	AreaInRecordService areaInRecordService;
25
26
	/**
27
	 * 分页查询考勤统计分析
28
	 */
29
30
	@ResponseBody
31
	@RequestMapping("/queryPageAttendanceCount")
32
	public PageInfo queryPageAttendanceCount(Map params) throws Exception {
33
		// 当前页数
34
		int pageNum = (int)params.get("pageNum") < 1 ? 1 : (int)params.get("pageNum");
35
		// 每页条数
36
		int pageSize = (int)params.get("pageSize") < 1 ? 1: (int)params.get("pageSize");
37
		if(params.get("currentDate")==null|| params.get("currentDate").equals("")){
38
			params.put("currentDate",new Date());
39
		}
40
		PageInfo pageInfo = areaInRecordService.queryPageAttendanceCount(params, pageNum, pageSize);
41
42
43
		return pageInfo;
44
45
	}
46
}

+ 3 - 3
security-protection-service/src/main/java/com/ai/bss/security/protection/controller/AreaInOutRecordController.java

@ -13,12 +13,12 @@ import java.util.Date;
13 13
import java.util.Map;
14 14
15 15
/**
16
 * 考勤管理
16
 * 进出记录
17 17
 */
18 18
@Controller
19 19
@RequestMapping("/areaInOutRecordManage")
20
public class AreaInOutRecordController {
21
	Logger logger = LoggerFactory.getLogger(AreaInOutRecordController.class);
20
public class areaInOutRecordController {
21
	Logger logger = LoggerFactory.getLogger(areaInOutRecordController.class);
22 22
23 23
	@Autowired
24 24
	AreaInRecordService areaInRecordService;

+ 0 - 46
security-protection-service/src/main/java/com/ai/bss/security/protection/controller/attendanceReportController.java

@ -1,46 +0,0 @@
1
package com.ai.bss.security.protection.controller;
2
3
import com.ai.bss.security.protection.service.interfaces.AreaInRecordService;
4
import com.github.pagehelper.PageInfo;
5
import org.slf4j.Logger;
6
import org.slf4j.LoggerFactory;
7
import org.springframework.beans.factory.annotation.Autowired;
8
import org.springframework.stereotype.Controller;
9
import org.springframework.web.bind.annotation.RequestMapping;
10
import org.springframework.web.bind.annotation.ResponseBody;
11
12
import java.util.Date;
13
import java.util.Map;
14
15
/**
16
 * 考勤报表
17
 */
18
@Controller
19
@RequestMapping("/attendanceReport")
20
public class attendanceReportController {
21
	Logger logger = LoggerFactory.getLogger(attendanceReportController.class);
22
23
	@Autowired
24
	AreaInRecordService areaInRecordService;
25
26
	/**
27
	 * 分页查询考勤统计分析
28
	 */
29
30
	@ResponseBody
31
	@RequestMapping("/queryPageAttendanceCount")
32
	public PageInfo queryPageAttendanceCount(Map params) throws Exception {
33
		// 当前页数
34
		int pageNum = (int)params.get("pageNum") < 1 ? 1 : (int)params.get("pageNum");
35
		// 每页条数
36
		int pageSize = (int)params.get("pageSize") < 1 ? 1: (int)params.get("pageSize");
37
		if(params.get("currentDate")==null|| params.get("currentDate").equals("")){
38
			params.put("currentDate",new Date());
39
		}
40
		PageInfo pageInfo = areaInRecordService.queryPageAttendanceCount(params, pageNum, pageSize);
41
42
43
		return pageInfo;
44
45
	}
46
}

+ 75 - 0
security-protection-service/src/main/java/com/ai/bss/security/protection/service/impl/AttendanceReportServiceImpl.java

@ -0,0 +1,75 @@
1
package com.ai.bss.security.protection.service.impl;
2
3
import com.ai.abc.api.model.CommonRequest;
4
import com.ai.abc.api.model.CommonResponse;
5
import com.ai.bss.components.common.model.PageBean;
6
import com.ai.bss.security.protection.service.interfaces.AttendanceReportService;
7
import com.ai.bss.security.protection.util.EbcConstant;
8
import com.ai.bss.worker.service.api.AttendanceStatusQuery;
9
import lombok.SneakyThrows;
10
import org.springframework.beans.factory.annotation.Autowired;
11
import org.springframework.stereotype.Service;
12
13
import java.text.ParseException;
14
import java.util.List;
15
import java.util.Map;
16
17
/**
18
 * @Auther: 王超
19
 * @Date: 2020/11/30 10:58
20
 * @Description:
21
 */
22
23
@Service
24
public class AttendanceReportServiceImpl implements AttendanceReportService {
25
26
27
28
    @Autowired
29
    AttendanceStatusQuery attendanceStatusQuery;
30
    @Override
31
    public CommonResponse<PageBean<Map<String,Object>>> queryMonthlyAttendanceReport(Map<String, Object> params, int pageNumber, int pageSize) {
32
        CommonResponse<PageBean<Map<String,Object>>>  attendanceReport = null;
33
        try {
34
            attendanceReport = attendanceStatusQuery.queryMonthlyAttendanceReport((new CommonRequest<>(params,pageNumber,pageSize)));
35
        } catch (ParseException e) {
36
            e.printStackTrace();
37
        }
38
        return attendanceReport;
39
    }
40
41
    @Override
42
    public CommonResponse<PageBean<Map<String,Object>>> queryPageAbnormalAttendance(Map<String, Object> params, int pageNumber, int pageSize) {
43
        params.put("statusType", EbcConstant.ATTENDANCE_STATUSTYPE_ABNORMAL);
44
        CommonResponse<PageBean<Map<String,Object>>>  attendanceReport = null;
45
        try {
46
            attendanceReport = attendanceStatusQuery.queryMonthlyAttendanceReport((new CommonRequest<>(params,pageNumber,pageSize)));
47
        } catch (ParseException e) {
48
            e.printStackTrace();
49
        }
50
        return attendanceReport;
51
    }
52
53
54
    @Override
55
    public CommonResponse<List<Map<String, Object>>> queryAttendanceDetailReport(Map<String, Object> params) {
56
        CommonResponse<List<Map<String, Object>>> attendanceReportResponse =  null;
57
        try {
58
            attendanceReportResponse = attendanceStatusQuery.queryAttendanceDetailReport(new CommonRequest<>(params,1,10));
59
        } catch (ParseException e) {
60
            e.printStackTrace();
61
        }
62
        return attendanceReportResponse;
63
    }
64
65
    @Override
66
    public CommonResponse<PageBean<Map<String,Object>>> queryDailyAttendanceReport(Map<String, Object> params, int pageNumber, int pageSize) {
67
        CommonResponse<PageBean<Map<String,Object>>>  attendanceReport = null;
68
        try {
69
            attendanceReport = attendanceStatusQuery.queryDailyAttendanceReport((new CommonRequest<>(params,pageNumber,pageSize)));
70
        } catch (ParseException e) {
71
            e.printStackTrace();
72
        }
73
        return attendanceReport;
74
    }
75
}

+ 18 - 0
security-protection-service/src/main/java/com/ai/bss/security/protection/service/interfaces/AttendanceReportService.java

@ -0,0 +1,18 @@
1
package com.ai.bss.security.protection.service.interfaces;
2
3
import com.ai.abc.api.model.CommonResponse;
4
import com.ai.bss.components.common.model.PageBean;
5
import com.github.pagehelper.PageInfo;
6
7
import java.util.List;
8
import java.util.Map;
9
10
public interface AttendanceReportService {
11
    CommonResponse<PageBean<Map<String,Object>>> queryMonthlyAttendanceReport(Map<String, Object> params, int pageNumber, int pageSize);
12
13
    CommonResponse<PageBean<Map<String,Object>>> queryPageAbnormalAttendance(Map<String, Object> params, int pageNumber, int pageSize);
14
15
    CommonResponse<List<Map<String, Object>>> queryAttendanceDetailReport(Map<String, Object> params);
16
17
    CommonResponse<PageBean<Map<String,Object>>> queryDailyAttendanceReport(Map<String, Object> params, int pageNumber, int pageSize);
18
}

+ 37 - 0
security-protection-service/src/main/java/com/ai/bss/security/protection/util/EbcConstant.java

@ -0,0 +1,37 @@
1
package com.ai.bss.security.protection.util;
2
3
/**
4
 * 业务常量
5
 * @author konghl@asiainfo.com
6
 * 2020-10-20
7
 */
8
public class EbcConstant {
9
	// 下拉列表最大查询条数
10
	public static final int COMBOBOX_MAXNUM = 30;
11
12
	// 每页默认查询条数
13
	public static final int DEFAULT_PAGE_SIZE = 20;
14
15
16
	// 异常考勤查询常量异常取值 abnormal,
17
	public static final String ATTENDANCE_STATUSTYPE_ABNORMAL = "ABNORMAL";
18
19
	// 异常考勤查询常量正常取值normal
20
	public static final String ATTENDANCE_STATUSTYPE_NORMAL = "NORMAL";
21
22
	// 轨迹回放单次查询条数
23
	public static final int TRACK_PLAYBACK_SIZE = 100;
24
25
26
	// 考勤查询:日
27
	public static final String AREA_IN_OUT_RECORD_DAY = "day";
28
29
	// 考勤查询:周
30
	public static final String AREA_IN_OUT_RECORD_WEEK = "week";
31
32
	// 考勤查询:月
33
	public static final String AREA_IN_OUT_RECORD_MONTH = "month";
34
35
	
36
	
37
}

+ 33 - 4
security-protection-service/src/main/resources/application.properties

@ -1,12 +1,19 @@
1 1
spring.application.name=WorkTaskSpec
2
server.port=8086
2
server.port=8087
3
4
#server.servlet.context-path=/ipu
5
server.servlet.context-path=/
3 6
4 7
# DATASOURCE (DataSourceAutoConfiguration & DataSourceProperties)
5 8
#spring.datasource.url=jdbc:mysql://localhost:3306/cmp
6
spring.datasource.url=jdbc:mysql://10.11.20.120:3306/common_frm?serverTimezone=Asia/Shanghai&characterEncoding=utf-8&verifyServerCertificate=false&useSSL=false&requireSSL=false
9
#spring.datasource.url=jdbc:mysql://10.11.20.120:3306/common_frm?serverTimezone=Asia/Shanghai&characterEncoding=utf-8&verifyServerCertificate=false&useSSL=false&requireSSL=false
10
#spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
11
#spring.datasource.username=comon_frm
12
#spring.datasource.password=1qaz@WSX
13
spring.datasource.url=jdbc:mysql://10.19.90.34:3307/energy?serverTimezone=Asia/Shanghai&characterEncoding=utf-8&verifyServerCertificate=false&useSSL=false&requireSSL=false
7 14
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
8
spring.datasource.username=comon_frm
9
spring.datasource.password=1qaz@WSX
15
spring.datasource.username=ebc
16
spring.datasource.password=ebc@123
10 17
11 18
# JPA (JpaBaseConfiguration, HibernateJpaAutoConfiguration)
12 19
#spring.jpa.database=default
@ -17,6 +24,28 @@ spring.jpa.properties.hibernate.format_sql=true
17 24
spring.jpa.properties.hibernate.generate_statistics=false
18 25
spring.main.allow-bean-definition-overriding=true
19 26
27
#kafka
28
#kafka.bootstrap-servers=47.105.160.21:9090
29
kafka.bootstrap-servers=10.19.90.34:9090
30
kafka.topic.deviceLocation=Topic_IoT_DeviceLocation_111
31
kafka.topic.alarm=Topic_IoT_IndividualAlarm_111
32
#kafka.topic.deviceLocation=DeviceLocationA
33
#kafka.topic.alarm=IndividualAlarmA
34
kafka.producer.batch-size=16785
35
kafka.producer.retries=1
36
kafka.producer.buffer-memory=33554432
37
kafka.producer.linger=1
38
kafka.consumer.auto-offset-reset=latest
39
kafka.consumer.max-poll-records=20
40
kafka.consumer.enable-auto-commit=false
41
kafka.consumer.auto-commit-interval=1000
42
kafka.consumer.session-timeout=20000
43
kafka.consumer.max-poll-interval=15000
44
kafka.consumer.max-partition-fetch-bytes=15728640
45
kafka.listener.batch-listener=false
46
kafka.listener.concurrencys=3,6
47
kafka.listener.poll-timeout=1500
48
20 49
# CACHE
21 50
#spring.cache.type=ehcache
22 51
#spring.cache.ehcache.config=ehcache.xml