|
|
@@ -42,10 +42,7 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@Service
|
|
|
@@ -65,6 +62,7 @@ public class ResumptionServiceImpl extends ServiceImpl<ResumptionMapper, Resumpt
|
|
|
private CoreSafetyExceptionDataMapper exceptionDataMapper;
|
|
|
@Autowired
|
|
|
private CoreSafeMonthScoreMapper safeMonthScoreMapper;
|
|
|
+
|
|
|
@Override
|
|
|
public List<Map<String, Object>> findDayTaskList(int year, int quarter, String dateTime, Long roleId, Long orgid) {
|
|
|
return resumptionMapper.findDayTaskList(year, quarter, dateTime, roleId, orgid);
|
|
|
@@ -116,12 +114,32 @@ public class ResumptionServiceImpl extends ServiceImpl<ResumptionMapper, Resumpt
|
|
|
|
|
|
@Override
|
|
|
public List<ResumptionAppVo> findResumptionApp(ResumptionTaskNewDto res) {
|
|
|
- if(ObjectUtil.isNotNull(res.getDateTime())){
|
|
|
+ if (ObjectUtil.isNotNull(res.getDateTime())) {
|
|
|
res.setStartTime(DateUtil.endOfDay(res.getDateTime()));
|
|
|
res.setEndTime(DateUtil.beginOfDay(res.getDateTime()));
|
|
|
}
|
|
|
|
|
|
- return resumptionMapper.findResumptionApp(res);
|
|
|
+ List<ResumptionAppVo> data = resumptionMapper.findResumptionApp(res);
|
|
|
+ data.sort(new Comparator<ResumptionAppVo>() {
|
|
|
+ @Override
|
|
|
+ public int compare(ResumptionAppVo o1, ResumptionAppVo o2) {
|
|
|
+ Integer o1Status = o1.getStatus();
|
|
|
+ Integer o2Status = o2.getStatus();
|
|
|
+ if (ObjectUtil.equal(o1Status, 1)) {
|
|
|
+ o1Status = -1;
|
|
|
+ }
|
|
|
+ if (ObjectUtil.equal(o2Status, 1)) {
|
|
|
+ o2Status = -1;
|
|
|
+ }
|
|
|
+ if (ObjectUtil.equal(o1Status, o2Status)) {
|
|
|
+ return o1.getPlanEndTime().compareTo(o2.getPlanEndTime());
|
|
|
+ } else {
|
|
|
+ return -o1Status.compareTo(o2Status);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ return data;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -211,7 +229,25 @@ public class ResumptionServiceImpl extends ServiceImpl<ResumptionMapper, Resumpt
|
|
|
list.forEach(item -> {
|
|
|
item.setType(PanelTypeEnums.RESUMPTION.getCode());
|
|
|
});
|
|
|
+ list.sort(new Comparator<PanelListVo>() {
|
|
|
+ @Override
|
|
|
+ public int compare(PanelListVo o1, PanelListVo o2) {
|
|
|
+ Integer o1Status = o1.getStatus();
|
|
|
+ Integer o2Status = o2.getStatus();
|
|
|
+ if (ObjectUtil.equal(o1Status, 1)) {
|
|
|
+ o1Status = -1;
|
|
|
+ }
|
|
|
+ if (ObjectUtil.equal(o2Status, 1)) {
|
|
|
+ o2Status = -1;
|
|
|
+ }
|
|
|
|
|
|
+ if (ObjectUtil.equal(o1Status, o2Status)) {
|
|
|
+ return o1.getEndTime().compareTo(o2.getEndTime());
|
|
|
+ } else {
|
|
|
+ return -o1Status.compareTo(o2Status);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
@@ -328,15 +364,15 @@ public class ResumptionServiceImpl extends ServiceImpl<ResumptionMapper, Resumpt
|
|
|
// }
|
|
|
|
|
|
@Override
|
|
|
- @Transactional(rollbackFor = Exception.class,propagation = Propagation.REQUIRES_NEW)
|
|
|
- public void findResumptionList(List<Long> orgIds,DateTime time) {
|
|
|
+ @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
|
|
|
+ public void findResumptionList(List<Long> orgIds, DateTime time) {
|
|
|
SysRole role = roleService.getRoleByName("网点安全员", SecurityConstants.INNER);
|
|
|
- //baseMapper.findResumptionExceptionList(time.year(), time.quarter(), time.month() + 1, role.getId());
|
|
|
- baseMapper.saveResumptionExceptionList(time.year(), time.quarter(), time.month() + 1, role.getId(),orgIds);
|
|
|
+ //baseMapper.findResumptionExceptionList(time.year(), time.quarter(), time.month() + 1, role.getId());
|
|
|
+ baseMapper.saveResumptionExceptionList(time.year(), time.quarter(), time.month() + 1, role.getId(), orgIds);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<SafeScoreResumptionDataVo> findSource(SafeScoreSourceDto request) {
|
|
|
+ public List<SafeScoreResumptionDataVo> findSource(SafeScoreSourceDto request) {
|
|
|
|
|
|
|
|
|
List<CoreSafetyExceptionData> exceptionDataList = exceptionDataMapper.selectList(new LambdaQueryWrapper<CoreSafetyExceptionData>()
|