package com.ruoyi.web.controller.api;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.ruoyi.common.core.domain.BaseModel;
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
import com.ruoyi.common.core.domain.model.LoginUser;
|
import com.ruoyi.system.dto.TConfirmBreedingAndPreservationDTO;
|
import com.ruoyi.system.mapper.TProjectTeamMapper;
|
import com.ruoyi.system.model.*;
|
|
import java.util.ArrayList;
|
import java.util.List;
|
|
|
import com.alibaba.fastjson.JSON;
|
import com.ruoyi.common.annotation.Log;
|
import com.ruoyi.common.basic.PageInfo;
|
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.common.enums.BusinessType;
|
import com.ruoyi.framework.web.service.TokenService;
|
import com.ruoyi.system.dto.TBreedingAndPreservationDTO;
|
import com.ruoyi.system.dto.TTrainLibraryDTO;
|
import com.ruoyi.system.query.TBreedingAndPreservationQuery;
|
import com.ruoyi.system.query.TPedigreeChartConfirmQuery;
|
import com.ruoyi.system.query.TPedigreeChartQuery;
|
import com.ruoyi.system.service.*;
|
import com.ruoyi.system.vo.TBreedingAndPreservationDetailVO;
|
import com.ruoyi.system.vo.TBreedingAndPreservationVO;
|
import com.ruoyi.system.vo.TPedigreeChartVO;
|
import com.ruoyi.system.vo.TProjectTeamVO;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import org.springframework.beans.BeanUtils;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.util.StringUtils;
|
import org.springframework.web.bind.annotation.*;
|
|
import javax.annotation.Resource;
|
import java.time.LocalDateTime;
|
import java.util.Random;
|
import java.util.stream.Collectors;
|
|
/**
|
* <p>
|
* 菌种选育保藏记录 前端控制器
|
* </p>
|
*
|
* @author 无关风月
|
* @since 2025-04-12
|
*/
|
@RestController
|
@RequestMapping("")
|
@Api(tags = "菌种选育保藏记录")
|
public class TBreedingAndPreservationController {
|
@Resource
|
private TBreedingAndPreservationService breedingAndPreservationService;
|
@Resource
|
private TCulturePreservationService culturePreservationService;
|
@Resource
|
private TObservationOfPetriDishesService observationOfPetriDishesService;
|
@Resource
|
private TVaccinationSlopeService vaccinationSlopeService;
|
@Resource
|
private TSeparationOfCultureDishesService separationOfCultureDishesService;
|
@Resource
|
private TokenService tokenService;
|
@Resource
|
private ISysUserService sysUserService;
|
|
/**
|
* 菌种选育保藏记录分页列表
|
*/
|
//@PreAuthorize("@ss.hasPermi('system:breedingAndPreservation:list')")
|
@ApiOperation(value = "菌种选育保藏记录-获取菌种选育保藏记录分页列表",response = TBreedingAndPreservationQuery.class)
|
@PostMapping(value = "/api/t-breeding-and-preservation/pageList")
|
public R<PageInfo<TBreedingAndPreservationVO>> pageList(@RequestBody String param) {
|
|
TBreedingAndPreservationQuery query = JSON.parseObject(param, TBreedingAndPreservationQuery.class);
|
SysUser sysUser = sysUserService.selectUserById(tokenService.getLoginUser().getUserId());
|
if (sysUser.getRoleType().equals("2")){
|
List<String> allProjectIds = projectTeamStaffService.lambdaQuery().eq(TProjectTeamStaff::getUserId, tokenService.getLoginUser().getUserId())
|
.list().stream().map(TProjectTeamStaff::getTeamId).collect(Collectors.toList());
|
if (!allProjectIds.isEmpty()){ List<String> projectIds = projectTeamService.lambdaQuery().in(TProjectTeam::getId, allProjectIds)
|
.list().stream().map(TProjectTeam::getId).collect(Collectors.toList());
|
|
if (projectIds.isEmpty()){
|
return R.ok(new PageInfo<>());
|
}
|
query.setProjectIds(projectIds);
|
}else {
|
return R.ok(new PageInfo<>());
|
}
|
}else if (!sysUser.getRoleType().equals("1")){
|
if (query.getProjectIds() == null || query.getProjectIds().isEmpty()){
|
List<String> allProjectIds = projectTeamStaffService.lambdaQuery().eq(TProjectTeamStaff::getUserId, tokenService.getLoginUser().getUserId())
|
.list().stream().map(TProjectTeamStaff::getTeamId).collect(Collectors.toList());
|
if (!allProjectIds.isEmpty()){
|
List<String> projectIds = projectTeamService.lambdaQuery().in(TProjectTeam::getId, allProjectIds)
|
.eq(TProjectTeam::getStatus, 1).list().stream().map(TProjectTeam::getId).collect(Collectors.toList());
|
|
if (projectIds.isEmpty()){
|
return R.ok(new PageInfo<>());
|
}
|
query.setProjectIds(projectIds);
|
}else {
|
return R.ok(new PageInfo<>());
|
}
|
}
|
}
|
|
return R.ok(breedingAndPreservationService.pageList(query));
|
}
|
/**
|
* 新增菌种库
|
*/
|
//@PreAuthorize("@ss.hasPermi('system:breedingAndPreservation:add')")
|
@Log(title = "菌种选育保藏记录-新增选育保藏记录", businessType = BusinessType.INSERT)
|
@ApiOperation(value = "菌种选育保藏记录-新增选育保藏记录",response = TBreedingAndPreservationDTO.class)
|
@PostMapping(value = "/api/t-breeding-and-preservation/add")
|
public R<Boolean> add(@RequestBody String param) {
|
if (tokenService.getLoginUser()==null){
|
return R.fail(401,"登陆失效");
|
}
|
TBreedingAndPreservationDTO dto = JSON.parseObject(param,TBreedingAndPreservationDTO.class);
|
if (dto.getStatus()==1){
|
return R.fail("有菌种待确认,无法提交");
|
}
|
|
if (dto.getStatus()==3){
|
dto.setIsDraft(1);
|
}
|
List<String> projectIds = projectTeamStaffService.lambdaQuery().eq(TProjectTeamStaff::getUserId, tokenService.getLoginUser().getUserId())
|
.list().stream().map(TProjectTeamStaff::getTeamId).collect(Collectors.toList());
|
if (!projectIds.isEmpty()){
|
TProjectTeam projectTeam = projectTeamService.lambdaQuery().in(TProjectTeam::getId, projectIds)
|
.eq(TProjectTeam::getStatus, 1)
|
.orderByDesc(BaseModel::getCreateTime)
|
.last("limit 1").one();
|
dto.setProjectId(projectTeam.getId());
|
}
|
breedingAndPreservationService.save(dto);
|
List<TSeparationOfCultureDishes> separationOfCultureDishesList = dto.getSeparationOfCultureDishesList();
|
for (TSeparationOfCultureDishes tSeparationOfCultureDishes : separationOfCultureDishesList) {
|
tSeparationOfCultureDishes.setBreedingPreserveId(dto.getId());
|
}
|
separationOfCultureDishesService.saveBatch(separationOfCultureDishesList);
|
List<TObservationOfPetriDishes> observationOfPetriDishes = dto.getObservationOfPetriDishes();
|
for (TObservationOfPetriDishes tSeparationOfCultureDishes : observationOfPetriDishes) {
|
tSeparationOfCultureDishes.setBreedingPreserveId(dto.getId());
|
}
|
observationOfPetriDishesService.saveBatch(observationOfPetriDishes);
|
List<TVaccinationSlope> vaccinationSlopes = dto.getVaccinationSlopes();
|
for (TVaccinationSlope tSeparationOfCultureDishes : vaccinationSlopes) {
|
tSeparationOfCultureDishes.setHandleId(tokenService.getLoginUser().getUserId()+"");
|
tSeparationOfCultureDishes.setHandleTime(LocalDateTime.now());
|
tSeparationOfCultureDishes.setBreedingPreserveId(dto.getId());
|
}
|
vaccinationSlopeService.saveBatch(vaccinationSlopes);
|
List<TCulturePreservation> culturePreservations = dto.getCulturePreservations();
|
for (TCulturePreservation tSeparationOfCultureDishes : culturePreservations) {
|
tSeparationOfCultureDishes.setHandleId(tokenService.getLoginUser().getUserId()+"");
|
tSeparationOfCultureDishes.setHandleTime(LocalDateTime.now());
|
tSeparationOfCultureDishes.setBreedingPreserveId(dto.getId());
|
}
|
culturePreservationService.saveBatch(culturePreservations);
|
if (dto.getStatus()!=null&&dto.getStatus()==2){
|
notifyProjectEngineers(dto.getProjectId(), dto.getId(), 5);
|
}
|
return R.ok();
|
}
|
@Resource
|
private TProjectTeamService projectTeamService;
|
@Resource
|
private TProjectTeamStaffService projectTeamStaffService;
|
@Resource
|
private TNoticeService noticeService;
|
@Log(title = "菌种选育保藏记录-编辑选育保藏记录", businessType = BusinessType.UPDATE)
|
@ApiOperation(value = "菌种选育保藏记录-编辑选育保藏记录",response = TBreedingAndPreservationDTO.class)
|
@PostMapping(value = "/api/t-breeding-and-preservation/update")
|
public R<Boolean> update(@RequestBody String param) {
|
if (tokenService.getLoginUser()==null){
|
return R.fail(401,"登陆失效");
|
}
|
TBreedingAndPreservationDTO dto = JSON.parseObject(param,TBreedingAndPreservationDTO.class);
|
if (dto.getStatus()==3){
|
dto.setIsDraft(1);
|
}else{
|
dto.setIsDraft(0);
|
}
|
TBreedingAndPreservation breedingAndPreservationServiceById = breedingAndPreservationService.getById(dto.getId());
|
if (breedingAndPreservationServiceById == null) {
|
return R.fail("记录不存在");
|
}
|
if (breedingAndPreservationServiceById.getStatus()==1){
|
return R.fail("该记录已提交,不可编辑!");
|
}
|
SysUser currentUser = sysUserService.selectUserById(tokenService.getLoginUser().getUserId());
|
if ("3".equals(currentUser.getRoleType())) {
|
return R.fail("菌种工程师只能进行入库确认,不能编辑记录");
|
}
|
List<TVaccinationSlope> vaccinationSlopes = dto.getVaccinationSlopes();
|
List<TCulturePreservation> culturePreservations = dto.getCulturePreservations();
|
if (vaccinationSlopes == null || culturePreservations == null) {
|
return R.fail("接种斜面记录和菌种保藏记录不能为空");
|
}
|
if (dto.getStatus() != null && dto.getStatus() == 1) {
|
if (breedingAndPreservationServiceById.getStatus() == null
|
|| breedingAndPreservationServiceById.getStatus() != 2) {
|
return R.fail("请先同步给保藏人并完成入库确认");
|
}
|
boolean slopeUnconfirmed = vaccinationSlopes.stream().anyMatch(item ->
|
!StringUtils.hasLength(item.getPreserveId()) || !StringUtils.hasLength(item.getPreserveSignature()));
|
boolean preservationUnconfirmed = culturePreservations.stream().anyMatch(item ->
|
!StringUtils.hasLength(item.getPreserveId()) || !StringUtils.hasLength(item.getPreserveSignature()));
|
if (slopeUnconfirmed || preservationUnconfirmed) {
|
return R.fail("存在未确认的接种斜面或菌种保藏记录,不能提交");
|
}
|
}
|
breedingAndPreservationService.updateById(dto);
|
List<TSeparationOfCultureDishes> separationOfCultureDishesList = dto.getSeparationOfCultureDishesList();
|
for (TSeparationOfCultureDishes tSeparationOfCultureDishes : separationOfCultureDishesList) {
|
tSeparationOfCultureDishes.setBreedingPreserveId(dto.getId());
|
}
|
separationOfCultureDishesService.remove(new LambdaQueryWrapper<TSeparationOfCultureDishes>().eq(TSeparationOfCultureDishes::getBreedingPreserveId, dto.getId()));
|
separationOfCultureDishesService.saveBatch(separationOfCultureDishesList);
|
List<TObservationOfPetriDishes> observationOfPetriDishes = dto.getObservationOfPetriDishes();
|
for (TObservationOfPetriDishes observationOfPetriDish : observationOfPetriDishes) {
|
observationOfPetriDish.setBreedingPreserveId(dto.getId());
|
}
|
observationOfPetriDishesService.remove(new LambdaQueryWrapper<TObservationOfPetriDishes>().eq(TObservationOfPetriDishes::getBreedingPreserveId, dto.getId()));
|
observationOfPetriDishesService.saveBatch(observationOfPetriDishes);
|
for (TVaccinationSlope vaccinationSlope : vaccinationSlopes) {
|
vaccinationSlope.setBreedingPreserveId(dto.getId());
|
}
|
vaccinationSlopeService.remove(new LambdaQueryWrapper<TVaccinationSlope>().eq(TVaccinationSlope::getBreedingPreserveId, dto.getId()));
|
vaccinationSlopeService.saveBatch(vaccinationSlopes);
|
for (TCulturePreservation tSeparationOfCultureDishes : culturePreservations) {
|
|
tSeparationOfCultureDishes.setBreedingPreserveId(dto.getId());
|
}
|
culturePreservationService.remove(new LambdaQueryWrapper<TCulturePreservation>().eq(TCulturePreservation::getBreedingPreserveId, dto.getId()));
|
for (TCulturePreservation culturePreservation : culturePreservations) {
|
culturePreservation.setBreedingPreserveId(dto.getId());
|
}
|
culturePreservationService.saveBatch(culturePreservations);
|
if (dto.getStatus()==2){
|
notifyProjectEngineers(dto.getProjectId(), dto.getId(), 6);
|
}
|
return R.ok();
|
}
|
|
private void notifyProjectEngineers(String projectId, String dataId, int noticeType) {
|
List<TProjectTeamStaff> engineers = projectTeamStaffService.lambdaQuery()
|
.eq(TProjectTeamStaff::getTeamId, projectId)
|
.eq(TProjectTeamStaff::getRoleType, 3)
|
.list();
|
for (TProjectTeamStaff engineer : engineers) {
|
TNotice notice = new TNotice();
|
notice.setUserId(engineer.getUserId());
|
notice.setCommitId(tokenService.getLoginUser().getUserId() + "");
|
notice.setStatus(1);
|
notice.setNoticeContent("您有【1】条【菌种选育保藏记录】等待签字入库确认;");
|
notice.setDataId(dataId);
|
notice.setNoticeType(noticeType);
|
noticeService.save(notice);
|
}
|
}
|
|
@Log(title = "接种斜面记录确认入库", businessType = BusinessType.UPDATE)
|
@ApiOperation(value = "接种斜面记录确认入库",response = TConfirmBreedingAndPreservationDTO.class)
|
@PostMapping(value = "/api/t-breeding-and-preservation/vaccinationSlopesConfirm")
|
public R<Boolean> vaccinationSlopesConfirm(@RequestBody String param) {
|
if (tokenService.getLoginUser() == null) {
|
return R.fail(401, "登陆失效");
|
}
|
Long userId = tokenService.getLoginUser().getUserId();
|
|
TConfirmBreedingAndPreservationDTO dto = JSON.parseObject(param,TConfirmBreedingAndPreservationDTO.class);
|
TVaccinationSlope vaccinationSlope = vaccinationSlopeService.getById(dto.getId());
|
if (vaccinationSlope == null) {
|
return R.fail("接种斜面记录不存在");
|
}
|
R<Boolean> validation = validatePreservationConfirmation(vaccinationSlope.getBreedingPreserveId(), userId,
|
vaccinationSlope.getPreserveSignature());
|
if (validation != null) {
|
return validation;
|
}
|
vaccinationSlope.setPreserveId(userId+"");
|
vaccinationSlope.setPreserveTime(LocalDateTime.now());
|
vaccinationSlope.setPreserveSignature(dto.getPreserveSignature());
|
vaccinationSlopeService.updateById(vaccinationSlope);
|
return R.ok();
|
}
|
@Log(title = "菌种保藏记录确认入库", businessType = BusinessType.UPDATE)
|
@ApiOperation(value = "菌种保藏记录确认入库",response = TConfirmBreedingAndPreservationDTO.class)
|
@PostMapping(value = "/api/t-breeding-and-preservation/culturePreservationsConfirm")
|
public R<Boolean> culturePreservationsConfirm(@RequestBody String param) {
|
if (tokenService.getLoginUser() == null) {
|
return R.fail(401, "登陆失效");
|
}
|
Long userId = tokenService.getLoginUser().getUserId();
|
TConfirmBreedingAndPreservationDTO dto = JSON.parseObject(param,TConfirmBreedingAndPreservationDTO.class);
|
TCulturePreservation culturePreservation = culturePreservationService.getById(dto.getId());
|
if (culturePreservation == null) {
|
return R.fail("菌种保藏记录不存在");
|
}
|
R<Boolean> validation = validatePreservationConfirmation(culturePreservation.getBreedingPreserveId(), userId,
|
culturePreservation.getPreserveSignature());
|
if (validation != null) {
|
return validation;
|
}
|
culturePreservation.setPreserveId(userId+"");
|
culturePreservation.setPreserveTime(LocalDateTime.now());
|
culturePreservation.setPreserveSignature(dto.getPreserveSignature());
|
culturePreservationService.updateById(culturePreservation);
|
return R.ok();
|
}
|
|
@Resource
|
private TProjectTeamMapper tProjectTeamMapper;
|
|
private R<Boolean> validatePreservationConfirmation(String breedingPreserveId, Long userId,
|
String existingSignature) {
|
if (StringUtils.hasLength(existingSignature)) {
|
return R.fail("该记录已经确认,不能重复签字");
|
}
|
TBreedingAndPreservation record = breedingAndPreservationService.getById(breedingPreserveId);
|
if (record == null || record.getStatus() == null || record.getStatus() != 2) {
|
return R.fail("仅已同步且未提交的记录可以确认入库");
|
}
|
boolean isProjectEngineer = projectTeamStaffService.lambdaQuery()
|
.eq(TProjectTeamStaff::getTeamId, record.getProjectId())
|
.eq(TProjectTeamStaff::getUserId, userId)
|
.count() > 0;
|
|
SysUser sysUser = sysUserService.selectUserById(userId);
|
|
if (isProjectEngineer) {
|
if (!sysUser.getRoleType().equals("3")) {
|
return R.fail("仅当前项目的菌种工程师可以确认入库");
|
}
|
}
|
return null;
|
}
|
|
//@PreAuthorize("@ss.hasPermi('system:breedingAndPreservation:detail')")
|
@ApiOperation(value = "选育保藏记录详情")
|
@GetMapping(value = "/open/t-breeding-and-preservation/getDetailById")
|
public R<TBreedingAndPreservationDetailVO> getDetailById(@RequestParam String id) {
|
if (!StringUtils.hasText(id)) {
|
return R.fail("记录ID不能为空");
|
}
|
TBreedingAndPreservation breedingAndPreservation = breedingAndPreservationService.getById(id);
|
if (breedingAndPreservation == null) {
|
return R.fail("菌种选育保藏记录不存在或已删除");
|
}
|
List<SysUser> sysUsers = sysUserService.selectAllList();
|
TBreedingAndPreservationDetailVO res = new TBreedingAndPreservationDetailVO();
|
BeanUtils.copyProperties(breedingAndPreservation, res);
|
List<TSeparationOfCultureDishes> separationOfCultureDishesList = separationOfCultureDishesService.lambdaQuery().eq(TSeparationOfCultureDishes::getBreedingPreserveId, id).list();
|
List<TObservationOfPetriDishes> observationOfPetriDishes = observationOfPetriDishesService.lambdaQuery().eq(TObservationOfPetriDishes::getBreedingPreserveId, id).list();
|
List<TVaccinationSlope> vaccinationSlopes = vaccinationSlopeService.lambdaQuery().eq(TVaccinationSlope::getBreedingPreserveId, id).list();
|
List<TCulturePreservation> culturePreservations = culturePreservationService.lambdaQuery().eq(TCulturePreservation::getBreedingPreserveId, id).list();
|
for (TCulturePreservation culturePreservation : culturePreservations) {
|
SysUser sysUser = findUserById(sysUsers, culturePreservation.getHandleId());
|
if (sysUser!=null){
|
culturePreservation.setHandleName(sysUser.getNickName());
|
}
|
}
|
for (TVaccinationSlope vaccinationSlope : vaccinationSlopes) {
|
SysUser sysUser = findUserById(sysUsers, vaccinationSlope.getHandleId());
|
if (sysUser!=null){
|
vaccinationSlope.setHandleName(sysUser.getNickName());
|
}
|
}
|
|
if (com.ruoyi.common.utils.StringUtils.isNotEmpty(breedingAndPreservation.getProjectId())) {
|
TProjectTeam tProjectTeam = tProjectTeamMapper.selectById(breedingAndPreservation.getProjectId());
|
if (tProjectTeam != null) {
|
List<TProjectTeamStaff> list = projectTeamStaffService.lambdaQuery().eq(TProjectTeamStaff::getTeamId, tProjectTeam.getId()).list();
|
StringBuilder staffNames = new StringBuilder();
|
for (TProjectTeamStaff tProjectTeamStaff : list) {
|
SysUser sysUser = sysUserService.selectUserById(Long.valueOf(tProjectTeamStaff.getUserId()));
|
if (sysUser!=null){
|
staffNames.append(sysUser.getNickName()).append(",");
|
}
|
}
|
if (StringUtils.hasLength(staffNames.toString())){
|
tProjectTeam.setStaff(staffNames.substring(0, staffNames.toString().length() - 1));
|
}
|
|
List<TProjectTeam> tProjectTeamList = new ArrayList<>();
|
tProjectTeamList.add(tProjectTeam);
|
res.setTProjectTeamList(tProjectTeamList);
|
}
|
}
|
|
res.setSeparationOfCultureDishesList(separationOfCultureDishesList);
|
res.setObservationOfPetriDishes(observationOfPetriDishes);
|
res.setVaccinationSlopes(vaccinationSlopes);
|
res.setCulturePreservations(culturePreservations);
|
return R.ok(res);
|
}
|
|
private SysUser findUserById(List<SysUser> sysUsers, String userId) {
|
if (!StringUtils.hasText(userId)) {
|
return null;
|
}
|
try {
|
Long parsedUserId = Long.valueOf(userId);
|
return sysUsers.stream()
|
.filter(user -> user.getUserId() != null && user.getUserId().equals(parsedUserId))
|
.findFirst()
|
.orElse(null);
|
} catch (NumberFormatException exception) {
|
return null;
|
}
|
}
|
//
|
// @Log(title = "培养皿分离记录删除", businessType = BusinessType.DELETE)
|
// @ApiOperation(value = "培养皿分离记录删除")
|
// @DeleteMapping(value = "/open/t_project_team/deleteSeparationOfCultureDishes")
|
// public R<Boolean> deleteSeparationOfCultureDishes(@RequestParam String id) {
|
// return R.ok(separationOfCultureDishesService.removeById(id));
|
// }
|
// @Log(title = "培养皿生物学形态观察记录", businessType = BusinessType.DELETE)
|
// @ApiOperation(value = "培养皿生物学形态观察记录删除")
|
// @DeleteMapping(value = "/open/t_project_team/deleteObservationOfPetriDishes")
|
// public R<Boolean> deleteObservationOfPetriDishes(@RequestParam String id) {
|
//
|
// return R.ok(observationOfPetriDishesService.removeById(id));
|
// }
|
// @Log(title = "接种斜面记录删除", businessType = BusinessType.DELETE)
|
// @ApiOperation(value = "接种斜面记录删除")
|
// @DeleteMapping(value = "/open/t_project_team/deleteVaccinationSlope")
|
// public R<Boolean> deleteVaccinationSlope(@RequestParam String id) {
|
// TVaccinationSlope byId = vaccinationSlopeService.getById(id);
|
// if (byId.getPreserveSignature()!=null){
|
// return R.fail("菌种保藏人签字确认之后,不可删除");
|
// }
|
// return R.ok(vaccinationSlopeService.removeById(id));
|
// }
|
// @Log(title = "菌种保藏记录删除", businessType = BusinessType.DELETE)
|
// @ApiOperation(value = "菌种保藏记录删除")
|
// @DeleteMapping(value = "/open/t_project_team/deleteCulturePreservation")
|
// public R<Boolean> deleteCulturePreservation(@RequestParam String id) {
|
// TCulturePreservation byId = culturePreservationService.getById(id);
|
// if (byId.getPreserveSignature()!=null){
|
// return R.fail("菌种保藏人签字确认之后,不可删除");
|
// }
|
// return R.ok(culturePreservationService.removeById(id));
|
// }
|
@Log(title = "菌种保藏记录删除", businessType = BusinessType.DELETE)
|
@ApiOperation(value = "菌种保藏记录删除")
|
@DeleteMapping(value = "/open/t_project_team/deleteBreedingAndPreservation")
|
public R<Boolean> deleteCulturePreservation(@RequestParam String id) {
|
TBreedingAndPreservation record = breedingAndPreservationService.getById(id);
|
if (record == null) {
|
return R.fail("记录不存在");
|
}
|
if (record.getStatus() != null && record.getStatus() == 1) {
|
return R.fail("该记录已提交,不可删除");
|
}
|
return R.ok(breedingAndPreservationService.removeById(id));
|
}
|
}
|