| | |
| | | import com.gkhy.safePlatform.commons.utils.BeanCopyUtils; |
| | | import com.gkhy.safePlatform.commons.vo.ResultVO; |
| | | import com.gkhy.safePlatform.commons.vo.SearchResultVO; |
| | | import com.gkhy.safePlatform.targetDuty.entity.TargetDutyWorkApprove; |
| | | import com.gkhy.safePlatform.targetDuty.entity.TargetExamine; |
| | | import com.gkhy.safePlatform.targetDuty.entity.TargetMng; |
| | | import com.gkhy.safePlatform.targetDuty.entity.TargetType; |
| | | import com.gkhy.safePlatform.targetDuty.entity.*; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.req.TargetCheckAndSubmitQueryCriteria; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.req.TargetDivideDetailQueryCriteria; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.req.TargetMngQueryCriteria; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.resp.TargetCheckAndSubmitDto; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.resp.TargetDivideDetailDto; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.resp.TargetMngDto; |
| | | import com.gkhy.safePlatform.targetDuty.repository.TargetDutyWorkApproveRepository; |
| | | import com.gkhy.safePlatform.targetDuty.repository.TargetExamineRepository; |
| | | import com.gkhy.safePlatform.targetDuty.repository.TargetMngRepository; |
| | | import com.gkhy.safePlatform.targetDuty.repository.TargetTypeRepository; |
| | | import com.gkhy.safePlatform.targetDuty.repository.*; |
| | | import com.gkhy.safePlatform.targetDuty.service.CommonService; |
| | | import com.gkhy.safePlatform.targetDuty.service.TargetDivideDetailService; |
| | | import com.gkhy.safePlatform.targetDuty.service.TargetMngService; |
| | |
| | | |
| | | @Resource |
| | | private TargetDivideDetailService targetDivideDetailService; |
| | | |
| | | @Autowired |
| | | private TargetDivideDetailRepository targetDivideDetailRepository; |
| | | |
| | | @Resource |
| | | private TargetDutyWorkApproveRepository targetDutyWorkApproveRepository; |
| | |
| | | public Object statistics(TargetMngQueryCriteria criteria) { |
| | | Map<String,String> map = new HashMap<>(); |
| | | // 查询总数 |
| | | Integer total = null; |
| | | try { |
| | | total = targetMngRepository.selectTotal(BeanToMapUtil.convertBean(criteria)); |
| | | //未完成数量 |
| | | Integer noComplete = targetMngRepository.selectNoComplete(BeanToMapUtil.convertBean(criteria)); |
| | | Integer total = 0; |
| | | // 未完成数量 |
| | | Integer complete=0; |
| | | |
| | | |
| | | |
| | | if(noComplete == null){ |
| | | noComplete = 0; |
| | | // 查询目标已分解且事件类型对一个的目标 |
| | | List<TargetMng> targetMngList = targetMngRepository.selectList( |
| | | new QueryWrapper<TargetMng>() |
| | | .eq("target_type",criteria.getTargetType()) |
| | | .eq("divide_status",1) |
| | | ); |
| | | if (!targetMngList.isEmpty()){ |
| | | total = targetMngList.size(); |
| | | // 查询目标下的所有分解项 |
| | | for (TargetMng targetMng : targetMngList){ |
| | | Boolean completeFlag = true; |
| | | List<TargetDivideDetail> targetDivideDetailList = targetDivideDetailRepository.selectList( |
| | | new QueryWrapper<TargetDivideDetail>() |
| | | .eq("target_id",targetMng.getId()) |
| | | ); |
| | | if (!targetDivideDetailList.isEmpty()){ |
| | | // 查询分解项 是否已经审核通过 |
| | | for (TargetDivideDetail targetDivideDetail :targetDivideDetailList){ |
| | | List<TargetExamine> targetExamineList = targetExamineRepository.selectList( |
| | | new QueryWrapper<TargetExamine>() |
| | | .eq("target_divide_detail_id",targetDivideDetail.getId()) |
| | | .eq("examine_result",1) |
| | | ); |
| | | if (targetExamineList.isEmpty()){ |
| | | completeFlag=false; |
| | | } |
| | | } |
| | | } |
| | | // 该目标中有未评价的或者不合格的 |
| | | if (completeFlag){ |
| | | complete++; |
| | | } |
| | | } |
| | | //已完成数 |
| | | int complete = total-noComplete; |
| | | |
| | | map.put("total",total+""); |
| | | map.put("noComplete",noComplete+""); |
| | | map.put("complete",complete+""); |
| | | return map; |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | //已完成数 |
| | | int noComplete = total-complete; |
| | | map.put("total",total+""); |
| | | map.put("noComplete",noComplete+""); |
| | | map.put("complete",complete+""); |
| | | return map; |
| | | } |
| | | |