|
@@ -10877,9 +10877,47 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
projectList.forEach(pl->{
|
|
|
List<SubProject> subProjects = subProjectList.stream().filter(st -> st.getProjectId().equals(pl.getId())).collect(Collectors.toList());
|
|
|
pl.setSubProjectList(subProjects);
|
|
|
+ pl.setId(null);
|
|
|
});
|
|
|
msg.data=projectList;
|
|
|
}
|
|
|
return msg;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public HttpRespMsg getTimeCostByToken(String json) {
|
|
|
+ HttpRespMsg msg=new HttpRespMsg();
|
|
|
+ TokenVo tokenVo = JSON.parseObject(json, TokenVo.class);
|
|
|
+ String token = tokenVo.getToken();
|
|
|
+ String startDate =tokenVo.getStartDate();
|
|
|
+ String endDate = tokenVo.getEndDate();
|
|
|
+ DateTimeFormatter df=DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
+ LocalDate openDate = LocalDate.parse(startDate, df);
|
|
|
+ LocalDate closeDate = LocalDate.parse(endDate, df);
|
|
|
+ if(Duration.between(openDate.atTime(LocalTime.now()),closeDate.atTime(LocalTime.now())).toDays()>31){
|
|
|
+ //msg.setError("获取数据时间段不得超过一个月");
|
|
|
+ msg.setError(MessageUtils.message("data.exceedMonthError"));
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
+ List<ThirdPartyInterface> thirdPartyInterfaceList = thirdPartyInterfaceMapper.selectList(new QueryWrapper<ThirdPartyInterface>().eq("token", token));
|
|
|
+ if(thirdPartyInterfaceList.size()==0){
|
|
|
+ //msg.setError("token错误");
|
|
|
+ msg.setError(MessageUtils.message("other.tokenError"));
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
+ ThirdPartyInterface thirdPartyInterface = thirdPartyInterfaceList.get(0);
|
|
|
+ if(LocalDateTime.now().isAfter(thirdPartyInterface.getExpireTime())){
|
|
|
+ //msg.setError("token过期失效");
|
|
|
+ msg.setError(MessageUtils.message("other.tokenOverdue"));
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
+ if(token.equals(thirdPartyInterface.getToken())){
|
|
|
+ List<Map<String, Object>> list = projectMapper.getTimeCost(thirdPartyInterface.getCompanyId(), startDate, endDate, null, null, null, null, null, null);
|
|
|
+ list.forEach(l->{
|
|
|
+ l.remove("id");
|
|
|
+ });
|
|
|
+ msg.data=list;
|
|
|
+ }
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
}
|