From d066ff34d052bd0597c69fec0b6bd3460bd0ac2b Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期二, 10 六月 2025 14:08:46 +0800
Subject: [PATCH] 菌种库所有代码
---
ruoyi-system/src/main/java/com/ruoyi/system/dto/TConfirmBreedingAndPreservationDTO.java | 17 +++++++++++++++++
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TBreedingAndPreservationController.java | 37 ++++++++++++++++++++++++++++++++++++-
2 files changed, 53 insertions(+), 1 deletions(-)
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TBreedingAndPreservationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TBreedingAndPreservationController.java
index dbb9ec1..895f018 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TBreedingAndPreservationController.java
+++ b/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")
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/dto/TConfirmBreedingAndPreservationDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/dto/TConfirmBreedingAndPreservationDTO.java
new file mode 100644
index 0000000..f8cd823
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/dto/TConfirmBreedingAndPreservationDTO.java
@@ -0,0 +1,17 @@
+package com.ruoyi.system.dto;
+
+import com.ruoyi.system.model.*;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+@ApiModel(value = "菌种工程师确认入库DTO")
+public class TConfirmBreedingAndPreservationDTO {
+ @ApiModelProperty("保藏人签名")
+ private String preserveSignature;
+ @ApiModelProperty("数据id")
+ private String id;
+}
--
Gitblit v1.7.1