|  | @@ -4,23 +4,30 @@ import cn.hutool.core.date.DateUtil;
 | 
											
												
													
														|  |  import cn.hutool.core.util.NumberUtil;
 |  |  import cn.hutool.core.util.NumberUtil;
 | 
											
												
													
														|  |  import cn.hutool.core.util.ObjectUtil;
 |  |  import cn.hutool.core.util.ObjectUtil;
 | 
											
												
													
														|  |  import com.xunmei.common.core.constant.SecurityConstants;
 |  |  import com.xunmei.common.core.constant.SecurityConstants;
 | 
											
												
													
														|  | 
 |  | +import com.xunmei.common.core.domain.DateRange;
 | 
											
												
													
														|  | 
 |  | +import com.xunmei.common.core.enums.CycleCommonEnum;
 | 
											
												
													
														|  |  import com.xunmei.common.core.exception.ServiceException;
 |  |  import com.xunmei.common.core.exception.ServiceException;
 | 
											
												
													
														|  | 
 |  | +import com.xunmei.common.core.utils.DateUtils;
 | 
											
												
													
														|  | 
 |  | +import com.xunmei.common.core.utils.NumberUtils;
 | 
											
												
													
														|  | 
 |  | +import com.xunmei.common.core.utils.StringUtils;
 | 
											
												
													
														|  | 
 |  | +import com.xunmei.core.board.dto.app.AppSyntheticQuestionDto;
 | 
											
												
													
														|  |  import com.xunmei.core.board.dto.web.TaskStatisticDto;
 |  |  import com.xunmei.core.board.dto.web.TaskStatisticDto;
 | 
											
												
													
														|  | 
 |  | +import com.xunmei.core.board.dto.web.WebGA38InfoDto;
 | 
											
												
													
														|  | 
 |  | +import com.xunmei.core.board.dto.web.WebSyntheticQuestionDto;
 | 
											
												
													
														|  |  import com.xunmei.core.board.enums.PeriodEnum;
 |  |  import com.xunmei.core.board.enums.PeriodEnum;
 | 
											
												
													
														|  |  import com.xunmei.core.board.mapper.CockpitMapper;
 |  |  import com.xunmei.core.board.mapper.CockpitMapper;
 | 
											
												
													
														|  |  import com.xunmei.core.board.service.CockpitService;
 |  |  import com.xunmei.core.board.service.CockpitService;
 | 
											
												
													
														|  | -import com.xunmei.core.board.vo.web.OrgGA38StatisticVo;
 |  | 
 | 
											
												
													
														|  | -import com.xunmei.core.board.vo.web.QuestionStatisticVo;
 |  | 
 | 
											
												
													
														|  | -import com.xunmei.core.board.vo.web.TaskStatisticVo;
 |  | 
 | 
											
												
													
														|  | 
 |  | +import com.xunmei.core.board.vo.web.*;
 | 
											
												
													
														|  | 
 |  | +import com.xunmei.system.api.RemoteDictDataService;
 | 
											
												
													
														|  |  import com.xunmei.system.api.RemoteOrgService;
 |  |  import com.xunmei.system.api.RemoteOrgService;
 | 
											
												
													
														|  | 
 |  | +import com.xunmei.system.api.domain.SysDictData;
 | 
											
												
													
														|  |  import com.xunmei.system.api.domain.SysOrg;
 |  |  import com.xunmei.system.api.domain.SysOrg;
 | 
											
												
													
														|  | 
 |  | +import org.apache.http.annotation.Obsolete;
 | 
											
												
													
														|  |  import org.springframework.stereotype.Service;
 |  |  import org.springframework.stereotype.Service;
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  import javax.annotation.Resource;
 |  |  import javax.annotation.Resource;
 | 
											
												
													
														|  | -import java.util.ArrayList;
 |  | 
 | 
											
												
													
														|  | -import java.util.Comparator;
 |  | 
 | 
											
												
													
														|  | -import java.util.List;
 |  | 
 | 
											
												
													
														|  | -import java.util.Date;
 |  | 
 | 
											
												
													
														|  | 
 |  | +import java.util.*;
 | 
											
												
													
														|  | 
 |  | +import java.util.stream.Collectors;
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  @Service
 |  |  @Service
 | 
											
												
													
														|  |  public class CockpitServiceImpl implements CockpitService {
 |  |  public class CockpitServiceImpl implements CockpitService {
 | 
											
										
											
												
													
														|  | @@ -30,31 +37,50 @@ public class CockpitServiceImpl implements CockpitService {
 | 
											
												
													
														|  |      @Resource
 |  |      @Resource
 | 
											
												
													
														|  |      RemoteOrgService remoteOrgService;
 |  |      RemoteOrgService remoteOrgService;
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | 
 |  | +    @Resource
 | 
											
												
													
														|  | 
 |  | +    RemoteDictDataService remoteDictDataService;
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |      @Override
 |  |      @Override
 | 
											
												
													
														|  |      public List<TaskStatisticVo> resumption(TaskStatisticDto dto) {
 |  |      public List<TaskStatisticVo> resumption(TaskStatisticDto dto) {
 | 
											
												
													
														|  |          Date date = getStartDate(dto.getPeriod());
 |  |          Date date = getStartDate(dto.getPeriod());
 | 
											
												
													
														|  |          SysOrg org = remoteOrgService.selectOrgById(dto.getOrgId(), SecurityConstants.INNER);
 |  |          SysOrg org = remoteOrgService.selectOrgById(dto.getOrgId(), SecurityConstants.INNER);
 | 
											
												
													
														|  |          String orgPath = org.getPath();
 |  |          String orgPath = org.getPath();
 | 
											
												
													
														|  |          List<TaskStatisticVo> list = cockpitMapper.resumption(date, DateUtil.endOfDay(new Date()), orgPath);
 |  |          List<TaskStatisticVo> list = cockpitMapper.resumption(date, DateUtil.endOfDay(new Date()), orgPath);
 | 
											
												
													
														|  | -        return taskStatistic(list, dto, org);
 |  | 
 | 
											
												
													
														|  | 
 |  | +        return taskStatistic(list, dto.getOrgId());
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      @Override
 |  |      @Override
 | 
											
												
													
														|  | -    public List<TaskStatisticVo> safetyCheck(TaskStatisticDto dto) {
 |  | 
 | 
											
												
													
														|  | 
 |  | +    public List<WebSafetyCheckVo> safetyCheck(TaskStatisticDto dto) {
 | 
											
												
													
														|  |          Date date = getStartDate(dto.getPeriod());
 |  |          Date date = getStartDate(dto.getPeriod());
 | 
											
												
													
														|  |          SysOrg org = remoteOrgService.selectOrgById(dto.getOrgId(), SecurityConstants.INNER);
 |  |          SysOrg org = remoteOrgService.selectOrgById(dto.getOrgId(), SecurityConstants.INNER);
 | 
											
												
													
														|  | -        String orgPath = org.getPath();
 |  | 
 | 
											
												
													
														|  | -        List<TaskStatisticVo> list = cockpitMapper.safetyCheck(date, DateUtil.endOfDay(new Date()), orgPath);
 |  | 
 | 
											
												
													
														|  | -        return taskStatistic(list, dto, org);
 |  | 
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +//        String orgPath = org.getPath();
 | 
											
												
													
														|  | 
 |  | +        List<WebSafetyCheckVo> list = cockpitMapper.safetyCheck(date, DateUtil.endOfDay(new Date()), dto.getOrgPath());
 | 
											
												
													
														|  | 
 |  | +        List<SysDictData> dicts = remoteDictDataService.selectDictByeType("check_type", SecurityConstants.INNER);
 | 
											
												
													
														|  | 
 |  | +        List<WebSafetyCheckVo> r = dicts.stream().map(d -> {
 | 
											
												
													
														|  | 
 |  | +            Optional<WebSafetyCheckVo> voOpt = list.stream().filter(i -> ObjectUtil.equal(i.getType(), d.getDictValue())).findFirst();
 | 
											
												
													
														|  | 
 |  | +            WebSafetyCheckVo vo;
 | 
											
												
													
														|  | 
 |  | +            if (voOpt.isPresent()) {
 | 
											
												
													
														|  | 
 |  | +                vo = voOpt.get();
 | 
											
												
													
														|  | 
 |  | +            } else {
 | 
											
												
													
														|  | 
 |  | +                vo = new WebSafetyCheckVo();
 | 
											
												
													
														|  | 
 |  | +            }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +            vo.setType(d.getDictLabel());
 | 
											
												
													
														|  | 
 |  | +            return vo;
 | 
											
												
													
														|  | 
 |  | +        }).collect(Collectors.toList());
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        return r;
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      @Override
 |  |      @Override
 | 
											
												
													
														|  | 
 |  | +    @Obsolete
 | 
											
												
													
														|  |      public List<TaskStatisticVo> monitor(TaskStatisticDto dto) {
 |  |      public List<TaskStatisticVo> monitor(TaskStatisticDto dto) {
 | 
											
												
													
														|  |          Date date = getStartDate(dto.getPeriod());
 |  |          Date date = getStartDate(dto.getPeriod());
 | 
											
												
													
														|  |          SysOrg org = remoteOrgService.selectOrgById(dto.getOrgId(), SecurityConstants.INNER);
 |  |          SysOrg org = remoteOrgService.selectOrgById(dto.getOrgId(), SecurityConstants.INNER);
 | 
											
												
													
														|  |          String orgPath = org.getPath();
 |  |          String orgPath = org.getPath();
 | 
											
												
													
														|  |          List<TaskStatisticVo> list = cockpitMapper.monitor(date, DateUtil.endOfDay(new Date()), orgPath);
 |  |          List<TaskStatisticVo> list = cockpitMapper.monitor(date, DateUtil.endOfDay(new Date()), orgPath);
 | 
											
												
													
														|  | -        return taskStatistic(list, dto, org);
 |  | 
 | 
											
												
													
														|  | 
 |  | +        return taskStatistic(list,  dto.getOrgId());
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      @Override
 |  |      @Override
 | 
											
										
											
												
													
														|  | @@ -63,57 +89,120 @@ public class CockpitServiceImpl implements CockpitService {
 | 
											
												
													
														|  |          SysOrg org = remoteOrgService.selectOrgById(dto.getOrgId(), SecurityConstants.INNER);
 |  |          SysOrg org = remoteOrgService.selectOrgById(dto.getOrgId(), SecurityConstants.INNER);
 | 
											
												
													
														|  |          String orgPath = org.getPath();
 |  |          String orgPath = org.getPath();
 | 
											
												
													
														|  |          List<TaskStatisticVo> list = cockpitMapper.edu(date, DateUtil.endOfDay(new Date()), orgPath);
 |  |          List<TaskStatisticVo> list = cockpitMapper.edu(date, DateUtil.endOfDay(new Date()), orgPath);
 | 
											
												
													
														|  | -        return taskStatistic(list, dto, org);
 |  | 
 | 
											
												
													
														|  | 
 |  | +        return taskStatistic(list,  dto.getOrgId());
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      @Override
 |  |      @Override
 | 
											
												
													
														|  | -    public List<TaskStatisticVo> drill(TaskStatisticDto dto) {
 |  | 
 | 
											
												
													
														|  | 
 |  | +    public List<WebDrillInfoVo> drill(TaskStatisticDto dto) {
 | 
											
												
													
														|  |          Date date = getStartDate(dto.getPeriod());
 |  |          Date date = getStartDate(dto.getPeriod());
 | 
											
												
													
														|  | -        SysOrg org = remoteOrgService.selectOrgById(dto.getOrgId(), SecurityConstants.INNER);
 |  | 
 | 
											
												
													
														|  | -        String orgPath = org.getPath();
 |  | 
 | 
											
												
													
														|  | -        List<TaskStatisticVo> list = cockpitMapper.drill(date, DateUtil.endOfDay(new Date()), orgPath);
 |  | 
 | 
											
												
													
														|  | -        return taskStatistic(list, dto, org);
 |  | 
 | 
											
												
													
														|  | 
 |  | +//        SysOrg org = remoteOrgService.selectOrgById(dto.getOrgId(), SecurityConstants.INNER);
 | 
											
												
													
														|  | 
 |  | +//        String orgPath = org.getPath();
 | 
											
												
													
														|  | 
 |  | +        List<TaskStatisticVo> list = cockpitMapper.drill(date, DateUtil.endOfDay(new Date()), dto.getOrgPath());
 | 
											
												
													
														|  | 
 |  | +        list = taskStatistic(list, dto.getOrgId());
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        List<WebDrillInfoVo> r = list.stream().map(i -> {
 | 
											
												
													
														|  | 
 |  | +            WebDrillInfoVo vo = new WebDrillInfoVo();
 | 
											
												
													
														|  | 
 |  | +            vo.setOrgName(i.getOrgName());
 | 
											
												
													
														|  | 
 |  | +            vo.setTotal((int) i.getTaskTotal());
 | 
											
												
													
														|  | 
 |  | +            vo.setCompletedRate(i.getCompletedRate());
 | 
											
												
													
														|  | 
 |  | +            return vo;
 | 
											
												
													
														|  | 
 |  | +        }).collect(Collectors.toList());
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        return r;
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      @Override
 |  |      @Override
 | 
											
												
													
														|  | -    public List<OrgGA38StatisticVo> orgGA38(Long orgId) {
 |  | 
 | 
											
												
													
														|  | -        List<OrgGA38StatisticVo> data = cockpitMapper.orgGA38(orgId);
 |  | 
 | 
											
												
													
														|  | -        List<OrgGA38StatisticVo> r = getGA38Children(orgId);
 |  | 
 | 
											
												
													
														|  | -        for (OrgGA38StatisticVo orgVo : data) {
 |  | 
 | 
											
												
													
														|  | 
 |  | +    public List<OrgGA38StatisticVo> orgGA38(TaskStatisticDto dto) {
 | 
											
												
													
														|  | 
 |  | +        Date date = getStartDate(dto.getPeriod());
 | 
											
												
													
														|  | 
 |  | +        SysOrg org = remoteOrgService.selectOrgById(dto.getOrgId(), SecurityConstants.INNER);
 | 
											
												
													
														|  | 
 |  | +        List<WebGA38InfoDto> data = cockpitMapper.orgGA38(org.getPath(), date);
 | 
											
												
													
														|  | 
 |  | +        List<OrgGA38StatisticVo> r = getGA38Children(dto.getOrgId());
 | 
											
												
													
														|  | 
 |  | +        for (WebGA38InfoDto orgVo : data) {
 | 
											
												
													
														|  |              for (OrgGA38StatisticVo statisticVo : r) {
 |  |              for (OrgGA38StatisticVo statisticVo : r) {
 | 
											
												
													
														|  | -                if (orgVo.getOrgPath().startsWith(statisticVo.getOrgPath())) {
 |  | 
 | 
											
												
													
														|  | 
 |  | +                if (orgVo.getPath().startsWith(statisticVo.getOrgPath())) {
 | 
											
												
													
														|  |                      statisticVo.setTotal(1 + statisticVo.getTotal());
 |  |                      statisticVo.setTotal(1 + statisticVo.getTotal());
 | 
											
												
													
														|  | -                    statisticVo.setReachCount(orgVo.getReachCount() + statisticVo.getReachCount());
 |  | 
 | 
											
												
													
														|  | 
 |  | +                    statisticVo.setGa382021(1 + statisticVo.getGa382021());
 | 
											
												
													
														|  | 
 |  | +                    statisticVo.setGa382021(1 + statisticVo.getGa382021());
 | 
											
												
													
														|  | 
 |  | +                    if (statisticVo.getGa382021() > 0 || statisticVo.getGa382015() > 0) {
 | 
											
												
													
														|  | 
 |  | +                        statisticVo.setReachCount(1 + statisticVo.getReachCount());
 | 
											
												
													
														|  | 
 |  | +                    }
 | 
											
												
													
														|  | 
 |  | +//                    statisticVo.setReachCount(orgVo.getReachCount() + statisticVo.getReachCount());
 | 
											
												
													
														|  |                  }
 |  |                  }
 | 
											
												
													
														|  |              }
 |  |              }
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |          r.forEach(i -> {
 |  |          r.forEach(i -> {
 | 
											
												
													
														|  | -            if (ObjectUtil.equal(i.getTotal(), 0F)) {
 |  | 
 | 
											
												
													
														|  | -                i.setReachRate(1F);
 |  | 
 | 
											
												
													
														|  | -            } else {
 |  | 
 | 
											
												
													
														|  | -                i.setReachRate(i.getReachCount() / i.getTotal());
 |  | 
 | 
											
												
													
														|  | -            }
 |  | 
 | 
											
												
													
														|  | 
 |  | +            i.setReachRate(NumberUtils.computeRate(i.getTotal(), i.getReachCount()));
 | 
											
												
													
														|  |          });
 |  |          });
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |          r.sort(new Comparator<OrgGA38StatisticVo>() {
 |  |          r.sort(new Comparator<OrgGA38StatisticVo>() {
 | 
											
												
													
														|  |              @Override
 |  |              @Override
 | 
											
												
													
														|  |              public int compare(OrgGA38StatisticVo o1, OrgGA38StatisticVo o2) {
 |  |              public int compare(OrgGA38StatisticVo o1, OrgGA38StatisticVo o2) {
 | 
											
												
													
														|  | -                return NumberUtil.compare(o2.getReachRate(),o1.getReachRate());
 |  | 
 | 
											
												
													
														|  | 
 |  | +                return -NumberUtil.compare(o2.getReachRate(), o1.getReachRate());
 | 
											
												
													
														|  |              }
 |  |              }
 | 
											
												
													
														|  |          });
 |  |          });
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |          return r;
 |  |          return r;
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +    /**
 | 
											
												
													
														|  | 
 |  | +     * 机构信息
 | 
											
												
													
														|  | 
 |  | +     *
 | 
											
												
													
														|  | 
 |  | +     * @return
 | 
											
												
													
														|  | 
 |  | +     */
 | 
											
												
													
														|  | 
 |  | +    @Override
 | 
											
												
													
														|  | 
 |  | +    public OrgInfoVo orgInfo(String orgPath) {
 | 
											
												
													
														|  | 
 |  | +        return cockpitMapper.orgInfo(orgPath);
 | 
											
												
													
														|  | 
 |  | +    }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +    /**
 | 
											
												
													
														|  | 
 |  | +     * 本月来访
 | 
											
												
													
														|  | 
 |  | +     *
 | 
											
												
													
														|  | 
 |  | +     * @param orgPath
 | 
											
												
													
														|  | 
 |  | +     * @return
 | 
											
												
													
														|  | 
 |  | +     */
 | 
											
												
													
														|  | 
 |  | +    @Override
 | 
											
												
													
														|  | 
 |  | +    public VisitInfoVo currentMonthVisitInfo(String orgPath) {
 | 
											
												
													
														|  | 
 |  | +        DateRange range = DateUtils.getStartAndEnd(new Date(), CycleCommonEnum.MONTHLY);
 | 
											
												
													
														|  | 
 |  | +        VisitInfoVo vo = cockpitMapper.currentMonthVisitInfo(orgPath, range.getStartTime());
 | 
											
												
													
														|  | 
 |  | +        int total = vo.getPaperCount() + vo.getElectronicCount() + vo.getUrgencyCount();
 | 
											
												
													
														|  | 
 |  | +        vo.setElectronicRate(NumberUtils.computeRate(total, vo.getElectronicCount()));
 | 
											
												
													
														|  | 
 |  | +        vo.setUrgencyRate(NumberUtils.computeRate(total, vo.getUrgencyCount()));
 | 
											
												
													
														|  | 
 |  | +        vo.setPaperRate(NumberUtils.computeRate(total, vo.getPaperCount()));
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        return vo;
 | 
											
												
													
														|  | 
 |  | +    }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |      @Override
 |  |      @Override
 | 
											
												
													
														|  |      public QuestionStatisticVo question(TaskStatisticDto dto) {
 |  |      public QuestionStatisticVo question(TaskStatisticDto dto) {
 | 
											
												
													
														|  |          Date date = getStartDate(dto.getPeriod());
 |  |          Date date = getStartDate(dto.getPeriod());
 | 
											
												
													
														|  | -        String orgPath = remoteOrgService.selectOrgById(dto.getOrgId(), SecurityConstants.INNER).getPath();
 |  | 
 | 
											
												
													
														|  | -        return cockpitMapper.question(date, orgPath);
 |  | 
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        WebSyntheticQuestionDto questionDto = cockpitMapper.selectQuestion(dto.getOrgPath(), date);
 | 
											
												
													
														|  | 
 |  | +        if (ObjectUtil.isNull(questionDto)) {
 | 
											
												
													
														|  | 
 |  | +            questionDto = new WebSyntheticQuestionDto();
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  | 
 |  | +        Map<String, Integer> overdueCount = cockpitMapper.selectOverDueQuestionCount(dto.getOrgPath(), date);
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        QuestionStatisticVo vo = new QuestionStatisticVo();
 | 
											
												
													
														|  | 
 |  | +        vo.setTotal(questionDto.getTotal());
 | 
											
												
													
														|  | 
 |  | +        vo.setUnconfirm(NumberUtils.computeRate(questionDto.getTotal(), questionDto.getUnconfirmedCount()));
 | 
											
												
													
														|  | 
 |  | +        vo.setDissent(NumberUtils.computeRate(questionDto.getTotal(), questionDto.getDissentCount()));
 | 
											
												
													
														|  | 
 |  | +        vo.setClosed(NumberUtils.computeRate(questionDto.getTotal(), questionDto.getClosedCount()));
 | 
											
												
													
														|  | 
 |  | +        vo.setUnreform(NumberUtils.computeRate(questionDto.getTotal(), questionDto.getUnconfirmedCount()));
 | 
											
												
													
														|  | 
 |  | +        vo.setReformed(NumberUtils.computeRate(questionDto.getTotal(), questionDto.getReformedCount()));
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        if (overdueCount.size() > 0) {
 | 
											
												
													
														|  | 
 |  | +            vo.setClosed(NumberUtils.computeRate(overdueCount.get("total"), overdueCount.get("overdueCount")));
 | 
											
												
													
														|  | 
 |  | +        } else {
 | 
											
												
													
														|  | 
 |  | +            vo.setClosed(1f);
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        return vo;
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -    private List<TaskStatisticVo> taskStatistic(List<TaskStatisticVo> data, TaskStatisticDto dto,SysOrg org) {
 |  | 
 | 
											
												
													
														|  | -        List<TaskStatisticVo> r = getTaskChildren(org);
 |  | 
 | 
											
												
													
														|  | 
 |  | +    private List<TaskStatisticVo> taskStatistic(List<TaskStatisticVo> data, Long orgId) {
 | 
											
												
													
														|  | 
 |  | +        List<TaskStatisticVo> r = getTaskChildren(orgId);
 | 
											
												
													
														|  |          for (TaskStatisticVo orgVo : data) {
 |  |          for (TaskStatisticVo orgVo : data) {
 | 
											
												
													
														|  |              for (TaskStatisticVo statisticVo : r) {
 |  |              for (TaskStatisticVo statisticVo : r) {
 | 
											
												
													
														|  |                  if (orgVo.getOrgPath().startsWith(statisticVo.getOrgPath())) {
 |  |                  if (orgVo.getOrgPath().startsWith(statisticVo.getOrgPath())) {
 | 
											
										
											
												
													
														|  | @@ -150,15 +239,25 @@ public class CockpitServiceImpl implements CockpitService {
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -    private List<TaskStatisticVo> getTaskChildren(SysOrg org) {
 |  | 
 | 
											
												
													
														|  | -        List<SysOrg> children=remoteOrgService.selectOrgTreeListByCurOrgId(org.getId(), SecurityConstants.INNER);
 |  | 
 | 
											
												
													
														|  | 
 |  | +    private DateRange getStartAndEnd(Integer period) {
 | 
											
												
													
														|  | 
 |  | +        Date start = getStartDate(period);
 | 
											
												
													
														|  | 
 |  | +        Date end = DateUtil.endOfDay(new Date());
 | 
											
												
													
														|  | 
 |  | +        return new DateRange(start, end);
 | 
											
												
													
														|  | 
 |  | +    }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +    private List<TaskStatisticVo> getTaskChildren(Long orgId) {
 | 
											
												
													
														|  | 
 |  | +        List<SysOrg> children = remoteOrgService.selectOrgTreeListByCurOrgId(orgId, SecurityConstants.INNER);
 | 
											
												
													
														|  |          List<TaskStatisticVo> list = new ArrayList<>();
 |  |          List<TaskStatisticVo> list = new ArrayList<>();
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |          for (SysOrg child : children) {
 |  |          for (SysOrg child : children) {
 | 
											
												
													
														|  |              TaskStatisticVo vo = new TaskStatisticVo();
 |  |              TaskStatisticVo vo = new TaskStatisticVo();
 | 
											
												
													
														|  |              vo.setOrgPath(child.getPath());
 |  |              vo.setOrgPath(child.getPath());
 | 
											
												
													
														|  |              vo.setOrgId(child.getId());
 |  |              vo.setOrgId(child.getId());
 | 
											
												
													
														|  | -            vo.setOrgName(child.getName());
 |  | 
 | 
											
												
													
														|  | 
 |  | +            if (StringUtils.isEmpty(child.getBreviary())) {
 | 
											
												
													
														|  | 
 |  | +                vo.setOrgName(child.getShortName());
 | 
											
												
													
														|  | 
 |  | +            } else {
 | 
											
												
													
														|  | 
 |  | +                vo.setOrgName(child.getBreviary());
 | 
											
												
													
														|  | 
 |  | +            }
 | 
											
												
													
														|  |              vo.setTaskTotal(0F);
 |  |              vo.setTaskTotal(0F);
 | 
											
												
													
														|  |              vo.setCompletedCount(0F);
 |  |              vo.setCompletedCount(0F);
 | 
											
												
													
														|  |              list.add(vo);
 |  |              list.add(vo);
 | 
											
										
											
												
													
														|  | @@ -168,15 +267,20 @@ public class CockpitServiceImpl implements CockpitService {
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      private List<OrgGA38StatisticVo> getGA38Children(Long orgId) {
 |  |      private List<OrgGA38StatisticVo> getGA38Children(Long orgId) {
 | 
											
												
													
														|  | -        List<SysOrg> children=remoteOrgService.selectOrgTreeListByCurOrgId(orgId, SecurityConstants.INNER);
 |  | 
 | 
											
												
													
														|  | 
 |  | +        List<SysOrg> children = remoteOrgService.selectOrgTreeListByCurOrgId(orgId, SecurityConstants.INNER);
 | 
											
												
													
														|  |          List<OrgGA38StatisticVo> list = new ArrayList<>();
 |  |          List<OrgGA38StatisticVo> list = new ArrayList<>();
 | 
											
												
													
														|  |          for (SysOrg child : children) {
 |  |          for (SysOrg child : children) {
 | 
											
												
													
														|  |              OrgGA38StatisticVo vo = new OrgGA38StatisticVo();
 |  |              OrgGA38StatisticVo vo = new OrgGA38StatisticVo();
 | 
											
												
													
														|  |              vo.setOrgPath(child.getPath());
 |  |              vo.setOrgPath(child.getPath());
 | 
											
												
													
														|  |              vo.setOrgId(child.getId());
 |  |              vo.setOrgId(child.getId());
 | 
											
												
													
														|  | -            vo.setOrgName(child.getName());
 |  | 
 | 
											
												
													
														|  | -            vo.setTotal(0F);
 |  | 
 | 
											
												
													
														|  | -            vo.setReachCount(0F);
 |  | 
 | 
											
												
													
														|  | 
 |  | +            if (StringUtils.isEmpty(child.getBreviary())) {
 | 
											
												
													
														|  | 
 |  | +                vo.setOrgName(child.getShortName());
 | 
											
												
													
														|  | 
 |  | +            } else {
 | 
											
												
													
														|  | 
 |  | +                vo.setOrgName(child.getBreviary());
 | 
											
												
													
														|  | 
 |  | +            }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +            vo.setTotal(0);
 | 
											
												
													
														|  | 
 |  | +            vo.setReachCount(0);
 | 
											
												
													
														|  |              list.add(vo);
 |  |              list.add(vo);
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |  
 |  |  
 |