|
|
@@ -76,56 +76,59 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
Page<Question> page = query.toPage();
|
|
|
|
|
|
//查询条件
|
|
|
- LambdaQueryWrapper<Question> wrapper = new LambdaQueryWrapper<>();
|
|
|
- //下穿
|
|
|
- if (query.getCheckSub()) {
|
|
|
- List<Long> ids = orgService.selectCheckSubOrgIdList(query.getOrgId(), SecurityConstants.INNER);
|
|
|
- //添加in条件
|
|
|
- wrapper.in(Question::getOrgId, ids);
|
|
|
- } else {
|
|
|
- wrapper.eq(Question::getOrgId, query.getOrgId());
|
|
|
- }
|
|
|
-
|
|
|
- if (ObjectUtil.isNotEmpty(query.getConfirmStatus())) {
|
|
|
- if (ObjectUtil.equal(query.getConfirmStatus(), QuestionConfirmEnum.OverDue.getValue())) {
|
|
|
- wrapper.ne(Question::getConfirmStatus, QuestionConfirmEnum.Closed.getValue());
|
|
|
- wrapper.lt(Question::getReformDeadline, DateUtil.beginOfDay(new Date()));
|
|
|
- } else {
|
|
|
- wrapper.eq(Question::getConfirmStatus, query.getConfirmStatus());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
+// LambdaQueryWrapper<Question> wrapper = new LambdaQueryWrapper<>();
|
|
|
+// //下穿
|
|
|
+// if (query.getCheckSub()) {
|
|
|
+// List<Long> ids = orgService.selectCheckSubOrgIdList(query.getOrgId(), SecurityConstants.INNER);
|
|
|
+// //添加in条件
|
|
|
+// wrapper.in(Question::getOrgId, ids);
|
|
|
+// } else {
|
|
|
+// wrapper.eq(Question::getOrgId, query.getOrgId());
|
|
|
+// }
|
|
|
+//
|
|
|
+// if (ObjectUtil.isNotEmpty(query.getConfirmStatus())) {
|
|
|
+// if (ObjectUtil.equal(query.getConfirmStatus(), QuestionConfirmEnum.OverDue.getValue())) {
|
|
|
+// wrapper.ne(Question::getConfirmStatus, QuestionConfirmEnum.Closed.getValue());
|
|
|
+// wrapper.lt(Question::getReformDeadline, DateUtil.beginOfDay(new Date()));
|
|
|
+// } else {
|
|
|
+// wrapper.eq(Question::getConfirmStatus, query.getConfirmStatus());
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+//
|
|
|
if (ObjectUtil.isNotNull(query.getReformDate())) {
|
|
|
+ query.setSubmitRange(new Date[2]);
|
|
|
Date submitTime = DateUtil.endOfDay(query.getReformDate());
|
|
|
- wrapper.le(Question::getSubmitTime, submitTime);
|
|
|
+ query.getSubmitRange()[0] = submitTime;
|
|
|
|
|
|
Date reformDeadLine = DateUtil.beginOfDay(query.getReformDate());
|
|
|
- wrapper.ge(Question::getReformDeadline, reformDeadLine);
|
|
|
+ query.getSubmitRange()[1] = reformDeadLine;
|
|
|
|
|
|
- if (ObjectUtil.isNotEmpty(query.getSearchKey())) {
|
|
|
- wrapper.and(w ->
|
|
|
- w.like(Question::getQuestionDesc, query.getSearchKey())
|
|
|
- );
|
|
|
- }
|
|
|
+
|
|
|
+// if (ObjectUtil.isNotEmpty(query.getSearchKey())) {
|
|
|
+// wrapper.and(w ->
|
|
|
+// w.like(Question::getQuestionDesc, query.getSearchKey())
|
|
|
+// );
|
|
|
+// }
|
|
|
} else {
|
|
|
//时间范围查询
|
|
|
if (ObjectUtil.isNotEmpty(query.getSubmitRange()) && query.getSubmitRange().length == 2) {
|
|
|
- Date start = DateUtil.beginOfDay(query.getSubmitRange()[0]);
|
|
|
- Date end = DateUtil.endOfDay(query.getSubmitRange()[1]);
|
|
|
- wrapper.between(Question::getSubmitTime, start, end);
|
|
|
- }
|
|
|
+ query.getSubmitRange()[0] = DateUtil.beginOfDay(query.getSubmitRange()[0]);
|
|
|
+ query.getSubmitRange()[1] = DateUtil.endOfDay(query.getSubmitRange()[1]);
|
|
|
|
|
|
- if (ObjectUtil.isNotEmpty(query.getSearchKey())) {
|
|
|
- wrapper.and(w ->
|
|
|
- w.like(Question::getCheckContent, query.getSearchKey()).or().like(Question::getQuestionDesc, query.getSearchKey())
|
|
|
- );
|
|
|
+// wrapper.between(Question::getSubmitTime, start, end);
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- wrapper.orderByDesc(Question::getId);
|
|
|
+// if (ObjectUtil.isNotEmpty(query.getSearchKey())) {
|
|
|
+// wrapper.and(w ->
|
|
|
+// w.like(Question::getCheckContent, query.getSearchKey()).or().like(Question::getQuestionDesc, query.getSearchKey())
|
|
|
+// );
|
|
|
+// }
|
|
|
+ }
|
|
|
+//
|
|
|
+// wrapper.orderByDesc(Question::getId);
|
|
|
//获取数据
|
|
|
- page = baseMapper.selectPage(page, wrapper);
|
|
|
+ page = baseMapper.pageQuestion(page, query, DateUtil.beginOfDay(new Date()));
|
|
|
page.getRecords().forEach(r -> {
|
|
|
if (ObjectUtil.notEqual(r.getConfirmStatus(), QuestionConfirmEnum.Closed.getValue()) &&
|
|
|
r.getReformDeadline().before(DateUtil.beginOfDay(new Date()))) {
|
|
|
@@ -185,7 +188,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
public int insertQuestion(Question question) {
|
|
|
question.setId(IDHelper.id());
|
|
|
|
|
|
- if (ObjectUtil.equal(question.getOrgId(),SecurityUtils.getLoginUser().getOrgId())) {
|
|
|
+ if (ObjectUtil.equal(question.getOrgId(), SecurityUtils.getLoginUser().getOrgId())) {
|
|
|
question.setConfirmStatus(QuestionConfirmEnum.Confirmed.getValue());
|
|
|
question.setReformStatus(QuestionReformEnum.Unreform.getValue());
|
|
|
} else {
|
|
|
@@ -309,32 +312,33 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
|
|
|
/**
|
|
|
* 当前用户的工作台。有所属机构+有整改权限的待整改、所属机构+有确认权限的待确认、异议提出人+异议状态的异议审批
|
|
|
+ *
|
|
|
* @param panelListDto
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public List<PanelListVo> selectCurUserTaskList(PanelListDto panelListDto){
|
|
|
- LambdaQueryWrapper<Question> wrapper=new LambdaQueryWrapper<>();
|
|
|
- Long confirmButton=2353L;
|
|
|
- Long dissentButton=2354L;
|
|
|
- Long reformButton=2355L;
|
|
|
- List<Long> ownPermission= remoteUserService.checkUserPermission(Arrays.asList(confirmButton,dissentButton,reformButton)
|
|
|
- ,SecurityUtils.getUserId(),SecurityConstants.INNER);
|
|
|
- if(ownPermission.contains(reformButton)){
|
|
|
- wrapper.or(w->w.eq(Question::getOrgId,panelListDto.getOrgId()).eq(Question::getReformStatus,QuestionReformEnum.Unreform.getValue()));
|
|
|
+ public List<PanelListVo> selectCurUserTaskList(PanelListDto panelListDto) {
|
|
|
+ LambdaQueryWrapper<Question> wrapper = new LambdaQueryWrapper<>();
|
|
|
+ Long confirmButton = 2353L;
|
|
|
+ Long dissentButton = 2354L;
|
|
|
+ Long reformButton = 2355L;
|
|
|
+ List<Long> ownPermission = remoteUserService.checkUserPermission(Arrays.asList(confirmButton, dissentButton, reformButton)
|
|
|
+ , SecurityUtils.getUserId(), SecurityConstants.INNER);
|
|
|
+ if (ownPermission.contains(reformButton)) {
|
|
|
+ wrapper.or(w -> w.eq(Question::getOrgId, panelListDto.getOrgId()).eq(Question::getReformStatus, QuestionReformEnum.Unreform.getValue()));
|
|
|
}
|
|
|
|
|
|
- if(ownPermission.contains(confirmButton)){
|
|
|
- wrapper.or(w->w.eq(Question::getOrgId,panelListDto.getOrgId()).eq(Question::getConfirmStatus,QuestionConfirmEnum.Unconfirm.getValue()));
|
|
|
+ if (ownPermission.contains(confirmButton)) {
|
|
|
+ wrapper.or(w -> w.eq(Question::getOrgId, panelListDto.getOrgId()).eq(Question::getConfirmStatus, QuestionConfirmEnum.Unconfirm.getValue()));
|
|
|
}
|
|
|
|
|
|
- if(ownPermission.contains(dissentButton)){
|
|
|
- wrapper.or(w->w.eq(Question::getSubmitorId,SecurityUtils.getUserId()).eq(Question::getConfirmStatus,QuestionConfirmEnum.Dissent.getValue()));
|
|
|
+ if (ownPermission.contains(dissentButton)) {
|
|
|
+ wrapper.or(w -> w.eq(Question::getSubmitorId, SecurityUtils.getUserId()).eq(Question::getConfirmStatus, QuestionConfirmEnum.Dissent.getValue()));
|
|
|
}
|
|
|
|
|
|
- if(wrapper.isEmptyOfWhere()){
|
|
|
- return new ArrayList<>();
|
|
|
- }else{
|
|
|
+ if (wrapper.isEmptyOfWhere()) {
|
|
|
+ return new ArrayList<>();
|
|
|
+ } else {
|
|
|
wrapper.select(Question::getId,
|
|
|
Question::getQuestionDesc,
|
|
|
Question::getOrgId,
|
|
|
@@ -342,24 +346,24 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
Question::getReformStatus,
|
|
|
Question::getSubmitTime,
|
|
|
Question::getReformDeadline);
|
|
|
- List<Question> list= baseMapper.selectList(wrapper);
|
|
|
- List<PanelListVo> vos=list.stream().map(item->{
|
|
|
- PanelListVo vo=new PanelListVo();
|
|
|
+ List<Question> list = baseMapper.selectList(wrapper);
|
|
|
+ List<PanelListVo> vos = list.stream().map(item -> {
|
|
|
+ PanelListVo vo = new PanelListVo();
|
|
|
vo.setId(item.getId());
|
|
|
vo.setEndTime(item.getReformDeadline());
|
|
|
vo.setTaskName(item.getQuestionDesc());
|
|
|
vo.setStartTime(item.getSubmitTime());
|
|
|
vo.setType(PanelTypeEnums.QUESTION.getCode());
|
|
|
- if(ObjectUtil.isNull(item.getReformStatus())){
|
|
|
+ if (ObjectUtil.isNull(item.getReformStatus())) {
|
|
|
vo.setStatus(item.getConfirmStatus());
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
vo.setStatus(item.getReformStatus());
|
|
|
}
|
|
|
|
|
|
- return vo;
|
|
|
+ return vo;
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
- return vos;
|
|
|
+ return vos;
|
|
|
}
|
|
|
}
|
|
|
}
|