|
@@ -553,10 +553,10 @@ public class TimingTask {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @Scheduled(cron = "0 15 3 ? * *")
|
|
|
+ @Scheduled(cron = "0 23 17 ? * *")
|
|
|
private void synFanWeiProjectDate() {
|
|
|
- if (isDev) return;
|
|
|
- if(!isPrivateDeploy) return;
|
|
|
+// if (isDev) return;
|
|
|
+// if(!isPrivateDeploy) return;
|
|
|
List<TimeType> timeTypeList = timeTypeMapper.selectList(new QueryWrapper<TimeType>().eq("sync_fanwei", 1));
|
|
|
List<Integer> compIds = timeTypeList.stream().map(TimeType::getCompanyId).collect(Collectors.toList());
|
|
|
if(compIds.isEmpty()){
|
|
@@ -577,6 +577,8 @@ public class TimingTask {
|
|
|
List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", compId).select("job_number", "id","name"));
|
|
|
int insert=0;
|
|
|
int update=0;
|
|
|
+ StringBuilder sb=new StringBuilder();
|
|
|
+ sb.append("更新的项目:");
|
|
|
for (Map<String, Object> map : mapList) {
|
|
|
List<Participation> participationList=new ArrayList<>();
|
|
|
Optional<User> first = userList.stream().filter(ul ->ul.getJobNumber()!=null&&ul.getJobNumber().equals(map.get("xmfzrplxm"))).findFirst();
|
|
@@ -591,6 +593,7 @@ public class TimingTask {
|
|
|
}
|
|
|
projectService.updateById(item);
|
|
|
update++;
|
|
|
+ List<Participation> allParticipations = participationService.list(new QueryWrapper<Participation>().eq("project_id", item.getId()));
|
|
|
if(map.get("xmcygs")!=null&&!map.get("xmcygs").equals("")){
|
|
|
participationService.remove(new QueryWrapper<Participation>().eq("project_id",item.getId()));
|
|
|
String participations = String.valueOf(map.get("xmcygs"));
|
|
@@ -604,6 +607,10 @@ public class TimingTask {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ boolean equals = allParticipations.stream().map(al -> al.getUserId()).sorted().collect(Collectors.joining()).equals(participationList.stream().sorted().map(pl -> pl.getUserId()).sorted().collect(Collectors.joining()));
|
|
|
+ if(!equals){
|
|
|
+ sb.append("["+item.getProjectCode()+"/"+item.getProjectCode()+"]"+"\n");
|
|
|
+ }
|
|
|
if(participationList.size()>0){
|
|
|
participationService.saveBatch(participationList);
|
|
|
}
|
|
@@ -639,7 +646,7 @@ public class TimingTask {
|
|
|
}
|
|
|
OperationRecord operationRecord=new OperationRecord();
|
|
|
operationRecord.setCompanyId(compId)
|
|
|
- .setContent("同步来自泛微的项目数据,共"+insert+"条数据"+"\n"+"同步更新来自泛微的项目数据,共"+update+"条数据")
|
|
|
+ .setContent("同步来自泛微的项目数据,共"+insert+"条数据"+"\n"+"同步更新来自泛微的项目数据,共"+update+"条数据"+"\n"+sb.toString())
|
|
|
.setModuleName("项目管理").setOperationTime(LocalDateTime.now());
|
|
|
operationRecordService.save(operationRecord);
|
|
|
}
|