From d0a8e2207b9ab09d26965eee92619379991b06fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BC=82=E6=B3=8A?= <1913856125@qq.com> Date: Tue, 4 Nov 2025 17:13:40 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E5=B2=97=E4=BD=8D?= =?UTF-8?q?=E7=BC=96=E7=A0=81=E6=9F=A5=E8=AF=A2=E7=94=A8=E6=88=B7=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/zhyc/module/common/domain/UserPost.java | 4 +++- .../main/resources/mapper/common/UserPostMapper.xml | 11 +++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/zhyc-module/src/main/java/com/zhyc/module/common/domain/UserPost.java b/zhyc-module/src/main/java/com/zhyc/module/common/domain/UserPost.java index 9160779..78dccce 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/common/domain/UserPost.java +++ b/zhyc-module/src/main/java/com/zhyc/module/common/domain/UserPost.java @@ -4,9 +4,11 @@ import lombok.Data; @Data public class UserPost { +// 用户id + private String userId; // 用户名 private String nickName; -// 用户 +// 岗位名称 private String postName; // 岗位编码 private String postCode; diff --git a/zhyc-module/src/main/resources/mapper/common/UserPostMapper.xml b/zhyc-module/src/main/resources/mapper/common/UserPostMapper.xml index cec16d8..57f41d5 100644 --- a/zhyc-module/src/main/resources/mapper/common/UserPostMapper.xml +++ b/zhyc-module/src/main/resources/mapper/common/UserPostMapper.xml @@ -5,14 +5,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + \ No newline at end of file From 96ac2f2dbf6d72c7ad5455b552b9ca10ca9e11d6 Mon Sep 17 00:00:00 2001 From: zyh <2066096076@qq.com> Date: Sat, 29 Nov 2025 18:52:08 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E5=86=BB=E8=83=9A=E5=86=BB=E7=B2=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frozen/controller/DdFeController.java | 104 ++++++ .../frozen/controller/DdFsController.java | 104 ++++++ .../com/zhyc/module/frozen/domain/DdFe.java | 299 ++++++++++++++++++ .../com/zhyc/module/frozen/domain/DdFs.java | 252 +++++++++++++++ .../zhyc/module/frozen/mapper/DdFeMapper.java | 61 ++++ .../zhyc/module/frozen/mapper/DdFsMapper.java | 61 ++++ .../module/frozen/service/IDdFeService.java | 61 ++++ .../module/frozen/service/IDdFsService.java | 61 ++++ .../frozen/service/impl/DdFeServiceImpl.java | 95 ++++++ .../frozen/service/impl/DdFsServiceImpl.java | 95 ++++++ .../controller/ScAddSheepController.java | 1 + .../resources/mapper/frozen/DdFeMapper.xml | 137 ++++++++ .../resources/mapper/frozen/DdFsMapper.xml | 123 +++++++ 13 files changed, 1454 insertions(+) create mode 100644 zhyc-module/src/main/java/com/zhyc/module/frozen/controller/DdFeController.java create mode 100644 zhyc-module/src/main/java/com/zhyc/module/frozen/controller/DdFsController.java create mode 100644 zhyc-module/src/main/java/com/zhyc/module/frozen/domain/DdFe.java create mode 100644 zhyc-module/src/main/java/com/zhyc/module/frozen/domain/DdFs.java create mode 100644 zhyc-module/src/main/java/com/zhyc/module/frozen/mapper/DdFeMapper.java create mode 100644 zhyc-module/src/main/java/com/zhyc/module/frozen/mapper/DdFsMapper.java create mode 100644 zhyc-module/src/main/java/com/zhyc/module/frozen/service/IDdFeService.java create mode 100644 zhyc-module/src/main/java/com/zhyc/module/frozen/service/IDdFsService.java create mode 100644 zhyc-module/src/main/java/com/zhyc/module/frozen/service/impl/DdFeServiceImpl.java create mode 100644 zhyc-module/src/main/java/com/zhyc/module/frozen/service/impl/DdFsServiceImpl.java create mode 100644 zhyc-module/src/main/resources/mapper/frozen/DdFeMapper.xml create mode 100644 zhyc-module/src/main/resources/mapper/frozen/DdFsMapper.xml diff --git a/zhyc-module/src/main/java/com/zhyc/module/frozen/controller/DdFeController.java b/zhyc-module/src/main/java/com/zhyc/module/frozen/controller/DdFeController.java new file mode 100644 index 0000000..88237eb --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/frozen/controller/DdFeController.java @@ -0,0 +1,104 @@ +package com.zhyc.module.frozen.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.zhyc.common.annotation.Log; +import com.zhyc.common.core.controller.BaseController; +import com.zhyc.common.core.domain.AjaxResult; +import com.zhyc.common.enums.BusinessType; +import com.zhyc.module.frozen.domain.DdFe; +import com.zhyc.module.frozen.service.IDdFeService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 冻胚库存Controller + * + * @author ruoyi + * @date 2025-11-29 + */ +@RestController +@RequestMapping("/frozen/embryo") +public class DdFeController extends BaseController +{ + @Autowired + private IDdFeService ddFeService; + + /** + * 查询冻胚库存列表 + */ + @PreAuthorize("@ss.hasPermi('frozen:embryo:list')") + @GetMapping("/list") + public TableDataInfo list(DdFe ddFe) + { + startPage(); + List list = ddFeService.selectDdFeList(ddFe); + return getDataTable(list); + } + + /** + * 导出冻胚库存列表 + */ + @PreAuthorize("@ss.hasPermi('frozen:embryo:export')") + @Log(title = "冻胚库存", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, DdFe ddFe) + { + List list = ddFeService.selectDdFeList(ddFe); + ExcelUtil util = new ExcelUtil(DdFe.class); + util.exportExcel(response, list, "冻胚库存数据"); + } + + /** + * 获取冻胚库存详细信息 + */ + @PreAuthorize("@ss.hasPermi('frozen:embryo:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(ddFeService.selectDdFeById(id)); + } + + /** + * 新增冻胚库存 + */ + @PreAuthorize("@ss.hasPermi('frozen:embryo:add')") + @Log(title = "冻胚库存", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody DdFe ddFe) + { + return toAjax(ddFeService.insertDdFe(ddFe)); + } + + /** + * 修改冻胚库存 + */ + @PreAuthorize("@ss.hasPermi('frozen:embryo:edit')") + @Log(title = "冻胚库存", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody DdFe ddFe) + { + return toAjax(ddFeService.updateDdFe(ddFe)); + } + + /** + * 删除冻胚库存 + */ + @PreAuthorize("@ss.hasPermi('frozen:embryo:remove')") + @Log(title = "冻胚库存", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(ddFeService.deleteDdFeByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/frozen/controller/DdFsController.java b/zhyc-module/src/main/java/com/zhyc/module/frozen/controller/DdFsController.java new file mode 100644 index 0000000..22f76a8 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/frozen/controller/DdFsController.java @@ -0,0 +1,104 @@ +package com.zhyc.module.frozen.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.zhyc.common.annotation.Log; +import com.zhyc.common.core.controller.BaseController; +import com.zhyc.common.core.domain.AjaxResult; +import com.zhyc.common.enums.BusinessType; +import com.zhyc.module.frozen.domain.DdFs; +import com.zhyc.module.frozen.service.IDdFsService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 冻精库存Controller + * + * @author ruoyi + * @date 2025-11-29 + */ +@RestController +@RequestMapping("/sperm/sperm") +public class DdFsController extends BaseController +{ + @Autowired + private IDdFsService ddFsService; + + /** + * 查询冻精库存列表 + */ + @PreAuthorize("@ss.hasPermi('sperm:sperm:list')") + @GetMapping("/list") + public TableDataInfo list(DdFs ddFs) + { + startPage(); + List list = ddFsService.selectDdFsList(ddFs); + return getDataTable(list); + } + + /** + * 导出冻精库存列表 + */ + @PreAuthorize("@ss.hasPermi('sperm:sperm:export')") + @Log(title = "冻精库存", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, DdFs ddFs) + { + List list = ddFsService.selectDdFsList(ddFs); + ExcelUtil util = new ExcelUtil(DdFs.class); + util.exportExcel(response, list, "冻精库存数据"); + } + + /** + * 获取冻精库存详细信息 + */ + @PreAuthorize("@ss.hasPermi('sperm:sperm:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(ddFsService.selectDdFsById(id)); + } + + /** + * 新增冻精库存 + */ + @PreAuthorize("@ss.hasPermi('sperm:sperm:add')") + @Log(title = "冻精库存", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody DdFs ddFs) + { + return toAjax(ddFsService.insertDdFs(ddFs)); + } + + /** + * 修改冻精库存 + */ + @PreAuthorize("@ss.hasPermi('sperm:sperm:edit')") + @Log(title = "冻精库存", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody DdFs ddFs) + { + return toAjax(ddFsService.updateDdFs(ddFs)); + } + + /** + * 删除冻精库存 + */ + @PreAuthorize("@ss.hasPermi('sperm:sperm:remove')") + @Log(title = "冻精库存", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(ddFsService.deleteDdFsByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/frozen/domain/DdFe.java b/zhyc-module/src/main/java/com/zhyc/module/frozen/domain/DdFe.java new file mode 100644 index 0000000..6f04a2a --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/frozen/domain/DdFe.java @@ -0,0 +1,299 @@ +package com.zhyc.module.frozen.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 冻胚库存对象 dd_fe + * + * @author ruoyi + * @date 2025-11-29 + */ +public class DdFe extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 胚胎编号 YS+日期+序号 */ + @Excel(name = "胚胎编号 YS+日期+序号") + private String code; + + /** 冻胚日期(事件录入日) */ + @Excel(name = "冻胚日期", readConverterExp = "事=件录入日") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date freezeDate; + + /** 供体公羊耳号 */ + @Excel(name = "供体公羊耳号") + private String drId; + + /** 供体公羊品种 */ + @Excel(name = "供体公羊品种") + private String drBreed; + + /** 供体母羊耳号 */ + @Excel(name = "供体母羊耳号") + private String deId; + + /** 供体母羊品种 */ + @Excel(name = "供体母羊品种") + private String deBreed; + + /** 胚胎品种(自动生成) */ + @Excel(name = "胚胎品种", readConverterExp = "自=动生成") + private String embBreed; + + /** 胚胎阶段等级('A', 'B', 'C', 'D', '囊胚', '桑椹胚') */ + @Excel(name = "胚胎阶段等级('A', 'B', 'C', 'D', '囊胚', '桑椹胚')") + private String grade; + + /** 胚胎数量 */ + @Excel(name = "胚胎数量") + private Long qty; + + /** 是否性控 1是 0否 */ + @Excel(name = "是否性控 1是 0否") + private Integer sexCtl; + + /** 状态(0正常1销售 2自用3废弃) */ + @Excel(name = "状态(0正常1销售 2自用3废弃)") + private String status; + + /** 技术员 */ + @Excel(name = "技术员") + private String tech; + + /** 液氮罐ID */ + @Excel(name = "液氮罐ID") + private Long tankId; + + /** 提桶ID */ + @Excel(name = "提桶ID") + private Long bucketId; + + /** 冷冻架ID */ + @Excel(name = "冷冻架ID") + private Long rackId; + + /** 出库日期(出库后回写) */ + @Excel(name = "出库日期", readConverterExp = "出=库后回写") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date outDate; + + /** 废弃原因(废弃时填写) */ + @Excel(name = "废弃原因", readConverterExp = "废=弃时填写") + private String discardTxt; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + + public void setFreezeDate(Date freezeDate) + { + this.freezeDate = freezeDate; + } + + public Date getFreezeDate() + { + return freezeDate; + } + + public void setDrId(String drId) + { + this.drId = drId; + } + + public String getDrId() + { + return drId; + } + + public void setDrBreed(String drBreed) + { + this.drBreed = drBreed; + } + + public String getDrBreed() + { + return drBreed; + } + + public void setDeId(String deId) + { + this.deId = deId; + } + + public String getDeId() + { + return deId; + } + + public void setDeBreed(String deBreed) + { + this.deBreed = deBreed; + } + + public String getDeBreed() + { + return deBreed; + } + + public void setEmbBreed(String embBreed) + { + this.embBreed = embBreed; + } + + public String getEmbBreed() + { + return embBreed; + } + + public void setGrade(String grade) + { + this.grade = grade; + } + + public String getGrade() + { + return grade; + } + + public void setQty(Long qty) + { + this.qty = qty; + } + + public Long getQty() + { + return qty; + } + + public void setSexCtl(Integer sexCtl) + { + this.sexCtl = sexCtl; + } + + public Integer getSexCtl() + { + return sexCtl; + } + + public void setStatus(String status) + { + this.status = status; + } + + public String getStatus() + { + return status; + } + + public void setTech(String tech) + { + this.tech = tech; + } + + public String getTech() + { + return tech; + } + + public void setTankId(Long tankId) + { + this.tankId = tankId; + } + + public Long getTankId() + { + return tankId; + } + + public void setBucketId(Long bucketId) + { + this.bucketId = bucketId; + } + + public Long getBucketId() + { + return bucketId; + } + + public void setRackId(Long rackId) + { + this.rackId = rackId; + } + + public Long getRackId() + { + return rackId; + } + + public void setOutDate(Date outDate) + { + this.outDate = outDate; + } + + public Date getOutDate() + { + return outDate; + } + + public void setDiscardTxt(String discardTxt) + { + this.discardTxt = discardTxt; + } + + public String getDiscardTxt() + { + return discardTxt; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("code", getCode()) + .append("freezeDate", getFreezeDate()) + .append("drId", getDrId()) + .append("drBreed", getDrBreed()) + .append("deId", getDeId()) + .append("deBreed", getDeBreed()) + .append("embBreed", getEmbBreed()) + .append("grade", getGrade()) + .append("qty", getQty()) + .append("sexCtl", getSexCtl()) + .append("status", getStatus()) + .append("tech", getTech()) + .append("tankId", getTankId()) + .append("bucketId", getBucketId()) + .append("rackId", getRackId()) + .append("outDate", getOutDate()) + .append("discardTxt", getDiscardTxt()) + .append("remark", getRemark()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .toString(); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/frozen/domain/DdFs.java b/zhyc-module/src/main/java/com/zhyc/module/frozen/domain/DdFs.java new file mode 100644 index 0000000..290d131 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/frozen/domain/DdFs.java @@ -0,0 +1,252 @@ +package com.zhyc.module.frozen.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 冻精库存对象 dd_fs + * + * @author ruoyi + * @date 2025-11-29 + */ +public class DdFs extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 冻精号/公羊耳号 */ + @Excel(name = "冻精号/公羊耳号") + private String code; + + /** 冻精日期(事件录入日) */ + @Excel(name = "冻精日期", readConverterExp = "事=件录入日") + private Date freezeDt; + + /** 冻精品种(同公羊品种) */ + @Excel(name = "冻精品种", readConverterExp = "同=公羊品种") + private String breed; + + /** 生产批次(日期格式) */ + @Excel(name = "生产批次", readConverterExp = "日=期格式") + private String batch; + + /** 规格(0.25mL,0.5mL) */ + @Excel(name = "规格(0.25mL,0.5mL)") + private String spec; + + /** 数量(支) */ + @Excel(name = "数量", readConverterExp = "支=") + private Long qty; + + /** 是否性控 1是 0否 */ + @Excel(name = "是否性控 1是 0否") + private Integer sexCtl; + + /** 状态(0正常1销售2自用3废弃) */ + @Excel(name = "状态", readConverterExp = "0=正常1销售2自用3废弃") + private String stat; + + /** 技术员 */ + @Excel(name = "技术员") + private String tech; + + /** 液氮罐ID */ + @Excel(name = "液氮罐ID") + private Long tankId; + + /** 提桶ID */ + @Excel(name = "提桶ID") + private Long bucketId; + + /** 冷冻架ID */ + @Excel(name = "冷冻架ID") + private Long rackId; + + /** 出库日期(出库后回写) */ + @Excel(name = "出库日期", readConverterExp = "出=库后回写") + private Date outDt; + + /** 废弃原因 */ + @Excel(name = "废弃原因") + private String discardTxt; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + + public void setFreezeDt(Date freezeDt) + { + this.freezeDt = freezeDt; + } + + public Date getFreezeDt() + { + return freezeDt; + } + + public void setBreed(String breed) + { + this.breed = breed; + } + + public String getBreed() + { + return breed; + } + + public void setBatch(String batch) + { + this.batch = batch; + } + + public String getBatch() + { + return batch; + } + + public void setSpec(String spec) + { + this.spec = spec; + } + + public String getSpec() + { + return spec; + } + + public void setQty(Long qty) + { + this.qty = qty; + } + + public Long getQty() + { + return qty; + } + + public void setSexCtl(Integer sexCtl) + { + this.sexCtl = sexCtl; + } + + public Integer getSexCtl() + { + return sexCtl; + } + + public void setStat(String stat) + { + this.stat = stat; + } + + public String getStat() + { + return stat; + } + + public void setTech(String tech) + { + this.tech = tech; + } + + public String getTech() + { + return tech; + } + + public void setTankId(Long tankId) + { + this.tankId = tankId; + } + + public Long getTankId() + { + return tankId; + } + + public void setBucketId(Long bucketId) + { + this.bucketId = bucketId; + } + + public Long getBucketId() + { + return bucketId; + } + + public void setRackId(Long rackId) + { + this.rackId = rackId; + } + + public Long getRackId() + { + return rackId; + } + + public void setOutDt(Date outDt) + { + this.outDt = outDt; + } + + public Date getOutDt() + { + return outDt; + } + + public void setDiscardTxt(String discardTxt) + { + this.discardTxt = discardTxt; + } + + public String getDiscardTxt() + { + return discardTxt; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("code", getCode()) + .append("freezeDt", getFreezeDt()) + .append("breed", getBreed()) + .append("batch", getBatch()) + .append("spec", getSpec()) + .append("qty", getQty()) + .append("sexCtl", getSexCtl()) + .append("stat", getStat()) + .append("tech", getTech()) + .append("tankId", getTankId()) + .append("bucketId", getBucketId()) + .append("rackId", getRackId()) + .append("outDt", getOutDt()) + .append("discardTxt", getDiscardTxt()) + .append("remark", getRemark()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .toString(); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/frozen/mapper/DdFeMapper.java b/zhyc-module/src/main/java/com/zhyc/module/frozen/mapper/DdFeMapper.java new file mode 100644 index 0000000..cea50ba --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/frozen/mapper/DdFeMapper.java @@ -0,0 +1,61 @@ +package com.zhyc.module.frozen.mapper; + +import java.util.List; +import com.zhyc.module.frozen.domain.DdFe; + +/** + * 冻胚库存Mapper接口 + * + * @author ruoyi + * @date 2025-11-29 + */ +public interface DdFeMapper +{ + /** + * 查询冻胚库存 + * + * @param id 冻胚库存主键 + * @return 冻胚库存 + */ + public DdFe selectDdFeById(Long id); + + /** + * 查询冻胚库存列表 + * + * @param ddFe 冻胚库存 + * @return 冻胚库存集合 + */ + public List selectDdFeList(DdFe ddFe); + + /** + * 新增冻胚库存 + * + * @param ddFe 冻胚库存 + * @return 结果 + */ + public int insertDdFe(DdFe ddFe); + + /** + * 修改冻胚库存 + * + * @param ddFe 冻胚库存 + * @return 结果 + */ + public int updateDdFe(DdFe ddFe); + + /** + * 删除冻胚库存 + * + * @param id 冻胚库存主键 + * @return 结果 + */ + public int deleteDdFeById(Long id); + + /** + * 批量删除冻胚库存 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteDdFeByIds(Long[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/frozen/mapper/DdFsMapper.java b/zhyc-module/src/main/java/com/zhyc/module/frozen/mapper/DdFsMapper.java new file mode 100644 index 0000000..4afdfc7 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/frozen/mapper/DdFsMapper.java @@ -0,0 +1,61 @@ +package com.zhyc.module.frozen.mapper; + +import java.util.List; +import com.zhyc.module.frozen.domain.DdFs; + +/** + * 冻精库存Mapper接口 + * + * @author ruoyi + * @date 2025-11-29 + */ +public interface DdFsMapper +{ + /** + * 查询冻精库存 + * + * @param id 冻精库存主键 + * @return 冻精库存 + */ + public DdFs selectDdFsById(Long id); + + /** + * 查询冻精库存列表 + * + * @param ddFs 冻精库存 + * @return 冻精库存集合 + */ + public List selectDdFsList(DdFs ddFs); + + /** + * 新增冻精库存 + * + * @param ddFs 冻精库存 + * @return 结果 + */ + public int insertDdFs(DdFs ddFs); + + /** + * 修改冻精库存 + * + * @param ddFs 冻精库存 + * @return 结果 + */ + public int updateDdFs(DdFs ddFs); + + /** + * 删除冻精库存 + * + * @param id 冻精库存主键 + * @return 结果 + */ + public int deleteDdFsById(Long id); + + /** + * 批量删除冻精库存 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteDdFsByIds(Long[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/frozen/service/IDdFeService.java b/zhyc-module/src/main/java/com/zhyc/module/frozen/service/IDdFeService.java new file mode 100644 index 0000000..a071ba3 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/frozen/service/IDdFeService.java @@ -0,0 +1,61 @@ +package com.zhyc.module.frozen.service; + +import java.util.List; +import com.zhyc.module.frozen.domain.DdFe; + +/** + * 冻胚库存Service接口 + * + * @author ruoyi + * @date 2025-11-29 + */ +public interface IDdFeService +{ + /** + * 查询冻胚库存 + * + * @param id 冻胚库存主键 + * @return 冻胚库存 + */ + public DdFe selectDdFeById(Long id); + + /** + * 查询冻胚库存列表 + * + * @param ddFe 冻胚库存 + * @return 冻胚库存集合 + */ + public List selectDdFeList(DdFe ddFe); + + /** + * 新增冻胚库存 + * + * @param ddFe 冻胚库存 + * @return 结果 + */ + public int insertDdFe(DdFe ddFe); + + /** + * 修改冻胚库存 + * + * @param ddFe 冻胚库存 + * @return 结果 + */ + public int updateDdFe(DdFe ddFe); + + /** + * 批量删除冻胚库存 + * + * @param ids 需要删除的冻胚库存主键集合 + * @return 结果 + */ + public int deleteDdFeByIds(Long[] ids); + + /** + * 删除冻胚库存信息 + * + * @param id 冻胚库存主键 + * @return 结果 + */ + public int deleteDdFeById(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/frozen/service/IDdFsService.java b/zhyc-module/src/main/java/com/zhyc/module/frozen/service/IDdFsService.java new file mode 100644 index 0000000..632489f --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/frozen/service/IDdFsService.java @@ -0,0 +1,61 @@ +package com.zhyc.module.frozen.service; + +import java.util.List; +import com.zhyc.module.frozen.domain.DdFs; + +/** + * 冻精库存Service接口 + * + * @author ruoyi + * @date 2025-11-29 + */ +public interface IDdFsService +{ + /** + * 查询冻精库存 + * + * @param id 冻精库存主键 + * @return 冻精库存 + */ + public DdFs selectDdFsById(Long id); + + /** + * 查询冻精库存列表 + * + * @param ddFs 冻精库存 + * @return 冻精库存集合 + */ + public List selectDdFsList(DdFs ddFs); + + /** + * 新增冻精库存 + * + * @param ddFs 冻精库存 + * @return 结果 + */ + public int insertDdFs(DdFs ddFs); + + /** + * 修改冻精库存 + * + * @param ddFs 冻精库存 + * @return 结果 + */ + public int updateDdFs(DdFs ddFs); + + /** + * 批量删除冻精库存 + * + * @param ids 需要删除的冻精库存主键集合 + * @return 结果 + */ + public int deleteDdFsByIds(Long[] ids); + + /** + * 删除冻精库存信息 + * + * @param id 冻精库存主键 + * @return 结果 + */ + public int deleteDdFsById(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/frozen/service/impl/DdFeServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/frozen/service/impl/DdFeServiceImpl.java new file mode 100644 index 0000000..5a61fa9 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/frozen/service/impl/DdFeServiceImpl.java @@ -0,0 +1,95 @@ +package com.zhyc.module.frozen.service.impl; + +import java.util.List; +import com.zhyc.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.zhyc.module.frozen.mapper.DdFeMapper; +import com.zhyc.module.frozen.domain.DdFe; +import com.zhyc.module.frozen.service.IDdFeService; + +/** + * 冻胚库存Service业务层处理 + * + * @author ruoyi + * @date 2025-11-29 + */ +@Service +public class DdFeServiceImpl implements IDdFeService +{ + @Autowired + private DdFeMapper ddFeMapper; + + /** + * 查询冻胚库存 + * + * @param id 冻胚库存主键 + * @return 冻胚库存 + */ + @Override + public DdFe selectDdFeById(Long id) + { + return ddFeMapper.selectDdFeById(id); + } + + /** + * 查询冻胚库存列表 + * + * @param ddFe 冻胚库存 + * @return 冻胚库存 + */ + @Override + public List selectDdFeList(DdFe ddFe) + { + return ddFeMapper.selectDdFeList(ddFe); + } + + /** + * 新增冻胚库存 + * + * @param ddFe 冻胚库存 + * @return 结果 + */ + @Override + public int insertDdFe(DdFe ddFe) + { + ddFe.setCreateTime(DateUtils.getNowDate()); + return ddFeMapper.insertDdFe(ddFe); + } + + /** + * 修改冻胚库存 + * + * @param ddFe 冻胚库存 + * @return 结果 + */ + @Override + public int updateDdFe(DdFe ddFe) + { + return ddFeMapper.updateDdFe(ddFe); + } + + /** + * 批量删除冻胚库存 + * + * @param ids 需要删除的冻胚库存主键 + * @return 结果 + */ + @Override + public int deleteDdFeByIds(Long[] ids) + { + return ddFeMapper.deleteDdFeByIds(ids); + } + + /** + * 删除冻胚库存信息 + * + * @param id 冻胚库存主键 + * @return 结果 + */ + @Override + public int deleteDdFeById(Long id) + { + return ddFeMapper.deleteDdFeById(id); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/frozen/service/impl/DdFsServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/frozen/service/impl/DdFsServiceImpl.java new file mode 100644 index 0000000..6b3c86d --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/frozen/service/impl/DdFsServiceImpl.java @@ -0,0 +1,95 @@ +package com.zhyc.module.frozen.service.impl; + +import java.util.List; +import com.zhyc.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.zhyc.module.frozen.mapper.DdFsMapper; +import com.zhyc.module.frozen.domain.DdFs; +import com.zhyc.module.frozen.service.IDdFsService; + +/** + * 冻精库存Service业务层处理 + * + * @author ruoyi + * @date 2025-11-29 + */ +@Service +public class DdFsServiceImpl implements IDdFsService +{ + @Autowired + private DdFsMapper ddFsMapper; + + /** + * 查询冻精库存 + * + * @param id 冻精库存主键 + * @return 冻精库存 + */ + @Override + public DdFs selectDdFsById(Long id) + { + return ddFsMapper.selectDdFsById(id); + } + + /** + * 查询冻精库存列表 + * + * @param ddFs 冻精库存 + * @return 冻精库存 + */ + @Override + public List selectDdFsList(DdFs ddFs) + { + return ddFsMapper.selectDdFsList(ddFs); + } + + /** + * 新增冻精库存 + * + * @param ddFs 冻精库存 + * @return 结果 + */ + @Override + public int insertDdFs(DdFs ddFs) + { + ddFs.setCreateTime(DateUtils.getNowDate()); + return ddFsMapper.insertDdFs(ddFs); + } + + /** + * 修改冻精库存 + * + * @param ddFs 冻精库存 + * @return 结果 + */ + @Override + public int updateDdFs(DdFs ddFs) + { + return ddFsMapper.updateDdFs(ddFs); + } + + /** + * 批量删除冻精库存 + * + * @param ids 需要删除的冻精库存主键 + * @return 结果 + */ + @Override + public int deleteDdFsByIds(Long[] ids) + { + return ddFsMapper.deleteDdFsByIds(ids); + } + + /** + * 删除冻精库存信息 + * + * @param id 冻精库存主键 + * @return 结果 + */ + @Override + public int deleteDdFsById(Long id) + { + return ddFsMapper.deleteDdFsById(id); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/controller/ScAddSheepController.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/controller/ScAddSheepController.java index 122d593..51bc1c9 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/controller/ScAddSheepController.java +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/controller/ScAddSheepController.java @@ -87,6 +87,7 @@ public class ScAddSheepController { //导出 @Log(title = "羊只信息", businessType = BusinessType.EXPORT) + @PreAuthorize("@ss.hasPermi('produce:add_sheep:export')") @PostMapping("/exportForm") public void exportForm(HttpServletResponse response, @RequestBody ScAddSheep scAddSheep) throws IOException { ExcelUtil util = new ExcelUtil<>(ScAddSheep.class); diff --git a/zhyc-module/src/main/resources/mapper/frozen/DdFeMapper.xml b/zhyc-module/src/main/resources/mapper/frozen/DdFeMapper.xml new file mode 100644 index 0000000..976d719 --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/frozen/DdFeMapper.xml @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, code, freeze_date, dr_id, dr_breed, de_id, de_breed, emb_breed, grade, qty, sex_ctl, status, tech, tank_id, bucket_id, rack_id, out_date, discard_txt, remark, create_by, create_time from dd_fe + + + + + + + + insert into dd_fe + + code, + freeze_date, + dr_id, + dr_breed, + de_id, + de_breed, + emb_breed, + grade, + qty, + sex_ctl, + status, + tech, + tank_id, + bucket_id, + rack_id, + out_date, + discard_txt, + remark, + create_by, + create_time, + + + #{code}, + #{freezeDate}, + #{drId}, + #{drBreed}, + #{deId}, + #{deBreed}, + #{embBreed}, + #{grade}, + #{qty}, + #{sexCtl}, + #{status}, + #{tech}, + #{tankId}, + #{bucketId}, + #{rackId}, + #{outDate}, + #{discardTxt}, + #{remark}, + #{createBy}, + #{createTime}, + + + + + update dd_fe + + code = #{code}, + freeze_date = #{freezeDate}, + dr_id = #{drId}, + dr_breed = #{drBreed}, + de_id = #{deId}, + de_breed = #{deBreed}, + emb_breed = #{embBreed}, + grade = #{grade}, + qty = #{qty}, + sex_ctl = #{sexCtl}, + status = #{status}, + tech = #{tech}, + tank_id = #{tankId}, + bucket_id = #{bucketId}, + rack_id = #{rackId}, + out_date = #{outDate}, + discard_txt = #{discardTxt}, + remark = #{remark}, + create_by = #{createBy}, + create_time = #{createTime}, + + where id = #{id} + + + + delete from dd_fe where id = #{id} + + + + delete from dd_fe where id in + + #{id} + + + \ No newline at end of file diff --git a/zhyc-module/src/main/resources/mapper/frozen/DdFsMapper.xml b/zhyc-module/src/main/resources/mapper/frozen/DdFsMapper.xml new file mode 100644 index 0000000..0000c30 --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/frozen/DdFsMapper.xml @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, code, freeze_dt, breed, batch, spec, qty, sex_ctl, stat, tech, tank_id, bucket_id, rack_id, out_dt, discard_txt, remark, create_by, create_time from dd_fs + + + + + + + + insert into dd_fs + + code, + freeze_dt, + breed, + batch, + spec, + qty, + sex_ctl, + stat, + tech, + tank_id, + bucket_id, + rack_id, + out_dt, + discard_txt, + remark, + create_by, + create_time, + + + #{code}, + #{freezeDt}, + #{breed}, + #{batch}, + #{spec}, + #{qty}, + #{sexCtl}, + #{stat}, + #{tech}, + #{tankId}, + #{bucketId}, + #{rackId}, + #{outDt}, + #{discardTxt}, + #{remark}, + #{createBy}, + #{createTime}, + + + + + update dd_fs + + code = #{code}, + freeze_dt = #{freezeDt}, + breed = #{breed}, + batch = #{batch}, + spec = #{spec}, + qty = #{qty}, + sex_ctl = #{sexCtl}, + stat = #{stat}, + tech = #{tech}, + tank_id = #{tankId}, + bucket_id = #{bucketId}, + rack_id = #{rackId}, + out_dt = #{outDt}, + discard_txt = #{discardTxt}, + remark = #{remark}, + create_by = #{createBy}, + create_time = #{createTime}, + + where id = #{id} + + + + delete from dd_fs where id = #{id} + + + + delete from dd_fs where id in + + #{id} + + + \ No newline at end of file From e79d57f6ce73f62aeeaf9949f1d8b31636877dfe Mon Sep 17 00:00:00 2001 From: zyk Date: Sun, 30 Nov 2025 13:25:48 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E9=85=8D=E7=A7=8D=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E5=92=8C=E5=86=B2=E8=83=9A=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/embryo/ScEmbryoFlushMapper.xml | 170 ++++++ .../controller/ScBreedRecordController.java | 16 +- .../controller/ScEmbryoFlushController.java | 129 +++++ .../produce/breed/domain/ScEmbryoFlush.java | 504 ++++++++++++++++++ .../breed/mapper/ScEmbryoFlushMapper.java | 86 +++ .../breed/service/IScEmbryoFlushService.java | 86 +++ .../impl/ScEmbryoFlushServiceImpl.java | 326 +++++++++++ .../produce/breed/ScBreedRecordMapper.xml | 16 +- .../produce/breed/ScEmbryoFlushMapper.xml | 229 ++++++++ 9 files changed, 1549 insertions(+), 13 deletions(-) create mode 100644 zhyc-common/src/main/resources/mapper/embryo/ScEmbryoFlushMapper.xml create mode 100644 zhyc-module/src/main/java/com/zhyc/module/produce/breed/controller/ScEmbryoFlushController.java create mode 100644 zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/ScEmbryoFlush.java create mode 100644 zhyc-module/src/main/java/com/zhyc/module/produce/breed/mapper/ScEmbryoFlushMapper.java create mode 100644 zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/IScEmbryoFlushService.java create mode 100644 zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/impl/ScEmbryoFlushServiceImpl.java create mode 100644 zhyc-module/src/main/resources/mapper/produce/breed/ScEmbryoFlushMapper.xml diff --git a/zhyc-common/src/main/resources/mapper/embryo/ScEmbryoFlushMapper.xml b/zhyc-common/src/main/resources/mapper/embryo/ScEmbryoFlushMapper.xml new file mode 100644 index 0000000..448874e --- /dev/null +++ b/zhyc-common/src/main/resources/mapper/embryo/ScEmbryoFlushMapper.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, flush_time, donor_female_no, donor_male_no, grade_a_plus, grade_a, grade_b, grade_c, grade_d, cell_2_4, cell_8, cell_16, unfertilized, degenerated, transferred, recipient_cnt, embryo_type, embryo_source, destination, storage_method, flush_operator, collect_operator, remark, created_by, created_at from sc_embryo_flush + + + + + + + + insert into sc_embryo_flush + + flush_time, + donor_female_no, + donor_male_no, + grade_a_plus, + grade_a, + grade_b, + grade_c, + grade_d, + cell_2_4, + cell_8, + cell_16, + unfertilized, + degenerated, + transferred, + recipient_cnt, + embryo_type, + embryo_source, + destination, + storage_method, + flush_operator, + collect_operator, + remark, + created_by, + created_at, + + + #{flushTime}, + #{donorFemaleNo}, + #{donorMaleNo}, + #{gradeAPlus}, + #{gradeA}, + #{gradeB}, + #{gradeC}, + #{gradeD}, + #{cell24}, + #{cell8}, + #{cell16}, + #{unfertilized}, + #{degenerated}, + #{transferred}, + #{recipientCnt}, + #{embryoType}, + #{embryoSource}, + #{destination}, + #{storageMethod}, + #{flushOperator}, + #{collectOperator}, + #{remark}, + #{createdBy}, + #{createdAt}, + + + + + update sc_embryo_flush + + flush_time = #{flushTime}, + donor_female_no = #{donorFemaleNo}, + donor_male_no = #{donorMaleNo}, + grade_a_plus = #{gradeAPlus}, + grade_a = #{gradeA}, + grade_b = #{gradeB}, + grade_c = #{gradeC}, + grade_d = #{gradeD}, + cell_2_4 = #{cell24}, + cell_8 = #{cell8}, + cell_16 = #{cell16}, + unfertilized = #{unfertilized}, + degenerated = #{degenerated}, + transferred = #{transferred}, + recipient_cnt = #{recipientCnt}, + embryo_type = #{embryoType}, + embryo_source = #{embryoSource}, + destination = #{destination}, + storage_method = #{storageMethod}, + flush_operator = #{flushOperator}, + collect_operator = #{collectOperator}, + remark = #{remark}, + created_by = #{createdBy}, + created_at = #{createdAt}, + + where id = #{id} + + + + delete from sc_embryo_flush where id = #{id} + + + + delete from sc_embryo_flush where id in + + #{id} + + + \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/controller/ScBreedRecordController.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/controller/ScBreedRecordController.java index 50c37c2..499be05 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/controller/ScBreedRecordController.java +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/controller/ScBreedRecordController.java @@ -99,7 +99,7 @@ public class ScBreedRecordController extends BaseController } /** - * 根据母羊耳号获取最新配种计划信息(优先从配种计划生成表获取) + * 根据母羊耳号获取最新配种计划信息(优先从配种计划生成表获取) */ @PreAuthorize("@ss.hasPermi('Breeding_records:Breeding_records:query')") @GetMapping(value = "/getLatestBreedPlan/{manageTags}") @@ -139,12 +139,12 @@ public class ScBreedRecordController extends BaseController scBreedRecord.setRamId(ramId.toString()); } - // 验证配种方式 + // 修改:验证配种方式 - 增加3-冲胚 和 4-自然发情人工授精 if (scBreedRecord.getBreedType() == null) { return error("配种方式不能为空"); } - if (scBreedRecord.getBreedType() != 1 && scBreedRecord.getBreedType() != 2) { - return error("配种方式只能是:1-同期发情 或 2-本交"); + if (scBreedRecord.getBreedType() < 1 || scBreedRecord.getBreedType() > 4) { + return error("配种方式只能是:1-同期发情、2-本交、3-冲胚、4-自然发情人工授精"); } // 验证技术员 @@ -186,10 +186,10 @@ public class ScBreedRecordController extends BaseController scBreedRecord.setRamId(ramId.toString()); } - // 验证配种方式 + // 修改:验证配种方式 if (scBreedRecord.getBreedType() != null) { - if (scBreedRecord.getBreedType() != 1 && scBreedRecord.getBreedType() != 2) { - return error("配种方式只能是:1-同期发情 或 2-本交"); + if (scBreedRecord.getBreedType() < 1 || scBreedRecord.getBreedType() > 4) { + return error("配种方式只能是:1-同期发情、2-本交、3-冲胚、4-自然发情人工授精"); } } @@ -223,7 +223,7 @@ public class ScBreedRecordController extends BaseController if (result > 0) { return success("孕检结果同步成功"); } else { - return error("孕检结果同步失败,可能未找到对应的配种记录"); + return error("孕检结果同步失败,可能未找到对应的配种记录"); } } diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/controller/ScEmbryoFlushController.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/controller/ScEmbryoFlushController.java new file mode 100644 index 0000000..d5d5426 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/controller/ScEmbryoFlushController.java @@ -0,0 +1,129 @@ +package com.zhyc.module.produce.breed.controller; + +import java.util.List; +import java.util.Map; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import com.zhyc.common.annotation.Log; +import com.zhyc.common.core.controller.BaseController; +import com.zhyc.common.core.domain.AjaxResult; +import com.zhyc.common.enums.BusinessType; +import com.zhyc.module.produce.breed.domain.ScEmbryoFlush; +import com.zhyc.module.produce.breed.service.IScEmbryoFlushService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 冲胚记录Controller + * + * @author ruoyi + * @date 2025-11-28 + */ +@RestController +@RequestMapping("/embryo/flush") +public class ScEmbryoFlushController extends BaseController +{ + @Autowired + private IScEmbryoFlushService scEmbryoFlushService; + + /** + * 查询冲胚记录列表 + */ + @PreAuthorize("@ss.hasPermi('embryo:flush:list')") + @GetMapping("/list") + public TableDataInfo list(ScEmbryoFlush scEmbryoFlush) + { + startPage(); + List list = scEmbryoFlushService.selectScEmbryoFlushList(scEmbryoFlush); + return getDataTable(list); + } + + /** + * 导出冲胚记录列表 + */ + @PreAuthorize("@ss.hasPermi('embryo:flush:export')") + @Log(title = "冲胚记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, ScEmbryoFlush scEmbryoFlush) + { + List list = scEmbryoFlushService.selectScEmbryoFlushList(scEmbryoFlush); + ExcelUtil util = new ExcelUtil(ScEmbryoFlush.class); + util.exportExcel(response, list, "冲胚记录数据"); + } + + /** + * 获取冲胚记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('embryo:flush:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(scEmbryoFlushService.selectScEmbryoFlushById(id)); + } + + /** + * 新增冲胚记录 + */ + @PreAuthorize("@ss.hasPermi('embryo:flush:add')") + @Log(title = "冲胚记录", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ScEmbryoFlush scEmbryoFlush) + { + return toAjax(scEmbryoFlushService.insertScEmbryoFlush(scEmbryoFlush)); + } + + /** + * 修改冲胚记录 + */ + @PreAuthorize("@ss.hasPermi('embryo:flush:edit')") + @Log(title = "冲胚记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ScEmbryoFlush scEmbryoFlush) + { + return toAjax(scEmbryoFlushService.updateScEmbryoFlush(scEmbryoFlush)); + } + + /** + * 删除冲胚记录 + */ + @PreAuthorize("@ss.hasPermi('embryo:flush:remove')") + @Log(title = "冲胚记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(scEmbryoFlushService.deleteScEmbryoFlushByIds(ids)); + } + + /** + * 根据供体母羊耳号获取关联信息 + * 返回:母羊品种、父号、父号品种、胚胎品种、牧场信息、配种日期等 + */ + @PreAuthorize("@ss.hasPermi('embryo:flush:query')") + @GetMapping("/getDonorInfo") + public AjaxResult getDonorRelatedInfo(@RequestParam("donorFemaleNo") String donorFemaleNo) + { + Map info = scEmbryoFlushService.getDonorRelatedInfo(donorFemaleNo); + return success(info); + } + + /** + * 获取供体母羊下拉列表 + */ + @PreAuthorize("@ss.hasPermi('embryo:flush:query')") + @GetMapping("/donorFemaleList") + public AjaxResult getDonorFemaleList() + { + List> list = scEmbryoFlushService.selectDonorFemaleList(); + return success(list); + } +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/ScEmbryoFlush.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/ScEmbryoFlush.java new file mode 100644 index 0000000..a02cead --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/ScEmbryoFlush.java @@ -0,0 +1,504 @@ +package com.zhyc.module.produce.breed.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 冲胚记录-用户录入对象 sc_embryo_flush + * + * @author ruoyi + * @date 2025-11-28 + */ +public class ScEmbryoFlush extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键ID */ + private Long id; + + /** 冲胚时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "冲胚时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date flushTime; + + /** 供体母号 */ + @Excel(name = "供体母号") + private String donorFemaleNo; + + /** 供体母羊品种 */ + @Excel(name = "供体母羊品种") + private String donorFemaleVariety; + + /** 供体父号 */ + @Excel(name = "供体父号") + private String donorMaleNo; + + /** 供体公羊品种 */ + @Excel(name = "供体公羊品种") + private String donorMaleVariety; + + /** 胚胎品种 */ + @Excel(name = "胚胎品种") + private String embryoVariety; + + /** 胎龄(天) */ + @Excel(name = "胎龄(天)") + private Integer embryoAge; + + /** A+级胚胎数 */ + @Excel(name = "A+级") + private Integer gradeAPlus; + + /** A级胚胎数 */ + @Excel(name = "A级") + private Integer gradeA; + + /** B级胚胎数 */ + @Excel(name = "B级") + private Integer gradeB; + + /** C级胚胎数 */ + @Excel(name = "C级") + private Integer gradeC; + + /** D级胚胎数 */ + @Excel(name = "D级") + private Integer gradeD; + + /** 2/4细胞期 */ + @Excel(name = "2/4细胞") + private Integer cell24; + + /** 8细胞期 */ + @Excel(name = "8细胞") + private Integer cell8; + + /** 16细胞期 */ + @Excel(name = "16细胞") + private Integer cell16; + + /** 未受精数 */ + @Excel(name = "未受精") + private Integer unfertilized; + + /** 退化数 */ + @Excel(name = "退化") + private Integer degenerated; + + /** 冲胚数(总和) */ + @Excel(name = "冲胚数") + private Integer totalEmbryo; + + /** 有效胚(A+到D级总和) */ + @Excel(name = "有效胚") + private Integer validEmbryo; + + /** 移胚数 */ + @Excel(name = "移胚数") + private Integer transferred; + + /** 移植受体数 */ + @Excel(name = "移植受体数") + private Integer recipientCnt; + + /** 胚胎类型 */ + @Excel(name = "胚胎类型") + private String embryoType; + + /** 胚胎来源 */ + @Excel(name = "胚胎来源") + private String embryoSource; + + /** 去向 */ + @Excel(name = "去向") + private String destination; + + /** 存储方式 */ + @Excel(name = "存储方式") + private String storageMethod; + + /** 冲胚人 */ + @Excel(name = "冲胚人") + private String flushOperator; + + /** 捡胚人 */ + @Excel(name = "捡胚人") + private String collectOperator; + + /** 所在牧场ID */ + private Long ranchId; + + /** 所在牧场名称 */ + @Excel(name = "所在牧场") + private String ranchName; + + /** 创建人 */ + private String createdBy; + + /** 创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createdAt; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public void setFlushTime(Date flushTime) + { + this.flushTime = flushTime; + } + + public Date getFlushTime() + { + return flushTime; + } + + public void setDonorFemaleNo(String donorFemaleNo) + { + this.donorFemaleNo = donorFemaleNo; + } + + public String getDonorFemaleNo() + { + return donorFemaleNo; + } + + public void setDonorFemaleVariety(String donorFemaleVariety) + { + this.donorFemaleVariety = donorFemaleVariety; + } + + public String getDonorFemaleVariety() + { + return donorFemaleVariety; + } + + public void setDonorMaleNo(String donorMaleNo) + { + this.donorMaleNo = donorMaleNo; + } + + public String getDonorMaleNo() + { + return donorMaleNo; + } + + public void setDonorMaleVariety(String donorMaleVariety) + { + this.donorMaleVariety = donorMaleVariety; + } + + public String getDonorMaleVariety() + { + return donorMaleVariety; + } + + public void setEmbryoVariety(String embryoVariety) + { + this.embryoVariety = embryoVariety; + } + + public String getEmbryoVariety() + { + return embryoVariety; + } + + public void setEmbryoAge(Integer embryoAge) + { + this.embryoAge = embryoAge; + } + + public Integer getEmbryoAge() + { + return embryoAge; + } + + public void setGradeAPlus(Integer gradeAPlus) + { + this.gradeAPlus = gradeAPlus; + } + + public Integer getGradeAPlus() + { + return gradeAPlus; + } + + public void setGradeA(Integer gradeA) + { + this.gradeA = gradeA; + } + + public Integer getGradeA() + { + return gradeA; + } + + public void setGradeB(Integer gradeB) + { + this.gradeB = gradeB; + } + + public Integer getGradeB() + { + return gradeB; + } + + public void setGradeC(Integer gradeC) + { + this.gradeC = gradeC; + } + + public Integer getGradeC() + { + return gradeC; + } + + public void setGradeD(Integer gradeD) + { + this.gradeD = gradeD; + } + + public Integer getGradeD() + { + return gradeD; + } + + public void setCell24(Integer cell24) + { + this.cell24 = cell24; + } + + public Integer getCell24() + { + return cell24; + } + + public void setCell8(Integer cell8) + { + this.cell8 = cell8; + } + + public Integer getCell8() + { + return cell8; + } + + public void setCell16(Integer cell16) + { + this.cell16 = cell16; + } + + public Integer getCell16() + { + return cell16; + } + + public void setUnfertilized(Integer unfertilized) + { + this.unfertilized = unfertilized; + } + + public Integer getUnfertilized() + { + return unfertilized; + } + + public void setDegenerated(Integer degenerated) + { + this.degenerated = degenerated; + } + + public Integer getDegenerated() + { + return degenerated; + } + + public void setTotalEmbryo(Integer totalEmbryo) + { + this.totalEmbryo = totalEmbryo; + } + + public Integer getTotalEmbryo() + { + return totalEmbryo; + } + + public void setValidEmbryo(Integer validEmbryo) + { + this.validEmbryo = validEmbryo; + } + + public Integer getValidEmbryo() + { + return validEmbryo; + } + + public void setTransferred(Integer transferred) + { + this.transferred = transferred; + } + + public Integer getTransferred() + { + return transferred; + } + + public void setRecipientCnt(Integer recipientCnt) + { + this.recipientCnt = recipientCnt; + } + + public Integer getRecipientCnt() + { + return recipientCnt; + } + + public void setEmbryoType(String embryoType) + { + this.embryoType = embryoType; + } + + public String getEmbryoType() + { + return embryoType; + } + + public void setEmbryoSource(String embryoSource) + { + this.embryoSource = embryoSource; + } + + public String getEmbryoSource() + { + return embryoSource; + } + + public void setDestination(String destination) + { + this.destination = destination; + } + + public String getDestination() + { + return destination; + } + + public void setStorageMethod(String storageMethod) + { + this.storageMethod = storageMethod; + } + + public String getStorageMethod() + { + return storageMethod; + } + + public void setFlushOperator(String flushOperator) + { + this.flushOperator = flushOperator; + } + + public String getFlushOperator() + { + return flushOperator; + } + + public void setCollectOperator(String collectOperator) + { + this.collectOperator = collectOperator; + } + + public String getCollectOperator() + { + return collectOperator; + } + + public void setRanchId(Long ranchId) + { + this.ranchId = ranchId; + } + + public Long getRanchId() + { + return ranchId; + } + + public void setRanchName(String ranchName) + { + this.ranchName = ranchName; + } + + public String getRanchName() + { + return ranchName; + } + + public void setCreatedBy(String createdBy) + { + this.createdBy = createdBy; + } + + public String getCreatedBy() + { + return createdBy; + } + + public void setCreatedAt(Date createdAt) + { + this.createdAt = createdAt; + } + + public Date getCreatedAt() + { + return createdAt; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("flushTime", getFlushTime()) + .append("donorFemaleNo", getDonorFemaleNo()) + .append("donorFemaleVariety", getDonorFemaleVariety()) + .append("donorMaleNo", getDonorMaleNo()) + .append("donorMaleVariety", getDonorMaleVariety()) + .append("embryoVariety", getEmbryoVariety()) + .append("embryoAge", getEmbryoAge()) + .append("gradeAPlus", getGradeAPlus()) + .append("gradeA", getGradeA()) + .append("gradeB", getGradeB()) + .append("gradeC", getGradeC()) + .append("gradeD", getGradeD()) + .append("cell24", getCell24()) + .append("cell8", getCell8()) + .append("cell16", getCell16()) + .append("unfertilized", getUnfertilized()) + .append("degenerated", getDegenerated()) + .append("totalEmbryo", getTotalEmbryo()) + .append("validEmbryo", getValidEmbryo()) + .append("transferred", getTransferred()) + .append("recipientCnt", getRecipientCnt()) + .append("embryoType", getEmbryoType()) + .append("embryoSource", getEmbryoSource()) + .append("destination", getDestination()) + .append("storageMethod", getStorageMethod()) + .append("flushOperator", getFlushOperator()) + .append("collectOperator", getCollectOperator()) + .append("ranchId", getRanchId()) + .append("ranchName", getRanchName()) + .append("remark", getRemark()) + .append("createdBy", getCreatedBy()) + .append("createdAt", getCreatedAt()) + .toString(); + } +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/mapper/ScEmbryoFlushMapper.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/mapper/ScEmbryoFlushMapper.java new file mode 100644 index 0000000..1ddd6e0 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/mapper/ScEmbryoFlushMapper.java @@ -0,0 +1,86 @@ +package com.zhyc.module.produce.breed.mapper; + +import java.util.List; +import java.util.Map; +import com.zhyc.module.produce.breed.domain.ScEmbryoFlush; +import org.apache.ibatis.annotations.Param; + +/** + * 冲胚记录-用户录入Mapper接口 + * + * @author ruoyi + * @date 2025-11-28 + */ +public interface ScEmbryoFlushMapper +{ + /** + * 查询冲胚记录-用户录入 + * + * @param id 冲胚记录-用户录入主键 + * @return 冲胚记录-用户录入 + */ + public ScEmbryoFlush selectScEmbryoFlushById(Long id); + + /** + * 查询冲胚记录-用户录入列表 + * + * @param scEmbryoFlush 冲胚记录-用户录入 + * @return 冲胚记录-用户录入集合 + */ + public List selectScEmbryoFlushList(ScEmbryoFlush scEmbryoFlush); + + /** + * 新增冲胚记录-用户录入 + * + * @param scEmbryoFlush 冲胚记录-用户录入 + * @return 结果 + */ + public int insertScEmbryoFlush(ScEmbryoFlush scEmbryoFlush); + + /** + * 修改冲胚记录-用户录入 + * + * @param scEmbryoFlush 冲胚记录-用户录入 + * @return 结果 + */ + public int updateScEmbryoFlush(ScEmbryoFlush scEmbryoFlush); + + /** + * 删除冲胚记录-用户录入 + * + * @param id 冲胚记录-用户录入主键 + * @return 结果 + */ + public int deleteScEmbryoFlushById(Long id); + + /** + * 批量删除冲胚记录-用户录入 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteScEmbryoFlushByIds(Long[] ids); + + /** + * 根据耳号查询羊只信息(从sheep_file视图) + * + * @param manageTag 管理耳号 + * @return 羊只信息Map(variety品种, varietyId品种ID, ranchId牧场ID, ranchName牧场名称) + */ + public Map selectSheepInfoByManageTag(@Param("manageTag") String manageTag); + + /** + * 根据母羊耳号查询最近一条配种记录 + * + * @param eweManageTag 母羊耳号 + * @return 配种记录(ramId公羊耳号, matingDate配种日期) + */ + public Map selectBreedRecordByEwe(@Param("eweManageTag") String eweManageTag); + + /** + * 查询所有母羊列表(用于下拉选择) + * + * @return 母羊列表 + */ + public List> selectDonorFemaleList(); +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/IScEmbryoFlushService.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/IScEmbryoFlushService.java new file mode 100644 index 0000000..a02fd99 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/IScEmbryoFlushService.java @@ -0,0 +1,86 @@ +package com.zhyc.module.produce.breed.service; + +import java.util.List; +import java.util.Map; +import com.zhyc.module.produce.breed.domain.ScEmbryoFlush; + +/** + * 冲胚记录-用户录入Service接口 + * + * @author ruoyi + * @date 2025-11-28 + */ +public interface IScEmbryoFlushService +{ + /** + * 查询冲胚记录-用户录入 + * + * @param id 冲胚记录-用户录入主键 + * @return 冲胚记录-用户录入 + */ + public ScEmbryoFlush selectScEmbryoFlushById(Long id); + + /** + * 查询冲胚记录-用户录入列表 + * + * @param scEmbryoFlush 冲胚记录-用户录入 + * @return 冲胚记录-用户录入集合 + */ + public List selectScEmbryoFlushList(ScEmbryoFlush scEmbryoFlush); + + /** + * 新增冲胚记录-用户录入 + * + * @param scEmbryoFlush 冲胚记录-用户录入 + * @return 结果 + */ + public int insertScEmbryoFlush(ScEmbryoFlush scEmbryoFlush); + + /** + * 修改冲胚记录-用户录入 + * + * @param scEmbryoFlush 冲胚记录-用户录入 + * @return 结果 + */ + public int updateScEmbryoFlush(ScEmbryoFlush scEmbryoFlush); + + /** + * 批量删除冲胚记录-用户录入 + * + * @param ids 需要删除的冲胚记录-用户录入主键集合 + * @return 结果 + */ + public int deleteScEmbryoFlushByIds(Long[] ids); + + /** + * 删除冲胚记录-用户录入信息 + * + * @param id 冲胚记录-用户录入主键 + * @return 结果 + */ + public int deleteScEmbryoFlushById(Long id); + + /** + * 根据供体母羊耳号获取关联信息 + * + * @param donorFemaleNo 供体母羊耳号 + * @return 关联信息(母羊品种、父号、父号品种、牧场信息、配种日期等) + */ + public Map getDonorRelatedInfo(String donorFemaleNo); + + /** + * 根据父母品种计算胚胎品种 + * + * @param maleVariety 公羊品种 + * @param femaleVariety 母羊品种 + * @return 胚胎品种 + */ + public String calculateEmbryoVariety(String maleVariety, String femaleVariety); + + /** + * 查询所有供体母羊列表(用于下拉选择) + * + * @return 母羊列表 + */ + public List> selectDonorFemaleList(); +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/impl/ScEmbryoFlushServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/impl/ScEmbryoFlushServiceImpl.java new file mode 100644 index 0000000..3af35d8 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/impl/ScEmbryoFlushServiceImpl.java @@ -0,0 +1,326 @@ +package com.zhyc.module.produce.breed.service.impl; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.zhyc.module.produce.breed.mapper.ScEmbryoFlushMapper; +import com.zhyc.module.produce.breed.domain.ScEmbryoFlush; +import com.zhyc.module.produce.breed.service.IScEmbryoFlushService; + +/** + * 冲胚记录Service业务层处理 + * + * @author ruoyi + * @date 2025-11-28 + */ +@Service +public class ScEmbryoFlushServiceImpl implements IScEmbryoFlushService +{ + @Autowired + private ScEmbryoFlushMapper scEmbryoFlushMapper; + + /** + * 品种ID常量 + * 1-湖羊, 2-东佛里生, 3-回交, 4-级杂一代, 5-级杂二代, 6-级杂三代, 7-1世代, 8-2世代, 9-3世代, 10-4世代 + */ + private static final int VARIETY_HUYANG = 1; // 湖羊 + private static final int VARIETY_DONGFULISHENG = 2; // 东佛里生 + private static final int VARIETY_HUIJIAO = 3; // 回交 + private static final int VARIETY_JIZA_1 = 4; // 级杂一代 + private static final int VARIETY_JIZA_2 = 5; // 级杂二代 + private static final int VARIETY_JIZA_3 = 6; // 级杂三代 + private static final int VARIETY_SHIDAI_1 = 7; // 1世代 + private static final int VARIETY_SHIDAI_2 = 8; // 2世代 + private static final int VARIETY_SHIDAI_3 = 9; // 3世代 + private static final int VARIETY_SHIDAI_4 = 10; // 4世代 + + /** 品种ID到名称的映射 */ + private static final Map VARIETY_NAME_MAP = new HashMap<>(); + static { + VARIETY_NAME_MAP.put(1, "湖羊"); + VARIETY_NAME_MAP.put(2, "东佛里生"); + VARIETY_NAME_MAP.put(3, "回交"); + VARIETY_NAME_MAP.put(4, "级杂一代"); + VARIETY_NAME_MAP.put(5, "级杂二代"); + VARIETY_NAME_MAP.put(6, "级杂三代"); + VARIETY_NAME_MAP.put(7, "1世代"); + VARIETY_NAME_MAP.put(8, "2世代"); + VARIETY_NAME_MAP.put(9, "3世代"); + VARIETY_NAME_MAP.put(10, "4世代"); + } + + @Override + public ScEmbryoFlush selectScEmbryoFlushById(Long id) + { + return scEmbryoFlushMapper.selectScEmbryoFlushById(id); + } + + @Override + public List selectScEmbryoFlushList(ScEmbryoFlush scEmbryoFlush) + { + return scEmbryoFlushMapper.selectScEmbryoFlushList(scEmbryoFlush); + } + + @Override + public int insertScEmbryoFlush(ScEmbryoFlush scEmbryoFlush) + { + calculateEmbryoCount(scEmbryoFlush); + return scEmbryoFlushMapper.insertScEmbryoFlush(scEmbryoFlush); + } + + @Override + public int updateScEmbryoFlush(ScEmbryoFlush scEmbryoFlush) + { + calculateEmbryoCount(scEmbryoFlush); + return scEmbryoFlushMapper.updateScEmbryoFlush(scEmbryoFlush); + } + + @Override + public int deleteScEmbryoFlushByIds(Long[] ids) + { + return scEmbryoFlushMapper.deleteScEmbryoFlushByIds(ids); + } + + @Override + public int deleteScEmbryoFlushById(Long id) + { + return scEmbryoFlushMapper.deleteScEmbryoFlushById(id); + } + + /** + * 计算冲胚数和有效胚数量 + */ + private void calculateEmbryoCount(ScEmbryoFlush flush) + { + int gradeAPlus = flush.getGradeAPlus() != null ? flush.getGradeAPlus() : 0; + int gradeA = flush.getGradeA() != null ? flush.getGradeA() : 0; + int gradeB = flush.getGradeB() != null ? flush.getGradeB() : 0; + int gradeC = flush.getGradeC() != null ? flush.getGradeC() : 0; + int gradeD = flush.getGradeD() != null ? flush.getGradeD() : 0; + int cell24 = flush.getCell24() != null ? flush.getCell24() : 0; + int cell8 = flush.getCell8() != null ? flush.getCell8() : 0; + int cell16 = flush.getCell16() != null ? flush.getCell16() : 0; + int unfertilized = flush.getUnfertilized() != null ? flush.getUnfertilized() : 0; + int degenerated = flush.getDegenerated() != null ? flush.getDegenerated() : 0; + + // 有效胚 = A+ + A + B + C + D + flush.setValidEmbryo(gradeAPlus + gradeA + gradeB + gradeC + gradeD); + + // 冲胚数 = 所有数量求和 + flush.setTotalEmbryo(gradeAPlus + gradeA + gradeB + gradeC + gradeD + + cell24 + cell8 + cell16 + unfertilized + degenerated); + } + + /** + * 根据供体母羊耳号获取关联信息 + */ + @Override + public Map getDonorRelatedInfo(String donorFemaleNo) + { + Map result = new HashMap<>(); + + if (donorFemaleNo == null || donorFemaleNo.trim().isEmpty()) { + return result; + } + + // 1. 查询母羊信息 + Map femaleInfo = scEmbryoFlushMapper.selectSheepInfoByManageTag(donorFemaleNo); + if (femaleInfo == null || femaleInfo.isEmpty()) { + return result; + } + + String femaleVariety = (String) femaleInfo.get("variety"); + Integer femaleVarietyId = getIntValue(femaleInfo.get("varietyId")); + + result.put("donorFemaleVariety", femaleVariety); + result.put("donorFemaleVarietyId", femaleVarietyId); + result.put("ranchId", femaleInfo.get("ranchId")); + result.put("ranchName", femaleInfo.get("ranchName")); + + // 2. 查询配种记录获取公羊信息 + Map breedRecord = scEmbryoFlushMapper.selectBreedRecordByEwe(donorFemaleNo); + if (breedRecord != null && !breedRecord.isEmpty()) { + String ramId = (String) breedRecord.get("ramId"); + result.put("donorMaleNo", ramId); + result.put("matingDate", breedRecord.get("matingDate")); + + // 3. 查询公羊品种 + if (ramId != null && !ramId.trim().isEmpty()) { + Map maleInfo = scEmbryoFlushMapper.selectSheepInfoByManageTag(ramId); + if (maleInfo != null && !maleInfo.isEmpty()) { + String maleVariety = (String) maleInfo.get("variety"); + Integer maleVarietyId = getIntValue(maleInfo.get("varietyId")); + + result.put("donorMaleVariety", maleVariety); + result.put("donorMaleVarietyId", maleVarietyId); + + // 4. 根据品种ID计算胚胎品种 + if (maleVarietyId != null && femaleVarietyId != null) { + String embryoVariety = calculateEmbryoVarietyById(maleVarietyId, femaleVarietyId); + result.put("embryoVariety", embryoVariety); + } + } + } + } + + return result; + } + + /** + * 安全获取Integer值 + */ + private Integer getIntValue(Object obj) { + if (obj == null) { + return null; + } + if (obj instanceof Integer) { + return (Integer) obj; + } + if (obj instanceof Long) { + return ((Long) obj).intValue(); + } + if (obj instanceof Number) { + return ((Number) obj).intValue(); + } + try { + return Integer.parseInt(obj.toString()); + } catch (NumberFormatException e) { + return null; + } + } + + /** + * 根据品种名称获取ID + */ + private Integer getVarietyIdByName(String name) { + if (name == null) return null; + for (Map.Entry entry : VARIETY_NAME_MAP.entrySet()) { + if (entry.getValue().equals(name)) { + return entry.getKey(); + } + } + return null; + } + + /** + * 根据父母品种名称计算胚胎品种(接口方法) + */ + @Override + public String calculateEmbryoVariety(String maleVariety, String femaleVariety) + { + Integer maleId = getVarietyIdByName(maleVariety); + Integer femaleId = getVarietyIdByName(femaleVariety); + if (maleId == null || femaleId == null) { + return null; + } + return calculateEmbryoVarietyById(maleId, femaleId); + } + + /** + * 根据父母品种ID计算胚胎品种(核心计算方法) + * + * 品种规则: + * 1-湖羊, 2-东佛里生, 3-回交, 4-级杂一代, 5-级杂二代, 6-级杂三代, 7-1世代, 8-2世代, 9-3世代, 10-4世代 + * + * 计算规则(根据图片): + * - 湖羊(公) × 湖羊(母) → 湖羊 + * - 东佛里生(公) × 东佛里生(母) → 东佛里生 + * - 东佛里生(公) × 湖羊(母) → 级杂一代 + * - 东佛里生(公) × 级杂一代(母) → 级杂二代 + * - 东佛里生(公) × 级杂二代(母) → 级杂三代 + * - 东佛里生(公) × 级杂三代(母) → 东佛里生 + * - 湖羊(公) × 级杂三代(母) → 回交 + * - 湖羊(公) × 回交(母) → 回交 + * - 世代计算... + * + * @param maleVarietyId 公羊品种ID + * @param femaleVarietyId 母羊品种ID + * @return 胚胎品种名称 + */ + public String calculateEmbryoVarietyById(Integer maleVarietyId, Integer femaleVarietyId) + { + if (maleVarietyId == null || femaleVarietyId == null) { + return null; + } + + int male = maleVarietyId; + int female = femaleVarietyId; + + // 湖羊(公) × 湖羊(母) → 湖羊 + if (male == VARIETY_HUYANG && female == VARIETY_HUYANG) { + return VARIETY_NAME_MAP.get(VARIETY_HUYANG); + } + + // 东佛里生(公) × 东佛里生(母) → 东佛里生 + if (male == VARIETY_DONGFULISHENG && female == VARIETY_DONGFULISHENG) { + return VARIETY_NAME_MAP.get(VARIETY_DONGFULISHENG); + } + + // 东佛里生(公) × 湖羊(母) → 级杂一代 + if (male == VARIETY_DONGFULISHENG && female == VARIETY_HUYANG) { + return VARIETY_NAME_MAP.get(VARIETY_JIZA_1); + } + + // 东佛里生(公) × 级杂一代(母) → 级杂二代 + if (male == VARIETY_DONGFULISHENG && female == VARIETY_JIZA_1) { + return VARIETY_NAME_MAP.get(VARIETY_JIZA_2); + } + + // 东佛里生(公) × 级杂二代(母) → 级杂三代 + if (male == VARIETY_DONGFULISHENG && female == VARIETY_JIZA_2) { + return VARIETY_NAME_MAP.get(VARIETY_JIZA_3); + } + + // 东佛里生(公) × 级杂三代(母) → 东佛里生 + if (male == VARIETY_DONGFULISHENG && female == VARIETY_JIZA_3) { + return VARIETY_NAME_MAP.get(VARIETY_DONGFULISHENG); + } + + // 湖羊(公) × 级杂三代(母) → 回交 + if (male == VARIETY_HUYANG && female == VARIETY_JIZA_3) { + return VARIETY_NAME_MAP.get(VARIETY_HUIJIAO); + } + + // 湖羊(公) × 回交(母) → 回交 + if (male == VARIETY_HUYANG && female == VARIETY_HUIJIAO) { + return VARIETY_NAME_MAP.get(VARIETY_HUIJIAO); + } + + // ========== 世代计算规则 ========== + // 级杂二代(BM)或n世代(SM) × 级杂一代/级杂二代/级杂三代/回交(公) → 世代 + + // 判断公羊是否为可产生世代的品种(级杂一代/二代/三代/回交) + boolean isMaleForShidai = (male == VARIETY_JIZA_1 || male == VARIETY_JIZA_2 || + male == VARIETY_JIZA_3 || male == VARIETY_HUIJIAO); + + if (isMaleForShidai) { + // 级杂二代(母) × 以上公羊 → 1世代 + if (female == VARIETY_JIZA_2) { + return VARIETY_NAME_MAP.get(VARIETY_SHIDAI_1); + } + // 1世代(母) × 以上公羊 → 2世代 + if (female == VARIETY_SHIDAI_1) { + return VARIETY_NAME_MAP.get(VARIETY_SHIDAI_2); + } + // 2世代(母) × 以上公羊 → 3世代 + if (female == VARIETY_SHIDAI_2) { + return VARIETY_NAME_MAP.get(VARIETY_SHIDAI_3); + } + // 3世代(母) × 以上公羊 → 4世代 + if (female == VARIETY_SHIDAI_3) { + return VARIETY_NAME_MAP.get(VARIETY_SHIDAI_4); + } + } + + // 默认返回null,表示无法计算或规则未覆盖 + return null; + } + + @Override + public List> selectDonorFemaleList() + { + return scEmbryoFlushMapper.selectDonorFemaleList(); + } +} \ No newline at end of file diff --git a/zhyc-module/src/main/resources/mapper/produce/breed/ScBreedRecordMapper.xml b/zhyc-module/src/main/resources/mapper/produce/breed/ScBreedRecordMapper.xml index c03c285..639480d 100644 --- a/zhyc-module/src/main/resources/mapper/produce/breed/ScBreedRecordMapper.xml +++ b/zhyc-module/src/main/resources/mapper/produce/breed/ScBreedRecordMapper.xml @@ -53,7 +53,7 @@ br.breed_type, br.create_by, br.create_time, - -- 母羊信息(从视图获取) + -- 母羊信息(从视图获取) ewe_view.bs_manage_tags as ewe_manage_tags, ewe_view.variety as ewe_variety, ewe_view.parity as ewe_parity, @@ -65,16 +65,18 @@ ewe_view.dr_ranch as ranch_name, ewe_view.name as sheep_type, ewe_view.mating_total as mating_count, - -- 公羊信息(从视图获取) + -- 公羊信息(从视图获取) ram_view.bs_manage_tags as ram_manage_tags, ram_view.variety as ram_variety, - -- 配种方式显示 + -- 配种方式显示(修改:增加3-冲胚、4-自然发情人工授精) CASE br.breed_type WHEN 1 THEN '同期发情' WHEN 2 THEN '本交' + WHEN 3 THEN '冲胚' + WHEN 4 THEN '自然发情人工授精' ELSE '未知' END as mating_type, - -- 发情后配种时间(小时数) + -- 发情后配种时间(小时数) TIMESTAMPDIFF(HOUR, br.create_time, NOW()) as time_since_planning, -- 孕检相关信息 pr.datetime as pregnancy_check_date, @@ -225,6 +227,8 @@ CASE bp.breed_type WHEN 1 THEN '同期发情' WHEN 2 THEN '本交' + WHEN 3 THEN '冲胚' + WHEN 4 THEN '自然发情人工授精' ELSE '未知' END as breed_type_name, TIMESTAMPDIFF(HOUR, NOW(), NOW()) as hours_since_plan @@ -236,7 +240,7 @@ limit 1 - + + + + + and flush_time between #{params.beginFlushTime} and #{params.endFlushTime} + + and donor_female_no like concat('%', #{donorFemaleNo}, '%') + and donor_male_no like concat('%', #{donorMaleNo}, '%') + and embryo_variety = #{embryoVariety} + and embryo_type = #{embryoType} + and embryo_source = #{embryoSource} + and flush_operator like concat('%', #{flushOperator}, '%') + and collect_operator like concat('%', #{collectOperator}, '%') + and ranch_id = #{ranchId} + + order by flush_time desc + + + + + + insert into sc_embryo_flush + + flush_time, + donor_female_no, + donor_female_variety, + donor_male_no, + donor_male_variety, + embryo_variety, + embryo_age, + grade_a_plus, + grade_a, + grade_b, + grade_c, + grade_d, + cell_2_4, + cell_8, + cell_16, + unfertilized, + degenerated, + total_embryo, + valid_embryo, + transferred, + recipient_cnt, + embryo_type, + embryo_source, + destination, + storage_method, + flush_operator, + collect_operator, + ranch_id, + ranch_name, + remark, + + + #{flushTime}, + #{donorFemaleNo}, + #{donorFemaleVariety}, + #{donorMaleNo}, + #{donorMaleVariety}, + #{embryoVariety}, + #{embryoAge}, + #{gradeAPlus}, + #{gradeA}, + #{gradeB}, + #{gradeC}, + #{gradeD}, + #{cell24}, + #{cell8}, + #{cell16}, + #{unfertilized}, + #{degenerated}, + #{totalEmbryo}, + #{validEmbryo}, + #{transferred}, + #{recipientCnt}, + #{embryoType}, + #{embryoSource}, + #{destination}, + #{storageMethod}, + #{flushOperator}, + #{collectOperator}, + #{ranchId}, + #{ranchName}, + #{remark}, + + + + + update sc_embryo_flush + + flush_time = #{flushTime}, + donor_female_no = #{donorFemaleNo}, + donor_female_variety = #{donorFemaleVariety}, + donor_male_no = #{donorMaleNo}, + donor_male_variety = #{donorMaleVariety}, + embryo_variety = #{embryoVariety}, + embryo_age = #{embryoAge}, + grade_a_plus = #{gradeAPlus}, + grade_a = #{gradeA}, + grade_b = #{gradeB}, + grade_c = #{gradeC}, + grade_d = #{gradeD}, + cell_2_4 = #{cell24}, + cell_8 = #{cell8}, + cell_16 = #{cell16}, + unfertilized = #{unfertilized}, + degenerated = #{degenerated}, + total_embryo = #{totalEmbryo}, + valid_embryo = #{validEmbryo}, + transferred = #{transferred}, + recipient_cnt = #{recipientCnt}, + embryo_type = #{embryoType}, + embryo_source = #{embryoSource}, + destination = #{destination}, + storage_method = #{storageMethod}, + flush_operator = #{flushOperator}, + collect_operator = #{collectOperator}, + ranch_id = #{ranchId}, + ranch_name = #{ranchName}, + remark = #{remark}, + + where id = #{id} + + + + delete from sc_embryo_flush where id = #{id} + + + + delete from sc_embryo_flush where id in + + #{id} + + + + + + + + + + + + + \ No newline at end of file From 5ae4af6c44bd679d71bdeb877c2c56679f17c87e Mon Sep 17 00:00:00 2001 From: HashMap Date: Mon, 1 Dec 2025 20:24:30 +0800 Subject: [PATCH 4/8] =?UTF-8?q?feat(Frozen/Sale=20[New]):=20=E9=94=80?= =?UTF-8?q?=E5=94=AE=E4=B8=BB=E8=A1=A8=20|=20=E6=98=8E=E7=BB=86=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 销售主子表管理功能 [skip ci] --- .../frozen/controller/DdSaleController.java | 104 ++++++++++ .../com/zhyc/module/frozen/domain/DdSale.java | 194 ++++++++++++++++++ .../zhyc/module/frozen/domain/DdSaleItem.java | 151 ++++++++++++++ .../module/frozen/mapper/DdSaleMapper.java | 87 ++++++++ .../module/frozen/service/IDdSaleService.java | 61 ++++++ .../service/impl/DdSaleServiceImpl.java | 133 ++++++++++++ .../mapper/frozen/sale/DdSaleMapper.xml | 150 ++++++++++++++ 7 files changed, 880 insertions(+) create mode 100644 zhyc-module/src/main/java/com/zhyc/module/frozen/controller/DdSaleController.java create mode 100644 zhyc-module/src/main/java/com/zhyc/module/frozen/domain/DdSale.java create mode 100644 zhyc-module/src/main/java/com/zhyc/module/frozen/domain/DdSaleItem.java create mode 100644 zhyc-module/src/main/java/com/zhyc/module/frozen/mapper/DdSaleMapper.java create mode 100644 zhyc-module/src/main/java/com/zhyc/module/frozen/service/IDdSaleService.java create mode 100644 zhyc-module/src/main/java/com/zhyc/module/frozen/service/impl/DdSaleServiceImpl.java create mode 100644 zhyc-module/src/main/resources/mapper/frozen/sale/DdSaleMapper.xml diff --git a/zhyc-module/src/main/java/com/zhyc/module/frozen/controller/DdSaleController.java b/zhyc-module/src/main/java/com/zhyc/module/frozen/controller/DdSaleController.java new file mode 100644 index 0000000..d78b11f --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/frozen/controller/DdSaleController.java @@ -0,0 +1,104 @@ +package com.zhyc.module.frozen.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.zhyc.common.annotation.Log; +import com.zhyc.common.core.controller.BaseController; +import com.zhyc.common.core.domain.AjaxResult; +import com.zhyc.common.enums.BusinessType; +import com.zhyc.module.frozen.domain.DdSale; +import com.zhyc.module.frozen.service.IDdSaleService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 销售主单Controller + * + * @author HashMap + * @date 2025-12-01 + */ +@RestController +@RequestMapping("/sale/sale") +public class DdSaleController extends BaseController +{ + @Autowired + private IDdSaleService ddSaleService; + + /** + * 查询销售主单列表 + */ + @PreAuthorize("@ss.hasPermi('sale:sale:list')") + @GetMapping("/list") + public TableDataInfo list(DdSale ddSale) + { + startPage(); + List list = ddSaleService.selectDdSaleList(ddSale); + return getDataTable(list); + } + + /** + * 导出销售主单列表 + */ + @PreAuthorize("@ss.hasPermi('sale:sale:export')") + @Log(title = "销售主单", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, DdSale ddSale) + { + List list = ddSaleService.selectDdSaleList(ddSale); + ExcelUtil util = new ExcelUtil(DdSale.class); + util.exportExcel(response, list, "销售主单数据"); + } + + /** + * 获取销售主单详细信息 + */ + @PreAuthorize("@ss.hasPermi('sale:sale:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(ddSaleService.selectDdSaleById(id)); + } + + /** + * 新增销售主单 + */ + @PreAuthorize("@ss.hasPermi('sale:sale:add')") + @Log(title = "销售主单", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody DdSale ddSale) + { + return toAjax(ddSaleService.insertDdSale(ddSale)); + } + + /** + * 修改销售主单 + */ + @PreAuthorize("@ss.hasPermi('sale:sale:edit')") + @Log(title = "销售主单", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody DdSale ddSale) + { + return toAjax(ddSaleService.updateDdSale(ddSale)); + } + + /** + * 删除销售主单 + */ + @PreAuthorize("@ss.hasPermi('sale:sale:remove')") + @Log(title = "销售主单", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(ddSaleService.deleteDdSaleByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/frozen/domain/DdSale.java b/zhyc-module/src/main/java/com/zhyc/module/frozen/domain/DdSale.java new file mode 100644 index 0000000..dc112c6 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/frozen/domain/DdSale.java @@ -0,0 +1,194 @@ +package com.zhyc.module.frozen.domain; + +import java.math.BigDecimal; +import java.util.List; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 销售主单对象 dd_sl + * + * @author HashMap + * @date 2025-12-01 + */ +public class DdSale extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 销售日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "销售日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date saleDate; + + /** 客户名称 */ + @Excel(name = "客户名称") + private String custName; + + /** 客户电话 */ + @Excel(name = "客户电话") + private String custPhone; + + /** 客户地址 */ + @Excel(name = "客户地址") + private String custAddr; + + /** 销售人员 */ + @Excel(name = "销售人员") + private String salesper; + + /** 检疫证号(可选) */ + @Excel(name = "检疫证号", readConverterExp = "可=选") + private String quaranNo; + + /** 审批编号(可选) */ + @Excel(name = "审批编号", readConverterExp = "可=选") + private String apprNo; + + /** 总价 */ + @Excel(name = "总价") + private BigDecimal price; + + /** 技术员 */ + @Excel(name = "技术员") + private String tech; + + /** 销售明细信息 */ + private List ddSaleItemList; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public void setSaleDate(Date saleDate) + { + this.saleDate = saleDate; + } + + public Date getSaleDate() + { + return saleDate; + } + + public void setCustName(String custName) + { + this.custName = custName; + } + + public String getCustName() + { + return custName; + } + + public void setCustPhone(String custPhone) + { + this.custPhone = custPhone; + } + + public String getCustPhone() + { + return custPhone; + } + + public void setCustAddr(String custAddr) + { + this.custAddr = custAddr; + } + + public String getCustAddr() + { + return custAddr; + } + + public void setSalesper(String salesper) + { + this.salesper = salesper; + } + + public String getSalesper() + { + return salesper; + } + + public void setQuaranNo(String quaranNo) + { + this.quaranNo = quaranNo; + } + + public String getQuaranNo() + { + return quaranNo; + } + + public void setApprNo(String apprNo) + { + this.apprNo = apprNo; + } + + public String getApprNo() + { + return apprNo; + } + + public void setPrice(BigDecimal price) + { + this.price = price; + } + + public BigDecimal getPrice() + { + return price; + } + + public void setTech(String tech) + { + this.tech = tech; + } + + public String getTech() + { + return tech; + } + + public List getDdSaleItemList() + { + return ddSaleItemList; + } + + public void setDdSaleItemList(List ddSaleItemList) + { + this.ddSaleItemList = ddSaleItemList; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("saleDate", getSaleDate()) + .append("custName", getCustName()) + .append("custPhone", getCustPhone()) + .append("custAddr", getCustAddr()) + .append("salesper", getSalesper()) + .append("quaranNo", getQuaranNo()) + .append("apprNo", getApprNo()) + .append("price", getPrice()) + .append("tech", getTech()) + .append("remark", getRemark()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("ddSaleItemList", getDdSaleItemList()) + .toString(); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/frozen/domain/DdSaleItem.java b/zhyc-module/src/main/java/com/zhyc/module/frozen/domain/DdSaleItem.java new file mode 100644 index 0000000..99a1a2c --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/frozen/domain/DdSaleItem.java @@ -0,0 +1,151 @@ +package com.zhyc.module.frozen.domain; + +import java.math.BigDecimal; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 销售明细对象 dd_sl_item + * + * @author HashMap + * @date 2025-12-01 + */ +public class DdSaleItem extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 销售主单ID */ + @Excel(name = "销售主单ID") + private Long saleId; + + /** 明细类型(冻胚embryo冻精semen) */ + @Excel(name = "明细类型", readConverterExp = "冻=胚embryo冻精semen") + private String itemType; + + /** 胚胎编号或冻精号 */ + @Excel(name = "胚胎编号或冻精号") + private String itemCode; + + /** 数量 */ + @Excel(name = "数量") + private Long qty; + + /** 单价(元) */ + @Excel(name = "单价", readConverterExp = "元=") + private BigDecimal unitPrice; + + /** 所在液氮罐ID */ + @Excel(name = "所在液氮罐ID") + private Long tankId; + + /** 所在提桶ID */ + @Excel(name = "所在提桶ID") + private Long bucketId; + + /** 所在冷冻架ID */ + @Excel(name = "所在冷冻架ID") + private Long rackId; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setSaleId(Long saleId) + { + this.saleId = saleId; + } + + public Long getSaleId() + { + return saleId; + } + public void setItemType(String itemType) + { + this.itemType = itemType; + } + + public String getItemType() + { + return itemType; + } + public void setItemCode(String itemCode) + { + this.itemCode = itemCode; + } + + public String getItemCode() + { + return itemCode; + } + public void setQty(Long qty) + { + this.qty = qty; + } + + public Long getQty() + { + return qty; + } + public void setUnitPrice(BigDecimal unitPrice) + { + this.unitPrice = unitPrice; + } + + public BigDecimal getUnitPrice() + { + return unitPrice; + } + public void setTankId(Long tankId) + { + this.tankId = tankId; + } + + public Long getTankId() + { + return tankId; + } + public void setBucketId(Long bucketId) + { + this.bucketId = bucketId; + } + + public Long getBucketId() + { + return bucketId; + } + public void setRackId(Long rackId) + { + this.rackId = rackId; + } + + public Long getRackId() + { + return rackId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("saleId", getSaleId()) + .append("itemType", getItemType()) + .append("itemCode", getItemCode()) + .append("qty", getQty()) + .append("unitPrice", getUnitPrice()) + .append("tankId", getTankId()) + .append("bucketId", getBucketId()) + .append("rackId", getRackId()) + .append("createTime", getCreateTime()) + .toString(); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/frozen/mapper/DdSaleMapper.java b/zhyc-module/src/main/java/com/zhyc/module/frozen/mapper/DdSaleMapper.java new file mode 100644 index 0000000..0094fd3 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/frozen/mapper/DdSaleMapper.java @@ -0,0 +1,87 @@ +package com.zhyc.module.frozen.mapper; + +import java.util.List; +import com.zhyc.module.frozen.domain.DdSale; +import com.zhyc.module.frozen.domain.DdSaleItem; + +/** + * 销售主单Mapper接口 + * + * @author HashMap + * @date 2025-12-01 + */ +public interface DdSaleMapper +{ + /** + * 查询销售主单 + * + * @param id 销售主单主键 + * @return 销售主单 + */ + public DdSale selectDdSaleById(Long id); + + /** + * 查询销售主单列表 + * + * @param ddSale 销售主单 + * @return 销售主单集合 + */ + public List selectDdSaleList(DdSale ddSale); + + /** + * 新增销售主单 + * + * @param ddSale 销售主单 + * @return 结果 + */ + public int insertDdSale(DdSale ddSale); + + /** + * 修改销售主单 + * + * @param ddSale 销售主单 + * @return 结果 + */ + public int updateDdSale(DdSale ddSale); + + /** + * 删除销售主单 + * + * @param id 销售主单主键 + * @return 结果 + */ + public int deleteDdSaleById(Long id); + + /** + * 批量删除销售主单 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteDdSaleByIds(Long[] ids); + + /** + * 批量删除销售明细 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteDdSaleItemBySaleIds(Long[] ids); + + /** + * 批量新增销售明细 + * + * @param ddSaleItemList 销售明细列表 + * @return 结果 + */ + public int batchDdSaleItem(List ddSaleItemList); + + + /** + * 通过销售主单主键删除销售明细信息 + * + * @param id 销售主单ID + * @return 结果 + */ + public int deleteDdSaleItemBySaleId(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/frozen/service/IDdSaleService.java b/zhyc-module/src/main/java/com/zhyc/module/frozen/service/IDdSaleService.java new file mode 100644 index 0000000..75340d8 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/frozen/service/IDdSaleService.java @@ -0,0 +1,61 @@ +package com.zhyc.module.frozen.service; + +import java.util.List; +import com.zhyc.module.frozen.domain.DdSale; + +/** + * 销售主单Service接口 + * + * @author HashMap + * @date 2025-12-01 + */ +public interface IDdSaleService +{ + /** + * 查询销售主单 + * + * @param id 销售主单主键 + * @return 销售主单 + */ + public DdSale selectDdSaleById(Long id); + + /** + * 查询销售主单列表 + * + * @param ddSale 销售主单 + * @return 销售主单集合 + */ + public List selectDdSaleList(DdSale ddSale); + + /** + * 新增销售主单 + * + * @param ddSale 销售主单 + * @return 结果 + */ + public int insertDdSale(DdSale ddSale); + + /** + * 修改销售主单 + * + * @param ddSale 销售主单 + * @return 结果 + */ + public int updateDdSale(DdSale ddSale); + + /** + * 批量删除销售主单 + * + * @param ids 需要删除的销售主单主键集合 + * @return 结果 + */ + public int deleteDdSaleByIds(Long[] ids); + + /** + * 删除销售主单信息 + * + * @param id 销售主单主键 + * @return 结果 + */ + public int deleteDdSaleById(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/frozen/service/impl/DdSaleServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/frozen/service/impl/DdSaleServiceImpl.java new file mode 100644 index 0000000..d2827f5 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/frozen/service/impl/DdSaleServiceImpl.java @@ -0,0 +1,133 @@ +package com.zhyc.module.frozen.service.impl; + +import java.util.List; +import com.zhyc.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import java.util.ArrayList; +import com.zhyc.common.utils.StringUtils; +import org.springframework.transaction.annotation.Transactional; +import com.zhyc.module.frozen.domain.DdSaleItem; +import com.zhyc.module.frozen.mapper.DdSaleMapper; +import com.zhyc.module.frozen.domain.DdSale; +import com.zhyc.module.frozen.service.IDdSaleService; + +/** + * 销售主单Service业务层处理 + * + * @author HashMap + * @date 2025-12-01 + */ +@Service +public class DdSaleServiceImpl implements IDdSaleService +{ + @Autowired + private DdSaleMapper ddSaleMapper; + + /** + * 查询销售主单 + * + * @param id 销售主单主键 + * @return 销售主单 + */ + @Override + public DdSale selectDdSaleById(Long id) + { + return ddSaleMapper.selectDdSaleById(id); + } + + /** + * 查询销售主单列表 + * + * @param ddSale 销售主单 + * @return 销售主单 + */ + @Override + public List selectDdSaleList(DdSale ddSale) + { + return ddSaleMapper.selectDdSaleList(ddSale); + } + + /** + * 新增销售主单 + * + * @param ddSale 销售主单 + * @return 结果 + */ + @Transactional + @Override + public int insertDdSale(DdSale ddSale) + { + ddSale.setCreateTime(DateUtils.getNowDate()); + int rows = ddSaleMapper.insertDdSale(ddSale); + insertDdSaleItem(ddSale); + return rows; + } + + /** + * 修改销售主单 + * + * @param ddSale 销售主单 + * @return 结果 + */ + @Transactional + @Override + public int updateDdSale(DdSale ddSale) + { + ddSaleMapper.deleteDdSaleItemBySaleId(ddSale.getId()); + insertDdSaleItem(ddSale); + return ddSaleMapper.updateDdSale(ddSale); + } + + /** + * 批量删除销售主单 + * + * @param ids 需要删除的销售主单主键 + * @return 结果 + */ + @Transactional + @Override + public int deleteDdSaleByIds(Long[] ids) + { + ddSaleMapper.deleteDdSaleItemBySaleIds(ids); + return ddSaleMapper.deleteDdSaleByIds(ids); + } + + /** + * 删除销售主单信息 + * + * @param id 销售主单主键 + * @return 结果 + */ + @Transactional + @Override + public int deleteDdSaleById(Long id) + { + ddSaleMapper.deleteDdSaleItemBySaleId(id); + return ddSaleMapper.deleteDdSaleById(id); + } + + /** + * 新增销售明细信息 + * + * @param ddSale 销售主单对象 + */ + public void insertDdSaleItem(DdSale ddSale) + { + List ddSaleItemList = ddSale.getDdSaleItemList(); + Long id = ddSale.getId(); + if (StringUtils.isNotNull(ddSaleItemList)) + { + List list = new ArrayList(); + for (DdSaleItem ddSaleItem : ddSaleItemList) + { + ddSaleItem.setSaleId(id); + list.add(ddSaleItem); + } + if (list.size() > 0) + { + ddSaleMapper.batchDdSaleItem(list); + } + } + } +} diff --git a/zhyc-module/src/main/resources/mapper/frozen/sale/DdSaleMapper.xml b/zhyc-module/src/main/resources/mapper/frozen/sale/DdSaleMapper.xml new file mode 100644 index 0000000..7011ee2 --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/frozen/sale/DdSaleMapper.xml @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, sale_date, cust_name, cust_phone, cust_addr, salesper, quaran_no, appr_no, price, tech, remark, create_by, create_time from dd_sl + + + + + + + + + + insert into dd_sl + + sale_date, + cust_name, + cust_phone, + cust_addr, + salesper, + quaran_no, + appr_no, + price, + tech, + remark, + create_by, + create_time, + + + #{saleDate}, + #{custName}, + #{custPhone}, + #{custAddr}, + #{salesper}, + #{quaranNo}, + #{apprNo}, + #{price}, + #{tech}, + #{remark}, + #{createBy}, + #{createTime}, + + + + + update dd_sl + + sale_date = #{saleDate}, + cust_name = #{custName}, + cust_phone = #{custPhone}, + cust_addr = #{custAddr}, + salesper = #{salesper}, + quaran_no = #{quaranNo}, + appr_no = #{apprNo}, + price = #{price}, + tech = #{tech}, + remark = #{remark}, + create_by = #{createBy}, + create_time = #{createTime}, + + where id = #{id} + + + + delete from dd_sl where id = #{id} + + + + delete from dd_sl where id in + + #{id} + + + + + delete from dd_sl_item where sale_id in + + #{saleId} + + + + + delete from dd_sl_item where sale_id = #{saleId} + + + + insert into dd_sl_item( id, sale_id, item_type, item_code, qty, unit_price, tank_id, bucket_id, rack_id, create_time) values + + ( #{item.id}, #{item.saleId}, #{item.itemType}, #{item.itemCode}, #{item.qty}, #{item.unitPrice}, #{item.tankId}, #{item.bucketId}, #{item.rackId}, #{item.createTime}) + + + \ No newline at end of file From f95798707973edcd482234d43afc7d2c8255f244 Mon Sep 17 00:00:00 2001 From: zyh <2066096076@qq.com> Date: Thu, 4 Dec 2025 16:36:16 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E5=86=BB=E8=83=9A=E5=86=BB=E7=B2=BE?= =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frozen/controller/DdFeController.java | 68 +++++- .../frozen/controller/DdFsController.java | 10 + .../com/zhyc/module/frozen/domain/DdFe.java | 16 +- .../com/zhyc/module/frozen/domain/DdFs.java | 216 +++++++++--------- .../zhyc/module/frozen/mapper/DdFeMapper.java | 14 ++ .../module/frozen/service/IDdFeService.java | 27 ++- .../module/frozen/service/IDdFsService.java | 21 +- .../frozen/service/impl/DdFeServiceImpl.java | 54 ++++- .../frozen/service/impl/DdFsServiceImpl.java | 76 ++++-- .../resources/mapper/frozen/DdFeMapper.xml | 123 +++++++--- .../resources/mapper/frozen/DdFsMapper.xml | 8 +- .../bodyManage/ScBodyMeasureMapper.xml | 25 +- .../produce/bodyManage/ScBodyScoreMapper.xml | 7 +- .../bodyManage/ScBreastRatingMapper.xml | 8 +- 14 files changed, 434 insertions(+), 239 deletions(-) diff --git a/zhyc-module/src/main/java/com/zhyc/module/frozen/controller/DdFeController.java b/zhyc-module/src/main/java/com/zhyc/module/frozen/controller/DdFeController.java index 88237eb..979b92c 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/frozen/controller/DdFeController.java +++ b/zhyc-module/src/main/java/com/zhyc/module/frozen/controller/DdFeController.java @@ -1,17 +1,14 @@ package com.zhyc.module.frozen.controller; import java.util.List; +import java.util.Map; import javax.servlet.http.HttpServletResponse; + +import com.zhyc.common.utils.SecurityUtils; +import com.zhyc.common.utils.StringUtils; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import com.zhyc.common.annotation.Log; import com.zhyc.common.core.controller.BaseController; import com.zhyc.common.core.domain.AjaxResult; @@ -77,6 +74,7 @@ public class DdFeController extends BaseController @PostMapping public AjaxResult add(@RequestBody DdFe ddFe) { + ddFe.setCreateBy(SecurityUtils.getUsername()); return toAjax(ddFeService.insertDdFe(ddFe)); } @@ -101,4 +99,58 @@ public class DdFeController extends BaseController { return toAjax(ddFeService.deleteDdFeByIds(ids)); } + + /** + * 根据供体母羊耳号获取最近一次冲胚信息 + */ + @PreAuthorize("@ss.hasPermi('frozen:embryo:add')") + @GetMapping("/getFlushInfoByEwe/{eweNo}") + public AjaxResult getFlushInfoByEwe(@PathVariable("eweNo") String eweNo) { + if (StringUtils.isBlank(eweNo)) { + return error("耳号不能为空"); + } + Map echo = ddFeService.getLastFlushInfoByEwe(eweNo.trim()); + return echo == null ? error("该母羊无冲胚记录,请先录入冲胚记录") : success(echo); + } + + /** + * 根据母羊耳号 + 胚胎等级 返回该等级数量 + * 无记录返回 0 + */ + @PreAuthorize("@ss.hasPermi('frozen:embryo:add')") + @GetMapping("/getQtyByGrade") + public AjaxResult getQtyByGrade(@RequestParam String eweNo, + @RequestParam String grade) { + Map flush = ddFeService.getLastFlushInfoByEwe(eweNo); + if (flush == null) return success(0); + + Integer qty; + switch (grade) { + case "A": qty = (Integer) flush.getOrDefault("gradeA", 0); break; + case "B": qty = (Integer) flush.getOrDefault("gradeB", 0); break; + case "C": qty = (Integer) flush.getOrDefault("gradeC", 0); break; + case "D": qty = (Integer) flush.getOrDefault("gradeD", 0); break; + case "囊胚": qty = (Integer) flush.getOrDefault("cell24", 0); break; + case "桑椹胚": qty = (Integer) flush.getOrDefault("cell8", 0); break; + default: qty = 0; + } + return success(qty); + } + + /** + * 批量废弃 + */ + @PreAuthorize("@ss.hasPermi('frozen:embryo:discard')") + @Log(title = "冻胚库存", businessType = BusinessType.UPDATE) + @PutMapping("/batchDiscard") + public AjaxResult batchDiscard(@RequestBody List list) { + if (list == null || list.isEmpty()) { + return error("请选择要废弃的记录"); + } + list.forEach(dto -> { + dto.setStatus("废弃"); + ddFeService.discard(dto); + }); + return success(); + } } diff --git a/zhyc-module/src/main/java/com/zhyc/module/frozen/controller/DdFsController.java b/zhyc-module/src/main/java/com/zhyc/module/frozen/controller/DdFsController.java index 22f76a8..cda2832 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/frozen/controller/DdFsController.java +++ b/zhyc-module/src/main/java/com/zhyc/module/frozen/controller/DdFsController.java @@ -101,4 +101,14 @@ public class DdFsController extends BaseController { return toAjax(ddFsService.deleteDdFsByIds(ids)); } + + /** + * 批量废弃 + */ + @PreAuthorize("@ss.hasPermi('sperm:sperm:discard')") + @Log(title = "冻精库存", businessType = BusinessType.UPDATE) + @PutMapping("/discard") + public AjaxResult discard(@RequestBody List list) { + return AjaxResult.success(ddFsService.discard(list)); + } } diff --git a/zhyc-module/src/main/java/com/zhyc/module/frozen/domain/DdFe.java b/zhyc-module/src/main/java/com/zhyc/module/frozen/domain/DdFe.java index 6f04a2a..0bbab98 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/frozen/domain/DdFe.java +++ b/zhyc-module/src/main/java/com/zhyc/module/frozen/domain/DdFe.java @@ -21,11 +21,11 @@ public class DdFe extends BaseEntity private Long id; /** 胚胎编号 YS+日期+序号 */ - @Excel(name = "胚胎编号 YS+日期+序号") + @Excel(name = "胚胎编号") private String code; /** 冻胚日期(事件录入日) */ - @Excel(name = "冻胚日期", readConverterExp = "事=件录入日") + @Excel(name = "冻胚日期", dateFormat = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date freezeDate; @@ -46,11 +46,11 @@ public class DdFe extends BaseEntity private String deBreed; /** 胚胎品种(自动生成) */ - @Excel(name = "胚胎品种", readConverterExp = "自=动生成") + @Excel(name = "胚胎品种") private String embBreed; /** 胚胎阶段等级('A', 'B', 'C', 'D', '囊胚', '桑椹胚') */ - @Excel(name = "胚胎阶段等级('A', 'B', 'C', 'D', '囊胚', '桑椹胚')") + @Excel(name = "胚胎阶段等级") private String grade; /** 胚胎数量 */ @@ -58,11 +58,11 @@ public class DdFe extends BaseEntity private Long qty; /** 是否性控 1是 0否 */ - @Excel(name = "是否性控 1是 0否") + @Excel(name = "是否性控",readConverterExp = "1=是,0=否") private Integer sexCtl; /** 状态(0正常1销售 2自用3废弃) */ - @Excel(name = "状态(0正常1销售 2自用3废弃)") + @Excel(name = "状态") private String status; /** 技术员 */ @@ -82,12 +82,12 @@ public class DdFe extends BaseEntity private Long rackId; /** 出库日期(出库后回写) */ - @Excel(name = "出库日期", readConverterExp = "出=库后回写") + @Excel(name = "出库日期", dateFormat = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date outDate; /** 废弃原因(废弃时填写) */ - @Excel(name = "废弃原因", readConverterExp = "废=弃时填写") + @Excel(name = "废弃原因") private String discardTxt; public void setId(Long id) diff --git a/zhyc-module/src/main/java/com/zhyc/module/frozen/domain/DdFs.java b/zhyc-module/src/main/java/com/zhyc/module/frozen/domain/DdFs.java index 290d131..50e7c1b 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/frozen/domain/DdFs.java +++ b/zhyc-module/src/main/java/com/zhyc/module/frozen/domain/DdFs.java @@ -1,6 +1,7 @@ package com.zhyc.module.frozen.domain; import java.util.Date; + import com.fasterxml.jackson.annotation.JsonFormat; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; @@ -9,244 +10,245 @@ import com.zhyc.common.core.domain.BaseEntity; /** * 冻精库存对象 dd_fs - * + * * @author ruoyi * @date 2025-11-29 */ -public class DdFs extends BaseEntity -{ +public class DdFs extends BaseEntity { private static final long serialVersionUID = 1L; - /** 主键 */ + /** + * 主键 + */ private Long id; - /** 冻精号/公羊耳号 */ - @Excel(name = "冻精号/公羊耳号") + /** + * 冻精号/公羊耳号 + */ + @Excel(name = "冻精号") private String code; - /** 冻精日期(事件录入日) */ - @Excel(name = "冻精日期", readConverterExp = "事=件录入日") + /** + * 冻精日期(事件录入日) + */ + @Excel(name = "冻精日期", dateFormat = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date freezeDt; - /** 冻精品种(同公羊品种) */ - @Excel(name = "冻精品种", readConverterExp = "同=公羊品种") + /** + * 冻精品种(同公羊品种) + */ + @Excel(name = "冻精品种") private String breed; - /** 生产批次(日期格式) */ - @Excel(name = "生产批次", readConverterExp = "日=期格式") + /** + * 生产批次(日期格式) + */ + @Excel(name = "生产批次") private String batch; - /** 规格(0.25mL,0.5mL) */ - @Excel(name = "规格(0.25mL,0.5mL)") + /** + * 规格(0.25mL,0.5mL) + */ + @Excel(name = "规格") private String spec; - /** 数量(支) */ - @Excel(name = "数量", readConverterExp = "支=") + /** + * 数量(支) + */ + @Excel(name = "数量") private Long qty; - /** 是否性控 1是 0否 */ - @Excel(name = "是否性控 1是 0否") + /** + * 是否性控 1是 0否 + */ + @Excel(name = "是否性控", readConverterExp = "1=是,0=否") private Integer sexCtl; - /** 状态(0正常1销售2自用3废弃) */ - @Excel(name = "状态", readConverterExp = "0=正常1销售2自用3废弃") + /** + * 状态(0正常1销售2自用3废弃) + */ + @Excel(name = "状态") private String stat; - /** 技术员 */ + /** + * 技术员 + */ @Excel(name = "技术员") private String tech; - /** 液氮罐ID */ + /** + * 液氮罐ID + */ @Excel(name = "液氮罐ID") private Long tankId; - /** 提桶ID */ + /** + * 提桶ID + */ @Excel(name = "提桶ID") private Long bucketId; - /** 冷冻架ID */ + /** + * 冷冻架ID + */ @Excel(name = "冷冻架ID") private Long rackId; - /** 出库日期(出库后回写) */ - @Excel(name = "出库日期", readConverterExp = "出=库后回写") + /** + * 出库日期(出库后回写) + */ + @Excel(name = "出库日期", dateFormat = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date outDt; - /** 废弃原因 */ + /** + * 废弃原因 + */ @Excel(name = "废弃原因") private String discardTxt; - public void setId(Long id) - { + public void setId(Long id) { this.id = id; } - public Long getId() - { + public Long getId() { return id; } - public void setCode(String code) - { + public void setCode(String code) { this.code = code; } - public String getCode() - { + public String getCode() { return code; } - public void setFreezeDt(Date freezeDt) - { + public void setFreezeDt(Date freezeDt) { this.freezeDt = freezeDt; } - public Date getFreezeDt() - { + public Date getFreezeDt() { return freezeDt; } - public void setBreed(String breed) - { + public void setBreed(String breed) { this.breed = breed; } - public String getBreed() - { + public String getBreed() { return breed; } - public void setBatch(String batch) - { + public void setBatch(String batch) { this.batch = batch; } - public String getBatch() - { + public String getBatch() { return batch; } - public void setSpec(String spec) - { + public void setSpec(String spec) { this.spec = spec; } - public String getSpec() - { + public String getSpec() { return spec; } - public void setQty(Long qty) - { + public void setQty(Long qty) { this.qty = qty; } - public Long getQty() - { + public Long getQty() { return qty; } - public void setSexCtl(Integer sexCtl) - { + public void setSexCtl(Integer sexCtl) { this.sexCtl = sexCtl; } - public Integer getSexCtl() - { + public Integer getSexCtl() { return sexCtl; } - public void setStat(String stat) - { + public void setStat(String stat) { this.stat = stat; } - public String getStat() - { + public String getStat() { return stat; } - public void setTech(String tech) - { + public void setTech(String tech) { this.tech = tech; } - public String getTech() - { + public String getTech() { return tech; } - public void setTankId(Long tankId) - { + public void setTankId(Long tankId) { this.tankId = tankId; } - public Long getTankId() - { + public Long getTankId() { return tankId; } - public void setBucketId(Long bucketId) - { + public void setBucketId(Long bucketId) { this.bucketId = bucketId; } - public Long getBucketId() - { + public Long getBucketId() { return bucketId; } - public void setRackId(Long rackId) - { + public void setRackId(Long rackId) { this.rackId = rackId; } - public Long getRackId() - { + public Long getRackId() { return rackId; } - public void setOutDt(Date outDt) - { + public void setOutDt(Date outDt) { this.outDt = outDt; } - public Date getOutDt() - { + public Date getOutDt() { return outDt; } - public void setDiscardTxt(String discardTxt) - { + public void setDiscardTxt(String discardTxt) { this.discardTxt = discardTxt; } - public String getDiscardTxt() - { + public String getDiscardTxt() { return discardTxt; } @Override public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("code", getCode()) - .append("freezeDt", getFreezeDt()) - .append("breed", getBreed()) - .append("batch", getBatch()) - .append("spec", getSpec()) - .append("qty", getQty()) - .append("sexCtl", getSexCtl()) - .append("stat", getStat()) - .append("tech", getTech()) - .append("tankId", getTankId()) - .append("bucketId", getBucketId()) - .append("rackId", getRackId()) - .append("outDt", getOutDt()) - .append("discardTxt", getDiscardTxt()) - .append("remark", getRemark()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .toString(); + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("code", getCode()) + .append("freezeDt", getFreezeDt()) + .append("breed", getBreed()) + .append("batch", getBatch()) + .append("spec", getSpec()) + .append("qty", getQty()) + .append("sexCtl", getSexCtl()) + .append("stat", getStat()) + .append("tech", getTech()) + .append("tankId", getTankId()) + .append("bucketId", getBucketId()) + .append("rackId", getRackId()) + .append("outDt", getOutDt()) + .append("discardTxt", getDiscardTxt()) + .append("remark", getRemark()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .toString(); } } diff --git a/zhyc-module/src/main/java/com/zhyc/module/frozen/mapper/DdFeMapper.java b/zhyc-module/src/main/java/com/zhyc/module/frozen/mapper/DdFeMapper.java index cea50ba..ded9e82 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/frozen/mapper/DdFeMapper.java +++ b/zhyc-module/src/main/java/com/zhyc/module/frozen/mapper/DdFeMapper.java @@ -1,7 +1,11 @@ package com.zhyc.module.frozen.mapper; import java.util.List; +import java.util.Map; + import com.zhyc.module.frozen.domain.DdFe; +import com.zhyc.module.produce.breed.domain.ScEmbryoFlush; +import org.apache.ibatis.annotations.Param; /** * 冻胚库存Mapper接口 @@ -58,4 +62,14 @@ public interface DdFeMapper * @return 结果 */ public int deleteDdFeByIds(Long[] ids); + + /** + * 按母羊耳号取最新一条冲胚记录(只读) + */ + Map selectFlushByEwe(@Param("eweNo") String eweNo); + + /** + * 废弃更新(只改状态、出库日期、废弃原因、更新人) + */ + int updateDiscard(DdFe dto); } diff --git a/zhyc-module/src/main/java/com/zhyc/module/frozen/service/IDdFeService.java b/zhyc-module/src/main/java/com/zhyc/module/frozen/service/IDdFeService.java index a071ba3..d047937 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/frozen/service/IDdFeService.java +++ b/zhyc-module/src/main/java/com/zhyc/module/frozen/service/IDdFeService.java @@ -1,19 +1,20 @@ package com.zhyc.module.frozen.service; import java.util.List; +import java.util.Map; + import com.zhyc.module.frozen.domain.DdFe; /** * 冻胚库存Service接口 - * + * * @author ruoyi * @date 2025-11-29 */ -public interface IDdFeService -{ +public interface IDdFeService { /** * 查询冻胚库存 - * + * * @param id 冻胚库存主键 * @return 冻胚库存 */ @@ -21,7 +22,7 @@ public interface IDdFeService /** * 查询冻胚库存列表 - * + * * @param ddFe 冻胚库存 * @return 冻胚库存集合 */ @@ -29,7 +30,7 @@ public interface IDdFeService /** * 新增冻胚库存 - * + * * @param ddFe 冻胚库存 * @return 结果 */ @@ -37,7 +38,7 @@ public interface IDdFeService /** * 修改冻胚库存 - * + * * @param ddFe 冻胚库存 * @return 结果 */ @@ -45,7 +46,7 @@ public interface IDdFeService /** * 批量删除冻胚库存 - * + * * @param ids 需要删除的冻胚库存主键集合 * @return 结果 */ @@ -53,9 +54,17 @@ public interface IDdFeService /** * 删除冻胚库存信息 - * + * * @param id 冻胚库存主键 * @return 结果 */ public int deleteDdFeById(Long id); + + /** + * 根据母羊耳号取最近一次冲胚信息 + */ + Map getLastFlushInfoByEwe(String eweNo); + + // 废弃 + int discard(DdFe dto); } diff --git a/zhyc-module/src/main/java/com/zhyc/module/frozen/service/IDdFsService.java b/zhyc-module/src/main/java/com/zhyc/module/frozen/service/IDdFsService.java index 632489f..a800579 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/frozen/service/IDdFsService.java +++ b/zhyc-module/src/main/java/com/zhyc/module/frozen/service/IDdFsService.java @@ -1,19 +1,19 @@ package com.zhyc.module.frozen.service; import java.util.List; + import com.zhyc.module.frozen.domain.DdFs; /** * 冻精库存Service接口 - * + * * @author ruoyi * @date 2025-11-29 */ -public interface IDdFsService -{ +public interface IDdFsService { /** * 查询冻精库存 - * + * * @param id 冻精库存主键 * @return 冻精库存 */ @@ -21,7 +21,7 @@ public interface IDdFsService /** * 查询冻精库存列表 - * + * * @param ddFs 冻精库存 * @return 冻精库存集合 */ @@ -29,7 +29,7 @@ public interface IDdFsService /** * 新增冻精库存 - * + * * @param ddFs 冻精库存 * @return 结果 */ @@ -37,7 +37,7 @@ public interface IDdFsService /** * 修改冻精库存 - * + * * @param ddFs 冻精库存 * @return 结果 */ @@ -45,7 +45,7 @@ public interface IDdFsService /** * 批量删除冻精库存 - * + * * @param ids 需要删除的冻精库存主键集合 * @return 结果 */ @@ -53,9 +53,12 @@ public interface IDdFsService /** * 删除冻精库存信息 - * + * * @param id 冻精库存主键 * @return 结果 */ public int deleteDdFsById(Long id); + + //废弃 + int discard(List list); } diff --git a/zhyc-module/src/main/java/com/zhyc/module/frozen/service/impl/DdFeServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/frozen/service/impl/DdFeServiceImpl.java index 5a61fa9..306a8e6 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/frozen/service/impl/DdFeServiceImpl.java +++ b/zhyc-module/src/main/java/com/zhyc/module/frozen/service/impl/DdFeServiceImpl.java @@ -1,13 +1,22 @@ package com.zhyc.module.frozen.service.impl; +import java.util.HashMap; import java.util.List; +import java.util.Map; + import com.zhyc.common.utils.DateUtils; +import com.zhyc.common.utils.StringUtils; +import com.zhyc.module.produce.breed.domain.ScEmbryoFlush; +import com.zhyc.module.produce.breed.mapper.ScEmbryoFlushMapper; +import com.zhyc.module.produce.breed.service.IScEmbryoFlushService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.zhyc.module.frozen.mapper.DdFeMapper; import com.zhyc.module.frozen.domain.DdFe; import com.zhyc.module.frozen.service.IDdFeService; +import javax.annotation.Resource; + /** * 冻胚库存Service业务层处理 * @@ -19,7 +28,10 @@ public class DdFeServiceImpl implements IDdFeService { @Autowired private DdFeMapper ddFeMapper; - + @Autowired + private ScEmbryoFlushMapper scEmbryoFlushMapper; + @Autowired + private IScEmbryoFlushService scEmbryoFlushService; /** * 查询冻胚库存 * @@ -92,4 +104,44 @@ public class DdFeServiceImpl implements IDdFeService { return ddFeMapper.deleteDdFeById(id); } + + @Override + public Map getLastFlushInfoByEwe(String eweNo) { + // 1. 冲胚数据(冻胚自己的 SQL) + Map flush = ddFeMapper.selectFlushByEwe(eweNo); + if (flush == null) return null; + + String ramId = (String) flush.get("ramId"); + if (StringUtils.isBlank(ramId)) return null; + + // 2. 公羊品种 + Map ram = scEmbryoFlushMapper.selectSheepInfoByManageTag(ramId); + String ramBreed = (String) ram.get("variety"); + + // 3. 母羊品种 + Map ewe = scEmbryoFlushMapper.selectSheepInfoByManageTag(eweNo); + String eweBreed = (String) ewe.get("variety"); + + // 4. 胚胎品种 + String embryoBreed = scEmbryoFlushService.calculateEmbryoVariety(ramBreed, eweBreed); + + // 5. 封装 4 字段 + Map rsp = new HashMap<>(8); + rsp.put("drId", ramId); + rsp.put("drBreed", ramBreed); + rsp.put("deBreed", eweBreed); + rsp.put("embBreed", embryoBreed); + // 如果以后需要等级数量,也从这个 flush map 里取 + rsp.put("gradeA", flush.get("gradeA")); + rsp.put("gradeB", flush.get("gradeB")); + rsp.put("gradeC", flush.get("gradeC")); + rsp.put("gradeD", flush.get("gradeD")); + return rsp; + } + +// 废弃 + @Override + public int discard(DdFe dto) { + return ddFeMapper.updateDiscard(dto); + } } diff --git a/zhyc-module/src/main/java/com/zhyc/module/frozen/service/impl/DdFsServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/frozen/service/impl/DdFsServiceImpl.java index 6b3c86d..52a1c73 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/frozen/service/impl/DdFsServiceImpl.java +++ b/zhyc-module/src/main/java/com/zhyc/module/frozen/service/impl/DdFsServiceImpl.java @@ -1,95 +1,129 @@ package com.zhyc.module.frozen.service.impl; import java.util.List; + +import com.zhyc.common.exception.ServiceException; import com.zhyc.common.utils.DateUtils; +import com.zhyc.module.base.domain.BasSheep; +import com.zhyc.module.base.domain.BasSheepVariety; +import com.zhyc.module.base.mapper.BasSheepMapper; +import com.zhyc.module.base.mapper.BasSheepVarietyMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.zhyc.module.frozen.mapper.DdFsMapper; import com.zhyc.module.frozen.domain.DdFs; import com.zhyc.module.frozen.service.IDdFsService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * 冻精库存Service业务层处理 - * + * * @author ruoyi * @date 2025-11-29 */ @Service -public class DdFsServiceImpl implements IDdFsService -{ +public class DdFsServiceImpl implements IDdFsService { @Autowired private DdFsMapper ddFsMapper; + @Autowired + private BasSheepMapper basSheepMapper; + @Autowired + private BasSheepVarietyMapper basSheepVarietyMapper; /** * 查询冻精库存 - * + * * @param id 冻精库存主键 * @return 冻精库存 */ @Override - public DdFs selectDdFsById(Long id) - { + public DdFs selectDdFsById(Long id) { return ddFsMapper.selectDdFsById(id); } /** * 查询冻精库存列表 - * + * * @param ddFs 冻精库存 * @return 冻精库存 */ @Override - public List selectDdFsList(DdFs ddFs) - { + public List selectDdFsList(DdFs ddFs) { return ddFsMapper.selectDdFsList(ddFs); } /** * 新增冻精库存 - * + * * @param ddFs 冻精库存 * @return 结果 */ @Override - public int insertDdFs(DdFs ddFs) - { + public int insertDdFs(DdFs ddFs) { + BasSheep ram = basSheepMapper.selectBasSheepByManageTags(ddFs.getCode()); + if (ram == null) { + throw new ServiceException("公羊不存在"); + } + if (ram.getStatusId() == null || !ram.getStatusId().equals(1L)) { + throw new ServiceException("羊只不在群"); + } + if (ram.getGender() == null || !ram.getGender().equals(2L)) { + throw new ServiceException("该耳号对应不是公羊"); + } + + if (ddFs.getBreed() == null || ddFs.getBreed().trim().isEmpty()) { + BasSheepVariety variety = basSheepVarietyMapper.selectBasSheepVarietyById(ram.getVarietyId()); + ddFs.setBreed(variety == null ? "" : variety.getVariety()); + } ddFs.setCreateTime(DateUtils.getNowDate()); return ddFsMapper.insertDdFs(ddFs); } /** * 修改冻精库存 - * + * * @param ddFs 冻精库存 * @return 结果 */ @Override - public int updateDdFs(DdFs ddFs) - { + public int updateDdFs(DdFs ddFs) { return ddFsMapper.updateDdFs(ddFs); } /** * 批量删除冻精库存 - * + * * @param ids 需要删除的冻精库存主键 * @return 结果 */ @Override - public int deleteDdFsByIds(Long[] ids) - { + public int deleteDdFsByIds(Long[] ids) { return ddFsMapper.deleteDdFsByIds(ids); } /** * 删除冻精库存信息 - * + * * @param id 冻精库存主键 * @return 结果 */ @Override - public int deleteDdFsById(Long id) - { + public int deleteDdFsById(Long id) { return ddFsMapper.deleteDdFsById(id); } + + // 废弃 + @Override + public int discard(List list) { + return list.stream() + .mapToInt(item -> { + DdFs update = new DdFs(); + update.setId(item.getId()); + update.setStat("废弃"); + update.setDiscardTxt(item.getDiscardTxt()); + return ddFsMapper.updateDdFs(update); + }) + .sum(); + } } diff --git a/zhyc-module/src/main/resources/mapper/frozen/DdFeMapper.xml b/zhyc-module/src/main/resources/mapper/frozen/DdFeMapper.xml index 976d719..496d875 100644 --- a/zhyc-module/src/main/resources/mapper/frozen/DdFeMapper.xml +++ b/zhyc-module/src/main/resources/mapper/frozen/DdFeMapper.xml @@ -1,49 +1,75 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - select id, code, freeze_date, dr_id, dr_breed, de_id, de_breed, emb_breed, grade, qty, sex_ctl, status, tech, tank_id, bucket_id, rack_id, out_date, discard_txt, remark, create_by, create_time from dd_fe + select id, + code, + freeze_date, + dr_id, + dr_breed, + de_id, + de_breed, + emb_breed, + grade, + qty, + sex_ctl, + status, + tech, + tank_id, + bucket_id, + rack_id, + out_date, + discard_txt, + remark, + create_by, + create_time + from dd_fe - + + SELECT grade_a gradeA, + grade_b gradeB, + grade_c gradeC, + grade_d gradeD, + cell_2_4 cell24, + cell_8 cell8, + donor_male_no ramId + FROM sc_embryo_flush + WHERE donor_female_no = #{eweNo} + ORDER BY flush_time DESC + LIMIT 1 + + + + UPDATE dd_fe + SET status = #{status}, + discard_txt = #{discardTxt} + WHERE id = #{id} + \ No newline at end of file diff --git a/zhyc-module/src/main/resources/mapper/frozen/DdFsMapper.xml b/zhyc-module/src/main/resources/mapper/frozen/DdFsMapper.xml index 0000c30..23daa37 100644 --- a/zhyc-module/src/main/resources/mapper/frozen/DdFsMapper.xml +++ b/zhyc-module/src/main/resources/mapper/frozen/DdFsMapper.xml @@ -33,9 +33,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and code like concat('%', #{code}, '%') - and freeze_dt = #{freezeDt} and tech like concat('%', #{tech}, '%') - and out_dt = #{outDt} + + and freeze_dt between #{params.beginFreezeDt} and #{params.endFreezeDt} + + + and out_dt between #{params.beginOutDt} and #{params.endOutDt} + diff --git a/zhyc-module/src/main/resources/mapper/produce/bodyManage/ScBodyMeasureMapper.xml b/zhyc-module/src/main/resources/mapper/produce/bodyManage/ScBodyMeasureMapper.xml index 8b26f99..df35238 100644 --- a/zhyc-module/src/main/resources/mapper/produce/bodyManage/ScBodyMeasureMapper.xml +++ b/zhyc-module/src/main/resources/mapper/produce/bodyManage/ScBodyMeasureMapper.xml @@ -102,30 +102,7 @@ and sm.create_time between #{params.beginCreateTime} and #{params.endCreateTime} - - ORDER BY - - bs.weaning_weight - sm.body_length - bs.birth_weight - bs.current_weight - bs.lactation_day - bs.gestation_day - post_mating_day - bs.parity - sm.height - sm.bust - sm.pipe_length - sm.chest_depth - sm.hip_height - sm.rump_width - sm.rump_heignt - sm.hip_width - sm.hip_cross_height - ${orderBy} - - ${sortDirection} - + ORDER BY sm.create_time DESC AND source LIKE CONCAT('%', #{source}, '%') - - AND datetime = #{datetime} + + AND datetime >= #{params.beginTime} + + + AND datetime <= #{params.endTime} - - INSERT INTO np_fresh_milk_insp @@ -96,7 +96,6 @@ - UPDATE np_fresh_milk_insp @@ -119,12 +118,10 @@ WHERE id = #{id} - DELETE FROM np_fresh_milk_insp WHERE id = #{id} - DELETE FROM np_fresh_milk_insp WHERE id IN diff --git a/zhyc-module/src/main/resources/mapper/dairyProducts/NpRawMilkInspeMapper.xml b/zhyc-module/src/main/resources/mapper/dairyProducts/NpRawMilkInspeMapper.xml index c6aba37..86b7774 100644 --- a/zhyc-module/src/main/resources/mapper/dairyProducts/NpRawMilkInspeMapper.xml +++ b/zhyc-module/src/main/resources/mapper/dairyProducts/NpRawMilkInspeMapper.xml @@ -40,7 +40,12 @@ diff --git a/zhyc-module/src/main/resources/mapper/dairyProducts/NpYogurtInspMapper.xml b/zhyc-module/src/main/resources/mapper/dairyProducts/NpYogurtInspMapper.xml index 1dcfa9f..0d47254 100644 --- a/zhyc-module/src/main/resources/mapper/dairyProducts/NpYogurtInspMapper.xml +++ b/zhyc-module/src/main/resources/mapper/dairyProducts/NpYogurtInspMapper.xml @@ -39,8 +39,11 @@ and source like concat('%', #{source}, '%') - - and datetime = #{datetime} + + and datetime >= #{params.beginTime} + + + and datetime <= #{params.endTime} @@ -70,7 +73,7 @@ comment, create_by, create_time, - + #{source}, #{datetime}, @@ -89,7 +92,7 @@ #{comment}, #{createBy}, #{createTime}, - + diff --git a/zhyc-module/src/main/resources/mapper/dairyProducts/XzDryMatterCorrectionMapper.xml b/zhyc-module/src/main/resources/mapper/dairyProducts/XzDryMatterCorrectionMapper.xml index 0fd5b29..37ae656 100644 --- a/zhyc-module/src/main/resources/mapper/dairyProducts/XzDryMatterCorrectionMapper.xml +++ b/zhyc-module/src/main/resources/mapper/dairyProducts/XzDryMatterCorrectionMapper.xml @@ -13,26 +13,28 @@ - SELECT - id, - datetime, - factory, - content, - COALESCE(standard, 18) as standard, - CASE - WHEN standard = 0 OR standard IS NULL THEN NULL - ELSE ROUND(content / standard, 2) - END AS coefficient + id, + datetime, + factory, + content, + COALESCE(standard, 18) as standard, + CASE + WHEN standard = 0 OR standard IS NULL THEN NULL + ELSE ROUND(content / standard, 2) + END AS coefficient FROM xz_dry_matter_correction - and datetime = #{datetime} + + and datetime >= #{params.beginTime} + + + and datetime <= #{params.endTime} + and factory = #{factory} diff --git a/zhyc-module/src/main/resources/mapper/sale/SxSheepSaleMapper.xml b/zhyc-module/src/main/resources/mapper/sale/SxSheepSaleMapper.xml index 00ac0da..b8e1e2f 100644 --- a/zhyc-module/src/main/resources/mapper/sale/SxSheepSaleMapper.xml +++ b/zhyc-module/src/main/resources/mapper/sale/SxSheepSaleMapper.xml @@ -36,30 +36,36 @@ + + + + + - select id, bs_manage_tags, sheepfold_id, variety, sheep_name, gender, month_age, parity, breed, post_lambing_day, lactation_day, lambing_day, event_type, sale_date, pricing_method, unit_price, total_price, total_weight, avg_weight, avg_price_per_sheep, sale_type, disease_type, secondary_reason, group_code, customer_id, sales_person_id, quarantine_no, approval_no, technician_id, handler_id, created_by, created_at, remark from sx_sheep_sale + SELECT + s.id, s.bs_manage_tags, s.sheepfold_id, s.variety, s.sheep_name, s.gender, s.month_age, s.parity, s.breed, + s.post_lambing_day, s.lactation_day, s.lambing_day, s.event_type, s.sale_date, s.pricing_method, + s.unit_price, s.total_price, s.total_weight, s.avg_weight, s.avg_price_per_sheep, s.sale_type, + s.disease_type, s.secondary_reason, s.group_code, s.customer_id, s.sales_person_id, + s.quarantine_no, s.approval_no, s.technician_id, s.handler_id, s.created_by, s.created_at, s.remark, + c.name AS customer_name, + c.phone AS customer_phone, + CONCAT(IFNULL(c.province,''), IFNULL(c.city,''), IFNULL(c.district,''), IFNULL(c.address,'')) AS customer_address, + u.nick_name AS sales_person_name + FROM sx_sheep_sale s + LEFT JOIN sx_customer c ON s.customer_id = c.id + LEFT JOIN sys_user u ON s.sales_person_id = u.user_id - select - bs_manage_tags, - variety, - name as sheep_name, - gender, - month_age, - parity, - breed, - post_lambing_day, - lactation_day, - lambing_day, - sheepfold_id + bs_manage_tags, variety, name as sheep_name, gender, month_age, parity, breed, + post_lambing_day, lactation_day, lambing_day, sheepfold_id from sheep_file - - and bs_manage_tags = #{bsManageTags} - and sheepfold_id = #{sheepfoldId} - and variety = #{variety} - and sheep_name = #{sheepName} - and sale_date = #{saleDate} - and sale_type = #{saleType} + + AND c.name LIKE CONCAT('%', #{customerName}, '%') + + + + AND u.nick_name LIKE CONCAT('%', #{salesPersonName}, '%') + + + + AND date_format(s.sale_date,'%y%m%d') >= date_format(#{params.beginSaleDate},'%y%m%d') + + + AND date_format(s.sale_date,'%y%m%d') <= date_format(#{params.endSaleDate},'%y%m%d') + From 9c6513265051b5518dc8cb0581597e6c457ca08d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BC=82=E6=B3=8A?= <1913856125@qq.com> Date: Fri, 5 Dec 2025 22:02:40 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E5=8F=82=E6=95=B0=EF=BC=8C=E6=96=B0=E5=A2=9Eflag=EF=BC=8C?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E6=98=AF=E5=90=A6=E7=99=BB=E5=BD=95=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/system/SysLoginController.java | 2 +- .../zhyc/common/core/domain/model/LoginBody.java | 12 ++++++++++++ .../framework/web/service/SysLoginService.java | 16 +++++++++------- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/zhyc-admin/src/main/java/com/zhyc/web/controller/system/SysLoginController.java b/zhyc-admin/src/main/java/com/zhyc/web/controller/system/SysLoginController.java index f3b318a..edfc953 100644 --- a/zhyc-admin/src/main/java/com/zhyc/web/controller/system/SysLoginController.java +++ b/zhyc-admin/src/main/java/com/zhyc/web/controller/system/SysLoginController.java @@ -51,7 +51,7 @@ public class SysLoginController AjaxResult ajax = AjaxResult.success(); // 生成令牌 String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(), - loginBody.getUuid()); + loginBody.getUuid(),loginBody.getFlag()); ajax.put(Constants.TOKEN, token); return ajax; } diff --git a/zhyc-common/src/main/java/com/zhyc/common/core/domain/model/LoginBody.java b/zhyc-common/src/main/java/com/zhyc/common/core/domain/model/LoginBody.java index fda8f5b..7de3fc6 100644 --- a/zhyc-common/src/main/java/com/zhyc/common/core/domain/model/LoginBody.java +++ b/zhyc-common/src/main/java/com/zhyc/common/core/domain/model/LoginBody.java @@ -26,6 +26,10 @@ public class LoginBody * 唯一标识 */ private String uuid; + /** + * 登录参数 + */ + private boolean flag; public String getUsername() { @@ -66,4 +70,12 @@ public class LoginBody { this.uuid = uuid; } + + public boolean getFlag() { + return flag; + } + + public void setFlag(boolean flag) { + this.flag = flag; + } } diff --git a/zhyc-framework/src/main/java/com/zhyc/framework/web/service/SysLoginService.java b/zhyc-framework/src/main/java/com/zhyc/framework/web/service/SysLoginService.java index 854517f..581b332 100644 --- a/zhyc-framework/src/main/java/com/zhyc/framework/web/service/SysLoginService.java +++ b/zhyc-framework/src/main/java/com/zhyc/framework/web/service/SysLoginService.java @@ -54,17 +54,18 @@ public class SysLoginService /** * 登录验证 - * + * * @param username 用户名 * @param password 密码 - * @param code 验证码 - * @param uuid 唯一标识 + * @param code 验证码 + * @param uuid 唯一标识 + * @param flag 是否开启验证 * @return 结果 */ - public String login(String username, String password, String code, String uuid) + public String login(String username, String password, String code, String uuid, boolean flag) { // 验证码校验 - validateCaptcha(username, code, uuid); + validateCaptcha(username, code, uuid,flag); // 登录前置校验 loginPreCheck(username, password); // 用户验证 @@ -106,12 +107,13 @@ public class SysLoginService * @param username 用户名 * @param code 验证码 * @param uuid 唯一标识 + * @param flag 是否进行验证码校验 * @return 结果 */ - public void validateCaptcha(String username, String code, String uuid) + public void validateCaptcha(String username, String code, String uuid,boolean flag) { boolean captchaEnabled = configService.selectCaptchaEnabled(); - if (captchaEnabled) + if (captchaEnabled && !flag) { String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + StringUtils.nvl(uuid, ""); String captcha = redisCache.getCacheObject(verifyKey); From 056ded0917126a149bc468dab428194f291d68a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BC=82=E6=B3=8A?= <1913856125@qq.com> Date: Fri, 5 Dec 2025 22:22:29 +0800 Subject: [PATCH 8/8] =?UTF-8?q?token=E6=9C=89=E6=95=88=E6=9C=9F=E5=BB=B6?= =?UTF-8?q?=E9=95=BF2=E5=B0=8F=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zhyc-admin/src/main/resources/application.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zhyc-admin/src/main/resources/application.yml b/zhyc-admin/src/main/resources/application.yml index 49cc5ba..641e1c3 100644 --- a/zhyc-admin/src/main/resources/application.yml +++ b/zhyc-admin/src/main/resources/application.yml @@ -99,7 +99,7 @@ token: # 令牌密钥 secret: abcdefghijklmnopqrstuvwxyz # 令牌有效期(默认30分钟) - expireTime: 30 + expireTime: 120 # MyBatis配置 mybatis: