|  |  |  | @ -148,6 +148,9 @@ public class EnterpriseInspectionsServiceImpl implements EnterpriseInspectionsSe | 
			
		
	
		
			
				
					|  |  |  |  |     @Override | 
			
		
	
		
			
				
					|  |  |  |  |     public PageResult<EnterpriseInspectionsDO> getEnterpriseInspectionsPage(EnterpriseInspectionsPageReqVO pageReqVO) { | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | //        final Long userId = getLoginUserId();
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         //根据企业名称查询
 | 
			
		
	
		
			
				
					|  |  |  |  |         if (pageReqVO.getEnterpriseName() != null) { | 
			
		
	
		
			
				
					|  |  |  |  |             LambdaQueryWrapper<EnterpriseDO> wrapper = new LambdaQueryWrapper<>(); | 
			
		
	
		
			
				
					|  |  |  |  |             wrapper.like(EnterpriseDO::getEnterprisesName, pageReqVO.getEnterpriseName()); | 
			
		
	
	
		
			
				
					|  |  |  | @ -158,6 +161,7 @@ public class EnterpriseInspectionsServiceImpl implements EnterpriseInspectionsSe | 
			
		
	
		
			
				
					|  |  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         //根据任务名称查询
 | 
			
		
	
		
			
				
					|  |  |  |  |         if (pageReqVO.getTaskName() != null) { | 
			
		
	
		
			
				
					|  |  |  |  |             LambdaQueryWrapper<TaskInfoDO> wrapper = new LambdaQueryWrapper<>(); | 
			
		
	
		
			
				
					|  |  |  |  |             wrapper.like(TaskInfoDO::getTitle, pageReqVO.getTaskName()); | 
			
		
	
	
		
			
				
					|  |  |  | @ -202,19 +206,15 @@ public class EnterpriseInspectionsServiceImpl implements EnterpriseInspectionsSe | 
			
		
	
		
			
				
					|  |  |  |  |                     throw exception(ENTERPRISE_NOT_EXISTS); | 
			
		
	
		
			
				
					|  |  |  |  |                 } | 
			
		
	
		
			
				
					|  |  |  |  |                 item.setEnterpriseName(enterpriseDO.getEnterprisesName()); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 //查询检查记录
 | 
			
		
	
		
			
				
					|  |  |  |  |                 QueryWrapper<InspectionsLogDO> inspectionsLogWrapper = new QueryWrapper<>(); | 
			
		
	
		
			
				
					|  |  |  |  |                 inspectionsLogWrapper.eq("inspections_id", item.getId()); | 
			
		
	
		
			
				
					|  |  |  |  |                 inspectionsLogWrapper.orderByDesc("create_time"); | 
			
		
	
		
			
				
					|  |  |  |  |                 final List<InspectionsLogDO> inspectionsLogDOS = inspectionsLogMapper.selectList(inspectionsLogWrapper); | 
			
		
	
		
			
				
					|  |  |  |  |                 if (inspectionsLogDOS != null && inspectionsLogDOS.size() > 0) { | 
			
		
	
		
			
				
					|  |  |  |  |                     item.setInspectionStatus(inspectionsLogDOS.get(0).getStatus()); | 
			
		
	
		
			
				
					|  |  |  |  |                     item.setInspectName(inspectionsLogDOS.get(0).getInspectName()); | 
			
		
	
		
			
				
					|  |  |  |  |                     item.setCooperateWithName(inspectionsLogDOS.get(0).getCooperateWithName()); | 
			
		
	
		
			
				
					|  |  |  |  |                     item.setExecTime(inspectionsLogDOS.get(0).getCreateTime()); | 
			
		
	
		
			
				
					|  |  |  |  |                 //查询执行的最新一条记录
 | 
			
		
	
		
			
				
					|  |  |  |  |                 final InspectionsLogDO inspectionsLogNew = this.getInspectionsLogNew(item.getId()); | 
			
		
	
		
			
				
					|  |  |  |  |                 if (inspectionsLogNew != null) { | 
			
		
	
		
			
				
					|  |  |  |  |                     item.setInspectionStatus(inspectionsLogNew.getStatus()); | 
			
		
	
		
			
				
					|  |  |  |  |                     item.setInspectName(inspectionsLogNew.getInspectName()); | 
			
		
	
		
			
				
					|  |  |  |  |                     item.setCooperateWithName(inspectionsLogNew.getCooperateWithName()); | 
			
		
	
		
			
				
					|  |  |  |  |                     item.setExecTime(inspectionsLogNew.getCreateTime()); | 
			
		
	
		
			
				
					|  |  |  |  |                     //根据执法人员id 查询其所属部门
 | 
			
		
	
		
			
				
					|  |  |  |  |                     final Long userId = Long.valueOf(inspectionsLogDOS.get(0).getCreator()); | 
			
		
	
		
			
				
					|  |  |  |  |                     final Long userId = Long.valueOf(inspectionsLogNew.getCreator()); | 
			
		
	
		
			
				
					|  |  |  |  |                     final AdminUserDO user = adminUserService.getUser(userId); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                     if (user == null) { | 
			
		
	
	
		
			
				
					|  |  |  | @ -228,7 +228,7 @@ public class EnterpriseInspectionsServiceImpl implements EnterpriseInspectionsSe | 
			
		
	
		
			
				
					|  |  |  |  |                     //根据执法人员id 查询其所属部门
 | 
			
		
	
		
			
				
					|  |  |  |  |                     final Long userId = Long.valueOf(item.getUserId()); | 
			
		
	
		
			
				
					|  |  |  |  |                     final AdminUserDO user = adminUserService.getUser(userId); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                     item.setInspectionStatus(1); | 
			
		
	
		
			
				
					|  |  |  |  |                     item.setInspectName(user.getRealName()); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                     if (user == null) { | 
			
		
	
	
		
			
				
					|  |  |  | @ -238,6 +238,13 @@ public class EnterpriseInspectionsServiceImpl implements EnterpriseInspectionsSe | 
			
		
	
		
			
				
					|  |  |  |  |             }); | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         if (pageReqVO.getInspectionsStatus() != null) { | 
			
		
	
		
			
				
					|  |  |  |  |             final List<EnterpriseInspectionsDO> collect = enterpriseInspectionsDOPageResult.getList().stream().filter(item -> item.getInspectionStatus() == pageReqVO.getInspectionsStatus()).collect(Collectors.toList()); | 
			
		
	
		
			
				
					|  |  |  |  |             enterpriseInspectionsDOPageResult.setList(collect); | 
			
		
	
		
			
				
					|  |  |  |  |             enterpriseInspectionsDOPageResult.setTotal(Long.valueOf(collect.size())); | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         return enterpriseInspectionsDOPageResult; | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  |  | 
 |