diff --git a/renren-admin/src/main/java/io/renren/modules/activiti/controller/HistoryController.java b/renren-admin/src/main/java/io/renren/modules/activiti/controller/HistoryController.java index fa78e263..0ae4205b 100644 --- a/renren-admin/src/main/java/io/renren/modules/activiti/controller/HistoryController.java +++ b/renren-admin/src/main/java/io/renren/modules/activiti/controller/HistoryController.java @@ -8,6 +8,8 @@ import io.renren.modules.activiti.dto.ProcessActivityDTO; import io.renren.modules.activiti.dto.ProcessInstanceDTO; import io.renren.modules.activiti.service.ActHistoryService; import io.renren.modules.activiti.service.ActivitiService; +import io.renren.modules.demanData.dto.TDemandDataDTO; +import io.renren.modules.demanData.service.TDemandDataService; import io.renren.modules.processForm.dto.TAbilityApplicationDTO; import io.renren.modules.processForm.service.TAbilityApplicationService; import io.renren.modules.resourceMountApply.dto.TResourceMountApplyDTO; @@ -50,6 +52,8 @@ public class HistoryController { private TAbilityApplicationService abilityApplicationService; @Autowired private TResourceMountApplyService tResourceMountApplyService; + @Autowired + private TDemandDataService tDemandDataService; @GetMapping("getInstImage") @ApiOperation(value = "获取流程活动图", produces = "application/octet-stream") @@ -125,10 +129,13 @@ public class HistoryController { TAbilityApplicationDTO abilityApplicationDTO = abilityApplicationService.get(Long.valueOf(activityDTO.getBusinessKey())); TResourceMountApplyDTO tResourceMountApplyDTO = tResourceMountApplyService.get(Long.valueOf(activityDTO.getBusinessKey())); + TDemandDataDTO tDemandDataDTO = tDemandDataService.get(Long.valueOf(activityDTO.getBusinessKey())); if (abilityApplicationDTO != null) { activityDTO.setResourceName(abilityApplicationDTO.getSystem()); } else if (tResourceMountApplyDTO != null) { activityDTO.setResourceName(tResourceMountApplyDTO.getResourceDTO().getName()); + } else if (tDemandDataDTO != null) { + activityDTO.setResourceName(tDemandDataDTO.getDemandSubject()); } } return new Result().ok(page); diff --git a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java index 38c93172..7cfb4498 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java @@ -123,12 +123,15 @@ public class ResourceServiceImpl extends CrudServiceImpl wrapper = new QueryWrapper<>(); wrapper.eq("data_resource_id", id) .eq("del_flag", 0); List attrEntities = attrDao.selectList(wrapper); - resourceDTO.setInfoList(attrEntities); + resourceDTO.setInfoList(attrEntities == null ? new ArrayList<>() : attrEntities); // npe? return resourceDTO; } @@ -143,14 +146,14 @@ public class ResourceServiceImpl extends CrudServiceImpl resultPage = new Page<>(pageNum, pageSize); if (resourceDTO.getInfoList().isEmpty()) { - List resourceDTOS = resourceDao.selectDTOPage(resourceDTO, (pageNum - 1)* pageSize, pageSize, orderField, orderType); + List resourceDTOS = resourceDao.selectDTOPage(resourceDTO, (pageNum - 1) * pageSize, pageSize, orderField, orderType); resourceDTOS.forEach(item -> { item.setInfoList(this.selectAttrsByResourceId(item.getId())); }); resultPage.setRecords(resourceDTOS); resultPage.setTotal(resourceDao.selectDTOPage(resourceDTO, 1, 100000, orderField, orderType).size()); } else { - List resourceDTOS = resourceDao.selectWithAttrs(resourceDTO , orderField, orderType); + List resourceDTOS = resourceDao.selectWithAttrs(resourceDTO, orderField, orderType); int j = Math.min(pageNum * pageSize, resourceDTOS.size()); if (resourceDTOS.isEmpty()) { resultPage.setRecords(null);