Browse Source

基因鉴定接口定义

陈长荣 5 months ago
parent
commit
35d4aa2a7c

+ 25 - 0
jfcloud-gene-biz/src/main/java/com/github/jfcloud/gene/file/controller/FileController.java

@@ -0,0 +1,25 @@
+package com.github.jfcloud.gene.file.controller;
+
+import com.github.jfcloud.common.core.util.R;
+import com.github.jfcloud.gene.file.vo.FileVo;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestPart;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+
+@Slf4j
+@Tag(name = "文件")
+@RestController
+@RequestMapping("/file")
+public class FileController {
+
+    @Operation(summary = "上传文件")
+    @PostMapping(value = "/upload")
+    public R<FileVo> upload(@RequestPart("file") MultipartFile file) {
+        return R.ok();
+    }
+}

+ 15 - 0
jfcloud-gene-biz/src/main/java/com/github/jfcloud/gene/file/vo/FileVo.java

@@ -0,0 +1,15 @@
+package com.github.jfcloud.gene.file.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+@Data
+@Schema(description = "附件")
+public class FileVo {
+
+    @Schema(description = "附件名称")
+    private String name;
+
+    @Schema(description = "附件链接")
+    private String url;
+}

+ 20 - 7
jfcloud-gene-biz/src/main/java/com/github/jfcloud/gene/form/controller/CustomController.java

@@ -1,21 +1,34 @@
 package com.github.jfcloud.gene.form.controller;
 
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.jfcloud.common.core.util.R;
+import com.github.jfcloud.gene.form.dto.StrainCustomDto;
+import com.github.jfcloud.gene.form.vo.StrainCustomVo;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
 
 @Tag(name = "品系定制表单")
 @RestController
 @RequestMapping("/custom")
 public class CustomController {
 
-    @Operation(summary = "列表分页")
-    @GetMapping("/page")
-    public R getPage(Page page) {
+    @Operation(summary = "详情")
+    @GetMapping("/{id}")
+    public R<StrainCustomDto> info(@PathVariable Long id) {
+        return R.ok();
+    }
+
+    @Operation(summary = "新增")
+    @PostMapping
+    public R save(@Valid @RequestBody StrainCustomVo vo) {
+        return R.ok();
+    }
+
+    @Operation(summary = "编辑")
+    @PutMapping("/{id}")
+    public R update(@PathVariable Long id, @Valid @RequestBody StrainCustomVo vo) {
         return R.ok();
     }
 }

+ 34 - 0
jfcloud-gene-biz/src/main/java/com/github/jfcloud/gene/form/controller/PurificationController.java

@@ -0,0 +1,34 @@
+package com.github.jfcloud.gene.form.controller;
+
+import com.github.jfcloud.common.core.util.R;
+import com.github.jfcloud.gene.form.dto.StrainPurificationInfoDto;
+import com.github.jfcloud.gene.form.vo.StrainPurificationInfoVo;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+
+@Tag(name = "品系净化扩繁表单")
+@RestController
+@RequestMapping("/purification")
+public class PurificationController {
+
+    @Operation(summary = "详情")
+    @GetMapping("/{id}")
+    public R<StrainPurificationInfoDto> info(@PathVariable Long id) {
+        return R.ok();
+    }
+
+    @Operation(summary = "新增")
+    @PostMapping
+    public R save(@Valid @RequestBody StrainPurificationInfoVo vo) {
+        return R.ok();
+    }
+
+    @Operation(summary = "编辑")
+    @PutMapping("/{id}")
+    public R update(@PathVariable Long id, @Valid @RequestBody StrainPurificationInfoVo vo) {
+        return R.ok();
+    }
+}

+ 19 - 0
jfcloud-gene-biz/src/main/java/com/github/jfcloud/gene/form/dto/StrainCustomDto.java

@@ -0,0 +1,19 @@
+package com.github.jfcloud.gene.form.dto;
+
+import com.github.jfcloud.gene.form.entity.StrainCustomInfo;
+import com.github.jfcloud.gene.form.vo.StrainCustomDetailVo;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+@EqualsAndHashCode(callSuper = true)
+@Data
+@Schema(description = "品系定制响应")
+public class StrainCustomDto extends StrainCustomInfo {
+
+    private List<StrainCustomDetailVo> detailList = new ArrayList<>();
+}

+ 26 - 0
jfcloud-gene-biz/src/main/java/com/github/jfcloud/gene/form/dto/StrainPurificationInfoDto.java

@@ -0,0 +1,26 @@
+package com.github.jfcloud.gene.form.dto;
+
+import com.github.jfcloud.gene.file.vo.FileVo;
+import com.github.jfcloud.gene.form.entity.StrainPurificationInfo;
+import com.github.jfcloud.gene.form.vo.AnimalDemandVo;
+import com.github.jfcloud.gene.form.vo.CageDemandVo;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class StrainPurificationInfoDto extends StrainPurificationInfo {
+
+    @Schema(description = "检测附件")
+    private List<FileVo> testingFiles = new ArrayList<>();
+
+    @Schema(description = "动物需求")
+    private List<AnimalDemandVo> animalDemands = new ArrayList<>();
+
+    @Schema(description = "笼位需求")
+    private List<CageDemandVo> cageDemands = new ArrayList<>();
+}

+ 16 - 9
jfcloud-gene-biz/src/main/java/com/github/jfcloud/gene/form/entity/StrainCustomInfo.java

@@ -1,6 +1,7 @@
 package com.github.jfcloud.gene.form.entity;
 
 import com.github.jfcloud.gene.common.entity.BaseEntity;
+import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
@@ -17,53 +18,59 @@ public class StrainCustomInfo extends BaseEntity implements Serializable {
     /**
      * 主键
      */
+    @Schema(description = "主键")
     private Long id;
     /**
      * 流程主键
      */
+    @Schema(description = "流程主键")
     private Long flowId;
     /**
-     * 定制类型
+     * 动物品系定制
      */
-    private String customizationType;
-    /**
-     * 动物品系
-     */
-    private String animalStrain;
+    @Schema(description = "动物品系定制")
+    private String animalStrainCustom;
     /**
      * 目标基因名称(简称)
      */
+    @Schema(description = "目标基因名称(简称)")
     private String geneName;
     /**
      * NCBI Gene ID
      */
+    @Schema(description = "NCBI Gene ID")
     private String ncbiGeneId;
     /**
      * 基因敲除种属
      */
+    @Schema(description = "基因敲除种属")
     private String knockoutSpecies;
     /**
      * 基因敲除种属(其他)
      */
+    @Schema(description = "基因敲除种属(其他)")
     private String knockoutSpeciesOther;
-    /**
-     * 遗传工程模型种类
-     */
+
+    @Schema(description = "遗传工程模型种类")
     private String geneticModelType;
     /**
      * 基因敲除具体要求
      */
+    @Schema(description = "基因敲除具体要求")
     private String knockoutDetail;
     /**
      * 插入基因要求
      */
+    @Schema(description = "插入基因要求")
     private String insertGeneDetail;
     /**
      * 其他要求
      */
+    @Schema(description = "其他要求")
     private String otherRequirement;
     /**
      * 申请方提供材料
      */
+    @Schema(description = "申请方提供材料")
     private String providedMaterials;
 }

+ 25 - 0
jfcloud-gene-biz/src/main/java/com/github/jfcloud/gene/form/entity/StrainPurificationInfo.java

@@ -1,6 +1,7 @@
 package com.github.jfcloud.gene.form.entity;
 
 import com.github.jfcloud.gene.common.entity.BaseEntity;
+import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
@@ -14,96 +15,120 @@ import java.io.Serializable;
 @Data
 public class StrainPurificationInfo extends BaseEntity implements Serializable {
     private static final long serialVersionUID = 1L;
+
     /**
      * 主键
      */
+    @Schema(description = "主键")
     private Long id;
     /**
      * 流程主键
      */
+    @Schema(description = "流程主键")
     private Long flowId;
     /**
      * 品系名称
      */
+    @Schema(description = "品系名称")
     private String strainName;
     /**
      * 动物饲养地
      */
+    @Schema(description = "动物饲养地")
     private String breedingLocation;
     /**
      * 获得来源
      */
+    @Schema(description = "获得来源")
     private String source;
     /**
      * 引种来源官方网站链接
      */
+    @Schema(description = "引种来源官方网站链接")
     private String sourceLink;
     /**
      * 自行提供外部动物信息
      */
+    @Schema(description = "自行提供外部动物信息")
     private String externalAnimalInfo;
     /**
      * 动物出生信息、基因型、鉴定策略
      */
+    @Schema(description = "动物出生信息、基因型、鉴定策略")
     private String birthGeneIdentification;
     /**
      * 实验安排
      */
+    @Schema(description = "实验安排")
     private String experimentalArrangement;
     /**
      * 遗传背景
      */
+    @Schema(description = "遗传背景")
     private String geneticBackground;
     /**
      * 遗传背景(其他)
      */
+    @Schema(description = "遗传背景(其他)")
     private String geneticBackgroundOther;
     /**
      * 雌性繁育方式
      */
+    @Schema(description = "雌性繁育方式")
     private String femaleBreedingMethod;
     /**
      * 雄性繁育方式
      */
+    @Schema(description = "雄性繁育方式")
     private String maleBreedingMethod;
     /**
      * 有无明显表型特征
      */
+    @Schema(description = "有无明显表型特征")
     private String phenotype;
     /**
      * 表型描述
      */
+    @Schema(description = "表型描述")
     private String phenotypeDescription;
     /**
      * 是否做过微生物检测
      */
+    @Schema(description = "是否做过微生物检测")
     private String microbialTesting;
     /**
      * 检测细节
      */
+    @Schema(description = "检测细节")
     private String testingDetails;
     /**
      * 检测附件
      */
+    @Schema(description = "检测附件")
     private String testingFile;
     /**
      * 基因鉴定
      */
+    @Schema(description = "基因鉴定")
     private String geneTesting;
     /**
      * 实验后期安排
      */
+    @Schema(description = "实验后期安排")
     private String experimentalPostArrangement;
     /**
      * 冻存服务需求
      */
+    @Schema(description = "冻结服务需求")
     private String cryopreservationService;
     /**
      * 冻存周期
      */
+    @Schema(description = "冻结周期")
     private String cryopreservationPeriod;
     /**
      * 冻存数量(如精子麦管数、胚胎数)
      */
+    @Schema(description = "冻结数量(如精子麦管数、胚胎数)")
     private Integer cryopreservationCount;
 }

+ 40 - 0
jfcloud-gene-biz/src/main/java/com/github/jfcloud/gene/form/vo/AnimalDemandVo.java

@@ -0,0 +1,40 @@
+package com.github.jfcloud.gene.form.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+@Data
+@Schema(description = "动物需求实体类")
+public class AnimalDemandVo {
+
+    /**
+     * 性别
+     */
+    @Schema(description = "性别")
+    private String gender;
+    /**
+     * 周龄
+     */
+    @Schema(description = "周龄")
+    private Integer ageWeeks;
+    /**
+     * 数量
+     */
+    @Schema(description = "数量")
+    private Integer quantity;
+    /**
+     * 品系名称
+     */
+    @Schema(description = "品系名称")
+    private String strainName;
+    /**
+     * 基因型名称
+     */
+    @Schema(description = "基因型名称")
+    private String genotypeName;
+    /**
+     * 备注
+     */
+    @Schema(description = "备注")
+    private String remarks;
+}

+ 35 - 0
jfcloud-gene-biz/src/main/java/com/github/jfcloud/gene/form/vo/CageDemandVo.java

@@ -0,0 +1,35 @@
+package com.github.jfcloud.gene.form.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+@Data
+@Schema(description = "笼位需求实体类")
+public class CageDemandVo {
+
+    /**
+     * 品系动物
+     */
+    @Schema(description = "品系动物")
+    private String animalStrain;
+    /**
+     * 笼位数
+     */
+    @Schema(description = "笼位数")
+    private Integer cageCount;
+    /**
+     * 饲养天数
+     */
+    @Schema(description = "饲养天数")
+    private Integer breedingDays;
+    /**
+     * 特殊饲料饲养
+     */
+    @Schema(description = "特殊饲料饲养")
+    private String specialFeed;
+    /**
+     * 备注
+     */
+    @Schema(description = "备注")
+    private String remarks;
+}

+ 29 - 0
jfcloud-gene-biz/src/main/java/com/github/jfcloud/gene/form/vo/StrainCustomDetailVo.java

@@ -0,0 +1,29 @@
+package com.github.jfcloud.gene.form.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+
+@Data
+@Schema(description = "品系定制总表")
+public class StrainCustomDetailVo {
+
+    @Schema(description = "种属")
+    private String species;
+
+    @Schema(description = "遗传工程模型种类", example = "CKO/KI")
+    private String geneticModel;
+
+    @Schema(description = "基因名称")
+    private String geneName;
+
+    @Schema(description = "Gene ID")
+    private String geneId;
+
+    @Schema(description = "具体要求")
+    private String specificRequirement;
+
+    @Schema(description = "备注")
+    private String remarks;
+
+}

+ 45 - 0
jfcloud-gene-biz/src/main/java/com/github/jfcloud/gene/form/vo/StrainCustomVo.java

@@ -0,0 +1,45 @@
+package com.github.jfcloud.gene.form.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+@Data
+@Schema(description = "品系定制")
+public class StrainCustomVo {
+
+    @Schema(description = "动物品系定制", example = "基因工程动物,打靶载体,基因工程细胞")
+    private String animalStrainCustom;
+
+    @Schema(description = "目标基因名称(简称)")
+    private String targetGeneName;
+
+    @Schema(description = "NCBI Gene ID")
+    private String ncbiGeneId;
+
+    @Schema(description = "基因敲除种属", example = "小鼠,大鼠")
+    private String knockoutSpecies;
+
+    @Schema(description = "基因敲除种属(其他)")
+    private String knockoutSpeciesOther;
+
+    @Schema(description = "遗传工程模型种类", example = "全身性基因敲除KO,条件性/组织特异性基因敲除CKO")
+    private String geneticModelType;
+
+    @Schema(description = "基因敲除具体要求")
+    private String knockoutDetail;
+
+    @Schema(description = "插入基因要求")
+    private String insertGeneDetail;
+
+    @Schema(description = "其他要求")
+    private String otherRequirement;
+
+    @Schema(description = "申请方提供材料", example = "骨架载体质粒")
+    private String providedMaterials;
+
+    private List<StrainCustomDetailVo> detailList = new ArrayList<>();
+}

+ 126 - 0
jfcloud-gene-biz/src/main/java/com/github/jfcloud/gene/form/vo/StrainPurificationInfoVo.java

@@ -0,0 +1,126 @@
+package com.github.jfcloud.gene.form.vo;
+
+import com.github.jfcloud.gene.file.vo.FileVo;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Data
+@Schema(description = "品系净化扩繁信息实体类")
+public class StrainPurificationInfoVo {
+
+    /**
+     * 品系名称
+     */
+    @Schema(description = "品系名称")
+    private String strainName;
+    /**
+     * 动物饲养地
+     */
+    @Schema(description = "动物饲养地")
+    private String breedingLocation;
+    /**
+     * 获得来源
+     */
+    @Schema(description = "获得来源", example = "模式动物中心提供")
+    private String source;
+    /**
+     * 引种来源官方网站链接
+     */
+    @Schema(description = "引种来源官方网站链接")
+    private String sourceLink;
+    /**
+     * 自行提供外部动物信息
+     */
+    @Schema(description = "自行提供外部动物信息")
+    private String externalAnimalInfo;
+    /**
+     * 动物出生信息、基因型、鉴定策略
+     */
+    @Schema(description = "动物出生信息、基因型、鉴定策略")
+    private String birthGeneIdentification;
+    /**
+     * 实验安排
+     */
+    @Schema(description = "实验安排", example = "仅净化保种,扩繁,精子冷冻")
+    private String experimentalArrangement;
+    /**
+     * 遗传背景
+     */
+    @Schema(description = "遗传背景", example = "KO,CKO")
+    private String geneticBackground;
+    /**
+     * 遗传背景(其他)
+     */
+    @Schema(description = "遗传背景(其他)")
+    private String geneticBackgroundOther;
+    /**
+     * 雌性繁育方式
+     */
+    @Schema(description = "雌性繁育方式", example = "杂合")
+    private String femaleBreedingMethod;
+    /**
+     * 雄性繁育方式
+     */
+    @Schema(description = "雄性繁育方式", example = "纯合")
+    private String maleBreedingMethod;
+    /**
+     * 有无明显表型特征
+     */
+    @Schema(description = "有无明显表型特征")
+    private String phenotype;
+    /**
+     * 表型描述
+     */
+    @Schema(description = "表型特征描述,表型特征选[是]显示")
+    private String phenotypeDescription;
+    /**
+     * 是否做过微生物检测
+     */
+    @Schema(description = "是否做过微生物检测")
+    private String microbialTesting;
+    /**
+     * 检测细节
+     */
+    @Schema(description = "检测细节,微生物检测选[是]显示")
+    private String testingDetails;
+    /**
+     * 检测附件
+     */
+    @Schema(description = "检测附件")
+    private List<FileVo> testingFiles = new ArrayList<>();
+
+    @Schema(description = "动物需求")
+    private List<AnimalDemandVo> animalDemands = new ArrayList<>();
+
+    @Schema(description = "笼位需求")
+    private List<CageDemandVo> cageDemands = new ArrayList<>();
+
+    /**
+     * 基因鉴定
+     */
+    @Schema(description = "基因鉴定", example = "申请方自行鉴定")
+    private String geneTesting;
+    /**
+     * 实验后期安排
+     */
+    @Schema(description = "实验后期安排", example = "净化后扩繁做实验")
+    private String experimentalPostArrangement;
+    /**
+     * 冻存服务需求
+     */
+    @Schema(description = "冻结服务需求", example = "冻存精子/冻存胚胎")
+    private String cryopreservationService;
+    /**
+     * 冻存周期
+     */
+    @Schema(description = "冻结周期", example = "3年")
+    private String cryopreservationPeriod;
+    /**
+     * 冻存数量(如精子麦管数、胚胎数)
+     */
+    @Schema(description = "冻结数量(如精子麦管数、胚胎数)")
+    private Integer cryopreservationCount;
+}

+ 3 - 0
jfcloud-gene-common/src/main/java/com/github/jfcloud/gene/common/entity/BaseEntity.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.FieldFill;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.github.jfcloud.gene.common.interceptor.anno.AutoStuff;
 import com.github.jfcloud.gene.common.interceptor.enums.AnnoEnum;
@@ -28,10 +29,12 @@ public abstract class BaseEntity extends Model implements Serializable {
 
     @TableField(fill = FieldFill.INSERT, value = "create_time")
     @AutoStuff(annoType = AnnoEnum.CREATE_TIME)
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date createTime;
 
     @TableField(fill = FieldFill.INSERT_UPDATE, value = "update_time")
     @AutoStuff(annoType = AnnoEnum.UPDATE_TIME)
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date updateTime;
 
     @TableField(fill = FieldFill.INSERT)