| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.gkhy.safePlatform.targetDuty.entity.ExamineItem; |
| | | import com.gkhy.safePlatform.targetDuty.entity.TargetMng; |
| | | import com.gkhy.safePlatform.targetDuty.enums.TargetDutyResultCodes; |
| | | import com.gkhy.safePlatform.targetDuty.excepiton.TargetDutyException; |
| | |
| | | return new SearchResultVO<>( |
| | | true, |
| | | pageIndex, |
| | | pageSize, |
| | | pageSize,page.getPages(), |
| | | page.getTotal(), |
| | | respList, |
| | | ResultCodes.OK |
| | |
| | | |
| | | //保存主数据 |
| | | //如果目标指标已经被分解,那么就不能再次增加 |
| | | if(targetMng.getDivideStatus() == 1){ |
| | | if(targetMng.getDivideStatus() == 1 && infoDto.getTargetId() == null){ |
| | | throw new TargetDutyException(TargetDutyResultCodes.E2); |
| | | } |
| | | |
| | |
| | | list.forEach(f->{f.setTargetId(infoDto.getTargetId());}); |
| | | this.saveOrUpdateBatch(list); |
| | | |
| | | //设置状态为 《已分解》 |
| | | targetMng.setDivideStatus(1); |
| | | //查询最新的分解数量,如果>0,设置状态为 《已分解》,否则设置为未分解 |
| | | int divideStatus = 2; |
| | | if(infoDto.getTargetId() != null){ |
| | | long number = this.count(new QueryWrapper<TargetDivideDetail>().eq("target_id",infoDto.getTargetId())); |
| | | if(number > 0){ |
| | | divideStatus = 1; |
| | | } |
| | | } |
| | | targetMng.setDivideStatus(divideStatus); |
| | | targetMngRepository.update(targetMng,new UpdateWrapper<TargetMng>().eq("id",targetMng.getId())); |
| | | |
| | | |