|
@@ -138,78 +138,18 @@ public class PreparationServiceImpl extends BaseServiceImpl<PreparationMapper, P
|
|
|
dto.setCreatedTimeEnd(searchStartTime);
|
|
|
dto.setCreatedTimeEnd(searchEndTime);
|
|
|
List<PreparationVO> list = mapper.selectList(dto);
|
|
|
- List<PreparationReportByStatusVO> result = new ArrayList<>();
|
|
|
- Integer draftNum = 0;
|
|
|
- Integer waiting_allocationNum = 0;
|
|
|
- Integer allocationedNum = 0;
|
|
|
- Integer complatedNum = 0;
|
|
|
- Integer revokedNum = 0;
|
|
|
- PreparationReportByStatusVO draft = new PreparationReportByStatusVO();
|
|
|
- PreparationReportByStatusVO waiting = new PreparationReportByStatusVO();
|
|
|
- PreparationReportByStatusVO allocationed = new PreparationReportByStatusVO();
|
|
|
- PreparationReportByStatusVO complated = new PreparationReportByStatusVO();
|
|
|
- PreparationReportByStatusVO revoked = new PreparationReportByStatusVO();
|
|
|
- List<PreparationVO> draftList = new ArrayList<>();
|
|
|
- List<PreparationVO> waitingList = new ArrayList<>();
|
|
|
- List<PreparationVO> allocationedList = new ArrayList<>();
|
|
|
- List<PreparationVO> complatedList = new ArrayList<>();
|
|
|
- List<PreparationVO> revokedList = new ArrayList<>();
|
|
|
- for (PreparationVO vo : list) {
|
|
|
- if (DictCache.getValueByCode("REPAIR_PREPARATION_STATUS", "draft").equals(vo.getStatus())) {
|
|
|
- draft.setStatusName("草稿");
|
|
|
- draftList.add(vo);
|
|
|
- draft.setStatus(0);
|
|
|
- draftNum++;
|
|
|
- } else if (DictCache.getValueByCode("REPAIR_PREPARATION_STATUS", "waiting_allocation").equals(vo.getStatus())) {
|
|
|
- waiting.setStatusName("待分配");
|
|
|
- waitingList.add(vo);
|
|
|
- waiting.setStatus(1);
|
|
|
- waiting_allocationNum++;
|
|
|
- } else if (DictCache.getValueByCode("REPAIR_PREPARATION_STATUS", "allocationed").equals(vo.getStatus())) {
|
|
|
- allocationed.setStatusName("已分配");
|
|
|
- allocationedList.add(vo);
|
|
|
- allocationed.setStatus(2);
|
|
|
- allocationedNum++;
|
|
|
- } else if (DictCache.getValueByCode("REPAIR_PREPARATION_STATUS", "complated").equals(vo.getStatus())) {
|
|
|
- complated.setStatusName("已完成");
|
|
|
- complatedList.add(vo);
|
|
|
- complated.setStatus(3);
|
|
|
- complatedNum++;
|
|
|
- } else if (DictCache.getValueByCode("REPAIR_PREPARATION_STATUS", "revoked").equals(vo.getStatus())) {
|
|
|
- revoked.setStatusName("已撤销");
|
|
|
- revokedList.add(vo);
|
|
|
- revoked.setStatus(4);
|
|
|
- revokedNum++;
|
|
|
- }
|
|
|
+ List<PreparationReportByStatusVO> preparationReportByStatusVOS = mapper.getPreparationReportByStatusVO(dto);
|
|
|
+ for (PreparationReportByStatusVO statusVO:preparationReportByStatusVOS){
|
|
|
+ List<PreparationVO> detailList = new ArrayList<>();
|
|
|
|
|
|
+ for (PreparationVO preparationVO:list){
|
|
|
+ if (preparationVO.getStatus().equals(statusVO.getStatus())){
|
|
|
+ detailList.add(preparationVO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ statusVO.setDetailList(detailList);
|
|
|
}
|
|
|
- List<PreparationReportByStatusVO> list1 = new ArrayList<>();
|
|
|
- if (draftNum != 0) {
|
|
|
- draft.setNum(draftNum);
|
|
|
- draft.setDetailList(draftList);
|
|
|
- list1.add(draft);
|
|
|
- }
|
|
|
- if (waiting_allocationNum != 0) {
|
|
|
- waiting.setNum(waiting_allocationNum);
|
|
|
- waiting.setDetailList(waitingList);
|
|
|
- list1.add(waiting);
|
|
|
- }
|
|
|
- if (allocationedNum != 0) {
|
|
|
- allocationed.setNum(allocationedNum);
|
|
|
- allocationed.setDetailList(allocationedList);
|
|
|
- list1.add(allocationed);
|
|
|
- }
|
|
|
- if (complatedNum != 0) {
|
|
|
- complated.setNum(complatedNum);
|
|
|
- complated.setDetailList(complatedList);
|
|
|
- list1.add(complated);
|
|
|
- }
|
|
|
- if (revokedNum != 0) {
|
|
|
- revoked.setNum(revokedNum);
|
|
|
- revoked.setDetailList(revokedList);
|
|
|
- list1.add(revoked);
|
|
|
- }
|
|
|
- return list1;
|
|
|
+ return preparationReportByStatusVOS;
|
|
|
}
|
|
|
|
|
|
@Override
|