| | |
| | | count.setPedigreeChartId(parent.getId()); |
| | | count.setId(null); |
| | | if (parent.getStatus()==1){ |
| | | count.setAuditStatus(0); |
| | | count.setAuditStatus(1); |
| | | }else{ |
| | | count.setAuditStatus(1); |
| | | } |
| | |
| | | TPedigreeChartParentTwoCountDTO childCount = count1List.get(0); |
| | | childCount.setType(2); |
| | | if (parent.getStatus()==1){ |
| | | count.setAuditStatus(0); |
| | | childCount.setAuditStatus(1); |
| | | }else{ |
| | | count.setAuditStatus(1); |
| | | childCount.setAuditStatus(1); |
| | | } |
| | | count.setVaccinateId(loginUser.getUserId()+""); |
| | | count.setVaccinateTime(LocalDateTime.now()); |
| | | childCount.setVaccinateId(loginUser.getUserId()+""); |
| | | childCount.setVaccinateTime(LocalDateTime.now()); |
| | | childCount.setParentId(tPedigreeChartParentTwoDTO.getId()); |
| | | childCount.setPedigreeChartId(parent.getId()); |
| | | childCount.setStatus(1); |
| | |
| | | Integer status = parent.getStatus(); |
| | | TPedigreeChart pedigreeChart = pedigreeChartService.getById(parent.getId()); |
| | | if (pedigreeChart.getStatus() == 2){ |
| | | parent.setStatus(2); |
| | | return R.fail("谱系图已提交,不可编辑"); |
| | | } |
| | | pedigreeChartService.updateById(parent); |
| | | parent.setStatus( status); |
| | |
| | | count.setStatus(1); |
| | | if (count.getId()==null){ |
| | | if (parent.getStatus()==1){ |
| | | count.setAuditStatus(0); |
| | | count.setAuditStatus(1); |
| | | count.setCodeStatus(parent.getStatus()); |
| | | }else{ |
| | | count.setAuditStatus(1); |
| | |
| | | childCount.setType(2); |
| | | if (childCount.getId()==null){ |
| | | if (parent.getStatus()==1){ |
| | | childCount.setAuditStatus(0); |
| | | childCount.setAuditStatus(1); |
| | | childCount.setCodeStatus(parent.getStatus()); |
| | | }else{ |
| | | childCount.setAuditStatus(1); |
| | |
| | | .eq(TProjectTeam::getStatus, 1) |
| | | .orderByDesc(BaseModel::getCreateTime).last("limit 1").one(); |
| | | TProjectTeamStaff projectTeamStaff = projectTeamStaffService.lambdaQuery() |
| | | .eq(TProjectTeamStaff::getTeamId, team.getId()).eq(TProjectTeamStaff::getRoleType, 1).one(); |
| | | .eq(TProjectTeamStaff::getTeamId, team.getId()).eq(TProjectTeamStaff::getRoleType, 2).one(); |
| | | tNotice.setCommitId(tokenService.getLoginUser().getUserId()+""); |
| | | tNotice.setUserId(projectTeamStaff.getUserId()); |
| | | tNotice.setStatus(1); |
| | |
| | | public R<TPedigreeChart> getDetailInfoById(@RequestParam String id) { |
| | | List<TPedigreeChartParentOneDTO> tPedigreeChartParentOneDTOS = new ArrayList<>(); |
| | | TPedigreeChart pedigreeChart = pedigreeChartService.getById(id); |
| | | List<TPedigreeChartDetail> details = pedigreeChartDetailService.lambdaQuery().eq(TPedigreeChartDetail::getPedigreeChartId, id).list(); |
| | | if (pedigreeChart == null) { |
| | | return R.fail("谱系图不存在或已删除"); |
| | | } |
| | | List<TPedigreeChartDetail> details = new ArrayList<>(pedigreeChartDetailService.lambdaQuery() |
| | | .eq(TPedigreeChartDetail::getPedigreeChartId, id) |
| | | .orderByDesc(TPedigreeChartDetail::getUpdateTime) |
| | | .orderByDesc(TPedigreeChartDetail::getCreateTime) |
| | | .list().stream() |
| | | .filter(detail -> StringUtils.isNotEmpty(detail.getId())) |
| | | .collect(Collectors.toMap( |
| | | TPedigreeChartDetail::getId, |
| | | detail -> detail, |
| | | (first, duplicate) -> first, |
| | | LinkedHashMap::new |
| | | )).values()); |
| | | TPedigreeChartParentAllDetailDTO tPedigreeChartParentAllDetailDTO = new TPedigreeChartParentAllDetailDTO(); |
| | | // 祖代 |
| | | TPedigreeChartDetail pedigreeChartDetail = details.stream().filter(e -> e.getParentId().equals("0") |
| | |
| | | List<TPedigreeChartDetail> childs = details.stream().filter(e -> e.getParentId().equals(tPedigreeChartParentOneCountDTO.getId()) |
| | | && e.getType() == 1).collect(Collectors.toList()); |
| | | List<TPedigreeChartParentTwoDTO> tPedigreeChartParentTwoDTOS = new ArrayList<>(); |
| | | List<TPedigreeChartParentThreeDTO> tPedigreeChartParentThreeDTOS = new ArrayList<>(); |
| | | for (TPedigreeChartDetail tPedigreeChartDetail : childs) { |
| | | TPedigreeChartParentTwoDTO tPedigreeChartParentTwoDTO = new TPedigreeChartParentTwoDTO(); |
| | | BeanUtils.copyProperties(tPedigreeChartDetail,tPedigreeChartParentTwoDTO); |
| | |
| | | ArrayList<TPedigreeChartParentTwoCountDTO> tPedigreeChartParentTwoCountDTOS = new ArrayList<>(); |
| | | TPedigreeChartParentTwoCountDTO tPedigreeChartParentTwoCountDTO = new TPedigreeChartParentTwoCountDTO(); |
| | | BeanUtils.copyProperties(childCountChild,tPedigreeChartParentTwoCountDTO); |
| | | List<TPedigreeChartParentThreeDTO> tPedigreeChartParentThreeDTOS = new ArrayList<>(); |
| | | List<TPedigreeChartDetail> childChilds = details.stream().filter(e -> e.getParentId().equals(tPedigreeChartParentTwoCountDTO.getId()) |
| | | && e.getType() == 1).collect(Collectors.toList()); |
| | | for (TPedigreeChartDetail chartDetail : childChilds) { |
| | |
| | | pedigreeChartDetail1.setType(2); |
| | | |
| | | pedigreeChartDetail1.setCodeStatus(dto.getCodeStatus()); |
| | | if (dto.getCodeStatus()==1){ |
| | | pedigreeChartDetail1.setAuditStatus(0); |
| | | }else{ |
| | | pedigreeChartDetail1.setAuditStatus(1); |
| | | } |
| | | pedigreeChartDetail1.setAuditStatus(1); |
| | | pedigreeChartDetailService.save(pedigreeChartDetail1); |
| | | return R.ok(); |
| | | } |