ClockInAnalysisController.java
5.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
package cn.com.glsx.dj.controller;
import cn.com.glsx.dj.request.StaffStatisticRequest;
import cn.com.glsx.dj.smartcarlife.dto.BehaviorAbnormalMonitoringWeeklyStatisticsDTO;
import cn.com.glsx.dj.smartcarlife.dto.ClockInCompleteAnalysisStaffDailyStatisticsDTO;
import cn.com.glsx.dj.smartcarlife.dto.ClockInCompleteAnalysisStaffMonthlyStatisticsDTO;
import cn.com.glsx.dj.smartcarlife.dto.StaffStatisticRequestDTO;
import cn.com.glsx.dj.smartcarlife.remote.ClockInAnalysisRemote;
import cn.com.glsx.dj.util.CommonUtil;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@Slf4j
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.NO)
@Api("打卡分析")
public class ClockInAnalysisController {
@Autowired
private ClockInAnalysisRemote clockInAnalysisRemote;
@ApiOperation("月报-打卡完成分析")
@ServiceMethod(method = "dj.api.pe.analysis.clock.in.monthly.page", needInSession = NeedInSessionType.YES)
public RopResponse<RpcPagination<ClockInCompleteAnalysisStaffMonthlyStatisticsDTO>> pageClockInMonthly(StaffStatisticRequest request){
RpcPagination<StaffStatisticRequestDTO> pagination = CommonUtil.getRpcPagination(StaffStatisticRequestDTO.class);
try {
pagination.getCondition().parseMerchantStaffMap(CommonUtil.getCycleOrderMerchantSellerPermission(request.getMerchantFilter()));
pagination.getCondition().setMerchantIds(CommonUtil.getMerchantIdPermission(request.getMerchantFilter()));
return CommonUtil.convertRopResponse(clockInAnalysisRemote.pageClockInMonthly(pagination));
} catch (RpcServiceException e) {
log.error("=====月报-打卡完成分析 rpcServiceException:{}", e.getMessage());
return RopResponse.error(e);
} catch (Exception e) {
log.error("=====月报-打卡完成分析 exception:{}", e.getMessage(), e);
return RopResponse.error("分页查询月报-打卡完成分析失败");
}
}
@ApiOperation("周报-人员行为异常监测")
@ServiceMethod(method = "dj.api.pe.analysis.behavior.abnormal.weekly.page", needInSession = NeedInSessionType.YES)
public RopResponse<RpcPagination<BehaviorAbnormalMonitoringWeeklyStatisticsDTO>> pageBehaviorAbnormalWeekly(StaffStatisticRequest request){
RpcPagination<StaffStatisticRequestDTO> pagination = CommonUtil.getRpcPagination(StaffStatisticRequestDTO.class);
try {
pagination.getCondition().parseMerchantStaffMap(CommonUtil.getCycleOrderMerchantSellerPermission(request.getMerchantFilter()));
pagination.getCondition().setMerchantIds(CommonUtil.getMerchantIdPermission(request.getMerchantFilter()));
return CommonUtil.convertRopResponse(clockInAnalysisRemote.pageBehaviorAbnormalWeekly(pagination));
} catch (RpcServiceException e) {
log.error("=====周报-人员行为异常监测 rpcServiceException:{}", e.getMessage());
return RopResponse.error(e);
} catch (Exception e) {
log.error("=====周报-人员行为异常监测 exception:{}", e.getMessage(), e);
return RopResponse.error("分页查询周报-人员行为异常监测失败");
}
}
@ApiOperation("日报-打卡完成分析")
@ServiceMethod(method = "dj.api.pe.analysis.clock.in.daily.page", needInSession = NeedInSessionType.YES)
public RopResponse<RpcPagination<ClockInCompleteAnalysisStaffDailyStatisticsDTO>> pageClockInDaily(StaffStatisticRequest request){
RpcPagination<StaffStatisticRequestDTO> pagination = CommonUtil.getRpcPagination(StaffStatisticRequestDTO.class);
try {
pagination.getCondition().parseMerchantStaffMap(CommonUtil.getCycleOrderMerchantSellerPermission(request.getMerchantFilter()));
pagination.getCondition().setMerchantIds(CommonUtil.getMerchantIdPermission(request.getMerchantFilter()));
return CommonUtil.convertRopResponse(clockInAnalysisRemote.pageClockInDaily(pagination));
} catch (RpcServiceException e) {
log.error("=====日报-打卡完成分析 rpcServiceException:{}", e.getMessage());
return RopResponse.error(e);
} catch (Exception e) {
log.error("=====日报-打卡完成分析 exception:{}", e.getMessage(), e);
return RopResponse.error("分页查询日报-打卡完成分析失败");
}
}
@ApiOperation("执行打卡数据同步任务")
@ServiceMethod(method = "dj.api.pe.analysis.clock.in.syncQwClockInData.handle", needInSession = NeedInSessionType.NO)
public RopResponse<Boolean> handleSyncQwClockInData(StaffStatisticRequest request){
RpcPagination<StaffStatisticRequestDTO> pagination = CommonUtil.getRpcPagination(StaffStatisticRequestDTO.class);
try {
return CommonUtil.convertRopResponse(clockInAnalysisRemote.handleSyncQwClockInData(pagination));
} catch (RpcServiceException e) {
log.error("=====执行打卡数据同步任务 rpcServiceException:{}", e.getMessage());
return RopResponse.error(e);
} catch (Exception e) {
log.error("=====执行打卡数据同步任务 exception:{}", e.getMessage(), e);
return RopResponse.error("执行打卡数据同步任务失败");
}
}
}