| | |
| | | package com.gkhy.safePlatform.targetDuty.service.impl; |
| | | import java.sql.Timestamp; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.metadata.OrderItem; |
| | | import com.baomidou.mybatisplus.core.toolkit.BeanUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.gkhy.safePlatform.account.rpc.apimodel.AccountDepartmentService; |
| | | import com.gkhy.safePlatform.account.rpc.apimodel.model.resp.DepInfoRPCRespDTO; |
| | | import com.gkhy.safePlatform.targetDuty.entity.ExamineItem; |
| | | import com.gkhy.safePlatform.targetDuty.entity.TargetDutyWorkApprove; |
| | | import com.gkhy.safePlatform.targetDuty.entity.TargetType; |
| | | import com.gkhy.safePlatform.commons.enums.ResultCodes; |
| | | import com.gkhy.safePlatform.commons.query.PageQuery; |
| | | 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.*; |
| | | 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.WorkApproveRelateDesc; |
| | | import com.gkhy.safePlatform.targetDuty.repository.TargetDutyWorkApproveRepository; |
| | | import com.gkhy.safePlatform.targetDuty.repository.TargetMngRepository; |
| | | import com.gkhy.safePlatform.targetDuty.entity.TargetMng; |
| | | import com.gkhy.safePlatform.targetDuty.repository.TargetTypeRepository; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.resp.TargetMngDto; |
| | | 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; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.gkhy.safePlatform.commons.enums.ResultCodes; |
| | | import com.gkhy.safePlatform.commons.query.PageQuery; |
| | | import com.gkhy.safePlatform.commons.vo.ResultVO; |
| | | import com.gkhy.safePlatform.commons.vo.SearchResultVO; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.req.TargetMngQueryCriteria; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.resp.TargetMngDto; |
| | | import com.gkhy.safePlatform.targetDuty.utils.BeanToMapUtil; |
| | | import com.gkhy.safePlatform.targetDuty.utils.QueryHelpPlus; |
| | | import com.gkhy.safePlatform.commons.utils.BeanCopyUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.beans.IntrospectionException; |
| | | import java.io.Serializable; |
| | | import java.lang.reflect.InvocationTargetException; |
| | | import java.util.*; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | |
| | | @Resource |
| | | private TargetDivideDetailService targetDivideDetailService; |
| | | |
| | | @Autowired |
| | | private TargetDivideDetailRepository targetDivideDetailRepository; |
| | | |
| | | @Resource |
| | | private TargetDutyWorkApproveRepository targetDutyWorkApproveRepository; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private TargetTypeRepository targetTypeRepository; |
| | | |
| | | @Override |
| | | |
| | | @Autowired |
| | | private TargetExamineRepository targetExamineRepository; |
| | | |
| | | @Override |
| | | public ResultVO queryAll(PageQuery<TargetMngQueryCriteria> pageQuery) { |
| | | Long pageIndex = pageQuery.getPageIndex(); |
| | | Long pageSize = pageQuery.getPageSize(); |
| | |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | // --------------------------- 获取考核结果----------------------- |
| | | //收集所用到的分解详情ID |
| | | Set<Long> collectExamResultSet = new HashSet(); |
| | | respList.forEach(f->{ |
| | | collectExamResultSet.add(f.getId()); |
| | | }); |
| | | //获取核结果集合 |
| | | if(!collectExamResultSet.isEmpty()){ |
| | | List<TargetExamine> typeList = targetExamineRepository.selectList(new QueryWrapper<TargetExamine>().in("target_divide_detail_id",collectExamResultSet)); |
| | | Map<Long,TargetExamine> examResultMap = typeList.stream() |
| | | .collect(Collectors.toMap(TargetExamine::getTargetDivideDetailId, Function.identity(),(k1, k2)->k1)); |
| | | |
| | | respList.forEach(f->{ |
| | | TargetExamine targetExamine = examResultMap.get(f.getId()); |
| | | if(targetExamine != null){ |
| | | f.setExamineResult(targetExamine.getExamineResult()); |
| | | f.setExamineDate(targetExamine.getExamineDate()); |
| | | f.setExaminePersonId(targetExamine.getExaminePersonId()); |
| | | f.setExaminePersonName(targetExamine.getExaminePersonName()); |
| | | } |
| | | |
| | | }); |
| | | } |
| | | |
| | | targetMngDto.setTargetDivideDetailList(respList); |
| | | return targetMngDto; |
| | | } |
| | |
| | | ); |
| | | } |
| | | |
| | | @Override |
| | | public Object statistics(TargetMngQueryCriteria criteria) { |
| | | Map<String,String> map = new HashMap<>(); |
| | | // 查询总数 |
| | | Integer total = 0; |
| | | // 未完成数量 |
| | | Integer complete=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 noComplete = total-complete; |
| | | map.put("total",total+""); |
| | | map.put("noComplete",noComplete+""); |
| | | map.put("complete",complete+""); |
| | | return map; |
| | | } |
| | | |
| | | |
| | | |
| | | } |