|
@@ -156,6 +156,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
private GroupParticipatorMapper groupParticipatorMapper;
|
|
|
@Resource
|
|
|
private ReportLogMapper reportLogMapper;
|
|
|
+ @Resource
|
|
|
+ private ThirdPartyInterfaceMapper thirdPartyInterfaceMapper;
|
|
|
|
|
|
@Value(value = "${upload.path}")
|
|
|
private String path;
|
|
@@ -1656,11 +1658,20 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
user.put("id", u.getId());
|
|
|
user.put("name", u.getName());
|
|
|
user.put("departmentId", u.getDepartmentId());
|
|
|
+ List<Map<String, Object>> mapList = reportNameByDate.stream().filter(r -> r.get("id").equals(u.getId())).collect(Collectors.toList());
|
|
|
Optional<Map<String, Object>> first = reportNameByDate.stream().filter(r -> r.get("id").equals(u.getId())).findFirst();
|
|
|
-
|
|
|
- if (first.isPresent()) {
|
|
|
- user.put("state", first.get().get("state"));
|
|
|
- user.put("workingTime", first.get().get("workingTime"));
|
|
|
+ BigDecimal bigDecimal=new BigDecimal(0);
|
|
|
+ for (Map<String, Object> map : mapList) {
|
|
|
+ bigDecimal=bigDecimal.add(BigDecimal.valueOf((Double) map.get("workingTime")));
|
|
|
+ }
|
|
|
+ boolean b = reportNameByDate.stream().anyMatch(r -> r.get("state").equals(1));
|
|
|
+ if (b) {
|
|
|
+ user.put("state",1);
|
|
|
+ user.put("workingTime",bigDecimal);
|
|
|
+ }
|
|
|
+ if(first.isPresent()&&!b){
|
|
|
+ user.put("state",first.get().get("state"));
|
|
|
+ user.put("workingTime",bigDecimal);
|
|
|
}
|
|
|
userMapList.add(user);
|
|
|
}
|
|
@@ -2270,6 +2281,12 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
//管理员看全公司所有人
|
|
|
allRangeUserList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId));
|
|
|
}
|
|
|
+ List<User> needRangeUserList=new ArrayList<>();
|
|
|
+ for (User u : allRangeUserList) {
|
|
|
+ if(u.getInactiveDate()==null||(u.getInactiveDate()!=null&&u.getInactiveDate().isAfter(LocalDate.parse(startDate))||u.getIsActive()==1)){
|
|
|
+ needRangeUserList.add(u);
|
|
|
+ }
|
|
|
+ }
|
|
|
List<UserMonthWork> userMonthWorks = new ArrayList<UserMonthWork>();
|
|
|
//准备部门数据
|
|
|
List<Department> departmentList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", companyId));
|
|
@@ -2308,7 +2325,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
|
|
|
LocalDateTime c=LocalDateTime.now();
|
|
|
//计算未填的人员
|
|
|
- List<User> noReportUserList = allRangeUserList.stream()
|
|
|
+ List<User> noReportUserList = needRangeUserList.stream()
|
|
|
.filter(au->!userMonthWorks.stream().anyMatch(mon->mon.userId.equals(au.getId())))
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
@@ -3485,4 +3502,24 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
return httpRespMsg;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public HttpRespMsg getReportListByToken(String token, String startDate, String endDate) {
|
|
|
+ HttpRespMsg msg=new HttpRespMsg();
|
|
|
+ List<ThirdPartyInterface> thirdPartyInterfaceList = thirdPartyInterfaceMapper.selectList(new QueryWrapper<ThirdPartyInterface>().eq("token", token));
|
|
|
+ if(thirdPartyInterfaceList.size()==0){
|
|
|
+ msg.setError("token错误");
|
|
|
+ }
|
|
|
+ for (ThirdPartyInterface thirdPartyInterface : thirdPartyInterfaceList){
|
|
|
+ if(LocalDateTime.now().isAfter(thirdPartyInterface.getExpireTime())){
|
|
|
+ msg.setError("token过期失效");
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
+ if(token.equals(thirdPartyInterface.getToken())){
|
|
|
+ List<HashMap<String, Object>> allReportByDate = reportMapper.getAllReportByDate(startDate,thirdPartyInterface.getComapnyId(), null, endDate, null, null, null);
|
|
|
+ msg.data=allReportByDate;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
+
|
|
|
}
|