Compare commits

...

40 Commits

Author SHA1 Message Date
9f65048d16 消毒以及依赖更新 2026-03-07 18:09:39 +08:00
zyk
4755a327eb 配种计划导出更新 2026-03-07 12:38:24 +08:00
zyk
2a39664c38 Merge remote-tracking branch 'origin/main' 2026-03-07 11:22:22 +08:00
zyk
b26a803aab 胚胎移植所有逻辑完成 2026-03-07 11:22:14 +08:00
6261b65040 生物安全羊只耳号查询 2026-03-06 22:44:16 +08:00
73a6e881e3 数据分离bug相关修改 2026-03-06 15:51:30 +08:00
ll
ca54b5f544 Merge remote-tracking branch 'origin/main' 2026-03-06 11:11:51 +08:00
ll
e9e5e88a73 羊只销售BUg修复 2026-03-06 11:11:35 +08:00
zyh
5693ca46c0 耳号模糊查询修改 2026-03-05 21:41:11 +08:00
zyk
68cd6b0e60 Merge remote-tracking branch 'origin/main' 2026-03-05 14:58:21 +08:00
zyk
1a5e98f70f 生产权限分离 2026-03-05 14:58:15 +08:00
ll
0fc748bbfd 羊只档案导出问题 2026-03-04 20:47:31 +08:00
ll
b8b15604b3 羊群结构数据分离 2026-03-04 11:48:29 +08:00
ll
5abf1cbff4 分组管理数据分离 2026-03-04 11:29:36 +08:00
ll
48d82ce7c0 羊舍管理数据分离 2026-03-04 11:19:52 +08:00
ll
e624f971de Merge remote-tracking branch 'origin/main' 2026-03-03 18:07:21 +08:00
ll
18f7808b67 羊只档案数据分离 2026-03-03 18:07:05 +08:00
2f646ba797 refactor(frozen-sale/all): 数据库增加字段支持
为数据库中新增的`user_id` `dept_id` 提供结构支持
[重构依据](https://www.yuque.com/piaobo-igrka/xvqmhp/ofcoxh57lywwubgy?singleDoc#)

BREAKING CHANGE: 可能产生隐性数据一致性问题
可能导致某些业务逻辑出现问题
2026-03-03 15:54:27 +08:00
zyk
4818ed5fc5 配种计划重新设计 2026-03-03 10:21:46 +08:00
zyk
204bbc5ee2 产羔导出修复 2026-03-03 10:03:59 +08:00
zyk
e3774cfde4 Merge remote-tracking branch 'origin/main' 2026-03-02 19:12:41 +08:00
zyh
1f3cac240b 新增羊只时的繁育状态问题 2026-03-01 15:21:19 +08:00
zyk
6b6770c99e Merge remote-tracking branch 'origin/main' 2026-03-01 15:03:17 +08:00
zyh
187b4ea840 Merge remote-tracking branch 'origin/main' 2026-03-01 14:13:43 +08:00
zyh
3443f080fb 新增羊只时的羊只类型,各页面导出功能需求,改品种功能的原品种回显需求,完成 2026-03-01 14:13:34 +08:00
7d72107144 生物安全导出修改 2026-02-26 15:37:45 +08:00
zyk
4dd01245fc Merge remote-tracking branch 'origin/main'
# Conflicts:
#	zhyc-module/src/main/resources/mapper/produce/breed/ScWeanRecordMapper.xml
2026-02-10 14:04:59 +08:00
zyk
bbc19b47ca 繁育多耳号查询 2026-02-10 14:04:43 +08:00
ll
404fd4837a Merge remote-tracking branch 'origin/main' 2026-02-10 13:46:44 +08:00
ll
38dc069ca1 销售记录bug修改 2026-02-10 13:46:27 +08:00
zyh
198c6eb263 Merge remote-tracking branch 'origin/main' 2026-02-10 13:30:44 +08:00
zyh
708589b420 新增羊只字段修改 2026-02-10 13:30:35 +08:00
ll
b4d3943e6a Merge remote-tracking branch 'origin/main' 2026-02-09 21:57:47 +08:00
ll
b84c35fe65 客户管理bug修改 2026-02-09 21:57:19 +08:00
zyh
094da396c1 Merge remote-tracking branch 'origin/main' 2026-02-09 21:46:21 +08:00
zyh
d9a621d6a7 转场数据分离bug修复 2026-02-09 21:46:12 +08:00
7bce9a0774 Merge remote-tracking branch 'origin/main' 2026-02-09 20:25:03 +08:00
5cf769c9f5 生物安全是否在群,以及execl导出枚举 2026-02-09 20:24:51 +08:00
zyk
d637bf5bc1 Merge remote-tracking branch 'origin/main' 2026-02-07 14:09:01 +08:00
zyk
e177df656f 产羔界面逻辑全部完成 2026-02-04 09:09:26 +08:00
200 changed files with 5751 additions and 2580 deletions

12
pom.xml
View File

@@ -259,6 +259,18 @@
<version>${kaptcha.version}</version> <version>${kaptcha.version}</version>
</dependency> </dependency>
<!-- ... existing code ... -->
<!-- Tess4J OCR 工具 -->
<dependency>
<groupId>net.sourceforge.tess4j</groupId>
<artifactId>tess4j</artifactId>
<version>4.5.4</version>
</dependency>
<!-- 定时任务-->
<!-- ... existing code ... -->
<!-- 定时任务--> <!-- 定时任务-->
<dependency> <dependency>
<groupId>zhyc</groupId> <groupId>zhyc</groupId>

View File

@@ -23,7 +23,11 @@
<artifactId>spring-boot-devtools</artifactId> <artifactId>spring-boot-devtools</artifactId>
<optional>true</optional> <!-- 表示依赖不会传递 --> <optional>true</optional> <!-- 表示依赖不会传递 -->
</dependency> </dependency>
<!-- Tess4J OCR 识别 -->
<dependency>
<groupId>net.sourceforge.tess4j</groupId>
<artifactId>tess4j</artifactId>
</dependency>
<!-- swagger3--> <!-- swagger3-->
<dependency> <dependency>
<groupId>io.springfox</groupId> <groupId>io.springfox</groupId>

View File

@@ -7,8 +7,8 @@ spring:
# 主库数据源 # 主库数据源
master: master:
# url: jdbc:mysql://localhost:3306/zhyc?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 # url: jdbc:mysql://localhost:3306/zhyc?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
# username: root # username: zhyc
# password: 123456 # password: zhyc1234
url: jdbc:mysql://118.182.97.76:3306/zhyc?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 url: jdbc:mysql://118.182.97.76:3306/zhyc?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: zhyc username: zhyc
password: yszh123 password: yszh123

View File

@@ -84,6 +84,11 @@ public class BasSheepController extends BaseController {
@Log(title = "羊只基本信息", businessType = BusinessType.INSERT) @Log(title = "羊只基本信息", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody BasSheep basSheep) { public AjaxResult add(@RequestBody BasSheep basSheep) {
// 新增下面这两行从当前登录态中获取部门ID和用户ID并赋值给即将保存的实体
basSheep.setDeptId(getDeptId());
basSheep.setUserId(getUserId());
return toAjax(basSheepService.insertBasSheep(basSheep)); return toAjax(basSheepService.insertBasSheep(basSheep));
} }
@@ -133,7 +138,9 @@ public class BasSheepController extends BaseController {
// 查询所有存在的羊只 // 查询所有存在的羊只
List<BasSheep> existingSheep = basSheepService.selectBasSheepByManageTagsList(validTags); List<BasSheep> existingSheep = basSheepService.selectBasSheepByManageTagsList(validTags);
if (validTags.size() == 1 && existingSheep.size() == 1) {
return success(existingSheep.get(0)); //直接返回羊只对象
}
Set<String> existingTagSet = existingSheep.stream() Set<String> existingTagSet = existingSheep.stream()
.map(BasSheep::getManageTags) .map(BasSheep::getManageTags)
.collect(Collectors.toSet()); .collect(Collectors.toSet());

View File

@@ -69,6 +69,10 @@ public class BasSheepGroupController extends BaseController
@PostMapping @PostMapping
public AjaxResult add(@RequestBody BasSheepGroup basSheepGroup) public AjaxResult add(@RequestBody BasSheepGroup basSheepGroup)
{ {
// 👇 新增这两行赋值语句
basSheepGroup.setDeptId(getDeptId());
basSheepGroup.setUserId(getUserId());
return toAjax(basSheepGroupService.insertBasSheepGroup(basSheepGroup)); return toAjax(basSheepGroupService.insertBasSheepGroup(basSheepGroup));
} }

View File

@@ -50,6 +50,7 @@ public class DaSheepfoldController extends BaseController
/** /**
* 主表格:羊舍级别汇总列表 * 主表格:羊舍级别汇总列表
*/ */
@PreAuthorize("@ss.hasPermi('sheepfold_management:sheepfold_management:list')")
@GetMapping("/summaryList") @GetMapping("/summaryList")
public TableDataInfo summaryList(DaSheepfold daSheepfold) { public TableDataInfo summaryList(DaSheepfold daSheepfold) {
startPage(); startPage();
@@ -166,6 +167,10 @@ public class DaSheepfoldController extends BaseController
@PostMapping @PostMapping
public AjaxResult add(@RequestBody DaSheepfold daSheepfold) public AjaxResult add(@RequestBody DaSheepfold daSheepfold)
{ {
// 👇 新增这两行赋值语句
daSheepfold.setDeptId(getDeptId());
daSheepfold.setUserId(getUserId());
return toAjax(daSheepfoldService.insertDaSheepfold(daSheepfold)); return toAjax(daSheepfoldService.insertDaSheepfold(daSheepfold));
} }

View File

@@ -8,6 +8,7 @@ import com.zhyc.common.core.page.TableDataInfo;
import com.zhyc.common.core.text.Convert; import com.zhyc.common.core.text.Convert;
import com.zhyc.common.enums.BusinessType; import com.zhyc.common.enums.BusinessType;
import com.zhyc.common.utils.poi.ExcelUtil; import com.zhyc.common.utils.poi.ExcelUtil;
import com.zhyc.module.base.domain.BasSheep;
import com.zhyc.module.base.domain.SheepFile; import com.zhyc.module.base.domain.SheepFile;
import com.zhyc.module.base.service.ISheepFileService; import com.zhyc.module.base.service.ISheepFileService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@@ -139,7 +140,7 @@ public class SheepFileController extends BaseController
PageHelper.startPage(pageNum, pageSize); PageHelper.startPage(pageNum, pageSize);
// 调用支持复杂查询的Service方法 // 调用支持复杂查询的Service方法
List<SheepFile> list = sheepFileService.selectSheepFileListByCondition(customParams, sheepFile); List<SheepFile> list = sheepFileService.selectSheepFileListByCondition( sheepFile,customParams);
return getDataTable(list); return getDataTable(list);
} }
@@ -209,62 +210,34 @@ public class SheepFileController extends BaseController
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, HttpServletRequest request) public void export(HttpServletResponse response, HttpServletRequest request)
{ {
// 构建查询条件对象
SheepFile sheepFile = new SheepFile(); SheepFile sheepFile = new SheepFile();
Map<String, Object> customParams = new HashMap<>(); Map<String, Object> customParams = new HashMap<>();
// 解析所有请求参数
Map<String, String[]> parameterMap = request.getParameterMap(); Map<String, String[]> parameterMap = request.getParameterMap();
// 1. 更直接地获取前端参数
String exportIdsStr = request.getParameter("exportIds");
String visibleColumnsStr = request.getParameter("visibleColumns");
// 2. 遍历其他条件
for (Map.Entry<String, String[]> entry : parameterMap.entrySet()) { for (Map.Entry<String, String[]> entry : parameterMap.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
String[] values = entry.getValue(); String[] values = entry.getValue();
if (values != null && values.length > 0 && StringUtils.isNotBlank(values[0])) { if (values != null && values.length > 0 && StringUtils.isNotBlank(values[0])) {
String value = values[0]; String value = values[0];
// 使用若依框架的工具方法处理参数
switch (key) { switch (key) {
// --- 单值参数 --- case "bsManageTags": sheepFile.setBsManageTags(convertToString(value)); break;
case "bsManageTags": case "electronicTags": sheepFile.setElectronicTags(convertToString(value)); break;
sheepFile.setBsManageTags(convertToString(value)); case "drRanch": sheepFile.setDrRanch(convertToString(value)); break;
break; case "variety": sheepFile.setVariety(convertToString(value)); break;
case "electronicTags": case "name": sheepFile.setName(convertToString(value)); break;
sheepFile.setElectronicTags(convertToString(value)); case "gender": sheepFile.setGender(Convert.toLong(value)); break;
break; case "statusId": sheepFile.setStatusId(Convert.toLong(value)); break;
case "drRanch": case "breed": sheepFile.setBreed(convertToString(value)); break;
sheepFile.setDrRanch(convertToString(value)); case "allEarNumbers": sheepFile.setAllEarNumbers(new ArrayList<>(Arrays.asList(values))); break;
break; case "allEleEarNumbers": sheepFile.setAllEleEarNumbers(new ArrayList<>(Arrays.asList(values))); break;
case "variety": case "allBreedingStatus": sheepFile.setAllBreedingStatus(new ArrayList<>(Arrays.asList(values))); break;
sheepFile.setVariety(convertToString(value)); case "allSheepTypes": sheepFile.setAllSheepTypes(new ArrayList<>(Arrays.asList(values))); break;
break;
case "name":
sheepFile.setName(convertToString(value));
break;
case "gender":
sheepFile.setGender(Convert.toLong(value));
break;
case "statusId":
sheepFile.setStatusId(Convert.toLong(value));
break;
case "breed":
sheepFile.setBreed(convertToString(value));
break;
// --- 新增:处理多选数组参数 ---
// request.getParameterMap 中的值本身就是 String[],可以直接使用
case "allEarNumbers":
sheepFile.setAllEarNumbers(new ArrayList<>(Arrays.asList(values)));
break;
case "allEleEarNumbers":
sheepFile.setAllEleEarNumbers(new ArrayList<>(Arrays.asList(values)));
break;
case "allBreedingStatus":
sheepFile.setAllBreedingStatus(new ArrayList<>(Arrays.asList(values)));
break;
case "allSheepTypes":
sheepFile.setAllSheepTypes(new ArrayList<>(Arrays.asList(values)));
break;
case "allGenders": case "allGenders":
List<Long> genderList = new ArrayList<>(); List<Long> genderList = new ArrayList<>();
for(String v : values){ for(String v : values){
@@ -273,24 +246,50 @@ public class SheepFileController extends BaseController
} }
sheepFile.setAllGenders(genderList); sheepFile.setAllGenders(genderList);
break; break;
case "pageNum": case "pageSize": case "exportIds": case "visibleColumns":
case "pageNum": break; // 忽略这些非数据库实体的字段
case "pageSize":
// 忽略分页参数
break;
default: default:
// 自定义参数
customParams.put(key, value); customParams.put(key, value);
break; break;
} }
} }
} }
// 调用Service获取数据 // 3. 获取数据并执行行过滤
List<SheepFile> list = sheepFileService.selectSheepFileListByCondition(customParams, sheepFile); List<SheepFile> list = sheepFileService.selectSheepFileListByCondition(sheepFile,customParams);
if (StringUtils.isNotBlank(exportIdsStr)) {
List<String> exportIdList = Arrays.asList(exportIdsStr.split(","));
list = list.stream()
.filter(item -> exportIdList.contains(String.valueOf(item.getId())))
.collect(java.util.stream.Collectors.toList());
}
// 使用若依框架的Excel工具类导出 // 4. 执行列过滤
ExcelUtil<SheepFile> util = new ExcelUtil<>(SheepFile.class); ExcelUtil<SheepFile> util = new ExcelUtil<>(SheepFile.class);
if (StringUtils.isNotBlank(visibleColumnsStr)) {
// 清理字符串可能的空格并转为List
List<String> visibleColumns = Arrays.asList(visibleColumnsStr.split("\\s*,\\s*"));
List<String> colsToHide = new ArrayList<>();
Class<?> clazz = SheepFile.class;
while (clazz != null) {
for (java.lang.reflect.Field field : clazz.getDeclaredFields()) {
if (field.isAnnotationPresent(com.zhyc.common.annotation.Excel.class)) {
if (!visibleColumns.contains(field.getName())) {
colsToHide.add(field.getName());
}
}
}
clazz = clazz.getSuperclass();
}
// 【核心修复】一次性把所有的字段数组传进去,规避若依底层循环覆盖的 Bug
if (!colsToHide.isEmpty()) {
util.hideColumn(colsToHide.toArray(new String[0]));
}
}
util.exportExcel(response, list, "羊只档案数据"); util.exportExcel(response, list, "羊只档案数据");
} }
@@ -334,28 +333,28 @@ public class SheepFileController extends BaseController
@GetMapping("/stat/sheepType") @GetMapping("/stat/sheepType")
public AjaxResult statSheepType() { public AjaxResult statSheepType() {
return success(sheepFileService.countBySheepType()); return success(sheepFileService.countBySheepType(new SheepFile()));
} }
@GetMapping("/stat/breedStatus") @GetMapping("/stat/breedStatus")
public AjaxResult statBreedStatus() { public AjaxResult statBreedStatus() {
return success(sheepFileService.countByBreedStatus()); return success(sheepFileService.countByBreedStatus(new SheepFile()));
} }
@GetMapping("/stat/variety") @GetMapping("/stat/variety")
public AjaxResult statVariety() { public AjaxResult statVariety() {
return success(sheepFileService.countByVariety()); return success(sheepFileService.countByVariety(new SheepFile()));
} }
@GetMapping("/stat/lactationParity") @GetMapping("/stat/lactationParity")
public AjaxResult statLactationParity() { public AjaxResult statLactationParity() {
return success(sheepFileService.countParityOfLactation()); return success(sheepFileService.countParityOfLactation(new SheepFile()));
} }
// 在群总数 // 在群总数
@GetMapping("/stat/inGroupCount") @GetMapping("/stat/inGroupCount")
public AjaxResult inGroupCount() { public AjaxResult inGroupCount() {
return success(sheepFileService.countInGroup()); return success(sheepFileService.countInGroup(new SheepFile()));
} }
/** /**

View File

@@ -103,6 +103,14 @@ public class BasSheep extends BaseEntity
@Excel(name = "母号id") @Excel(name = "母号id")
private Long motherId; private Long motherId;
/** 外祖父耳号 */
@Excel(name = "外祖父")
private String grandpa;
/** 外祖母耳号 */
@Excel(name = "外祖母")
private String grandma;
/** 受体id */ /** 受体id */
@Excel(name = "受体id") @Excel(name = "受体id")
private Long receptorId; private Long receptorId;
@@ -181,4 +189,11 @@ public class BasSheep extends BaseEntity
private Long isDelete; private Long isDelete;
/** 用户编号 */
private Long userId;
/** 部门编号 */
private Long deptId;
} }

View File

@@ -42,4 +42,24 @@ public class BasSheepGroup extends TreeEntity
private Integer isLeaf; private Integer isLeaf;
// 新增数据隔离字段
/** 用户编号 */
private Long userId;
/** 部门编号 */
private Long deptId;
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Long getDeptId() {
return deptId;
}
public void setDeptId(Long deptId) {
this.deptId = deptId;
}
} }

View File

@@ -19,70 +19,6 @@ public class DaSheepfold extends BaseEntity
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getRanchId() {
return ranchId;
}
public void setRanchId(Long ranchId) {
this.ranchId = ranchId;
}
public String getSheepfoldName() {
return sheepfoldName;
}
public void setSheepfoldName(String sheepfoldName) {
this.sheepfoldName = sheepfoldName;
}
public Long getSheepfoldTypeId() {
return sheepfoldTypeId;
}
public void setSheepfoldTypeId(Long sheepfoldTypeId) {
this.sheepfoldTypeId = sheepfoldTypeId;
}
public String getSheepfoldNo() {
return sheepfoldNo;
}
public void setSheepfoldNo(String sheepfoldNo) {
this.sheepfoldNo = sheepfoldNo;
}
public String getRowNo() {
return rowNo;
}
public void setRowNo(String rowNo) {
this.rowNo = rowNo;
}
public String getColumns() {
return columns;
}
public void setColumns(String columns) {
this.columns = columns;
}
public String getComment() {
return comment;
}
public void setComment(String comment) {
this.comment = comment;
}
/** 羊舍id */ /** 羊舍id */
@Excel(name = "羊舍id") @Excel(name = "羊舍id")
private Long id; private Long id;
@@ -121,4 +57,10 @@ public class DaSheepfold extends BaseEntity
private Integer totalSheepCount; private Integer totalSheepCount;
// 👇 新增数据隔离字段
/** 用户编号 */
private Long userId;
/** 部门编号 */
private Long deptId;
} }

View File

@@ -319,4 +319,10 @@ public class SheepFile extends BaseEntity
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "创建日期", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "创建日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date createTime; private Date createTime;
/** 用户编号 */
private Long userId;
/** 部门编号 */
private Long deptId;
} }

View File

@@ -3,8 +3,6 @@ package com.zhyc.module.base.mapper;
import com.zhyc.module.base.domain.SheepFile; import com.zhyc.module.base.domain.SheepFile;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.SelectProvider;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@@ -50,19 +48,19 @@ public interface SheepFileMapper
SheepFile selectSheepByManageTags(String tags); SheepFile selectSheepByManageTags(String tags);
// 在群羊只总数 // 在群羊只总数
Long countInGroup(); Long countInGroup(SheepFile sheep);
// 羊只类别分布(按 name 分组) // 羊只类别分布(按 name 分组)
List<Map<String,Object>> countBySheepType(); List<Map<String,Object>> countBySheepType(SheepFile sheep);
// 繁育状态分布(按 breed 分组) // 繁育状态分布(按 breed 分组)
List<Map<String,Object>> countByBreedStatus(); List<Map<String,Object>> countByBreedStatus(SheepFile sheep);
// 品种分布(按 variety 分组) // 品种分布(按 variety 分组)
List<Map<String,Object>> countByVariety(); List<Map<String,Object>> countByVariety(SheepFile sheep);
// 泌乳羊胎次分布name = '泌乳羊' 时按 parity 分组) // 泌乳羊胎次分布name = '泌乳羊' 时按 parity 分组)
List<Map<String,Object>> countParityOfLactation(); List<Map<String,Object>> countParityOfLactation(SheepFile sheep);
/** /**
* 获取指定字段的唯一值列表 (配合 XML 中的 selectFieldValues) * 获取指定字段的唯一值列表 (配合 XML 中的 selectFieldValues)
@@ -75,22 +73,22 @@ public interface SheepFileMapper
* 必须使用 @Param 注解以便 XML 能正确识别两个参数 * 必须使用 @Param 注解以便 XML 能正确识别两个参数
*/ */
List<SheepFile> selectSheepFileListByCondition( List<SheepFile> selectSheepFileListByCondition(
@Param("params") Map<String, Object> params,
@Param("sheepFile") SheepFile sheepFile
);
/**
* 保留原有 Provider 方法 (若项目其他地方有用到)
*/
@SelectProvider(type = SheepFileSqlProvider.class, method = "selectByCondition")
@ResultMap("SheepFileResult")
List<SheepFile> selectByCondition(
@Param("sheepFile") SheepFile sheepFile, @Param("sheepFile") SheepFile sheepFile,
@Param("conditions") Map<String, Object> conditions @Param("params") Map<String, Object> params
); );
@SelectProvider(type = SheepFileSqlProvider.class, method = "selectFieldValues") // /**
List<String> selectFieldValuesByProvider(@Param("fieldName") String fieldName); // * 保留原有 Provider 方法 (若项目其他地方有用到)
// */
// @SelectProvider(type = SheepFileSqlProvider.class, method = "selectByCondition")
// @ResultMap("SheepFileResult")
// List<SheepFile> selectByCondition(
// @Param("sheepFile") SheepFile sheepFile,
// @Param("conditions") Map<String, Object> conditions
// );
//
// @SelectProvider(type = SheepFileSqlProvider.class, method = "selectFieldValues")
// List<String> selectFieldValuesByProvider(@Param("fieldName") String fieldName);
/** /**
* 查询所有公羊gender=2 * 查询所有公羊gender=2

View File

@@ -1,6 +1,7 @@
package com.zhyc.module.base.service; package com.zhyc.module.base.service;
import com.zhyc.module.base.domain.SheepFile; import com.zhyc.module.base.domain.SheepFile;
import io.lettuce.core.dynamic.annotation.Param;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.List; import java.util.List;
@@ -34,26 +35,21 @@ public interface ISheepFileService
SheepFile selectBasSheepByManageTags(String trim); SheepFile selectBasSheepByManageTags(String trim);
Long countInGroup(); Long countInGroup(SheepFile sheepFile);
List<Map<String,Object>> countBySheepType(); List<Map<String,Object>> countBySheepType(SheepFile sheepFile);
List<Map<String,Object>> countByBreedStatus(); List<Map<String,Object>> countByBreedStatus(SheepFile sheepFile);
List<Map<String,Object>> countByVariety(); List<Map<String,Object>> countByVariety(SheepFile sheepFile);
List<Map<String,Object>> countParityOfLactation(); List<Map<String,Object>> countParityOfLactation(SheepFile sheepFile);
/** /**
* 获取指定字段的唯一值列表 * 获取指定字段的唯一值列表
*/ */
List<String> getFieldValues(String fieldName); List<String> getFieldValues(String fieldName);
/**
* 根据复杂条件查询羊只档案列表
* @param params 自定义参数Map (用于动态SQL)
* @param sheepFile 包含List筛选条件的实体对象
*/
List<SheepFile> selectSheepFileListByCondition( List<SheepFile> selectSheepFileListByCondition(
Map<String, Object> params, @Param("sheepFile") SheepFile sheepFile,
SheepFile sheepFile @Param("params") Map<String, Object> params
); );
@Transactional @Transactional

View File

@@ -1,5 +1,6 @@
package com.zhyc.module.base.service.impl; package com.zhyc.module.base.service.impl;
import com.zhyc.common.annotation.DataScope;
import com.zhyc.common.exception.ServiceException; import com.zhyc.common.exception.ServiceException;
import com.zhyc.common.utils.DateUtils; import com.zhyc.common.utils.DateUtils;
import com.zhyc.module.base.domain.BasSheepGroup; import com.zhyc.module.base.domain.BasSheepGroup;
@@ -45,6 +46,7 @@ public class BasSheepGroupServiceImpl implements IBasSheepGroupService
// { // {
// return basSheepGroupMapper.selectBasSheepGroupList(basSheepGroup); // return basSheepGroupMapper.selectBasSheepGroupList(basSheepGroup);
// } // }
@DataScope(deptAlias = "g", userAlias = "g")
@Override @Override
public List<BasSheepGroup> selectBasSheepGroupList(BasSheepGroup basSheepGroup) { public List<BasSheepGroup> selectBasSheepGroupList(BasSheepGroup basSheepGroup) {
List<BasSheepGroup> groups = basSheepGroupMapper.selectBasSheepGroupList(basSheepGroup); List<BasSheepGroup> groups = basSheepGroupMapper.selectBasSheepGroupList(basSheepGroup);
@@ -122,6 +124,7 @@ public class BasSheepGroupServiceImpl implements IBasSheepGroupService
return basSheepGroupMapper.deleteBasSheepGroupByGroupId(groupId); return basSheepGroupMapper.deleteBasSheepGroupByGroupId(groupId);
} }
@DataScope(deptAlias = "g", userAlias = "g")
@Override @Override
public List<BasSheepGroup> selectLeafNodes() { public List<BasSheepGroup> selectLeafNodes() {
List<BasSheepGroup> leafNodes = basSheepGroupMapper.selectLeafNodes(); List<BasSheepGroup> leafNodes = basSheepGroupMapper.selectLeafNodes();

View File

@@ -1,5 +1,6 @@
package com.zhyc.module.base.service.impl; package com.zhyc.module.base.service.impl;
import com.zhyc.common.annotation.DataScope;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zhyc.module.base.domain.BasSheep; import com.zhyc.module.base.domain.BasSheep;
import com.zhyc.module.base.domain.DaSheepfold; import com.zhyc.module.base.domain.DaSheepfold;
@@ -50,6 +51,7 @@ public class DaSheepfoldServiceImpl implements IDaSheepfoldService
* @param daSheepfold 羊舍管理 * @param daSheepfold 羊舍管理
* @return 羊舍管理 * @return 羊舍管理
*/ */
@DataScope(deptAlias = "ds", userAlias = "ds")
@Override @Override
public List<DaSheepfold> selectDaSheepfoldList(DaSheepfold daSheepfold) public List<DaSheepfold> selectDaSheepfoldList(DaSheepfold daSheepfold)
{ {
@@ -60,8 +62,11 @@ public class DaSheepfoldServiceImpl implements IDaSheepfoldService
/** /**
* 羊舍级别汇总查询(主表格) * 羊舍级别汇总查询(主表格)
*/ */
@DataScope(deptAlias = "ds", userAlias = "ds")
@Override
public List<DaSheepfold> selectDaSheepfoldSummaryList(DaSheepfold daSheepfold) { public List<DaSheepfold> selectDaSheepfoldSummaryList(DaSheepfold daSheepfold) {
return daSheepfoldMapper.selectDaSheepfoldSummaryList(daSheepfold); List<DaSheepfold> sheepfoldList = daSheepfoldMapper.selectDaSheepfoldSummaryList(daSheepfold);
return sheepfoldList;
} }
/** /**

View File

@@ -1,5 +1,8 @@
package com.zhyc.module.base.service.impl; package com.zhyc.module.base.service.impl;
// 新增这一行导入
import com.zhyc.common.annotation.DataScope;
import com.zhyc.module.base.domain.BasSheep;
import com.zhyc.module.base.domain.BreedRamFile; import com.zhyc.module.base.domain.BreedRamFile;
import com.zhyc.module.base.domain.SheepFile; import com.zhyc.module.base.domain.SheepFile;
import com.zhyc.module.base.mapper.SheepFileMapper; import com.zhyc.module.base.mapper.SheepFileMapper;
@@ -38,6 +41,7 @@ public class SheepFileServiceImpl implements ISheepFileService {
/** /**
* 查询羊只档案列表 * 查询羊只档案列表
*/ */
@DataScope(deptAlias = "sf", userAlias = "sf")
@Override @Override
public List<SheepFile> selectSheepFileList(SheepFile sheepFile) { public List<SheepFile> selectSheepFileList(SheepFile sheepFile) {
return sheepFileMapper.selectSheepFileList(sheepFile); return sheepFileMapper.selectSheepFileList(sheepFile);
@@ -56,28 +60,35 @@ public class SheepFileServiceImpl implements ISheepFileService {
return sheepFileMapper.selectSheepByManageTags(tags); return sheepFileMapper.selectSheepByManageTags(tags);
} }
@DataScope(deptAlias = "sf", userAlias = "sf")
@Override @Override
public List<Map<String, Object>> countBySheepType() { public List<Map<String, Object>> countBySheepType(SheepFile sheepFile) {
return sheepFileMapper.countBySheepType(); return sheepFileMapper.countBySheepType(sheepFile);
} }
@DataScope(deptAlias = "sf", userAlias = "sf")
@Override @Override
public List<Map<String, Object>> countByBreedStatus() { public List<Map<String, Object>> countByBreedStatus(SheepFile sheepFile) {
return sheepFileMapper.countByBreedStatus(); return sheepFileMapper.countByBreedStatus(sheepFile);
} }
@DataScope(deptAlias = "sf", userAlias = "sf")
@Override @Override
public List<Map<String, Object>> countByVariety() { public List<Map<String, Object>> countByVariety(SheepFile sheepFile) {
return sheepFileMapper.countByVariety(); return sheepFileMapper.countByVariety(sheepFile);
} }
@DataScope(deptAlias = "sf", userAlias = "sf")
@Override @Override
public List<Map<String, Object>> countParityOfLactation() { public List<Map<String, Object>> countParityOfLactation(SheepFile sheepFile) {
return sheepFileMapper.countParityOfLactation(); return sheepFileMapper.countParityOfLactation(sheepFile);
} }
@DataScope(deptAlias = "sf", userAlias = "sf")
@Override @Override
public Long countInGroup() { return sheepFileMapper.countInGroup(); } public Long countInGroup(SheepFile sheepFile) {
return sheepFileMapper.countInGroup(sheepFile);
}
/** /**
* 获取指定字段的唯一值列表 * 获取指定字段的唯一值列表
@@ -100,14 +111,16 @@ public class SheepFileServiceImpl implements ISheepFileService {
* 必须调用 Mapper 中对应的 XML 方法 (selectSheepFileListByCondition) * 必须调用 Mapper 中对应的 XML 方法 (selectSheepFileListByCondition)
* 并且传递 sheepFile 对象以启用 <foreach> 列表查询 * 并且传递 sheepFile 对象以启用 <foreach> 列表查询
*/ */
@DataScope(deptAlias = "sf", userAlias = "sf")
@Override @Override
public List<SheepFile> selectSheepFileListByCondition(Map<String, Object> params, SheepFile sheepFile) { public List<SheepFile> selectSheepFileListByCondition( SheepFile sheepFile,Map<String, Object> params) {
// 1. 验证并处理自定义参数 (驼峰转下划线、安全检查) // 1. 验证并处理自定义参数 (驼峰转下划线、安全检查)
Map<String, Object> safeConditions = processConditions(params); Map<String, Object> safeConditions = processConditions(params);
System.out.println("sheepFile.params: " + (sheepFile.getParams() != null ? sheepFile.getParams().get("dataScope") : "null"));
// 2. 调用 Mapper // 2. 调用 Mapper
// 这里必须使用与 XML 中 <select id="selectSheepFileListByCondition"> 对应的方法 // 这里必须使用与 XML 中 <select id="selectSheepFileListByCondition"> 对应的方法
return sheepFileMapper.selectSheepFileListByCondition(safeConditions, sheepFile); return sheepFileMapper.selectSheepFileListByCondition(sheepFile,safeConditions);
} }
@Override @Override

View File

@@ -47,6 +47,16 @@ public class DewormController extends BaseController
return getDataTable(list); return getDataTable(list);
} }
@PreAuthorize("@ss.hasPermi('biosafety:deworm:list')")
@GetMapping("/searchEarNumbers")
public AjaxResult getSheepNoList(String sheepNo)
{
Deworm deworm = new Deworm();
deworm.setSheepNo(sheepNo);
List<String> list = dewormService.selectSheepNoList(deworm);
return success(list);
}
/** /**
* 导出驱虫列表 * 导出驱虫列表
*/ */

View File

@@ -2,6 +2,8 @@ package com.zhyc.module.biosafety.controller;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.zhyc.module.biosafety.domain.Deworm;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@@ -114,4 +116,15 @@ public class DiagnosisController extends BaseController
{ {
return toAjax(diagnosisService.deleteDiagnosisByIds(ids)); return toAjax(diagnosisService.deleteDiagnosisByIds(ids));
} }
@PreAuthorize("@ss.hasPermi('biosafety:diagnosis:list')")
@GetMapping("/searchEarNumbers")
public AjaxResult getSheepNoList(String sheepNo)
{
Diagnosis diagnosis = new Diagnosis();
diagnosis.setSheepNo(sheepNo);
List<String> list = diagnosisService.selectSheepNoList(diagnosis);
return success(list);
}
} }

View File

@@ -1,6 +1,8 @@
package com.zhyc.module.biosafety.controller; package com.zhyc.module.biosafety.controller;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Objects;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.zhyc.module.biosafety.service.IDisinfectService; import com.zhyc.module.biosafety.service.IDisinfectService;
@@ -104,4 +106,13 @@ public class DisinfectController extends BaseController
{ {
return toAjax(disinfectService.deleteDisinfectByIds(ids)); return toAjax(disinfectService.deleteDisinfectByIds(ids));
} }
@PreAuthorize("@ss.hasPermi('biosafety:disinfect:list')")
@GetMapping("/searchSheepfold")
public AjaxResult getSheepfoldList(String sheepfold){
Disinfect disinfect = new Disinfect();
disinfect.setSheepfoldName(sheepfold);
List<Object[]> list = disinfectService.selectSheepfoldList(disinfect);
return success(list);
}
} }

View File

@@ -4,6 +4,7 @@ import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.zhyc.common.utils.SecurityUtils; import com.zhyc.common.utils.SecurityUtils;
import com.zhyc.module.biosafety.domain.Deworm;
import com.zhyc.module.biosafety.service.IHealthService; import com.zhyc.module.biosafety.service.IHealthService;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@@ -105,4 +106,15 @@ public class HealthController extends BaseController
{ {
return toAjax(healthService.deleteHealthByIds(ids)); return toAjax(healthService.deleteHealthByIds(ids));
} }
@PreAuthorize("@ss.hasPermi('biosafety:health:list')")
@GetMapping("/searchEarNumbers")
public AjaxResult getSheepNoList(String sheepNo)
{
Health health = new Health();
health.setSheepNo(sheepNo);
List<String> list = healthService.selectSheepNoList(health);
return success(list);
}
} }

View File

@@ -3,6 +3,7 @@ package com.zhyc.module.biosafety.controller;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.zhyc.module.biosafety.domain.Health;
import com.zhyc.module.biosafety.service.IImmunityService; import com.zhyc.module.biosafety.service.IImmunityService;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@@ -104,4 +105,15 @@ public class ImmunityController extends BaseController
{ {
return toAjax(immunityService.deleteImmunityByIds(ids)); return toAjax(immunityService.deleteImmunityByIds(ids));
} }
@PreAuthorize("@ss.hasPermi('biosafety:immunity:list')")
@GetMapping("/searchEarNumbers")
public AjaxResult getSheepNoList(String sheepNo)
{
Immunity immunity = new Immunity();
immunity.setSheepNo(sheepNo);
List<String> list = immunityService.selectSheepNoList(immunity);
return success(list);
}
} }

View File

@@ -3,6 +3,7 @@ package com.zhyc.module.biosafety.controller;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.zhyc.module.biosafety.domain.Health;
import com.zhyc.module.biosafety.domain.QuarantineReport; import com.zhyc.module.biosafety.domain.QuarantineReport;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@@ -104,4 +105,15 @@ public class QuarantineReportController extends BaseController
{ {
return toAjax(quarantineReportService.deleteQuarantineReportByIds(ids)); return toAjax(quarantineReportService.deleteQuarantineReportByIds(ids));
} }
@PreAuthorize("@ss.hasPermi('biosafety:quarantine:list')")
@GetMapping("/searchEarNumbers")
public AjaxResult getSheepNoList(String sheepNo)
{
QuarantineReport report = new QuarantineReport();
report.setSheepNo(sheepNo);
List<String> list = quarantineReportService.selectSheepNoList(report);
return success(list);
}
} }

View File

@@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.zhyc.module.biosafety.domain.Health;
import com.zhyc.module.biosafety.domain.SwMedicineUsage; import com.zhyc.module.biosafety.domain.SwMedicineUsage;
import com.zhyc.module.biosafety.service.ISwMedicineUsageService; import com.zhyc.module.biosafety.service.ISwMedicineUsageService;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
@@ -110,4 +111,14 @@ public class SwMedicineUsageController extends BaseController
{ {
return toAjax(swMedicineUsageService.deleteSwMedicineUsageByIds(ids)); return toAjax(swMedicineUsageService.deleteSwMedicineUsageByIds(ids));
} }
@PreAuthorize("@ss.hasPermi('biosafety:usageInfo:list')")
@GetMapping("/searchEarNumbers")
public AjaxResult getSheepNoList(String sheepNo)
{
SwMedicineUsage usage = new SwMedicineUsage();
usage.setSheepNo(sheepNo);
List<String> list = swMedicineUsageService.selectSheepNoList(usage);
return success(list);
}
} }

View File

@@ -3,6 +3,7 @@ package com.zhyc.module.biosafety.controller;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.zhyc.module.biosafety.domain.Health;
import com.zhyc.module.biosafety.domain.Treatment; import com.zhyc.module.biosafety.domain.Treatment;
import com.zhyc.module.biosafety.service.ITreatmentService; import com.zhyc.module.biosafety.service.ITreatmentService;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
@@ -104,4 +105,15 @@ public class TreatmentController extends BaseController
{ {
return toAjax(treatmentService.deleteTreatmentByIds(ids)); return toAjax(treatmentService.deleteTreatmentByIds(ids));
} }
@PreAuthorize("@ss.hasPermi('biosafety:treatment:list')")
@GetMapping("/searchEarNumbers")
public AjaxResult getSheepNoList(String sheepNo)
{
Treatment treatment = new Treatment();
treatment.setSheepNo(sheepNo);
List<String> list = treatmentService.selectSheepNoList(treatment);
return success(list);
}
} }

View File

@@ -26,6 +26,7 @@ public class Deworm extends BaseEntity
/** $column.columnComment */ /** $column.columnComment */
private Long id; private Long id;
private Long[] ids;
private Long sheepId; private Long sheepId;
@@ -58,7 +59,7 @@ public class Deworm extends BaseEntity
private Long deptId; private Long deptId;
/** 药品使用记录 */ /** 药品使用记录 */
@Excel(name = "药品使用记录") // @Excel(name = "药品使用记录")
private Integer usageId; private Integer usageId;
@@ -78,9 +79,28 @@ public class Deworm extends BaseEntity
@Excel(name = "备注") @Excel(name = "备注")
private String comment; private String comment;
/**
* 是否在群查询条件0-在群1-离群),非数据库字段
*/
private Integer isDelete;
// 排序查询 // 排序查询
private String orderByColumn; private String orderByColumn;
private String isAsc; private String isAsc;
public void setGender(String gender) {
this.gender = gender;
if (gender != null && !gender.trim().isEmpty()) {
try {
Integer genderCode = Integer.valueOf(gender.trim());
this.genderName = Gender.getDescByCode(genderCode);
} catch (NumberFormatException e) {
// 如果转换失败,设置为空或默认值
this.genderName = null;
}
} else {
this.genderName = null;
}
}
} }

View File

@@ -26,9 +26,10 @@ public class Diagnosis extends BaseEntity
/** $column.columnComment */ /** $column.columnComment */
private Long id; private Long id;
private Long[] ids;
/** 治疗记录id */ /** 治疗记录id */
@Excel(name = "治疗记录") // @Excel(name = "治疗记录")
private Long treatId; private Long treatId;
private Integer[] treatIds; private Integer[] treatIds;
/** 时间日期 */ /** 时间日期 */
@@ -80,6 +81,8 @@ public class Diagnosis extends BaseEntity
/** 诊疗结果 */ /** 诊疗结果 */
@Excel(name = "诊疗结果") @Excel(name = "诊疗结果")
private String resultName;
/** 诊断结果 */
private String result; private String result;
/** 开始时间 */ /** 开始时间 */
@@ -106,6 +109,11 @@ public class Diagnosis extends BaseEntity
private String orderByColumn; private String orderByColumn;
private String isAsc; private String isAsc;
/**
* 是否在群查询条件0-在群1-离群),非数据库字段
*/
private Integer isDelete;
private Long userId; private Long userId;
private Long deptId; private Long deptId;
@@ -123,5 +131,19 @@ public class Diagnosis extends BaseEntity
this.genderName = null; this.genderName = null;
} }
} }
public void setResult(String result) {
this.result = result;
if (result != null && !result.trim().isEmpty()) {
try {
Integer resultCode = Integer.valueOf(result.trim());
this.resultName = Gender.getDescByCode(resultCode);
} catch (NumberFormatException e) {
// 如果转换失败,设置为空或默认值
this.resultName = null;
}
} else {
this.resultName = null;
}
}
} }

View File

@@ -25,6 +25,7 @@ public class Disinfect extends BaseEntity
/** id */ /** id */
private Long id; private Long id;
private Long[] ids;
/** 羊舍id */ /** 羊舍id */
@Excel(name = "羊舍") @Excel(name = "羊舍")
@@ -43,12 +44,12 @@ public class Disinfect extends BaseEntity
@Excel(name = "技术员") @Excel(name = "技术员")
private String technician; private String technician;
/** 消毒方式 */ /** 消毒方式0喷雾 1撒布 2浸泡 3熏蒸 4其他 */
@Excel(name = "消毒方式") @Excel(name = "消毒方式", readConverterExp = "0=喷雾,1=撒布,2=浸泡,3=熏蒸,4=其他")
private String way; private String way;
/** 药品使用记录id */ /** 药品使用记录id */
@Excel(name = "药品使用记录id") // @Excel(name = "药品使用记录id")
private Integer usageId; private Integer usageId;
/** 比例 */ /** 比例 */

View File

@@ -22,6 +22,7 @@ public class Health extends BaseEntity
/** $column.columnComment */ /** $column.columnComment */
private Long id; private Long id;
private Long[] ids;
/** 保健日期 */ /** 保健日期 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@@ -29,7 +30,7 @@ public class Health extends BaseEntity
private Date datetime; private Date datetime;
/** 羊只id */ /** 羊只id */
@Excel(name = "羊只id") // @Excel(name = "羊只id")
private Long sheepId; private Long sheepId;
private Integer[] sheepIds; private Integer[] sheepIds;
@@ -57,7 +58,7 @@ public class Health extends BaseEntity
private Long parity; private Long parity;
/** 用药记录 */ /** 用药记录 */
@Excel(name = "用药记录") // @Excel(name = "用药记录")
private Integer usageId; private Integer usageId;
@@ -79,6 +80,11 @@ public class Health extends BaseEntity
private String orderByColumn; private String orderByColumn;
private String isAsc; private String isAsc;
/**
* 是否在群查询条件0-在群1-离群),非数据库字段
*/
private Integer isDelete;
public void setGender(String gender) { public void setGender(String gender) {
this.gender = gender; this.gender = gender;
if (gender != null && !gender.trim().isEmpty()) { if (gender != null && !gender.trim().isEmpty()) {

View File

@@ -26,9 +26,9 @@ public class Immunity extends BaseEntity
/** $column.columnComment */ /** $column.columnComment */
private Long id; private Long id;
private Long[] ids;
/** 羊只id */ /** 羊只id */
@Excel(name = "羊只id")
private Long sheepId; private Long sheepId;
private Integer[] sheepIds; private Integer[] sheepIds;
@@ -42,7 +42,6 @@ public class Immunity extends BaseEntity
@Excel(name = "品种") @Excel(name = "品种")
private String variety; private String variety;
@Excel(name = "羊只类别") @Excel(name = "羊只类别")
private String sheepType; private String sheepType;
@@ -61,7 +60,7 @@ public class Immunity extends BaseEntity
private Long parity; private Long parity;
/** 使用记录 */ /** 使用记录 */
@Excel(name = "使用记录") // @Excel(name = "使用记录")
private Integer usageId; private Integer usageId;
@@ -81,6 +80,11 @@ public class Immunity extends BaseEntity
private Long userId; private Long userId;
private Long deptId; private Long deptId;
/**
* 是否在群查询条件0-在群1-离群),非数据库字段
*/
private Integer isDelete;
// 药品使用 // 药品使用
private List<SwMedicineUsageDetails> usageDetails; private List<SwMedicineUsageDetails> usageDetails;

View File

@@ -4,6 +4,8 @@ import java.util.Date;
import java.util.List; import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.zhyc.module.biosafety.enums.QuarantineResult;
import com.zhyc.module.biosafety.enums.QuarantineStatus;
import com.zhyc.module.enums.Gender; import com.zhyc.module.enums.Gender;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
@@ -91,10 +93,12 @@ public class QuarantineReport extends BaseEntity
/** 检疫结果 */ /** 检疫结果 */
@Excel(name = "检疫结果") @Excel(name = "检疫结果")
private String resultName;
private String result; private String result;
/** 状态 */ /** 状态 */
@Excel(name = "状态") @Excel(name = "状态")
private String statusName;
private Integer status; private Integer status;
/** 备注*/ /** 备注*/
@@ -104,6 +108,11 @@ public class QuarantineReport extends BaseEntity
private Long userId; private Long userId;
private Long deptId; private Long deptId;
/**
* 是否在群查询条件0-在群1-离群),非数据库字段
*/
private Integer isDelete;
public void setGender(String gender) { public void setGender(String gender) {
this.gender = gender; this.gender = gender;
if (gender != null && !gender.trim().isEmpty()) { if (gender != null && !gender.trim().isEmpty()) {
@@ -118,6 +127,35 @@ public class QuarantineReport extends BaseEntity
this.genderName = null; this.genderName = null;
} }
} }
// 检疫结果转换
public void setResult(String result) {
this.result = result;
if (result != null && !result.trim().isEmpty()) {
try {
Integer resultCode = Integer.valueOf(result.trim());
this.resultName = QuarantineResult.getDescByCode(resultCode);
} catch (NumberFormatException e) {
// 如果转换失败,设置为空或默认值
this.resultName = null;
}
} else {
this.genderName = null;
}
}
// 检疫状态
public void setStatus(Integer status) {
this.status = status;
if (status != null) {
try {
this.statusName = QuarantineStatus.getDescByCode(status);
} catch (NumberFormatException e) {
// 如果转换失败,设置为空或默认值
this.statusName = null;
}
} else {
this.statusName = null;
}
}
// 排序查询 // 排序查询
private String orderByColumn; private String orderByColumn;

View File

@@ -5,6 +5,8 @@ import java.util.Date;
import java.util.List; import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.zhyc.module.biosafety.enums.PrescriptionType;
import com.zhyc.module.biosafety.enums.TreatmentStatus;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
@@ -26,13 +28,14 @@ public class SwMedicineUsage extends BaseEntity
/** id */ /** id */
private Integer id; private Integer id;
private Long[] ids;
/** 使用名称 */ /** 使用名称 */
@Excel(name = "使用名称",width = 20, needMerge = true) @Excel(name = "使用名称",width = 20, needMerge = true)
private String name; private String name;
/** 羊舍名称 */ /** 羊舍名称 */
@Excel(name = "使用名称" ,width = 20, needMerge = true) @Excel(name = "羊舍名称" ,width = 20, needMerge = true)
private String sheepfoldName; private String sheepfoldName;
private Integer sheepfoldId; private Integer sheepfoldId;
/** 耳号 */ /** 耳号 */
@@ -51,8 +54,10 @@ public class SwMedicineUsage extends BaseEntity
/** 使用类型 */ /** 使用类型 */
@Excel(name = "使用类型",width = 20, needMerge = true) @Excel(name = "使用类型",width = 20, needMerge = true)
private String useTypeName;
private String useType; private String useType;
private Long userId; private Long userId;
private Long deptId; private Long deptId;
@@ -61,4 +66,17 @@ public class SwMedicineUsage extends BaseEntity
private List<SwMedicineUsageDetails> swMedicineUsageDetailsList; private List<SwMedicineUsageDetails> swMedicineUsageDetailsList;
/** 状态转换 */
public void setUseType(String useType) {
this.useType = useType;
this.useTypeName = null;
if (useType != null && !useType.trim().isEmpty()) {
try {
this.useTypeName = PrescriptionType.getDescByCode(Integer.valueOf(useType.trim()));
} catch (NumberFormatException ex) {
// 可选:记录日志、或抛业务异常
this.useTypeName = "未知";
}
}
}
} }

View File

@@ -4,6 +4,7 @@ import java.util.Date;
import java.util.List; import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.zhyc.module.biosafety.enums.TreatmentStatus;
import com.zhyc.module.enums.Gender; import com.zhyc.module.enums.Gender;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
@@ -25,6 +26,7 @@ public class Treatment extends BaseEntity
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private Long id; private Long id;
private Long[] ids;
/** 诊疗记录id */ /** 诊疗记录id */
private Long diagId; private Long diagId;
@@ -97,22 +99,38 @@ public class Treatment extends BaseEntity
private String veterinary; private String veterinary;
/** 治疗状态 */ /** 治疗状态 */
@Excel(name = "治疗状态") @Excel(name = "治疗状态")
private String statusName;
private String status; private String status;
/** 药品使用记录id */ /** 药品使用记录id */
@Excel(name = "药品使用记录id")
private Integer usageId; private Integer usageId;
private Long userId; private Long userId;
private Long deptId; private Long deptId;
/**
* 是否在群查询条件0-在群1-离群),非数据库字段
*/
private Integer isDelete;
// 药品使用 // 药品使用
private List<SwMedicineUsageDetails> usageDetails; private List<SwMedicineUsageDetails> usageDetails;
/** 备注 */ /** 备注 */
@Excel(name = "备注") @Excel(name = "备注")
private String comment; private String comment;
// 排序查询
private String orderByColumn;
private String isAsc;
/** 性别转换 */
public void setGender(String gender) { public void setGender(String gender) {
this.gender = gender; // 保留原始字符串 this.gender = gender; // 保留原始字符串
this.genderName = null; // 先清空 this.genderName = null; // 先清空
@@ -125,8 +143,18 @@ public class Treatment extends BaseEntity
} }
} }
} }
/** 状态转换 */
public void setStatus(String status) {
this.status = status;
this.statusName = null;
if (status != null && !status.trim().isEmpty()) {
try {
this.statusName = TreatmentStatus.getDescByCode(Integer.valueOf(status.trim()));
} catch (NumberFormatException ex) {
// 可选:记录日志、或抛业务异常
this.statusName = "未知";
}
}
}
// 排序查询
private String orderByColumn;
private String isAsc;
} }

View File

@@ -0,0 +1,74 @@
package com.zhyc.module.biosafety.enums;
/**
* 诊疗结果枚举
*/
public enum DiagnosisResult {
ABANDONED(0, "放弃"),
CURED(1, "已治愈"),
IN_TREATMENT(2, "治疗中"),
COMPLETED(3, "治疗完成");
private final int code;
private final String desc;
DiagnosisResult(int code, String desc) {
this.code = code;
this.desc = desc;
}
public int getCode() {
return code;
}
public String getDesc() {
return desc;
}
/**
* 根据code获取描述
*/
public static String getDescByCode(Integer code) {
if (code == null) {
return "";
}
for (DiagnosisResult result : values()) {
if (result.code == code) {
return result.desc;
}
}
return "";
}
/**
* 根据code获取枚举
*/
public static DiagnosisResult getByCode(Integer code) {
if (code == null) {
return null;
}
for (DiagnosisResult result : values()) {
if (result.code == code) {
return result;
}
}
return null;
}
/**
* 根据描述获取code
*/
public static Integer getCodeByDesc(String desc) {
if (desc == null || desc.trim().isEmpty()) {
return null;
}
for (DiagnosisResult result : values()) {
if (result.desc.equals(desc)) {
return result.code;
}
}
return null;
}
}

View File

@@ -0,0 +1,74 @@
package com.zhyc.module.biosafety.enums;
/**
* 消毒方式枚举
*/
public enum DisinfectionMethod {
SPRAY(0, "喷雾"),
SCATTER(1, "撒布"),
SOAK(2, "浸泡"),
FUMIGATE(3, "熏蒸"),
OTHER(4, "其他");
private final int code;
private final String desc;
DisinfectionMethod(int code, String desc) {
this.code = code;
this.desc = desc;
}
public int getCode() {
return code;
}
public String getDesc() {
return desc;
}
/**
* 根据code获取描述
*/
public static String getDescByCode(Integer code) {
if (code == null) {
return "";
}
for (DisinfectionMethod method : values()) {
if (method.code == code) {
return method.desc;
}
}
return "";
}
/**
* 根据code获取枚举
*/
public static DisinfectionMethod getByCode(Integer code) {
if (code == null) {
return null;
}
for (DisinfectionMethod method : values()) {
if (method.code == code) {
return method;
}
}
return null;
}
/**
* 根据描述获取code
*/
public static Integer getCodeByDesc(String desc) {
if (desc == null || desc.trim().isEmpty()) {
return null;
}
for (DisinfectionMethod method : values()) {
if (method.desc.equals(desc)) {
return method.code;
}
}
return null;
}
}

View File

@@ -0,0 +1,75 @@
package com.zhyc.module.biosafety.enums;
/**
* 处方类型枚举
*/
public enum PrescriptionType {
IMMUNITY(0, "免疫"),
DEWORMING(1, "驱虫"),
HEALTH_CARE(2, "保健"),
DISINFECTION(3, "消毒"),
DISEASE_TREATMENT(4, "疾病治疗");
private final int code;
private final String desc;
PrescriptionType(int code, String desc) {
this.code = code;
this.desc = desc;
}
public int getCode() {
return code;
}
public String getDesc() {
return desc;
}
/**
* 根据code获取描述
*/
public static String getDescByCode(Integer code) {
if (code == null) {
return "";
}
for (PrescriptionType type : values()) {
if (type.code == code) {
return type.desc;
}
}
return "";
}
/**
* 根据code获取枚举
*/
public static PrescriptionType getByCode(Integer code) {
if (code == null) {
return null;
}
for (PrescriptionType type : values()) {
if (type.code == code) {
return type;
}
}
return null;
}
/**
* 根据描述获取code
*/
public static Integer getCodeByDesc(String desc) {
if (desc == null || desc.trim().isEmpty()) {
return null;
}
for (PrescriptionType type : values()) {
if (type.desc.equals(desc)) {
return type.code;
}
}
return null;
}
}

View File

@@ -0,0 +1,71 @@
package com.zhyc.module.biosafety.enums;
/**
* 检疫结果枚举
*/
public enum QuarantineResult {
NEGATIVE(0, "阴性"),
POSITIVE(1, "阳性");
private final int code;
private final String desc;
QuarantineResult(int code, String desc) {
this.code = code;
this.desc = desc;
}
public int getCode() {
return code;
}
public String getDesc() {
return desc;
}
/**
* 根据code获取描述
*/
public static String getDescByCode(Integer code) {
if (code == null) {
return "";
}
for (QuarantineResult result : values()) {
if (result.code == code) {
return result.desc;
}
}
return "";
}
/**
* 根据code获取枚举
*/
public static QuarantineResult getByCode(Integer code) {
if (code == null) {
return null;
}
for (QuarantineResult result : values()) {
if (result.code == code) {
return result;
}
}
return null;
}
/**
* 根据描述获取code
*/
public static Integer getCodeByDesc(String desc) {
if (desc == null || desc.trim().isEmpty()) {
return null;
}
for (QuarantineResult result : values()) {
if (result.desc.equals(desc)) {
return result.code;
}
}
return null;
}
}

View File

@@ -0,0 +1,72 @@
package com.zhyc.module.biosafety.enums;
/**
* 检疫状态枚举
*/
public enum QuarantineStatus {
PENDING(0, "送检中"),
TESTED(1, "已检测");
private final int code;
private final String desc;
QuarantineStatus(int code, String desc) {
this.code = code;
this.desc = desc;
}
public int getCode() {
return code;
}
public String getDesc() {
return desc;
}
/**
* 根据code获取描述
*/
public static String getDescByCode(Integer code) {
if (code == null) {
return "";
}
for (QuarantineStatus status : values()) {
if (status.code == code) {
return status.desc;
}
}
return "";
}
/**
* 根据code获取枚举
*/
public static QuarantineStatus getByCode(Integer code) {
if (code == null) {
return null;
}
for (QuarantineStatus status : values()) {
if (status.code == code) {
return status;
}
}
return null;
}
/**
* 根据描述获取code
*/
public static Integer getCodeByDesc(String desc) {
if (desc == null || desc.trim().isEmpty()) {
return null;
}
for (QuarantineStatus status : values()) {
if (status.desc.equals(desc)) {
return status.code;
}
}
return null;
}
}

View File

@@ -0,0 +1,31 @@
package com.zhyc.module.biosafety.enums;
/**
* 治疗状态枚举
*/
public enum TreatmentStatus {
ABANDONED(-1, "放弃", 0),
IN_TREATMENT(0, "治疗中", 1),
TREATMENT_COMPLETED(1, "治疗完成", 2),
CURED(2, "已治愈", 3);
private final int code;
private final String desc;
private final int sort;
TreatmentStatus(int code, String desc, int sort) {
this.code = code;
this.desc = desc;
this.sort = sort;
}
public static String getDescByCode(Integer code) {
for (TreatmentStatus status : values()) {
if (status.code == code) {
return status.desc;
}
}
return "未知";
}
}

View File

@@ -61,4 +61,6 @@ public interface DewormMapper
* @return 结果 * @return 结果
*/ */
public int deleteDewormByIds(Long[] ids); public int deleteDewormByIds(Long[] ids);
List<String> selectSheepNoList(Deworm deworm);
} }

View File

@@ -60,4 +60,6 @@ public interface DiagnosisMapper
* @return 结果 * @return 结果
*/ */
public int deleteDiagnosisByIds(Long[] ids); public int deleteDiagnosisByIds(Long[] ids);
List<String> selectSheepNoList(Diagnosis diagnosis);
} }

View File

@@ -1,5 +1,6 @@
package com.zhyc.module.biosafety.mapper; package com.zhyc.module.biosafety.mapper;
import java.util.HashMap;
import java.util.List; import java.util.List;
import com.zhyc.module.biosafety.domain.Disinfect; import com.zhyc.module.biosafety.domain.Disinfect;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
@@ -60,4 +61,6 @@ public interface DisinfectMapper
* @return 结果 * @return 结果
*/ */
public int deleteDisinfectByIds(Long[] ids); public int deleteDisinfectByIds(Long[] ids);
List<Object[]> selectSheepfoldList(Disinfect disinfect);
} }

View File

@@ -13,6 +13,9 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper @Mapper
public interface HealthMapper public interface HealthMapper
{ {
/** /**
* 查询保健 * 查询保健
* *
@@ -60,4 +63,6 @@ public interface HealthMapper
* @return 结果 * @return 结果
*/ */
public int deleteHealthByIds(Long[] ids); public int deleteHealthByIds(Long[] ids);
List<String> selectSheepNoList(Health health);
} }

View File

@@ -60,4 +60,6 @@ public interface ImmunityMapper
* @return 结果 * @return 结果
*/ */
public int deleteImmunityByIds(Long[] ids); public int deleteImmunityByIds(Long[] ids);
List<String> selectSheepNoList(Immunity immunity);
} }

View File

@@ -61,4 +61,6 @@ public interface QuarantineReportMapper
* @return 结果 * @return 结果
*/ */
public int deleteQuarantineReportByIds(Long[] ids); public int deleteQuarantineReportByIds(Long[] ids);
List<String> selectSheepNoList(QuarantineReport report);
} }

View File

@@ -89,4 +89,6 @@ public interface SwMedicineUsageMapper
public int deleteSwMedicineUsageDetailsByMediUsage(Integer id); public int deleteSwMedicineUsageDetailsByMediUsage(Integer id);
List<SwMedicineUsageDetails> selectSwMedicineUsageDetailsById(Integer id); List<SwMedicineUsageDetails> selectSwMedicineUsageDetailsById(Integer id);
List<String> selectSheepNoList(SwMedicineUsage usage);
} }

View File

@@ -66,4 +66,6 @@ public interface TreatmentMapper
List<Treatment> selectTreatmentStatus(Long sheepId); List<Treatment> selectTreatmentStatus(Long sheepId);
List<String> selectSheepNoList(Treatment treatment);
} }

View File

@@ -59,4 +59,6 @@ public interface IDewormService
* @return 结果 * @return 结果
*/ */
public int deleteDewormById(Long id); public int deleteDewormById(Long id);
List<String> selectSheepNoList(Deworm deworm);
} }

View File

@@ -61,4 +61,6 @@ public interface IDiagnosisService
public int deleteDiagnosisById(Long id); public int deleteDiagnosisById(Long id);
int insertDiagnosisList(Diagnosis diagnosis); int insertDiagnosisList(Diagnosis diagnosis);
List<String> selectSheepNoList(Diagnosis diagnosis);
} }

View File

@@ -1,6 +1,7 @@
package com.zhyc.module.biosafety.service; package com.zhyc.module.biosafety.service;
import java.util.List; import java.util.List;
import com.zhyc.module.biosafety.domain.Disinfect; import com.zhyc.module.biosafety.domain.Disinfect;
/** /**
@@ -58,4 +59,6 @@ public interface IDisinfectService
* @return 结果 * @return 结果
*/ */
public int deleteDisinfectById(Long id); public int deleteDisinfectById(Long id);
List<Object[]> selectSheepfoldList(Disinfect disinfect);
} }

View File

@@ -58,4 +58,6 @@ public interface IHealthService
* @return 结果 * @return 结果
*/ */
public int deleteHealthById(Long id); public int deleteHealthById(Long id);
List<String> selectSheepNoList(Health health);
} }

View File

@@ -58,4 +58,6 @@ public interface IImmunityService
* @return 结果 * @return 结果
*/ */
public int deleteImmunityById(Long id); public int deleteImmunityById(Long id);
List<String> selectSheepNoList(Immunity immunity);
} }

View File

@@ -59,4 +59,6 @@ public interface IQuarantineReportService
* @return 结果 * @return 结果
*/ */
public int deleteQuarantineReportById(Long id); public int deleteQuarantineReportById(Long id);
List<String> selectSheepNoList(QuarantineReport report);
} }

View File

@@ -61,4 +61,6 @@ public interface ISwMedicineUsageService
public int deleteSwMedicineUsageById(Integer id); public int deleteSwMedicineUsageById(Integer id);
List<SwMedicineUsageDetails> selectSwMedicineUsageDetailsById(Integer id); List<SwMedicineUsageDetails> selectSwMedicineUsageDetailsById(Integer id);
List<String> selectSheepNoList(SwMedicineUsage usage);
} }

View File

@@ -60,4 +60,6 @@ public interface ITreatmentService
* @return 结果 * @return 结果
*/ */
public int deleteTreatmentById(Long id); public int deleteTreatmentById(Long id);
List<String> selectSheepNoList(Treatment treatment);
} }

View File

@@ -172,4 +172,10 @@ public class DewormServiceImpl implements IDewormService
{ {
return dewormMapper.deleteDewormById(id); return dewormMapper.deleteDewormById(id);
} }
@DataScope(deptAlias = "s", userAlias = "s")
@Override
public List<String> selectSheepNoList(Deworm deworm) {
return dewormMapper.selectSheepNoList(deworm);
}
} }

View File

@@ -11,6 +11,7 @@ import com.zhyc.module.base.domain.BasSheep;
import com.zhyc.module.base.domain.SheepFile; import com.zhyc.module.base.domain.SheepFile;
import com.zhyc.module.base.mapper.BasSheepMapper; import com.zhyc.module.base.mapper.BasSheepMapper;
import com.zhyc.module.base.mapper.SheepFileMapper; import com.zhyc.module.base.mapper.SheepFileMapper;
import com.zhyc.module.biosafety.domain.Deworm;
import com.zhyc.module.biosafety.domain.Treatment; import com.zhyc.module.biosafety.domain.Treatment;
import com.zhyc.module.biosafety.mapper.DiagnosisMapper; import com.zhyc.module.biosafety.mapper.DiagnosisMapper;
import com.zhyc.module.biosafety.mapper.TreatmentMapper; import com.zhyc.module.biosafety.mapper.TreatmentMapper;
@@ -220,4 +221,10 @@ public class DiagnosisServiceImpl implements IDiagnosisService
return diagnosisMapper.deleteDiagnosisById(id); return diagnosisMapper.deleteDiagnosisById(id);
} }
@DataScope(deptAlias = "s", userAlias = "s")
@Override
public List<String> selectSheepNoList(Diagnosis diagnosis) {
return diagnosisMapper.selectSheepNoList(diagnosis);
}
} }

View File

@@ -149,4 +149,10 @@ public class DisinfectServiceImpl implements IDisinfectService
{ {
return disinfectMapper.deleteDisinfectById(id); return disinfectMapper.deleteDisinfectById(id);
} }
@DataScope(deptAlias = "s", userAlias = "s")
@Override
public List<Object[]> selectSheepfoldList(Disinfect disinfect) {
return disinfectMapper.selectSheepfoldList(disinfect);
}
} }

View File

@@ -11,6 +11,7 @@ import com.zhyc.common.utils.SecurityUtils;
import com.zhyc.common.utils.bean.BeanUtils; import com.zhyc.common.utils.bean.BeanUtils;
import com.zhyc.module.base.domain.SheepFile; import com.zhyc.module.base.domain.SheepFile;
import com.zhyc.module.base.mapper.SheepFileMapper; import com.zhyc.module.base.mapper.SheepFileMapper;
import com.zhyc.module.biosafety.domain.Deworm;
import com.zhyc.module.biosafety.domain.SwMedicineUsage; import com.zhyc.module.biosafety.domain.SwMedicineUsage;
import com.zhyc.module.biosafety.domain.SwMedicineUsageDetails; import com.zhyc.module.biosafety.domain.SwMedicineUsageDetails;
import com.zhyc.module.biosafety.mapper.SwMedicineUsageMapper; import com.zhyc.module.biosafety.mapper.SwMedicineUsageMapper;
@@ -165,4 +166,11 @@ public class HealthServiceImpl implements IHealthService
{ {
return healthMapper.deleteHealthById(id); return healthMapper.deleteHealthById(id);
} }
@DataScope(deptAlias = "s", userAlias = "s")
@Override
public List<String> selectSheepNoList(Health health) {
return healthMapper.selectSheepNoList(health);
}
} }

View File

@@ -9,6 +9,7 @@ import com.zhyc.common.utils.SecurityUtils;
import com.zhyc.common.utils.bean.BeanUtils; import com.zhyc.common.utils.bean.BeanUtils;
import com.zhyc.module.base.domain.SheepFile; import com.zhyc.module.base.domain.SheepFile;
import com.zhyc.module.base.mapper.SheepFileMapper; import com.zhyc.module.base.mapper.SheepFileMapper;
import com.zhyc.module.biosafety.domain.Deworm;
import com.zhyc.module.biosafety.domain.SwMedicineUsage; import com.zhyc.module.biosafety.domain.SwMedicineUsage;
import com.zhyc.module.biosafety.domain.SwMedicineUsageDetails; import com.zhyc.module.biosafety.domain.SwMedicineUsageDetails;
import com.zhyc.module.biosafety.mapper.SwMedicineUsageMapper; import com.zhyc.module.biosafety.mapper.SwMedicineUsageMapper;
@@ -170,4 +171,10 @@ public class ImmunityServiceImpl implements IImmunityService
{ {
return immunityMapper.deleteImmunityById(id); return immunityMapper.deleteImmunityById(id);
} }
@DataScope(deptAlias = "s", userAlias = "s")
@Override
public List<String> selectSheepNoList(Immunity immunity) {
return immunityMapper.selectSheepNoList(immunity);
}
} }

View File

@@ -9,6 +9,7 @@ import com.zhyc.common.utils.SecurityUtils;
import com.zhyc.common.utils.bean.BeanUtils; import com.zhyc.common.utils.bean.BeanUtils;
import com.zhyc.module.base.domain.SheepFile; import com.zhyc.module.base.domain.SheepFile;
import com.zhyc.module.base.service.impl.SheepFileServiceImpl; import com.zhyc.module.base.service.impl.SheepFileServiceImpl;
import com.zhyc.module.biosafety.domain.Immunity;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.zhyc.module.biosafety.mapper.QuarantineReportMapper; import com.zhyc.module.biosafety.mapper.QuarantineReportMapper;
@@ -136,4 +137,10 @@ public class QuarantineReportServiceImpl implements IQuarantineReportService
{ {
return quarantineReportMapper.deleteQuarantineReportById(id); return quarantineReportMapper.deleteQuarantineReportById(id);
} }
@DataScope(deptAlias = "s", userAlias = "s")
@Override
public List<String> selectSheepNoList(QuarantineReport report) {
return quarantineReportMapper.selectSheepNoList(report);
}
} }

View File

@@ -5,6 +5,7 @@ import java.util.List;
import com.zhyc.common.annotation.DataScope; import com.zhyc.common.annotation.DataScope;
import com.zhyc.common.utils.DateUtils; import com.zhyc.common.utils.DateUtils;
import com.zhyc.common.utils.SecurityUtils; import com.zhyc.common.utils.SecurityUtils;
import com.zhyc.module.biosafety.domain.Immunity;
import com.zhyc.module.biosafety.service.ISwMedicineUsageService; import com.zhyc.module.biosafety.service.ISwMedicineUsageService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -152,4 +153,10 @@ public class SwMedicineUsageServiceImpl implements ISwMedicineUsageService
} }
} }
} }
@DataScope(deptAlias = "s", userAlias = "s")
@Override
public List<String> selectSheepNoList(SwMedicineUsage usage) {
return swMedicineUsageMapper.selectSheepNoList(usage);
}
} }

View File

@@ -10,15 +10,12 @@ import com.zhyc.common.utils.bean.BeanUtils;
import com.zhyc.module.Exception.BusinessException; import com.zhyc.module.Exception.BusinessException;
import com.zhyc.module.base.domain.SheepFile; import com.zhyc.module.base.domain.SheepFile;
import com.zhyc.module.base.mapper.SheepFileMapper; import com.zhyc.module.base.mapper.SheepFileMapper;
import com.zhyc.module.biosafety.domain.Diagnosis; import com.zhyc.module.biosafety.domain.*;
import com.zhyc.module.biosafety.domain.SwMedicineUsage;
import com.zhyc.module.biosafety.domain.SwMedicineUsageDetails;
import com.zhyc.module.biosafety.mapper.DiagnosisMapper; import com.zhyc.module.biosafety.mapper.DiagnosisMapper;
import com.zhyc.module.biosafety.mapper.SwMedicineUsageMapper; import com.zhyc.module.biosafety.mapper.SwMedicineUsageMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.zhyc.module.biosafety.mapper.TreatmentMapper; import com.zhyc.module.biosafety.mapper.TreatmentMapper;
import com.zhyc.module.biosafety.domain.Treatment;
import com.zhyc.module.biosafety.service.ITreatmentService; import com.zhyc.module.biosafety.service.ITreatmentService;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@@ -243,6 +240,12 @@ public class TreatmentServiceImpl implements ITreatmentService
return treatmentMapper.deleteTreatmentById(id); return treatmentMapper.deleteTreatmentById(id);
} }
@DataScope(deptAlias = "s", userAlias = "s")
@Override
public List<String> selectSheepNoList(Treatment treatment) {
return treatmentMapper.selectSheepNoList(treatment);
}
public void updateTreatmentStatus(Long sheepId) { public void updateTreatmentStatus(Long sheepId) {
List<Treatment> treatments=treatmentMapper.selectTreatmentStatus(sheepId); List<Treatment> treatments=treatmentMapper.selectTreatmentStatus(sheepId);
Diagnosis diagnosis = new Diagnosis(); Diagnosis diagnosis = new Diagnosis();

View File

@@ -27,7 +27,9 @@ public class UserPostController {
@GetMapping("/getUser") @GetMapping("/getUser")
public AjaxResult getUserPost(String postCode){ public AjaxResult getUserPost(String postCode){
User user = new User(); User user = new User();
user.setPostCode(postCode); if (postCode != null){
user.setPostName(postCode);
}
List<User> list = userService.getUserListByCode(user); List<User> list = userService.getUserListByCode(user);
return AjaxResult.success(list); return AjaxResult.success(list);
} }
@@ -35,7 +37,14 @@ public class UserPostController {
// 获取岗位(部门) // 获取岗位(部门)
@GetMapping("/getPost") @GetMapping("/getPost")
public AjaxResult getPost(String postName){ public AjaxResult getPost(String postName){
List<Post> list = postService.selectPostList(); List<Post> list = postService.selectPostList(postName);
return AjaxResult.success(list);
}
// 获取岗位班组
@GetMapping("/getPostTeam")
public AjaxResult getPostTeam(){
List<Post> list = postService.selectPostList("");
return AjaxResult.success(list); return AjaxResult.success(list);
} }

View File

@@ -1,12 +1,29 @@
package com.zhyc.module.common.mapper; package com.zhyc.module.common.mapper;
import com.zhyc.module.common.domain.Post; import com.zhyc.module.common.domain.Post;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import java.util.List; import java.util.List;
public interface PostMapper { public interface PostMapper {
@Select("select * from sys_post where status = '0'") /**
List<Post> selectPostList(); * 根据岗位名称模糊查询岗位列表
*
* @param postName 岗位名称(可为空)
* @return 岗位列表
*/
@Select("SELECT post_id, post_code, post_name, post_sort, status FROM sys_post WHERE post_name LIKE CONCAT('%', #{postName}, '%') AND status = '0'")
@Results({
@Result(property = "postId", column = "post_id"),
@Result(property = "postCode", column = "post_code"),
@Result(property = "postName", column = "post_name"),
@Result(property = "postSort", column = "post_sort"),
@Result(property = "status", column = "status")
})
List<Post> selectPostList(@Param("postName") String postName);
} }

View File

@@ -5,5 +5,5 @@ import com.zhyc.module.common.domain.Post;
import java.util.List; import java.util.List;
public interface PostService { public interface PostService {
List<Post> selectPostList(); List<Post> selectPostList(String postName);
} }

View File

@@ -15,8 +15,8 @@ public class PostServiceImpl implements PostService {
PostMapper postMapper; PostMapper postMapper;
@Override @Override
public List<Post> selectPostList() { public List<Post> selectPostList(String postName) {
List<Post> list = postMapper.selectPostList(); List<Post> list = postMapper.selectPostList(postName);
return list; return list;
} }
} }

View File

@@ -1,4 +0,0 @@
package com.zhyc.module.enums;
public enum UseType {
}

View File

@@ -84,6 +84,9 @@ public class DdSaleController extends BaseController {
@Log(title = "销售主单", businessType = BusinessType.INSERT) @Log(title = "销售主单", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody DdSale ddSale) { public AjaxResult add(@RequestBody DdSale ddSale) {
// 适配数据分离
ddSale.setDeptId(getDeptId());
ddSale.setUserId(getUserId());
return toAjax(ddSaleService.insertDdSale(ddSale)); return toAjax(ddSaleService.insertDdSale(ddSale));
} }

View File

@@ -2,6 +2,9 @@ package com.zhyc.module.frozen.domain;
import java.util.Date; import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import com.zhyc.common.annotation.Excel; import com.zhyc.common.annotation.Excel;
@@ -13,13 +16,16 @@ import com.zhyc.common.core.domain.BaseEntity;
* @author ruoyi * @author ruoyi
* @date 2025-11-29 * @date 2025-11-29
*/ */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class DdFe extends BaseEntity public class DdFe extends BaseEntity
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** 主键 */ /** 主键 */
private Long id; private Long id;
private Long[] ids;
/** 胚胎编号 YS+日期+序号 */ /** 胚胎编号 YS+日期+序号 */
@Excel(name = "胚胎编号") @Excel(name = "胚胎编号")
private String code; private String code;
@@ -95,205 +101,5 @@ public class DdFe extends BaseEntity
this.id = 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();
}
} }

View File

@@ -3,6 +3,9 @@ package com.zhyc.module.frozen.domain;
import java.util.Date; import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import com.zhyc.common.annotation.Excel; import com.zhyc.common.annotation.Excel;
@@ -14,6 +17,9 @@ import com.zhyc.common.core.domain.BaseEntity;
* @author ruoyi * @author ruoyi
* @date 2025-11-29 * @date 2025-11-29
*/ */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class DdFs extends BaseEntity { public class DdFs extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@@ -21,7 +27,7 @@ public class DdFs extends BaseEntity {
* 主键 * 主键
*/ */
private Long id; private Long id;
private Long[] ids;
/** /**
* 冻精号/公羊耳号 * 冻精号/公羊耳号
*/ */
@@ -107,148 +113,4 @@ public class DdFs extends BaseEntity {
*/ */
@Excel(name = "废弃原因") @Excel(name = "废弃原因")
private String discardTxt; 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();
}
} }

View File

@@ -4,6 +4,10 @@ import java.math.BigDecimal;
import java.util.List; import java.util.List;
import java.util.Date; import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import com.zhyc.common.annotation.Excel; import com.zhyc.common.annotation.Excel;
@@ -11,10 +15,12 @@ import com.zhyc.common.core.domain.BaseEntity;
/** /**
* 销售主单对象 dd_sl * 销售主单对象 dd_sl
* *
* @author HashMap * @author HashMap
* @date 2025-12-01 * @date 2025-12-01
*/ */
@EqualsAndHashCode(callSuper = true)
@Data
public class DdSale extends BaseEntity public class DdSale extends BaseEntity
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@@ -59,119 +65,11 @@ public class DdSale extends BaseEntity
@Excel(name = "技术员") @Excel(name = "技术员")
private String tech; private String tech;
private Long userId;
private Long deptId;
/** 销售明细信息 */ /** 销售明细信息 */
private List<DdSaleItem> ddSaleItemList; private List<DdSaleItem> 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<DdSaleItem> getDdSaleItemList()
{
return ddSaleItemList;
}
public void setDdSaleItemList(List<DdSaleItem> ddSaleItemList)
{
this.ddSaleItemList = ddSaleItemList;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

View File

@@ -3,6 +3,7 @@ package com.zhyc.module.frozen.service.impl;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import com.zhyc.common.annotation.DataScope;
import com.zhyc.common.utils.DateUtils; import com.zhyc.common.utils.DateUtils;
import com.zhyc.module.frozen.domain.DdFe; import com.zhyc.module.frozen.domain.DdFe;
import com.zhyc.module.frozen.domain.DdFs; import com.zhyc.module.frozen.domain.DdFs;
@@ -58,6 +59,7 @@ public class DdSaleServiceImpl implements IDdSaleService {
* @return 销售主单 * @return 销售主单
*/ */
@Override @Override
@DataScope(deptAlias = "dd_sl_alias" , userAlias = "dd_sl_alias")
public List<DdSale> selectDdSaleList(DdSale ddSale) { public List<DdSale> selectDdSaleList(DdSale ddSale) {
return ddSaleMapper.selectDdSaleList(ddSale); return ddSaleMapper.selectDdSaleList(ddSale);
} }

View File

@@ -29,7 +29,7 @@ public class ScBodyMeasure extends BaseEntity {
* $column.columnComment * $column.columnComment
*/ */
private Long id; private Long id;
private Long[] ids;
/** /**
* 耳号 * 耳号
*/ */

View File

@@ -26,7 +26,7 @@ public class ScBodyScore extends BaseEntity {
* $column.columnComment * $column.columnComment
*/ */
private Long id; private Long id;
private Long[] ids;
/** /**
* 羊只id * 羊只id
*/ */

View File

@@ -26,7 +26,7 @@ public class ScBreastRating extends BaseEntity {
* $column.columnComment * $column.columnComment
*/ */
private Long id; private Long id;
private Long[] ids;
/** /**
* 羊只id * 羊只id
*/ */

View File

@@ -47,6 +47,7 @@ public class ScBreedPlanController extends BaseController
return getDataTable(list); return getDataTable(list);
} }
/** /**
* 导出配种计划列表 * 导出配种计划列表
*/ */
@@ -79,6 +80,8 @@ public class ScBreedPlanController extends BaseController
@PostMapping @PostMapping
public AjaxResult add(@RequestBody ScBreedPlan scBreedPlan) public AjaxResult add(@RequestBody ScBreedPlan scBreedPlan)
{ {
scBreedPlan.setDeptId(getDeptId());
scBreedPlan.setUserId(getUserId());
return toAjax(scBreedPlanService.insertScBreedPlan(scBreedPlan)); return toAjax(scBreedPlanService.insertScBreedPlan(scBreedPlan));
} }

View File

@@ -5,11 +5,13 @@ import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.zhyc.module.base.domain.SheepFile;
import com.zhyc.module.produce.breed.domain.ScBreedPlanGenerate; import com.zhyc.module.produce.breed.domain.ScBreedPlanGenerate;
import com.zhyc.module.produce.breed.service.IScBreedPlanGenerateService; import com.zhyc.module.produce.breed.service.IScBreedPlanGenerateService;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.zhyc.common.annotation.Log; import com.zhyc.common.annotation.Log;
import com.zhyc.common.core.controller.BaseController; import com.zhyc.common.core.controller.BaseController;
import com.zhyc.common.core.domain.AjaxResult; import com.zhyc.common.core.domain.AjaxResult;
@@ -49,7 +51,7 @@ public class ScBreedPlanGenerateController extends BaseController
@GetMapping("/selectEwe") @GetMapping("/selectEwe")
public AjaxResult selectEligibleEwe(@RequestParam(value = "manageTags", required = false) String manageTags) public AjaxResult selectEligibleEwe(@RequestParam(value = "manageTags", required = false) String manageTags)
{ {
List<Map<String, Object>> eligibleEwe = scBreedPlanGenerateService.selectEligibleEwe(manageTags); List<Map<String, Object>> eligibleEwe = scBreedPlanGenerateService.selectEligibleEwe(new SheepFile(),manageTags);
return success(eligibleEwe); return success(eligibleEwe);
} }
@@ -60,12 +62,100 @@ public class ScBreedPlanGenerateController extends BaseController
@GetMapping("/selectRam") @GetMapping("/selectRam")
public AjaxResult selectEligibleRam(@RequestParam(value = "manageTags", required = false) String manageTags) public AjaxResult selectEligibleRam(@RequestParam(value = "manageTags", required = false) String manageTags)
{ {
List<Map<String, Object>> eligibleRam = scBreedPlanGenerateService.selectEligibleRam(manageTags); List<Map<String, Object>> eligibleRam = scBreedPlanGenerateService.selectEligibleRam(new SheepFile(),manageTags);
return success(eligibleRam); return success(eligibleRam);
} }
/** /**
* 自动生成配种计划 * 导出已选母羊公羊配对表(供用户下载后手动填写/确认配对)
*/
@PreAuthorize("@ss.hasPermi('mating_plan:generate:export')")
@Log(title = "导出配对模板", businessType = BusinessType.EXPORT)
@PostMapping("/exportPairs")
public void exportSelectedPairs(HttpServletResponse response, @RequestBody Map<String, Object> params)
{
try {
List<?> eweIdsRaw = (List<?>) params.get("eweIds");
List<?> ramIdsRaw = (List<?>) params.get("ramIds");
if (eweIdsRaw == null || ramIdsRaw == null) {
response.setContentType("application/json;charset=utf-8");
response.getWriter().write("{\"code\":500,\"msg\":\"参数不能为空\"}");
return;
}
List<Long> eweIds = eweIdsRaw.stream()
.map(obj -> obj instanceof Integer ? ((Integer) obj).longValue()
: obj instanceof Long ? (Long) obj : Long.valueOf(obj.toString()))
.collect(Collectors.toList());
List<Long> ramIds = ramIdsRaw.stream()
.map(obj -> obj instanceof Integer ? ((Integer) obj).longValue()
: obj instanceof Long ? (Long) obj : Long.valueOf(obj.toString()))
.collect(Collectors.toList());
// eweIds 和 ramIds 均为空时,直接导出只含表头的空白模板,不查数据库(避免 IN () 语法错误)
if (eweIds.isEmpty() && ramIds.isEmpty()) {
scBreedPlanGenerateService.exportEmptyPairTemplate(response);
return;
}
scBreedPlanGenerateService.exportSelectedPairs(response, eweIds, ramIds);
} catch (Exception e) {
logger.error("导出配对表失败", e);
try {
response.setContentType("application/json;charset=utf-8");
response.getWriter().write("{\"code\":500,\"msg\":\"导出失败:" + e.getMessage() + "\"}");
} catch (Exception ex) {
logger.error("返回错误信息失败", ex);
}
}
}
/**
* 解析导入的配对Excel返回配对预览数据不生成计划
*/
@PreAuthorize("@ss.hasPermi('mating_plan:generate:add')")
@PostMapping("/parsePairs")
public AjaxResult parsePairsFromExcel(@RequestParam("file") MultipartFile file)
{
try {
List<Map<String, Object>> pairs = scBreedPlanGenerateService.parsePairsFromExcel(file);
return success(pairs);
} catch (Exception e) {
logger.error("解析配对Excel失败", e);
return error("解析失败:" + e.getMessage());
}
}
/**
* 根据导入的配对数据生成配种计划
*/
@PreAuthorize("@ss.hasPermi('mating_plan:generate:auto')")
@PostMapping("/generateFromPairs")
@Log(title = "导入生成配种计划", businessType = BusinessType.INSERT)
public AjaxResult generateBreedPlanFromPairs(@RequestBody Map<String, Object> params)
{
try {
Integer planType = params.get("planType") != null ? (Integer) params.get("planType") : 1;
@SuppressWarnings("unchecked")
List<Map<String, Object>> pairs = (List<Map<String, Object>>) params.get("pairs");
if (pairs == null || pairs.isEmpty()) {
return error("配对数据不能为空");
}
ScBreedPlanGenerate planGenerate = scBreedPlanGenerateService.autoGenerateBreedPlanFromPairs(planType, pairs);
return success(planGenerate);
} catch (Exception e) {
logger.error("导入生成配种计划失败", e);
return error("生成失败:" + e.getMessage());
}
}
/**
* 自动生成配种计划(原有逻辑保留,按比例自动分配)
*/ */
@PreAuthorize("@ss.hasPermi('mating_plan:generate:auto')") @PreAuthorize("@ss.hasPermi('mating_plan:generate:auto')")
@PostMapping("/auto") @PostMapping("/auto")
@@ -73,13 +163,9 @@ public class ScBreedPlanGenerateController extends BaseController
public AjaxResult autoGenerateBreedPlan(@RequestBody Map<String, Object> params) public AjaxResult autoGenerateBreedPlan(@RequestBody Map<String, Object> params)
{ {
try { try {
// 获取计划类型
Integer planType = params.get("planType") != null ? (Integer) params.get("planType") : 1; Integer planType = params.get("planType") != null ? (Integer) params.get("planType") : 1;
// 计划名称由系统自动生成,不再从前端传入
String planName = null; String planName = null;
// 安全的类型转换
List<?> eweIdsRaw = (List<?>) params.get("eweIds"); List<?> eweIdsRaw = (List<?>) params.get("eweIds");
List<?> ramIdsRaw = (List<?>) params.get("ramIds"); List<?> ramIdsRaw = (List<?>) params.get("ramIds");
@@ -88,27 +174,13 @@ public class ScBreedPlanGenerateController extends BaseController
} }
List<Long> eweIds = eweIdsRaw.stream() List<Long> eweIds = eweIdsRaw.stream()
.map(obj -> { .map(obj -> obj instanceof Integer ? ((Integer) obj).longValue()
if (obj instanceof Integer) { : obj instanceof Long ? (Long) obj : Long.valueOf(obj.toString()))
return ((Integer) obj).longValue();
} else if (obj instanceof Long) {
return (Long) obj;
} else {
return Long.valueOf(obj.toString());
}
})
.collect(Collectors.toList()); .collect(Collectors.toList());
List<Long> ramIds = ramIdsRaw.stream() List<Long> ramIds = ramIdsRaw.stream()
.map(obj -> { .map(obj -> obj instanceof Integer ? ((Integer) obj).longValue()
if (obj instanceof Integer) { : obj instanceof Long ? (Long) obj : Long.valueOf(obj.toString()))
return ((Integer) obj).longValue();
} else if (obj instanceof Long) {
return (Long) obj;
} else {
return Long.valueOf(obj.toString());
}
})
.collect(Collectors.toList()); .collect(Collectors.toList());
ScBreedPlanGenerate planGenerate = scBreedPlanGenerateService.autoGenerateBreedPlan(planType, planName, eweIds, ramIds); ScBreedPlanGenerate planGenerate = scBreedPlanGenerateService.autoGenerateBreedPlan(planType, planName, eweIds, ramIds);
@@ -137,6 +209,8 @@ public class ScBreedPlanGenerateController extends BaseController
@PostMapping @PostMapping
public AjaxResult add(@RequestBody ScBreedPlanGenerate scBreedPlanGenerate) public AjaxResult add(@RequestBody ScBreedPlanGenerate scBreedPlanGenerate)
{ {
scBreedPlanGenerate.setDeptId(getDeptId());
scBreedPlanGenerate.setUserId(getUserId());
return toAjax(scBreedPlanGenerateService.insertScBreedPlanGenerate(scBreedPlanGenerate)); return toAjax(scBreedPlanGenerateService.insertScBreedPlanGenerate(scBreedPlanGenerate));
} }
@@ -222,7 +296,6 @@ public class ScBreedPlanGenerateController extends BaseController
scBreedPlanGenerateService.exportBreedPlanDetails(response, id); scBreedPlanGenerateService.exportBreedPlanDetails(response, id);
} catch (Exception e) { } catch (Exception e) {
logger.error("导出配种计划详情失败", e); logger.error("导出配种计划详情失败", e);
// 在出错时返回错误信息给前端
try { try {
response.setContentType("application/json;charset=utf-8"); response.setContentType("application/json;charset=utf-8");
response.getWriter().write("{\"code\":500,\"msg\":\"导出失败:" + e.getMessage() + "\"}"); response.getWriter().write("{\"code\":500,\"msg\":\"导出失败:" + e.getMessage() + "\"}");
@@ -246,7 +319,7 @@ public class ScBreedPlanGenerateController extends BaseController
/** /**
* 模糊查询母羊耳号列表 * 模糊查询母羊耳号列表
*/ */
@PreAuthorize("@ss.hasPermi('mating_plan:generate:query')") // 根据实际权限修改 @PreAuthorize("@ss.hasPermi('mating_plan:generate:query')")
@GetMapping("/search_ear_numbers") @GetMapping("/search_ear_numbers")
public AjaxResult searchEarNumbers(@RequestParam("query") String query) { public AjaxResult searchEarNumbers(@RequestParam("query") String query) {
try { try {

View File

@@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.zhyc.common.annotation.Log; import com.zhyc.common.annotation.Log;
import com.zhyc.common.core.controller.BaseController; import com.zhyc.common.core.controller.BaseController;
@@ -120,6 +121,8 @@ public class ScBreedRecordController extends BaseController
@PostMapping @PostMapping
public AjaxResult add(@RequestBody ScBreedRecord scBreedRecord) public AjaxResult add(@RequestBody ScBreedRecord scBreedRecord)
{ {
scBreedRecord.setDeptId(getDeptId());
scBreedRecord.setUserId(getUserId());
// 处理母羊耳号转换 // 处理母羊耳号转换
if (scBreedRecord.getEweManageTags() != null && !scBreedRecord.getEweManageTags().isEmpty()) { if (scBreedRecord.getEweManageTags() != null && !scBreedRecord.getEweManageTags().isEmpty()) {
Long eweId = scBreedRecordService.getSheepIdByTags(scBreedRecord.getEweManageTags()); Long eweId = scBreedRecordService.getSheepIdByTags(scBreedRecord.getEweManageTags());
@@ -152,9 +155,10 @@ public class ScBreedRecordController extends BaseController
return error("技术员不能为空"); return error("技术员不能为空");
} }
// 修改后
int result = scBreedRecordService.insertScBreedRecord(scBreedRecord); int result = scBreedRecordService.insertScBreedRecord(scBreedRecord);
if (result > 0) { if (result > 0) {
return success("配种记录新增成功"); return success(scBreedRecord.getId()); // 返回自增主键ID
} }
return error("配种记录新增失败"); return error("配种记录新增失败");
} }
@@ -228,10 +232,52 @@ public class ScBreedRecordController extends BaseController
} }
/** /**
* 根据羊只ID和时间范围查询配种记录 * 批量标记胚胎已移植,并同步更新冲胚记录的 transferred / recipient_cnt
*/
@PreAuthorize("@ss.hasPermi('Breeding_records:Breeding_records:edit')")
@Log(title = "批量标记胚胎移植", businessType = BusinessType.UPDATE)
@PostMapping("/markBatchEmbryoTransferred")
public AjaxResult markBatchEmbryoTransferred(@RequestBody Map<String, Object> params)
{
@SuppressWarnings("unchecked")
List<Integer> idList = (List<Integer>) params.get("ids");
Long breedRecordId = Long.valueOf(params.get("breedRecordId").toString());
if (idList == null || idList.isEmpty()) {
return error("胚胎ID列表不能为空");
}
Long[] ids = idList.stream().map(Long::valueOf).toArray(Long[]::new);
int result = scBreedRecordService.markBatchEmbryoTransferred(ids, breedRecordId);
if (result > 0) {
return success("批量标记移植成功,共更新 " + result + "");
}
return error("批量标记失败");
}
/**
* 搜索耳号(模糊查询,用于前端 autocomplete
*/ */
@PreAuthorize("@ss.hasPermi('Breeding_records:Breeding_records:query')") @PreAuthorize("@ss.hasPermi('Breeding_records:Breeding_records:query')")
@GetMapping("/getByTimeRange/{sheepId}/{startDate}/{endDate}") @GetMapping("/searchEarNumbers")
public AjaxResult searchEarNumbers(@RequestParam("query") String query,
@RequestParam(value = "gender", required = false) String gender)
{
List<Map<String, Object>> result = scBreedRecordService.searchEarNumbers(query, gender);
return success(result);
}
/**
* 根据配种记录ID查询已移植的胚胎明细查看胚胎弹窗使用
*/
@PreAuthorize("@ss.hasPermi('Breeding_records:Breeding_records:query')")
@GetMapping("/embryosByBreedRecord/{breedRecordId}")
public AjaxResult getEmbryosByBreedRecord(@PathVariable("breedRecordId") Long breedRecordId)
{
List<Map<String, Object>> list = scBreedRecordService.getEmbryosByBreedRecord(breedRecordId);
return success(list);
}
@PreAuthorize("@ss.hasPermi('Breeding_records:Breeding_records:query')")
public AjaxResult getBreedRecordsByTimeRange(@PathVariable("sheepId") Long sheepId, public AjaxResult getBreedRecordsByTimeRange(@PathVariable("sheepId") Long sheepId,
@PathVariable("startDate") String startDate, @PathVariable("startDate") String startDate,
@PathVariable("endDate") String endDate) @PathVariable("endDate") String endDate)

View File

@@ -79,14 +79,20 @@ public class ScDryMilkController extends BaseController
/** /**
* 远程搜索耳号列表 * 远程搜索耳号列表
*/ */
/**
* 模糊查询母羊耳号列表
*/
@PreAuthorize("@ss.hasPermi('drymilk:drymilk:query')") // 根据实际权限修改
@GetMapping("/searchEarNumbers") @GetMapping("/searchEarNumbers")
public AjaxResult searchEarNumbers(@RequestParam(value = "query", required = false) String query) public AjaxResult searchEarNumbers(@RequestParam("query") String query) {
{ try {
if (query == null) query = ""; List<String> earNumbers = scDryMilkService.searchEarNumbers(query);
List<String> list = scDryMilkService.selectSheepEarNumberList(query); return success(earNumbers);
return AjaxResult.success(list); } catch (Exception e) {
logger.error("搜索耳号异常", e);
return error("搜索耳号失败:" + e.getMessage());
}
} }
/** /**
* 远程搜索技术员列表 * 远程搜索技术员列表
*/ */
@@ -153,6 +159,8 @@ public class ScDryMilkController extends BaseController
@PostMapping @PostMapping
public AjaxResult add(@RequestBody ScDryMilk scDryMilk) public AjaxResult add(@RequestBody ScDryMilk scDryMilk)
{ {
scDryMilk.setDeptId(getDeptId());
scDryMilk.setUserId(getUserId());
try { try {
if (scDryMilk == null || scDryMilk.getManageTags() == null) { if (scDryMilk == null || scDryMilk.getManageTags() == null) {
return error("耳号不能为空"); return error("耳号不能为空");

View File

@@ -0,0 +1,92 @@
package com.zhyc.module.produce.breed.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
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;
import com.zhyc.common.enums.BusinessType;
import com.zhyc.module.produce.breed.domain.ScEmbryoDetail;
import com.zhyc.module.produce.breed.service.IScEmbryoDetailService;
/**
* 胚胎明细记录 Controller
*
* @author ruoyi
* @date 2025-11-28
*/
@RestController
@RequestMapping("/embryo/detail")
public class ScEmbryoDetailController extends BaseController {
@Autowired
private IScEmbryoDetailService scEmbryoDetailService;
/**
* 根据冲胚记录ID查询胚胎明细列表含关联冲胚父记录字段
* 供冲胚记录编辑/查看时回显用
*/
@PreAuthorize("@ss.hasPermi('embryo:flush:query')")
@GetMapping("/byFlush/{flushId}")
public AjaxResult listByFlushId(@PathVariable("flushId") Long flushId) {
return success(scEmbryoDetailService.selectByFlushId(flushId));
}
/**
* 查询可供移植的胚胎明细
* 供配种记录-胚胎移植 弹窗选择使用
* @param flushId 可选,指定某条冲胚记录;不传则返回所有可移植胚胎
*/
@PreAuthorize("@ss.hasPermi('embryo:flush:query')")
@GetMapping("/available")
public AjaxResult listAvailable(@RequestParam(value = "flushId", required = false) Long flushId) {
return success(scEmbryoDetailService.selectAvailableForTransfer(flushId));
}
/**
* 获取单条胚胎明细
*/
@PreAuthorize("@ss.hasPermi('embryo:flush:query')")
@GetMapping("/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(scEmbryoDetailService.selectScEmbryoDetailById(id));
}
/**
* 修改单条胚胎明细(如修改去向、存储方式)
*/
@PreAuthorize("@ss.hasPermi('embryo:flush:edit')")
@Log(title = "胚胎明细", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ScEmbryoDetail scEmbryoDetail) {
return toAjax(scEmbryoDetailService.updateScEmbryoDetail(scEmbryoDetail));
}
/**
* 将某枚胚胎标记为已移植并关联配种记录ID
* 在配种记录新增-胚胎移植 提交成功后调用
*/
@PreAuthorize("@ss.hasPermi('Breeding_records:Breeding_records:edit')")
@Log(title = "胚胎移植标记", businessType = BusinessType.UPDATE)
@PostMapping("/markTransferred")
public AjaxResult markTransferred(@RequestParam("id") Long id,
@RequestParam("breedRecordId") Long breedRecordId) {
int result = scEmbryoDetailService.markAsTransferred(id, breedRecordId);
if (result > 0) {
return success("移植标记成功");
}
return error("移植标记失败");
}
/**
* 删除胚胎明细
*/
@PreAuthorize("@ss.hasPermi('embryo:flush:remove')")
@Log(title = "胚胎明细", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(scEmbryoDetailService.deleteScEmbryoDetailByIds(ids));
}
}

View File

@@ -3,6 +3,8 @@ package com.zhyc.module.produce.breed.controller;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.zhyc.module.produce.breed.service.impl.ScEmbryoFlushServiceImpl;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@@ -48,6 +50,7 @@ public class ScEmbryoFlushController extends BaseController
return getDataTable(list); return getDataTable(list);
} }
/** /**
* 导出冲胚记录列表 * 导出冲胚记录列表
*/ */
@@ -79,6 +82,8 @@ public class ScEmbryoFlushController extends BaseController
@PostMapping @PostMapping
public AjaxResult add(@RequestBody ScEmbryoFlush scEmbryoFlush) public AjaxResult add(@RequestBody ScEmbryoFlush scEmbryoFlush)
{ {
scEmbryoFlush.setDeptId(getDeptId());
scEmbryoFlush.setUserId(getUserId());
return toAjax(scEmbryoFlushService.insertScEmbryoFlush(scEmbryoFlush)); return toAjax(scEmbryoFlushService.insertScEmbryoFlush(scEmbryoFlush));
} }
@@ -126,4 +131,36 @@ public class ScEmbryoFlushController extends BaseController
List<Map<String, Object>> list = scEmbryoFlushService.selectDonorFemaleList(); List<Map<String, Object>> list = scEmbryoFlushService.selectDonorFemaleList();
return success(list); return success(list);
} }
/**
* 获取供体公羊下拉列表
*/
@PreAuthorize("@ss.hasPermi('embryo:flush:query')")
@GetMapping("/donorMaleList")
public AjaxResult getDonorMaleList()
{
List<Map<String, Object>> list = scEmbryoFlushService.selectDonorMaleList();
return success(list);
}
/**
* 根据耳号获取羊只基础信息
*/
@PreAuthorize("@ss.hasPermi('embryo:flush:query')")
@GetMapping("/getSheepInfo")
public AjaxResult getSheepInfo(@RequestParam("manageTag") String manageTag) {
return success(scEmbryoFlushService.getSheepInfoByTag(manageTag));
}
/**
* 根据父母品种实时计算胚胎品种
*/
@PreAuthorize("@ss.hasPermi('embryo:flush:query')")
@GetMapping("/calculateVariety")
public AjaxResult calculateVariety(String maleVariety, String femaleVariety) {
// ✅ 通过注入的 service 调用
String result = scEmbryoFlushService.calculateEmbryoVarietyByName(maleVariety, femaleVariety);
return success(result);
}
} }

View File

@@ -1,8 +1,14 @@
package com.zhyc.module.produce.breed.controller; package com.zhyc.module.produce.breed.controller;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@@ -13,7 +19,6 @@ import com.zhyc.common.enums.BusinessType;
import com.zhyc.module.produce.breed.domain.ScLambingRecord; import com.zhyc.module.produce.breed.domain.ScLambingRecord;
import com.zhyc.module.produce.breed.domain.ScLambDetail; import com.zhyc.module.produce.breed.domain.ScLambDetail;
import com.zhyc.module.produce.breed.service.IScLambingRecordService; import com.zhyc.module.produce.breed.service.IScLambingRecordService;
import com.zhyc.common.utils.poi.ExcelUtil;
import com.zhyc.common.core.page.TableDataInfo; import com.zhyc.common.core.page.TableDataInfo;
/** /**
@@ -55,6 +60,7 @@ public class ScLambingRecordController extends BaseController {
return error("查询配种信息失败:" + e.getMessage()); return error("查询配种信息失败:" + e.getMessage());
} }
} }
@PreAuthorize("@ss.hasPermi('breed:lambing_records:query')") @PreAuthorize("@ss.hasPermi('breed:lambing_records:query')")
@GetMapping("/search_ear_numbers") @GetMapping("/search_ear_numbers")
public AjaxResult searchEarNumbers(@RequestParam("query") String query) { public AjaxResult searchEarNumbers(@RequestParam("query") String query) {
@@ -66,25 +72,273 @@ public class ScLambingRecordController extends BaseController {
return error("搜索耳号失败:" + e.getMessage()); return error("搜索耳号失败:" + e.getMessage());
} }
} }
/** /**
* 导出产羔记录列表 * 导出产羔记录列表多SheetSheet1=产羔记录Sheet2=羔羊详情)
*/ */
@PreAuthorize("@ss.hasPermi('breed:lambing_records:export')") @PreAuthorize("@ss.hasPermi('breed:lambing_records:export')")
@Log(title = "产羔记录", businessType = BusinessType.EXPORT) @Log(title = "产羔记录", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, ScLambingRecord scLambingRecord) { public void export(HttpServletResponse response, ScLambingRecord scLambingRecord) throws IOException {
// 不分页,查全量
List<ScLambingRecord> list = scLambingRecordService.selectScLambingRecordList(scLambingRecord); List<ScLambingRecord> list = scLambingRecordService.selectScLambingRecordList(scLambingRecord);
ExcelUtil<ScLambingRecord> util = new ExcelUtil<ScLambingRecord>(ScLambingRecord.class);
util.exportExcel(response, list, "产羔记录数据"); // 为每条记录补充羔羊详情
for (ScLambingRecord record : list) {
List<ScLambDetail> details = scLambingRecordService.selectLambDetailByLambingRecordId(record.getId());
record.setLambDetails(details);
}
// 构建多Sheet工作簿
XSSFWorkbook workbook = buildExportWorkbook(list);
// 写出响应
String filename = java.net.URLEncoder.encode("产羔记录_" + new java.text.SimpleDateFormat("yyyyMMddHHmmss").format(new java.util.Date()), "UTF-8");
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setCharacterEncoding("utf-8");
response.setHeader("Content-Disposition", "attachment;filename=" + filename + ".xlsx");
workbook.write(response.getOutputStream());
workbook.close();
} }
/** /**
* 获取产羔记录详细信息(修改:改为获取包含关联信息的详细数据 * 构建导出工作簿两个Sheet
*/
private XSSFWorkbook buildExportWorkbook(List<ScLambingRecord> list) {
XSSFWorkbook workbook = new XSSFWorkbook();
SimpleDateFormat dateFmt = new SimpleDateFormat("yyyy-MM-dd");
// ==================== Sheet1产羔记录 ====================
Sheet sheet1 = workbook.createSheet("产羔记录");
// 标题样式
CellStyle headerStyle = createHeaderStyle(workbook);
// 普通单元格样式
CellStyle dataStyle = createDataStyle(workbook);
// 品种名称映射表
Map<Integer, String> varietyMap = new java.util.HashMap<>();
varietyMap.put(1, "湖羊"); varietyMap.put(2, "东佛里生"); varietyMap.put(3, "回交");
varietyMap.put(4, "级杂一代"); varietyMap.put(5, "级杂二代"); varietyMap.put(6, "级杂三代");
varietyMap.put(7, "一世代"); varietyMap.put(8, "二世代"); varietyMap.put(9, "三世代");
varietyMap.put(10, "四世代");
// 产羔记录表头(与界面完全一致)
String[] headers1 = {
"母羊耳号", "母羊品种", "事件类型", "产羔日期", "配种类型", "配种日期", "胎次", "公羊耳号", "公羊品种",
"供体母羊", "供体母羊品种", "供体公羊", "供体公羊品种",
"产羔数量", "活羔数量", "折损数",
"羔羊品种",
"羔羊耳号1", "羔羊1出生重", "羔羊耳号2", "羔羊2出生重",
"羔羊耳号3", "羔羊3出生重", "羔羊耳号4", "羔羊4出生重",
"羔羊耳号5", "羔羊5出生重", "羔羊耳号6", "羔羊6出生重",
"羔羊耳号7", "羔羊7出生重", "羔羊耳号8", "羔羊8出生重",
"技术员", "月龄", "产羔评分",
"公羔数量", "母羔数量", "留养公羔数量", "留养母羔数量",
"未留养公羔数量", "未留养母羔数量", "产羔时怀孕天数",
"当前羊舍", "创建人", "所在牧场", "备注"
};
// 列宽(字符数 * 256
int[] colWidths1 = {
14, 12, 10, 13, 18, 13, 8, 14, 12,
14, 12, 14, 12,
10, 10, 8,
12,
14, 12, 14, 12, 14, 12, 14, 12,
14, 12, 14, 12, 14, 12, 14, 12,
10, 8, 10,
10, 10, 14, 14,
16, 16, 16,
12, 10, 12, 20
};
Row headerRow1 = sheet1.createRow(0);
headerRow1.setHeightInPoints(22);
for (int i = 0; i < headers1.length; i++) {
sheet1.setColumnWidth(i, colWidths1[i] * 256);
Cell cell = headerRow1.createCell(i);
cell.setCellValue(headers1[i]);
cell.setCellStyle(headerStyle);
}
// 产羔记录数据行
int rowNum1 = 1;
for (ScLambingRecord r : list) {
Row row = sheet1.createRow(rowNum1++);
row.setHeightInPoints(18);
int col = 0;
setCellValue(row, col++, r.getFemaleEarNumber(), dataStyle);
setCellValue(row, col++, r.getFemaleBreed(), dataStyle);
setCellValue(row, col++, "产羔", dataStyle);
setCellValue(row, col++, r.getCreateTime() != null ? dateFmt.format(r.getCreateTime()) : "", dataStyle);
setCellValue(row, col++, getBreedTypeLabel(r.getBreedType()), dataStyle);
setCellValue(row, col++, r.getBreedingDate() != null ? dateFmt.format(r.getBreedingDate()) : "", dataStyle);
setCellValue(row, col++, r.getParity(), dataStyle);
setCellValue(row, col++, r.getMaleEarNumber(), dataStyle);
setCellValue(row, col++, r.getMaleBreed(), dataStyle);
// 供体信息(非胚胎移植时为空)
setCellValue(row, col++, r.getDonorEwe(), dataStyle);
setCellValue(row, col++, r.getDonorEweBreed(), dataStyle);
setCellValue(row, col++, r.getDonorRam(), dataStyle);
setCellValue(row, col++, r.getDonorRamBreed(), dataStyle);
setCellValue(row, col++, r.getLambsBorn(), dataStyle);
setCellValue(row, col++, r.getSurvival(), dataStyle);
// 折损数 = 产羔数 - 活羔数
int loss = (int) ((r.getLambsBorn() != null ? r.getLambsBorn() : 0)
- (r.getSurvival() != null ? r.getSurvival() : 0));
setCellValue(row, col++, loss, dataStyle);
// 羔羊品种(取第一只羔羊品种名)
String lambBreedName = "";
if (r.getLambDetails() != null && !r.getLambDetails().isEmpty() && r.getLambDetails().get(0).getLambBreed() != null) {
lambBreedName = varietyMap.getOrDefault(r.getLambDetails().get(0).getLambBreed(), "");
}
setCellValue(row, col++, lambBreedName, dataStyle);
// 羔羊耳号1-8 及出生重
for (int i = 0; i < 8; i++) {
if (r.getLambDetails() != null && i < r.getLambDetails().size()) {
ScLambDetail d = r.getLambDetails().get(i);
setCellValue(row, col++, d.getLambEarNumber(), dataStyle);
setCellValue(row, col++, d.getBirthWeight() != null ? d.getBirthWeight().toPlainString() : "", dataStyle);
} else {
setCellValue(row, col++, "", dataStyle);
setCellValue(row, col++, "", dataStyle);
}
}
setCellValue(row, col++, r.getTechnician(), dataStyle);
setCellValue(row, col++, r.getMonthAge(), dataStyle);
setCellValue(row, col++, r.getScore(), dataStyle);
setCellValue(row, col++, r.getMaleCount(), dataStyle);
setCellValue(row, col++, r.getFemaleCount(), dataStyle);
setCellValue(row, col++, r.getRetainedMaleCount(), dataStyle);
setCellValue(row, col++, r.getRetainedFemaleCount(), dataStyle);
setCellValue(row, col++, r.getUnretainedMaleCount(), dataStyle);
setCellValue(row, col++, r.getUnretainedFemaleCount(), dataStyle);
setCellValue(row, col++, r.getPregnancyDays(), dataStyle);
setCellValue(row, col++, r.getCurrentShed(), dataStyle);
setCellValue(row, col++, r.getCreateBy(), dataStyle);
setCellValue(row, col++, r.getFarm(), dataStyle);
setCellValue(row, col++, r.getComment(), dataStyle);
}
// ==================== Sheet2羔羊详情 ====================
Sheet sheet2 = workbook.createSheet("羔羊详情");
String[] headers2 = {
"母羊耳号", "胎次", "羔羊耳号", "性别", "出生体重(kg)",
"是否留养", "家系", "出生日期"
};
int[] colWidths2 = { 14, 8, 14, 8, 14, 10, 16, 13 };
Row headerRow2 = sheet2.createRow(0);
headerRow2.setHeightInPoints(22);
for (int i = 0; i < headers2.length; i++) {
sheet2.setColumnWidth(i, colWidths2[i] * 256);
Cell cell = headerRow2.createCell(i);
cell.setCellValue(headers2[i]);
cell.setCellStyle(headerStyle);
}
int rowNum2 = 1;
for (ScLambingRecord r : list) {
if (r.getLambDetails() == null || r.getLambDetails().isEmpty()) {
continue;
}
for (ScLambDetail d : r.getLambDetails()) {
Row row = sheet2.createRow(rowNum2++);
row.setHeightInPoints(18);
int col = 0;
setCellValue(row, col++, r.getFemaleEarNumber(), dataStyle);
setCellValue(row, col++, r.getParity(), dataStyle);
setCellValue(row, col++, d.getLambEarNumber(), dataStyle);
// 性别1=公0=母2=阉羊3=兼性(参照后端校验逻辑)
String genderLabel = "";
if (d.getGender() != null) {
switch (d.getGender()) {
case 0: genderLabel = ""; break;
case 1: genderLabel = ""; break;
case 2: genderLabel = "阉羊"; break;
case 3: genderLabel = "兼性"; break;
default: genderLabel = String.valueOf(d.getGender());
}
}
setCellValue(row, col++, genderLabel, dataStyle);
setCellValue(row, col++, d.getBirthWeight() != null ? d.getBirthWeight().toPlainString() : "", dataStyle);
setCellValue(row, col++, Boolean.TRUE.equals(d.getIsRetained()) ? "" : "", dataStyle);
setCellValue(row, col++, d.getLineage(), dataStyle);
setCellValue(row, col++, d.getBirthday() != null ? dateFmt.format(d.getBirthday()) : "", dataStyle);
}
}
return workbook;
}
/** 配种类型编码转文字 */
private String getBreedTypeLabel(String breedType) {
if (breedType == null || breedType.trim().isEmpty()) return "";
switch (breedType.trim()) {
case "1": return "供体母羊配种";
case "2": return "同期发情人工授精";
case "3": return "本交";
case "4": return "自然发情人工授精";
case "5": return "胚胎移植";
default: return breedType;
}
}
/** 创建表头样式 */
private CellStyle createHeaderStyle(XSSFWorkbook workbook) {
CellStyle style = workbook.createCellStyle();
Font font = workbook.createFont();
font.setBold(true);
font.setFontHeightInPoints((short) 11);
style.setFont(font);
style.setFillForegroundColor(IndexedColors.LIGHT_CORNFLOWER_BLUE.getIndex());
style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
style.setAlignment(HorizontalAlignment.CENTER);
style.setVerticalAlignment(VerticalAlignment.CENTER);
style.setBorderBottom(BorderStyle.THIN);
style.setBorderTop(BorderStyle.THIN);
style.setBorderLeft(BorderStyle.THIN);
style.setBorderRight(BorderStyle.THIN);
return style;
}
/** 创建数据行样式 */
private CellStyle createDataStyle(XSSFWorkbook workbook) {
CellStyle style = workbook.createCellStyle();
style.setAlignment(HorizontalAlignment.CENTER);
style.setVerticalAlignment(VerticalAlignment.CENTER);
style.setBorderBottom(BorderStyle.THIN);
style.setBorderTop(BorderStyle.THIN);
style.setBorderLeft(BorderStyle.THIN);
style.setBorderRight(BorderStyle.THIN);
return style;
}
/** 统一设置单元格值 */
private void setCellValue(Row row, int col, Object value, CellStyle style) {
Cell cell = row.createCell(col);
if (value == null) {
cell.setCellValue("");
} else if (value instanceof Integer) {
cell.setCellValue((Integer) value);
} else if (value instanceof Long) {
cell.setCellValue((Long) value);
} else if (value instanceof Double) {
cell.setCellValue((Double) value);
} else {
cell.setCellValue(value.toString());
}
cell.setCellStyle(style);
}
/**
* 获取产羔记录详细信息
*/ */
@PreAuthorize("@ss.hasPermi('breed:lambing_records:query')") @PreAuthorize("@ss.hasPermi('breed:lambing_records:query')")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) { public AjaxResult getInfo(@PathVariable("id") Long id) {
// 修改:改为调用详细查询方法,获取包含母羊耳号、公羊耳号等关联信息
return success(scLambingRecordService.selectScLambingRecordDetailById(id)); return success(scLambingRecordService.selectScLambingRecordDetailById(id));
} }
@@ -96,16 +350,11 @@ public class ScLambingRecordController extends BaseController {
@PostMapping @PostMapping
public AjaxResult add(@RequestBody ScLambingRecord scLambingRecord) { public AjaxResult add(@RequestBody ScLambingRecord scLambingRecord) {
try { try {
// 设置创建人
scLambingRecord.setCreateBy(getUsername()); scLambingRecord.setCreateBy(getUsername());
// 如果没有设置创建时间,使用当前时间
if (scLambingRecord.getCreateTime() == null) { if (scLambingRecord.getCreateTime() == null) {
scLambingRecord.setCreateTime(new java.util.Date()); scLambingRecord.setCreateTime(new java.util.Date());
} }
int result = scLambingRecordService.insertScLambingRecord(scLambingRecord); int result = scLambingRecordService.insertScLambingRecord(scLambingRecord);
if (result > 0) { if (result > 0) {
String message = "新增产羔记录成功"; String message = "新增产羔记录成功";
if (scLambingRecord.getLambDetails() != null && !scLambingRecord.getLambDetails().isEmpty()) { if (scLambingRecord.getLambDetails() != null && !scLambingRecord.getLambDetails().isEmpty()) {

View File

@@ -100,6 +100,8 @@ public class ScMiscarriageRecordController extends BaseController
@PostMapping @PostMapping
public AjaxResult add(@RequestBody ScMiscarriageRecord scMiscarriageRecord) public AjaxResult add(@RequestBody ScMiscarriageRecord scMiscarriageRecord)
{ {
scMiscarriageRecord.setDeptId(getDeptId());
scMiscarriageRecord.setUserId(getUserId());
return toAjax(scMiscarriageRecordService.insertScMiscarriageRecord(scMiscarriageRecord)); return toAjax(scMiscarriageRecordService.insertScMiscarriageRecord(scMiscarriageRecord));
} }

View File

@@ -125,6 +125,8 @@ public class ScPregnancyRecordController extends BaseController
@PostMapping @PostMapping
public AjaxResult add(@RequestBody ScPregnancyRecord scPregnancyRecord) public AjaxResult add(@RequestBody ScPregnancyRecord scPregnancyRecord)
{ {
scPregnancyRecord.setDeptId(getDeptId());
scPregnancyRecord.setUserId(getUserId());
try { try {
// 基础参数校验 // 基础参数校验
if (scPregnancyRecord == null) { if (scPregnancyRecord == null) {

View File

@@ -41,6 +41,20 @@ public class ScSheepDeathController extends BaseController
@Autowired @Autowired
private ISwDiseaseService swDiseaseService; private ISwDiseaseService swDiseaseService;
/**
* 模糊查询母羊耳号列表
*/
@PreAuthorize("@ss.hasPermi('/sheep_death/death:query')") // 根据实际权限修改
@GetMapping("/search_ear_numbers")
public AjaxResult searchEarNumbers(@RequestParam("query") String query) {
try {
List<String> earNumbers = scSheepDeathService.searchEarNumbers(query);
return success(earNumbers);
} catch (Exception e) {
logger.error("搜索耳号异常", e);
return error("搜索耳号失败:" + e.getMessage());
}
}
/** /**
* 查询羊只死淘记录列表 * 查询羊只死淘记录列表
*/ */
@@ -126,6 +140,8 @@ public class ScSheepDeathController extends BaseController
@PostMapping @PostMapping
public AjaxResult add(@RequestBody ScSheepDeath scSheepDeath) public AjaxResult add(@RequestBody ScSheepDeath scSheepDeath)
{ {
scSheepDeath.setDeptId(getDeptId());
scSheepDeath.setUserId(getUserId());
try { try {
if (scSheepDeath == null || scSheepDeath.getManageTags() == null || scSheepDeath.getManageTags().trim().isEmpty()) { if (scSheepDeath == null || scSheepDeath.getManageTags() == null || scSheepDeath.getManageTags().trim().isEmpty()) {
return error("管理耳号不能为空"); return error("管理耳号不能为空");

View File

@@ -36,15 +36,6 @@ public class ScWeanRecordController extends BaseController {
return getDataTable(list); return getDataTable(list);
} }
/**
* 【新增】模糊查询耳号列表 (用于前端下拉框远程搜索)
*/
@PreAuthorize("@ss.hasPermi('Weaning:weaning_record:list')")
@GetMapping("/search_ear_numbers")
public AjaxResult searchEarNumbers(@RequestParam("query") String query) {
List<String> list = scWeanRecordService.searchEarNumbers(query);
return success(list);
}
/** /**
* 导出断奶记录列表 * 导出断奶记录列表
@@ -88,6 +79,8 @@ public class ScWeanRecordController extends BaseController {
@Log(title = "断奶记录", businessType = BusinessType.INSERT) @Log(title = "断奶记录", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody ScWeanRecord scWeanRecord) { public AjaxResult add(@RequestBody ScWeanRecord scWeanRecord) {
scWeanRecord.setDeptId(getDeptId());
scWeanRecord.setUserId(getUserId());
if (scWeanRecord.getEarNumber() != null) { if (scWeanRecord.getEarNumber() != null) {
Long sheepId = scWeanRecordService.selectSheepIdByEarNumber(scWeanRecord.getEarNumber()); Long sheepId = scWeanRecordService.selectSheepIdByEarNumber(scWeanRecord.getEarNumber());
if (sheepId == null) { if (sheepId == null) {
@@ -129,5 +122,19 @@ public class ScWeanRecordController extends BaseController {
return toAjax(scWeanRecordService.deleteScWeanRecordByIds(ids)); return toAjax(scWeanRecordService.deleteScWeanRecordByIds(ids));
} }
/**
* 模糊查询母羊耳号列表
*/
@PreAuthorize("@ss.hasPermi('breed:lambing_records:query')") // 根据实际权限修改
@GetMapping("/search_ear_numbers")
public AjaxResult searchEarNumbers(@RequestParam("query") String query) {
try {
List<String> earNumbers = scWeanRecordService.searchEarNumbers(query);
return success(earNumbers);
} catch (Exception e) {
logger.error("搜索耳号异常", e);
return error("搜索耳号失败:" + e.getMessage());
}
}
} }

View File

@@ -34,4 +34,7 @@ public class ScBreedPlan extends BaseEntity
@Excel(name = "配种类型") @Excel(name = "配种类型")
private Long breedType; private Long breedType;
private Long userId;
private Long deptId;
} }

View File

@@ -67,6 +67,8 @@ public class ScBreedPlanGenerate extends BaseEntity
/** 审批意见 */ /** 审批意见 */
private String approveRemark; private String approveRemark;
private Long userId;
private Long deptId;
/** 全部羊耳号列表(用于多耳号查询) */ /** 全部羊耳号列表(用于多耳号查询) */
private List<String> allEarNumbers; private List<String> allEarNumbers;

View File

@@ -67,5 +67,6 @@ public class ScBreedPlanTemp extends BaseEntity
return id; return id;
} }
private Long userId;
private Long deptId;
} }

View File

@@ -27,6 +27,8 @@ public class ScBreedRecord extends BaseEntity
private Long sheepId; private Long sheepId;
private String ramId; private String ramId;
private String eweId; private String eweId;
private Long userId;
private Long deptId;
// --- 导出及表单顺序 --- // --- 导出及表单顺序 ---
@Excel(name = "耳号") @Excel(name = "耳号")

View File

@@ -18,6 +18,19 @@ public class ScDryMilk extends BaseEntity
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private Long userId;
private Long deptId;
/** 全部羊耳号列表(用于多耳号查询) */
private List<String> allEarNumbers;
public List<String> getAllEarNumbers() {
return allEarNumbers;
}
public void setAllEarNumbers(List<String> allEarNumbers) {
this.allEarNumbers = allEarNumbers;
}
/** 主键id */ /** 主键id */
private Long id; private Long id;
@@ -120,6 +133,22 @@ public class ScDryMilk extends BaseEntity
this.tecahnician = tecahnician; this.tecahnician = tecahnician;
} }
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Long getDeptId() {
return deptId;
}
public void setDeptId(Long deptId) {
this.deptId = deptId;
}
public String getTecahnician() public String getTecahnician()
{ {
return tecahnician; return tecahnician;

View File

@@ -0,0 +1,98 @@
package com.zhyc.module.produce.breed.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import com.zhyc.common.annotation.Excel;
import com.zhyc.common.core.domain.BaseEntity;
import java.util.Date;
/**
* 胚胎明细记录 sc_embryo_detail
* 每次冲胚中每枚胚胎单独一条记录
*
* @author ruoyi
* @date 2025-11-28
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ScEmbryoDetail extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 主键ID */
private Long id;
/** 所属冲胚记录ID */
private Long flushId;
/** 胚胎序号同批次内从1递增 */
private Integer embryoNo;
/**
* 胚胎等级A / B / C / 16细胞 / 未受精 / 退化
*/
@Excel(name = "胚胎等级")
private String embryoGrade;
/**
* 去向:移植 / 遗弃 / 冷冻保存
*/
@Excel(name = "去向")
private String destination;
/** 存储方式 */
@Excel(name = "存储方式")
private String storageMethod;
/** 胚胎品种(继承自父冲胚记录) */
@Excel(name = "胚胎品种")
private String embryoVariety;
/** 关联配种记录ID移植后回填 */
private Long breedRecordId;
/**
* 是否已移植0-否 1-是
*/
private Integer isTransferred;
/** 部门ID数据权限 */
private Long deptId;
/** 创建人ID */
private Long userId;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
private Date createdAt;
// ---- 查询时关联冲胚记录的冗余字段(非数据库列)----
/** 冲胚时间(从父记录关联展示) */
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "Asia/Shanghai")
private Date flushTime;
/** 供体母羊耳号(从父记录关联展示) */
private String donorFemaleNo;
/** 供体公羊耳号(从父记录关联展示) */
private String donorMaleNo;
/** 供体公羊品种(从父记录关联展示) */
private String donorMaleVariety;
/** 供体母羊品种(从父记录关联展示) */
private String donorFemaleVariety;
/** 胎龄(从父记录关联展示) */
private Integer embryoAge;
/** 胚胎类型(从父记录关联展示) */
private String embryoType;
/** 胚胎来源(从父记录关联展示) */
private String embryoSource;
}

View File

@@ -1,6 +1,7 @@
package com.zhyc.module.produce.breed.domain; package com.zhyc.module.produce.breed.domain;
import java.util.Date; import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
@@ -8,13 +9,16 @@ import com.zhyc.common.annotation.Excel;
import com.zhyc.common.core.domain.BaseEntity; import com.zhyc.common.core.domain.BaseEntity;
/** /**
* 冲胚记录-用户录入对象 sc_embryo_flush * 冲胚记录 sc_embryo_flush
* 变更说明v2
* - 新增 embryoDetails 字段(非数据库列),用于前端一次性提交整批胚胎明细
* - transferred / recipientCnt 不再由前端直接填写,改为由胚胎明细同步计算
* *
* @author ruoyi * @author ruoyi
* @date 2025-11-28 * @date 2025-11-28
*/ */
public class ScEmbryoFlush extends BaseEntity public class ScEmbryoFlush extends BaseEntity {
{
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** 主键ID */ /** 主键ID */
@@ -49,11 +53,15 @@ public class ScEmbryoFlush extends BaseEntity
@Excel(name = "胎龄(天)") @Excel(name = "胎龄(天)")
private Integer embryoAge; private Integer embryoAge;
// ===== 胚胎等级数量(聚合值,从 embryoDetails 计算得出,存入数据库供查询展示) =====
/** A+级胚胎数 */ /** A+级胚胎数 */
@Excel(name = "A+级") @Excel(name = "A+级")
private Integer gradeAPlus; private Integer gradeAPlus;
/** A级胚胎数 */ public void setGradeAPlus(Integer gradeAPlus) { this.gradeAPlus = gradeAPlus; }
public Integer getGradeAPlus() { return gradeAPlus; }
/** A级胚胎数原 grade_aA+合并入A前端不再有A+ */
@Excel(name = "A级") @Excel(name = "A级")
private Integer gradeA; private Integer gradeA;
@@ -64,20 +72,18 @@ public class ScEmbryoFlush extends BaseEntity
/** C级胚胎数 */ /** C级胚胎数 */
@Excel(name = "C级") @Excel(name = "C级")
private Integer gradeC; private Integer gradeC;
/** D级胚胎数 */
@Excel(name = "D级")
private Integer gradeD;
/** 2/4细胞期 */
@Excel(name = "2/4细胞") @Excel(name = "2/4细胞")
private Integer cell24; private Integer cell24;
/** 8细胞期 */ public void setCell24(Integer cell24) { this.cell24 = cell24; }
public Integer getCell24() { return cell24; }
@Excel(name = "8细胞") @Excel(name = "8细胞")
private Integer cell8; private Integer cell8;
/** 16细胞期 */ public void setCell8(Integer cell8) { this.cell8 = cell8; }
public Integer getCell8() { return cell8; }
/** 16细胞期原 grade_d */
@Excel(name = "16细胞") @Excel(name = "16细胞")
private Integer cell16; private Integer cell16;
@@ -93,18 +99,36 @@ public class ScEmbryoFlush extends BaseEntity
@Excel(name = "冲胚数") @Excel(name = "冲胚数")
private Integer totalEmbryo; private Integer totalEmbryo;
/** 有效胚(A+到D级总和) */ /** 有效胚(A+B+C+16细胞总和) */
@Excel(name = "有效胚") @Excel(name = "有效胚")
private Integer validEmbryo; private Integer validEmbryo;
/** 移胚数 */ /**
* 移胚数(只读,由 sc_embryo_detail 中已移植的明细数量同步,不可前端直接填写)
*/
@Excel(name = "移胚数") @Excel(name = "移胚数")
private Integer transferred; private Integer transferred;
/** 移植受体数 */ /**
* 移植受体数(只读,由 sc_embryo_detail 中不同 breed_record_id 数量同步,不可前端直接填写)
*/
@Excel(name = "移植受体数") @Excel(name = "移植受体数")
private Integer recipientCnt; private Integer recipientCnt;
/** 鲜胚受体数(只读,子查询计算,不持久化到主表) */
@Excel(name = "鲜胚受体数")
private Integer freshRecipientCnt;
/** 冻胚受体数(只读,子查询计算,不持久化到主表) */
@Excel(name = "冻胚受体数")
private Integer frozenRecipientCnt;
public void setFreshRecipientCnt(Integer v) { this.freshRecipientCnt = v; }
public Integer getFreshRecipientCnt() { return freshRecipientCnt; }
public void setFrozenRecipientCnt(Integer v) { this.frozenRecipientCnt = v; }
public Integer getFrozenRecipientCnt() { return frozenRecipientCnt; }
/** 胚胎类型 */ /** 胚胎类型 */
@Excel(name = "胚胎类型") @Excel(name = "胚胎类型")
private String embryoType; private String embryoType;
@@ -113,14 +137,6 @@ public class ScEmbryoFlush extends BaseEntity
@Excel(name = "胚胎来源") @Excel(name = "胚胎来源")
private String embryoSource; private String embryoSource;
/** 去向 */
@Excel(name = "去向")
private String destination;
/** 存储方式 */
@Excel(name = "存储方式")
private String storageMethod;
/** 冲胚人 */ /** 冲胚人 */
@Excel(name = "冲胚人") @Excel(name = "冲胚人")
private String flushOperator; private String flushOperator;
@@ -136,369 +152,133 @@ public class ScEmbryoFlush extends BaseEntity
@Excel(name = "所在牧场") @Excel(name = "所在牧场")
private String ranchName; private String ranchName;
/** 去向(来自关联胚胎明细) */
private String destination;
public void setDestination(String destination) { this.destination = destination; }
public String getDestination() { return destination; }
/** 存储方式 */
private String storageMethod;
public void setStorageMethod(String storageMethod) { this.storageMethod = storageMethod; }
public String getStorageMethod() { return storageMethod; }
/** 创建人 */ /** 创建人 */
private String createdBy; private String createdBy;
private Long userId;
private Long deptId;
/** 创建时间 */ /** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createdAt; private Date createdAt;
public void setId(Long id) /**
{ * 胚胎明细列表(非数据库列,仅用于前端一次性提交整批胚胎明细)
this.id = id; * 在 Service 层插入冲胚记录后,遍历此列表批量插入 sc_embryo_detail
} */
private List<ScEmbryoDetail> embryoDetails;
public Long getId() // ===================== Getter / Setter =====================
{
return id;
}
public void setFlushTime(Date flushTime) public void setId(Long id) { this.id = id; }
{ public Long getId() { return id; }
this.flushTime = flushTime;
}
public Date getFlushTime() public void setFlushTime(Date flushTime) { this.flushTime = flushTime; }
{ public Date getFlushTime() { return flushTime; }
return flushTime;
}
public void setDonorFemaleNo(String donorFemaleNo) public void setDonorFemaleNo(String donorFemaleNo) { this.donorFemaleNo = donorFemaleNo; }
{ public String getDonorFemaleNo() { return donorFemaleNo; }
this.donorFemaleNo = donorFemaleNo;
}
public String getDonorFemaleNo() public void setDonorFemaleVariety(String donorFemaleVariety) { this.donorFemaleVariety = donorFemaleVariety; }
{ public String getDonorFemaleVariety() { return donorFemaleVariety; }
return donorFemaleNo;
}
public void setDonorFemaleVariety(String donorFemaleVariety) public void setDonorMaleNo(String donorMaleNo) { this.donorMaleNo = donorMaleNo; }
{ public String getDonorMaleNo() { return donorMaleNo; }
this.donorFemaleVariety = donorFemaleVariety;
}
public String getDonorFemaleVariety() public void setDonorMaleVariety(String donorMaleVariety) { this.donorMaleVariety = donorMaleVariety; }
{ public String getDonorMaleVariety() { return donorMaleVariety; }
return donorFemaleVariety;
}
public void setDonorMaleNo(String donorMaleNo) public void setEmbryoVariety(String embryoVariety) { this.embryoVariety = embryoVariety; }
{ public String getEmbryoVariety() { return embryoVariety; }
this.donorMaleNo = donorMaleNo;
}
public String getDonorMaleNo() public void setEmbryoAge(Integer embryoAge) { this.embryoAge = embryoAge; }
{ public Integer getEmbryoAge() { return embryoAge; }
return donorMaleNo;
}
public void setDonorMaleVariety(String donorMaleVariety) public void setGradeA(Integer gradeA) { this.gradeA = gradeA; }
{ public Integer getGradeA() { return gradeA; }
this.donorMaleVariety = donorMaleVariety;
}
public String getDonorMaleVariety() public void setGradeB(Integer gradeB) { this.gradeB = gradeB; }
{ public Integer getGradeB() { return gradeB; }
return donorMaleVariety;
}
public void setEmbryoVariety(String embryoVariety) public void setGradeC(Integer gradeC) { this.gradeC = gradeC; }
{ public Integer getGradeC() { return gradeC; }
this.embryoVariety = embryoVariety;
}
public String getEmbryoVariety() public void setGradeD(Integer gradeD) { this.cell16 = gradeD; }
{ public Integer getGradeD() { return cell16; }
return embryoVariety;
}
public void setEmbryoAge(Integer embryoAge) public void setUnfertilized(Integer unfertilized) { this.unfertilized = unfertilized; }
{ public Integer getUnfertilized() { return unfertilized; }
this.embryoAge = embryoAge;
}
public Integer getEmbryoAge() public void setDegenerated(Integer degenerated) { this.degenerated = degenerated; }
{ public Integer getDegenerated() { return degenerated; }
return embryoAge;
}
public void setGradeAPlus(Integer gradeAPlus) public void setTotalEmbryo(Integer totalEmbryo) { this.totalEmbryo = totalEmbryo; }
{ public Integer getTotalEmbryo() { return totalEmbryo; }
this.gradeAPlus = gradeAPlus;
}
public Integer getGradeAPlus() public void setValidEmbryo(Integer validEmbryo) { this.validEmbryo = validEmbryo; }
{ public Integer getValidEmbryo() { return validEmbryo; }
return gradeAPlus;
}
public void setGradeA(Integer gradeA) public void setTransferred(Integer transferred) { this.transferred = transferred; }
{ public Integer getTransferred() { return transferred; }
this.gradeA = gradeA;
}
public Integer getGradeA() public void setRecipientCnt(Integer recipientCnt) { this.recipientCnt = recipientCnt; }
{ public Integer getRecipientCnt() { return recipientCnt; }
return gradeA;
}
public void setGradeB(Integer gradeB) public void setEmbryoType(String embryoType) { this.embryoType = embryoType; }
{ public String getEmbryoType() { return embryoType; }
this.gradeB = gradeB;
}
public Integer getGradeB() public void setEmbryoSource(String embryoSource) { this.embryoSource = embryoSource; }
{ public String getEmbryoSource() { return embryoSource; }
return gradeB;
}
public void setGradeC(Integer gradeC) public void setFlushOperator(String flushOperator) { this.flushOperator = flushOperator; }
{ public String getFlushOperator() { return flushOperator; }
this.gradeC = gradeC;
}
public Integer getGradeC() public void setCollectOperator(String collectOperator) { this.collectOperator = collectOperator; }
{ public String getCollectOperator() { return collectOperator; }
return gradeC;
}
public void setGradeD(Integer gradeD) public void setRanchId(Long ranchId) { this.ranchId = ranchId; }
{ public Long getRanchId() { return ranchId; }
this.gradeD = gradeD;
}
public Integer getGradeD() public void setRanchName(String ranchName) { this.ranchName = ranchName; }
{ public String getRanchName() { return ranchName; }
return gradeD;
}
public void setCell24(Integer cell24) public void setCreatedBy(String createdBy) { this.createdBy = createdBy; }
{ public String getCreatedBy() { return createdBy; }
this.cell24 = cell24;
}
public Integer getCell24() public void setCreatedAt(Date createdAt) { this.createdAt = createdAt; }
{ public Date getCreatedAt() { return createdAt; }
return cell24;
}
public void setCell8(Integer cell8) public Long getUserId() { return userId; }
{ public void setUserId(Long userId) { this.userId = userId; }
this.cell8 = cell8;
}
public Integer getCell8() public Long getDeptId() { return deptId; }
{ public void setDeptId(Long deptId) { this.deptId = deptId; }
return cell8;
}
public void setCell16(Integer cell16) public List<ScEmbryoDetail> getEmbryoDetails() { return embryoDetails; }
{ public void setEmbryoDetails(List<ScEmbryoDetail> embryoDetails) { this.embryoDetails = embryoDetails; }
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 @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId()) .append("id", getId())
.append("flushTime", getFlushTime()) .append("flushTime", getFlushTime())
.append("donorFemaleNo", getDonorFemaleNo()) .append("donorFemaleNo", getDonorFemaleNo())
.append("donorFemaleVariety", getDonorFemaleVariety())
.append("donorMaleNo", getDonorMaleNo()) .append("donorMaleNo", getDonorMaleNo())
.append("donorMaleVariety", getDonorMaleVariety())
.append("embryoVariety", getEmbryoVariety()) .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("totalEmbryo", getTotalEmbryo())
.append("validEmbryo", getValidEmbryo()) .append("validEmbryo", getValidEmbryo())
.append("transferred", getTransferred()) .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(); .toString();
} }
} }

View File

@@ -135,6 +135,8 @@ public class ScLambDetail extends BaseEntity
@Excel(name = "性别") @Excel(name = "性别")
private Integer gender; private Integer gender;
private Long userId;
private Long deptId;
/** 出生重量 */ /** 出生重量 */
@Excel(name = "出生重量") @Excel(name = "出生重量")
private BigDecimal birthWeight; private BigDecimal birthWeight;

View File

@@ -121,6 +121,32 @@ public class ScLambingRecord extends BaseEntity
@Excel(name = "未留养母羔数量") @Excel(name = "未留养母羔数量")
private Integer unretainedFemaleCount; private Integer unretainedFemaleCount;
/** 供体母羊耳号 */
@Excel(name = "供体母羊")
private String donorEwe;
/** 供体母羊品种 */
@Excel(name = "供体母羊品种")
private String donorEweBreed;
/** 供体公羊耳号 */
@Excel(name = "供体公羊")
private String donorRam;
/** 供体公羊品种 */
@Excel(name = "供体公羊品种")
private String donorRamBreed;
/** 移胚数 */
@Excel(name = "移胚数")
private Integer embryoCount;
/** 配种方式(用于判断是否为胚胎移植) */
private String breedType;
/** 羔羊品种ID从第一只羔羊取得用于界面展示 */
private Integer lambBreedId;
/** 全部羊耳号列表(用于多耳号查询) */ /** 全部羊耳号列表(用于多耳号查询) */
private List<String> allEarNumbers; private List<String> allEarNumbers;
@@ -376,6 +402,27 @@ public class ScLambingRecord extends BaseEntity
this.lambDetails = lambDetails; this.lambDetails = lambDetails;
} }
public String getDonorEwe() { return donorEwe; }
public void setDonorEwe(String donorEwe) { this.donorEwe = donorEwe; }
public String getDonorEweBreed() { return donorEweBreed; }
public void setDonorEweBreed(String donorEweBreed) { this.donorEweBreed = donorEweBreed; }
public String getDonorRam() { return donorRam; }
public void setDonorRam(String donorRam) { this.donorRam = donorRam; }
public String getDonorRamBreed() { return donorRamBreed; }
public void setDonorRamBreed(String donorRamBreed) { this.donorRamBreed = donorRamBreed; }
public Integer getEmbryoCount() { return embryoCount; }
public void setEmbryoCount(Integer embryoCount) { this.embryoCount = embryoCount; }
public String getBreedType() { return breedType; }
public void setBreedType(String breedType) { this.breedType = breedType; }
public Integer getLambBreedId() { return lambBreedId; }
public void setLambBreedId(Integer lambBreedId) { this.lambBreedId = lambBreedId; }
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@@ -394,5 +441,4 @@ public class ScLambingRecord extends BaseEntity
.append("farm", getFarm()) .append("farm", getFarm())
.toString(); .toString();
} }
} }

View File

@@ -24,6 +24,8 @@ public class ScMiscarriageRecord extends BaseEntity
/** 羊只id */ /** 羊只id */
private String sheepId; private String sheepId;
private Long userId;
private Long deptId;
/** 事件日期 */ /** 事件日期 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@@ -289,6 +291,22 @@ public class ScMiscarriageRecord extends BaseEntity
this.drRanch = drRanch; this.drRanch = drRanch;
} }
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Long getDeptId() {
return deptId;
}
public void setDeptId(Long deptId) {
this.deptId = deptId;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

View File

@@ -25,6 +25,8 @@ public class ScPregnancyRecord extends BaseEntity
/** 主键ID */ /** 主键ID */
private Long id; private Long id;
private Long userId;
private Long deptId;
/** 羊只ID */ /** 羊只ID */
@Excel(name = "羊只ID") @Excel(name = "羊只ID")

View File

@@ -17,6 +17,8 @@ import com.zhyc.common.core.domain.BaseEntity;
public class ScSheepDeath extends BaseEntity public class ScSheepDeath extends BaseEntity
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private Long userId;
private Long deptId;
/** 主键ID */ /** 主键ID */
private Long id; private Long id;
@@ -219,6 +221,21 @@ public class ScSheepDeath extends BaseEntity
public List<String> getWorkGroupList() { return workGroupList; } public List<String> getWorkGroupList() { return workGroupList; }
public void setWorkGroupList(List<String> workGroupList) { this.workGroupList = workGroupList; } public void setWorkGroupList(List<String> workGroupList) { this.workGroupList = workGroupList; }
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Long getDeptId() {
return deptId;
}
public void setDeptId(Long deptId) {
this.deptId = deptId;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

View File

@@ -21,6 +21,19 @@ public class ScWeanRecord extends BaseEntity {
/** 主键ID */ /** 主键ID */
private Long id; private Long id;
private Long userId;
private Long deptId;
/** 全部羊耳号列表(用于多耳号查询) */
private List<String> allEarNumbers;
public List<String> getAllEarNumbers() {
return allEarNumbers;
}
public void setAllEarNumbers(List<String> allEarNumbers) {
this.allEarNumbers = allEarNumbers;
}
/** 羊只ID */ /** 羊只ID */
@Excel(name = "羊只ID") @Excel(name = "羊只ID")
@@ -51,10 +64,6 @@ public class ScWeanRecord extends BaseEntity {
@Excel(name = "电子耳号") @Excel(name = "电子耳号")
private String electronicTags; private String electronicTags;
// --- 新增查询字段 ---
/** 多耳号查询列表 */
private List<String> allEarNumbers;
/** 是否在群 (1是 0否) */ /** 是否在群 (1是 0否) */
private String isInHerd; private String isInHerd;

View File

@@ -3,6 +3,7 @@ package com.zhyc.module.produce.breed.mapper;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.zhyc.module.base.domain.SheepFile;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import com.zhyc.module.produce.breed.domain.ScBreedPlanGenerate; import com.zhyc.module.produce.breed.domain.ScBreedPlanGenerate;
@@ -38,14 +39,14 @@ public interface ScBreedPlanGenerateMapper
* *
* @return 符合条件的母羊列表 * @return 符合条件的母羊列表
*/ */
public List<Map<String, Object>> selectEligibleEwe(); public List<Map<String, Object>> selectEligibleEwe(SheepFile sheepFile);
/** /**
* 筛选符合条件的公羊 * 筛选符合条件的公羊
* *
* @return 符合条件的公羊列表 * @return 符合条件的公羊列表
*/ */
public List<Map<String, Object>> selectEligibleRam(); public List<Map<String, Object>> selectEligibleRam(SheepFile sheepFile);
/** /**
* 新增配种计划生成 * 新增配种计划生成
@@ -136,4 +137,26 @@ public interface ScBreedPlanGenerateMapper
* @return 耳号列表 * @return 耳号列表
*/ */
List<String> searchEarNumbers(@Param("query") String query); List<String> searchEarNumbers(@Param("query") String query);
/**
* 根据ID列表查询羊只耳号
*
* @param ids 羊只ID列表
* @param gender 性别1=母羊2=公羊
* @return 包含 id、manage_tags 的 Map 列表
*/
List<Map<String, Object>> selectEarNumbersByIds(
@Param("ids") List<Long> ids,
@Param("gender") int gender);
/**
* 根据管理耳号查询羊只ID
*
* @param manageTags 管理耳号
* @param gender 性别1=母羊2=公羊
* @return 羊只ID
*/
Long selectSheepIdByManageTags(
@Param("manageTags") String manageTags,
@Param("gender") int gender);
} }

Some files were not shown because too many files have changed in this diff Show More