From 21f2df110e5de48978aa7d9ccd393319ee8e3d4a Mon Sep 17 00:00:00 2001
From: wyt <414651037@qq.com>
Date: Thu, 17 Jul 2025 10:19:16 +0800
Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3?=
=?UTF-8?q?=E5=8C=85=E5=AF=BC=E5=85=A5=E8=B7=AF=E5=BE=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../add_sheep/controller/ScAddSheepController.java | 4 ++--
.../add_sheep/service/impl/ScAddSheepServiceImpl.java | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/add_sheep/controller/ScAddSheepController.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/add_sheep/controller/ScAddSheepController.java
index 8602dce..07d8261 100644
--- a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/add_sheep/controller/ScAddSheepController.java
+++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/add_sheep/controller/ScAddSheepController.java
@@ -7,8 +7,8 @@ import com.zhyc.common.exception.ServiceException;
import com.zhyc.common.utils.poi.ExcelUtil;
import com.zhyc.module.produce.manage_sheep.add_sheep.domain.ScAddSheep;
import com.zhyc.module.produce.manage_sheep.add_sheep.service.IScAddSheepService;
-import com.zhyc.module.sheepfold_management.domain.DaSheepfold;
-import com.zhyc.module.sheepfold_management.service.IDaSheepfoldService;
+import com.zhyc.module.fileManagement.domain.DaSheepfold;
+import com.zhyc.module.fileManagement.service.IDaSheepfoldService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/add_sheep/service/impl/ScAddSheepServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/add_sheep/service/impl/ScAddSheepServiceImpl.java
index bd6a247..95e5e72 100644
--- a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/add_sheep/service/impl/ScAddSheepServiceImpl.java
+++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/add_sheep/service/impl/ScAddSheepServiceImpl.java
@@ -9,8 +9,8 @@ import com.zhyc.module.produce.sheep.domain.BasSheep;
import com.zhyc.module.produce.sheep.mapper.BasSheepMapper;
import com.zhyc.module.produce.sheep.service.IBasSheepService;
import com.zhyc.module.produce.sheep.service.impl.BasSheepServiceImpl;
-import com.zhyc.module.sheepfold_management.domain.DaSheepfold;
-import com.zhyc.module.sheepfold_management.mapper.DaSheepfoldMapper;
+import com.zhyc.module.fileManagement.domain.DaSheepfold;
+import com.zhyc.module.fileManagement.mapper.DaSheepfoldMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
From f33bf937149dd41aaeea43ce888b56ae8dc172f2 Mon Sep 17 00:00:00 2001
From: wyt <414651037@qq.com>
Date: Fri, 18 Jul 2025 12:57:42 +0800
Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BE=8A=E5=8F=AA?=
=?UTF-8?q?=E5=88=86=E7=BB=84=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
zhyc-module/pom.xml | 4 +
.../add_sheep/domain/ScAddSheep.java | 11 +-
.../trans_group/domain/ScTransGroup.java | 7 ++
.../service/impl/ScTransGroupServiceImpl.java | 2 -
.../other/castrate/domain/ScCastrate.java | 71 +++--------
.../other/fixHoof/domain/ScFixHoof.java | 7 ++
.../add_sheep/ScAddSheepMapper.xml | 110 ++++++++++--------
.../trans_group/ScTransGroupMapper.xml | 28 +++--
.../other/castrate/ScCastrateMapper.xml | 11 ++
.../produce/other/fixHoof/ScFixHoofMapper.xml | 56 ++++-----
10 files changed, 152 insertions(+), 155 deletions(-)
diff --git a/zhyc-module/pom.xml b/zhyc-module/pom.xml
index a3a00b5..78bc63d 100644
--- a/zhyc-module/pom.xml
+++ b/zhyc-module/pom.xml
@@ -23,6 +23,10 @@
1.18.38
provided
+
+ org.projectlombok
+ lombok
+
\ No newline at end of file
diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/add_sheep/domain/ScAddSheep.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/add_sheep/domain/ScAddSheep.java
index 9ac2465..625a90b 100644
--- a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/add_sheep/domain/ScAddSheep.java
+++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/add_sheep/domain/ScAddSheep.java
@@ -52,18 +52,21 @@ public class ScAddSheep extends BaseEntity {
@Excel(name = "出生日期", dateFormat = "yyyy-MM-dd")
private Date birthday;
- /** 性别 1公 0母 */
- @Excel(name = "性别", readConverterExp = "1=公,0=母")
+ /** 性别 1公 0母 2阉羊 3兼性 */
+ @Excel(name = "性别", readConverterExp = "1=公,0=母,2=阉羊,3=兼性")
private Integer gender;
/** 胎次 */
@Excel(name = "胎次")
private Integer parity;
- /** 品种编号 */
- @Excel(name = "品种编号")
+ /** 品种id */
private Integer varietyId;
+ /** 品种名称(联表查询返回,非数据库字段) */
+ @Excel(name = "品种")
+ private String varietyName;
+
/** 入群日期 */
@Excel(name = "入群日期", dateFormat = "yyyy-MM-dd")
private Date joinDate;
diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/trans_group/domain/ScTransGroup.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/trans_group/domain/ScTransGroup.java
index bee29eb..5c23503 100644
--- a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/trans_group/domain/ScTransGroup.java
+++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/trans_group/domain/ScTransGroup.java
@@ -66,6 +66,13 @@ public class ScTransGroup extends BaseEntity {
@Excel(name = "品种")
private String varietyName;
+ /** 品种id */
+ private Long varietyId;
+
+ /** 品种名称(联表查询返回,非数据库字段) */
+ @Excel(name = "品种")
+ private String varietyName;
+
private Integer reason;
/**
* 转群原因描述 用于导出
diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/trans_group/service/impl/ScTransGroupServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/trans_group/service/impl/ScTransGroupServiceImpl.java
index 4354dd7..2eeb360 100644
--- a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/trans_group/service/impl/ScTransGroupServiceImpl.java
+++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/trans_group/service/impl/ScTransGroupServiceImpl.java
@@ -51,8 +51,6 @@ public class ScTransGroupServiceImpl implements IScTransGroupService {
group.setStatusText(convertStatus(group.getStatus()));
});
return list;
-// return scTransGroupMapper.selectScTransGroupList(scTransGroup);
-
}
/**
diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/other/castrate/domain/ScCastrate.java b/zhyc-module/src/main/java/com/zhyc/module/produce/other/castrate/domain/ScCastrate.java
index 280a1e3..c8d0b88 100644
--- a/zhyc-module/src/main/java/com/zhyc/module/produce/other/castrate/domain/ScCastrate.java
+++ b/zhyc-module/src/main/java/com/zhyc/module/produce/other/castrate/domain/ScCastrate.java
@@ -1,5 +1,8 @@
package com.zhyc.module.produce.other.castrate.domain;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zhyc.common.annotation.Excel;
@@ -11,6 +14,9 @@ import com.zhyc.common.core.domain.BaseEntity;
* @author ruoyi
* @date 2025-07-09
*/
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
public class ScCastrate extends BaseEntity {
private static final long serialVersionUID = 1L;
@@ -36,6 +42,13 @@ public class ScCastrate extends BaseEntity {
@Excel(name = "羊舍名称")
private String sheepfoldName;
+ /** 品种id */
+ private Long varietyId;
+
+ /** 品种名称(联表查询返回,非数据库字段) */
+ @Excel(name = "品种")
+ private String varietyName;
+
/**
* 备注
*/
@@ -50,63 +63,5 @@ public class ScCastrate extends BaseEntity {
- public void setId(Long id) {
- this.id = id;
- }
- public Long getId() {
- return id;
- }
-
- public void setSheepId(String sheepId) {
- this.sheepId = sheepId;
- }
-
- public String getSheepId() {
- return sheepId;
- }
-
- public void setSheepfold(Long sheepfold) {
- this.sheepfold = sheepfold;
- }
-
- public Long getSheepfold() {
- return sheepfold;
- }
-
- public void setComment(String comment) {
- this.comment = comment;
- }
-
- public String getComment() {
- return comment;
- }
-
- public void setTechnician(String technician) {
- this.technician = technician;
- }
-
- public String getTechnician() {
- return technician;
- }
-
- public String getSheepfoldName() {
- return sheepfoldName;
- }
- public void setSheepfoldName(String sheepfoldName) {
- this.sheepfoldName = sheepfoldName;
- }
-
- @Override
- public String toString() {
- return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
- .append("id", getId())
- .append("sheepId", getSheepId())
- .append("sheepfold", getSheepfold())
- .append("comment", getComment())
- .append("technician", getTechnician())
- .append("createBy", getCreateBy())
- .append("createTime", getCreateTime())
- .toString();
- }
}
diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/other/fixHoof/domain/ScFixHoof.java b/zhyc-module/src/main/java/com/zhyc/module/produce/other/fixHoof/domain/ScFixHoof.java
index 0275751..03cd9e3 100644
--- a/zhyc-module/src/main/java/com/zhyc/module/produce/other/fixHoof/domain/ScFixHoof.java
+++ b/zhyc-module/src/main/java/com/zhyc/module/produce/other/fixHoof/domain/ScFixHoof.java
@@ -38,6 +38,13 @@ public class ScFixHoof extends BaseEntity
@Excel(name = "羊舍名称")
private String sheepfoldName;
+ /** 品种id */
+ private Long varietyId;
+
+ /** 品种名称(联表查询返回,非数据库字段) */
+ @Excel(name = "品种")
+ private String varietyName;
+
/** 备注 */
@Excel(name = "备注")
private String comment;
diff --git a/zhyc-module/src/main/resources/mapper/produce/manage_sheep/add_sheep/ScAddSheepMapper.xml b/zhyc-module/src/main/resources/mapper/produce/manage_sheep/add_sheep/ScAddSheepMapper.xml
index 9f4de89..fa44bff 100644
--- a/zhyc-module/src/main/resources/mapper/produce/manage_sheep/add_sheep/ScAddSheepMapper.xml
+++ b/zhyc-module/src/main/resources/mapper/produce/manage_sheep/add_sheep/ScAddSheepMapper.xml
@@ -4,78 +4,94 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
- INSERT INTO sc_add_sheep
- (ear_number, sheepfold, father, mother, born_weight, birthday, gender, parity,
- variety_id, join_date, comment, technician, create_by, create_time)
- VALUES (#{earNumber}, #{sheepfold}, #{father}, #{mother}, #{bornWeight}, #{birthday},
- #{gender}, #{parity}, #{varietyId}, #{joinDate}, #{comment}, #{technician},
- #{createBy}, #{createTime})
-
-
-
+
+
+
+
+
+
+ INSERT INTO sc_add_sheep
+ (ear_number, sheepfold, father, mother, born_weight, birthday,
+ gender, parity, variety_id, join_date, comment, technician,
+ create_by, create_time)
+ VALUES
+ (#{earNumber}, #{sheepfold}, #{father}, #{mother}, #{bornWeight},
+ #{birthday}, #{gender}, #{parity}, #{varietyId}, #{joinDate},
+ #{comment}, #{technician}, #{createBy}, #{createTime})
+
+
+
UPDATE sc_add_sheep
- ear_number = #{earNumber},
- sheepfold = #{sheepfold},
- father = #{father},
- mother = #{mother},
- born_weight = #{bornWeight},
- birthday = #{birthday},
- gender = #{gender},
- parity = #{parity},
- variety_id = #{varietyId},
- join_date = #{joinDate},
- comment = #{comment},
- technician = #{technician},
- update_by = #{updateBy},
- update_time = NOW()
+ ear_number = #{earNumber},
+ sheepfold = #{sheepfold},
+ father = #{father},
+ mother = #{mother},
+ born_weight = #{bornWeight},
+ birthday = #{birthday},
+ gender = #{gender},
+ parity = #{parity},
+ variety_id = #{varietyId},
+ join_date = #{joinDate},
+ comment = #{comment},
+ technician = #{technician},
+ update_by = #{updateBy},
+ update_time = NOW()
WHERE id = #{id}
+
DELETE FROM sc_add_sheep WHERE id IN
#{id}
-
-
\ No newline at end of file
diff --git a/zhyc-module/src/main/resources/mapper/produce/manage_sheep/trans_group/ScTransGroupMapper.xml b/zhyc-module/src/main/resources/mapper/produce/manage_sheep/trans_group/ScTransGroupMapper.xml
index 665ec43..e0d4df0 100644
--- a/zhyc-module/src/main/resources/mapper/produce/manage_sheep/trans_group/ScTransGroupMapper.xml
+++ b/zhyc-module/src/main/resources/mapper/produce/manage_sheep/trans_group/ScTransGroupMapper.xml
@@ -10,6 +10,8 @@
+
+
@@ -23,6 +25,8 @@
tg.fold_to,
tg.fold_from,
tg.reason,
+ tg.variety_id,
+ bv.variety AS varietyName,
tg.technician,
tg.status,
tg.comment,
@@ -33,15 +37,17 @@
FROM sc_trans_group tg
LEFT JOIN da_sheepfold sf_from ON tg.fold_from = sf_from.id
LEFT JOIN da_sheepfold sf_to ON tg.fold_to = sf_to.id
+ LEFT JOIN bas_sheep_variety bv ON tg.variety_id = bv.id
-
+
insert into sc_trans_group
sheep_id,
fold_to,
fold_from,
- reason,
+ variety_id,
+ reason,
technician,
status,
comment,
@@ -71,7 +79,8 @@
#{sheepId},
#{foldTo},
#{foldFrom},
- #{reason},
+ #{varietyId},
+ #{reason},
#{technician},
#{status},
#{comment},
@@ -86,14 +95,15 @@
sheep_id = #{sheepId},
fold_to = #{foldTo},
fold_from = #{foldFrom},
- reason = #{reason},
+ variety_id = #{varietyId},
+ reason = #{reason},
technician = #{technician},
status = #{status},
comment = #{comment},
create_by = #{createBy},
create_time = #{createTime},
- where sc_trans_group.id = #{id}
+ where id = #{id}
diff --git a/zhyc-module/src/main/resources/mapper/produce/other/castrate/ScCastrateMapper.xml b/zhyc-module/src/main/resources/mapper/produce/other/castrate/ScCastrateMapper.xml
index dcbaba7..1d067c0 100644
--- a/zhyc-module/src/main/resources/mapper/produce/other/castrate/ScCastrateMapper.xml
+++ b/zhyc-module/src/main/resources/mapper/produce/other/castrate/ScCastrateMapper.xml
@@ -9,6 +9,7 @@
+
@@ -19,12 +20,15 @@
sc.sheep_id,
sc.sheepfold,
sf.sheepfold_name as sheepfoldName,
+ sc.variety_id,
+ bv.variety as varietyName,
sc.comment,
sc.technician,
sc.create_by,
sc.create_time
from sc_castrate sc
left join da_sheepfold sf on sc.sheepfold = sf.id
+ left join bas_sheep_variety bv on sc.variety_id = bv.id
@@ -49,6 +57,7 @@
sheep_id,
sheepfold,
+ variety_id,
comment,
technician,
create_by,
@@ -57,6 +66,7 @@
#{sheepId},
#{sheepfold},
+ #{varietyId},
#{comment},
#{technician},
#{createBy},
@@ -69,6 +79,7 @@
sheep_id = #{sheepId},
sheepfold = #{sheepfold},
+ variety_id = #{varietyId},
comment = #{comment},
technician = #{technician},
create_by = #{createBy},
diff --git a/zhyc-module/src/main/resources/mapper/produce/other/fixHoof/ScFixHoofMapper.xml b/zhyc-module/src/main/resources/mapper/produce/other/fixHoof/ScFixHoofMapper.xml
index fdd5659..3ec4178 100644
--- a/zhyc-module/src/main/resources/mapper/produce/other/fixHoof/ScFixHoofMapper.xml
+++ b/zhyc-module/src/main/resources/mapper/produce/other/fixHoof/ScFixHoofMapper.xml
@@ -6,9 +6,8 @@
-
+
-
@@ -18,19 +17,15 @@
select fh.id,
- bs.manage_tags AS manageTags,
+ fh.sheep_id,
fh.sheepfold,
- sf.sheepfold_name AS sheepfoldName,
- fh.variety_id,
- bv.variety AS varietyName,
+ sf.sheepfold_name as sheepfoldName,
fh.comment,
fh.technician,
fh.create_by,
fh.create_time
from sc_fix_hoof fh
- left join bas_sheep bs on fh.sheep_id = bs.id
left join da_sheepfold sf on fh.sheepfold = sf.id
- left join bas_sheep_variety bv on fh.variety_id = bv.id
@@ -55,24 +44,24 @@
where fh.id = #{id}
-
- INSERT INTO sc_fix_hoof
- (sheep_id,
- sheepfold,
- variety_id,
- comment,
- technician,
- create_by,
- create_time)
- VALUES
- (#{sheepId},
- #{sheepfold},
- #{varietyId},
- #{comment},
- #{technician},
- #{createBy},
- #{createTime})
+
+ insert into sc_fix_hoof
+
+ and fh.sheep_id like concat('%', #{sheepId}, '%')
+ and fh.sheepfold = #{sheepfold}
+ comment,
+ technician,
+ create_by,
+ create_time,
+
+
+ #{sheepId},
+ #{sheepfold},
+ #{comment},
+ #{technician},
+ #{createBy},
+ #{createTime},
+
@@ -80,7 +69,6 @@
sheep_id = #{sheepId},
sheepfold = #{sheepfold},
- variety_id=#{varietyId},
comment = #{comment},
technician = #{technician},
create_by = #{createBy},
@@ -101,6 +89,4 @@
#{id}
-
-
\ No newline at end of file