无关风月
2025-06-10 d066ff34d052bd0597c69fec0b6bd3460bd0ac2b
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TBreedingAndPreservationController.java
@@ -4,6 +4,7 @@
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.model.*;
import java.util.List;
@@ -90,6 +91,9 @@
            return R.fail(401,"登陆失效");
        }
        TBreedingAndPreservationDTO dto = JSON.parseObject(param,TBreedingAndPreservationDTO.class);
        if (dto.getStatus()==3){
            dto.setIsDraft(1);
        }
        breedingAndPreservationService.save(dto);
        List<TSeparationOfCultureDishes> separationOfCultureDishesList = dto.getSeparationOfCultureDishesList();
        for (TSeparationOfCultureDishes tSeparationOfCultureDishes : separationOfCultureDishesList) {
@@ -111,7 +115,7 @@
            tSeparationOfCultureDishes.setBreedingPreserveId(dto.getId());
        }
        culturePreservationService.saveBatch(culturePreservations);
        if (dto.getStatus()==2){
        if (dto.getStatus()!=null&&dto.getStatus()==2){
            // 新增消息
            TNotice tNotice = new TNotice();
            List<String> collect = projectTeamStaffService.lambdaQuery().eq(TProjectTeamStaff::getUserId, tokenService.getLoginUser().getUserId())
@@ -148,6 +152,11 @@
            return R.fail(401,"登陆失效");
        }
        TBreedingAndPreservationDTO dto = JSON.parseObject(param,TBreedingAndPreservationDTO.class);
        if (dto.getStatus()==3){
            dto.setIsDraft(1);
        }else{
            dto.setIsDraft(0);
        }
        breedingAndPreservationService.updateById(dto);
        List<TSeparationOfCultureDishes> separationOfCultureDishesList = dto.getSeparationOfCultureDishesList();
        for (TSeparationOfCultureDishes tSeparationOfCultureDishes : separationOfCultureDishesList) {
@@ -195,7 +204,33 @@
        }
        return R.ok();
    }
    @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) {
        Long userId = tokenService.getLoginUser().getUserId();
        TConfirmBreedingAndPreservationDTO dto = JSON.parseObject(param,TConfirmBreedingAndPreservationDTO.class);
        TVaccinationSlope byId = vaccinationSlopeService.getById(dto.getId());
        byId.setPreserveId(userId+"");
        byId.setPreserveTime(LocalDateTime.now());
        byId.setPreserveSignature(dto.getPreserveSignature());
        vaccinationSlopeService.updateById(byId);
        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) {
        Long userId = tokenService.getLoginUser().getUserId();
        TConfirmBreedingAndPreservationDTO dto = JSON.parseObject(param,TConfirmBreedingAndPreservationDTO.class);
        TCulturePreservation byId = culturePreservationService.getById(dto.getId());
        byId.setPreserveId(userId+"");
        byId.setPreserveTime(LocalDateTime.now());
        byId.setPreserveSignature(dto.getPreserveSignature());
        culturePreservationService.updateById(byId);
        return R.ok();
    }
    //@PreAuthorize("@ss.hasPermi('system:breedingAndPreservation:detail')")
    @ApiOperation(value = "选育保藏记录详情")
    @GetMapping(value = "/open/t-breeding-and-preservation/getDetailById")