|
|
@@ -967,9 +967,14 @@ public class CoreDrillTaskServiceImpl extends ServiceImpl<CoreDrillTaskMapper, C
|
|
|
return TableDataInfo.build(page);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 优秀案例学习列表查询
|
|
|
+ * @param request
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@Override
|
|
|
public TableDataInfo<CoreDrillTaskRecTaskPageVo> recTaskList(CoreDrillTaskRecPageDto request) {
|
|
|
- dealRecListParam(request);
|
|
|
+ dealRecTaskListParam(request);
|
|
|
|
|
|
IPage<CoreDrillTaskRecTaskPageVo> page = coreDrillTaskMapper.selectRecTaskListPage(request.getPageRequest(), request);
|
|
|
List<CoreDrillTaskRecTaskPageVo> records = page.getRecords();
|
|
|
@@ -982,6 +987,69 @@ public class CoreDrillTaskServiceImpl extends ServiceImpl<CoreDrillTaskMapper, C
|
|
|
}
|
|
|
return TableDataInfo.build(page);
|
|
|
}
|
|
|
+ private void dealRecTaskListParam(CoreDrillTaskRecPageDto request) {
|
|
|
+
|
|
|
+ //App的查询, App 默认下穿
|
|
|
+ request.setCheckSub(true);
|
|
|
+ //App端的时间按季度查询
|
|
|
+ request.setStartTime(DateUtil.beginOfMonth(request.getStartTime()));
|
|
|
+ request.setEndTime(DateUtil.endOfMonth(request.getEndTime()));
|
|
|
+ // 查询行社优秀
|
|
|
+ if(ObjectUtil.equals(request.getRecStatus(),1))
|
|
|
+ {
|
|
|
+ List<SysOrgVO> sysOrgVOS = RemoteCallHandlerExecutor.executeRemoteCall(() -> orgService.getSelfAndAllParentOrgs(request.getOrgId()), ErrorMsgConstants.QUERY_ORG_DATA_ERROR);
|
|
|
+
|
|
|
+ String orgPath = dealRecTaskOrgPathParam(request.getOrgId(),4);
|
|
|
+ request.setOrgPath(orgPath);
|
|
|
+// // 如果当前机构或者机构的上级存在 行社 取 该行社的机构Path
|
|
|
+// final Optional<SysOrgVO> first = sysOrgVOS.stream().filter(x -> ObjectUtil.equal(x.getType(), 3)).findFirst();
|
|
|
+// if(first.isPresent())
|
|
|
+// {
|
|
|
+// request.setOrgPath(first.get().getPath());
|
|
|
+// }
|
|
|
+// // 不存在行社 这说明该机构是在 行社之上 取当前查询条件机构的Path
|
|
|
+// else{
|
|
|
+// final Optional<SysOrgVO> self = sysOrgVOS.stream().filter(x -> ObjectUtil.equal(x.getId(), request.getOrgId())).findFirst();
|
|
|
+//
|
|
|
+// request.setOrgPath(self.get().getPath());
|
|
|
+// }
|
|
|
+
|
|
|
+ }
|
|
|
+ // 查询地区优秀
|
|
|
+ else if(ObjectUtil.equals(request.getRecStatus(),3))
|
|
|
+ {
|
|
|
+ String orgPath = dealRecTaskOrgPathParam(request.getOrgId(),2);
|
|
|
+ request.setOrgPath(orgPath);
|
|
|
+ }
|
|
|
+ // 查询省级优秀
|
|
|
+ else if(ObjectUtil.equals(request.getRecStatus(),5))
|
|
|
+ {
|
|
|
+// SysOrg sysOrg = RemoteCallHandlerExecutor.executeRemoteCall(() -> orgService.selectOrgById(request.getOrgId(), SecurityConstants.INNER), ErrorMsgConstants.QUERY_ORG_DATA_ERROR);
|
|
|
+ request.setOrgPath(null);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private String dealRecTaskOrgPathParam(Long requestOrgId,Integer orgType)
|
|
|
+ {
|
|
|
+ List<SysOrgVO> sysOrgVOS = RemoteCallHandlerExecutor.executeRemoteCall(() -> orgService.getSelfAndAllParentOrgs(requestOrgId), ErrorMsgConstants.QUERY_ORG_DATA_ERROR);
|
|
|
+
|
|
|
+ // 如果当前机构或者机构的上级存在 指定机构类型的机构 该类型的机构Path
|
|
|
+ final Optional<SysOrgVO> first = sysOrgVOS.stream().filter(x -> ObjectUtil.equal(x.getType(), orgType)).findFirst();
|
|
|
+ if(first.isPresent())
|
|
|
+ {
|
|
|
+ return first.get().getPath();
|
|
|
+ }
|
|
|
+ // 不存在 这说明该机构是在 指定机构类型之上 取当前查询条件机构的Path
|
|
|
+ else{
|
|
|
+ final Optional<SysOrgVO> self = sysOrgVOS.stream().filter(x -> ObjectUtil.equal(x.getId(), requestOrgId)).findFirst();
|
|
|
+
|
|
|
+ if(self.isPresent())
|
|
|
+ {
|
|
|
+ return self.get().getPath();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
|
|
|
private void dealRecListParam(CoreDrillTaskRecPageDto request) {
|
|
|
|
|
|
@@ -1273,7 +1341,7 @@ public class CoreDrillTaskServiceImpl extends ServiceImpl<CoreDrillTaskMapper, C
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
- waitRecTaskList.removeIf(item -> DateUtil.date().before(item.getStartTime()) || DateUtil.date().after(item.getEndTime()));
|
|
|
+ waitRecTaskList.removeIf(item -> DateUtil.date().before(item.getStartTime()) );
|
|
|
waitRecTaskList.forEach(item -> {
|
|
|
item.setType(PanelTypeEnums.DRILL_REC.getCode());
|
|
|
});
|