|  | @@ -2,7 +2,6 @@ package com.usky.fire.service.impl;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 | 
	
		
			
				|  |  |  import com.baomidou.mybatisplus.core.metadata.IPage;
 | 
	
		
			
				|  |  | -import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 | 
	
		
			
				|  |  |  import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 | 
	
		
			
				|  |  |  import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 | 
	
		
			
				|  |  |  import com.usky.common.core.bean.CommonPage;
 | 
	
	
		
			
				|  | @@ -41,28 +40,28 @@ public class BaseCompanyPersonServiceImpl extends AbstractCrudService<BaseCompan
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public CommonPage<BaseCompanyPerson> baseCompanyPersonList(String companyCode, String companyName, Integer pageNum, Integer pageSize) {
 | 
	
		
			
				|  |  | -        List<String> companyIdList = baseUserCompanyService.companyIdList();
 | 
	
		
			
				|  |  | +//        List<String> companyIdList = baseUserCompanyService.companyIdList();
 | 
	
		
			
				|  |  |          IPage<BaseCompanyPerson> page = new Page<>(pageNum, pageSize);
 | 
	
		
			
				|  |  | -        if (CollectionUtils.isNotEmpty(companyIdList)) {
 | 
	
		
			
				|  |  | -            LambdaQueryWrapper<BaseCompanyPerson> queryWrapper = Wrappers.lambdaQuery();
 | 
	
		
			
				|  |  | -            queryWrapper.like(StringUtils.isNotBlank(companyCode), BaseCompanyPerson::getCompanyCode, companyCode)
 | 
	
		
			
				|  |  | -                    .like(StringUtils.isNotBlank(companyName), BaseCompanyPerson::getCompanyName, companyName)
 | 
	
		
			
				|  |  | -                    .in(BaseCompanyPerson::getCompanyId, companyIdList)
 | 
	
		
			
				|  |  | -                    .orderByDesc(BaseCompanyPerson::getId);
 | 
	
		
			
				|  |  | -            page = this.page(page, queryWrapper);
 | 
	
		
			
				|  |  | -            if (page.getTotal() > 0) {
 | 
	
		
			
				|  |  | -                List<BaseCompanyPerson> baseCompanyPeople = mhPostInspectMapper.inspectStatistics(companyIdList);
 | 
	
		
			
				|  |  | -                for (int i = 0; i < page.getRecords().size(); i++) {
 | 
	
		
			
				|  |  | -                    for (int j = 0; j < baseCompanyPeople.size(); j++) {
 | 
	
		
			
				|  |  | -                        if (page.getRecords().get(i).getCompanyId().equals(baseCompanyPeople.get(j).getCompanyId())) {
 | 
	
		
			
				|  |  | -                            page.getRecords().get(i).setInspectCount(baseCompanyPeople.get(j).getInspectCount());
 | 
	
		
			
				|  |  | -                            page.getRecords().get(i).setAnswerCount(baseCompanyPeople.get(j).getAnswerCount());
 | 
	
		
			
				|  |  | -                            page.getRecords().get(i).setInspectTime(baseCompanyPeople.get(j).getInspectTime());
 | 
	
		
			
				|  |  | -                        }
 | 
	
		
			
				|  |  | +//        if (CollectionUtils.isNotEmpty(companyIdList)) {
 | 
	
		
			
				|  |  | +        LambdaQueryWrapper<BaseCompanyPerson> queryWrapper = Wrappers.lambdaQuery();
 | 
	
		
			
				|  |  | +        queryWrapper.like(StringUtils.isNotBlank(companyCode), BaseCompanyPerson::getCompanyCode, companyCode)
 | 
	
		
			
				|  |  | +                .like(StringUtils.isNotBlank(companyName), BaseCompanyPerson::getCompanyName, companyName)
 | 
	
		
			
				|  |  | +//                    .in(BaseCompanyPerson::getCompanyId, companyIdList)
 | 
	
		
			
				|  |  | +                .orderByDesc(BaseCompanyPerson::getId);
 | 
	
		
			
				|  |  | +        page = this.page(page, queryWrapper);
 | 
	
		
			
				|  |  | +        if (page.getTotal() > 0) {
 | 
	
		
			
				|  |  | +            List<BaseCompanyPerson> baseCompanyPeople = mhPostInspectMapper.inspectStatistics(null);
 | 
	
		
			
				|  |  | +            for (int i = 0; i < page.getRecords().size(); i++) {
 | 
	
		
			
				|  |  | +                for (int j = 0; j < baseCompanyPeople.size(); j++) {
 | 
	
		
			
				|  |  | +                    if (page.getRecords().get(i).getCompanyId().equals(baseCompanyPeople.get(j).getCompanyId())) {
 | 
	
		
			
				|  |  | +                        page.getRecords().get(i).setInspectCount(baseCompanyPeople.get(j).getInspectCount());
 | 
	
		
			
				|  |  | +                        page.getRecords().get(i).setAnswerCount(baseCompanyPeople.get(j).getAnswerCount());
 | 
	
		
			
				|  |  | +                        page.getRecords().get(i).setInspectTime(baseCompanyPeople.get(j).getInspectTime());
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | +//        }
 | 
	
		
			
				|  |  |          return new CommonPage<>(page.getRecords(), page.getTotal(), pageSize, pageNum);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -73,21 +72,21 @@ public class BaseCompanyPersonServiceImpl extends AbstractCrudService<BaseCompan
 | 
	
		
			
				|  |  |          String format = simpleDateFormat.format(date);
 | 
	
		
			
				|  |  |          String startTime = format + " 00:00:00";
 | 
	
		
			
				|  |  |          String endTime = format + " 23:59:59";
 | 
	
		
			
				|  |  | -        List<String> companyIdList = baseUserCompanyService.companyIdList();
 | 
	
		
			
				|  |  | +//        List<String> companyIdList = baseUserCompanyService.companyIdList();
 | 
	
		
			
				|  |  |          String spentTime = "--:--";
 | 
	
		
			
				|  |  |          Integer answeredCount = 0;
 | 
	
		
			
				|  |  |          Integer notAnsweredCount = 0;
 | 
	
		
			
				|  |  |          Integer count = 0;
 | 
	
		
			
				|  |  | -        if (CollectionUtils.isNotEmpty(companyIdList)) {
 | 
	
		
			
				|  |  | -            Integer spentTimeAvg = mhPostInspectMapper.mhPostInspectStatistics(" AVG(spent_time) ", 1, startTime, endTime, companyIdList, null);
 | 
	
		
			
				|  |  | -            if (spentTimeAvg==null){
 | 
	
		
			
				|  |  | -                spentTimeAvg = 0;
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -            answeredCount = mhPostInspectMapper.mhPostInspectStatistics(" count(*) ", 1, startTime, endTime, companyIdList, null);
 | 
	
		
			
				|  |  | -            notAnsweredCount = mhPostInspectMapper.mhPostInspectStatistics(" count(*) ", 0, startTime, endTime, companyIdList, null);
 | 
	
		
			
				|  |  | -            count = answeredCount + notAnsweredCount;
 | 
	
		
			
				|  |  | -            spentTime = spentTimeAvg / 60 + ":" + spentTimeAvg % 60;
 | 
	
		
			
				|  |  | +//        if (CollectionUtils.isNotEmpty(companyIdList)) {
 | 
	
		
			
				|  |  | +        Integer spentTimeAvg = mhPostInspectMapper.mhPostInspectStatistics(" AVG(spent_time) ", 1, startTime, endTime, null, null);
 | 
	
		
			
				|  |  | +        if (spentTimeAvg == null) {
 | 
	
		
			
				|  |  | +            spentTimeAvg = 0;
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | +        answeredCount = mhPostInspectMapper.mhPostInspectStatistics(" count(*) ", 1, startTime, endTime, null, null);
 | 
	
		
			
				|  |  | +        notAnsweredCount = mhPostInspectMapper.mhPostInspectStatistics(" count(*) ", 0, startTime, endTime, null, null);
 | 
	
		
			
				|  |  | +        count = answeredCount + notAnsweredCount;
 | 
	
		
			
				|  |  | +        spentTime = spentTimeAvg / 60 + ":" + spentTimeAvg % 60;
 | 
	
		
			
				|  |  | +//        }
 | 
	
		
			
				|  |  |          Map<String, Object> map = new HashMap<>();
 | 
	
		
			
				|  |  |          map.put("spentTimeAvg", spentTime);
 | 
	
		
			
				|  |  |          map.put("count", count);
 |