Merge remote-tracking branch 'origin/main'

This commit is contained in:
ll
2026-01-19 20:43:37 +08:00
119 changed files with 1703 additions and 505 deletions

View File

@@ -0,0 +1,66 @@
package com.zhyc.module.app.controller;
import com.zhyc.common.config.RuoYiConfig;
import com.zhyc.common.core.domain.AjaxResult;
import com.zhyc.module.app.util.OcrRecognizeUtil;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
//图片返回base64
@RestController
@RequestMapping("/app/image")
public class ImageController {
@PostMapping
public AjaxResult getImageBase64(String path) {
// 添加空值检查
if (path == null || path.trim().isEmpty()) {
return AjaxResult.error("路径不能为空");
}
path = path.replace("/profile", "");
try {
// 构建完整的文件路径
String fullPath = RuoYiConfig.getProfile() + path;
// 读取文件并转换为字节数组
byte[] fileBytes = java.nio.file.Files.readAllBytes(java.nio.file.Paths.get(fullPath));
// 将字节数组转换为base64字符串
String base64String = java.util.Base64.getEncoder().encodeToString(fileBytes);
// 获取文件扩展名以确定MIME类型
String mimeType = getMimeType(path);
// 返回base64数据格式为 data:image/xxx;base64,xxxxx
String result = "data:" + mimeType + ";base64," + base64String;
return AjaxResult.success("操作成功",result);
} catch (Exception e) {
return AjaxResult.error("读取图片失败: " + e.getMessage());
}
}
/**
* 根据文件扩展名获取MIME类型
*/
private String getMimeType(String fileName) {
String extension = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase();
switch (extension) {
case "jpg":
case "jpeg":
return "image/jpeg";
case "png":
return "image/png";
case "gif":
return "image/gif";
case "bmp":
return "image/bmp";
default:
return "image/jpeg"; // 默认返回jpeg类型
}
}
}

View File

@@ -0,0 +1,50 @@
package com.zhyc.module.app.controller;
import com.zhyc.common.config.RuoYiConfig;
import com.zhyc.common.core.domain.AjaxResult;
import com.zhyc.module.app.util.OcrRecognizeUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.io.File;
//文字识别
@RestController
@RequestMapping("/ocr")
public class OrcController {
@PostMapping
public AjaxResult orcSheepNo(String path) {
// 添加空值检查
if (path == null || path.trim().isEmpty()) {
return AjaxResult.error("路径不能为空");
}
try {
OcrRecognizeUtil ocrRecognizeUtil = new OcrRecognizeUtil();
// 移除 /profile
path = path.replace("/profile", "");
path = RuoYiConfig.getProfile() + path;
// 验证文件是否存在
File file = new File(path);
if (!file.exists()) {
return AjaxResult.error("文件不存在: " + path);
}
if (!file.isFile()) {
return AjaxResult.error("路径不是一个有效文件: " + path);
}
if (!file.canRead()) {
return AjaxResult.error("无权限读取文件: " + path);
}
String recognize = ocrRecognizeUtil.recognizeTwo(path);
return AjaxResult.success("操作成功", recognize);
} catch (Exception e) {
return AjaxResult.error("OCR识别失败: " + e.getMessage());
}
}
}

View File

@@ -0,0 +1,257 @@
package com.zhyc.module.app.util;
import ai.djl.modality.cv.Image;
import cn.smartjavaai.common.cv.SmartImageFactory;
import cn.smartjavaai.common.enums.DeviceEnum;
import cn.smartjavaai.common.utils.ImageUtils;
import cn.smartjavaai.ocr.config.DirectionModelConfig;
import cn.smartjavaai.ocr.config.OcrDetModelConfig;
import cn.smartjavaai.ocr.config.OcrRecModelConfig;
import cn.smartjavaai.ocr.config.OcrRecOptions;
import cn.smartjavaai.ocr.entity.OcrInfo;
import cn.smartjavaai.ocr.enums.CommonDetModelEnum;
import cn.smartjavaai.ocr.enums.CommonRecModelEnum;
import cn.smartjavaai.ocr.enums.DirectionModelEnum;
import cn.smartjavaai.ocr.factory.OcrModelFactory;
import cn.smartjavaai.ocr.model.common.detect.OcrCommonDetModel;
import cn.smartjavaai.ocr.model.common.direction.OcrDirectionModel;
import cn.smartjavaai.ocr.model.common.recognize.OcrCommonRecModel;
import com.alibaba.fastjson.JSONObject;
import com.zhyc.common.config.RuoYiConfig;
import lombok.extern.slf4j.Slf4j;
import org.junit.BeforeClass;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
/**
* OCR 文本识别 示例
* 模型下载地址https://pan.baidu.com/s/1MLfd73Vjdpnuls9-oqc9uw?pwd=1234 提取码: 1234
* 开发文档http://doc.smartjavaai.cn/
*/
/**
* OCR识别工具类
* 提供文本识别相关的功能,包括获取不同类型的识别模型、文本检测模型、方向检测模型等
* 支持普通识别、手写识别、带方向矫正的识别以及批量识别等功能
*/
@Slf4j
public class OcrRecognizeUtil {
//设备类型
public static DeviceEnum device =DeviceEnum.CPU;
/**
* 测试初始化方法,在所有测试用例执行前调用一次
* 设置SmartImageFactory使用的引擎为OpenCV并可选配置缓存路径
*
* @throws IOException 当初始化过程中发生IO异常时抛出
*/
@BeforeClass
public static void beforeAll() throws IOException {
SmartImageFactory.setEngine(SmartImageFactory.Engine.OPENCV);
//修改缓存路径
//Config.setCachePath("/Users/xxx/smartjavaai_cache");
}
/**
* 获取通用识别模型(高精确度模型)
* 注意事项:高精度模型,识别准确度高,速度慢
*
* @return 返回高精度的OCR通用识别模型实例
*/
public OcrCommonRecModel getProRecModel(){
OcrRecModelConfig recModelConfig = new OcrRecModelConfig();
//指定文本识别模型切换模型需要同时修改modelEnum及modelPath
recModelConfig.setRecModelEnum(CommonRecModelEnum.PP_OCR_V5_SERVER_REC_MODEL);
//指定识别模型位置,需要更改为自己的模型路径(下载地址请查看文档)
recModelConfig.setRecModelPath("C:/wwwroot/ocr/rec/PP-OCRv5_server_rec_infer/PP-OCRv5_server_rec.onnx");
recModelConfig.setDevice(device);
recModelConfig.setTextDetModel(getProDetectionModel());
recModelConfig.setDirectionModel(getDirectionModel());
return OcrModelFactory.getInstance().getRecModel(recModelConfig);
}
/**
* 获取通用识别模型(极速模型)
* 注意事项:极速模型,识别准确度低,速度快
*
* @return 返回极速的OCR通用识别模型实例
*/
public OcrCommonRecModel getFastRecModel(){
OcrRecModelConfig recModelConfig = new OcrRecModelConfig();
//指定文本识别模型切换模型需要同时修改modelEnum及modelPath
recModelConfig.setRecModelEnum(CommonRecModelEnum.PP_OCR_V5_MOBILE_REC_MODEL);
//指定识别模型位置,需要更改为自己的模型路径(下载地址请查看文档)
recModelConfig.setRecModelPath("C:/wwwroot/ocr/rec/PP-OCRv5_mobile_rec_infer/PP-OCRv5_mobile_rec_infer.onnx");
recModelConfig.setDevice(device);
recModelConfig.setTextDetModel(getFastDetectionModel());
recModelConfig.setDirectionModel(getDirectionModel()); // 添加方向模型配置
return OcrModelFactory.getInstance().getRecModel(recModelConfig);
}
/**
* 获取文本检测模型(极速模型)
* 注意事项:极速模型,识别准确度低,速度快
*
* @return 返回极速的OCR通用检测模型实例
*/
public OcrCommonDetModel getFastDetectionModel() {
OcrDetModelConfig config = new OcrDetModelConfig();
//指定检测模型切换模型需要同时修改modelEnum及modelPath
config.setModelEnum(CommonDetModelEnum.PP_OCR_V5_MOBILE_DET_MODEL);
//指定模型位置,需要更改为自己的模型路径(下载地址请查看文档)
config.setDetModelPath("C:/wwwroot/ocr/det/PP-OCRv5_mobile_det_infer/PP-OCRv5_mobile_det_infer.onnx");
config.setDevice(device);
return OcrModelFactory.getInstance().getDetModel(config);
}
/**
* 获取文本检测模型(高精确度模型)
* 注意事项:高精度模型,识别准确度高,速度慢
*
* @return 返回高精度的OCR通用检测模型实例
*/
public OcrCommonDetModel getProDetectionModel() {
OcrDetModelConfig config = new OcrDetModelConfig();
//指定检测模型切换模型需要同时修改modelEnum及modelPath
config.setModelEnum(CommonDetModelEnum.PP_OCR_V5_SERVER_DET_MODEL);
//指定模型位置,需要更改为自己的模型路径(下载地址请查看文档)
config.setDetModelPath("C:/wwwroot/ocr/det/PP-OCRv5_server_det_infer/PP-OCRv5_server_det.onnx");
config.setDevice(device);
return OcrModelFactory.getInstance().getDetModel(config);
}
/**
* 获取方向检测模型
*
* @return 返回OCR方向检测模型实例
*/
public OcrDirectionModel getDirectionModel(){
DirectionModelConfig directionModelConfig = new DirectionModelConfig();
//指定行文本方向检测模型切换模型需要同时修改modelEnum及modelPath
directionModelConfig.setModelEnum(DirectionModelEnum.PP_LCNET_X0_25);
//指定行文本方向检测模型路径,需要更改为自己的模型路径(下载地址请查看文档)
directionModelConfig.setModelPath("C:/wwwroot/ocr/ori/PP-LCNet_x0_25_textline_ori_infer.onnx");
directionModelConfig.setDevice(device);
return OcrModelFactory.getInstance().getDirectionModel(directionModelConfig);
}
/**
* 文本识别
* 支持简体中文、繁体中文、英文、日文四种主要语言,以及手写、竖版、拼音、生僻字
* 流程:文本检测 -> 文本识别
* 注意事项:
* 1、批量检测时模型应统一放在外层 try 中使用,避免重复加载,自动释放资源更安全。
* 2、模型文件需要放在单独文件夹
*/
public String recognize(String path){
try {
OcrCommonRecModel recModel = getFastRecModel();
//不带方向矫正,分行返回文本
OcrRecOptions options = new OcrRecOptions(false, true);
//创建Image对象可以从文件、url、InputStream创建、BufferedImage、Base64创建具体使用方法可以查看文档
Image image = SmartImageFactory.getInstance().fromFile(path);
OcrInfo ocrInfo = recModel.recognize(image, options);
log.info("OCR识别结果{}", JSONObject.toJSONString(ocrInfo.getFullText()));
// 识别成功后删除原图片
deleteFile(path);
return ocrInfo.getFullText();
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
* 文本识别(手写字)
* 支持简体中文、繁体中文、英文、日文四种主要语言,以及手写、竖版、拼音、生僻字
* 流程:文本检测 -> 文本识别
* 注意事项:
* 1、批量检测时模型应统一放在外层 try 中使用,避免重复加载,自动释放资源更安全。
* 2、模型文件需要放在单独文件夹
* 3、识别完成后会删除原图片文件
*/
public void recognizeHandWriting(String path){
try {
OcrCommonRecModel recModel = getFastRecModel();
//创建Image对象可以从文件、url、InputStream创建、BufferedImage、Base64创建具体使用方法可以查看文档
Image image = SmartImageFactory.getInstance().fromFile(path);
OcrInfo ocrInfo = recModel.recognize(image, new OcrRecOptions());
log.info("OCR识别结果{}", JSONObject.toJSONString(ocrInfo));
// 识别成功后删除原图片
deleteFile(path);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 文本识别(带方向矫正)
* 支持简体中文、繁体中文、英文、日文四种主要语言,以及手写、竖版、拼音、生僻字
* 本方法支持多角度文字识别
* 流程:文本检测 -> 方向检测 -> 方向矫正 -> 文本识别
* 注意事项:
* 1、批量检测时模型应统一放在外层 try 中使用,避免重复加载,自动释放资源更安全。
* 2、模型文件需要放在单独文件夹
* 3、识别完成后会删除原图片文件
*/
public String recognizeTwo(String path){
try {
OcrCommonRecModel recModel = getFastRecModel();
//带方向矫正,分行返回文本
OcrRecOptions options = new OcrRecOptions(true, true);
//创建Image对象可以从文件、url、InputStream创建、BufferedImage、Base64创建具体使用方法可以查看文档
Image image = SmartImageFactory.getInstance().fromFile(path);
OcrInfo ocrInfo = recModel.recognize(image, options);
log.info("OCR识别结果{}", JSONObject.toJSONString(ocrInfo));
// 识别成功后删除原图片
deleteFile(path);
return ocrInfo.getFullText();
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
* 删除指定路径的文件
*
* @param filePath 要删除的文件路径
* @return 删除是否成功
*/
private boolean deleteFile(String filePath) {
try {
File file = new File(filePath);
if (file.exists()) {
boolean deleted = file.delete();
if (deleted) {
log.info("已删除文件: {}", filePath);
} else {
log.warn("删除文件失败: {}", filePath);
}
return deleted;
} else {
log.warn("文件不存在: {}", filePath);
return false;
}
} catch (Exception e) {
log.error("删除文件时发生异常: {}", filePath, e);
return false;
}
}
}

View File

@@ -41,7 +41,7 @@ public class BasSheepTypeController extends BaseController
/**
* 查询羊只类型列表
*/
@PreAuthorize("@ss.hasPermi('base:base:list')")
// @PreAuthorize("@ss.hasPermi('base:base:list')")
@GetMapping("/list")
public TableDataInfo list(BasSheepType basSheepType)
{
@@ -53,7 +53,7 @@ public class BasSheepTypeController extends BaseController
/**
* 导出羊只类型列表
*/
@PreAuthorize("@ss.hasPermi('base:base:export')")
// @PreAuthorize("@ss.hasPermi('base:base:export')")
@Log(title = "羊只类型", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, BasSheepType basSheepType)
@@ -66,7 +66,7 @@ public class BasSheepTypeController extends BaseController
/**
* 获取羊只类型详细信息
*/
@PreAuthorize("@ss.hasPermi('base:base:query')")
// @PreAuthorize("@ss.hasPermi('base:base:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Integer id)
{
@@ -76,7 +76,7 @@ public class BasSheepTypeController extends BaseController
/**
* 新增羊只类型
*/
@PreAuthorize("@ss.hasPermi('base:base:add')")
// @PreAuthorize("@ss.hasPermi('base:base:add')")
@Log(title = "羊只类型", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody BasSheepType basSheepType)
@@ -87,7 +87,7 @@ public class BasSheepTypeController extends BaseController
/**
* 修改羊只类型
*/
@PreAuthorize("@ss.hasPermi('base:base:edit')")
// @PreAuthorize("@ss.hasPermi('base:base:edit')")
@Log(title = "羊只类型", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody BasSheepType basSheepType)
@@ -98,7 +98,7 @@ public class BasSheepTypeController extends BaseController
/**
* 删除羊只类型
*/
@PreAuthorize("@ss.hasPermi('base:base:remove')")
// @PreAuthorize("@ss.hasPermi('base:base:remove')")
@Log(title = "羊只类型", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Integer[] ids)

View File

@@ -42,7 +42,7 @@ public class DaRanchController extends BaseController
/**
* 查询牧场管理列表
*/
@PreAuthorize("@ss.hasPermi('ranch:ranch:list')")
// @PreAuthorize("@ss.hasPermi('ranch:ranch:list')")
@GetMapping("/list")
public TableDataInfo list(DaRanch daRanch)
{
@@ -54,7 +54,7 @@ public class DaRanchController extends BaseController
/**
* 导出牧场管理列表
*/
@PreAuthorize("@ss.hasPermi('ranch:ranch:export')")
// @PreAuthorize("@ss.hasPermi('ranch:ranch:export')")
@Log(title = "牧场管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, DaRanch daRanch)
@@ -67,7 +67,7 @@ public class DaRanchController extends BaseController
/**
* 获取牧场管理详细信息
*/
@PreAuthorize("@ss.hasPermi('ranch:ranch:query')")
// @PreAuthorize("@ss.hasPermi('ranch:ranch:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
@@ -77,7 +77,7 @@ public class DaRanchController extends BaseController
/**
* 获取指定牧场下的所有羊只耳号
*/
@GetMapping("/getSheepByRanchId/{ranchId}")
// @GetMapping("/getSheepByRanchId/{ranchId}")
public AjaxResult getSheepByRanchId(@PathVariable Long ranchId) {
List<BasSheep> sheepList = basSheepService.getSheepByRanchId(ranchId);
return AjaxResult.success(sheepList);
@@ -87,7 +87,7 @@ public class DaRanchController extends BaseController
/**
* 新增牧场管理
*/
@PreAuthorize("@ss.hasPermi('ranch:ranch:add')")
// @PreAuthorize("@ss.hasPermi('ranch:ranch:add')")
@Log(title = "牧场管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody DaRanch daRanch)
@@ -98,7 +98,7 @@ public class DaRanchController extends BaseController
/**
* 修改牧场管理
*/
@PreAuthorize("@ss.hasPermi('ranch:ranch:edit')")
// @PreAuthorize("@ss.hasPermi('ranch:ranch:edit')")
@Log(title = "牧场管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody DaRanch daRanch)
@@ -109,7 +109,7 @@ public class DaRanchController extends BaseController
/**
* 删除牧场管理
*/
@PreAuthorize("@ss.hasPermi('ranch:ranch:remove')")
// @PreAuthorize("@ss.hasPermi('ranch:ranch:remove')")
@Log(title = "牧场管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)

View File

@@ -5,6 +5,7 @@ import com.zhyc.common.annotation.Log;
import com.zhyc.common.core.controller.BaseController;
import com.zhyc.common.core.domain.AjaxResult;
import com.zhyc.common.core.page.TableDataInfo;
import com.zhyc.common.core.text.Convert;
import com.zhyc.common.enums.BusinessType;
import com.zhyc.common.utils.poi.ExcelUtil;
import com.zhyc.module.base.domain.SheepFile;
@@ -19,6 +20,9 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import javax.servlet.http.HttpServletRequest;
/**
* 羊只档案Controller
*
@@ -55,13 +59,29 @@ public class SheepFileController extends BaseController
} catch (NumberFormatException e) {
// 使用默认值
}
} else if (queryParams.containsKey("page") && queryParams.get("page") != null) {
// 如果 pageNum 不存在,则尝试使用 page
try {
pageNum = Integer.parseInt(queryParams.get("page").toString());
} catch (NumberFormatException e) {
// 使用默认值
}
}
if (queryParams.containsKey("pageSize") && queryParams.get("pageSize") != null) {
try {
pageSize = Integer.parseInt(queryParams.get("pageSize").toString());
} catch (NumberFormatException e) {
// 使用默认值
}
}else if (queryParams.containsKey("limit") && queryParams.get("limit") != null) {
// 如果 pageSize 不存在,则尝试使用 limit
try {
pageSize = Integer.parseInt(queryParams.get("limit").toString());
} catch (NumberFormatException e) {
// 使用默认值
}
}
// 提取常规查询参数到 SheepFile 对象
@@ -147,68 +167,80 @@ public class SheepFileController extends BaseController
*/
@PreAuthorize("@ss.hasPermi('sheep_file:sheep_file:export')")
@Log(title = "羊只档案", businessType = BusinessType.EXPORT)
@PostMapping("/export") // 改为 POST 请求
public void export(HttpServletResponse response, @RequestBody(required = false) Map<String, Object> queryParams)
@PostMapping("/export")
public void export(HttpServletResponse response, HttpServletRequest request)
{
// 解析查询参数
// 构建查询条件对象
SheepFile sheepFile = new SheepFile();
Map<String, Object> customParams = new HashMap<>();
if (queryParams != null && !queryParams.isEmpty()) {
// 提取常规查询参数到 SheepFile 对象
if (queryParams.containsKey("bsManageTags") && queryParams.get("bsManageTags") != null) {
sheepFile.setBsManageTags(queryParams.get("bsManageTags").toString());
}
if (queryParams.containsKey("electronicTags") && queryParams.get("electronicTags") != null) {
sheepFile.setElectronicTags(queryParams.get("electronicTags").toString());
}
if (queryParams.containsKey("drRanch") && queryParams.get("drRanch") != null) {
sheepFile.setDrRanch(queryParams.get("drRanch").toString());
}
if (queryParams.containsKey("variety") && queryParams.get("variety") != null) {
sheepFile.setVariety(queryParams.get("variety").toString());
}
if (queryParams.containsKey("name") && queryParams.get("name") != null) {
sheepFile.setName(queryParams.get("name").toString());
}
if (queryParams.containsKey("gender") && queryParams.get("gender") != null) {
sheepFile.setGender(convertToLong(queryParams.get("gender")));
}
if (queryParams.containsKey("statusId") && queryParams.get("statusId") != null) {
sheepFile.setStatusId(convertToLong(queryParams.get("statusId")));
}
if (queryParams.containsKey("breed") && queryParams.get("breed") != null) {
sheepFile.setBreed(queryParams.get("breed").toString());
}
// 解析所有请求参数
Map<String, String[]> parameterMap = request.getParameterMap();
// 提取自定义筛选参数
for (Map.Entry<String, Object> entry : queryParams.entrySet()) {
String key = entry.getKey();
Object value = entry.getValue();
for (Map.Entry<String, String[]> entry : parameterMap.entrySet()) {
String key = entry.getKey();
String[] values = entry.getValue();
// 跳过常规参数和分页参数
if ("bsManageTags".equals(key) || "electronicTags".equals(key) ||
"drRanch".equals(key) || "variety".equals(key) ||
"name".equals(key) || "gender".equals(key) ||
"statusId".equals(key) || "breed".equals(key) ||
"pageNum".equals(key) || "pageSize".equals(key)) {
continue;
}
if (values != null && values.length > 0 && StringUtils.isNotBlank(values[0])) {
String value = values[0];
// 添加到自定义参数
if (value != null) {
customParams.put(key, value);
// 使用若依框架的工具方法处理参数
switch (key) {
case "bsManageTags":
sheepFile.setBsManageTags(convertToString(value));
break;
case "electronicTags":
sheepFile.setElectronicTags(convertToString(value));
break;
case "drRanch":
sheepFile.setDrRanch(convertToString(value));
break;
case "variety":
sheepFile.setVariety(convertToString(value));
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;
case "pageNum":
case "pageSize":
// 忽略分页参数
break;
default:
// 自定义参数
customParams.put(key, value);
break;
}
}
}
// 调用支持复杂查询的Service方法获取数据(不分页)
// 调用Service获取数据
List<SheepFile> list = sheepFileService.selectSheepFileListByCondition(customParams, sheepFile);
ExcelUtil<SheepFile> util = new ExcelUtil<SheepFile>(SheepFile.class);
// 使用若依框架的Excel工具类导出
ExcelUtil<SheepFile> util = new ExcelUtil<>(SheepFile.class);
util.exportExcel(response, list, "羊只档案数据");
}
/**
* 字符串转换工具方法
*/
private String convertToString(Object value) {
if (value == null) {
return null;
}
return value.toString().trim();
}
/**
* 获取羊只档案详细信息
*/

View File

@@ -30,7 +30,7 @@ public class SheepFile extends BaseEntity
private String bsManageTags;
/** 牧场id */
@Excel(name = "牧场id")
// @Excel(name = "牧场id")
private Long ranchId;
/** 牧场名称 */
@@ -38,7 +38,7 @@ public class SheepFile extends BaseEntity
private String drRanch;
/** 羊舍id */
@Excel(name = "羊舍id")
// @Excel(name = "羊舍id")
private Long sheepfoldId;
/** 羊舍名称 */
@@ -50,7 +50,7 @@ public class SheepFile extends BaseEntity
private String electronicTags;
/** 品种id */
@Excel(name = "品种id")
// @Excel(name = "品种id")
private Long varietyId;
/** 品种 */
@@ -65,8 +65,12 @@ public class SheepFile extends BaseEntity
@Excel(name = "羊只类型")
private String name;
/** 性别 */
@Excel(name = "性别")
// /** 性别 */
//// @Excel(name = "性别")
// private Long gender;
/** 性别 - 使用字典转换 */
@Excel(name = "性别", dictType = "sheep_gender") // 添加 dictType
private Long gender;
/** 出生日期 */
@@ -95,10 +99,11 @@ public class SheepFile extends BaseEntity
@Excel(name = "断奶日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date weaningDate;
/** 羊只状态 */
@Excel(name = "羊只状态")
/** 羊只状态 - 使用字典转换 */
@Excel(name = "羊只状态", dictType = "sheep_status")
private Long statusId;
/** 断奶体重 */
@Excel(name = "断奶体重")
private Double weaningWeight;
@@ -117,7 +122,7 @@ public class SheepFile extends BaseEntity
private Double weaningDailyGain;
/** 繁育状态id */
@Excel(name = "繁育状态id")
// @Excel(name = "繁育状态id")
private Long breedStatusId;
/** 繁殖状态 */
@@ -125,7 +130,7 @@ public class SheepFile extends BaseEntity
private String breed;
/** 父号id */
@Excel(name = "父号id")
// @Excel(name = "父号id")
private Long bsFatherId;
/** 父亲管理耳号 */
@@ -133,7 +138,7 @@ public class SheepFile extends BaseEntity
private String fatherManageTags;
/** 母号id */
@Excel(name = "母号id")
// @Excel(name = "母号id")
private Long bsMotherId;
/** 母亲管理耳号 */
@@ -141,7 +146,7 @@ public class SheepFile extends BaseEntity
private String motherManageTags;
/** 受体id */
@Excel(name = "受体id")
// @Excel(name = "受体id")
private Long receptorId;
/** 受体管理耳号 */
@@ -149,7 +154,7 @@ public class SheepFile extends BaseEntity
private String receptorManageTags;
/** 祖父号id */
@Excel(name = "祖父号id")
// @Excel(name = "祖父号id")
private Long fatherFatherId;
/** 祖父管理耳号 */
@@ -157,7 +162,7 @@ public class SheepFile extends BaseEntity
private String grandfatherManageTags;
/** 祖母号id */
@Excel(name = "祖母号id")
// @Excel(name = "祖母号id")
private Long fatherMotherId;
/** 祖母管理耳号 */
@@ -165,7 +170,7 @@ public class SheepFile extends BaseEntity
private String grandmotherManageTags;
/** 外祖父号id */
@Excel(name = "外祖父号id")
// @Excel(name = "外祖父号id")
private Long fatherId;
/** 外祖父管理耳号 */
@@ -173,7 +178,7 @@ public class SheepFile extends BaseEntity
private String maternalGrandfatherManageTags;
/** 外祖母号id */
@Excel(name = "外祖母号id")
// @Excel(name = "外祖母号id")
private Long motherId;
/** 外祖母管理耳号 */
@@ -186,7 +191,7 @@ public class SheepFile extends BaseEntity
private Date matingDate;
/** 配种类型 */
@Excel(name = "配种类型")
@Excel(name = "配种类型",dictType = "breed_type")
private Long matingTypeId;
/** 孕检日期 */
@@ -245,7 +250,7 @@ public class SheepFile extends BaseEntity
private String comment;
/** 是否性控 */
@Excel(name = "是否性控")
@Excel(name = "是否性控",dictType = "controlled")
private Long controlled;
/** 体况评分 */
@@ -257,7 +262,7 @@ public class SheepFile extends BaseEntity
private Long breast;
/** 入群来源 */
@Excel(name = "入群来源")
@Excel(name = "入群来源",dictType = "source")
private String source;
/** 入群日期 */
@@ -266,7 +271,7 @@ public class SheepFile extends BaseEntity
private Date sourceDate;
/** 来源牧场id */
@Excel(name = "来源牧场id")
// @Excel(name = "来源牧场id")
private Long sourceRanchId;
/** 来源牧场 */
@@ -276,5 +281,25 @@ public class SheepFile extends BaseEntity
/** 是否删除 */
private Long isDelete;
/** 修改人 */
@Excel(name = "修改人")
private String updateBy;
/** 修改日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "修改日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date updateTime;
/** 创建人 */
@Excel(name = "创建人")
private String createBy;
/** 创建日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "创建日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date createTime;
}

View File

@@ -33,7 +33,7 @@ public class SheepFileSqlProvider {
// 添加动态条件
addDynamicConditions(sql, conditions);
sql.ORDER_BY("id DESC");
sql.ORDER_BY("id ASC");
return sql.toString();
}

View File

@@ -37,7 +37,7 @@ public class SwDiseaseController extends BaseController
/**
* 查询疾病列表
*/
@PreAuthorize("@ss.hasPermi('disease:disease:list')")
@PreAuthorize("@ss.hasPermi('biosafety:disease:list')")
@GetMapping("/list")
public AjaxResult list(SwDisease swDisease)
{
@@ -48,7 +48,7 @@ public class SwDiseaseController extends BaseController
/**
* 导出疾病列表
*/
@PreAuthorize("@ss.hasPermi('disease:disease:export')")
@PreAuthorize("@ss.hasPermi('biosafety:disease:export')")
@Log(title = "疾病", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SwDisease swDisease)
@@ -61,7 +61,7 @@ public class SwDiseaseController extends BaseController
/**
* 获取疾病详细信息
*/
@PreAuthorize("@ss.hasPermi('disease:disease:query')")
@PreAuthorize("@ss.hasPermi('biosafety:disease:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
@@ -71,7 +71,7 @@ public class SwDiseaseController extends BaseController
/**
* 新增疾病
*/
@PreAuthorize("@ss.hasPermi('disease:disease:add')")
@PreAuthorize("@ss.hasPermi('biosafety:disease:add')")
@Log(title = "疾病", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SwDisease swDisease)
@@ -82,7 +82,7 @@ public class SwDiseaseController extends BaseController
/**
* 修改疾病
*/
@PreAuthorize("@ss.hasPermi('disease:disease:edit')")
@PreAuthorize("@ss.hasPermi('biosafety:disease:edit')")
@Log(title = "疾病", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SwDisease swDisease)
@@ -93,7 +93,7 @@ public class SwDiseaseController extends BaseController
/**
* 删除疾病
*/
@PreAuthorize("@ss.hasPermi('disease:disease:remove')")
@PreAuthorize("@ss.hasPermi('biosafety:disease:remove')")
@Log(title = "疾病", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)

View File

@@ -34,6 +34,8 @@ public class Deworm extends BaseEntity
/** 羊只id */
@Excel(name = "羊只耳号")
private String sheepNo;
private String[] sheepNos;
@Excel(name = "品种")
private String variety;
@Excel(name = "羊只类别")

View File

@@ -37,6 +37,7 @@ public class Diagnosis extends BaseEntity
/** 羊只id */
@Excel(name = "羊只耳号")
private String sheepNo;
private String[] sheepNos;
private Long sheepId;

View File

@@ -37,6 +37,8 @@ public class Health extends BaseEntity
/** 羊只id */
@Excel(name = "羊只耳号")
private String sheepNo;
private String[] sheepNos;
@Excel(name = "品种")
private String variety;
@Excel(name = "羊只类别")

View File

@@ -36,6 +36,8 @@ public class Immunity extends BaseEntity
/** 羊只id */
@Excel(name = "羊只耳号")
private String sheepNo;
private String[] sheepNos;
@Excel(name = "品种")
private String variety;

View File

@@ -36,6 +36,8 @@ public class QuarantineReport extends BaseEntity
@Excel(name = "羊只耳号")
private String sheepNo;
private String[] sheepNos;
@Excel(name = "羊只类别")
private String sheepType;
@Excel(name = "羊只性别")

View File

@@ -32,6 +32,7 @@ public class Treatment extends BaseEntity
/** 羊只耳号 */
@Excel(name = "羊只耳号")
private String sheepNo;
private String[] sheepNos;
private Long sheepId;
// 用于批量新增

View File

@@ -59,6 +59,15 @@ public class DewormServiceImpl implements IDewormService
@Override
public List<Deworm> selectDewormList(Deworm deworm)
{
String[] sheepNos = null;
if (deworm.getSheepNo() != null && !deworm.getSheepNo().isEmpty()) {
if (deworm.getSheepNo().contains(",")) {
sheepNos = deworm.getSheepNo().split(",");
} else {
sheepNos = new String[]{deworm.getSheepNo()};
}
}
deworm.setSheepNos(sheepNos);
return dewormMapper.selectDewormList(deworm);
}
@@ -90,12 +99,12 @@ public class DewormServiceImpl implements IDewormService
Deworm dew = new Deworm();
BeanUtils.copyProperties(deworm, dew);
dew.setSheepId(Long.valueOf(sheepId));
dew.setVariety(sheepFile.getVariety());
dew.setSheepType(sheepFile.getName());
dew.setMonthAge(sheepFile.getMonthAge());
dew.setGender(String.valueOf(sheepFile.getGender()));
dew.setBreed(sheepFile.getBreed());
dew.setParity(sheepFile.getParity());
dew.setVariety(sheepFile.getVariety() != null ? sheepFile.getVariety() : "");
dew.setSheepType(sheepFile.getName() != null ? sheepFile.getName() : "");
dew.setMonthAge(sheepFile.getMonthAge() != null ? sheepFile.getMonthAge() : 0);
dew.setGender(sheepFile.getGender() != null ? String.valueOf(sheepFile.getGender()) : "");
dew.setBreed(sheepFile.getBreed() != null ? sheepFile.getBreed() : "");
dew.setParity(sheepFile.getParity() != null ? sheepFile.getParity() : 0);
medicineUsage.setSheepId(sheepId);
// 获取药品使用记录的id

View File

@@ -49,6 +49,7 @@ public class DiagnosisServiceImpl implements IDiagnosisService
@Override
public Diagnosis selectDiagnosisById(Long id)
{
return diagnosisMapper.selectDiagnosisById(id);
}
@@ -61,6 +62,15 @@ public class DiagnosisServiceImpl implements IDiagnosisService
@Override
public List<Diagnosis> selectDiagnosisList(Diagnosis diagnosis)
{
String[] sheepNos = null;
if (diagnosis.getSheepNo() != null && !diagnosis.getSheepNo().isEmpty()) {
if (diagnosis.getSheepNo().contains(",")) {
sheepNos = diagnosis.getSheepNo().split(",");
} else {
sheepNos = new String[]{diagnosis.getSheepNo()};
}
}
diagnosis.setSheepNos(sheepNos);
return diagnosisMapper.selectDiagnosisList(diagnosis);
}

View File

@@ -3,6 +3,8 @@ package com.zhyc.module.biosafety.service.impl;
import java.beans.Transient;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import com.zhyc.common.utils.DateUtils;
import com.zhyc.common.utils.SecurityUtils;
import com.zhyc.common.utils.bean.BeanUtils;
@@ -62,6 +64,15 @@ public class HealthServiceImpl implements IHealthService
@Override
public List<Health> selectHealthList(Health health)
{
String[] sheepNos = null;
if (health.getSheepNo() != null && !health.getSheepNo().isEmpty()) {
if (health.getSheepNo().contains(",")) {
sheepNos = health.getSheepNo().split(",");
} else {
sheepNos = new String[]{health.getSheepNo()};
}
}
health.setSheepNos(sheepNos);
return healthMapper.selectHealthList(health);
}
@@ -92,12 +103,14 @@ public class HealthServiceImpl implements IHealthService
Health heal = new Health();
BeanUtils.copyProperties(health, heal);
heal.setSheepId(Long.valueOf(sheepId));
heal.setVariety(sheepFile.getVariety());
heal.setSheepType(sheepFile.getName());
heal.setMonthAge(sheepFile.getMonthAge());
heal.setGender(String.valueOf(sheepFile.getGender()));
heal.setBreed(sheepFile.getBreed());
heal.setParity(sheepFile.getParity());
// 处理数据为空的情况
heal.setVariety(sheepFile.getVariety() != null ? sheepFile.getVariety() : "");
heal.setSheepType(sheepFile.getName() != null ? sheepFile.getName() : "");
heal.setMonthAge(sheepFile.getMonthAge() != null ? sheepFile.getMonthAge() : 0);
heal.setGender(sheepFile.getGender() != null ? String.valueOf(sheepFile.getGender()) : "");
heal.setBreed(sheepFile.getBreed() != null ? sheepFile.getBreed() : "");
heal.setParity(sheepFile.getParity() != null ? sheepFile.getParity() : 0);
medicineUsage.setSheepId(sheepId);
// 获取药品使用记录的id

View File

@@ -63,6 +63,15 @@ public class ImmunityServiceImpl implements IImmunityService
@Override
public List<Immunity> selectImmunityList(Immunity immunity)
{
String[] sheepNos = null;
if (immunity.getSheepNo() != null && !immunity.getSheepNo().isEmpty()) {
if (immunity.getSheepNo().contains(",")) {
sheepNos = immunity.getSheepNo().split(",");
} else {
sheepNos = new String[]{immunity.getSheepNo()};
}
}
immunity.setSheepNos(sheepNos);
return immunityMapper.selectImmunityList(immunity);
}
@@ -97,13 +106,12 @@ public class ImmunityServiceImpl implements IImmunityService
Immunity imm = new Immunity();
BeanUtils.copyProperties(immunity, imm);
imm.setSheepId(Long.valueOf(sheepId));
imm.setVariety(sheepFile.getVariety());
imm.setSheepType(sheepFile.getName());
imm.setMonthAge(sheepFile.getMonthAge());
imm.setGender(String.valueOf(sheepFile.getGender()));
imm.setBreed(sheepFile.getBreed());
imm.setParity(sheepFile.getParity());
imm.setVariety(sheepFile.getVariety() != null ? sheepFile.getVariety() : "");
imm.setSheepType(sheepFile.getName() != null ? sheepFile.getName() : "");
imm.setMonthAge(sheepFile.getMonthAge() != null ? sheepFile.getMonthAge() : 0);
imm.setGender(sheepFile.getGender() != null ? String.valueOf(sheepFile.getGender()) : "");
imm.setBreed(sheepFile.getBreed() != null ? sheepFile.getBreed() : "");
imm.setParity(sheepFile.getParity() != null ? sheepFile.getParity() : 0);
medicineUsage.setSheepId(sheepId);
// 获取药品使用记录的id
Integer usageId = medicineUsageService.insertSwMedicineUsage(medicineUsage);

View File

@@ -48,6 +48,15 @@ public class QuarantineReportServiceImpl implements IQuarantineReportService
@Override
public List<QuarantineReport> selectQuarantineReportList(QuarantineReport quarantineReport)
{
String[] sheepNos = null;
if (quarantineReport.getSheepNo() != null && !quarantineReport.getSheepNo().isEmpty()) {
if (quarantineReport.getSheepNo().contains(",")) {
sheepNos = quarantineReport.getSheepNo().split(",");
} else {
sheepNos = new String[]{quarantineReport.getSheepNo()};
}
}
quarantineReport.setSheepNos(sheepNos);
return quarantineReportMapper.selectQuarantineReportList(quarantineReport);
}

View File

@@ -67,6 +67,15 @@ public class TreatmentServiceImpl implements ITreatmentService
@Override
public List<Treatment> selectTreatmentList(Treatment treatment)
{
String[] sheepNos = null;
if (treatment.getSheepNo() != null && !treatment.getSheepNo().isEmpty()) {
if (treatment.getSheepNo().contains(",")) {
sheepNos = treatment.getSheepNo().split(",");
} else {
sheepNos = new String[]{treatment.getSheepNo()};
}
}
treatment.setSheepNos(sheepNos);
return treatmentMapper.selectTreatmentList(treatment);
}

View File

@@ -32,7 +32,7 @@ public class UserPostController {
// 获取岗位(部门)
@GetMapping("/getPost")
public AjaxResult getPost(){
public AjaxResult getPost(String postName){
List<Post> list = postService.selectPostList();
return AjaxResult.success(list);
}

View File

@@ -7,6 +7,6 @@ import java.util.List;
public interface PostMapper {
@Select("select * from sys_post where status = '0' and post_name like '%部'")
@Select("select * from sys_post where status = '0'")
List<Post> selectPostList();
}

View File

@@ -0,0 +1,21 @@
package com.zhyc.module.feed.controller.Exception;
import com.zhyc.common.core.domain.AjaxResult;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import javax.servlet.http.HttpServletRequest;
@ControllerAdvice
public class MaterialExceptionHandler {
@ExceptionHandler({Exception.class, RuntimeException.class})
public AjaxResult handleException(HttpServletRequest request, Exception ex) {
AjaxResult ajaxResult = new AjaxResult();
ajaxResult.put("message", ex.getMessage());
ajaxResult.put("url", request.getRequestURL().toString());
ajaxResult.put("status", 500);
ajaxResult.put("error", "出现了一些错误");
return ajaxResult;
}
}

View File

@@ -3,6 +3,7 @@ package com.zhyc.module.feed.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
@@ -22,19 +23,16 @@ import com.zhyc.common.core.page.TableDataInfo;
/**
* 原料Controller
*
*
* @author HashMap
* @date 2025-08-11
* @date 2026-01-16
*/
@RestController
@RequestMapping("/feed/material")
public class SgMaterialController extends BaseController
{
private final ISgMaterialService sgMaterialService;
public SgMaterialController(ISgMaterialService sgMaterialService) {
this.sgMaterialService = sgMaterialService;
}
@Autowired
private ISgMaterialService sgMaterialService;
/**
* 查询原料列表
@@ -57,7 +55,7 @@ public class SgMaterialController extends BaseController
public void export(HttpServletResponse response, SgMaterial sgMaterial)
{
List<SgMaterial> list = sgMaterialService.selectSgMaterialList(sgMaterial);
ExcelUtil<SgMaterial> util = new ExcelUtil<>(SgMaterial.class);
ExcelUtil<SgMaterial> util = new ExcelUtil<SgMaterial>(SgMaterial.class);
util.exportExcel(response, list, "原料数据");
}
@@ -98,7 +96,7 @@ public class SgMaterialController extends BaseController
*/
@PreAuthorize("@ss.hasPermi('feed:material:remove')")
@Log(title = "原料", businessType = BusinessType.DELETE)
@DeleteMapping("/{materialIds}")
@DeleteMapping("/{materialIds}")
public AjaxResult remove(@PathVariable String[] materialIds)
{
return toAjax(sgMaterialService.deleteSgMaterialByMaterialIds(materialIds));

View File

@@ -1,15 +1,68 @@
package com.zhyc.module.feed.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zhyc.common.annotation.Excel;
import com.zhyc.common.core.domain.BaseEntity;
import lombok.Getter;
import lombok.Setter;
@Setter
@Getter
public class SgMaterial extends BaseEntity {
/**
* 原料对象 sg_material
*
* @author HashMap
* @date 2026-01-16
*/
public class SgMaterial extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 原料编码 */
@Excel(name = "原料编码")
private String materialId;
/** 原料名称 */
@Excel(name = "原料名称")
private String materialName;
private String isGranular;
/** 颗粒料 */
@Excel(name = "颗粒料")
private Integer isGranular;
public void setMaterialId(String materialId)
{
this.materialId = materialId;
}
public String getMaterialId()
{
return materialId;
}
public void setMaterialName(String materialName)
{
this.materialName = materialName;
}
public String getMaterialName()
{
return materialName;
}
public void setIsGranular(Integer isGranular)
{
this.isGranular = isGranular;
}
public Integer getIsGranular()
{
return isGranular;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("materialId", getMaterialId())
.append("materialName", getMaterialName())
.append("isGranular", getIsGranular())
.toString();
}
}

View File

@@ -6,16 +6,16 @@ import org.apache.ibatis.annotations.Mapper;
/**
* 原料Mapper接口
*
*
* @author HashMap
* @date 2025-08-11
* @date 2026-01-16
*/
@Mapper
public interface SgMaterialMapper
public interface SgMaterialMapper
{
/**
* 查询原料
*
*
* @param materialId 原料主键
* @return 原料
*/
@@ -23,7 +23,7 @@ public interface SgMaterialMapper
/**
* 查询原料列表
*
*
* @param sgMaterial 原料
* @return 原料集合
*/
@@ -31,7 +31,7 @@ public interface SgMaterialMapper
/**
* 新增原料
*
*
* @param sgMaterial 原料
* @return 结果
*/
@@ -39,7 +39,7 @@ public interface SgMaterialMapper
/**
* 修改原料
*
*
* @param sgMaterial 原料
* @return 结果
*/
@@ -47,7 +47,7 @@ public interface SgMaterialMapper
/**
* 删除原料
*
*
* @param materialId 原料主键
* @return 结果
*/
@@ -55,7 +55,7 @@ public interface SgMaterialMapper
/**
* 批量删除原料
*
*
* @param materialIds 需要删除的数据主键集合
* @return 结果
*/

View File

@@ -5,57 +5,57 @@ import com.zhyc.module.feed.domain.SgMaterial;
/**
* 原料Service接口
*
*
* @author HashMap
* @date 2025-08-11
* @date 2026-01-16
*/
public interface ISgMaterialService
public interface ISgMaterialService
{
/**
* 查询原料
*
*
* @param materialId 原料主键
* @return 原料
*/
SgMaterial selectSgMaterialByMaterialId(String materialId);
public SgMaterial selectSgMaterialByMaterialId(String materialId);
/**
* 查询原料列表
*
*
* @param sgMaterial 原料
* @return 原料集合
*/
List<SgMaterial> selectSgMaterialList(SgMaterial sgMaterial);
public List<SgMaterial> selectSgMaterialList(SgMaterial sgMaterial);
/**
* 新增原料
*
*
* @param sgMaterial 原料
* @return 结果
*/
int insertSgMaterial(SgMaterial sgMaterial);
public int insertSgMaterial(SgMaterial sgMaterial);
/**
* 修改原料
*
*
* @param sgMaterial 原料
* @return 结果
*/
int updateSgMaterial(SgMaterial sgMaterial);
public int updateSgMaterial(SgMaterial sgMaterial);
/**
* 批量删除原料
*
*
* @param materialIds 需要删除的原料主键集合
* @return 结果
*/
int deleteSgMaterialByMaterialIds(String[] materialIds);
public int deleteSgMaterialByMaterialIds(String[] materialIds);
/**
* 删除原料信息
*
*
* @param materialId 原料主键
* @return 结果
*/
int deleteSgMaterialByMaterialId(String materialId);
public int deleteSgMaterialByMaterialId(String materialId);
}

View File

@@ -2,6 +2,7 @@ package com.zhyc.module.feed.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zhyc.module.feed.mapper.SgMaterialMapper;
import com.zhyc.module.feed.domain.SgMaterial;
@@ -11,16 +12,12 @@ import com.zhyc.module.feed.service.ISgMaterialService;
* 原料Service业务层处理
*
* @author HashMap
* @date 2025-08-11
* @date 2026-01-16
*/
@Service
public class SgMaterialServiceImpl implements ISgMaterialService
{
private final SgMaterialMapper sgMaterialMapper;
public SgMaterialServiceImpl(SgMaterialMapper sgMaterialMapper) {
this.sgMaterialMapper = sgMaterialMapper;
}
public class SgMaterialServiceImpl implements ISgMaterialService {
@Autowired
private SgMaterialMapper sgMaterialMapper;
/**
* 查询原料
@@ -29,8 +26,7 @@ public class SgMaterialServiceImpl implements ISgMaterialService
* @return 原料
*/
@Override
public SgMaterial selectSgMaterialByMaterialId(String materialId)
{
public SgMaterial selectSgMaterialByMaterialId(String materialId) {
return sgMaterialMapper.selectSgMaterialByMaterialId(materialId);
}
@@ -41,8 +37,7 @@ public class SgMaterialServiceImpl implements ISgMaterialService
* @return 原料
*/
@Override
public List<SgMaterial> selectSgMaterialList(SgMaterial sgMaterial)
{
public List<SgMaterial> selectSgMaterialList(SgMaterial sgMaterial) {
return sgMaterialMapper.selectSgMaterialList(sgMaterial);
}
@@ -53,8 +48,10 @@ public class SgMaterialServiceImpl implements ISgMaterialService
* @return 结果
*/
@Override
public int insertSgMaterial(SgMaterial sgMaterial)
{
public int insertSgMaterial(SgMaterial sgMaterial) {
if (sgMaterialMapper.selectSgMaterialByMaterialId(sgMaterial.getMaterialId()) != null) {
throw new RuntimeException("重复的编码或名称");
}
return sgMaterialMapper.insertSgMaterial(sgMaterial);
}
@@ -65,8 +62,7 @@ public class SgMaterialServiceImpl implements ISgMaterialService
* @return 结果
*/
@Override
public int updateSgMaterial(SgMaterial sgMaterial)
{
public int updateSgMaterial(SgMaterial sgMaterial) {
return sgMaterialMapper.updateSgMaterial(sgMaterial);
}
@@ -77,8 +73,7 @@ public class SgMaterialServiceImpl implements ISgMaterialService
* @return 结果
*/
@Override
public int deleteSgMaterialByMaterialIds(String[] materialIds)
{
public int deleteSgMaterialByMaterialIds(String[] materialIds) {
return sgMaterialMapper.deleteSgMaterialByMaterialIds(materialIds);
}
@@ -89,8 +84,7 @@ public class SgMaterialServiceImpl implements ISgMaterialService
* @return 结果
*/
@Override
public int deleteSgMaterialByMaterialId(String materialId)
{
public int deleteSgMaterialByMaterialId(String materialId) {
return sgMaterialMapper.deleteSgMaterialByMaterialId(materialId);
}
}

View File

@@ -134,12 +134,6 @@ public class DdFeController extends BaseController {
case "D":
qty = (Integer) flush.getOrDefault("gradeD", 0);
break;
case "囊胚":
qty = (Integer) flush.getOrDefault("cell24", 0);
break;
case "桑椹胚":
qty = (Integer) flush.getOrDefault("cell8", 0);
break;
default:
qty = 0;
}

View File

@@ -37,7 +37,7 @@ public class DdFsController extends BaseController
/**
* 查询冻精库存列表
*/
@PreAuthorize("@ss.hasPermi('sperm:sperm:list')")
@PreAuthorize("@ss.hasPermi('frozen:sperm:list')")
@GetMapping("/list")
public TableDataInfo list(DdFs ddFs)
{
@@ -49,7 +49,7 @@ public class DdFsController extends BaseController
/**
* 导出冻精库存列表
*/
@PreAuthorize("@ss.hasPermi('sperm:sperm:export')")
@PreAuthorize("@ss.hasPermi('frozen:sperm:export')")
@Log(title = "冻精库存", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, DdFs ddFs)
@@ -62,7 +62,7 @@ public class DdFsController extends BaseController
/**
* 获取冻精库存详细信息
*/
@PreAuthorize("@ss.hasPermi('sperm:sperm:query')")
@PreAuthorize("@ss.hasPermi('frozen:sperm:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
@@ -72,7 +72,7 @@ public class DdFsController extends BaseController
/**
* 新增冻精库存
*/
@PreAuthorize("@ss.hasPermi('sperm:sperm:add')")
@PreAuthorize("@ss.hasPermi('frozen:sperm:add')")
@Log(title = "冻精库存", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody DdFs ddFs)
@@ -83,7 +83,7 @@ public class DdFsController extends BaseController
/**
* 修改冻精库存
*/
@PreAuthorize("@ss.hasPermi('sperm:sperm:edit')")
@PreAuthorize("@ss.hasPermi('frozen:sperm:edit')")
@Log(title = "冻精库存", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody DdFs ddFs)
@@ -94,7 +94,7 @@ public class DdFsController extends BaseController
/**
* 删除冻精库存
*/
@PreAuthorize("@ss.hasPermi('sperm:sperm:remove')")
@PreAuthorize("@ss.hasPermi('frozen:sperm:remove')")
@Log(title = "冻精库存", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
@@ -105,7 +105,7 @@ public class DdFsController extends BaseController
/**
* 批量废弃
*/
@PreAuthorize("@ss.hasPermi('sperm:sperm:discard')")
@PreAuthorize("@ss.hasPermi('frozen:sperm:discard')")
@Log(title = "冻精库存", businessType = BusinessType.UPDATE)
@PutMapping("/discard")
public AjaxResult discard(@RequestBody List<DdFs> list) {

View File

@@ -90,7 +90,7 @@ public class DdFe extends BaseEntity
@Excel(name = "废弃原因")
private String discardTxt;
public void setId(Long id)
public void setId(Long id)
{
this.id = id;
}

View File

@@ -109,7 +109,7 @@ public class DdFeServiceImpl implements IDdFeService
@Override
public Map<String, Object> getLastFlushInfoByEwe(String eweNo) {
// 1. 冲胚数据(冻胚自己的 SQL
// 1. 冲胚数据
Map<String, Object> flush = ddFeMapper.selectFlushByEwe(eweNo);
if (flush == null) return null;
@@ -118,10 +118,16 @@ public class DdFeServiceImpl implements IDdFeService
// 2. 公羊品种
Map<String, Object> ram = scEmbryoFlushMapper.selectSheepInfoByManageTag(ramId);
if (ram == null) {
throw new ServiceException("供体公羊耳号在羊只档案中未找到");
}
String ramBreed = (String) ram.get("variety");
// 3. 母羊品种
Map<String, Object> ewe = scEmbryoFlushMapper.selectSheepInfoByManageTag(eweNo);
if (ewe == null) {
throw new ServiceException("供体母羊耳在羊只档案中未找到");
}
String eweBreed = (String) ewe.get("variety");
// 4. 胚胎品种
@@ -133,7 +139,6 @@ public class DdFeServiceImpl implements IDdFeService
rsp.put("drBreed", ramBreed);
rsp.put("deBreed", eweBreed);
rsp.put("embBreed", embryoBreed);
// 如果以后需要等级数量,也从这个 flush map 里取
rsp.put("gradeA", flush.get("gradeA"));
rsp.put("gradeB", flush.get("gradeB"));
rsp.put("gradeC", flush.get("gradeC"));

View File

@@ -5,14 +5,7 @@ import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import 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;
@@ -103,4 +96,9 @@ public class ScBodyMeasureController extends BaseController
{
return toAjax(scBodyMeasureService.deleteScBodyMeasureByIds(ids));
}
@GetMapping("/search_ear_numbers")
public AjaxResult searchEarNumbers(@RequestParam("query") String query){
return success(scBodyMeasureService.searchEarNumbers(query.trim()));
}
}

View File

@@ -4,14 +4,7 @@ import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import 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;
@@ -101,4 +94,9 @@ public class ScBodyScoreController extends BaseController
{
return toAjax(scBodyScoreService.deleteScBodyScoreByIds(ids));
}
@GetMapping("/search_ear_numbers")
public AjaxResult searchEarNumbers(@RequestParam("query") String query){
return success(scBodyScoreService.searchEarNumbers(query.trim()));
}
}

View File

@@ -4,14 +4,7 @@ import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import 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;
@@ -101,4 +94,9 @@ public class ScBreastRatingController extends BaseController
{
return toAjax(scBreastRatingService.deleteScBreastRatingByIds(ids));
}
@GetMapping("/search_ear_numbers")
public AjaxResult searchEarNumbers(@RequestParam("query") String query){
return success(scBreastRatingService.searchEarNumbers(query.trim()));
}
}

View File

@@ -8,6 +8,7 @@ import com.zhyc.common.core.domain.BaseEntity;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;
/**
* 体尺测量对象 sc_body_measure
@@ -184,13 +185,7 @@ public class ScBodyMeasure extends BaseEntity {
@Excel(name = "技术员")
private String technician;
/**
* 排序字段
*/
private String orderBy;
/**
* 排序方向
*/
private String sortDirection;
/** 前端多耳号查询条件,非表字段 */
private List<String> manageTagsList;
}

View File

@@ -1,6 +1,7 @@
package com.zhyc.module.produce.bodyManage.domain;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
@@ -77,13 +78,6 @@ public class ScBodyScore extends BaseEntity {
@Excel(name = "技术员")
private String technician;
/**
* 排序字段
*/
private String orderBy;
/**
* 排序方向
*/
private String sortDirection;
/** 前端多耳号查询条件,非表字段 */
private List<String> manageTagsList;
}

View File

@@ -8,6 +8,7 @@ import com.zhyc.common.annotation.Excel;
import com.zhyc.common.core.domain.BaseEntity;
import java.time.LocalDate;
import java.util.List;
/**
* 乳房评分对象 sc_breast_rating
@@ -110,13 +111,7 @@ public class ScBreastRating extends BaseEntity {
@Excel(name = "技术员")
private String technician;
/**
* 排序字段
*/
private String orderBy;
/**
* 排序方向
*/
private String sortDirection;
/** 前端多耳号查询条件,非表字段 */
private List<String> manageTagsList;
}

View File

@@ -2,6 +2,7 @@ package com.zhyc.module.produce.bodyManage.mapper;
import java.util.List;
import com.zhyc.module.produce.bodyManage.domain.ScBodyMeasure;
import org.apache.ibatis.annotations.Param;
/**
* 体尺测量Mapper接口
@@ -58,4 +59,14 @@ public interface ScBodyMeasureMapper
* @return 结果
*/
public int deleteScBodyMeasureByIds(Long[] ids);
/**
* 模糊搜索耳号
*/
List<String> searchEarNumbers(@Param("query") String query);
/* 列表查询支持多耳号模糊 */
List<ScBodyMeasure> selectScBodyMeasureList(
@Param("sc") ScBodyMeasure sc,
@Param("manageTagsList") List<String> manageTagsList);
}

View File

@@ -2,6 +2,7 @@ package com.zhyc.module.produce.bodyManage.mapper;
import java.util.List;
import com.zhyc.module.produce.bodyManage.domain.ScBodyScore;
import org.apache.ibatis.annotations.Param;
/**
* 体况评分Mapper接口
@@ -58,4 +59,13 @@ public interface ScBodyScoreMapper
* @return 结果
*/
public int deleteScBodyScoreByIds(Long[] ids);
/**
* 模糊搜索耳号
*/
List<String> searchEarNumbers(@Param("query") String query);
/* 列表查询支持多耳号模糊 */
List<ScBodyScore> selectScBodyScoreList(
@Param("sc") ScBodyScore sc,
@Param("manageTagsList") List<String> manageTagsList);
}

View File

@@ -2,6 +2,7 @@ package com.zhyc.module.produce.bodyManage.mapper;
import java.util.List;
import com.zhyc.module.produce.bodyManage.domain.ScBreastRating;
import org.apache.ibatis.annotations.Param;
/**
* 乳房评分Mapper接口
@@ -58,4 +59,14 @@ public interface ScBreastRatingMapper
* @return 结果
*/
public int deleteScBreastRatingByIds(Long[] ids);
/**
* 模糊搜索耳号
*/
List<String> searchEarNumbers(@Param("query") String query);
/* 列表查询支持多耳号模糊 */
List<ScBreastRating> selectScBreastRatingList(
@Param("sc") ScBreastRating sc,
@Param("manageTagsList") List<String> manageTagsList);
}

View File

@@ -58,4 +58,6 @@ public interface IScBodyMeasureService
* @return 结果
*/
public int deleteScBodyMeasureById(Long id);
List<String> searchEarNumbers(String query);
}

View File

@@ -58,4 +58,6 @@ public interface IScBodyScoreService
* @return 结果
*/
public int deleteScBodyScoreById(Long id);
List<String> searchEarNumbers(String query);
}

View File

@@ -58,4 +58,6 @@ public interface IScBreastRatingService
* @return 结果
*/
public int deleteScBreastRatingById(Long id);
List<String> searchEarNumbers(String query);
}

View File

@@ -44,9 +44,14 @@ public class ScBodyMeasureServiceImpl implements IScBodyMeasureService
* @return 体尺测量
*/
@Override
public List<ScBodyMeasure> selectScBodyMeasureList(ScBodyMeasure scBodyMeasure)
{
return scBodyMeasureMapper.selectScBodyMeasureList(scBodyMeasure);
public List<ScBodyMeasure> selectScBodyMeasureList(ScBodyMeasure scBodyMeasure) {
return scBodyMeasureMapper.selectScBodyMeasureList(scBodyMeasure,
scBodyMeasure.getManageTagsList());
}
@Override
public List<String> searchEarNumbers(String query) {
return scBodyMeasureMapper.searchEarNumbers(query.trim());
}
/**

View File

@@ -49,7 +49,13 @@ public class ScBodyScoreServiceImpl implements IScBodyScoreService {
*/
@Override
public List<ScBodyScore> selectScBodyScoreList(ScBodyScore scBodyScore) {
return scBodyScoreMapper.selectScBodyScoreList(scBodyScore);
return scBodyScoreMapper.selectScBodyScoreList(scBodyScore,
scBodyScore.getManageTagsList());
}
@Override
public List<String> searchEarNumbers(String query) {
return scBodyScoreMapper.searchEarNumbers(query.trim());
}
/**

View File

@@ -52,7 +52,13 @@ public class ScBreastRatingServiceImpl implements IScBreastRatingService {
*/
@Override
public List<ScBreastRating> selectScBreastRatingList(ScBreastRating scBreastRating) {
return scBreastRatingMapper.selectScBreastRatingList(scBreastRating);
return scBreastRatingMapper.selectScBreastRatingList(scBreastRating,
scBreastRating.getManageTagsList());
}
@Override
public List<String> searchEarNumbers(String query) {
return scBreastRatingMapper.searchEarNumbers(query.trim());
}
/**

View File

@@ -4,14 +4,7 @@ import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import 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;
@@ -101,4 +94,9 @@ public class ScChangeCommentController extends BaseController
{
return toAjax(scChangeCommentService.deleteScChangeCommentByIds(ids));
}
@GetMapping("/search_ear_numbers")
public AjaxResult searchEarNumbers(@RequestParam("query") String query){
return success(scChangeCommentService.searchEarNumbers(query.trim()));
}
}

View File

@@ -7,14 +7,7 @@ import com.zhyc.module.base.domain.BasSheep;
import com.zhyc.module.base.service.IBasSheepService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.zhyc.common.annotation.Log;
import com.zhyc.common.core.controller.BaseController;
import com.zhyc.common.core.domain.AjaxResult;
@@ -23,6 +16,7 @@ import com.zhyc.module.produce.manage_sheep.domain.ScChangeEar;
import com.zhyc.module.produce.manage_sheep.service.IScChangeEarService;
import com.zhyc.common.utils.poi.ExcelUtil;
import com.zhyc.common.core.page.TableDataInfo;
import org.springframework.web.bind.annotation.RequestParam;
/**
* 修改电子耳号记录Controller
@@ -116,4 +110,9 @@ public class ScChangeEarController extends BaseController
{
return toAjax(scChangeEarService.deleteScChangeEarByIds(ids));
}
@GetMapping("/search_ear_numbers")
public AjaxResult searchEarNumbers(@RequestParam("query") String query){
return success(scChangeEarService.searchEarNumbers(query.trim()));
}
}

View File

@@ -4,14 +4,7 @@ import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import 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;
@@ -101,4 +94,9 @@ public class ScChangeVarietyController extends BaseController
{
return toAjax(scChangeVarietyService.deleteScChangeVarietyByIds(ids));
}
@GetMapping("/search_ear_numbers")
public AjaxResult searchEarNumbers(@RequestParam("query") String query){
return success(scChangeVarietyService.searchEarNumbers(query.trim()));
}
}

View File

@@ -8,14 +8,7 @@ import com.zhyc.module.produce.manage_sheep.domain.ScTransGroup;
import com.zhyc.module.produce.manage_sheep.service.IScTransGroupService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.zhyc.common.annotation.Log;
import com.zhyc.common.core.controller.BaseController;
import com.zhyc.common.core.domain.AjaxResult;
@@ -97,12 +90,8 @@ public class ScTransGroupController extends BaseController {
return toAjax(scTransGroupService.deleteScTransGroupByIds(ids));
}
/**
* 审批转群记录
*/
// @PutMapping("/approve")
// public AjaxResult approve(@RequestBody ScTransGroup scTransGroup) {
// return toAjax(scTransGroupService.approveScTransGroup(scTransGroup));
// }
@GetMapping("/search_ear_numbers")
public AjaxResult searchEarNumbers(@RequestParam("query") String query){
return success(scTransGroupService.searchEarNumbers(query.trim()));
}
}

View File

@@ -5,14 +5,7 @@ import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import 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;
@@ -116,4 +109,9 @@ public class ScTransitionInfoController extends BaseController {
int rows = scTransitionInfoService.approveScTransitionInfo(scTransitionInfo);
return toAjax(rows);
}
@GetMapping("/search_ear_numbers")
public AjaxResult searchEarNumbers(@RequestParam("query") String query){
return success(scTransitionInfoService.searchEarNumbers(query.trim()));
}
}

View File

@@ -90,7 +90,9 @@ public class ScAddSheep extends BaseEntity {
@Excel(name = "技术员")
private String technician;
/** 断奶体重(仅接收,不入库) */
@Excel(name = "断奶体重")
private BigDecimal weaningWeight;
private String createBy;
private Date createTime;

View File

@@ -8,6 +8,7 @@ import com.zhyc.common.annotation.Excel;
import com.zhyc.common.core.domain.BaseEntity;
import java.util.Date;
import java.util.List;
/**
* 改备注对象 sc_change_comment
@@ -67,4 +68,7 @@ public class ScChangeComment extends BaseEntity {
*/
@Excel(name = "技术员")
private String technician;
/** 前端多耳号条件,非数据库字段 */
private List<String> manageTagsList;
}

View File

@@ -8,6 +8,7 @@ import com.zhyc.common.annotation.Excel;
import com.zhyc.common.core.domain.BaseEntity;
import java.util.Date;
import java.util.List;
/**
* 修改电子耳号记录对象 sc_change_ear
@@ -84,4 +85,7 @@ public class ScChangeEar extends BaseEntity {
@Excel(name = "技术员")
private String technician;
/** 前端多耳号查询条件,非表字段 */
private List<String> manageTagsList;
}

View File

@@ -1,6 +1,7 @@
package com.zhyc.module.produce.manage_sheep.domain;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
@@ -77,4 +78,6 @@ public class ScChangeVariety extends BaseEntity {
@JsonFormat(pattern = "yyyy-MM-dd")
private Date eventDate;
/** 前端多耳号查询条件,非表字段 */
private List<String> manageTagsList;
}

View File

@@ -6,6 +6,8 @@ import lombok.NoArgsConstructor;
import com.zhyc.common.annotation.Excel;
import com.zhyc.common.core.domain.BaseEntity;
import java.util.List;
/**
* 转群记录对象 sc_trans_group
*
@@ -112,5 +114,6 @@ public class ScTransGroup extends BaseEntity {
@Excel(name = "备注")
private String comment;
/** 前端多耳号查询条件,非表字段 */
private List<String> manageTagsList;
}

View File

@@ -7,6 +7,7 @@ import com.zhyc.common.annotation.Excel;
import com.zhyc.common.core.domain.BaseEntity;
import java.time.LocalDate;
import java.util.List;
/**
* 转场对象 sc_transition_info
@@ -96,5 +97,6 @@ public class ScTransitionInfo extends BaseEntity {
@Excel(name = "备注")
private String comment;
/** 前端多耳号查询条件,非表字段 */
private List<String> manageTagsList;
}

View File

@@ -2,6 +2,7 @@ package com.zhyc.module.produce.manage_sheep.mapper;
import java.util.List;
import com.zhyc.module.produce.manage_sheep.domain.ScChangeComment;
import org.apache.ibatis.annotations.Param;
/**
* 改备注Mapper接口
@@ -58,4 +59,13 @@ public interface ScChangeCommentMapper
* @return 结果
*/
public int deleteScChangeCommentByIds(Long[] ids);
List<ScChangeComment> selectScChangeCommentList(
@Param("sc") ScChangeComment sc,
@Param("manageTagsList") List<String> manageTagsList);
/**
* 模糊搜索耳号
*/
List<String> searchEarNumbers(@Param("query") String query);
}

View File

@@ -2,6 +2,7 @@ package com.zhyc.module.produce.manage_sheep.mapper;
import java.util.List;
import com.zhyc.module.produce.manage_sheep.domain.ScChangeEar;
import org.apache.ibatis.annotations.Param;
/**
* 修改电子耳号记录Mapper接口
@@ -58,4 +59,14 @@ public interface ScChangeEarMapper
* @return 结果
*/
public int deleteScChangeEarByIds(Integer[] ids);
/**
* 模糊搜索耳号
*/
List<String> searchEarNumbers(@Param("query") String query);
/* 列表查询支持多耳号模糊 */
List<ScChangeEar> selectScChangeEarList(
@Param("sc") ScChangeEar sc,
@Param("manageTagsList") List<String> manageTagsList);
}

View File

@@ -2,6 +2,7 @@ package com.zhyc.module.produce.manage_sheep.mapper;
import java.util.List;
import com.zhyc.module.produce.manage_sheep.domain.ScChangeVariety;
import org.apache.ibatis.annotations.Param;
/**
* 改品种记录Mapper接口
@@ -58,4 +59,14 @@ public interface ScChangeVarietyMapper
* @return 结果
*/
public int deleteScChangeVarietyByIds(Integer[] ids);
/**
* 模糊搜索耳号
*/
List<String> searchEarNumbers(@Param("query") String query);
/* 列表查询支持多耳号模糊 */
List<ScChangeVariety> selectScChangeVarietyList(
@Param("sc") ScChangeVariety sc,
@Param("manageTagsList") List<String> manageTagsList);
}

View File

@@ -4,6 +4,7 @@ import java.util.List;
import com.zhyc.module.produce.manage_sheep.domain.ScTransGroup;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 转群记录Mapper接口
@@ -60,4 +61,14 @@ public interface ScTransGroupMapper {
* @return 结果
*/
public int deleteScTransGroupByIds(Integer[] ids);
/**
* 模糊搜索耳号
*/
List<String> searchEarNumbers(@Param("query") String query);
/* 列表查询支持多耳号模糊 */
List<ScTransGroup> selectScTransGroupList(
@Param("sc") ScTransGroup sc,
@Param("manageTagsList") List<String> manageTagsList);
}

View File

@@ -64,4 +64,13 @@ public interface ScTransitionInfoMapper
//批量转场
int insertScTransitionInfoBatch(@Param("list") List<ScTransitionInfo> transitionInfoList);
/**
* 模糊搜索耳号
*/
List<String> searchEarNumbers(@Param("query") String query);
/* 列表查询支持多耳号模糊 */
List<ScTransitionInfo> selectScTransitionInfoList(
@Param("sc") ScTransitionInfo sc,
@Param("manageTagsList") List<String> manageTagsList);
}

View File

@@ -58,4 +58,9 @@ public interface IScChangeCommentService
* @return 结果
*/
public int deleteScChangeCommentById(Long id);
/**
* 远程模糊搜索耳号(下拉用)
*/
List<String> searchEarNumbers(String query);
}

View File

@@ -58,4 +58,6 @@ public interface IScChangeEarService
* @return 结果
*/
public int deleteScChangeEarById(Integer id);
List<String> searchEarNumbers(String query);
}

View File

@@ -58,4 +58,6 @@ public interface IScChangeVarietyService
* @return 结果
*/
public int deleteScChangeVarietyById(Integer id);
List<String> searchEarNumbers(String query);
}

View File

@@ -64,4 +64,6 @@ public interface IScTransGroupService {
* 审批转群记录
*/
int approveScTransGroup(ScTransGroup scTransGroup);
List<String> searchEarNumbers(String query);
}

View File

@@ -71,4 +71,5 @@ public interface IScTransitionInfoService {
//审批转场
public int approveScTransitionInfo(ScTransitionInfo scTransitionInfo);
List<String> searchEarNumbers(String query);
}

View File

@@ -61,6 +61,7 @@ public class ScAddSheepServiceImpl implements IScAddSheepService {
bs.setFatherId(null);
bs.setMotherId(null);
bs.setBirthWeight(scAddSheep.getBornWeight().longValue());
bs.setWeaningWeight(scAddSheep.getWeaningWeight().longValue());
bs.setSource(String.valueOf(2));
bs.setBirthday(scAddSheep.getBirthday());
bs.setGender(scAddSheep.getGender().longValue());
@@ -72,6 +73,7 @@ public class ScAddSheepServiceImpl implements IScAddSheepService {
bs.setVarietyId(scAddSheep.getVarietyId().longValue());
bs.setSourceDate(scAddSheep.getJoinDate());
bs.setComment(scAddSheep.getComment());
bs.setCreateBy(scAddSheep.getCreateBy());
bs.setCreateTime(new Date());
if (scAddSheep.getTypeId() != null) {

View File

@@ -49,9 +49,14 @@ public class ScChangeCommentServiceImpl implements IScChangeCommentService
@Override
public List<ScChangeComment> selectScChangeCommentList(ScChangeComment scChangeComment)
{
return scChangeCommentMapper.selectScChangeCommentList(scChangeComment);
// 把实体和独立参数一起传过去
return scChangeCommentMapper.selectScChangeCommentList(scChangeComment,
scChangeComment.getManageTagsList());
}
@Override
public List<String> searchEarNumbers(String query) {
return scChangeCommentMapper.searchEarNumbers(query);
}
/**
* 新增改备注
*

View File

@@ -67,8 +67,8 @@ public class ScChangeEarServiceImpl implements IScChangeEarService
*/
@Override
public List<ScChangeEar> selectScChangeEarList(ScChangeEar scChangeEar) {
List<ScChangeEar> list = scChangeEarMapper.selectScChangeEarList(scChangeEar);
return list;
return scChangeEarMapper.selectScChangeEarList(scChangeEar,
scChangeEar.getManageTagsList());
}
/**
@@ -166,4 +166,10 @@ public class ScChangeEarServiceImpl implements IScChangeEarService
{
return scChangeEarMapper.deleteScChangeEarById(id);
}
@Override
public List<String> searchEarNumbers(String query) {
return scChangeEarMapper.searchEarNumbers(query.trim());
}
}

View File

@@ -52,7 +52,8 @@ public class ScChangeVarietyServiceImpl implements IScChangeVarietyService
@Override
public List<ScChangeVariety> selectScChangeVarietyList(ScChangeVariety scChangeVariety)
{
return scChangeVarietyMapper.selectScChangeVarietyList(scChangeVariety);
return scChangeVarietyMapper.selectScChangeVarietyList(scChangeVariety,
scChangeVariety.getManageTagsList());
}
/**
@@ -133,4 +134,9 @@ public class ScChangeVarietyServiceImpl implements IScChangeVarietyService
{
return scChangeVarietyMapper.deleteScChangeVarietyById(id);
}
@Override
public List<String> searchEarNumbers(String query) {
return scChangeVarietyMapper.searchEarNumbers(query.trim());
}
}

View File

@@ -56,7 +56,8 @@ public class ScTransGroupServiceImpl implements IScTransGroupService {
*/
@Override
public List<ScTransGroup> selectScTransGroupList(ScTransGroup scTransGroup) {
List<ScTransGroup> list = scTransGroupMapper.selectScTransGroupList(scTransGroup);
List<ScTransGroup> list = scTransGroupMapper.selectScTransGroupList(scTransGroup,
scTransGroup.getManageTagsList());
list.forEach(group -> {
group.setReasonText(convertReason(group.getReason()));
group.setStatusText(convertStatus(group.getStatus()));
@@ -209,4 +210,9 @@ public class ScTransGroupServiceImpl implements IScTransGroupService {
eventTypeMap.put(4, "预售转群");
return eventTypeMap.getOrDefault(eventType, "未知");
}
@Override
public List<String> searchEarNumbers(String query) {
return scTransGroupMapper.searchEarNumbers(query.trim());
}
}

View File

@@ -55,7 +55,8 @@ public class ScTransitionInfoServiceImpl implements IScTransitionInfoService
@Override
public List<ScTransitionInfo> selectScTransitionInfoList(ScTransitionInfo scTransitionInfo)
{
return scTransitionInfoMapper.selectScTransitionInfoList(scTransitionInfo);
return scTransitionInfoMapper.selectScTransitionInfoList(scTransitionInfo,
scTransitionInfo.getManageTagsList());
}
/**
@@ -212,4 +213,9 @@ public class ScTransitionInfoServiceImpl implements IScTransitionInfoService
transTypeMap.put(2, "育肥调拨");
return transTypeMap.getOrDefault(transTypeCode, "未知类型");
}
@Override
public List<String> searchEarNumbers(String query) {
return scTransitionInfoMapper.searchEarNumbers(query.trim());
}
}

View File

@@ -7,14 +7,7 @@ import com.zhyc.module.produce.other.domain.ScCastrate;
import com.zhyc.module.produce.other.service.IScCastrateService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.zhyc.common.annotation.Log;
import com.zhyc.common.core.controller.BaseController;
import com.zhyc.common.core.domain.AjaxResult;
@@ -102,4 +95,9 @@ public class ScCastrateController extends BaseController
{
return toAjax(scCastrateService.deleteScCastrateByIds(ids));
}
@GetMapping("/search_ear_numbers")
public AjaxResult searchEarNumbers(@RequestParam("query") String query){
return success(scCastrateService.searchEarNumbers(query.trim()));
}
}

View File

@@ -107,7 +107,10 @@ public class ScFixHoofController extends BaseController
return toAjax(scFixHoofService.deleteScFixHoofByIds(ids));
}
@GetMapping("/search_ear_numbers")
public AjaxResult searchEarNumbers(@RequestParam("query") String query){
return success(scFixHoofService.searchEarNumbers(query.trim()));
}
}

View File

@@ -7,6 +7,8 @@ import lombok.NoArgsConstructor;
import com.zhyc.common.annotation.Excel;
import com.zhyc.common.core.domain.BaseEntity;
import java.util.List;
/**
* 去势对象 sc_castrate
*
@@ -72,5 +74,6 @@ public class ScCastrate extends BaseEntity {
@JsonFormat(pattern = "yyyy-MM-dd")
private String eventDate;
/** 前端多耳号查询条件,非表字段 */
private List<String> manageTagsList;
}

View File

@@ -7,6 +7,8 @@ import lombok.NoArgsConstructor;
import com.zhyc.common.annotation.Excel;
import com.zhyc.common.core.domain.BaseEntity;
import java.util.List;
/**
* 修蹄对象 sc_fix_hoof
*
@@ -62,4 +64,7 @@ public class ScFixHoof extends BaseEntity
@Excel(name = "事件日期", width = 15, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private String eventDate;
/** 前端多耳号查询条件,非表字段 */
private List<String> manageTagsList;
}

View File

@@ -4,6 +4,7 @@ import java.util.List;
import com.zhyc.module.produce.other.domain.ScCastrate;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 去势Mapper接口
@@ -61,4 +62,14 @@ public interface ScCastrateMapper
* @return 结果
*/
public int deleteScCastrateByIds(Long[] ids);
/**
* 模糊搜索耳号
*/
List<String> searchEarNumbers(@Param("query") String query);
/* 列表查询支持多耳号模糊 */
List<ScCastrate> selectScCastrateList(
@Param("sc") ScCastrate sc,
@Param("manageTagsList") List<String> manageTagsList);
}

View File

@@ -4,6 +4,7 @@ import java.util.List;
import com.zhyc.module.produce.other.domain.ScFixHoof;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 修蹄Mapper接口
@@ -61,5 +62,13 @@ public interface ScFixHoofMapper {
*/
public int deleteScFixHoofByIds(Integer[] ids);
/**
*模糊搜索耳号
*/
List<String> searchEarNumbers(@Param("query") String query);
/* 列表查询支持多耳号模糊 */
List<ScFixHoof> selectScFixHoofList(
@Param("sc") ScFixHoof sc,
@Param("manageTagsList") List<String> manageTagsList);
}

View File

@@ -59,5 +59,5 @@ public interface IScCastrateService {
*/
public int deleteScCastrateById(Long id);
List<String> searchEarNumbers(String query);
}

View File

@@ -67,5 +67,5 @@ public interface IScFixHoofService {
*/
Long findIdByManageTags(String manageTags);
List<String> searchEarNumbers(String query);
}

View File

@@ -44,7 +44,8 @@ public class ScCastrateServiceImpl implements IScCastrateService {
*/
@Override
public List<ScCastrate> selectScCastrateList(ScCastrate scCastrate) {
return scCastrateMapper.selectScCastrateList(scCastrate);
return scCastrateMapper.selectScCastrateList(scCastrate,
scCastrate.getManageTagsList());
}
/**
@@ -105,4 +106,10 @@ public class ScCastrateServiceImpl implements IScCastrateService {
public int deleteScCastrateById(Long id) {
return scCastrateMapper.deleteScCastrateById(id);
}
@Override
public List<String> searchEarNumbers(String query) {
return scCastrateMapper.searchEarNumbers(query.trim());
}
}

View File

@@ -51,9 +51,11 @@ public class ScFixHoofServiceImpl implements IScFixHoofService {
*/
@Override
public List<ScFixHoof> selectScFixHoofList(ScFixHoof scFixHoof) {
return scFixHoofMapper.selectScFixHoofList(scFixHoof);
return scFixHoofMapper.selectScFixHoofList(scFixHoof,
scFixHoof.getManageTagsList());
}
/**
* 新增修蹄
*
@@ -118,5 +120,8 @@ public class ScFixHoofServiceImpl implements IScFixHoofService {
return sheep.getId();
}
@Override
public List<String> searchEarNumbers(String query) {
return scFixHoofMapper.searchEarNumbers(query.trim());
}
}

View File

@@ -44,6 +44,7 @@ public class WorkOrderController extends BaseController
{
startPage();
List<WorkOrder> list = workOrderService.selectWorkOrderList(workOrder);
return getDataTable(list);
}

View File

@@ -42,6 +42,8 @@ public class WorkOrder extends BaseEntity
/** 业务类型1免疫 2保健 3转群 4称重 5配种 6干奶 7淘汰 8消毒 9饲喂必填 */
@Excel(name = "业务类型1免疫 2保健 3转群 4称重 5配种 6干奶 7淘汰 8消毒 9饲喂必填")
private Integer bizType;
private String bizTypes;
private Integer [] bizTypeArray;
/** 简短任务标 */
@Excel(name = "简短任务标")
@@ -100,10 +102,14 @@ public class WorkOrder extends BaseEntity
/** 状态0待派工 1已派工 2执行中 3已完成 4已取消 5异常必填 */
@Excel(name = "状态0待派工 1已派工 2执行中 3已完成 4已取消 5异常必填")
private Integer status;
private String statuss;
private Integer [] statusArray;
/** 优先级1普通 2重要 3紧急必填 */
@Excel(name = "优先级1普通 2重要 3紧急必填")
private Integer priority;
private String prioritys;
private Integer [] priorityArray;
/** 派工人用户 */
@Excel(name = "派工人用户")
@@ -113,8 +119,8 @@ public class WorkOrder extends BaseEntity
private String issuer;
/** 派工时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "派工时间", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "派工时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date issueTime;
/** 接工人用户 */
@@ -125,13 +131,13 @@ public class WorkOrder extends BaseEntity
private String receiver;
/** 接工时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "接工时间", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "接工时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date receiveTime;
/** 实际完成时间,可空 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "实际完成时间,可空", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "实际完成时间,可空", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date finishTime;
/** 执行结果填报,可空 */

View File

@@ -43,9 +43,44 @@ public class WorkOrderServiceImpl implements IWorkOrderService
public List<WorkOrder> selectWorkOrderList(WorkOrder workOrder)
{
String username = SecurityUtils.getLoginUser().getUser().getNickName();
// 业务类型处理
if (workOrder.getBizTypes() != null && !workOrder.getBizTypes().isEmpty() &&
!workOrder.getBizTypes().equals("0")) {
String[] bizTypeStrs = workOrder.getBizTypes().split(",");
Integer[] bizTypes = new Integer[bizTypeStrs.length];
for (int i = 0; i < bizTypeStrs.length; i++) {
bizTypes[i] = Integer.parseInt(bizTypeStrs[i].trim());
}
workOrder.setBizTypeArray(bizTypes);
}
// 优先级处理
if (workOrder.getPrioritys() != null && !workOrder.getPrioritys().isEmpty() &&
!workOrder.getPrioritys().equals("0")) {
String[] priorityStrs = workOrder.getPrioritys().split(",");
Integer[] prioritys = new Integer[priorityStrs.length];
for (int i = 0; i < priorityStrs.length; i++) {
prioritys[i] = Integer.parseInt(priorityStrs[i].trim());
}
workOrder.setPriorityArray(prioritys);
}
// 状态处理
if (workOrder.getStatuss() != null && !workOrder.getStatuss().isEmpty() &&
!workOrder.getStatuss().equals("0")) {
String[] statusStrs = workOrder.getStatuss().split(",");
Integer[] statuss = new Integer[statusStrs.length];
for (int i = 0; i < statusStrs.length; i++) {
statuss[i] = Integer.parseInt(statusStrs[i].trim());
}
workOrder.setStatusArray(statuss);
}
return workOrderMapper.selectWorkOrderList(workOrder);
}
/**
* 新增派工单
*

View File

@@ -90,6 +90,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="statusId != null "> and status_id = #{statusId}</if>
<if test="breed != null and breed != ''"> and breed = #{breed}</if>
</where>
ORDER BY id ASC <!-- 修改为升序 -->
</select>
<select id="selectSheepFileById" parameterType="Long" resultMap="SheepFileResult">
@@ -260,7 +261,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</if>
</where>
ORDER BY id DESC
ORDER BY id ASC
</select>
<!-- &lt;!&ndash; 查询所有公羊gender=2 &ndash;&gt;-->

View File

@@ -36,6 +36,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
<if test="sheepId != null">and sheep_id = #{sheepId}</if>
<if test="sheepNo != null and sheepNo != ''">and bs.manage_tags like concat('%',#{sheepNo},'%')</if>
<if test="sheepNos != null and sheepNos.length > 0">
AND (
<foreach collection="sheepNos" item="item" separator=" OR " open="" close="">
bs.manage_tags LIKE CONCAT('%', #{item}, '%')
</foreach>
)
</if>
<if test="params.beginDatetime != null and params.beginDatetime != '' and params.endDatetime != null and params.endDatetime != ''">
and datetime between #{params.beginDatetime} and #{params.endDatetime}
</if>

View File

@@ -45,6 +45,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
<if test="sheepId != null "> and sd.sheep_id = #{sheepId}</if>
<if test="sheepNo != null"> and sf.bs_manage_tags like concat('%', #{sheepNo}, '%')</if>
<if test="sheepNos != null and sheepNos.length > 0">
AND (
<foreach collection="sheepNos" item="item" separator=" OR " open="" close="">
bs.manage_tags LIKE CONCAT('%', #{item}, '%')
</foreach>
)
</if>
<if test="params.beginDatetime != null and params.beginDatetime != '' and params.endDatetime != null and params.endDatetime != ''"> and datetime between #{params.beginDatetime} and #{params.endDatetime}</if>
<if test="diseasePid != null "> and disease_pid = #{diseasePid}</if>
<if test="diseaseId != null "> and disease_id = #{diseaseId}</if>

View File

@@ -43,6 +43,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
<if test="datetime != null "> and datetime = #{datetime}</if>
<if test="sheepNo != null and sheepNo != ''">and bs.manage_tags like concat('%',#{sheepNo},'%')</if>
<if test="sheepNos != null and sheepNos.length > 0">
AND (
<foreach collection="sheepNos" item="item" separator=" OR " open="" close="">
bs.manage_tags LIKE CONCAT('%', #{item}, '%')
</foreach>
)
</if>
<if test="params.beginDatetime != null and params.beginDatetime != '' and params.endDatetime != null and params.endDatetime != ''"> and datetime between #{params.beginDatetime} and #{params.endDatetime}</if>
<if test="technical != null and technical != ''"> and technical = #{technical}</if>
</where>

View File

@@ -41,6 +41,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="sheepId != null "> and sheep_id = #{sheepId}</if>
<if test="sheepType != null "> and sheep_type = #{sheepType}</if>
<if test="sheepNo != null and sheepNo != ''">and bs.manage_tags like concat('%',#{sheepNo},'%')</if>
<if test="sheepNos != null and sheepNos.length > 0">
AND (
<foreach collection="sheepNos" item="item" separator=" OR " open="" close="">
bs.manage_tags LIKE CONCAT('%', #{item}, '%')
</foreach>
)
</if>
<if test="params.beginDatetime != null and params.beginDatetime != '' and params.endDatetime != null and params.endDatetime != ''"> and datetime between #{params.beginDatetime} and #{params.endDatetime}</if>
<if test="technical != null and technical != ''"> and technical = #{technical}</if>
</where>

View File

@@ -45,7 +45,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectQuarantineReportVo"/>
<where>
<if test="sheepId != null "> and sheep_id = #{sheepId}</if>
<if test="sheepNo != null and sheepNo != ''">and bs.manage_tags like concat('%',#{sheepNo},'%')</if>
<if test="params.beginDatetime != null and params.beginDatetime != '' and params.endDatetime != null and params.endDatetime != ''"> and datetime between #{params.beginDatetime} and #{params.endDatetime}</if>
<if test="sheepNos != null and sheepNos.length > 0">
AND (
<foreach collection="sheepNos" item="item" separator=" OR " open="" close="">
bs.manage_tags LIKE CONCAT('%', #{item}, '%')
</foreach>
)
</if>
<if test="quarItem != null "> and quar_item = #{quarItem}</if>
<if test="sampleType != null "> and sample_type = #{sampleType}</if>
<if test="sampler != null and sampler != ''"> and sampler like concat('%',#{sampler},'%') </if>

View File

@@ -55,6 +55,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
<if test="sheepId != null "> and sheep_id = #{sheepId}</if>
<if test="sheepNo != null and sheepNo != ''">and bs.manage_tags like concat('%',#{sheepNo},'%')</if>
<if test="sheepNos != null and sheepNos.length > 0">
AND (
<foreach collection="sheepNos" item="item" separator=" OR " open="" close="">
bs.manage_tags LIKE CONCAT('%', #{item}, '%')
</foreach>
)
</if>
<if test="params.beginDatetime != null and params.beginDatetime != '' and params.endDatetime != null and params.endDatetime != ''"> and datetime between #{params.beginDatetime} and #{params.endDatetime}</if>
<if test="diseaseId != null "> and disease_id = #{diseaseId}</if>
<if test="status != null and status !=''"> and status = #{status}</if>

View File

@@ -11,7 +11,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="postCode" column="post_code" />
</resultMap>
<select id="getUserPostListByCode" resultMap="UserResult">
<select id="getUserListByCode" resultMap="UserResult">
SELECT u.user_id, nick_name , post_name , post_code
FROM sys_role r
JOIN sys_user_role ur ON r.role_id = ur.role_id

View File

@@ -19,9 +19,9 @@
<select id="selectSgFeedListList" parameterType="SgFeedList" resultMap="SgFeedListResult">
<include refid="selectSgFeedListVo"/>
<where>
<if test="formulaId != null and formulaId != ''"> and formula_id = #{formulaId}</if>
<if test="formulaBatchId != null and formulaBatchId != ''"> and formula_batch_id = #{formulaBatchId}</if>
<if test="zookeeper != null and zookeeper != ''"> and zookeeper = #{zookeeper}</if>
<if test="formulaId != null and formulaId != ''"> and formula_id LIKE CONCAT('%',#{formulaId},'%')</if>
<if test="formulaBatchId != null and formulaBatchId != ''"> and formula_batch_id LIKE CONCAT('%',#{formulaBatchId},'%')</if>
<if test="zookeeper != null and zookeeper != ''"> and zookeeper LIKE CONCAT('%',#{zookeeper},'%')</if>
<if test="deployDate != null "> and deploy_date = #{deployDate}</if>
</where>
ORDER BY deploy_date ASC, formula_id ASC, formula_batch_id ASC

View File

@@ -36,9 +36,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectSgFeedPlanList" parameterType="SgFeedPlan" resultMap="SgFeedPlanResult">
<include refid="selectSgFeedPlanVo"/>
<where>
<if test="formulaId != null and formulaId != ''"> and formula_id = #{formulaId}</if>
<if test="batchId != null and batchId != ''"> and batch_id = #{batchId}</if>
<if test="sheepHouseId != null "> and sheep_house_id = #{sheepHouseId}</if>
<if test="formulaId != null and formulaId != ''"> and formula_id LIKE CONCAT('%',#{formulaId},'%')</if>
<if test="batchId != null and batchId != ''"> and batch_id LIKE CONCAT('%',#{batchId},'%')</if>
<if test="sheepHouseId != null "> and sheep_house_id LIKE CONCAT('%',#{sheepHouseId},'%')</if>
<if test="planDate != null "> and plan_date = #{planDate}</if>
</where>
ORDER BY plan_date ASC, formula_id ASC , batch_id ASC

View File

@@ -31,8 +31,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectSgFeedStatisticList" parameterType="SgFeedStatistic" resultMap="SgFeedStatisticResult">
<include refid="selectSgFeedStatisticVo"/>
<where>
<if test="formulaId != null and formulaId != ''"> and formula_id = #{formulaId}</if>
<if test="formulaBatchId != null and formulaBatchId != ''"> and formula_batch_id = #{formulaBatchId}</if>
<if test="formulaId != null and formulaId != ''"> and formula_id LIKE CONCAT('%',#{formulaId},'%')</if>
<if test="formulaBatchId != null and formulaBatchId != ''"> and formula_batch_id = LIKE CONCAT('%',#{formulaBatchId},'%')</if>
<if test="silageLossRate != null and silageLossRate != ''"> and silage_loss_rate = #{silageLossRate}</if>
</where>
</select>

View File

@@ -22,9 +22,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectSgFormulaListList" parameterType="SgFormulaList" resultMap="SgFormulaListResult">
<include refid="selectSgFormulaListVo"/>
<where>
<if test="materialId != null and materialId != ''">material_id = #{materialId}</if>
<if test="formulaId != null and formulaId != ''">and formula_id = #{formulaId}</if>
<if test="batchId != null and batchId != ''"> and batch_id = #{batchId}</if>
<if test="materialId != null and materialId != ''">material_id LIKE CONCAT('%',#{materialId},'%')</if>
<if test="formulaId != null and formulaId != ''">and formula_id LIKE CONCAT('%',#{formulaId},'%')</if>
<if test="batchId != null and batchId != ''"> and batch_id LIKE CONCAT('%',#{batchId},'%')</if>
</where>
</select>

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