Merge remote-tracking branch 'origin/main'

# Conflicts:
#	zhyc-module/src/main/java/com/zhyc/module/produce/breed/controller/ScDryMilkController.java
#	zhyc-module/src/main/java/com/zhyc/module/produce/breed/controller/ScSheepDeathController.java
#	zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/ScDryMilk.java
#	zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/ScSheepDeath.java
#	zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/ScWeanRecord.java
#	zhyc-module/src/main/java/com/zhyc/module/produce/breed/mapper/ScDryMilkMapper.java
#	zhyc-module/src/main/java/com/zhyc/module/produce/breed/mapper/ScSheepDeathMapper.java
#	zhyc-module/src/main/java/com/zhyc/module/produce/breed/mapper/ScWeanRecordMapper.java
#	zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/IScDryMilkService.java
#	zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/IScSheepDeathService.java
#	zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/IScWeanRecordService.java
#	zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/impl/ScDryMilkServiceImpl.java
#	zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/impl/ScSheepDeathServiceImpl.java
#	zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/impl/ScWeanRecordServiceImpl.java
#	zhyc-module/src/main/resources/mapper/produce/breed/ScDryMilkMapper.xml
#	zhyc-module/src/main/resources/mapper/produce/breed/ScSheepDeathMapper.xml
This commit is contained in:
ll
2026-02-03 21:54:19 +08:00
182 changed files with 4186 additions and 1085 deletions

View File

@@ -190,7 +190,7 @@
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>${poi.version}</version>
<version>4.1.2</version>
</dependency>
<!-- POI 相关依赖 -->

View File

@@ -76,6 +76,9 @@ public class SysDeptController extends BaseController
@PostMapping
public AjaxResult add(@Validated @RequestBody SysDept dept)
{
if (!deptService.checkRanchName(dept)){
return error("新增部门'" + dept.getDeptName() + "'失败,牧场名称已存在");
}
if (!deptService.checkDeptNameUnique(dept))
{
return error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");

View File

@@ -11,7 +11,7 @@ import java.lang.annotation.Target;
*
* @author ruoyi
*/
@Target(ElementType.METHOD)
@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface DataScope

View File

@@ -31,6 +31,10 @@ public class SysDept extends BaseEntity
/** 部门名称 */
private String deptName;
/** 牧场id */
private Long ranchId;
private String ranchName;
/** 显示顺序 */
private Integer orderNum;
@@ -55,6 +59,22 @@ public class SysDept extends BaseEntity
/** 子部门 */
private List<SysDept> children = new ArrayList<SysDept>();
public String getRanchName() {
return ranchName;
}
public void setRanchName(String ranchName) {
this.ranchName = ranchName;
}
public Long getRanchId() {
return ranchId;
}
public void setRanchId(Long ranchId) {
this.ranchId = ranchId;
}
public Long getDeptId()
{
return deptId;

View File

@@ -0,0 +1,36 @@
package com.zhyc.common.core.domain.entity;
import com.zhyc.common.core.domain.BaseEntity;
/**
* 牧场管理对象 da_ranch
*
* @author ruoyi
* @date 2025-07-22
*/
public class SysRanch extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** 牧场名称 */
private String ranch;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getRanch() {
return ranch;
}
public void setRanch(String ranch) {
this.ranch = ranch;
}
}

View File

@@ -111,10 +111,12 @@ public class SecurityConfig
.authorizeHttpRequests((requests) -> {
permitAllUrl.getUrls().forEach(url -> requests.antMatchers(url).permitAll());
// 对于登录login 注册register 验证码captchaImage 允许匿名访问
requests.antMatchers("/login", "/register", "/captchaImage").permitAll()
requests.antMatchers("/app/**").permitAll()
.antMatchers("/login", "/register", "/captchaImage").permitAll()
// 静态资源,可匿名访问
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
// 除上面外的所有请求全部需要鉴权认证
.anyRequest().authenticated();
})

View File

@@ -14,8 +14,8 @@ import com.zhyc.common.utils.SecurityUtils;
import com.zhyc.framework.security.context.AuthenticationContextHolder;
/**
* 登录密码方法
*
* 系统密码服务类,用于处理登录密码验证相关的业务逻辑,包括密码错误次数限制、账户锁定等功能
*
* @author ruoyi
*/
@Component
@@ -31,8 +31,8 @@ public class SysPasswordService
private int lockTime;
/**
* 登录账户密码错误次数缓存键名
*
* 构建登录账户密码错误次数缓存键名
*
* @param username 用户名
* @return 缓存键key
*/
@@ -41,12 +41,21 @@ public class SysPasswordService
return CacheConstants.PWD_ERR_CNT_KEY + username;
}
/**
* 验证用户登录信息,包括密码匹配验证和错误次数限制检查
*
* @param user 待验证的系统用户对象
* @throws UserPasswordRetryLimitExceedException 当密码错误次数超过限制时抛出异常
* @throws UserPasswordNotMatchException 当密码不匹配时抛出异常
*/
public void validate(SysUser user)
{
// 获取当前认证的用户名和密码
Authentication usernamePasswordAuthenticationToken = AuthenticationContextHolder.getContext();
String username = usernamePasswordAuthenticationToken.getName();
String password = usernamePasswordAuthenticationToken.getCredentials().toString();
// 从Redis缓存中获取该用户的密码错误次数
Integer retryCount = redisCache.getCacheObject(getCacheKey(username));
if (retryCount == null)
@@ -54,28 +63,44 @@ public class SysPasswordService
retryCount = 0;
}
// 检查是否达到最大重试次数限制
if (retryCount >= Integer.valueOf(maxRetryCount).intValue())
{
throw new UserPasswordRetryLimitExceedException(maxRetryCount, lockTime);
}
// 验证密码是否匹配
if (!matches(user, password))
{
// 密码不匹配时,增加错误次数并更新缓存
retryCount = retryCount + 1;
redisCache.setCacheObject(getCacheKey(username), retryCount, lockTime, TimeUnit.MINUTES);
throw new UserPasswordNotMatchException();
}
else
{
// 密码匹配成功,清除登录记录缓存
clearLoginRecordCache(username);
}
}
/**
* 验证原始密码与用户存储密码是否匹配
*
* @param user 系统用户对象
* @param rawPassword 原始密码字符串
* @return 密码匹配返回true否则返回false
*/
public boolean matches(SysUser user, String rawPassword)
{
return SecurityUtils.matchesPassword(rawPassword, user.getPassword());
}
/**
* 清除指定登录名的登录记录缓存
*
* @param loginName 登录用户名
*/
public void clearLoginRecordCache(String loginName)
{
if (redisCache.hasKey(getCacheKey(loginName)))

View File

@@ -54,7 +54,7 @@ public class UserDetailsServiceImpl implements UserDetailsService
throw new ServiceException(MessageUtils.message("user.blocked"));
}
passwordService.validate(user);
// passwordService.validate(user);
return createLoginUser(user);
}

View File

@@ -155,6 +155,56 @@
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<!-- Spring Boot Web 核心依赖(提供接口能力) -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- Tesseract-OCR Java 封装(无需手动操作命令行,简化开发) -->
<dependency>
<groupId>net.sourceforge.tess4j</groupId>
<artifactId>tess4j</artifactId>
<version>4.5.4</version>
</dependency>
<!-- 文件上传相关依赖Spring Boot 内置,指定版本兼容) -->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.4</version>
</dependency>
<!-- 可选lombok 简化实体类代码(无需手写 getter/setter -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
</dependency>
<!-- Spring Boot 测试核心依赖(包含 @SpringBootTest 等注解) -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope> <!-- 仅在测试环境生效,不打包到生产环境,不可省略 -->
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-test</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,106 @@
package com.zhyc.module.app.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.zhyc.module.app.domain.AppErrorLog;
import com.zhyc.module.app.service.IAppErrorLogService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zhyc.common.annotation.Log;
import com.zhyc.common.core.controller.BaseController;
import com.zhyc.common.core.domain.AjaxResult;
import com.zhyc.common.enums.BusinessType;
import com.zhyc.common.utils.poi.ExcelUtil;
import com.zhyc.common.core.page.TableDataInfo;
/**
* App错误日志Controller
*
* @author ruoyi
* @date 2026-01-19
*/
@RestController
@RequestMapping("/app/error")
public class AppErrorLogController extends BaseController
{
@Autowired
private IAppErrorLogService appErrorLogService;
/**
* 查询App错误日志列表
*/
// @PreAuthorize("@ss.hasPermi('app:app:list')")
@GetMapping("/list")
public TableDataInfo list(AppErrorLog appErrorLog)
{
startPage();
List<AppErrorLog> list = appErrorLogService.selectAppErrorLogList(appErrorLog);
return getDataTable(list);
}
/**
* 导出App错误日志列表
*/
// @PreAuthorize("@ss.hasPermi('app:app:export')")
@Log(title = "App错误日志", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, AppErrorLog appErrorLog)
{
List<AppErrorLog> list = appErrorLogService.selectAppErrorLogList(appErrorLog);
ExcelUtil<AppErrorLog> util = new ExcelUtil<AppErrorLog>(AppErrorLog.class);
util.exportExcel(response, list, "App错误日志数据");
}
/**
* 获取App错误日志详细信息
*/
// @PreAuthorize("@ss.hasPermi('app:app:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(appErrorLogService.selectAppErrorLogById(id));
}
/**
* 新增App错误日志
*/
// @PreAuthorize("@ss.hasPermi('app:app:add')")
@Log(title = "App错误日志", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody AppErrorLog appErrorLog)
{
return toAjax(appErrorLogService.insertAppErrorLog(appErrorLog));
}
/**
* 修改App错误日志
*/
// @PreAuthorize("@ss.hasPermi('app:app:edit')")
@Log(title = "App错误日志", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody AppErrorLog appErrorLog)
{
return toAjax(appErrorLogService.updateAppErrorLog(appErrorLog));
}
/**
* 删除App错误日志
*/
// @PreAuthorize("@ss.hasPermi('app:app:remove')")
@Log(title = "App错误日志", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(appErrorLogService.deleteAppErrorLogByIds(ids));
}
}

View File

@@ -0,0 +1,106 @@
package com.zhyc.module.app.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.zhyc.module.app.domain.AppSettings;
import com.zhyc.module.app.service.IAppSettingsService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zhyc.common.annotation.Log;
import com.zhyc.common.core.controller.BaseController;
import com.zhyc.common.core.domain.AjaxResult;
import com.zhyc.common.enums.BusinessType;
import com.zhyc.common.utils.poi.ExcelUtil;
import com.zhyc.common.core.page.TableDataInfo;
/**
* 应用设置Controller
*
* @author ruoyi
* @date 2026-01-20
*/
@RestController
@RequestMapping("/app/settings")
public class AppSettingsController extends BaseController
{
@Autowired
private IAppSettingsService appSettingsService;
/**
* 查询应用设置列表
*/
// @PreAuthorize("@ss.hasPermi('app:settings:list')")
@GetMapping("/list")
public TableDataInfo list(AppSettings appSettings)
{
startPage();
List<AppSettings> list = appSettingsService.selectAppSettingsList(appSettings);
return getDataTable(list);
}
/**
* 导出应用设置列表
*/
// @PreAuthorize("@ss.hasPermi('app:settings:export')")
@Log(title = "应用设置", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, AppSettings appSettings)
{
List<AppSettings> list = appSettingsService.selectAppSettingsList(appSettings);
ExcelUtil<AppSettings> util = new ExcelUtil<AppSettings>(AppSettings.class);
util.exportExcel(response, list, "应用设置数据");
}
/**
* 获取应用设置详细信息
*/
// @PreAuthorize("@ss.hasPermi('app:settings:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(appSettingsService.selectAppSettingsById(id));
}
/**
* 新增应用设置
*/
// @PreAuthorize("@ss.hasPermi('app:settings:add')")
@Log(title = "应用设置", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody AppSettings appSettings)
{
return toAjax(appSettingsService.insertAppSettings(appSettings));
}
/**
* 修改应用设置
*/
// @PreAuthorize("@ss.hasPermi('app:settings:edit')")
@Log(title = "应用设置", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody AppSettings appSettings)
{
return toAjax(appSettingsService.updateAppSettings(appSettings));
}
/**
* 删除应用设置
*/
// @PreAuthorize("@ss.hasPermi('app:settings:remove')")
@Log(title = "应用设置", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(appSettingsService.deleteAppSettingsByIds(ids));
}
}

View File

@@ -0,0 +1,96 @@
package com.zhyc.module.app.domain;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
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;
/**
* App错误日志对象 app_error_log
*
* @author ruoyi
* @date 2026-01-19
*/
@EqualsAndHashCode(callSuper = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
public class AppErrorLog extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键ID自增 */
private Long id;
/** 设备唯一标识 */
@Excel(name = "设备唯一标识")
private String deviceId;
/** 用户ID */
@Excel(name = "用户ID")
private Long userId;
/** App版本号 */
@Excel(name = "App版本号")
private String appVersion;
/** App版本号 */
@Excel(name = "App版本号")
private Long appCode;
/** 平台类型 */
@Excel(name = "平台类型")
private String platform;
/** 操作系统版本 */
@Excel(name = "操作系统版本")
private String osVersion;
/** 错误类型分类 */
@Excel(name = "错误类型分类")
private String errorType;
/** 错误代码 */
@Excel(name = "错误代码")
private String errorCode;
/** 错误描述信息 */
@Excel(name = "错误描述信息")
private String errorMessage;
/** 错误堆栈跟踪 */
@Excel(name = "错误堆栈跟踪")
private String stackTrace;
/** 页面路径 */
@Excel(name = "页面路径")
private String pageUrl;
/** API接口地址 */
@Excel(name = "API接口地址")
private String apiUrl;
/** API调用参数 */
@Excel(name = "API调用参数")
private String apiParams;
/** 网络类型 */
@Excel(name = "网络类型")
private String networkType;
/** 屏幕宽度 */
@Excel(name = "屏幕宽度")
private Long screenWidth;
/** 屏幕高度 */
@Excel(name = "屏幕高度")
private Long screenHeight;
/** 自定义扩展数据JSON格式 */
@Excel(name = "自定义扩展数据JSON格式")
private String customData;
}

View File

@@ -0,0 +1,71 @@
package com.zhyc.module.app.domain;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zhyc.common.annotation.Excel;
import com.zhyc.common.core.domain.BaseEntity;
/**
* 应用设置对象 app_settings
*
* @author ruoyi
* @date 2026-01-20
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class AppSettings extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键ID */
private Long id;
/** 用户ID0为全局 */
@Excel(name = "用户ID0为全局")
private Long userId;
/** 设置键名 */
@Excel(name = "设置键名")
private String settingKey;
/** 设置 */
@Excel(name = "设置")
private String settingValue;
/** 值类型 */
@Excel(name = "值类型")
private String settingType;
/** 设置分组 */
@Excel(name = "设置分组")
private String settingGroup;
/** 设置描述 */
@Excel(name = "设置描述")
private String settingDesc;
/** 适用平台 */
@Excel(name = "适用平台")
private String platform;
/** 适用版本范围 */
@Excel(name = "适用版本范围")
private String versionRange;
/** 状态 */
@Excel(name = "状态")
private Integer status;
/** 逻辑位 */
@Excel(name = "逻辑位")
private Integer logical;
/** 自定义扩展数据JSON格式 */
@Excel(name = "自定义扩展数据JSON格式")
private String customData;
}

View File

@@ -0,0 +1,64 @@
package com.zhyc.module.app.mapper;
import java.util.List;
import com.zhyc.module.app.domain.AppErrorLog;
import org.apache.ibatis.annotations.Mapper;
/**
* App错误日志Mapper接口
*
* @author ruoyi
* @date 2026-01-19
*/
@Mapper
public interface AppErrorLogMapper
{
/**
* 查询App错误日志
*
* @param id App错误日志主键
* @return App错误日志
*/
public AppErrorLog selectAppErrorLogById(Long id);
/**
* 查询App错误日志列表
*
* @param appErrorLog App错误日志
* @return App错误日志集合
*/
public List<AppErrorLog> selectAppErrorLogList(AppErrorLog appErrorLog);
/**
* 新增App错误日志
*
* @param appErrorLog App错误日志
* @return 结果
*/
public int insertAppErrorLog(AppErrorLog appErrorLog);
/**
* 修改App错误日志
*
* @param appErrorLog App错误日志
* @return 结果
*/
public int updateAppErrorLog(AppErrorLog appErrorLog);
/**
* 删除App错误日志
*
* @param id App错误日志主键
* @return 结果
*/
public int deleteAppErrorLogById(Long id);
/**
* 批量删除App错误日志
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteAppErrorLogByIds(Long[] ids);
}

View File

@@ -0,0 +1,62 @@
package com.zhyc.module.app.mapper;
import com.zhyc.module.app.domain.AppSettings;
import java.util.List;
/**
* 应用设置Mapper接口
*
* @author ruoyi
* @date 2026-01-20
*/
public interface AppSettingsMapper
{
/**
* 查询应用设置
*
* @param id 应用设置主键
* @return 应用设置
*/
public AppSettings selectAppSettingsById(Long id);
/**
* 查询应用设置列表
*
* @param appSettings 应用设置
* @return 应用设置集合
*/
public List<AppSettings> selectAppSettingsList(AppSettings appSettings);
/**
* 新增应用设置
*
* @param appSettings 应用设置
* @return 结果
*/
public int insertAppSettings(AppSettings appSettings);
/**
* 修改应用设置
*
* @param appSettings 应用设置
* @return 结果
*/
public int updateAppSettings(AppSettings appSettings);
/**
* 删除应用设置
*
* @param id 应用设置主键
* @return 结果
*/
public int deleteAppSettingsById(Long id);
/**
* 批量删除应用设置
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteAppSettingsByIds(Long[] ids);
}

View File

@@ -0,0 +1,62 @@
package com.zhyc.module.app.service;
import com.zhyc.module.app.domain.AppErrorLog;
import java.util.List;
/**
* App错误日志Service接口
*
* @author ruoyi
* @date 2026-01-19
*/
public interface IAppErrorLogService
{
/**
* 查询App错误日志
*
* @param id App错误日志主键
* @return App错误日志
*/
public AppErrorLog selectAppErrorLogById(Long id);
/**
* 查询App错误日志列表
*
* @param appErrorLog App错误日志
* @return App错误日志集合
*/
public List<AppErrorLog> selectAppErrorLogList(AppErrorLog appErrorLog);
/**
* 新增App错误日志
*
* @param appErrorLog App错误日志
* @return 结果
*/
public int insertAppErrorLog(AppErrorLog appErrorLog);
/**
* 修改App错误日志
*
* @param appErrorLog App错误日志
* @return 结果
*/
public int updateAppErrorLog(AppErrorLog appErrorLog);
/**
* 批量删除App错误日志
*
* @param ids 需要删除的App错误日志主键集合
* @return 结果
*/
public int deleteAppErrorLogByIds(Long[] ids);
/**
* 删除App错误日志信息
*
* @param id App错误日志主键
* @return 结果
*/
public int deleteAppErrorLogById(Long id);
}

View File

@@ -0,0 +1,63 @@
package com.zhyc.module.app.service;
import com.zhyc.module.app.domain.AppSettings;
import java.util.List;
/**
* 应用设置Service接口
*
* @author ruoyi
* @date 2026-01-20
*/
public interface IAppSettingsService
{
/**
* 查询应用设置
*
* @param id 应用设置主键
* @return 应用设置
*/
public AppSettings selectAppSettingsById(Long id);
/**
* 查询应用设置列表
*
* @param appSettings 应用设置
* @return 应用设置集合
*/
public List<AppSettings> selectAppSettingsList(AppSettings appSettings);
/**
* 新增应用设置
*
* @param appSettings 应用设置
* @return 结果
*/
public int insertAppSettings(AppSettings appSettings);
/**
* 修改应用设置
*
* @param appSettings 应用设置
* @return 结果
*/
public int updateAppSettings(AppSettings appSettings);
/**
* 批量删除应用设置
*
* @param ids 需要删除的应用设置主键集合
* @return 结果
*/
public int deleteAppSettingsByIds(Long[] ids);
/**
* 删除应用设置信息
*
* @param id 应用设置主键
* @return 结果
*/
public int deleteAppSettingsById(Long id);
}

View File

@@ -0,0 +1,97 @@
package com.zhyc.module.app.service.impl;
import java.util.List;
import com.zhyc.common.utils.DateUtils;
import com.zhyc.module.app.domain.AppErrorLog;
import com.zhyc.module.app.mapper.AppErrorLogMapper;
import com.zhyc.module.app.service.IAppErrorLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* App错误日志Service业务层处理
*
* @author ruoyi
* @date 2026-01-19
*/
@Service
public class AppErrorLogServiceImpl implements IAppErrorLogService
{
@Autowired
private AppErrorLogMapper appErrorLogMapper;
/**
* 查询App错误日志
*
* @param id App错误日志主键
* @return App错误日志
*/
@Override
public AppErrorLog selectAppErrorLogById(Long id)
{
return appErrorLogMapper.selectAppErrorLogById(id);
}
/**
* 查询App错误日志列表
*
* @param appErrorLog App错误日志
* @return App错误日志
*/
@Override
public List<AppErrorLog> selectAppErrorLogList(AppErrorLog appErrorLog)
{
return appErrorLogMapper.selectAppErrorLogList(appErrorLog);
}
/**
* 新增App错误日志
*
* @param appErrorLog App错误日志
* @return 结果
*/
@Override
public int insertAppErrorLog(AppErrorLog appErrorLog)
{
appErrorLog.setCreateTime(DateUtils.getNowDate());
return appErrorLogMapper.insertAppErrorLog(appErrorLog);
}
/**
* 修改App错误日志
*
* @param appErrorLog App错误日志
* @return 结果
*/
@Override
public int updateAppErrorLog(AppErrorLog appErrorLog)
{
return appErrorLogMapper.updateAppErrorLog(appErrorLog);
}
/**
* 批量删除App错误日志
*
* @param ids 需要删除的App错误日志主键
* @return 结果
*/
@Override
public int deleteAppErrorLogByIds(Long[] ids)
{
return appErrorLogMapper.deleteAppErrorLogByIds(ids);
}
/**
* 删除App错误日志信息
*
* @param id App错误日志主键
* @return 结果
*/
@Override
public int deleteAppErrorLogById(Long id)
{
return appErrorLogMapper.deleteAppErrorLogById(id);
}
}

View File

@@ -0,0 +1,96 @@
package com.zhyc.module.app.service.impl;
import java.util.List;
import com.zhyc.common.utils.DateUtils;
import com.zhyc.module.app.domain.AppSettings;
import com.zhyc.module.app.mapper.AppSettingsMapper;
import com.zhyc.module.app.service.IAppSettingsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* 应用设置Service业务层处理
*
* @author ruoyi
* @date 2026-01-20
*/
@Service
public class AppSettingsServiceImpl implements IAppSettingsService
{
@Autowired
private AppSettingsMapper appSettingsMapper;
/**
* 查询应用设置
*
* @param id 应用设置主键
* @return 应用设置
*/
@Override
public AppSettings selectAppSettingsById(Long id)
{
return appSettingsMapper.selectAppSettingsById(id);
}
/**
* 查询应用设置列表
*
* @param appSettings 应用设置
* @return 应用设置
*/
@Override
public List<AppSettings> selectAppSettingsList(AppSettings appSettings)
{
return appSettingsMapper.selectAppSettingsList(appSettings);
}
/**
* 新增应用设置
*
* @param appSettings 应用设置
* @return 结果
*/
@Override
public int insertAppSettings(AppSettings appSettings)
{
appSettings.setCreateTime(DateUtils.getNowDate());
return appSettingsMapper.insertAppSettings(appSettings);
}
/**
* 修改应用设置
*
* @param appSettings 应用设置
* @return 结果
*/
@Override
public int updateAppSettings(AppSettings appSettings)
{
appSettings.setUpdateTime(DateUtils.getNowDate());
return appSettingsMapper.updateAppSettings(appSettings);
}
/**
* 批量删除应用设置
*
* @param ids 需要删除的应用设置主键
* @return 结果
*/
@Override
public int deleteAppSettingsByIds(Long[] ids)
{
return appSettingsMapper.deleteAppSettingsByIds(ids);
}
/**
* 删除应用设置信息
*
* @param id 应用设置主键
* @return 结果
*/
@Override
public int deleteAppSettingsById(Long id)
{
return appSettingsMapper.deleteAppSettingsById(id);
}
}

View File

@@ -46,6 +46,18 @@ public class BasSheepController extends BaseController {
return getDataTable(list);
}
//查询耳号列表
@GetMapping("/earNumbers")
public AjaxResult searchEarNumbers(@RequestParam("query") String query) {
try {
List<String> earNumbers =basSheepService.searchEarNumbers(query);
return success(earNumbers);
} catch (Exception e) {
logger.error("搜索耳号异常", e);
return error("搜索耳号失败:" + e.getMessage());
}
}
/**
* 导出羊只基本信息列表
*/
@@ -125,7 +137,6 @@ public class BasSheepController extends BaseController {
}
BasSheep query = new BasSheep();
query.setTypeId(typeId.longValue());
startPage();
List<BasSheep> list = basSheepService.selectBasSheepList(query);
return getDataTable(list);
}
@@ -142,7 +153,6 @@ public class BasSheepController extends BaseController {
BasSheep query = new BasSheep();
query.setSheepfoldId(sheepfoldId.longValue());
query.setTypeId(typeId.longValue());
startPage();
List<BasSheep> list = basSheepService.selectBasSheepList(query);
return getDataTable(list);
}
@@ -179,7 +189,6 @@ public class BasSheepController extends BaseController {
return success(result);
}
/**
* 判断耳号是否存在(用于新增羊只时校验)
*/

View File

@@ -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);

View File

@@ -8,6 +8,7 @@ import com.zhyc.common.enums.BusinessType;
import com.zhyc.common.utils.poi.ExcelUtil;
import com.zhyc.module.base.domain.BasSheep;
import com.zhyc.module.base.domain.DaSheepfold;
import com.zhyc.module.base.domain.DaSheepfoldSummaryExportVO;
import com.zhyc.module.base.service.IDaSheepfoldService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
@@ -44,6 +45,17 @@ public class DaSheepfoldController extends BaseController
List<DaSheepfold> list = daSheepfoldService.selectDaSheepfoldList(daSheepfold);
return getDataTable(list);
}
/**
* 主表格:羊舍级别汇总列表
*/
@GetMapping("/summaryList")
public TableDataInfo summaryList(DaSheepfold daSheepfold) {
startPage();
List<DaSheepfold> list = daSheepfoldService.selectDaSheepfoldSummaryList(daSheepfold);
return getDataTable(list);
}
/*
* 根据羊舍ids查询羊只id
* */
@@ -69,6 +81,73 @@ public class DaSheepfoldController extends BaseController
util.exportExcel(response, list, "羊舍管理数据");
}
/**
* 导出羊舍管理汇总列表(主表格数据)- 新增方法
*/
@PreAuthorize("@ss.hasPermi('sheepfold_management:sheepfold_management:export')")
@Log(title = "羊舍管理汇总导出", businessType = BusinessType.EXPORT)
@PostMapping("/exportSummary")
public void exportSummary(HttpServletResponse response, DaSheepfold daSheepfold) {
// 1. 查询汇总数据
List<DaSheepfold> list = daSheepfoldService.selectDaSheepfoldSummaryList(daSheepfold);
// 2. 转换为导出VO
List<DaSheepfoldSummaryExportVO> exportList = convertToExportVO(list);
// 3. 使用VO类导出Excel
ExcelUtil<DaSheepfoldSummaryExportVO> util = new ExcelUtil<>(DaSheepfoldSummaryExportVO.class);
util.exportExcel(response, exportList, "羊舍管理汇总数据");
}
/**
* 将DaSheepfold列表转换为导出VO列表
*/
private List<DaSheepfoldSummaryExportVO> convertToExportVO(List<DaSheepfold> daSheepfoldList) {
List<DaSheepfoldSummaryExportVO> voList = new ArrayList<>();
for (DaSheepfold entity : daSheepfoldList) {
DaSheepfoldSummaryExportVO vo = new DaSheepfoldSummaryExportVO();
// 字典翻译牧场ID -> 牧场名称
if (entity.getRanchId() != null) {
String ranchName = DictUtils.getDictLabel("da_ranch", entity.getRanchId().toString());
vo.setRanchName(ranchName != null ? ranchName : entity.getRanchId().toString());
} else {
vo.setRanchName("");
}
// 使用汇总查询中的羊舍名称
vo.setSheepfoldName(entity.getSheepfoldName() != null ? entity.getSheepfoldName() : "");
// 字典翻译羊舍类型ID -> 羊舍类型名称
if (entity.getSheepfoldTypeId() != null) {
String typeName = DictUtils.getDictLabel("bas_sheepfold_type", entity.getSheepfoldTypeId().toString());
vo.setSheepfoldTypeName(typeName != null ? typeName : entity.getSheepfoldTypeId().toString());
} else {
vo.setSheepfoldTypeName("");
}
// 羊舍编号
vo.setSheepfoldNo(entity.getSheepfoldNo() != null ? entity.getSheepfoldNo() : "");
// 羊数(确保不为空)
vo.setTotalSheepCount(entity.getTotalSheepCount() != null ? entity.getTotalSheepCount() : 0);
// 备注
vo.setComment(entity.getComment() != null ? entity.getComment() : "");
voList.add(vo);
}
return voList;
}
/**
* 获取羊舍管理详细信息
*/
@@ -101,16 +180,74 @@ public class DaSheepfoldController extends BaseController
return toAjax(daSheepfoldService.updateDaSheepfold(daSheepfold));
}
// /**
// * 删除羊舍管理
// */
// @PreAuthorize("@ss.hasPermi('sheepfold_management:sheepfold_management:remove')")
// @Log(title = "羊舍管理", businessType = BusinessType.DELETE)
// @DeleteMapping("/{ids}")
// public AjaxResult remove(@PathVariable Long[] ids)
// {
// return toAjax(daSheepfoldService.deleteDaSheepfoldByIds(ids));
// }
/**
* 删除羊舍管理
* 修改后:根据组合条件删除羊圈信息(单条)
* 接收ranch_id/sheepfold_no/sheepfold_type_id/sheepfold_name组合条件
*/
@PreAuthorize("@ss.hasPermi('sheepfold_management:sheepfold_management:remove')")
@Log(title = "羊舍管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(daSheepfoldService.deleteDaSheepfoldByIds(ids));
@PreAuthorize("@ss.hasPermi('sheep:sheepfold:remove')")
@DeleteMapping("/deleteByCondition")
public AjaxResult removeByCondition(@RequestBody DaSheepfold sheepfold) {
// 1. 校验核心条件非空(避免条件缺失导致误删)
if (sheepfold.getRanchId() == null
|| sheepfold.getSheepfoldNo() == null || sheepfold.getSheepfoldNo().isEmpty()
|| sheepfold.getSheepfoldTypeId() == null) {
return AjaxResult.error("删除失败核心条件牧场ID/羊圈编号/羊圈类型ID不能为空");
}
// 2. 调用Service执行组合条件删除
boolean deleteResult = daSheepfoldService.deleteSheepfoldByCondition(sheepfold);
if (deleteResult) {
return AjaxResult.success("删除成功");
} else {
return AjaxResult.error("删除失败:未找到匹配条件的记录");
}
}
/**
* 【扩展】批量删除:接收多条组合条件数据,循环删除
*/
@PreAuthorize("@ss.hasPermi('sheep:sheepfold:remove')")
@DeleteMapping("/batchDeleteByCondition")
public AjaxResult batchRemoveByCondition(@RequestBody List<DaSheepfold> sheepfoldList) {
if (sheepfoldList == null || sheepfoldList.isEmpty()) {
return AjaxResult.error("删除失败:请选择要删除的羊圈数据");
}
// 统计成功删除的数量
int successCount = 0;
for (DaSheepfold sheepfold : sheepfoldList) {
// 跳过条件不全的记录
if (sheepfold.getRanchId() == null
|| sheepfold.getSheepfoldNo() == null || sheepfold.getSheepfoldNo().isEmpty()
|| sheepfold.getSheepfoldTypeId() == null) {
continue;
}
if (daSheepfoldService.deleteSheepfoldByCondition(sheepfold)) {
successCount++;
}
}
if (successCount == 0) {
return AjaxResult.error("批量删除失败:无符合条件的记录可删除");
} else {
return AjaxResult.success("批量删除成功,共删除" + successCount + "条记录");
}
}
/**
* 检查羊舍编号是否已存在
*/

View File

@@ -115,5 +115,10 @@ public class DaSheepfold extends BaseEntity
@Excel(name = "备注")
private String comment;
// 非数据库字段:单栏位羊数(子表格用)
private Integer sheepCount;
// 非数据库字段:羊舍总羊数(主表格用)
private Integer totalSheepCount;
}

View File

@@ -0,0 +1,55 @@
package com.zhyc.module.base.domain;
import com.zhyc.common.annotation.Excel;
import com.zhyc.common.core.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 羊舍汇总导出VO
*/
@Data
public class DaSheepfoldSummaryExportVO {
/** 牧场名称 */
@Excel(name = "牧场")
private String ranchName;
/** 羊舍名称 */
@Excel(name = "羊舍名称")
private String sheepfoldName;
/** 羊舍类型名称 */
@Excel(name = "羊舍类型")
private String sheepfoldTypeName;
/** 羊舍编号 */
@Excel(name = "羊舍编号")
private String sheepfoldNo;
/** 羊舍总羊数 */
@Excel(name = "羊数")
private Integer totalSheepCount;
/** 备注 */
@Excel(name = "备注")
private String comment;
// 构造函数
public DaSheepfoldSummaryExportVO() {
}
public DaSheepfoldSummaryExportVO(String ranchName, String sheepfoldName,
String sheepfoldTypeName, String sheepfoldNo,
Integer totalSheepCount, String comment) {
this.ranchName = ranchName;
this.sheepfoldName = sheepfoldName;
this.sheepfoldTypeName = sheepfoldTypeName;
this.sheepfoldNo = sheepfoldNo;
this.totalSheepCount = totalSheepCount;
this.comment = comment;
}
}

View File

@@ -0,0 +1,28 @@
// 创建文件ExportConfig.java
package com.zhyc.module.base.domain;
import lombok.Data;
import java.util.List;
import java.util.Map;
/**
* 导出配置类
*/
@Data
public class ExportConfig {
/**
* 要导出的列名列表(前端传递的驼峰命名)
*/
private List<String> columnNames;
/**
* 查询条件
*/
private Map<String, Object> queryParams;
/**
* 自定义筛选条件
*/
private Map<String, Object> customFilterParams;
}

View File

@@ -70,6 +70,15 @@ public interface BasSheepMapper
BasSheep selectBasSheepByManageTags(String manageTags);
/**
* 模糊查询母羊耳号列表
*
* @param query 查询关键字
* @return 耳号列表
*/
List<String> searchEarNumbers(@Param("query") String query);
List<BasSheep> selectBasSheepBySheepfold(String id);
// 根据牧场ID获取羊只列表

View File

@@ -2,6 +2,7 @@ package com.zhyc.module.base.mapper;
import com.zhyc.module.base.domain.DaSheepfold;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -30,6 +31,12 @@ public interface DaSheepfoldMapper
*/
public List<DaSheepfold> selectDaSheepfoldList(DaSheepfold daSheepfold);
/**
* 羊舍级别汇总查询(主表格)
*/
List<DaSheepfold> selectDaSheepfoldSummaryList(DaSheepfold daSheepfold);
/**
* 新增羊舍管理
*
@@ -63,5 +70,13 @@ public interface DaSheepfoldMapper
public int deleteDaSheepfoldByIds(Long[] ids);
public int selectCount(DaSheepfold daSheepfold);
// 新增:按组合条件删除的自定义方法(核心)
int deleteSheepfoldByCondition(
@Param("ranchId") Long ranchId,
@Param("sheepfoldNo") String sheepfoldNo,
@Param("sheepfoldTypeId") Long sheepfoldTypeId
);
}

View File

@@ -28,6 +28,13 @@ public interface IBasSheepService
*/
public List<BasSheep> selectBasSheepList(BasSheep basSheep);
/**
* 羊只查询耳号信息
*
* @param earNumbers 耳号
* @return 结果
*/
public List<String> searchEarNumbers(String earNumbers);
/**
* 新增羊只基本信息
*

View File

@@ -29,6 +29,8 @@ public interface IDaSheepfoldService
*/
public List<DaSheepfold> selectDaSheepfoldList(DaSheepfold daSheepfold);
public List<DaSheepfold> selectDaSheepfoldSummaryList(DaSheepfold daSheepfold);
/**
* 新增羊舍管理
*
@@ -73,4 +75,8 @@ public interface IDaSheepfoldService
// 根据羊舍id获取该羊舍的羊
List<BasSheep> sheepListById(String id);
/** 新增:根据组合条件删除羊圈记录 */
boolean deleteSheepfoldByCondition(DaSheepfold sheepfold);
}

View File

@@ -1,6 +1,8 @@
package com.zhyc.module.base.service.impl;
import java.util.List;
import com.zhyc.common.annotation.DataScope;
import com.zhyc.common.utils.DateUtils;
import com.zhyc.module.base.domain.BasSheep;
import com.zhyc.module.base.mapper.BasSheepMapper;
@@ -44,6 +46,17 @@ public class BasSheepServiceImpl implements IBasSheepService
return basSheepMapper.selectBasSheepList(basSheep);
}
/**
* 搜索羊只 earNumbers
*
* @param query
* @return
*/
@Override
@DataScope(deptAlias = "b", userAlias = "b")
public List<String> searchEarNumbers(String query) {
return basSheepMapper.searchEarNumbers(query);
}
/**
* 新增羊只基本信息
*

View File

@@ -1,32 +1,40 @@
package com.zhyc.module.base.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zhyc.module.base.domain.BasSheep;
import com.zhyc.module.base.domain.DaSheepfold;
import com.zhyc.module.base.mapper.BasSheepMapper;
import com.zhyc.module.base.mapper.DaSheepfoldMapper;
import com.zhyc.module.base.service.IDaSheepfoldService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import java.util.List;
/**
* 羊舍管理Service业务层处理
*
*
* @author wyt
* @date 2025-07-11
*/
@Service
public class DaSheepfoldServiceImpl implements IDaSheepfoldService
public class DaSheepfoldServiceImpl implements IDaSheepfoldService
{
@Autowired
private DaSheepfoldMapper daSheepfoldMapper;
@Autowired
private BasSheepMapper basSheepMapper;
// 日志对象
private static final Logger log = LoggerFactory.getLogger(DaSheepfoldServiceImpl.class);
/**
* 查询羊舍管理
*
*
* @param id 羊舍管理主键
* @return 羊舍管理
*/
@@ -38,19 +46,27 @@ public class DaSheepfoldServiceImpl implements IDaSheepfoldService
/**
* 查询羊舍管理列表
*
*
* @param daSheepfold 羊舍管理
* @return 羊舍管理
*/
@Override
public List<DaSheepfold> selectDaSheepfoldList(DaSheepfold daSheepfold)
{
return daSheepfoldMapper.selectDaSheepfoldList(daSheepfold);
List<DaSheepfold> sheepfoldList = daSheepfoldMapper.selectDaSheepfoldList(daSheepfold);
return sheepfoldList; // 修复原代码重复调用Mapper改为返回已查询的列表
}
/**
* 羊舍级别汇总查询(主表格)
*/
public List<DaSheepfold> selectDaSheepfoldSummaryList(DaSheepfold daSheepfold) {
return daSheepfoldMapper.selectDaSheepfoldSummaryList(daSheepfold);
}
/**
* 新增羊舍管理
*
*
* @param daSheepfold 羊舍管理
* @return 结果
*/
@@ -62,7 +78,7 @@ public class DaSheepfoldServiceImpl implements IDaSheepfoldService
/**
* 修改羊舍管理
*
*
* @param daSheepfold 羊舍管理
* @return 结果
*/
@@ -74,7 +90,7 @@ public class DaSheepfoldServiceImpl implements IDaSheepfoldService
/**
* 批量删除羊舍管理
*
*
* @param ids 需要删除的羊舍管理主键
* @return 结果
*/
@@ -86,7 +102,7 @@ public class DaSheepfoldServiceImpl implements IDaSheepfoldService
/**
* 删除羊舍管理信息
*
*
* @param id 羊舍管理主键
* @return 结果
*/
@@ -96,7 +112,6 @@ public class DaSheepfoldServiceImpl implements IDaSheepfoldService
return daSheepfoldMapper.deleteDaSheepfoldById(id);
}
@Override
public boolean checkSheepfoldNoExist(Long ranchId, Long sheepfoldTypeId, String sheepfoldNo) {
DaSheepfold query = new DaSheepfold();
@@ -111,4 +126,40 @@ public class DaSheepfoldServiceImpl implements IDaSheepfoldService
List<BasSheep> basSheep = basSheepMapper.selectBasSheepBySheepfold(id);
return basSheep;
}
}
/**
* 核心实现根据组合条件删除完全自定义无MP依赖
* 条件ranch_id = ? AND sheepfold_no = ? AND sheepfold_type_id = ?
*/
@Override
@Transactional(rollbackFor = Exception.class)
public boolean deleteSheepfoldByCondition(DaSheepfold sheepfold) {
// 1. 前置校验仅校验3个核心字段移除sheepfoldName的校验
if (sheepfold.getRanchId() == null
|| !StringUtils.hasText(sheepfold.getSheepfoldNo())
|| sheepfold.getSheepfoldTypeId() == null) {
log.error("删除失败核心条件不能为空牧场ID={}, 羊舍编号={}, 羊舍类型ID={}",
sheepfold.getRanchId(), sheepfold.getSheepfoldNo(), sheepfold.getSheepfoldTypeId());
throw new IllegalArgumentException("删除失败牧场ID、羊舍编号、羊舍类型ID不能为空");
}
// 2. 调用Mapper方法仅传递3个核心字段移除sheepfoldName
int deleteCount = daSheepfoldMapper.deleteSheepfoldByCondition(
sheepfold.getRanchId(),
sheepfold.getSheepfoldNo(),
sheepfold.getSheepfoldTypeId()
);
boolean isSuccess = deleteCount > 0;
// 3. 日志打印移除sheepfoldName相关内容
if (isSuccess) {
log.info("成功删除羊舍记录牧场ID={}, 羊舍编号={}, 羊舍类型ID={}",
sheepfold.getRanchId(), sheepfold.getSheepfoldNo(), sheepfold.getSheepfoldTypeId());
} else {
log.warn("未找到匹配条件的羊舍记录牧场ID={}, 羊舍编号={}, 羊舍类型ID={}",
sheepfold.getRanchId(), sheepfold.getSheepfoldNo(), sheepfold.getSheepfoldTypeId());
}
return isSuccess;
}
}

View File

@@ -78,7 +78,8 @@ public class DewormController extends BaseController
@PostMapping
public AjaxResult add(@RequestBody Deworm deworm)
{
System.out.println(deworm);
deworm.setDeptId(getDeptId());
deworm.setUserId(getUserId());
return toAjax(dewormService.insertDeworm(deworm));
}

View File

@@ -77,6 +77,8 @@ public class DiagnosisController extends BaseController
@PostMapping
public AjaxResult add(@RequestBody Diagnosis diagnosis)
{
diagnosis.setDeptId(getDeptId());
diagnosis.setUserId(getUserId());
return toAjax(diagnosisService.insertDiagnosis(diagnosis));
}

View File

@@ -78,6 +78,8 @@ public class DisinfectController extends BaseController
@PostMapping
public AjaxResult add(@RequestBody Disinfect disinfect)
{
disinfect.setDeptId(getDeptId());
disinfect.setUserId(getUserId());
return toAjax(disinfectService.insertDisinfect(disinfect));
}

View File

@@ -79,6 +79,8 @@ public class HealthController extends BaseController
@PostMapping
public AjaxResult add(@RequestBody Health health)
{
health.setDeptId(getDeptId());
health.setUserId(getUserId());
return toAjax(healthService.insertHealth(health));
}

View File

@@ -78,6 +78,8 @@ public class ImmunityController extends BaseController
@PostMapping
public AjaxResult add(@RequestBody Immunity immunity)
{
immunity.setDeptId(getDeptId());
immunity.setUserId(getUserId());
return toAjax(immunityService.insertImmunity(immunity));
}

View File

@@ -78,6 +78,8 @@ public class QuarantineReportController extends BaseController
@PostMapping
public AjaxResult add(@RequestBody QuarantineReport quarantineReport)
{
quarantineReport.setDeptId(getDeptId());
quarantineReport.setUserId(getUserId());
return toAjax(quarantineReportService.insertQuarantineReport(quarantineReport));
}

View File

@@ -84,6 +84,8 @@ public class SwMedicineUsageController extends BaseController
@PostMapping
public AjaxResult add(@RequestBody SwMedicineUsage swMedicineUsage)
{
swMedicineUsage.setDeptId(getDeptId());
swMedicineUsage.setUserId(getUserId());
return toAjax(swMedicineUsageService.insertSwMedicineUsage(swMedicineUsage));
}

View File

@@ -78,6 +78,8 @@ public class TreatmentController extends BaseController
@PostMapping
public AjaxResult add(@RequestBody Treatment treatment)
{
treatment.setDeptId(getDeptId());
treatment.setUserId(getUserId());
return toAjax(treatmentService.insertTreatment(treatment));
}

View File

@@ -35,6 +35,8 @@ public class Deworm extends BaseEntity
@Excel(name = "羊只耳号")
private String sheepNo;
private String[] sheepNos;
/** 全部羊耳号列表(用于多耳号查询) */
private List<String> allEarNumbers;
@Excel(name = "品种")
private String variety;
@@ -52,7 +54,8 @@ public class Deworm extends BaseEntity
@Excel(name = "胎次")
private Long parity;
private Long userId;
private Long deptId;
/** 药品使用记录 */
@Excel(name = "药品使用记录")
@@ -75,11 +78,9 @@ public class Deworm extends BaseEntity
@Excel(name = "备注")
private String comment;
// public void setGender(String gender) {
// this.gender = gender;
// this.genderName = Gender.getDescByCode(Integer.valueOf(gender));
// }
// 排序查询
private String orderByColumn;
private String isAsc;
}

View File

@@ -1,6 +1,8 @@
package com.zhyc.module.biosafety.domain;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zhyc.module.enums.Gender;
import lombok.AllArgsConstructor;
@@ -38,6 +40,9 @@ public class Diagnosis extends BaseEntity
@Excel(name = "羊只耳号")
private String sheepNo;
private String[] sheepNos;
/** 全部羊耳号列表(用于多耳号查询) */
private List<String> allEarNumbers;
private Long sheepId;
@@ -97,12 +102,26 @@ public class Diagnosis extends BaseEntity
private Long sheepfoldId;
public void setGender(String gender) {
this.gender = gender;
this.genderName = Gender.getDescByCode(Integer.valueOf(gender));
}
// 排序查询
private String orderByColumn;
private String isAsc;
private Long userId;
private Long deptId;
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

@@ -61,6 +61,9 @@ public class Disinfect extends BaseEntity
/** 药品名称用于查询*/
private String mediName;
private Long userId;
private Long deptId;
// 药品使用
private List<SwMedicineUsageDetails> usageDetails;

View File

@@ -31,13 +31,15 @@ public class Health extends BaseEntity
/** 羊只id */
@Excel(name = "羊只id")
private Long sheepId;
private Integer[] sheepIds;
/** 羊只id */
@Excel(name = "羊只耳号")
private String sheepNo;
private String[] sheepNos;
/** 全部羊耳号列表(用于多耳号查询) */
private List<String> allEarNumbers;
@Excel(name = "品种")
private String variety;
@@ -67,14 +69,29 @@ public class Health extends BaseEntity
@Excel(name = "备注")
private String comment;
private Long userId;
private Long deptId;
// 药品使用
private List<SwMedicineUsageDetails> usageDetails;
public void setGender(String gender) {
this.gender = gender;
this.genderName = Gender.getDescByCode(Integer.valueOf(gender));
}
// 排序查询
private String orderByColumn;
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

@@ -37,6 +37,9 @@ public class Immunity extends BaseEntity
@Excel(name = "羊只耳号")
private String sheepNo;
private String[] sheepNos;
/** 全部羊耳号列表(用于多耳号查询) */
private List<String> allEarNumbers;
@Excel(name = "品种")
@@ -75,14 +78,29 @@ public class Immunity extends BaseEntity
@Excel(name = "备注")
private String comment;
private Long userId;
private Long deptId;
// 药品使用
private List<SwMedicineUsageDetails> usageDetails;
public void setGender(String gender) {
this.gender = gender;
this.genderName = Gender.getDescByCode(Integer.valueOf(gender));
}
// 排序查询
private String orderByColumn;
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

@@ -1,6 +1,8 @@
package com.zhyc.module.biosafety.domain;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zhyc.module.enums.Gender;
import lombok.AllArgsConstructor;
@@ -37,6 +39,9 @@ public class QuarantineReport extends BaseEntity
@Excel(name = "羊只耳号")
private String sheepNo;
private String[] sheepNos;
/** 全部羊耳号列表(用于多耳号查询) */
private List<String> allEarNumbers;
@Excel(name = "羊只类别")
private String sheepType;
@@ -93,6 +98,9 @@ public class QuarantineReport extends BaseEntity
@Excel(name = "备注")
private String comment;
private Long userId;
private Long deptId;
public void setGender(String gender) {
this.gender = gender;
this.genderName = Gender.getDescByCode(Integer.valueOf(gender));

View File

@@ -38,6 +38,11 @@ public class SwMedicineUsage extends BaseEntity
/** 耳号 */
@Excel(name = "耳号",width = 20, needMerge = true)
private String sheepNo;
private String[] sheepNos;
/** 全部羊耳号列表(用于多耳号查询) */
private List<String> allEarNumbers;
private Integer sheepId;
/** 使用时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@@ -48,6 +53,9 @@ public class SwMedicineUsage extends BaseEntity
@Excel(name = "使用类型",width = 20, needMerge = true)
private String useType;
private Long userId;
private Long deptId;
/** 药品使用记录详情信息 */
@Excel
private List<SwMedicineUsageDetails> swMedicineUsageDetailsList;

View File

@@ -33,6 +33,9 @@ public class Treatment extends BaseEntity
@Excel(name = "羊只耳号")
private String sheepNo;
private String[] sheepNos;
/** 全部羊耳号列表(用于多耳号查询) */
private List<String> allEarNumbers;
private Long sheepId;
// 用于批量新增
@@ -101,6 +104,9 @@ public class Treatment extends BaseEntity
@Excel(name = "药品使用记录id")
private Integer usageId;
private Long userId;
private Long deptId;
// 药品使用
private List<SwMedicineUsageDetails> usageDetails;

View File

@@ -1,7 +1,10 @@
package com.zhyc.module.biosafety.service.impl;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.zhyc.common.annotation.DataScope;
import com.zhyc.common.utils.DateUtils;
import com.zhyc.common.utils.SecurityUtils;
import com.zhyc.common.utils.bean.BeanUtils;
@@ -57,17 +60,18 @@ public class DewormServiceImpl implements IDewormService
* @return 驱虫
*/
@Override
@DataScope(deptAlias = "s", userAlias = "s")
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()};
if (deworm.getSheepNo().contains(" ")) {
sheepNos = deworm.getSheepNo().split(" ");
deworm.setSheepNos(sheepNos);
deworm.setSheepNo(null);
}
}
deworm.setSheepNos(sheepNos);
return dewormMapper.selectDewormList(deworm);
}

View File

@@ -4,6 +4,7 @@ import java.util.Date;
import java.util.List;
import java.util.Objects;
import com.zhyc.common.annotation.DataScope;
import com.zhyc.common.utils.DateUtils;
import com.zhyc.common.utils.SecurityUtils;
import com.zhyc.module.base.domain.BasSheep;
@@ -60,14 +61,13 @@ public class DiagnosisServiceImpl implements IDiagnosisService
* @return 诊疗结果
*/
@Override
@DataScope(deptAlias = "sd", userAlias = "sd")
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()};
if (diagnosis.getSheepNo().contains(" ")) {
sheepNos = diagnosis.getSheepNo().split(" ");
}
}
diagnosis.setSheepNos(sheepNos);

View File

@@ -2,6 +2,8 @@ package com.zhyc.module.biosafety.service.impl;
import java.util.ArrayList;
import java.util.List;
import com.zhyc.common.annotation.DataScope;
import com.zhyc.common.utils.DateUtils;
import com.zhyc.common.utils.SecurityUtils;
import com.zhyc.common.utils.bean.BeanUtils;
@@ -59,6 +61,7 @@ public class DisinfectServiceImpl implements IDisinfectService
* @return 消毒记录
*/
@Override
@DataScope(deptAlias = "sd", userAlias = "sd")
public List<Disinfect> selectDisinfectList(Disinfect disinfect)
{
return disinfectMapper.selectDisinfectList(disinfect);

View File

@@ -5,6 +5,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import com.zhyc.common.annotation.DataScope;
import com.zhyc.common.utils.DateUtils;
import com.zhyc.common.utils.SecurityUtils;
import com.zhyc.common.utils.bean.BeanUtils;
@@ -62,14 +63,13 @@ public class HealthServiceImpl implements IHealthService
* @return 保健
*/
@Override
@DataScope(deptAlias = "s", userAlias = "s")
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()};
if (health.getSheepNo().contains(" ")) {
sheepNos = health.getSheepNo().split(" ");
}
}
health.setSheepNos(sheepNos);

View File

@@ -2,6 +2,8 @@ package com.zhyc.module.biosafety.service.impl;
import java.util.ArrayList;
import java.util.List;
import com.zhyc.common.annotation.DataScope;
import com.zhyc.common.utils.DateUtils;
import com.zhyc.common.utils.SecurityUtils;
import com.zhyc.common.utils.bean.BeanUtils;
@@ -61,14 +63,13 @@ public class ImmunityServiceImpl implements IImmunityService
* @return 免疫
*/
@Override
@DataScope(deptAlias = "s", userAlias = "s")
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()};
if (immunity.getSheepNo().contains(" ")) {
sheepNos = immunity.getSheepNo().split(" ");
}
}
immunity.setSheepNos(sheepNos);

View File

@@ -2,6 +2,7 @@ package com.zhyc.module.biosafety.service.impl;
import java.util.List;
import com.zhyc.common.annotation.DataScope;
import com.zhyc.module.biosafety.domain.QuarantineItems;
import com.zhyc.module.biosafety.mapper.QuarantineItemsMapper;
import com.zhyc.module.biosafety.service.IQuarantineItemsService;

View File

@@ -2,6 +2,8 @@ package com.zhyc.module.biosafety.service.impl;
import java.util.ArrayList;
import java.util.List;
import com.zhyc.common.annotation.DataScope;
import com.zhyc.common.utils.DateUtils;
import com.zhyc.common.utils.SecurityUtils;
import com.zhyc.common.utils.bean.BeanUtils;
@@ -46,14 +48,13 @@ public class QuarantineReportServiceImpl implements IQuarantineReportService
* @return 检疫记录
*/
@Override
@DataScope(deptAlias = "sqr", userAlias = "sqr")
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()};
if (quarantineReport.getSheepNo().contains(" ")) {
sheepNos = quarantineReport.getSheepNo().split(" ");
}
}
quarantineReport.setSheepNos(sheepNos);

View File

@@ -1,6 +1,8 @@
package com.zhyc.module.biosafety.service.impl;
import java.util.List;
import com.zhyc.common.annotation.DataScope;
import com.zhyc.common.utils.DateUtils;
import com.zhyc.common.utils.SecurityUtils;
import com.zhyc.module.biosafety.service.ISwMedicineUsageService;
@@ -44,8 +46,17 @@ public class SwMedicineUsageServiceImpl implements ISwMedicineUsageService
* @return 药品使用记录
*/
@Override
@DataScope(deptAlias = "smu", userAlias = "smu")
public List<SwMedicineUsage> selectSwMedicineUsageList(SwMedicineUsage swMedicineUsage)
{
String[] sheepNos = null;
if (swMedicineUsage.getSheepNo() != null && !swMedicineUsage.getSheepNo().isEmpty()) {
if (swMedicineUsage.getSheepNo().contains(" ")) {
sheepNos = swMedicineUsage.getSheepNo().split(" ");
swMedicineUsage.setSheepNos(sheepNos);
swMedicineUsage.setSheepNo(null);
}
}
return swMedicineUsageMapper.selectSwMedicineUsageList(swMedicineUsage);
}

View File

@@ -2,6 +2,8 @@ package com.zhyc.module.biosafety.service.impl;
import java.util.ArrayList;
import java.util.List;
import com.zhyc.common.annotation.DataScope;
import com.zhyc.common.utils.DateUtils;
import com.zhyc.common.utils.SecurityUtils;
import com.zhyc.common.utils.bean.BeanUtils;
@@ -65,6 +67,7 @@ public class TreatmentServiceImpl implements ITreatmentService
* @return 治疗记录
*/
@Override
@DataScope(deptAlias = "t", userAlias = "t")
public List<Treatment> selectTreatmentList(Treatment treatment)
{
String[] sheepNos = null;

View File

@@ -26,7 +26,9 @@ public class UserPostController {
// 根据岗位编码获取用户
@GetMapping("/getUser")
public AjaxResult getUserPost(String postCode){
List<User> list = userService.getUserListByCode(postCode);
User user = new User();
user.setPostCode(postCode);
List<User> list = userService.getUserListByCode(user);
return AjaxResult.success(list);
}

View File

@@ -0,0 +1,22 @@
package com.zhyc.module.common.domain;
import com.zhyc.common.core.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Dept extends BaseEntity {
private Long deptId;
private Long parentId;
private String ancestors;
private String deptName;
private String orderNum;
private String leader;
private String phone;
private String email;
private String status;
private String delFlag;
}

View File

@@ -1,6 +1,7 @@
package com.zhyc.module.common.domain;
import com.zhyc.common.annotation.Excel;
import com.zhyc.common.core.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@@ -8,7 +9,7 @@ import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Post {
public class Post extends BaseEntity {
/** 岗位序号 */
@Excel(name = "岗位序号", cellType = Excel.ColumnType.NUMERIC)

View File

@@ -1,5 +1,6 @@
package com.zhyc.module.common.domain;
import com.zhyc.common.core.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@@ -7,9 +8,10 @@ import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class User {
public class User extends BaseEntity {
// 用户id
private String userId;
private Long userId;
private Long deptId;
// 用户名
private String nickName;
// 岗位名称
@@ -17,4 +19,5 @@ public class User {
// 岗位编码
private String postCode;
}

View File

@@ -0,0 +1,15 @@
package com.zhyc.module.common.mapper;
import com.zhyc.module.common.domain.Dept;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;
@Mapper
public interface DeptMapper {
/**
* 根据部门ID查询其所属二级部门排除根部门
*/
Dept selectTopSecondLevelDept(Long deptId);
}

View File

@@ -8,5 +8,5 @@ import java.util.List;
@Mapper
public interface UserMapper {
List<User> getUserListByCode(String postCode);
List<User> getUserListByCode(User user);
}

View File

@@ -5,5 +5,5 @@ import com.zhyc.module.common.domain.User;
import java.util.List;
public interface UserService {
List<User> getUserListByCode(String postCode);
List<User> getUserListByCode(User postCode);
}

View File

@@ -1,6 +1,10 @@
package com.zhyc.module.common.service.impl;
import com.zhyc.common.annotation.DataScope;
import com.zhyc.common.utils.SecurityUtils;
import com.zhyc.module.common.domain.Dept;
import com.zhyc.module.common.domain.User;
import com.zhyc.module.common.mapper.DeptMapper;
import com.zhyc.module.common.mapper.UserMapper;
import com.zhyc.module.common.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
@@ -12,9 +16,16 @@ import java.util.List;
public class UserPostServiceImpl implements UserService {
@Autowired
UserMapper userMapper;
@Autowired
DeptMapper deptMapper;
@Override
public List<User> getUserListByCode(String postCode) {
return userMapper.getUserListByCode(postCode);
public List<User> getUserListByCode(User user) {
Long deptId = SecurityUtils.getLoginUser().getUser().getDeptId();
Dept secondLevel = deptMapper.selectTopSecondLevelDept(deptId);
user.setDeptId(secondLevel.getDeptId());
System.out.println(secondLevel);
return userMapper.getUserListByCode(user);
}
}

View File

@@ -109,6 +109,8 @@ public class SgFeedListController extends BaseController {
@Log(title = "配料清单", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SgFeedList sgFeedList) {
sgFeedList.setDeptId(getDeptId());
sgFeedList.setUserId(getUserId());
return toAjax(sgFeedListService.insertSgFeedList(sgFeedList));
}

View File

@@ -79,6 +79,8 @@ public class SgFeedPlanController extends BaseController {
if (null == sgFeedPlan) {
throw new RuntimeException("数据为空");
}
sgFeedPlan.setDeptId(getDeptId());
sgFeedPlan.setUserId(getUserId());
sgFeedPlan.setCreateDate(new Date());
// 计算其他字段值
setPlan(sgFeedPlan);

View File

@@ -84,6 +84,8 @@ public class SgFeedStatisticController extends BaseController {
if (null == sgFeedStatistic.getFormulaId() && null == sgFeedStatistic.getFormulaBatchId()) {
throw new RuntimeException("ERROR: 数据为空");
}
sgFeedStatistic.setUserId(getUserId());
sgFeedStatistic.setDeptId(getDeptId());
List<SgFeedStatistic> isExist = sgFeedStatisticService.selectSgFeedStatisticList(sgFeedStatistic);
if (null != isExist && !isExist.isEmpty()) {
throw new RuntimeException("WARNING: 数据重复");

View File

@@ -79,6 +79,8 @@ public class SgFormulaListController extends BaseController
@PostMapping
public AjaxResult add(@RequestBody SgFormulaList sgFormulaList)
{
sgFormulaList.setUserId(getUserId());
sgFormulaList.setDeptId(getDeptId());
return toAjax(sgFormulaListService.insertSgFormulaList(sgFormulaList));
}

View File

@@ -95,6 +95,8 @@ public class SgFormulaManagementController extends BaseController {
public AjaxResult add(@RequestBody SgFormulaManagement sgFormulaManagement) {
if (null == sgFormulaManagement)
throw new RuntimeException("ERROR: 数据为空");
sgFormulaManagement.setUserId(getUserId());
sgFormulaManagement.setDeptId(getDeptId());
if (Objects.equals(sgFormulaManagement.getBatchId(), "0")) {
SgFormulaManagement exist = sgFormulaManagementService.selectSgFormulaManagementByFormulaId(sgFormulaManagement.getFormulaId());
if (exist != null) {

View File

@@ -2,6 +2,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;
@@ -23,14 +24,13 @@ import com.zhyc.common.core.page.TableDataInfo;
/**
* 原料Controller
*
*
* @author HashMap
* @date 2026-01-16
*/
@RestController
@RequestMapping("/feed/material")
public class SgMaterialController extends BaseController
{
public class SgMaterialController extends BaseController {
@Autowired
private ISgMaterialService sgMaterialService;
@@ -39,8 +39,7 @@ public class SgMaterialController extends BaseController
*/
@PreAuthorize("@ss.hasPermi('feed:material:list')")
@GetMapping("/list")
public TableDataInfo list(SgMaterial sgMaterial)
{
public TableDataInfo list(SgMaterial sgMaterial) {
startPage();
List<SgMaterial> list = sgMaterialService.selectSgMaterialList(sgMaterial);
return getDataTable(list);
@@ -52,8 +51,7 @@ public class SgMaterialController extends BaseController
@PreAuthorize("@ss.hasPermi('feed:material:export')")
@Log(title = "原料", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SgMaterial sgMaterial)
{
public void export(HttpServletResponse response, SgMaterial sgMaterial) {
List<SgMaterial> list = sgMaterialService.selectSgMaterialList(sgMaterial);
ExcelUtil<SgMaterial> util = new ExcelUtil<SgMaterial>(SgMaterial.class);
util.exportExcel(response, list, "原料数据");
@@ -64,8 +62,7 @@ public class SgMaterialController extends BaseController
*/
@PreAuthorize("@ss.hasPermi('feed:material:query')")
@GetMapping(value = "/{materialId}")
public AjaxResult getInfo(@PathVariable("materialId") String materialId)
{
public AjaxResult getInfo(@PathVariable("materialId") String materialId) {
return success(sgMaterialService.selectSgMaterialByMaterialId(materialId));
}
@@ -75,8 +72,9 @@ public class SgMaterialController extends BaseController
@PreAuthorize("@ss.hasPermi('feed:material:add')")
@Log(title = "原料", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SgMaterial sgMaterial)
{
public AjaxResult add(@RequestBody SgMaterial sgMaterial) {
sgMaterial.setUserId(getUserId());
sgMaterial.setDeptId(getDeptId());
return toAjax(sgMaterialService.insertSgMaterial(sgMaterial));
}
@@ -86,8 +84,7 @@ public class SgMaterialController extends BaseController
@PreAuthorize("@ss.hasPermi('feed:material:edit')")
@Log(title = "原料", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SgMaterial sgMaterial)
{
public AjaxResult edit(@RequestBody SgMaterial sgMaterial) {
return toAjax(sgMaterialService.updateSgMaterial(sgMaterial));
}
@@ -96,9 +93,8 @@ public class SgMaterialController extends BaseController
*/
@PreAuthorize("@ss.hasPermi('feed:material:remove')")
@Log(title = "原料", businessType = BusinessType.DELETE)
@DeleteMapping("/{materialIds}")
public AjaxResult remove(@PathVariable String[] materialIds)
{
@DeleteMapping("/{materialIds}")
public AjaxResult remove(@PathVariable String[] materialIds) {
return toAjax(sgMaterialService.deleteSgMaterialByMaterialIds(materialIds));
}
}

View File

@@ -19,26 +19,36 @@ import com.zhyc.common.core.domain.BaseEntity;
*/
@Setter
@Getter
public class SgFeedList extends BaseEntity
{
public class SgFeedList extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 序号 */
private Long userId;
private Long deptId;
/**
* 序号
*/
private Long id;
/** 配方编号 */
/**
* 配方编号
*/
@Excel(name = "配方编号")
private String formulaId;
/** 配方批号 */
/**
* 配方批号
*/
@Excel(name = "配方批号")
private String formulaBatchId;
/** 饲草班人员 */
/**
* 饲草班人员
*/
@Excel(name = "饲草班人员")
private String zookeeper;
/** 配料日期 */
/**
* 配料日期
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "配料日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date deployDate;
@@ -51,14 +61,14 @@ public class SgFeedList extends BaseEntity
private Double noonTotal;
private Double afternoonTotal;
private List<SgFormulaList> formulaList;
private List<SgFormulaList> formulaList;
private List<SgFeedPlan> planList;
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("formulaId", getFormulaId())
.append("formulaBatchId", getFormulaBatchId())

View File

@@ -1,6 +1,7 @@
package com.zhyc.module.feed.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
@@ -11,125 +12,144 @@ import com.zhyc.common.core.domain.BaseEntity;
/**
* 饲喂计划对象 sg_feed_plan
*
*
* @author HashMap
* @date 2025-08-14
*/
@Getter
@Setter
public class SgFeedPlan extends BaseEntity
{
public class SgFeedPlan extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 创建日期 */
private Long userId;
private Long deptId;
/**
* 创建日期
*/
private Date createDate;
/** 配方编码 */
/**
* 配方编码
*/
@Excel(name = "配方编码")
private String formulaId;
/** 批号 */
/**
* 批号
*/
@Excel(name = "批号")
private String batchId;
/** 羊舍 */
/**
* 羊舍
*/
@Excel(name = "羊舍")
private Integer sheepHouseId;
/** 羊只数量 */
/**
* 羊只数量
*/
@Excel(name = "羊只数量")
private Integer sheepCount;
/** 日均计划量 */
/**
* 日均计划量
*/
@Excel(name = "日均计划量")
private Double planDailySize;
/** 饲喂比例(早) */
/**
* 饲喂比例(早)
*/
@Excel(name = "饲喂比例(早)")
private Double ratioMorning;
/** 饲喂比例(中) */
/**
* 饲喂比例(中)
*/
@Excel(name = "饲喂比例(中)")
private Double ratioNoon;
/** 饲喂比例(下) */
/**
* 饲喂比例(下)
*/
@Excel(name = "饲喂比例(下)")
private Double ratioAfternoon;
/** 计划量(早) */
/**
* 计划量(早)
*/
@Excel(name = "计划量(早)")
private Double planMorningSize;
/** 计划总量(早) */
/**
* 计划总量(早)
*/
@Excel(name = "计划总量(早)")
private Double planMorningTotal;
/** 实际量(早) */
/**
* 实际量(早)
*/
@Excel(name = "实际量(早)")
private Double actualMorningSize;
/** 计划量(中) */
/**
* 计划量(中)
*/
@Excel(name = "计划量(中)")
private Double planNoonSize;
/** 计划总量(中) */
/**
* 计划总量(中)
*/
@Excel(name = "计划总量(中)")
private Double planNoonTotal;
/** 实际量(中) */
/**
* 实际量(中)
*/
@Excel(name = "实际量(中)")
private Double actualNoonSize;
/** 计划量(下) */
/**
* 计划量(下)
*/
@Excel(name = "计划量(下)")
private Double planAfternoonSize;
/** 计划总量(下) */
/**
* 计划总量(下)
*/
@Excel(name = "计划总量(下)")
private Double planAfternoonTotal;
/** 实际量(下) */
/**
* 实际量(下)
*/
@Excel(name = "实际量(下)")
private Double actualAfternoonSize;
/** 计划饲喂总量 */
/**
* 计划饲喂总量
*/
@Excel(name = "计划饲喂总量")
private Double planFeedTotal;
/** 饲草班人员 */
/**
* 饲草班人员
*/
@Excel(name = "饲草班人员")
private String zookeeper;
/** 饲喂计划日期 */
/**
* 饲喂计划日期
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "饲喂计划日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date planDate;
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("createDate", getCreateDate())
.append("formulaId", getFormulaId())
.append("batchId", getBatchId())
.append("sheepHouseId", getSheepHouseId())
.append("sheepCount", getSheepCount())
.append("planDailySize", getPlanDailySize())
.append("ratioMorning", getRatioMorning())
.append("ratioNoon", getRatioNoon())
.append("ratioAfternoon", getRatioAfternoon())
.append("planMorningSize", getPlanMorningSize())
.append("planMorningTotal", getPlanMorningTotal())
.append("actualMorningSize", getActualMorningSize())
.append("planNoonSize", getPlanNoonSize())
.append("planNoonTotal", getPlanNoonTotal())
.append("actualNoonSize", getActualNoonSize())
.append("planAfternoonSize", getPlanAfternoonSize())
.append("planAfternoonTotal", getPlanAfternoonTotal())
.append("actualAfternoonSize", getActualAfternoonSize())
.append("planFeedTotal", getPlanFeedTotal())
.append("zookeeper", getZookeeper())
.append("planDate", getPlanDate())
.append("remark", getRemark())
.toString();
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("createDate", getCreateDate()).append("formulaId", getFormulaId()).append("batchId", getBatchId()).append("sheepHouseId", getSheepHouseId()).append("sheepCount", getSheepCount()).append("planDailySize", getPlanDailySize()).append("ratioMorning", getRatioMorning()).append("ratioNoon", getRatioNoon()).append("ratioAfternoon", getRatioAfternoon()).append("planMorningSize", getPlanMorningSize()).append("planMorningTotal", getPlanMorningTotal()).append("actualMorningSize", getActualMorningSize()).append("planNoonSize", getPlanNoonSize()).append("planNoonTotal", getPlanNoonTotal()).append("actualNoonSize", getActualNoonSize()).append("planAfternoonSize", getPlanAfternoonSize()).append("planAfternoonTotal", getPlanAfternoonTotal()).append("actualAfternoonSize", getActualAfternoonSize()).append("planFeedTotal", getPlanFeedTotal()).append("zookeeper", getZookeeper()).append("planDate", getPlanDate()).append("remark", getRemark()).toString();
}
}

View File

@@ -23,7 +23,8 @@ import java.util.List;
@Getter
public class SgFeedStatistic extends BaseEntity {
private static final long serialVersionUID = 1L;
private Long userId;
private Long deptId;
/**
* UUID
*/

View File

@@ -9,33 +9,45 @@ import com.zhyc.common.core.domain.BaseEntity;
/**
* 配方列表对象 sg_formula_list
*
*
* @author HashMap
* @date 2025-08-09
*/
@Setter
@Getter
public class SgFormulaList extends BaseEntity
{
public class SgFormulaList extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 序号 */
private Long userId;
private Long deptId;
/**
* 序号
*/
private Long code;
/** 配方编号 */
/**
* 配方编号
*/
private String formulaId;
/** 配方编号 */
/**
* 配方编号
*/
private String batchId;
/** 原料编号 */
/**
* 原料编号
*/
@Excel(name = "原料编号")
private String materialId;
/** 原料名称 */
/**
* 原料名称
*/
@Excel(name = "原料名称")
private String materialName;
/** 比例 */
/**
* 比例
*/
@Excel(name = "比例")
private Long ratio;
@@ -60,14 +72,14 @@ public class SgFormulaList extends BaseEntity
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("code", getCode())
.append("formulaId", getFormulaId())
.append("materialId", getMaterialId())
.append("materialName", getMaterialName())
.append("ratio", getRatio())
.append("isGranular", getIsGranular())
.append("isSupplement", getIsSupplement())
.toString();
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("code", getCode())
.append("formulaId", getFormulaId())
.append("materialId", getMaterialId())
.append("materialName", getMaterialName())
.append("ratio", getRatio())
.append("isGranular", getIsGranular())
.append("isSupplement", getIsSupplement())
.toString();
}
}

View File

@@ -13,67 +13,87 @@ import com.zhyc.common.core.domain.BaseEntity;
/**
* 配方管理对象 sg_formula_management
*
*
* @author HashMap
* @date 2025-08-09
*/
@Setter
@Getter
public class SgFormulaManagement extends BaseEntity
{
public class SgFormulaManagement extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 配方编号 */
private Long userId;
private Long deptId;
/**
* 配方编号
*/
private String formulaId;
/** 饲养阶段 */
/**
* 饲养阶段
*/
@Excel(name = "饲养阶段")
private String feedStage;
/** 批号 */
/**
* 批号
*/
@Excel(name = "批号")
private String batchId;
/** 开始使用时间 */
/**
* 开始使用时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "开始使用时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date useStartDate;
/** 结束使用时间 */
/**
* 结束使用时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "结束使用时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date useEndDate;
/** 使用状态 */
/**
* 使用状态
*/
@Excel(name = "使用状态")
private String useState;
/** 备注 */
/**
* 备注
*/
@Excel(name = "备注")
private String remark;
/** 配方列表 */
private List<SgFormulaList> sgFormulaList;
/**
* 配方列表
*/
private List<SgFormulaList> sgFormulaList;
/** 子配方 */
/**
* 子配方
*/
private List<SgFormulaManagement> subFormulaList;
/** 查询类型 *
/**
* 查询类型 *
* Sub : 子配方查询
* query : 类型查询
* */
*
*/
private String queryType;
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("formulaId", getFormulaId())
.append("feedStage", getFeedStage())
.append("batchId", getBatchId())
.append("useStartDate", getUseStartDate())
.append("useEndDate", getUseEndDate())
.append("useState", getUseState())
.append("remark", getRemark())
.toString();
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("formulaId", getFormulaId())
.append("feedStage", getFeedStage())
.append("batchId", getBatchId())
.append("useStartDate", getUseStartDate())
.append("useEndDate", getUseEndDate())
.append("useState", getUseState())
.append("remark", getRemark())
.toString();
}
}

View File

@@ -1,5 +1,6 @@
package com.zhyc.module.feed.domain;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zhyc.common.annotation.Excel;
@@ -7,62 +8,59 @@ import com.zhyc.common.core.domain.BaseEntity;
/**
* 原料对象 sg_material
*
*
* @author HashMap
* @date 2026-01-16
*/
public class SgMaterial extends BaseEntity
{
@Data
public class SgMaterial extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 原料编码 */
private Long userId;
private Long deptId;
/**
* 原料编码
*/
@Excel(name = "原料编码")
private String materialId;
/** 原料名称 */
/**
* 原料名称
*/
@Excel(name = "原料名称")
private String materialName;
/** 颗粒料 */
/**
* 颗粒料
*/
@Excel(name = "颗粒料")
private Integer isGranular;
public void setMaterialId(String materialId)
{
public void setMaterialId(String materialId) {
this.materialId = materialId;
}
public String getMaterialId()
{
public String getMaterialId() {
return materialId;
}
public void setMaterialName(String materialName)
{
public void setMaterialName(String materialName) {
this.materialName = materialName;
}
public String getMaterialName()
{
public String getMaterialName() {
return materialName;
}
public void setIsGranular(Integer isGranular)
{
public void setIsGranular(Integer isGranular) {
this.isGranular = isGranular;
}
public Integer getIsGranular()
{
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();
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("materialId", getMaterialId()).append("materialName", getMaterialName()).append("isGranular", getIsGranular()).toString();
}
}

View File

@@ -2,6 +2,7 @@ package com.zhyc.module.feed.service.impl;
import java.util.*;
import com.zhyc.common.annotation.DataScope;
import com.zhyc.module.feed.domain.SgFeedPlan;
import com.zhyc.module.feed.domain.SgFormulaManagement;
import com.zhyc.module.feed.service.ISgFeedPlanService;
@@ -56,6 +57,7 @@ public class SgFeedListServiceImpl implements ISgFeedListService {
* @return 配料清单
*/
@Override
@DataScope(deptAlias = "sg_feed_list_alias", userAlias = "sg_feed_list_alias")
public List<SgFeedList> selectSgFeedListList(SgFeedList sgFeedList) {
return sgFeedListMapper.selectSgFeedListList(sgFeedList);
}

View File

@@ -3,6 +3,7 @@ package com.zhyc.module.feed.service.impl;
import java.util.Date;
import java.util.List;
import com.zhyc.common.annotation.DataScope;
import org.springframework.stereotype.Service;
import com.zhyc.module.feed.mapper.SgFeedPlanMapper;
import com.zhyc.module.feed.domain.SgFeedPlan;
@@ -11,14 +12,13 @@ import org.springframework.transaction.annotation.Transactional;
/**
* 饲喂计划Service业务层处理
*
*
* @author HashMap
* @date 2025-08-14
*/
@Service
@Transactional(rollbackFor=Exception.class)
public class SgFeedPlanServiceImpl implements ISgFeedPlanService
{
@Transactional(rollbackFor = Exception.class)
public class SgFeedPlanServiceImpl implements ISgFeedPlanService {
private final SgFeedPlanMapper sgFeedPlanMapper;
public SgFeedPlanServiceImpl(SgFeedPlanMapper sgFeedPlanMapper) {
@@ -27,73 +27,68 @@ public class SgFeedPlanServiceImpl implements ISgFeedPlanService
/**
* 查询饲喂计划
*
*
* @param createDate 饲喂计划主键
* @return 饲喂计划
*/
@Override
public SgFeedPlan selectSgFeedPlanByCreateDate(Date createDate)
{
public SgFeedPlan selectSgFeedPlanByCreateDate(Date createDate) {
return sgFeedPlanMapper.selectSgFeedPlanByCreateDate(createDate);
}
/**
* 查询饲喂计划列表
*
*
* @param sgFeedPlan 饲喂计划
* @return 饲喂计划
*/
@Override
public List<SgFeedPlan> selectSgFeedPlanList(SgFeedPlan sgFeedPlan)
{
@DataScope(deptAlias = "sg_feed_plan_alias", userAlias = "sg_feed_plan_alias")
public List<SgFeedPlan> selectSgFeedPlanList(SgFeedPlan sgFeedPlan) {
return sgFeedPlanMapper.selectSgFeedPlanList(sgFeedPlan);
}
/**
* 新增饲喂计划
*
*
* @param sgFeedPlan 饲喂计划
* @return 结果
*/
@Override
public int insertSgFeedPlan(SgFeedPlan sgFeedPlan)
{
public int insertSgFeedPlan(SgFeedPlan sgFeedPlan) {
return sgFeedPlanMapper.insertSgFeedPlan(sgFeedPlan);
}
/**
* 修改饲喂计划
*
*
* @param sgFeedPlan 饲喂计划
* @return 结果
*/
@Override
public int updateSgFeedPlan(SgFeedPlan sgFeedPlan)
{
public int updateSgFeedPlan(SgFeedPlan sgFeedPlan) {
return sgFeedPlanMapper.updateSgFeedPlan(sgFeedPlan);
}
/**
* 批量删除饲喂计划
*
*
* @param createDates 需要删除的饲喂计划主键
* @return 结果
*/
@Override
public int deleteSgFeedPlanByCreateDates(Date[] createDates)
{
public int deleteSgFeedPlanByCreateDates(Date[] createDates) {
return sgFeedPlanMapper.deleteSgFeedPlanByCreateDates(createDates);
}
/**
* 删除饲喂计划信息
*
*
* @param createDate 饲喂计划主键
* @return 结果
*/
@Override
public int deleteSgFeedPlanByCreateDate(Date createDate)
{
public int deleteSgFeedPlanByCreateDate(Date createDate) {
return sgFeedPlanMapper.deleteSgFeedPlanByCreateDate(createDate);
}

View File

@@ -3,6 +3,7 @@ package com.zhyc.module.feed.service.impl;
import java.util.List;
import java.util.stream.Collectors;
import com.zhyc.common.annotation.DataScope;
import com.zhyc.module.base.domain.DaSheepfold;
import com.zhyc.module.feed.domain.SgFeedList;
import com.zhyc.module.feed.domain.SgFeedPlan;
@@ -51,6 +52,7 @@ public class SgFeedStatisticServiceImpl implements ISgFeedStatisticService {
* @return 饲喂量统计
*/
@Override
@DataScope(deptAlias = "sg_feed_statistic_alias", userAlias = "sg_feed_statistic_alias")
public List<SgFeedStatistic> selectSgFeedStatisticList(SgFeedStatistic sgFeedStatistic) {
return sgFeedStatisticMapper.selectSgFeedStatisticList(sgFeedStatistic);
}

View File

@@ -2,6 +2,7 @@ package com.zhyc.module.feed.service.impl;
import java.util.List;
import com.zhyc.common.annotation.DataScope;
import org.springframework.stereotype.Service;
import com.zhyc.module.feed.mapper.SgFormulaListMapper;
import com.zhyc.module.feed.domain.SgFormulaList;
@@ -41,6 +42,7 @@ public class SgFormulaListServiceImpl implements ISgFormulaListService {
* @return 配方列表
*/
@Override
@DataScope(deptAlias = "sg_formula_list_alias", userAlias = "sg_formula_list_alias")
public List<SgFormulaList> selectSgFormulaListList(SgFormulaList sgFormulaList) {
return sgFormulaListMapper.selectSgFormulaListList(sgFormulaList);
}

View File

@@ -4,6 +4,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.Objects;
import com.zhyc.common.annotation.DataScope;
import com.zhyc.module.feed.domain.SgFormulaList;
import com.zhyc.module.feed.mapper.SgFormulaListMapper;
import org.springframework.stereotype.Service;
@@ -46,6 +47,7 @@ public class SgFormulaManagementServiceImpl implements ISgFormulaManagementServi
* @return 配方管理
*/
@Override
@DataScope(deptAlias = "sg_formula_management_alias", userAlias = "sg_formula_management_alias")
public List<SgFormulaManagement> selectSgFormulaManagementList(SgFormulaManagement sgFormulaManagement) {
List<SgFormulaManagement> sgFormulaManagements =
sgFormulaManagementMapper.selectSgFormulaManagementList(sgFormulaManagement);

View File

@@ -2,6 +2,7 @@ package com.zhyc.module.feed.service.impl;
import java.util.List;
import com.zhyc.common.annotation.DataScope;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zhyc.module.feed.mapper.SgMaterialMapper;
@@ -37,6 +38,7 @@ public class SgMaterialServiceImpl implements ISgMaterialService {
* @return 原料
*/
@Override
@DataScope(deptAlias = "sg_material_alias", userAlias = "sg_material_alias")
public List<SgMaterial> selectSgMaterialList(SgMaterial sgMaterial) {
return sgMaterialMapper.selectSgMaterialList(sgMaterial);
}

View File

@@ -3,6 +3,11 @@ package com.zhyc.module.produce.bodyManage.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.zhyc.common.utils.DateUtils;
import com.zhyc.common.utils.SecurityUtils;
import com.zhyc.common.utils.StringUtils;
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.*;
@@ -14,28 +19,28 @@ import com.zhyc.module.produce.bodyManage.domain.ScBodyMeasure;
import com.zhyc.module.produce.bodyManage.service.IScBodyMeasureService;
import com.zhyc.common.utils.poi.ExcelUtil;
import com.zhyc.common.core.page.TableDataInfo;
import org.springframework.web.multipart.MultipartFile;
/**
* 体尺测量Controller
*
*
* @author ruoyi
* @date 2025-07-27
*/
@RestController
@RequestMapping("/body_measure/body_measure")
public class ScBodyMeasureController extends BaseController
{
public class ScBodyMeasureController extends BaseController {
@Autowired
private IScBodyMeasureService scBodyMeasureService;
@Autowired
private IBasSheepService basSheepService;
/**
* 查询体尺测量列表
*/
@PreAuthorize("@ss.hasPermi('body_measure:body_measure:list')")
@GetMapping("/list")
public TableDataInfo list(ScBodyMeasure scBodyMeasure)
{
public TableDataInfo list(ScBodyMeasure scBodyMeasure) {
startPage();
List<ScBodyMeasure> list = scBodyMeasureService.selectScBodyMeasureList(scBodyMeasure);
return getDataTable(list);
@@ -47,8 +52,7 @@ public class ScBodyMeasureController extends BaseController
@PreAuthorize("@ss.hasPermi('body_measure:body_measure:export')")
@Log(title = "体尺测量", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ScBodyMeasure scBodyMeasure)
{
public void export(HttpServletResponse response, ScBodyMeasure scBodyMeasure) {
List<ScBodyMeasure> list = scBodyMeasureService.selectScBodyMeasureList(scBodyMeasure);
ExcelUtil<ScBodyMeasure> util = new ExcelUtil<ScBodyMeasure>(ScBodyMeasure.class);
util.exportExcel(response, list, "体尺测量数据");
@@ -59,8 +63,7 @@ public class ScBodyMeasureController extends BaseController
*/
@PreAuthorize("@ss.hasPermi('body_measure:body_measure:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(scBodyMeasureService.selectScBodyMeasureById(id));
}
@@ -70,8 +73,7 @@ public class ScBodyMeasureController extends BaseController
@PreAuthorize("@ss.hasPermi('body_measure:body_measure:add')")
@Log(title = "体尺测量", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ScBodyMeasure scBodyMeasure)
{
public AjaxResult add(@RequestBody ScBodyMeasure scBodyMeasure) {
return toAjax(scBodyMeasureService.insertScBodyMeasure(scBodyMeasure));
}
@@ -81,8 +83,7 @@ public class ScBodyMeasureController extends BaseController
@PreAuthorize("@ss.hasPermi('body_measure:body_measure:edit')")
@Log(title = "体尺测量", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ScBodyMeasure scBodyMeasure)
{
public AjaxResult edit(@RequestBody ScBodyMeasure scBodyMeasure) {
return toAjax(scBodyMeasureService.updateScBodyMeasure(scBodyMeasure));
}
@@ -91,14 +92,82 @@ public class ScBodyMeasureController extends BaseController
*/
@PreAuthorize("@ss.hasPermi('body_measure:body_measure:remove')")
@Log(title = "体尺测量", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(scBodyMeasureService.deleteScBodyMeasureByIds(ids));
}
@GetMapping("/search_ear_numbers")
public AjaxResult searchEarNumbers(@RequestParam("query") String query){
public AjaxResult searchEarNumbers(@RequestParam("query") String query) {
return success(scBodyMeasureService.searchEarNumbers(query.trim()));
}
/**
* 导入体尺测量数据
*/
@PreAuthorize("@ss.hasPermi('body_measure:body_measure:import')")
@Log(title = "体尺测量", businessType = BusinessType.IMPORT)
@PostMapping("/import")
public AjaxResult importData(@RequestParam("file") MultipartFile file) throws Exception {
ExcelUtil<ScBodyMeasure> util = new ExcelUtil<>(ScBodyMeasure.class);
List<ScBodyMeasure> list = util.importExcel(file.getInputStream());
// 数据校验和处理
StringBuilder errorMsg = new StringBuilder();
int successCount = 0;
int failCount = 0;
for (int i = 0; i < list.size(); i++) {
ScBodyMeasure measure = list.get(i);
try {
// 根据耳号查询羊只ID
if (StringUtils.isNotBlank(measure.getManageTags())) {
BasSheep sheep = basSheepService.selectBasSheepByManageTags(measure.getManageTags().trim());
if (sheep == null) {
failCount++;
errorMsg.append("").append(i + 2).append("行:耳号【")
.append(measure.getManageTags()).append("】不存在;");
continue;
}
measure.setSheepId(sheep.getId());
} else {
failCount++;
errorMsg.append("").append(i + 2).append("行:耳号不能为空;");
continue;
}
// 设置默认值
measure.setCreateTime(DateUtils.getNowDate());
measure.setCreateBy(SecurityUtils.getUsername());
scBodyMeasureService.insertScBodyMeasure(measure);
successCount++;
// 更新羊只当前体重
if (measure.getCurrentWeight() != null) {
BasSheep updateSheep = new BasSheep();
updateSheep.setId(measure.getSheepId());
updateSheep.setCurrentWeight(measure.getCurrentWeight());
basSheepService.updateBasSheep(updateSheep);
}
} catch (Exception e) {
failCount++;
errorMsg.append("").append(i + 2).append("行:").append(e.getMessage()).append("");
}
}
String msg = String.format("导入完成:成功%d条失败%d条", successCount, failCount);
if (failCount > 0) {
msg += ";失败原因:" + errorMsg.toString();
}
return success(msg);
}
/**
* 获取繁殖状态列表(用于下拉选择)
*/
@GetMapping("/breedStatus")
public AjaxResult listBreedStatus() {
return success(scBodyMeasureService.selectBreedStatusList());
}
}

View File

@@ -1,13 +1,16 @@
package com.zhyc.module.produce.bodyManage.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 org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.Date;
import java.util.List;
/**
@@ -62,8 +65,10 @@ public class ScBodyMeasure extends BaseEntity {
/**
* 测量日期
*/
@Excel(name = "测量日期")
private LocalDate measureDate;
@Excel(name = "测量日期", dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date measureDate;
/**
* 羊只类别
*/
@@ -82,10 +87,12 @@ public class ScBodyMeasure extends BaseEntity {
/**
* 出生体重
*/
@Excel(name = "出生体重")
private BigDecimal birthWeight;
/**
* 断奶体重
*/
@Excel(name = "断奶体重")
private BigDecimal weaningWeight;
/**
* 当前体重
@@ -173,6 +180,13 @@ public class ScBodyMeasure extends BaseEntity {
*/
@Excel(name = "配后天数")
private Integer postMatingDay;
/**
* 技术员
*/
@Excel(name = "技术员")
private String technician;
/**
* 备注
*/
@@ -180,12 +194,22 @@ public class ScBodyMeasure extends BaseEntity {
private String comment;
/**
* 技术员
* 前端多耳号查询条件,非表字段
*/
@Excel(name = "技术员")
private String technician;
/** 前端多耳号查询条件,非表字段 */
private List<String> manageTagsList;
/**
* 是否在群查询条件0-在群1-离群),非数据库字段
*/
private Integer isDelete;
/**
* 月龄查询条件(开始),非数据库字段
*/
private Integer monthAgeStart;
/**
* 月龄查询条件(结束),非数据库字段
*/
private Integer monthAgeEnd;
}

View File

@@ -78,6 +78,13 @@ public class ScBodyScore extends BaseEntity {
@Excel(name = "技术员")
private String technician;
/** 前端多耳号查询条件,非表字段 */
/**
* 前端多耳号查询条件,非表字段
*/
private List<String> manageTagsList;
/**
* 是否在群查询条件0-在群1-离群),非数据库字段
*/
private Integer isDelete;
}

View File

@@ -111,7 +111,13 @@ public class ScBreastRating extends BaseEntity {
@Excel(name = "技术员")
private String technician;
/** 前端多耳号查询条件,非表字段 */
/**
* 前端多耳号查询条件,非表字段
*/
private List<String> manageTagsList;
/**
* 是否在群查询条件0-在群1-离群),非数据库字段
*/
private Integer isDelete;
}

View File

@@ -1,6 +1,8 @@
package com.zhyc.module.produce.bodyManage.mapper;
import java.util.List;
import java.util.Map;
import com.zhyc.module.produce.bodyManage.domain.ScBodyMeasure;
import org.apache.ibatis.annotations.Param;
@@ -69,4 +71,9 @@ public interface ScBodyMeasureMapper
List<ScBodyMeasure> selectScBodyMeasureList(
@Param("sc") ScBodyMeasure sc,
@Param("manageTagsList") List<String> manageTagsList);
/**
* 查询繁殖状态列表
*/
List<Map<String, Object>> selectBreedStatusList();
}

View File

@@ -1,6 +1,8 @@
package com.zhyc.module.produce.bodyManage.service;
import java.util.List;
import java.util.Map;
import com.zhyc.module.produce.bodyManage.domain.ScBodyMeasure;
/**
@@ -60,4 +62,9 @@ public interface IScBodyMeasureService
public int deleteScBodyMeasureById(Long id);
List<String> searchEarNumbers(String query);
/**
* 查询繁殖状态列表
*/
List<Map<String, Object>> selectBreedStatusList();
}

View File

@@ -1,6 +1,8 @@
package com.zhyc.module.produce.bodyManage.service.impl;
import java.util.List;
import java.util.Map;
import com.zhyc.common.utils.DateUtils;
import com.zhyc.common.utils.SecurityUtils;
import com.zhyc.common.utils.StringUtils;
@@ -127,4 +129,9 @@ public class ScBodyMeasureServiceImpl implements IScBodyMeasureService
{
return scBodyMeasureMapper.deleteScBodyMeasureById(id);
}
@Override
public List<Map<String, Object>> selectBreedStatusList() {
return scBodyMeasureMapper.selectBreedStatusList();
}
}

View File

@@ -70,6 +70,7 @@ public class ScBreedPlanController extends BaseController
return success(scBreedPlanService.selectScBreedPlanById(id));
}
/**
* 新增配种计划
*/

View File

@@ -9,14 +9,7 @@ import com.zhyc.module.produce.breed.domain.ScBreedPlanGenerate;
import com.zhyc.module.produce.breed.service.IScBreedPlanGenerateService;
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;
@@ -54,9 +47,9 @@ public class ScBreedPlanGenerateController extends BaseController
*/
@PreAuthorize("@ss.hasPermi('mating_plan:generate:selectEwe')")
@GetMapping("/selectEwe")
public AjaxResult selectEligibleEwe()
public AjaxResult selectEligibleEwe(@RequestParam(value = "manageTags", required = false) String manageTags)
{
List<Map<String, Object>> eligibleEwe = scBreedPlanGenerateService.selectEligibleEwe();
List<Map<String, Object>> eligibleEwe = scBreedPlanGenerateService.selectEligibleEwe(manageTags);
return success(eligibleEwe);
}
@@ -65,9 +58,9 @@ public class ScBreedPlanGenerateController extends BaseController
*/
@PreAuthorize("@ss.hasPermi('mating_plan:generate:selectRam')")
@GetMapping("/selectRam")
public AjaxResult selectEligibleRam()
public AjaxResult selectEligibleRam(@RequestParam(value = "manageTags", required = false) String manageTags)
{
List<Map<String, Object>> eligibleRam = scBreedPlanGenerateService.selectEligibleRam();
List<Map<String, Object>> eligibleRam = scBreedPlanGenerateService.selectEligibleRam(manageTags);
return success(eligibleRam);
}
@@ -249,4 +242,19 @@ public class ScBreedPlanGenerateController extends BaseController
{
return toAjax(scBreedPlanGenerateService.deleteScBreedPlanGenerateByIds(ids));
}
/**
* 模糊查询母羊耳号列表
*/
@PreAuthorize("@ss.hasPermi('mating_plan:generate:query')") // 根据实际权限修改
@GetMapping("/search_ear_numbers")
public AjaxResult searchEarNumbers(@RequestParam("query") String query) {
try {
List<String> earNumbers = scBreedPlanGenerateService.searchEarNumbers(query);
return success(earNumbers);
} catch (Exception e) {
logger.error("搜索耳号异常", e);
return error("搜索耳号失败:" + e.getMessage());
}
}
}

View File

@@ -143,8 +143,8 @@ public class ScBreedRecordController extends BaseController
if (scBreedRecord.getBreedType() == null) {
return error("配种方式不能为空");
}
if (scBreedRecord.getBreedType() < 1 || scBreedRecord.getBreedType() > 4) {
return error("配种方式只能是1-同期发情、2-本交、3-冲胚、4-自然发情人工授精");
if (scBreedRecord.getBreedType() < 1 || scBreedRecord.getBreedType() > 5) {
return error("配种方式只能是1-供体母羊配种、2-同期发情人工授精、3-本交、4-自然发情人工授精、5-胚胎移植");
}
// 验证技术员
@@ -239,4 +239,6 @@ public class ScBreedRecordController extends BaseController
List<ScBreedRecord> records = scBreedRecordService.getBreedRecordsByTimeRange(sheepId, startDate, endDate);
return success(records);
}
}

View File

@@ -5,14 +5,7 @@ import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.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;
@@ -62,7 +55,17 @@ public class ScLambingRecordController extends BaseController {
return error("查询配种信息失败:" + e.getMessage());
}
}
@PreAuthorize("@ss.hasPermi('breed:lambing_records:query')")
@GetMapping("/search_ear_numbers")
public AjaxResult searchEarNumbers(@RequestParam("query") String query) {
try {
List<String> earNumbers = scLambingRecordService.searchEarNumbers(query);
return success(earNumbers);
} catch (Exception e) {
logger.error("搜索耳号异常", e);
return error("搜索耳号失败:" + e.getMessage());
}
}
/**
* 导出产羔记录列表
*/

View File

@@ -5,14 +5,7 @@ import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.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;
@@ -131,4 +124,19 @@ public class ScMiscarriageRecordController extends BaseController
{
return toAjax(scMiscarriageRecordService.deleteScMiscarriageRecordByIds(ids));
}
/**
* 模糊查询母羊耳号列表
*/
@PreAuthorize("@ss.hasPermi('breed:lambing_records:query')") // 根据实际权限修改
@GetMapping("/search_ear_numbers")
public AjaxResult searchEarNumbers(@RequestParam("query") String query) {
try {
List<String> earNumbers = scMiscarriageRecordService.searchEarNumbers(query);
return success(earNumbers);
} catch (Exception e) {
logger.error("搜索耳号异常", e);
return error("搜索耳号失败:" + e.getMessage());
}
}
}

View File

@@ -356,4 +356,18 @@ public class ScPregnancyRecordController extends BaseController
return error("调试测试失败: " + e.getMessage());
}
}
/**
* 模糊查询母羊耳号列表
*/
@PreAuthorize("@ss.hasPermi('breed:lambing_records:query')") // 根据实际权限修改
@GetMapping("/search_ear_numbers")
public AjaxResult searchEarNumbers(@RequestParam("query") String query) {
try {
List<String> earNumbers = scPregnancyRecordService.searchEarNumbers(query);
return success(earNumbers);
} catch (Exception e) {
logger.error("搜索耳号异常", e);
return error("搜索耳号失败:" + e.getMessage());
}
}
}

View File

@@ -128,4 +128,20 @@ public class ScWeanRecordController extends BaseController {
public AjaxResult remove(@PathVariable Long[] 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

@@ -1,6 +1,8 @@
package com.zhyc.module.produce.breed.domain;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
@@ -65,4 +67,15 @@ public class ScBreedPlanGenerate extends BaseEntity
/** 审批意见 */
private String approveRemark;
/** 全部羊耳号列表(用于多耳号查询) */
private List<String> allEarNumbers;
public List<String> getAllEarNumbers() {
return allEarNumbers;
}
public void setAllEarNumbers(List<String> allEarNumbers) {
this.allEarNumbers = allEarNumbers;
}
}

View File

@@ -1,5 +1,6 @@
package com.zhyc.module.produce.breed.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@@ -20,135 +21,135 @@ public class ScBreedRecord extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键ID */
// ===================== 基础主键/关联ID字段 =====================
// 基础关联ID
private Long id;
/** 羊只id */
@Excel(name = "羊只id")
private Long sheepId;
/** 配种公羊id */
@Excel(name = "配种公羊id")
private String ramId;
/** 配种母羊id */
@Excel(name = "配种母羊id")
private String eweId;
/** 技术员 */
@Excel(name = "技术员")
private String technician;
/** 繁殖用药/耗精量 */
@Excel(name = "耗精量")
private String breedDrugs;
/** 配种方式 1-同期发情 2-本交 */
@Excel(name = "配种方式", readConverterExp = "1=同期发情,2=本交")
private Integer breedType;
// ============ 显示字段 ============
/** 母羊耳号 */
// --- 导出及表单顺序 ---
@Excel(name = "耳号")
private String eweManageTags;
private String eweManageTags; // 母羊耳号
/** 母羊品种 */
@Excel(name = "品种")
private String eweVariety;
/** 公羊耳号 */
@Excel(name = "事件类型")
private String eventType = "配种";
// 核心注解指定JSON解析/序列化的日期格式时区指定为东八区Asia/Shanghai
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "Asia/Shanghai")
@Excel(name = "配种日期", dateFormat = "yyyy-MM-dd")
private Date createTime;
@Excel(name = "配种公羊")
private String ramManageTags;
/** 公羊品种 */
@Excel(name = "配种公羊品种")
private String ramVariety;
/** 胎次 */
@Excel(name = "胎次")
private Integer eweParity;
@Excel(name = "供体母羊")
private String donorEweNo;
@Excel(name = "供体母羊品种")
private String donorEweVariety;
@Excel(name = "供体公羊")
private String donorRamNo;
@Excel(name = "供体公羊品种")
private String donorRamVariety;
@Excel(name = "移胚数")
private Integer embryoCount;
/** 1-同期发情, 2-本交, 3-自然发情, 4-胚胎移植 */
@Excel(name = "配种方式", readConverterExp = "1=供体母羊配种,2=同期发情人工授精,3=本交,4=胚胎移植,5=自然发情人工授精")
private Integer breedType;
@Excel(name = "配种子类型")
private String embryoSubType; // 体内/体外 + 冻胚/鲜胚
/** 月龄 */
@Excel(name = "月龄")
private Integer eweMonthAge;
/** 羊舍名称 */
@Excel(name = "当前羊舍")
private String eweSheepfoldName;
/** 繁育状态 */
@Excel(name = "繁育状态")
private String eweBreedStatus;
/** 是否性控 */
@Excel(name = "是否性控", readConverterExp = "0=否,1=是")
private Integer eweControlled;
/** 羊只备注 */
@Excel(name = "羊只备注")
private String eweComment;
/** 牧场名称 */
@Excel(name = "所在牧场")
private String ranchName;
/** 配种方式显示 */
@Excel(name = "配种方式")
private String matingType;
/** 羊只类别 */
@Excel(name = "配种时羊只类别")
private String sheepType;
/** 配次 */
@Excel(name = "胎次")
private Integer eweParity;
@Excel(name = "孕检记录id")
private Integer pregnancyRecordId;
@Excel(name = "配次")
private Integer matingCount;
/** 发情后配种时间 */
@Excel(name = "发情后配种时间(小时)")
@Excel(name = "发情后配种时间")
private Long timeSincePlanning;
/** 牧场ID */
private Long ranchId;
@Excel(name = "当前羊舍")
private String eweSheepfoldName;
/** 配种计划ID */
private Long planId;
@Excel(name = "技术员")
private String technician;
// ============ 新增孕检相关字段 ============
@Excel(name = "繁殖用药")
private String breedDrugs;
@Excel(name = "羊只备注")
private String eweComment;
@Excel(name = "繁育状态")
private String eweBreedStatus;
/** 孕检日期 */
@Excel(name = "孕检日期")
private Date pregnancyCheckDate;
/** 孕检结果 */
@Excel(name = "孕检结果")
private String pregnancyResult;
/** 孕检方式 */
@Excel(name = "孕检方式")
private String pregnancyWay;
/** 胎数 */
@Excel(name = "胎数")
private Integer fetusCount;
/** 孕检技术员 */
@Excel(name = "孕检技术员")
private String pregnancyTechnician;
/** 孕检备注 */
@Excel(name = "孕检备注")
private String pregnancyRemark;
/** 孕检记录ID */
private Long pregnancyRecordId;
/** 配种到孕检间隔天数 */
@Excel(name = "配种到孕检间隔(天)")
private Integer daysToPregnancyCheck;
/** 是否已孕检 */
@Excel(name = "是否已孕检", readConverterExp = "0=否,1=是")
private Integer isPregnancyChecked;
@Excel(name = "预产日期")
private Date expectedDate;
@Excel(name = "实产日期")
private Date actualLambingDate;
@Excel(name = "配种时产后天数")
private Long daysPostLambing; // 距离上一次产羔
@Excel(name = "配种时泌乳天数")
private Long daysLactation; // 距离上一次孕检且怀孕
@Excel(name = "配种时配后天数")
private Long daysPostMating; // 距离上一次配种
@Excel(name = "上次配种日期")
private Date lastMatingDate;
@Excel(name = "冻精号")
private String frozenSemenNo; // 新增字段:自行输入
@Excel(name = "是否性控", readConverterExp = "0=否,1=是")
private Integer eweControlled;
@Excel(name = "耗精量")
private String spermConsumption;
@Excel(name = "创建人")
private String createBy;
@Excel(name = "创建日期")
private Date createDate;
@Excel(name = "所在牧场")
private String ranchName;
@Excel(name = "备注")
private String comment;
}

View File

@@ -141,7 +141,7 @@ public class ScLambDetail extends BaseEntity
/** 是否留养0-否1-是 */
@Excel(name = "是否留养")
private Integer isRetained;
private Boolean isRetained;
/** 家系 */
@Excel(name = "家系")

View File

@@ -121,6 +121,17 @@ public class ScLambingRecord extends BaseEntity
@Excel(name = "未留养母羔数量")
private Integer unretainedFemaleCount;
/** 全部羊耳号列表(用于多耳号查询) */
private List<String> allEarNumbers;
public List<String> getAllEarNumbers() {
return allEarNumbers;
}
public void setAllEarNumbers(List<String> allEarNumbers) {
this.allEarNumbers = allEarNumbers;
}
/** 羔羊信息列表(从羊只信息表查询) */
private List<SheepLambInfo> lambInfoList;

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