Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
02634eb7b6
@ -3,7 +3,6 @@ package com.zhyc;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
|
||||
/**
|
||||
* 启动程序
|
||||
|
@ -66,6 +66,21 @@ public class SecurityUtils
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户昵称
|
||||
**/
|
||||
public static String getNickName()
|
||||
{
|
||||
try
|
||||
{
|
||||
return getLoginUser().getUser().getNickName();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new ServiceException("获取用户昵称异常", HttpStatus.UNAUTHORIZED);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户
|
||||
**/
|
||||
|
@ -4,7 +4,6 @@ import java.lang.reflect.Method;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import org.aspectj.lang.JoinPoint;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.annotation.Before;
|
||||
import org.aspectj.lang.reflect.MethodSignature;
|
||||
import org.slf4j.Logger;
|
||||
@ -12,7 +11,6 @@ import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.data.redis.core.script.RedisScript;
|
||||
import org.springframework.stereotype.Component;
|
||||
import com.zhyc.common.annotation.RateLimiter;
|
||||
import com.zhyc.common.enums.LimitType;
|
||||
import com.zhyc.common.exception.ServiceException;
|
||||
|
@ -1,9 +1,6 @@
|
||||
package com.zhyc.framework.config;
|
||||
|
||||
import org.springframework.cache.annotation.CachingConfigurerSupport;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.data.redis.core.script.DefaultRedisScript;
|
||||
|
@ -8,7 +8,6 @@ import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.zhyc.module.base.domain.BasSheep;
|
||||
import com.zhyc.module.base.domain.BasSheepVariety;
|
||||
import com.zhyc.module.base.mapper.BasSheepMapper;
|
||||
import com.zhyc.module.base.service.IBasSheepService;
|
||||
import com.zhyc.module.base.service.IBasSheepVarietyService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
|
@ -1,12 +1,8 @@
|
||||
package com.zhyc.module.base.controller;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
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;
|
||||
|
@ -0,0 +1,104 @@
|
||||
package com.zhyc.module.base.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.zhyc.common.annotation.Log;
|
||||
import com.zhyc.common.enums.BusinessType;
|
||||
import com.zhyc.module.base.domain.BreedRamFile;
|
||||
import com.zhyc.module.base.service.IBreedRamFileService;
|
||||
import com.zhyc.common.core.controller.BaseController;
|
||||
import com.zhyc.common.core.domain.AjaxResult;
|
||||
import com.zhyc.common.utils.poi.ExcelUtil;
|
||||
import com.zhyc.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 种公羊档案Controller
|
||||
*
|
||||
* @author zhyc
|
||||
* @date 2025-07-29
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/ram_file/bas_ram_file")
|
||||
public class BreedRamFileController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IBreedRamFileService breedRamFileService;
|
||||
|
||||
/**
|
||||
* 查询种公羊档案列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('breed_ram_file:breed_ram_file:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BreedRamFile breedRamFile)
|
||||
{
|
||||
startPage();
|
||||
List<BreedRamFile> list = breedRamFileService.selectBreedRamFileList(breedRamFile);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出种公羊档案列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('breed_ram_file:breed_ram_file:export')")
|
||||
@Log(title = "种公羊档案", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BreedRamFile breedRamFile)
|
||||
{
|
||||
List<BreedRamFile> list = breedRamFileService.selectBreedRamFileList(breedRamFile);
|
||||
ExcelUtil<BreedRamFile> util = new ExcelUtil<BreedRamFile>(BreedRamFile.class);
|
||||
util.exportExcel(response, list, "种公羊档案数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取种公羊档案详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('breed_ram_file:breed_ram_file:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(breedRamFileService.selectBreedRamFileById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增种公羊档案
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('breed_ram_file:breed_ram_file:add')")
|
||||
@Log(title = "种公羊档案", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BreedRamFile breedRamFile)
|
||||
{
|
||||
return toAjax(breedRamFileService.insertBreedRamFile(breedRamFile));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改种公羊档案
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('breed_ram_file:breed_ram_file:edit')")
|
||||
@Log(title = "种公羊档案", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BreedRamFile breedRamFile)
|
||||
{
|
||||
return toAjax(breedRamFileService.updateBreedRamFile(breedRamFile));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除种公羊档案
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('breed_ram_file:breed_ram_file:remove')")
|
||||
@Log(title = "种公羊档案", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(breedRamFileService.deleteBreedRamFileByIds(ids));
|
||||
}
|
||||
}
|
@ -6,7 +6,6 @@ import com.zhyc.common.core.domain.AjaxResult;
|
||||
import com.zhyc.common.core.page.TableDataInfo;
|
||||
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.SheepFile;
|
||||
import com.zhyc.module.base.service.ISheepFileService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -5,8 +5,6 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.zhyc.common.annotation.Excel;
|
||||
import com.zhyc.common.core.domain.BaseEntity;
|
||||
|
||||
|
@ -5,8 +5,6 @@ import com.zhyc.common.core.domain.TreeEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 分组管理对象 bas_sheep_group
|
||||
|
@ -3,8 +3,6 @@ package com.zhyc.module.base.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;
|
||||
|
||||
|
@ -3,9 +3,6 @@ package com.zhyc.module.base.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;
|
||||
|
||||
/**
|
||||
|
@ -3,8 +3,6 @@ package com.zhyc.module.base.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;
|
||||
|
||||
|
@ -0,0 +1,890 @@
|
||||
package com.zhyc.module.base.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.zhyc.common.annotation.Excel;
|
||||
import com.zhyc.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 种公羊档案对象 breed_ram_file
|
||||
*
|
||||
* @author zhyc
|
||||
* @date 2025-07-29
|
||||
*/
|
||||
public class BreedRamFile extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 种公羊id */
|
||||
private Long id;
|
||||
|
||||
/** 普通耳号 */
|
||||
@Excel(name = "普通耳号")
|
||||
private String ordinaryEarNumber;
|
||||
|
||||
/** 牧场id */
|
||||
@Excel(name = "牧场id")
|
||||
private Long ranchId;
|
||||
|
||||
/** 牧场名称 */
|
||||
@Excel(name = "牧场名称")
|
||||
private String ranchName;
|
||||
|
||||
/** 羊舍id */
|
||||
@Excel(name = "羊舍id")
|
||||
private Long sheepfoldId;
|
||||
|
||||
/** 羊舍名称 */
|
||||
@Excel(name = "羊舍名称")
|
||||
private String sheepfoldName;
|
||||
|
||||
/** 电子耳号 */
|
||||
@Excel(name = "电子耳号")
|
||||
private String electronicTags;
|
||||
|
||||
/** 品种id */
|
||||
@Excel(name = "品种id")
|
||||
private Long varietyId;
|
||||
|
||||
/** 品种 */
|
||||
@Excel(name = "品种")
|
||||
private String variety;
|
||||
|
||||
/** 羊只类别 */
|
||||
@Excel(name = "羊只类别")
|
||||
private String sheepCategory;
|
||||
|
||||
/** 当前状态 */
|
||||
@Excel(name = "当前状态")
|
||||
private String currentStatus;
|
||||
|
||||
/** 生日 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "生日", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date birthday;
|
||||
|
||||
/** 动态 */
|
||||
@Excel(name = "动态")
|
||||
private String dynamicInfo;
|
||||
|
||||
/** 月龄 */
|
||||
@Excel(name = "月龄")
|
||||
private Long monthAge;
|
||||
|
||||
/** 出生体重 */
|
||||
@Excel(name = "出生体重")
|
||||
private BigDecimal birthWeight;
|
||||
|
||||
/** 断奶日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "断奶日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date weaningDate;
|
||||
|
||||
/** 断奶日龄 */
|
||||
@Excel(name = "断奶日龄")
|
||||
private Long weaningDayAge;
|
||||
|
||||
/** 断奶体重 */
|
||||
@Excel(name = "断奶体重")
|
||||
private BigDecimal weaningWeight;
|
||||
|
||||
/** 断奶日增重 */
|
||||
@Excel(name = "断奶日增重")
|
||||
private BigDecimal weaningDailyGain;
|
||||
|
||||
/** 断奶后日增重 */
|
||||
@Excel(name = "断奶后日增重")
|
||||
private BigDecimal postWeaningDailyGain;
|
||||
|
||||
/** 当前体重 */
|
||||
@Excel(name = "当前体重")
|
||||
private BigDecimal currentWeight;
|
||||
|
||||
/** 当前体重称重日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "当前体重称重日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date currentWeightDate;
|
||||
|
||||
/** 活动量 */
|
||||
@Excel(name = "活动量")
|
||||
private String activityLevel;
|
||||
|
||||
/** 性欲情况 */
|
||||
@Excel(name = "性欲情况")
|
||||
private String sexualStatus;
|
||||
|
||||
/** 阴囊周长 */
|
||||
@Excel(name = "阴囊周长")
|
||||
private BigDecimal scrotumCircumference;
|
||||
|
||||
/** 采精时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "采精时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date spermCollectionTime;
|
||||
|
||||
/** 精液量 */
|
||||
@Excel(name = "精液量")
|
||||
private BigDecimal spermVolume;
|
||||
|
||||
/** 精液活力 */
|
||||
@Excel(name = "精液活力")
|
||||
private String spermVitality;
|
||||
|
||||
/** 精液密度 */
|
||||
@Excel(name = "精液密度")
|
||||
private String spermDensity;
|
||||
|
||||
/** 精液品质 */
|
||||
@Excel(name = "精液品质")
|
||||
private String spermQuality;
|
||||
|
||||
/** 配种状态 */
|
||||
@Excel(name = "配种状态")
|
||||
private Long breedingStatus;
|
||||
|
||||
/** 上次计划时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "上次计划时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date lastPlanTime;
|
||||
|
||||
/** 本次计划时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "本次计划时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date currentPlanTime;
|
||||
|
||||
/** 蛋白率%EBV */
|
||||
@Excel(name = "蛋白率%EBV")
|
||||
private BigDecimal proteinRateEbv;
|
||||
|
||||
/** 乳脂率%EBV */
|
||||
@Excel(name = "乳脂率%EBV")
|
||||
private BigDecimal milkFatRateEbv;
|
||||
|
||||
/** 乳体细胞(SCS)EBV */
|
||||
@Excel(name = "乳体细胞", readConverterExp = "S=CS")
|
||||
private BigDecimal scsEbv;
|
||||
|
||||
/** 生长性能EBV */
|
||||
@Excel(name = "生长性能EBV")
|
||||
private BigDecimal growthPerformanceEbv;
|
||||
|
||||
/** 抗逆性EBV */
|
||||
@Excel(name = "抗逆性EBV")
|
||||
private BigDecimal resistanceEbv;
|
||||
|
||||
/** 繁殖性能EBV */
|
||||
@Excel(name = "繁殖性能EBV")
|
||||
private BigDecimal reproductionPerformanceEbv;
|
||||
|
||||
/** 体型性状EBV */
|
||||
@Excel(name = "体型性状EBV")
|
||||
private BigDecimal bodyTypeEbv;
|
||||
|
||||
/** 综合育种值 */
|
||||
@Excel(name = "综合育种值")
|
||||
private BigDecimal comprehensiveBreedingValue;
|
||||
|
||||
/** 父号 */
|
||||
@Excel(name = "父号")
|
||||
private String fatherNumber;
|
||||
|
||||
/** 母号 */
|
||||
@Excel(name = "母号")
|
||||
private String motherNumber;
|
||||
|
||||
/** 祖父 */
|
||||
@Excel(name = "祖父")
|
||||
private String grandfatherNumber;
|
||||
|
||||
/** 祖母 */
|
||||
@Excel(name = "祖母")
|
||||
private String grandmotherNumber;
|
||||
|
||||
/** 外祖父 */
|
||||
@Excel(name = "外祖父")
|
||||
private String maternalGrandfatherNumber;
|
||||
|
||||
/** 外祖母 */
|
||||
@Excel(name = "外祖母")
|
||||
private String maternalGrandmotherNumber;
|
||||
|
||||
/** 是否核心羊群(0否1是) */
|
||||
@Excel(name = "是否核心羊群", readConverterExp = "0=否,1=是")
|
||||
private Long isCoreFlock;
|
||||
|
||||
/** 是否种用(0否1是) */
|
||||
@Excel(name = "是否种用", readConverterExp = "0=否,1=是")
|
||||
private Long isBreedingUse;
|
||||
|
||||
/** 孕检 */
|
||||
@Excel(name = "孕检")
|
||||
private String pregnancyCheck;
|
||||
|
||||
/** 总配母羊数 */
|
||||
@Excel(name = "总配母羊数")
|
||||
private Long totalMatedEwes;
|
||||
|
||||
/** 本交孕检母羊数 */
|
||||
@Excel(name = "本交孕检母羊数")
|
||||
private Long naturalPregnancyCheckEwes;
|
||||
|
||||
/** 本交受孕率% */
|
||||
@Excel(name = "本交受孕率%")
|
||||
private BigDecimal naturalConceptionRate;
|
||||
|
||||
/** 人工孕检母羊数 */
|
||||
@Excel(name = "人工孕检母羊数")
|
||||
private Long artificialPregnancyCheckEwes;
|
||||
|
||||
/** 人工受孕率% */
|
||||
@Excel(name = "人工受孕率%")
|
||||
private BigDecimal artificialConceptionRate;
|
||||
|
||||
/** 公羊母亲奶量 */
|
||||
@Excel(name = "公羊母亲奶量")
|
||||
private BigDecimal ramMotherMilkVolume;
|
||||
|
||||
/** 产奶量估计育种值(Kg) */
|
||||
@Excel(name = "产奶量估计育种值", readConverterExp = "K=g")
|
||||
private BigDecimal milkProductionEbv;
|
||||
|
||||
/** 准确性 */
|
||||
@Excel(name = "准确性")
|
||||
private BigDecimal accuracy;
|
||||
|
||||
/** 信息数 */
|
||||
@Excel(name = "信息数")
|
||||
private Long informationCount;
|
||||
|
||||
/** 是否亲子鉴定(0否1是) */
|
||||
@Excel(name = "是否亲子鉴定", readConverterExp = "0=否,1=是")
|
||||
private Long isPaternityTested;
|
||||
|
||||
/** 是否删除(0否1是) */
|
||||
private Long isDelete;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setOrdinaryEarNumber(String ordinaryEarNumber)
|
||||
{
|
||||
this.ordinaryEarNumber = ordinaryEarNumber;
|
||||
}
|
||||
|
||||
public String getOrdinaryEarNumber()
|
||||
{
|
||||
return ordinaryEarNumber;
|
||||
}
|
||||
public void setRanchId(Long ranchId)
|
||||
{
|
||||
this.ranchId = ranchId;
|
||||
}
|
||||
|
||||
public Long getRanchId()
|
||||
{
|
||||
return ranchId;
|
||||
}
|
||||
public void setRanchName(String ranchName)
|
||||
{
|
||||
this.ranchName = ranchName;
|
||||
}
|
||||
|
||||
public String getRanchName()
|
||||
{
|
||||
return ranchName;
|
||||
}
|
||||
public void setSheepfoldId(Long sheepfoldId)
|
||||
{
|
||||
this.sheepfoldId = sheepfoldId;
|
||||
}
|
||||
|
||||
public Long getSheepfoldId()
|
||||
{
|
||||
return sheepfoldId;
|
||||
}
|
||||
public void setSheepfoldName(String sheepfoldName)
|
||||
{
|
||||
this.sheepfoldName = sheepfoldName;
|
||||
}
|
||||
|
||||
public String getSheepfoldName()
|
||||
{
|
||||
return sheepfoldName;
|
||||
}
|
||||
public void setElectronicTags(String electronicTags)
|
||||
{
|
||||
this.electronicTags = electronicTags;
|
||||
}
|
||||
|
||||
public String getElectronicTags()
|
||||
{
|
||||
return electronicTags;
|
||||
}
|
||||
public void setVarietyId(Long varietyId)
|
||||
{
|
||||
this.varietyId = varietyId;
|
||||
}
|
||||
|
||||
public Long getVarietyId()
|
||||
{
|
||||
return varietyId;
|
||||
}
|
||||
public void setVariety(String variety)
|
||||
{
|
||||
this.variety = variety;
|
||||
}
|
||||
|
||||
public String getVariety()
|
||||
{
|
||||
return variety;
|
||||
}
|
||||
public void setSheepCategory(String sheepCategory)
|
||||
{
|
||||
this.sheepCategory = sheepCategory;
|
||||
}
|
||||
|
||||
public String getSheepCategory()
|
||||
{
|
||||
return sheepCategory;
|
||||
}
|
||||
public void setCurrentStatus(String currentStatus)
|
||||
{
|
||||
this.currentStatus = currentStatus;
|
||||
}
|
||||
|
||||
public String getCurrentStatus()
|
||||
{
|
||||
return currentStatus;
|
||||
}
|
||||
public void setBirthday(Date birthday)
|
||||
{
|
||||
this.birthday = birthday;
|
||||
}
|
||||
|
||||
public Date getBirthday()
|
||||
{
|
||||
return birthday;
|
||||
}
|
||||
public void setDynamicInfo(String dynamicInfo)
|
||||
{
|
||||
this.dynamicInfo = dynamicInfo;
|
||||
}
|
||||
|
||||
public String getDynamicInfo()
|
||||
{
|
||||
return dynamicInfo;
|
||||
}
|
||||
public void setMonthAge(Long monthAge)
|
||||
{
|
||||
this.monthAge = monthAge;
|
||||
}
|
||||
|
||||
public Long getMonthAge()
|
||||
{
|
||||
return monthAge;
|
||||
}
|
||||
public void setBirthWeight(BigDecimal birthWeight)
|
||||
{
|
||||
this.birthWeight = birthWeight;
|
||||
}
|
||||
|
||||
public BigDecimal getBirthWeight()
|
||||
{
|
||||
return birthWeight;
|
||||
}
|
||||
public void setWeaningDate(Date weaningDate)
|
||||
{
|
||||
this.weaningDate = weaningDate;
|
||||
}
|
||||
|
||||
public Date getWeaningDate()
|
||||
{
|
||||
return weaningDate;
|
||||
}
|
||||
public void setWeaningDayAge(Long weaningDayAge)
|
||||
{
|
||||
this.weaningDayAge = weaningDayAge;
|
||||
}
|
||||
|
||||
public Long getWeaningDayAge()
|
||||
{
|
||||
return weaningDayAge;
|
||||
}
|
||||
public void setWeaningWeight(BigDecimal weaningWeight)
|
||||
{
|
||||
this.weaningWeight = weaningWeight;
|
||||
}
|
||||
|
||||
public BigDecimal getWeaningWeight()
|
||||
{
|
||||
return weaningWeight;
|
||||
}
|
||||
public void setWeaningDailyGain(BigDecimal weaningDailyGain)
|
||||
{
|
||||
this.weaningDailyGain = weaningDailyGain;
|
||||
}
|
||||
|
||||
public BigDecimal getWeaningDailyGain()
|
||||
{
|
||||
return weaningDailyGain;
|
||||
}
|
||||
public void setPostWeaningDailyGain(BigDecimal postWeaningDailyGain)
|
||||
{
|
||||
this.postWeaningDailyGain = postWeaningDailyGain;
|
||||
}
|
||||
|
||||
public BigDecimal getPostWeaningDailyGain()
|
||||
{
|
||||
return postWeaningDailyGain;
|
||||
}
|
||||
public void setCurrentWeight(BigDecimal currentWeight)
|
||||
{
|
||||
this.currentWeight = currentWeight;
|
||||
}
|
||||
|
||||
public BigDecimal getCurrentWeight()
|
||||
{
|
||||
return currentWeight;
|
||||
}
|
||||
public void setCurrentWeightDate(Date currentWeightDate)
|
||||
{
|
||||
this.currentWeightDate = currentWeightDate;
|
||||
}
|
||||
|
||||
public Date getCurrentWeightDate()
|
||||
{
|
||||
return currentWeightDate;
|
||||
}
|
||||
public void setActivityLevel(String activityLevel)
|
||||
{
|
||||
this.activityLevel = activityLevel;
|
||||
}
|
||||
|
||||
public String getActivityLevel()
|
||||
{
|
||||
return activityLevel;
|
||||
}
|
||||
public void setSexualStatus(String sexualStatus)
|
||||
{
|
||||
this.sexualStatus = sexualStatus;
|
||||
}
|
||||
|
||||
public String getSexualStatus()
|
||||
{
|
||||
return sexualStatus;
|
||||
}
|
||||
public void setScrotumCircumference(BigDecimal scrotumCircumference)
|
||||
{
|
||||
this.scrotumCircumference = scrotumCircumference;
|
||||
}
|
||||
|
||||
public BigDecimal getScrotumCircumference()
|
||||
{
|
||||
return scrotumCircumference;
|
||||
}
|
||||
public void setSpermCollectionTime(Date spermCollectionTime)
|
||||
{
|
||||
this.spermCollectionTime = spermCollectionTime;
|
||||
}
|
||||
|
||||
public Date getSpermCollectionTime()
|
||||
{
|
||||
return spermCollectionTime;
|
||||
}
|
||||
public void setSpermVolume(BigDecimal spermVolume)
|
||||
{
|
||||
this.spermVolume = spermVolume;
|
||||
}
|
||||
|
||||
public BigDecimal getSpermVolume()
|
||||
{
|
||||
return spermVolume;
|
||||
}
|
||||
public void setSpermVitality(String spermVitality)
|
||||
{
|
||||
this.spermVitality = spermVitality;
|
||||
}
|
||||
|
||||
public String getSpermVitality()
|
||||
{
|
||||
return spermVitality;
|
||||
}
|
||||
public void setSpermDensity(String spermDensity)
|
||||
{
|
||||
this.spermDensity = spermDensity;
|
||||
}
|
||||
|
||||
public String getSpermDensity()
|
||||
{
|
||||
return spermDensity;
|
||||
}
|
||||
public void setSpermQuality(String spermQuality)
|
||||
{
|
||||
this.spermQuality = spermQuality;
|
||||
}
|
||||
|
||||
public String getSpermQuality()
|
||||
{
|
||||
return spermQuality;
|
||||
}
|
||||
public void setBreedingStatus(Long breedingStatus)
|
||||
{
|
||||
this.breedingStatus = breedingStatus;
|
||||
}
|
||||
|
||||
public Long getBreedingStatus()
|
||||
{
|
||||
return breedingStatus;
|
||||
}
|
||||
public void setLastPlanTime(Date lastPlanTime)
|
||||
{
|
||||
this.lastPlanTime = lastPlanTime;
|
||||
}
|
||||
|
||||
public Date getLastPlanTime()
|
||||
{
|
||||
return lastPlanTime;
|
||||
}
|
||||
public void setCurrentPlanTime(Date currentPlanTime)
|
||||
{
|
||||
this.currentPlanTime = currentPlanTime;
|
||||
}
|
||||
|
||||
public Date getCurrentPlanTime()
|
||||
{
|
||||
return currentPlanTime;
|
||||
}
|
||||
public void setProteinRateEbv(BigDecimal proteinRateEbv)
|
||||
{
|
||||
this.proteinRateEbv = proteinRateEbv;
|
||||
}
|
||||
|
||||
public BigDecimal getProteinRateEbv()
|
||||
{
|
||||
return proteinRateEbv;
|
||||
}
|
||||
public void setMilkFatRateEbv(BigDecimal milkFatRateEbv)
|
||||
{
|
||||
this.milkFatRateEbv = milkFatRateEbv;
|
||||
}
|
||||
|
||||
public BigDecimal getMilkFatRateEbv()
|
||||
{
|
||||
return milkFatRateEbv;
|
||||
}
|
||||
public void setScsEbv(BigDecimal scsEbv)
|
||||
{
|
||||
this.scsEbv = scsEbv;
|
||||
}
|
||||
|
||||
public BigDecimal getScsEbv()
|
||||
{
|
||||
return scsEbv;
|
||||
}
|
||||
public void setGrowthPerformanceEbv(BigDecimal growthPerformanceEbv)
|
||||
{
|
||||
this.growthPerformanceEbv = growthPerformanceEbv;
|
||||
}
|
||||
|
||||
public BigDecimal getGrowthPerformanceEbv()
|
||||
{
|
||||
return growthPerformanceEbv;
|
||||
}
|
||||
public void setResistanceEbv(BigDecimal resistanceEbv)
|
||||
{
|
||||
this.resistanceEbv = resistanceEbv;
|
||||
}
|
||||
|
||||
public BigDecimal getResistanceEbv()
|
||||
{
|
||||
return resistanceEbv;
|
||||
}
|
||||
public void setReproductionPerformanceEbv(BigDecimal reproductionPerformanceEbv)
|
||||
{
|
||||
this.reproductionPerformanceEbv = reproductionPerformanceEbv;
|
||||
}
|
||||
|
||||
public BigDecimal getReproductionPerformanceEbv()
|
||||
{
|
||||
return reproductionPerformanceEbv;
|
||||
}
|
||||
public void setBodyTypeEbv(BigDecimal bodyTypeEbv)
|
||||
{
|
||||
this.bodyTypeEbv = bodyTypeEbv;
|
||||
}
|
||||
|
||||
public BigDecimal getBodyTypeEbv()
|
||||
{
|
||||
return bodyTypeEbv;
|
||||
}
|
||||
public void setComprehensiveBreedingValue(BigDecimal comprehensiveBreedingValue)
|
||||
{
|
||||
this.comprehensiveBreedingValue = comprehensiveBreedingValue;
|
||||
}
|
||||
|
||||
public BigDecimal getComprehensiveBreedingValue()
|
||||
{
|
||||
return comprehensiveBreedingValue;
|
||||
}
|
||||
public void setFatherNumber(String fatherNumber)
|
||||
{
|
||||
this.fatherNumber = fatherNumber;
|
||||
}
|
||||
|
||||
public String getFatherNumber()
|
||||
{
|
||||
return fatherNumber;
|
||||
}
|
||||
public void setMotherNumber(String motherNumber)
|
||||
{
|
||||
this.motherNumber = motherNumber;
|
||||
}
|
||||
|
||||
public String getMotherNumber()
|
||||
{
|
||||
return motherNumber;
|
||||
}
|
||||
public void setGrandfatherNumber(String grandfatherNumber)
|
||||
{
|
||||
this.grandfatherNumber = grandfatherNumber;
|
||||
}
|
||||
|
||||
public String getGrandfatherNumber()
|
||||
{
|
||||
return grandfatherNumber;
|
||||
}
|
||||
public void setGrandmotherNumber(String grandmotherNumber)
|
||||
{
|
||||
this.grandmotherNumber = grandmotherNumber;
|
||||
}
|
||||
|
||||
public String getGrandmotherNumber()
|
||||
{
|
||||
return grandmotherNumber;
|
||||
}
|
||||
public void setMaternalGrandfatherNumber(String maternalGrandfatherNumber)
|
||||
{
|
||||
this.maternalGrandfatherNumber = maternalGrandfatherNumber;
|
||||
}
|
||||
|
||||
public String getMaternalGrandfatherNumber()
|
||||
{
|
||||
return maternalGrandfatherNumber;
|
||||
}
|
||||
public void setMaternalGrandmotherNumber(String maternalGrandmotherNumber)
|
||||
{
|
||||
this.maternalGrandmotherNumber = maternalGrandmotherNumber;
|
||||
}
|
||||
|
||||
public String getMaternalGrandmotherNumber()
|
||||
{
|
||||
return maternalGrandmotherNumber;
|
||||
}
|
||||
public void setIsCoreFlock(Long isCoreFlock)
|
||||
{
|
||||
this.isCoreFlock = isCoreFlock;
|
||||
}
|
||||
|
||||
public Long getIsCoreFlock()
|
||||
{
|
||||
return isCoreFlock;
|
||||
}
|
||||
public void setIsBreedingUse(Long isBreedingUse)
|
||||
{
|
||||
this.isBreedingUse = isBreedingUse;
|
||||
}
|
||||
|
||||
public Long getIsBreedingUse()
|
||||
{
|
||||
return isBreedingUse;
|
||||
}
|
||||
public void setPregnancyCheck(String pregnancyCheck)
|
||||
{
|
||||
this.pregnancyCheck = pregnancyCheck;
|
||||
}
|
||||
|
||||
public String getPregnancyCheck()
|
||||
{
|
||||
return pregnancyCheck;
|
||||
}
|
||||
public void setTotalMatedEwes(Long totalMatedEwes)
|
||||
{
|
||||
this.totalMatedEwes = totalMatedEwes;
|
||||
}
|
||||
|
||||
public Long getTotalMatedEwes()
|
||||
{
|
||||
return totalMatedEwes;
|
||||
}
|
||||
public void setNaturalPregnancyCheckEwes(Long naturalPregnancyCheckEwes)
|
||||
{
|
||||
this.naturalPregnancyCheckEwes = naturalPregnancyCheckEwes;
|
||||
}
|
||||
|
||||
public Long getNaturalPregnancyCheckEwes()
|
||||
{
|
||||
return naturalPregnancyCheckEwes;
|
||||
}
|
||||
public void setNaturalConceptionRate(BigDecimal naturalConceptionRate)
|
||||
{
|
||||
this.naturalConceptionRate = naturalConceptionRate;
|
||||
}
|
||||
|
||||
public BigDecimal getNaturalConceptionRate()
|
||||
{
|
||||
return naturalConceptionRate;
|
||||
}
|
||||
public void setArtificialPregnancyCheckEwes(Long artificialPregnancyCheckEwes)
|
||||
{
|
||||
this.artificialPregnancyCheckEwes = artificialPregnancyCheckEwes;
|
||||
}
|
||||
|
||||
public Long getArtificialPregnancyCheckEwes()
|
||||
{
|
||||
return artificialPregnancyCheckEwes;
|
||||
}
|
||||
public void setArtificialConceptionRate(BigDecimal artificialConceptionRate)
|
||||
{
|
||||
this.artificialConceptionRate = artificialConceptionRate;
|
||||
}
|
||||
|
||||
public BigDecimal getArtificialConceptionRate()
|
||||
{
|
||||
return artificialConceptionRate;
|
||||
}
|
||||
public void setRamMotherMilkVolume(BigDecimal ramMotherMilkVolume)
|
||||
{
|
||||
this.ramMotherMilkVolume = ramMotherMilkVolume;
|
||||
}
|
||||
|
||||
public BigDecimal getRamMotherMilkVolume()
|
||||
{
|
||||
return ramMotherMilkVolume;
|
||||
}
|
||||
public void setMilkProductionEbv(BigDecimal milkProductionEbv)
|
||||
{
|
||||
this.milkProductionEbv = milkProductionEbv;
|
||||
}
|
||||
|
||||
public BigDecimal getMilkProductionEbv()
|
||||
{
|
||||
return milkProductionEbv;
|
||||
}
|
||||
public void setAccuracy(BigDecimal accuracy)
|
||||
{
|
||||
this.accuracy = accuracy;
|
||||
}
|
||||
|
||||
public BigDecimal getAccuracy()
|
||||
{
|
||||
return accuracy;
|
||||
}
|
||||
public void setInformationCount(Long informationCount)
|
||||
{
|
||||
this.informationCount = informationCount;
|
||||
}
|
||||
|
||||
public Long getInformationCount()
|
||||
{
|
||||
return informationCount;
|
||||
}
|
||||
public void setIsPaternityTested(Long isPaternityTested)
|
||||
{
|
||||
this.isPaternityTested = isPaternityTested;
|
||||
}
|
||||
|
||||
public Long getIsPaternityTested()
|
||||
{
|
||||
return isPaternityTested;
|
||||
}
|
||||
public void setIsDelete(Long isDelete)
|
||||
{
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
|
||||
public Long getIsDelete()
|
||||
{
|
||||
return isDelete;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("ordinaryEarNumber", getOrdinaryEarNumber())
|
||||
.append("ranchId", getRanchId())
|
||||
.append("ranchName", getRanchName())
|
||||
.append("sheepfoldId", getSheepfoldId())
|
||||
.append("sheepfoldName", getSheepfoldName())
|
||||
.append("electronicTags", getElectronicTags())
|
||||
.append("varietyId", getVarietyId())
|
||||
.append("variety", getVariety())
|
||||
.append("sheepCategory", getSheepCategory())
|
||||
.append("currentStatus", getCurrentStatus())
|
||||
.append("birthday", getBirthday())
|
||||
.append("dynamicInfo", getDynamicInfo())
|
||||
.append("monthAge", getMonthAge())
|
||||
.append("birthWeight", getBirthWeight())
|
||||
.append("weaningDate", getWeaningDate())
|
||||
.append("weaningDayAge", getWeaningDayAge())
|
||||
.append("weaningWeight", getWeaningWeight())
|
||||
.append("weaningDailyGain", getWeaningDailyGain())
|
||||
.append("postWeaningDailyGain", getPostWeaningDailyGain())
|
||||
.append("currentWeight", getCurrentWeight())
|
||||
.append("currentWeightDate", getCurrentWeightDate())
|
||||
.append("activityLevel", getActivityLevel())
|
||||
.append("sexualStatus", getSexualStatus())
|
||||
.append("scrotumCircumference", getScrotumCircumference())
|
||||
.append("spermCollectionTime", getSpermCollectionTime())
|
||||
.append("spermVolume", getSpermVolume())
|
||||
.append("spermVitality", getSpermVitality())
|
||||
.append("spermDensity", getSpermDensity())
|
||||
.append("spermQuality", getSpermQuality())
|
||||
.append("breedingStatus", getBreedingStatus())
|
||||
.append("lastPlanTime", getLastPlanTime())
|
||||
.append("currentPlanTime", getCurrentPlanTime())
|
||||
.append("remark", getRemark())
|
||||
.append("proteinRateEbv", getProteinRateEbv())
|
||||
.append("milkFatRateEbv", getMilkFatRateEbv())
|
||||
.append("scsEbv", getScsEbv())
|
||||
.append("growthPerformanceEbv", getGrowthPerformanceEbv())
|
||||
.append("resistanceEbv", getResistanceEbv())
|
||||
.append("reproductionPerformanceEbv", getReproductionPerformanceEbv())
|
||||
.append("bodyTypeEbv", getBodyTypeEbv())
|
||||
.append("comprehensiveBreedingValue", getComprehensiveBreedingValue())
|
||||
.append("fatherNumber", getFatherNumber())
|
||||
.append("motherNumber", getMotherNumber())
|
||||
.append("grandfatherNumber", getGrandfatherNumber())
|
||||
.append("grandmotherNumber", getGrandmotherNumber())
|
||||
.append("maternalGrandfatherNumber", getMaternalGrandfatherNumber())
|
||||
.append("maternalGrandmotherNumber", getMaternalGrandmotherNumber())
|
||||
.append("isCoreFlock", getIsCoreFlock())
|
||||
.append("isBreedingUse", getIsBreedingUse())
|
||||
.append("pregnancyCheck", getPregnancyCheck())
|
||||
.append("totalMatedEwes", getTotalMatedEwes())
|
||||
.append("naturalPregnancyCheckEwes", getNaturalPregnancyCheckEwes())
|
||||
.append("naturalConceptionRate", getNaturalConceptionRate())
|
||||
.append("artificialPregnancyCheckEwes", getArtificialPregnancyCheckEwes())
|
||||
.append("artificialConceptionRate", getArtificialConceptionRate())
|
||||
.append("ramMotherMilkVolume", getRamMotherMilkVolume())
|
||||
.append("milkProductionEbv", getMilkProductionEbv())
|
||||
.append("accuracy", getAccuracy())
|
||||
.append("informationCount", getInformationCount())
|
||||
.append("isPaternityTested", getIsPaternityTested())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("isDelete", getIsDelete())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -3,9 +3,6 @@ package com.zhyc.module.base.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;
|
||||
|
||||
/**
|
||||
|
@ -5,8 +5,6 @@ import com.zhyc.common.core.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 羊舍管理对象 da_sheepfold
|
||||
|
@ -6,8 +6,6 @@ import com.zhyc.common.core.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
@ -78,4 +78,6 @@ public interface BasSheepMapper
|
||||
//用于校验改耳号部分新管理/电子耳号
|
||||
int existsByManageTag(@Param("tag") String tag);
|
||||
int existsByElectronicTag(@Param("tag") String tag);
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,109 @@
|
||||
package com.zhyc.module.base.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.zhyc.module.base.domain.BreedRamFile;
|
||||
|
||||
/**
|
||||
* 种公羊档案Mapper接口
|
||||
*
|
||||
* @author zhyc
|
||||
* @date 2025-07-29
|
||||
*/
|
||||
public interface BreedRamFileMapper
|
||||
{
|
||||
/**
|
||||
* 查询种公羊档案
|
||||
*
|
||||
* @param id 种公羊档案主键
|
||||
* @return 种公羊档案
|
||||
*/
|
||||
public BreedRamFile selectBreedRamFileById(Long id);
|
||||
|
||||
/**
|
||||
* 查询种公羊档案列表
|
||||
*
|
||||
* @param breedRamFile 种公羊档案
|
||||
* @return 种公羊档案集合
|
||||
*/
|
||||
public List<BreedRamFile> selectBreedRamFileList(BreedRamFile breedRamFile);
|
||||
|
||||
/**
|
||||
* 新增种公羊档案
|
||||
*
|
||||
* @param breedRamFile 种公羊档案
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBreedRamFile(BreedRamFile breedRamFile);
|
||||
|
||||
/**
|
||||
* 修改种公羊档案
|
||||
*
|
||||
* @param breedRamFile 种公羊档案
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBreedRamFile(BreedRamFile breedRamFile);
|
||||
|
||||
/**
|
||||
* 删除种公羊档案
|
||||
*
|
||||
* @param id 种公羊档案主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBreedRamFileById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除种公羊档案
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBreedRamFileByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 根据普通耳号查询种公羊档案
|
||||
*
|
||||
* @param ordinaryEarNumber 普通耳号
|
||||
* @return 种公羊档案
|
||||
*/
|
||||
public BreedRamFile selectBreedRamFileByOrdinaryEarNumber(String ordinaryEarNumber);
|
||||
|
||||
/**
|
||||
* 根据电子耳号查询种公羊档案
|
||||
*
|
||||
* @param electronicTags 电子耳号
|
||||
* @return 种公羊档案
|
||||
*/
|
||||
public BreedRamFile selectBreedRamFileByElectronicTags(String electronicTags);
|
||||
|
||||
/**
|
||||
* 根据牧场ID查询种公羊档案列表
|
||||
*
|
||||
* @param ranchId 牧场ID
|
||||
* @return 种公羊档案集合
|
||||
*/
|
||||
public List<BreedRamFile> selectBreedRamFileListByRanchId(Long ranchId);
|
||||
|
||||
/**
|
||||
* 根据羊舍ID查询种公羊档案列表
|
||||
*
|
||||
* @param sheepfoldId 羊舍ID
|
||||
* @return 种公羊档案集合
|
||||
*/
|
||||
public List<BreedRamFile> selectBreedRamFileListBySheepfoldId(Long sheepfoldId);
|
||||
|
||||
/**
|
||||
* 查询核心羊群种公羊档案列表
|
||||
*
|
||||
* @param breedRamFile 种公羊档案
|
||||
* @return 种公羊档案集合
|
||||
*/
|
||||
public List<BreedRamFile> selectCoreFlockBreedRamFileList(BreedRamFile breedRamFile);
|
||||
|
||||
/**
|
||||
* 查询种用种公羊档案列表
|
||||
*
|
||||
* @param breedRamFile 种公羊档案
|
||||
* @return 种公羊档案集合
|
||||
*/
|
||||
public List<BreedRamFile> selectBreedingUseBreedRamFileList(BreedRamFile breedRamFile);
|
||||
}
|
@ -2,7 +2,6 @@ package com.zhyc.module.base.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.zhyc.module.base.domain.BasSheep;
|
||||
import com.zhyc.module.base.domain.BasSheepType;
|
||||
|
||||
/**
|
||||
|
@ -0,0 +1,61 @@
|
||||
package com.zhyc.module.base.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.zhyc.module.base.domain.BreedRamFile;
|
||||
|
||||
/**
|
||||
* 种公羊档案Service接口
|
||||
*
|
||||
* @author zhyc
|
||||
* @date 2025-07-29
|
||||
*/
|
||||
public interface IBreedRamFileService
|
||||
{
|
||||
/**
|
||||
* 查询种公羊档案
|
||||
*
|
||||
* @param id 种公羊档案主键
|
||||
* @return 种公羊档案
|
||||
*/
|
||||
public BreedRamFile selectBreedRamFileById(Long id);
|
||||
|
||||
/**
|
||||
* 查询种公羊档案列表
|
||||
*
|
||||
* @param breedRamFile 种公羊档案
|
||||
* @return 种公羊档案集合
|
||||
*/
|
||||
public List<BreedRamFile> selectBreedRamFileList(BreedRamFile breedRamFile);
|
||||
|
||||
/**
|
||||
* 新增种公羊档案
|
||||
*
|
||||
* @param breedRamFile 种公羊档案
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBreedRamFile(BreedRamFile breedRamFile);
|
||||
|
||||
/**
|
||||
* 修改种公羊档案
|
||||
*
|
||||
* @param breedRamFile 种公羊档案
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBreedRamFile(BreedRamFile breedRamFile);
|
||||
|
||||
/**
|
||||
* 批量删除种公羊档案
|
||||
*
|
||||
* @param ids 需要删除的种公羊档案主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBreedRamFileByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除种公羊档案信息
|
||||
*
|
||||
* @param id 种公羊档案主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBreedRamFileById(Long id);
|
||||
}
|
@ -2,7 +2,6 @@ package com.zhyc.module.base.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.zhyc.module.base.domain.BasSheep;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.zhyc.module.base.mapper.BasSheepTypeMapper;
|
||||
|
@ -0,0 +1,96 @@
|
||||
package com.zhyc.module.base.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.zhyc.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.zhyc.module.base.mapper.BreedRamFileMapper;
|
||||
import com.zhyc.module.base.domain.BreedRamFile;
|
||||
import com.zhyc.module.base.service.IBreedRamFileService;
|
||||
|
||||
/**
|
||||
* 种公羊档案Service业务层处理
|
||||
*
|
||||
* @author zhyc
|
||||
* @date 2025-07-29
|
||||
*/
|
||||
@Service
|
||||
public class BreedRamFileServiceImpl implements IBreedRamFileService
|
||||
{
|
||||
@Autowired
|
||||
private BreedRamFileMapper breedRamFileMapper;
|
||||
|
||||
/**
|
||||
* 查询种公羊档案
|
||||
*
|
||||
* @param id 种公羊档案主键
|
||||
* @return 种公羊档案
|
||||
*/
|
||||
@Override
|
||||
public BreedRamFile selectBreedRamFileById(Long id)
|
||||
{
|
||||
return breedRamFileMapper.selectBreedRamFileById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询种公羊档案列表
|
||||
*
|
||||
* @param breedRamFile 种公羊档案
|
||||
* @return 种公羊档案
|
||||
*/
|
||||
@Override
|
||||
public List<BreedRamFile> selectBreedRamFileList(BreedRamFile breedRamFile)
|
||||
{
|
||||
return breedRamFileMapper.selectBreedRamFileList(breedRamFile);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增种公羊档案
|
||||
*
|
||||
* @param breedRamFile 种公羊档案
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBreedRamFile(BreedRamFile breedRamFile)
|
||||
{
|
||||
breedRamFile.setCreateTime(DateUtils.getNowDate());
|
||||
return breedRamFileMapper.insertBreedRamFile(breedRamFile);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改种公羊档案
|
||||
*
|
||||
* @param breedRamFile 种公羊档案
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBreedRamFile(BreedRamFile breedRamFile)
|
||||
{
|
||||
breedRamFile.setUpdateTime(DateUtils.getNowDate());
|
||||
return breedRamFileMapper.updateBreedRamFile(breedRamFile);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除种公羊档案
|
||||
*
|
||||
* @param ids 需要删除的种公羊档案主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBreedRamFileByIds(Long[] ids)
|
||||
{
|
||||
return breedRamFileMapper.deleteBreedRamFileByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除种公羊档案信息
|
||||
*
|
||||
* @param id 种公羊档案主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBreedRamFileById(Long id)
|
||||
{
|
||||
return breedRamFileMapper.deleteBreedRamFileById(id);
|
||||
}
|
||||
}
|
@ -1,6 +1,5 @@
|
||||
package com.zhyc.module.base.service.impl;
|
||||
|
||||
import com.zhyc.common.utils.DateUtils;
|
||||
import com.zhyc.module.base.domain.SheepFile;
|
||||
import com.zhyc.module.base.mapper.SheepFileMapper;
|
||||
import com.zhyc.module.base.service.ISheepFileService;
|
||||
|
@ -3,6 +3,7 @@ package com.zhyc.module.biosafety.controller;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.zhyc.common.utils.SecurityUtils;
|
||||
import com.zhyc.module.biosafety.service.IHealthService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -97,7 +98,7 @@ public class HealthController extends BaseController
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('biosafety:health:remove')")
|
||||
@Log(title = "保健", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(healthService.deleteHealthByIds(ids));
|
||||
|
@ -7,13 +7,11 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.zhyc.common.annotation.Excel;
|
||||
import com.zhyc.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 驱虫对象 sw_deworm
|
||||
* 驱虫对象 sw_dih
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-15
|
||||
|
@ -5,8 +5,6 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.zhyc.common.annotation.Excel;
|
||||
import com.zhyc.common.core.domain.BaseEntity;
|
||||
|
||||
|
@ -7,8 +7,6 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.zhyc.common.annotation.Excel;
|
||||
import com.zhyc.common.core.domain.BaseEntity;
|
||||
|
||||
@ -60,6 +58,8 @@ public class Disinfect extends BaseEntity
|
||||
/** 备注 */
|
||||
@Excel(name = "备注")
|
||||
private String comment;
|
||||
/** 药品名称用于查询*/
|
||||
private String mediName;
|
||||
|
||||
// 药品使用
|
||||
private List<SwMedicineUsageDetails> usageDetails;
|
||||
|
@ -7,8 +7,6 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.zhyc.common.annotation.Excel;
|
||||
import com.zhyc.common.core.domain.BaseEntity;
|
||||
|
||||
|
@ -3,8 +3,6 @@ package com.zhyc.module.biosafety.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;
|
||||
|
||||
|
@ -5,8 +5,6 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.zhyc.common.annotation.Excel;
|
||||
import com.zhyc.common.core.domain.BaseEntity;
|
||||
import org.apache.ibatis.type.Alias;
|
||||
|
@ -3,8 +3,6 @@ package com.zhyc.module.biosafety.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;
|
||||
|
||||
|
@ -3,8 +3,6 @@ package com.zhyc.module.biosafety.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.TreeEntity;
|
||||
|
||||
|
@ -3,8 +3,6 @@ package com.zhyc.module.biosafety.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;
|
||||
|
||||
|
@ -5,8 +5,6 @@ import java.util.List;
|
||||
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;
|
||||
|
||||
|
@ -3,8 +3,6 @@ package com.zhyc.module.biosafety.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;
|
||||
|
||||
|
@ -49,90 +49,4 @@ public class SwPrescription extends BaseEntity
|
||||
/** 处方详情信息 */
|
||||
private List<SwPresDetail> swPresDetailList;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setNo(String no)
|
||||
{
|
||||
this.no = no;
|
||||
}
|
||||
|
||||
public String getNo()
|
||||
{
|
||||
return no;
|
||||
}
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setPersType(Integer persType)
|
||||
{
|
||||
this.persType = persType;
|
||||
}
|
||||
|
||||
public Integer getPersType()
|
||||
{
|
||||
return persType;
|
||||
}
|
||||
|
||||
public void setComment(String comment)
|
||||
{
|
||||
this.comment = comment;
|
||||
}
|
||||
|
||||
public String getComment()
|
||||
{
|
||||
return comment;
|
||||
}
|
||||
|
||||
public void setStatus(Integer status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Integer getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
public List<SwPresDetail> getSwPresDetailList()
|
||||
{
|
||||
return swPresDetailList;
|
||||
}
|
||||
|
||||
public void setSwPresDetailList(List<SwPresDetail> swPresDetailList)
|
||||
{
|
||||
this.swPresDetailList = swPresDetailList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("no", getNo())
|
||||
.append("name", getName())
|
||||
.append("persType", getPersType())
|
||||
.append("comment", getComment())
|
||||
.append("status", getStatus())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("swPresDetailList", getSwPresDetailList())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
@ -3,8 +3,6 @@ package com.zhyc.module.biosafety.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;
|
||||
|
||||
|
@ -3,8 +3,6 @@ package com.zhyc.module.biosafety.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;
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.zhyc.module.biosafety.domain;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@ -8,8 +7,6 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.zhyc.common.annotation.Excel;
|
||||
import com.zhyc.common.core.domain.BaseEntity;
|
||||
|
||||
|
@ -3,7 +3,6 @@ package com.zhyc.module.biosafety.service;
|
||||
import java.util.List;
|
||||
|
||||
import com.zhyc.module.biosafety.domain.Treatment;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 治疗记录Service接口
|
||||
|
@ -10,7 +10,6 @@ import com.zhyc.module.base.mapper.SheepFileMapper;
|
||||
import com.zhyc.module.biosafety.domain.Deworm;
|
||||
import com.zhyc.module.biosafety.domain.SwMedicineUsage;
|
||||
import com.zhyc.module.biosafety.domain.SwMedicineUsageDetails;
|
||||
import com.zhyc.module.biosafety.domain.Treatment;
|
||||
import com.zhyc.module.biosafety.mapper.SwMedicineUsageMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -73,7 +72,7 @@ public class DewormServiceImpl implements IDewormService
|
||||
@Transactional
|
||||
public int insertDeworm(Deworm deworm)
|
||||
{
|
||||
String username = SecurityUtils.getUsername();
|
||||
String username = SecurityUtils.getLoginUser().getUser().getNickName();
|
||||
// 使用记录的文件
|
||||
SwMedicineUsage medicineUsage = new SwMedicineUsage();
|
||||
medicineUsage.setSwMedicineUsageDetailsList(deworm.getUsageDetails());
|
||||
@ -116,7 +115,7 @@ public class DewormServiceImpl implements IDewormService
|
||||
@Transactional
|
||||
public int updateDeworm(Deworm deworm)
|
||||
{
|
||||
String username = SecurityUtils.getUsername();
|
||||
String username = SecurityUtils.getLoginUser().getUser().getNickName();
|
||||
for (SwMedicineUsageDetails usageDetail : deworm.getUsageDetails()) {
|
||||
usageDetail.setMediUsage(deworm.getUsageId());
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ public class DiagnosisServiceImpl implements IDiagnosisService
|
||||
diagnosis.setGender(String.valueOf(sheepFile.getGender()));
|
||||
diagnosis.setMonthAge(sheepFile.getMonthAge());
|
||||
|
||||
String username = SecurityUtils.getUsername();
|
||||
String username = SecurityUtils.getLoginUser().getUser().getNickName();
|
||||
diagnosis.setCreateBy(username);
|
||||
diagnosis.setCreateTime(DateUtils.getNowDate());
|
||||
if (!Objects.equals(sheepFile.getSheepfoldId(), diagnosis.getSheepfoldId())){
|
||||
@ -98,7 +98,7 @@ public class DiagnosisServiceImpl implements IDiagnosisService
|
||||
BasSheep basSheep = new BasSheep();
|
||||
basSheep.setId(diagnosis.getSheepId());
|
||||
basSheep.setSheepfoldId(diagnosis.getSheepfoldId());
|
||||
String username = SecurityUtils.getUsername();
|
||||
String username = SecurityUtils.getLoginUser().getUser().getNickName();
|
||||
basSheep.setUpdateBy(username);
|
||||
basSheep.setUpdateTime(DateUtils.getNowDate());
|
||||
diagnosis.setUpdateBy(username);
|
||||
|
@ -5,9 +5,7 @@ import java.util.List;
|
||||
import com.zhyc.common.utils.DateUtils;
|
||||
import com.zhyc.common.utils.SecurityUtils;
|
||||
import com.zhyc.common.utils.bean.BeanUtils;
|
||||
import com.zhyc.module.base.domain.SheepFile;
|
||||
import com.zhyc.module.base.mapper.SheepFileMapper;
|
||||
import com.zhyc.module.biosafety.domain.Deworm;
|
||||
import com.zhyc.module.biosafety.domain.SwMedicineUsage;
|
||||
import com.zhyc.module.biosafety.domain.SwMedicineUsageDetails;
|
||||
import com.zhyc.module.biosafety.mapper.SwMedicineUsageMapper;
|
||||
@ -75,7 +73,7 @@ public class DisinfectServiceImpl implements IDisinfectService
|
||||
@Override
|
||||
public int insertDisinfect(Disinfect disinfect)
|
||||
{
|
||||
String username = SecurityUtils.getUsername();
|
||||
String username = SecurityUtils.getLoginUser().getUser().getNickName();
|
||||
// 使用记录的文件
|
||||
SwMedicineUsage medicineUsage = new SwMedicineUsage();
|
||||
medicineUsage.setSwMedicineUsageDetailsList(disinfect.getUsageDetails());
|
||||
@ -116,7 +114,7 @@ public class DisinfectServiceImpl implements IDisinfectService
|
||||
}
|
||||
medicineUsageMapper.deleteSwMedicineUsageDetailsByMediUsage(disinfect.getUsageId());
|
||||
medicineUsageMapper.batchSwMedicineUsageDetails(disinfect.getUsageDetails());
|
||||
String username = SecurityUtils.getUsername();
|
||||
String username = SecurityUtils.getLoginUser().getUser().getNickName();
|
||||
disinfect.setUpdateBy(username);
|
||||
disinfect.setUpdateTime(DateUtils.getNowDate());
|
||||
return disinfectMapper.updateDisinfect(disinfect);
|
||||
|
@ -7,7 +7,6 @@ import com.zhyc.common.utils.SecurityUtils;
|
||||
import com.zhyc.common.utils.bean.BeanUtils;
|
||||
import com.zhyc.module.base.domain.SheepFile;
|
||||
import com.zhyc.module.base.mapper.SheepFileMapper;
|
||||
import com.zhyc.module.biosafety.domain.Health;
|
||||
import com.zhyc.module.biosafety.domain.SwMedicineUsage;
|
||||
import com.zhyc.module.biosafety.domain.SwMedicineUsageDetails;
|
||||
import com.zhyc.module.biosafety.mapper.SwMedicineUsageMapper;
|
||||
@ -74,7 +73,7 @@ public class HealthServiceImpl implements IHealthService
|
||||
@Override
|
||||
public int insertHealth(Health health)
|
||||
{
|
||||
String username = SecurityUtils.getUsername();
|
||||
String username = SecurityUtils.getLoginUser().getUser().getNickName();
|
||||
|
||||
// 使用记录的文件
|
||||
SwMedicineUsage medicineUsage = new SwMedicineUsage();
|
||||
@ -120,7 +119,7 @@ public class HealthServiceImpl implements IHealthService
|
||||
}
|
||||
medicineUsageMapper.deleteSwMedicineUsageDetailsByMediUsage(health.getUsageId());
|
||||
medicineUsageMapper.batchSwMedicineUsageDetails(health.getUsageDetails());
|
||||
String username = SecurityUtils.getUsername();
|
||||
String username = SecurityUtils.getLoginUser().getUser().getNickName();
|
||||
health.setUpdateBy(username);
|
||||
health.setUpdateTime(DateUtils.getNowDate());
|
||||
return healthMapper.updateHealth(health);
|
||||
|
@ -7,7 +7,6 @@ import com.zhyc.common.utils.SecurityUtils;
|
||||
import com.zhyc.common.utils.bean.BeanUtils;
|
||||
import com.zhyc.module.base.domain.SheepFile;
|
||||
import com.zhyc.module.base.mapper.SheepFileMapper;
|
||||
import com.zhyc.module.biosafety.domain.Deworm;
|
||||
import com.zhyc.module.biosafety.domain.SwMedicineUsage;
|
||||
import com.zhyc.module.biosafety.domain.SwMedicineUsageDetails;
|
||||
import com.zhyc.module.biosafety.mapper.SwMedicineUsageMapper;
|
||||
@ -76,7 +75,7 @@ public class ImmunityServiceImpl implements IImmunityService
|
||||
@Override
|
||||
public int insertImmunity(Immunity immunity)
|
||||
{
|
||||
String username = SecurityUtils.getUsername();
|
||||
String username = SecurityUtils.getLoginUser().getUser().getNickName();
|
||||
|
||||
// 使用记录的文件
|
||||
SwMedicineUsage medicineUsage = new SwMedicineUsage();
|
||||
@ -129,6 +128,8 @@ public class ImmunityServiceImpl implements IImmunityService
|
||||
}
|
||||
medicineUsageMapper.deleteSwMedicineUsageDetailsByMediUsage(immunity.getUsageId());
|
||||
medicineUsageMapper.batchSwMedicineUsageDetails(immunity.getUsageDetails());
|
||||
String username = SecurityUtils.getLoginUser().getUser().getNickName();
|
||||
immunity.setUpdateBy(username);
|
||||
immunity.setUpdateTime(DateUtils.getNowDate());
|
||||
return immunityMapper.updateImmunity(immunity);
|
||||
}
|
||||
|
@ -4,7 +4,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import com.zhyc.common.utils.DateUtils;
|
||||
import com.zhyc.common.utils.SecurityUtils;
|
||||
import com.zhyc.common.utils.StringUtils;
|
||||
import com.zhyc.common.utils.bean.BeanUtils;
|
||||
import com.zhyc.module.base.domain.SheepFile;
|
||||
import com.zhyc.module.base.service.impl.SheepFileServiceImpl;
|
||||
@ -61,10 +60,10 @@ public class QuarantineReportServiceImpl implements IQuarantineReportService
|
||||
@Override
|
||||
public int insertQuarantineReport(QuarantineReport quarantineReport)
|
||||
{
|
||||
String username = SecurityUtils.getUsername();
|
||||
String username = SecurityUtils.getLoginUser().getUser().getNickName();
|
||||
quarantineReport.setCreateBy(username);
|
||||
quarantineReport.setCreateTime(DateUtils.getNowDate());
|
||||
if (quarantineReport.getResult()==null){
|
||||
if (quarantineReport.getResult()==null || quarantineReport.getResult().length()==0){
|
||||
quarantineReport.setStatus(0);
|
||||
}else {
|
||||
quarantineReport.setStatus(1);
|
||||
@ -97,7 +96,7 @@ public class QuarantineReportServiceImpl implements IQuarantineReportService
|
||||
@Override
|
||||
public int updateQuarantineReport(QuarantineReport quarantineReport)
|
||||
{
|
||||
String username = SecurityUtils.getUsername();
|
||||
String username = SecurityUtils.getLoginUser().getUser().getNickName();
|
||||
quarantineReport.setUpdateBy(username);
|
||||
quarantineReport.setUpdateTime(DateUtils.getNowDate());
|
||||
return quarantineReportMapper.updateQuarantineReport(quarantineReport);
|
||||
|
@ -59,7 +59,7 @@ public class SwMedicineUsageServiceImpl implements ISwMedicineUsageService
|
||||
@Override
|
||||
public int insertSwMedicineUsage(SwMedicineUsage swMedicineUsage)
|
||||
{
|
||||
String username = SecurityUtils.getUsername();
|
||||
String username = SecurityUtils.getLoginUser().getUser().getNickName();
|
||||
swMedicineUsage.setCreateBy(username);
|
||||
swMedicineUsage.setCreateTime(DateUtils.getNowDate());
|
||||
int rows = swMedicineUsageMapper.insertSwMedicineUsage(swMedicineUsage);
|
||||
@ -77,7 +77,7 @@ public class SwMedicineUsageServiceImpl implements ISwMedicineUsageService
|
||||
@Override
|
||||
public int updateSwMedicineUsage(SwMedicineUsage swMedicineUsage)
|
||||
{
|
||||
String username = SecurityUtils.getUsername();
|
||||
String username = SecurityUtils.getLoginUser().getUser().getNickName();
|
||||
swMedicineUsage.setUpdateBy(username);
|
||||
swMedicineUsage.setUpdateTime(DateUtils.getNowDate());
|
||||
swMedicineUsageMapper.deleteSwMedicineUsageDetailsByMediUsage(swMedicineUsage.getId());
|
||||
|
@ -59,7 +59,8 @@ public class SwPrescriptionServiceImpl implements ISwPrescriptionService
|
||||
@Override
|
||||
public int insertSwPrescription(SwPrescription swPrescription)
|
||||
{
|
||||
String username = SecurityUtils.getUsername();
|
||||
// 获取创建人的用户名称
|
||||
String username = SecurityUtils.getLoginUser().getUser().getNickName();
|
||||
swPrescription.setCreateBy(username);
|
||||
swPrescription.setCreateTime(DateUtils.getNowDate());
|
||||
int rows = swPrescriptionMapper.insertSwPrescription(swPrescription);
|
||||
@ -77,7 +78,7 @@ public class SwPrescriptionServiceImpl implements ISwPrescriptionService
|
||||
@Override
|
||||
public int updateSwPrescription(SwPrescription swPrescription)
|
||||
{
|
||||
String username = SecurityUtils.getUsername();
|
||||
String username = SecurityUtils.getLoginUser().getUser().getNickName();
|
||||
swPrescription.setUpdateBy(username);
|
||||
swPrescription.setUpdateTime(DateUtils.getNowDate());
|
||||
swPrescriptionMapper.deleteSwPresDetailByPersId(swPrescription.getId());
|
||||
|
@ -7,7 +7,6 @@ import com.zhyc.common.utils.SecurityUtils;
|
||||
import com.zhyc.common.utils.bean.BeanUtils;
|
||||
import com.zhyc.module.base.domain.SheepFile;
|
||||
import com.zhyc.module.base.mapper.SheepFileMapper;
|
||||
import com.zhyc.module.base.service.impl.SheepFileServiceImpl;
|
||||
import com.zhyc.module.biosafety.domain.SwMedicineUsage;
|
||||
import com.zhyc.module.biosafety.domain.SwMedicineUsageDetails;
|
||||
import com.zhyc.module.biosafety.mapper.SwMedicineUsageMapper;
|
||||
@ -74,7 +73,7 @@ public class TreatmentServiceImpl implements ITreatmentService
|
||||
@Transactional
|
||||
public int insertTreatment(Treatment treatment)
|
||||
{
|
||||
String username = SecurityUtils.getUsername();
|
||||
String username = SecurityUtils.getLoginUser().getUser().getNickName();
|
||||
// 使用记录的文件
|
||||
SwMedicineUsage medicineUsage = new SwMedicineUsage();
|
||||
medicineUsage.setSwMedicineUsageDetailsList(treatment.getUsageDetails());
|
||||
@ -135,7 +134,7 @@ public class TreatmentServiceImpl implements ITreatmentService
|
||||
@Transactional
|
||||
public int updateTreatment(Treatment treatment)
|
||||
{
|
||||
String username = SecurityUtils.getUsername();
|
||||
String username = SecurityUtils.getLoginUser().getUser().getNickName();
|
||||
for (SwMedicineUsageDetails usageDetail : treatment.getUsageDetails()) {
|
||||
usageDetail.setMediUsage(treatment.getUsageId());
|
||||
}
|
||||
|
@ -0,0 +1,27 @@
|
||||
package com.zhyc.module.common.controller;
|
||||
|
||||
import com.zhyc.common.core.domain.AjaxResult;
|
||||
import com.zhyc.module.common.domain.UserPost;
|
||||
|
||||
import com.zhyc.module.common.service.UserPostService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
//人员用户
|
||||
@RestController
|
||||
@RequestMapping("/user")
|
||||
public class UserController {
|
||||
@Autowired
|
||||
UserPostService userPostService;
|
||||
|
||||
@GetMapping()
|
||||
public AjaxResult getUserPost(String postCode){
|
||||
List<UserPost> list = userPostService.getUserPostListByCode(postCode);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.zhyc.module.common.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class UserPost {
|
||||
// 用户名
|
||||
private String nickName;
|
||||
// 用户
|
||||
private String postName;
|
||||
// 岗位编码
|
||||
private String postCode;
|
||||
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package com.zhyc.module.common.mapper;
|
||||
|
||||
import com.zhyc.module.common.domain.UserPost;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface UserPostMapper {
|
||||
|
||||
List<UserPost> getUserPostListByCode(String postCode);
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package com.zhyc.module.common.service;
|
||||
|
||||
import com.zhyc.module.common.domain.UserPost;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface UserPostService {
|
||||
List<UserPost> getUserPostListByCode(String postCode);
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.zhyc.module.common.service.impl;
|
||||
|
||||
import com.zhyc.module.common.domain.UserPost;
|
||||
import com.zhyc.module.common.mapper.UserPostMapper;
|
||||
import com.zhyc.module.common.service.UserPostService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class UserPostServiceImpl implements UserPostService {
|
||||
@Autowired
|
||||
UserPostMapper userPostMapper;
|
||||
@Override
|
||||
public List<UserPost> getUserPostListByCode(String postCode) {
|
||||
return userPostMapper.getUserPostListByCode(postCode);
|
||||
}
|
||||
}
|
@ -4,7 +4,6 @@ import com.zhyc.common.annotation.Log;
|
||||
import com.zhyc.common.core.controller.BaseController;
|
||||
import com.zhyc.common.core.domain.AjaxResult;
|
||||
import com.zhyc.common.enums.BusinessType;
|
||||
import com.zhyc.module.dairyProducts.domain.NpMilkInOutStore;
|
||||
import com.zhyc.module.dairyProducts.service.INpMilkInOutStoreService;
|
||||
import com.zhyc.common.utils.poi.ExcelUtil;
|
||||
import com.zhyc.common.core.page.TableDataInfo;
|
||||
|
@ -8,12 +8,14 @@ import com.zhyc.common.enums.BusinessType;
|
||||
import com.zhyc.common.utils.poi.ExcelUtil;
|
||||
import com.zhyc.module.dairyProducts.domain.NpSheepMilkAnalysis;
|
||||
import com.zhyc.module.dairyProducts.service.INpSheepMilkAnalysisService;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 只保留:分页列表(只读) + 单条查询 + 导出
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/dairyProducts/sheepMilkAnalysis")
|
||||
public class NpSheepMilkAnalysisController extends BaseController {
|
||||
@ -22,58 +24,33 @@ public class NpSheepMilkAnalysisController extends BaseController {
|
||||
private INpSheepMilkAnalysisService npSheepMilkAnalysisService;
|
||||
|
||||
/**
|
||||
* 查询奶产量分析列表
|
||||
* 查询奶产量分析列表(只读,分页)
|
||||
* 支持参数 manageEarTag(耳号模糊) 和 screenDays(筛选天数)
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(NpSheepMilkAnalysis analysis) {
|
||||
startPage();
|
||||
startPage(); // 使用 PageHelper 分页(注意 service 中第一个 DB 调用是 distinct sheep id)
|
||||
List<NpSheepMilkAnalysis> list = npSheepMilkAnalysisService.selectNpSheepMilkAnalysisList(analysis);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取单个分析记录详细信息
|
||||
* 获取单个分析记录详细信息(按 sheepId)
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(npSheepMilkAnalysisService.selectNpSheepMilkAnalysisById(id));
|
||||
}
|
||||
/**
|
||||
* 新增奶产量分析记录
|
||||
*/
|
||||
@Log(title = "奶产量分析", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody NpSheepMilkAnalysis analysis) {
|
||||
return toAjax(npSheepMilkAnalysisService.insertNpSheepMilkAnalysis(analysis));
|
||||
@GetMapping(value = "/{sheepId}")
|
||||
public AjaxResult getInfo(@PathVariable("sheepId") String sheepId) {
|
||||
return AjaxResult.success(npSheepMilkAnalysisService.selectNpSheepMilkAnalysisBySheepId(sheepId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改奶产量分析记录
|
||||
* 导出奶产量分析记录(Excel)
|
||||
* 支持 manageEarTag 与 screenDays 两个查询条件
|
||||
*/
|
||||
@Log(title = "奶产量分析", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody NpSheepMilkAnalysis analysis) {
|
||||
return toAjax(npSheepMilkAnalysisService.updateNpSheepMilkAnalysis(analysis));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除奶产量分析记录
|
||||
*/
|
||||
@Log(title = "奶产量分析", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(npSheepMilkAnalysisService.deleteNpSheepMilkAnalysisByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出奶产量分析记录
|
||||
*/
|
||||
@Log(title = "奶产量分析", businessType = BusinessType.EXPORT)
|
||||
@Log(title = "奶产量分析 导出", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(NpSheepMilkAnalysis analysis) {
|
||||
List<NpSheepMilkAnalysis> list = npSheepMilkAnalysisService.selectNpSheepMilkAnalysisList(analysis);
|
||||
ExcelUtil<NpSheepMilkAnalysis> util = new ExcelUtil<>(NpSheepMilkAnalysis.class);
|
||||
return util.exportExcel(list, "奶产量分析数据");
|
||||
return util.exportExcel(list, "羊奶产量分析数据");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,13 +2,10 @@ package com.zhyc.module.dairyProducts.controller;
|
||||
|
||||
import com.zhyc.common.core.controller.BaseController;
|
||||
import com.zhyc.common.core.domain.AjaxResult;
|
||||
import com.zhyc.module.dairyProducts.domain.Ranch;
|
||||
import com.zhyc.module.dairyProducts.service.IRanchService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/dairyProducts/ranch")
|
||||
public class RanchController extends BaseController {
|
||||
|
@ -19,7 +19,6 @@ import com.zhyc.common.enums.BusinessType;
|
||||
import com.zhyc.module.dairyProducts.domain.XzParityCorrection;
|
||||
import com.zhyc.module.dairyProducts.service.IXzParityCorrectionService;
|
||||
import com.zhyc.common.utils.poi.ExcelUtil;
|
||||
import com.zhyc.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 胎次校正Controller
|
||||
|
@ -5,8 +5,6 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.zhyc.common.annotation.Excel;
|
||||
import com.zhyc.common.core.domain.BaseEntity;
|
||||
|
||||
|
@ -347,8 +347,6 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.zhyc.common.annotation.Excel;
|
||||
import com.zhyc.common.core.domain.BaseEntity;
|
||||
|
||||
|
@ -1,34 +1,64 @@
|
||||
package com.zhyc.module.dairyProducts.domain;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class NpSheepMilkAnalysis {
|
||||
// 唯一键(可用于前端 row-key)
|
||||
private String sheepId;
|
||||
|
||||
// 耳号(从 sheep_file.bs_manage_tags)
|
||||
private String manageEarTag;
|
||||
|
||||
private String variety;
|
||||
|
||||
// 最高校正胎次的挤奶开始时间 & 干奶时间
|
||||
private Date milkingStartTime;
|
||||
private Date dryEndTime;
|
||||
|
||||
// 挤奶天数(该胎次)
|
||||
private Integer milkingDays;
|
||||
|
||||
// 前端传入的筛选天数(screenDays)
|
||||
private Integer screenDays;
|
||||
|
||||
// 分析天数(若你有不同命名,可忽略)
|
||||
private Integer analysisDays;
|
||||
|
||||
// 校正后最大胎次(即校正奶量之和最大的胎次)
|
||||
private Integer maxParity;
|
||||
|
||||
// 最高校正胎次区间内的系统奶量与校正奶量(按筛选窗口)
|
||||
private Double sumSystemMilk;
|
||||
private Double sumCorrectedMilk;
|
||||
|
||||
// 校正日平均奶量(按 min(挤奶天数, 筛选天数))
|
||||
private Double avgCorrectedDaily;
|
||||
|
||||
// 各胎次总奶量(校正)
|
||||
private Double sumParity1Milk;
|
||||
private Double sumParity2Milk;
|
||||
private Double sumParity3Milk;
|
||||
private Double sumParity4Milk;
|
||||
|
||||
// 各胎次日平均(按规则)
|
||||
private Double avgParity1Daily;
|
||||
private Double avgParity2Daily;
|
||||
private Double avgParity3Daily;
|
||||
private Double avgParity4Daily;
|
||||
|
||||
// 泌乳天数(sheep_file.lactation_day)
|
||||
private Integer lactationDays;
|
||||
|
||||
// 过去 7 / 14 / 30 日平均(系统奶量)
|
||||
private Double avgLast7Milk;
|
||||
private Double avgLast7Corrected;
|
||||
private Double avgLast7Corrected; // = avgLast7Milk * weightCoefficient (默认 1.0)
|
||||
private Double avgLast14Milk;
|
||||
private Double avgLast30Milk;
|
||||
|
||||
// 羊只基础信息(来自 sheep_file)
|
||||
private String sheepCategory;
|
||||
private Date birthday;
|
||||
private Integer parity;
|
||||
private Integer parity; // 当前胎次
|
||||
private Integer monthAge;
|
||||
private Double currentWeight;
|
||||
private String breedStatus;
|
||||
@ -36,12 +66,16 @@ public class NpSheepMilkAnalysis {
|
||||
private String motherManageTags;
|
||||
private String ranchName;
|
||||
private String family;
|
||||
|
||||
// 母亲相关字段(由已计算的母亲分析结果中取值)
|
||||
private Integer motherMilkingDays;
|
||||
private Double motherSumCorrected;
|
||||
private Integer motherMaxParity;
|
||||
private Double motherAvgCorrectedDaily;
|
||||
|
||||
private Date lastUpdate;
|
||||
|
||||
// getters and setters
|
||||
public String getSheepId() { return sheepId; }
|
||||
public void setSheepId(String sheepId) { this.sheepId = sheepId; }
|
||||
|
||||
@ -60,6 +94,9 @@ public class NpSheepMilkAnalysis {
|
||||
public Integer getMilkingDays() { return milkingDays; }
|
||||
public void setMilkingDays(Integer milkingDays) { this.milkingDays = milkingDays; }
|
||||
|
||||
public Integer getScreenDays() { return screenDays; }
|
||||
public void setScreenDays(Integer screenDays) { this.screenDays = screenDays; }
|
||||
|
||||
public Integer getAnalysisDays() { return analysisDays; }
|
||||
public void setAnalysisDays(Integer analysisDays) { this.analysisDays = analysisDays; }
|
||||
|
||||
@ -159,4 +196,3 @@ public class NpSheepMilkAnalysis {
|
||||
public Date getLastUpdate() { return lastUpdate; }
|
||||
public void setLastUpdate(Date lastUpdate) { this.lastUpdate = lastUpdate; }
|
||||
}
|
||||
|
||||
|
@ -5,8 +5,6 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.zhyc.common.annotation.Excel;
|
||||
import com.zhyc.common.core.domain.BaseEntity;
|
||||
|
||||
|
@ -5,8 +5,6 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.zhyc.common.annotation.Excel;
|
||||
import com.zhyc.common.core.domain.BaseEntity;
|
||||
|
||||
|
@ -3,8 +3,6 @@ package com.zhyc.module.dairyProducts.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;
|
||||
|
||||
|
@ -5,8 +5,6 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.zhyc.common.annotation.Excel;
|
||||
import com.zhyc.common.core.domain.BaseEntity;
|
||||
|
||||
|
@ -1,19 +1,36 @@
|
||||
package com.zhyc.module.dairyProducts.mapper;
|
||||
|
||||
import com.zhyc.module.dairyProducts.domain.NpSheepMilkAnalysis;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface NpSheepMilkAnalysisMapper {
|
||||
|
||||
NpSheepMilkAnalysis selectNpSheepMilkAnalysisById(Long id);
|
||||
/**
|
||||
* 按筛选天数 screenDays 统计并返回所有羊只的奶产量分析
|
||||
*/
|
||||
List<NpSheepMilkAnalysis> selectAnalysisForExport(@Param("screenDays") Integer screenDays);
|
||||
|
||||
List<NpSheepMilkAnalysis> selectNpSheepMilkAnalysisList(NpSheepMilkAnalysis analysis);
|
||||
/**
|
||||
* 根据羊只ID查询羊只奶产量分析信息,返回Map结构
|
||||
*/
|
||||
Map<String, Object> selectNpSheepMilkAnalysisBySheepId(@Param("sheepId") String sheepId);
|
||||
|
||||
int insertNpSheepMilkAnalysis(NpSheepMilkAnalysis analysis);
|
||||
/**
|
||||
* 根据管理耳标筛选,返回distinct的sheepId列表
|
||||
*/
|
||||
List<String> selectDistinctSheepIds(@Param("manageEarTag") String manageEarTag);
|
||||
|
||||
int updateNpSheepMilkAnalysis(NpSheepMilkAnalysis analysis);
|
||||
/**
|
||||
* 根据羊只ID查询羊只档案信息,返回Map结构
|
||||
*/
|
||||
Map<String, Object> selectSheepFileBySheepId(@Param("sheepId") String sheepId);
|
||||
|
||||
int deleteNpSheepMilkAnalysisById(Long id);
|
||||
/**
|
||||
* 根据羊只ID查询挤奶班次数据,返回List<Map>
|
||||
*/
|
||||
List<Map<String, Object>> selectMilkRecordsBySheepId(@Param("sheepId") String sheepId);
|
||||
|
||||
int deleteNpSheepMilkAnalysisByIds(Long[] ids);
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.zhyc.module.dairyProducts.service;
|
||||
|
||||
import com.zhyc.module.dairyProducts.domain.NpMilkInOutStore;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.Date;
|
||||
|
@ -5,16 +5,8 @@ import java.util.List;
|
||||
|
||||
public interface INpSheepMilkAnalysisService {
|
||||
|
||||
NpSheepMilkAnalysis selectNpSheepMilkAnalysisById(Long id);
|
||||
NpSheepMilkAnalysis selectNpSheepMilkAnalysisBySheepId(String sheepId);
|
||||
|
||||
List<NpSheepMilkAnalysis> selectNpSheepMilkAnalysisList(NpSheepMilkAnalysis analysis);
|
||||
|
||||
int insertNpSheepMilkAnalysis(NpSheepMilkAnalysis analysis);
|
||||
|
||||
int updateNpSheepMilkAnalysis(NpSheepMilkAnalysis analysis);
|
||||
|
||||
int deleteNpSheepMilkAnalysisById(Long id);
|
||||
|
||||
int deleteNpSheepMilkAnalysisByIds(Long[] ids);
|
||||
}
|
||||
|
||||
|
@ -1,12 +1,17 @@
|
||||
package com.zhyc.module.dairyProducts.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.zhyc.module.dairyProducts.mapper.NpSheepMilkAnalysisMapper;
|
||||
import com.zhyc.module.dairyProducts.domain.NpSheepMilkAnalysis;
|
||||
import com.zhyc.module.dairyProducts.mapper.NpSheepMilkAnalysisMapper;
|
||||
import com.zhyc.module.dairyProducts.service.INpSheepMilkAnalysisService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.ZoneId;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class NpSheepMilkAnalysisServiceImpl implements INpSheepMilkAnalysisService {
|
||||
@ -14,34 +19,268 @@ public class NpSheepMilkAnalysisServiceImpl implements INpSheepMilkAnalysisServi
|
||||
@Autowired
|
||||
private NpSheepMilkAnalysisMapper npSheepMilkAnalysisMapper;
|
||||
|
||||
// 将 Rec 定义为静态内部类
|
||||
private static class Rec {
|
||||
LocalDate date;
|
||||
double systemMilk;
|
||||
double correctedMilk;
|
||||
int parity;
|
||||
}
|
||||
|
||||
// 将 ParityStat 定义为静态内部类
|
||||
private static class ParityStat {
|
||||
int parity;
|
||||
double sumCorrected;
|
||||
double sumSystem;
|
||||
LocalDate first;
|
||||
LocalDate last;
|
||||
long days;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NpSheepMilkAnalysis selectNpSheepMilkAnalysisById(Long id) {
|
||||
return npSheepMilkAnalysisMapper.selectNpSheepMilkAnalysisById(id);
|
||||
public NpSheepMilkAnalysis selectNpSheepMilkAnalysisBySheepId(String sheepId) {
|
||||
Map<String, Object> map = npSheepMilkAnalysisMapper.selectNpSheepMilkAnalysisBySheepId(sheepId);
|
||||
if (map == null) return null;
|
||||
NpSheepMilkAnalysis ana = new NpSheepMilkAnalysis();
|
||||
ana.setSheepId(sheepId);
|
||||
ana.setManageEarTag((String) map.get("manageEarTag"));
|
||||
return ana;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NpSheepMilkAnalysis> selectNpSheepMilkAnalysisList(NpSheepMilkAnalysis analysis) {
|
||||
return npSheepMilkAnalysisMapper.selectNpSheepMilkAnalysisList(analysis);
|
||||
int screenDays = (analysis != null && analysis.getScreenDays() != null) ? analysis.getScreenDays() : 100;
|
||||
String manageEarTagFilter = (analysis != null) ? analysis.getManageEarTag() : null;
|
||||
|
||||
List<String> sheepIds = npSheepMilkAnalysisMapper.selectDistinctSheepIds(manageEarTagFilter);
|
||||
if (CollectionUtils.isEmpty(sheepIds)) return Collections.emptyList();
|
||||
|
||||
List<NpSheepMilkAnalysis> resultList = new ArrayList<>();
|
||||
Map<String, NpSheepMilkAnalysis> mapByManageTag = new HashMap<>();
|
||||
|
||||
for (String sheepId : sheepIds) {
|
||||
Map<String, Object> sf = npSheepMilkAnalysisMapper.selectSheepFileBySheepId(sheepId);
|
||||
List<Map<String, Object>> records = npSheepMilkAnalysisMapper.selectMilkRecordsBySheepId(sheepId);
|
||||
|
||||
if (records == null || records.isEmpty()) {
|
||||
NpSheepMilkAnalysis emptyAna = new NpSheepMilkAnalysis();
|
||||
emptyAna.setSheepId(sheepId);
|
||||
if (sf != null) {
|
||||
emptyAna.setManageEarTag((String) sf.get("manageEarTag"));
|
||||
emptyAna.setVariety((String) sf.get("variety"));
|
||||
emptyAna.setLactationDays(toInteger(sf.get("lactationDay")));
|
||||
emptyAna.setSheepCategory((String) sf.get("sheepType"));
|
||||
emptyAna.setBirthday(convertToDate(sf.get("birthday")));
|
||||
emptyAna.setParity(toInteger(sf.get("currentParity")));
|
||||
emptyAna.setMonthAge(toInteger(sf.get("monthAge")));
|
||||
emptyAna.setCurrentWeight(toDouble(sf.get("currentWeight")));
|
||||
emptyAna.setBreedStatus((String) sf.get("breedStatus"));
|
||||
emptyAna.setFatherManageTags((String) sf.get("fatherManageTags"));
|
||||
emptyAna.setMotherManageTags((String) sf.get("motherManageTags"));
|
||||
emptyAna.setRanchName((String) sf.get("ranchName"));
|
||||
emptyAna.setFamily((String) sf.get("family"));
|
||||
}
|
||||
resultList.add(emptyAna);
|
||||
mapByManageTag.put(emptyAna.getManageEarTag(), emptyAna);
|
||||
continue;
|
||||
}
|
||||
|
||||
// 使用静态内部类 Rec
|
||||
List<Rec> recs = new ArrayList<>();
|
||||
for (Map<String, Object> r : records) {
|
||||
Rec rr = new Rec();
|
||||
rr.date = toLocalDate(r.get("classDate"));
|
||||
rr.systemMilk = toDouble(r.get("systemMilk"));
|
||||
rr.correctedMilk = toDouble(r.get("correctedMilk"));
|
||||
rr.parity = (r.get("parity") == null) ? 0 : Integer.parseInt(String.valueOf(r.get("parity")));
|
||||
recs.add(rr);
|
||||
}
|
||||
|
||||
Map<Integer, List<Rec>> byParity = recs.stream().collect(Collectors.groupingBy(r -> r.parity));
|
||||
|
||||
// 使用静态内部类 ParityStat
|
||||
List<ParityStat> parityStats = new ArrayList<>();
|
||||
for (Map.Entry<Integer, List<Rec>> e : byParity.entrySet()) {
|
||||
List<Rec> list = e.getValue();
|
||||
double sumCorr = list.stream().mapToDouble(x -> x.correctedMilk).sum();
|
||||
double sumSys = list.stream().mapToDouble(x -> x.systemMilk).sum();
|
||||
LocalDate first = list.stream().map(x -> x.date).min(LocalDate::compareTo).get();
|
||||
LocalDate last = list.stream().map(x -> x.date).max(LocalDate::compareTo).get();
|
||||
long days = ChronoUnit.DAYS.between(first, last) + 1;
|
||||
ParityStat ps = new ParityStat();
|
||||
ps.parity = e.getKey();
|
||||
ps.sumCorrected = sumCorr;
|
||||
ps.sumSystem = sumSys;
|
||||
ps.first = first;
|
||||
ps.last = last;
|
||||
ps.days = Math.max(days, 1);
|
||||
parityStats.add(ps);
|
||||
}
|
||||
|
||||
parityStats.sort(Comparator.comparingDouble((ParityStat p) -> p.sumCorrected).reversed()
|
||||
.thenComparingInt(p -> p.parity));
|
||||
ParityStat maxParityStat = parityStats.get(0);
|
||||
|
||||
LocalDate windowStart = maxParityStat.first;
|
||||
LocalDate windowEndByDays = windowStart.plusDays(screenDays - 1);
|
||||
LocalDate actualWindowEnd = (maxParityStat.last.isBefore(windowEndByDays)) ? maxParityStat.last : windowEndByDays;
|
||||
|
||||
double sumSystemWindow = recs.stream()
|
||||
.filter(r -> r.parity == maxParityStat.parity && !r.date.isBefore(windowStart) && !r.date.isAfter(actualWindowEnd))
|
||||
.mapToDouble(r -> r.systemMilk).sum();
|
||||
|
||||
double sumCorrectedWindow = recs.stream()
|
||||
.filter(r -> r.parity == maxParityStat.parity && !r.date.isBefore(windowStart) && !r.date.isAfter(actualWindowEnd))
|
||||
.mapToDouble(r -> r.correctedMilk).sum();
|
||||
|
||||
long milkingDays = maxParityStat.days;
|
||||
long denominator = Math.min(milkingDays, screenDays);
|
||||
double avgCorrectedDaily = (denominator > 0) ? (sumCorrectedWindow / (double) denominator) : 0.0;
|
||||
|
||||
double sumParity1 = parityStats.stream().filter(p -> p.parity == 1).mapToDouble(p -> p.sumCorrected).sum();
|
||||
double sumParity2 = parityStats.stream().filter(p -> p.parity == 2).mapToDouble(p -> p.sumCorrected).sum();
|
||||
double sumParity3 = parityStats.stream().filter(p -> p.parity == 3).mapToDouble(p -> p.sumCorrected).sum();
|
||||
double sumParity4 = parityStats.stream().filter(p -> p.parity == 4).mapToDouble(p -> p.sumCorrected).sum();
|
||||
|
||||
// 你之前的 computeParityAvg 方法里没实现,保留调用0
|
||||
double avgP1 = computeParityAvg(parityStats, 1, screenDays);
|
||||
double avgP2 = computeParityAvg(parityStats, 2, screenDays);
|
||||
double avgP3 = computeParityAvg(parityStats, 3, screenDays);
|
||||
double avgP4 = computeParityAvg(parityStats, 4, screenDays);
|
||||
|
||||
LocalDate lastDate = recs.stream().map(r -> r.date).max(LocalDate::compareTo).get();
|
||||
double avgLast7 = computeLastNDaysAvg(recs, lastDate, 7);
|
||||
double avgLast14 = computeLastNDaysAvg(recs, lastDate, 14);
|
||||
double avgLast30 = computeLastNDaysAvg(recs, lastDate, 30);
|
||||
|
||||
double weightCoefficient = 1.0;
|
||||
if (sf != null && sf.get("weighCoefficient") != null) {
|
||||
weightCoefficient = toDouble(sf.get("weighCoefficient"));
|
||||
}
|
||||
double avgLast7Corrected = avgLast7 * weightCoefficient;
|
||||
|
||||
NpSheepMilkAnalysis ana = new NpSheepMilkAnalysis();
|
||||
ana.setSheepId(sheepId);
|
||||
ana.setManageEarTag(sf == null ? null : (String) sf.get("manageEarTag"));
|
||||
ana.setVariety(sf == null ? null : (String) sf.get("variety"));
|
||||
ana.setMilkingStartTime(toDate(windowStart));
|
||||
ana.setDryEndTime(toDate(maxParityStat.last));
|
||||
ana.setMilkingDays((int) milkingDays);
|
||||
ana.setScreenDays(screenDays);
|
||||
ana.setMaxParity(maxParityStat.parity);
|
||||
ana.setSumSystemMilk(sumSystemWindow);
|
||||
ana.setSumCorrectedMilk(sumCorrectedWindow);
|
||||
ana.setAvgCorrectedDaily(avgCorrectedDaily);
|
||||
ana.setSumParity1Milk(sumParity1);
|
||||
ana.setSumParity2Milk(sumParity2);
|
||||
ana.setSumParity3Milk(sumParity3);
|
||||
ana.setSumParity4Milk(sumParity4);
|
||||
ana.setAvgParity1Daily(avgP1);
|
||||
ana.setAvgParity2Daily(avgP2);
|
||||
ana.setAvgParity3Daily(avgP3);
|
||||
ana.setAvgParity4Daily(avgP4);
|
||||
ana.setLactationDays(toInteger(sf == null ? null : sf.get("lactationDay")));
|
||||
ana.setAvgLast7Milk(avgLast7);
|
||||
ana.setAvgLast7Corrected(avgLast7Corrected);
|
||||
ana.setAvgLast14Milk(avgLast14);
|
||||
ana.setAvgLast30Milk(avgLast30);
|
||||
|
||||
if (sf != null) {
|
||||
ana.setSheepCategory((String) sf.get("sheepType"));
|
||||
ana.setBirthday(convertToDate(sf.get("birthday")));
|
||||
ana.setParity(toInteger(sf.get("currentParity")));
|
||||
ana.setMonthAge(toInteger(sf.get("monthAge")));
|
||||
ana.setCurrentWeight(toDouble(sf.get("currentWeight")));
|
||||
ana.setBreedStatus((String) sf.get("breedStatus"));
|
||||
ana.setFatherManageTags((String) sf.get("fatherManageTags"));
|
||||
ana.setMotherManageTags((String) sf.get("motherManageTags"));
|
||||
ana.setRanchName((String) sf.get("ranchName"));
|
||||
ana.setFamily((String) sf.get("family"));
|
||||
}
|
||||
|
||||
ana.setLastUpdate(toDate(lastDate));
|
||||
|
||||
resultList.add(ana);
|
||||
mapByManageTag.put(ana.getManageEarTag(), ana);
|
||||
}
|
||||
|
||||
// 填充母亲相关字段
|
||||
for (NpSheepMilkAnalysis a : resultList) {
|
||||
String motherTag = a.getMotherManageTags();
|
||||
if (motherTag != null && mapByManageTag.containsKey(motherTag)) {
|
||||
NpSheepMilkAnalysis mom = mapByManageTag.get(motherTag);
|
||||
a.setMotherMilkingDays(mom.getMilkingDays());
|
||||
a.setMotherSumCorrected(mom.getSumCorrectedMilk());
|
||||
a.setMotherMaxParity(mom.getMaxParity());
|
||||
a.setMotherAvgCorrectedDaily(mom.getAvgCorrectedDaily());
|
||||
}
|
||||
}
|
||||
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertNpSheepMilkAnalysis(NpSheepMilkAnalysis analysis) {
|
||||
return npSheepMilkAnalysisMapper.insertNpSheepMilkAnalysis(analysis);
|
||||
private static Date convertToDate(Object obj) {
|
||||
if (obj == null) return null;
|
||||
if (obj instanceof Date) {
|
||||
return (Date) obj;
|
||||
}
|
||||
if (obj instanceof java.sql.Date) {
|
||||
return new Date(((java.sql.Date) obj).getTime());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateNpSheepMilkAnalysis(NpSheepMilkAnalysis analysis) {
|
||||
return npSheepMilkAnalysisMapper.updateNpSheepMilkAnalysis(analysis);
|
||||
private static LocalDate toLocalDate(Object obj) {
|
||||
if (obj == null) return null;
|
||||
if (obj instanceof java.sql.Date) {
|
||||
return ((java.sql.Date) obj).toLocalDate();
|
||||
}
|
||||
if (obj instanceof Date) {
|
||||
return ((Date) obj).toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteNpSheepMilkAnalysisById(Long id) {
|
||||
return npSheepMilkAnalysisMapper.deleteNpSheepMilkAnalysisById(id);
|
||||
private static Date toDate(LocalDate ld) {
|
||||
if (ld == null) return null;
|
||||
return Date.from(ld.atStartOfDay(ZoneId.systemDefault()).toInstant());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteNpSheepMilkAnalysisByIds(Long[] ids) {
|
||||
return npSheepMilkAnalysisMapper.deleteNpSheepMilkAnalysisByIds(ids);
|
||||
private static Integer toInteger(Object obj) {
|
||||
if (obj == null) return null;
|
||||
if (obj instanceof Number) return ((Number) obj).intValue();
|
||||
try {
|
||||
return Integer.parseInt(obj.toString());
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static Double toDouble(Object obj) {
|
||||
if (obj == null) return 0.0;
|
||||
if (obj instanceof Number) return ((Number) obj).doubleValue();
|
||||
try {
|
||||
return Double.parseDouble(obj.toString());
|
||||
} catch (Exception e) {
|
||||
return 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
private double computeParityAvg(List<ParityStat> stats, int parity, int screenDays) {
|
||||
// 这里你之前实现是直接返回0,可按需完善
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
private double computeLastNDaysAvg(List<Rec> recs, LocalDate lastDate, int days) {
|
||||
LocalDate startDate = lastDate.minusDays(days - 1);
|
||||
double sum = 0;
|
||||
int count = 0;
|
||||
for (Rec r : recs) {
|
||||
if (r.date != null && !r.date.isBefore(startDate) && !r.date.isAfter(lastDate)) {
|
||||
sum += r.correctedMilk;
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return (count > 0) ? (sum / count) : 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,236 @@
|
||||
package com.zhyc.module.feed.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.zhyc.module.feed.domain.SgFeedPlan;
|
||||
import com.zhyc.module.feed.domain.SgFormulaManagement;
|
||||
import com.zhyc.module.feed.service.ISgFeedPlanService;
|
||||
import com.zhyc.module.feed.service.ISgFormulaManagementService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.zhyc.common.annotation.Log;
|
||||
import com.zhyc.common.core.controller.BaseController;
|
||||
import com.zhyc.common.core.domain.AjaxResult;
|
||||
import com.zhyc.common.enums.BusinessType;
|
||||
import com.zhyc.module.feed.domain.SgFeedList;
|
||||
import com.zhyc.module.feed.service.ISgFeedListService;
|
||||
import com.zhyc.common.utils.poi.ExcelUtil;
|
||||
import com.zhyc.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 配料清单Controller
|
||||
*
|
||||
* @author HashMap
|
||||
* @date 2025-08-19
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/feed/FeedList")
|
||||
public class SgFeedListController extends BaseController {
|
||||
private final ISgFeedListService sgFeedListService;
|
||||
|
||||
private final ISgFormulaManagementService sgFormulaManagementService;
|
||||
|
||||
private final ISgFeedPlanService sgFeedPlanService;
|
||||
|
||||
private final Map<String, SgFeedList> sgFeedListMap = new HashMap<>();
|
||||
|
||||
public static boolean refresh = true;
|
||||
|
||||
@Autowired
|
||||
public SgFeedListController(ISgFeedListService sgFeedListService, ISgFormulaManagementService sgFormulaManagementService, ISgFeedPlanService sgFeedPlanService) {
|
||||
this.sgFeedListService = sgFeedListService;
|
||||
this.sgFormulaManagementService = sgFormulaManagementService;
|
||||
this.sgFeedPlanService = sgFeedPlanService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询配料清单列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('feed:FeedList:list')")
|
||||
@GetMapping("/list")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public TableDataInfo list(SgFeedList sgFeedList) {
|
||||
/*
|
||||
刷新缓存
|
||||
当配方管理表出现更新 或 饲喂计划表出现增删改时会将refresh置为true 通知此处进行刷新
|
||||
*/
|
||||
if (refresh) {
|
||||
SyncFeedList();
|
||||
refresh = false;
|
||||
}
|
||||
startPage();
|
||||
List<SgFeedList> list = sgFeedListService.selectSgFeedListList(sgFeedList);
|
||||
// 用 map 中已有的数据替换 list 中的元素
|
||||
List<SgFeedList> replacedList = new ArrayList<>();
|
||||
for (SgFeedList item : list) {
|
||||
String key = item.getFormulaId() + "_" + item.getFormulaBatchId();
|
||||
// 从缓存中取出完整对象
|
||||
SgFeedList itemInCache = sgFeedListMap.getOrDefault(key, item);
|
||||
// 将数据库查询的基本信息替换掉缓存中去除的内容 - 前端展示与修改需要
|
||||
itemInCache.setId(item.getId());
|
||||
itemInCache.setFormulaBatchId(item.getFormulaBatchId());
|
||||
itemInCache.setFormulaId(item.getFormulaId());
|
||||
itemInCache.setZookeeper(item.getZookeeper());
|
||||
itemInCache.setDeployDate(item.getDeployDate());
|
||||
// 替换为 map 中的对象
|
||||
replacedList.add(itemInCache);
|
||||
}
|
||||
return getDataTable(replacedList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出配料清单列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('feed:FeedList:export')")
|
||||
@Log(title = "配料清单", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SgFeedList sgFeedList) {
|
||||
List<SgFeedList> list = sgFeedListService.selectSgFeedListList(sgFeedList);
|
||||
ExcelUtil<SgFeedList> util = new ExcelUtil<>(SgFeedList.class);
|
||||
util.exportExcel(response, list, "配料清单数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取配料清单详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('feed:FeedList:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(sgFeedListService.selectSgFeedListById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增配料清单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('feed:FeedList:add')")
|
||||
@Log(title = "配料清单", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SgFeedList sgFeedList) {
|
||||
return toAjax(sgFeedListService.insertSgFeedList(sgFeedList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改配料清单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('feed:FeedList:edit')")
|
||||
@Log(title = "配料清单", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SgFeedList sgFeedList) {
|
||||
return toAjax(sgFeedListService.updateSgFeedList(sgFeedList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除配料清单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('feed:FeedList:remove')")
|
||||
@Log(title = "配料清单", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(sgFeedListService.deleteSgFeedListByIds(ids));
|
||||
}
|
||||
|
||||
|
||||
public void SyncFeedList() {
|
||||
// 清空旧缓存
|
||||
sgFeedListMap.clear();
|
||||
// 获取配方管理和现有配料清单内容
|
||||
List<SgFormulaManagement> formulaManagementList = sgFormulaManagementService.selectSgFormulaManagementList(new SgFormulaManagement());
|
||||
List<SgFeedList> feedLists = sgFeedListService.selectSgFeedListList(new SgFeedList());
|
||||
// 将最新查询的配料清单加入缓存
|
||||
for (SgFeedList sgFeedList : feedLists) {
|
||||
sgFeedListMap.put(sgFeedList.getFormulaId() + "_" + sgFeedList.getFormulaBatchId(), sgFeedList);
|
||||
}
|
||||
// 与新的配方管理列表同步 - 如果配料清单没有对应数据则加入
|
||||
for (SgFormulaManagement sgFormulaManagement : formulaManagementList) {
|
||||
// 匹配 但忽略模板配方
|
||||
if (sgFormulaManagement.getFormulaId() != null && sgFormulaManagement.getBatchId() != null && !sgFormulaManagement.getBatchId().equals("0")) {
|
||||
// 查询当前配方管理项是否存在现有配料计划中 (不论是否存在都要设置,因为缓存被清空,存在则更新,不存在则插入)
|
||||
boolean isExist = sgFeedListMap.containsKey(sgFormulaManagement.getFormulaId() + "_" + sgFormulaManagement.getBatchId());
|
||||
// 标志位 : 如果当前配方不在饲喂计划中则不生成配量清单
|
||||
boolean isPlan = true;
|
||||
// 设置缓存对象具体值
|
||||
SgFeedList sgFeedList = new SgFeedList();
|
||||
sgFeedList.setFormulaId(sgFormulaManagement.getFormulaId());
|
||||
sgFeedList.setFormulaBatchId(sgFormulaManagement.getBatchId());
|
||||
sgFeedList.setFormulaList(sgFormulaManagement.getSgFormulaList());
|
||||
sgFeedList.setRootFormula(sgFormulaManagement);
|
||||
|
||||
|
||||
// 从饲喂计划列表中查出对应值(饲喂量需要计划中的比例计算)
|
||||
SgFeedPlan rootPlanQuery = new SgFeedPlan();
|
||||
rootPlanQuery.setFormulaId(sgFormulaManagement.getFormulaId());
|
||||
rootPlanQuery.setBatchId(sgFormulaManagement.getBatchId());
|
||||
List<SgFeedPlan> sgFeedPlans = sgFeedPlanService.selectSgFeedPlanList(rootPlanQuery);
|
||||
// 为空则标识当前配方不在饲喂计划中 && 不在缓存中设置
|
||||
if (sgFeedPlans.isEmpty()) {
|
||||
isPlan = false;
|
||||
} else {
|
||||
// rootPlan中存储的是该配方批号的总量
|
||||
SgFeedPlan rootPlan = computePlanTotal(sgFeedPlans);
|
||||
|
||||
// 将计划实体对象设置到配料清单中
|
||||
sgFeedList.setRootPlan(rootPlan);
|
||||
|
||||
// 完整的配料清单对象加入缓存
|
||||
sgFeedListMap.put(sgFormulaManagement.getFormulaId() + "_" + sgFormulaManagement.getBatchId(), sgFeedList);
|
||||
}
|
||||
|
||||
// 不存在则插入
|
||||
if (!isExist && isPlan) {
|
||||
sgFeedListService.insertSgFeedList(sgFeedList);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算某个配方某个批次的总和值
|
||||
*
|
||||
* @param sgFeedPlans 配方计划列表
|
||||
* @return 各个值总和
|
||||
*/
|
||||
private static SgFeedPlan computePlanTotal(List<SgFeedPlan> sgFeedPlans) {
|
||||
SgFeedPlan rootPlan = new SgFeedPlan();
|
||||
if (!sgFeedPlans.isEmpty()) {
|
||||
int sheepCountTotal = 0;
|
||||
double sheepDailySize = 0.0;
|
||||
double planFeedMorningSize = 0.0;
|
||||
double planFeedNoonSize = 0.0;
|
||||
double planFeedAfternoonSize = 0.0;
|
||||
double planFeedTotalSize = 0.0;
|
||||
for (SgFeedPlan sgFeedPlan : sgFeedPlans) {
|
||||
sheepCountTotal += sgFeedPlan.getSheepCount();
|
||||
sheepDailySize += sgFeedPlan.getPlanDailySize();
|
||||
planFeedMorningSize += sgFeedPlan.getPlanMorningSize();
|
||||
planFeedNoonSize += sgFeedPlan.getPlanNoonSize();
|
||||
planFeedAfternoonSize += sgFeedPlan.getPlanAfternoonSize();
|
||||
planFeedTotalSize += sgFeedPlan.getPlanFeedTotal();
|
||||
}
|
||||
|
||||
rootPlan.setSheepCount(sheepCountTotal);
|
||||
rootPlan.setPlanDailySize(sheepDailySize);
|
||||
rootPlan.setPlanMorningSize(planFeedMorningSize);
|
||||
rootPlan.setPlanNoonSize(planFeedNoonSize);
|
||||
rootPlan.setPlanAfternoonSize(planFeedAfternoonSize);
|
||||
rootPlan.setPlanFeedTotal(planFeedTotalSize);
|
||||
|
||||
// 设置计划日期
|
||||
rootPlan.setPlanDate(sgFeedPlans.get(0).getPlanDate());
|
||||
}
|
||||
return rootPlan;
|
||||
}
|
||||
}
|
@ -0,0 +1,131 @@
|
||||
package com.zhyc.module.feed.controller;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.zhyc.module.feed.domain.SgFeedPlan;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.zhyc.common.annotation.Log;
|
||||
import com.zhyc.common.core.controller.BaseController;
|
||||
import com.zhyc.common.core.domain.AjaxResult;
|
||||
import com.zhyc.common.enums.BusinessType;
|
||||
import com.zhyc.module.feed.service.ISgFeedPlanService;
|
||||
import com.zhyc.common.utils.poi.ExcelUtil;
|
||||
import com.zhyc.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 饲喂计划Controller
|
||||
*
|
||||
* @author HashMap
|
||||
* @date 2025-08-14
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/feed/FeedPlan")
|
||||
public class SgFeedPlanController extends BaseController {
|
||||
private final ISgFeedPlanService sgFeedPlanService;
|
||||
|
||||
public SgFeedPlanController(ISgFeedPlanService sgFeedPlanService) {
|
||||
this.sgFeedPlanService = sgFeedPlanService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询饲喂计划列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('feed:FeedPlan:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SgFeedPlan sgFeedPlan) {
|
||||
startPage();
|
||||
List<SgFeedPlan> list = sgFeedPlanService.selectSgFeedPlanList(sgFeedPlan);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出饲喂计划列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('feed:FeedPlan:export')")
|
||||
@Log(title = "饲喂计划", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SgFeedPlan sgFeedPlan) {
|
||||
List<SgFeedPlan> list = sgFeedPlanService.selectSgFeedPlanList(sgFeedPlan);
|
||||
ExcelUtil<SgFeedPlan> util = new ExcelUtil<>(SgFeedPlan.class);
|
||||
util.exportExcel(response, list, "饲喂计划数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取饲喂计划详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('feed:FeedPlan:query')")
|
||||
@GetMapping(value = "/{createDate}")
|
||||
public AjaxResult getInfo(@PathVariable("createDate") Date createDate) {
|
||||
return success(sgFeedPlanService.selectSgFeedPlanByCreateDate(createDate));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增饲喂计划
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('feed:FeedPlan:add')")
|
||||
@Log(title = "饲喂计划", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SgFeedPlan sgFeedPlan) {
|
||||
if (null == sgFeedPlan) {
|
||||
throw new RuntimeException("数据为空");
|
||||
}
|
||||
sgFeedPlan.setCreateDate(new Date());
|
||||
// 计算其他字段值
|
||||
setPlan(sgFeedPlan);
|
||||
// 通知配料清单刷新数据
|
||||
SgFeedListController.refresh = true;
|
||||
return toAjax(sgFeedPlanService.insertSgFeedPlan(sgFeedPlan));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改饲喂计划
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('feed:FeedPlan:edit')")
|
||||
@Log(title = "饲喂计划", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SgFeedPlan sgFeedPlan) {
|
||||
// 根据修改后的值重新计算
|
||||
setPlan(sgFeedPlan);
|
||||
// 通知配料清单刷新数据
|
||||
SgFeedListController.refresh = true;
|
||||
return toAjax(sgFeedPlanService.updateSgFeedPlan(sgFeedPlan));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除饲喂计划
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('feed:FeedPlan:remove')")
|
||||
@Log(title = "饲喂计划", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{createDates}")
|
||||
public AjaxResult remove(@PathVariable Date[] createDates) {
|
||||
// 通知配料清单刷新数据
|
||||
SgFeedListController.refresh = true;
|
||||
return toAjax(sgFeedPlanService.deleteSgFeedPlanByCreateDates(createDates));
|
||||
}
|
||||
|
||||
/**
|
||||
* 设定计划值
|
||||
* 用于添加和修改
|
||||
*/
|
||||
private void setPlan(SgFeedPlan sgFeedPlan) {
|
||||
// 根据羊舍ID获取羊只数量
|
||||
int countByFoldId = sgFeedPlanService.getSheepCountByFoldId(sgFeedPlan.getSheepHouseId());
|
||||
sgFeedPlan.setSheepCount(countByFoldId);
|
||||
// 计算总计划量
|
||||
sgFeedPlan.setPlanFeedTotal(countByFoldId * sgFeedPlan.getPlanDailySize());
|
||||
// 计算早中晚计划量
|
||||
sgFeedPlan.setPlanMorningSize(sgFeedPlan.getPlanFeedTotal() * (sgFeedPlan.getRatioMorning() / 100));
|
||||
sgFeedPlan.setPlanNoonSize(sgFeedPlan.getPlanFeedTotal() * (sgFeedPlan.getRatioNoon() / 100));
|
||||
sgFeedPlan.setPlanAfternoonSize(sgFeedPlan.getPlanFeedTotal() * (sgFeedPlan.getRatioAfternoon() / 100));
|
||||
}
|
||||
}
|
@ -0,0 +1,106 @@
|
||||
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.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.zhyc.common.annotation.Log;
|
||||
import com.zhyc.common.core.controller.BaseController;
|
||||
import com.zhyc.common.core.domain.AjaxResult;
|
||||
import com.zhyc.common.enums.BusinessType;
|
||||
import com.zhyc.module.feed.domain.SgFormulaList;
|
||||
import com.zhyc.module.feed.service.ISgFormulaListService;
|
||||
import com.zhyc.common.utils.poi.ExcelUtil;
|
||||
import com.zhyc.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 配方列表Controller
|
||||
*
|
||||
* @author HashMap
|
||||
* @date 2025-08-09
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/feed/FormulaList")
|
||||
public class SgFormulaListController extends BaseController
|
||||
{
|
||||
private final ISgFormulaListService sgFormulaListService;
|
||||
|
||||
public SgFormulaListController(ISgFormulaListService sgFormulaListService) {
|
||||
this.sgFormulaListService = sgFormulaListService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询配方列表列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('feed:FormulaList:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SgFormulaList sgFormulaList)
|
||||
{
|
||||
startPage();
|
||||
List<SgFormulaList> list = sgFormulaListService.selectSgFormulaListList(sgFormulaList);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出配方列表列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('feed:FormulaList:export')")
|
||||
@Log(title = "配方列表", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SgFormulaList sgFormulaList)
|
||||
{
|
||||
List<SgFormulaList> list = sgFormulaListService.selectSgFormulaListList(sgFormulaList);
|
||||
ExcelUtil<SgFormulaList> util = new ExcelUtil<>(SgFormulaList.class);
|
||||
util.exportExcel(response, list, "配方列表数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取配方列表详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('feed:FormulaList:query')")
|
||||
@GetMapping(value = "/{code}")
|
||||
public AjaxResult getInfo(@PathVariable("code") Long code)
|
||||
{
|
||||
return success(sgFormulaListService.selectSgFormulaListByCode(code));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增配方列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('feed:FormulaList:add')")
|
||||
@Log(title = "配方列表", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SgFormulaList sgFormulaList)
|
||||
{
|
||||
return toAjax(sgFormulaListService.insertSgFormulaList(sgFormulaList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改配方列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('feed:FormulaList:edit')")
|
||||
@Log(title = "配方列表", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SgFormulaList sgFormulaList)
|
||||
{
|
||||
return toAjax(sgFormulaListService.updateSgFormulaList(sgFormulaList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除配方列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('feed:FormulaList:remove')")
|
||||
@Log(title = "配方列表", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{codes}")
|
||||
public AjaxResult remove(@PathVariable Long[] codes)
|
||||
{
|
||||
return toAjax(sgFormulaListService.deleteSgFormulaListByCodes(codes));
|
||||
}
|
||||
}
|
@ -0,0 +1,178 @@
|
||||
package com.zhyc.module.feed.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.zhyc.module.feed.domain.SgFormulaList;
|
||||
import com.zhyc.module.feed.service.ISgFormulaListService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.zhyc.common.annotation.Log;
|
||||
import com.zhyc.common.core.controller.BaseController;
|
||||
import com.zhyc.common.core.domain.AjaxResult;
|
||||
import com.zhyc.common.enums.BusinessType;
|
||||
import com.zhyc.module.feed.domain.SgFormulaManagement;
|
||||
import com.zhyc.module.feed.service.ISgFormulaManagementService;
|
||||
import com.zhyc.common.utils.poi.ExcelUtil;
|
||||
import com.zhyc.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 配方管理Controller
|
||||
*
|
||||
* @author HashMap
|
||||
* @date 2025-08-09
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/feed/FormulaManagement")
|
||||
public class SgFormulaManagementController extends BaseController {
|
||||
private final ISgFormulaManagementService sgFormulaManagementService;
|
||||
private final ISgFormulaListService sgFormulaListService;
|
||||
|
||||
public SgFormulaManagementController(ISgFormulaManagementService sgFormulaManagementService, ISgFormulaListService sgFormulaListService) {
|
||||
this.sgFormulaManagementService = sgFormulaManagementService;
|
||||
this.sgFormulaListService = sgFormulaListService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询配方管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('feed:FormulaManagement:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SgFormulaManagement sgFormulaManagement) {
|
||||
startPage();
|
||||
// 非查询详情时设定BatchId为0查询配方模板
|
||||
if (null != sgFormulaManagement && !Objects.equals(sgFormulaManagement.getQueryType(), "query")) {
|
||||
sgFormulaManagement.setBatchId("0");
|
||||
}
|
||||
List<SgFormulaManagement> FormulaManagement = sgFormulaManagementService.selectSgFormulaManagementList(sgFormulaManagement);
|
||||
for (SgFormulaManagement sgFormulaManagementItem : FormulaManagement) {
|
||||
SgFormulaManagement query = new SgFormulaManagement();
|
||||
query.setFormulaId(sgFormulaManagementItem.getFormulaId());
|
||||
query.setQueryType("Sub");
|
||||
List<SgFormulaManagement> subFormula = sgFormulaManagementService.selectSgFormulaManagementList(query);
|
||||
sgFormulaManagementItem.setSubFormulaList(subFormula);
|
||||
}
|
||||
return getDataTable(FormulaManagement);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出配方管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('feed:FormulaManagement:export')")
|
||||
@Log(title = "配方管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SgFormulaManagement sgFormulaManagement) {
|
||||
List<SgFormulaManagement> list = sgFormulaManagementService.selectSgFormulaManagementList(sgFormulaManagement);
|
||||
ExcelUtil<SgFormulaManagement> util = new ExcelUtil<>(SgFormulaManagement.class);
|
||||
util.exportExcel(response, list, "配方管理数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取配方管理详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('feed:FormulaManagement:query')")
|
||||
@GetMapping(value = "/{formulaId}")
|
||||
public AjaxResult getInfo(@PathVariable("formulaId") String formulaId) {
|
||||
return success(sgFormulaManagementService.selectSgFormulaManagementByFormulaId(formulaId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增配方管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('feed:FormulaManagement:add')")
|
||||
@Log(title = "配方管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult add(@RequestBody SgFormulaManagement sgFormulaManagement) {
|
||||
if (null == sgFormulaManagement)
|
||||
throw new RuntimeException("ERROR: 数据为空");
|
||||
if (Objects.equals(sgFormulaManagement.getBatchId(), "0")) {
|
||||
SgFormulaManagement exist = sgFormulaManagementService.selectSgFormulaManagementByFormulaId(sgFormulaManagement.getFormulaId());
|
||||
if (exist != null) {
|
||||
throw new RuntimeException("WARNING: 配方编码重复,录入失败");
|
||||
}
|
||||
} else {
|
||||
SgFormulaManagement exist = new SgFormulaManagement();
|
||||
exist.setFormulaId(sgFormulaManagement.getFormulaId());
|
||||
exist.setBatchId(sgFormulaManagement.getBatchId());
|
||||
if (!sgFormulaManagementService.selectSgFormulaManagementList(exist).isEmpty()) {
|
||||
throw new RuntimeException("WARNING: 批号重复,录入失败");
|
||||
}
|
||||
}
|
||||
List<SgFormulaList> sgFormulaList = sgFormulaManagement.getSgFormulaList();
|
||||
for (SgFormulaList sgFormulaListItem : sgFormulaList) {
|
||||
// 前端引用模板数据时会引用主键Code,在插入前置为空
|
||||
sgFormulaListItem.setCode(null);
|
||||
sgFormulaListItem.setFormulaId(sgFormulaManagement.getFormulaId());
|
||||
sgFormulaListItem.setBatchId(sgFormulaManagement.getBatchId());
|
||||
sgFormulaListService.insertSgFormulaList(sgFormulaListItem);
|
||||
}
|
||||
return toAjax(sgFormulaManagementService.insertSgFormulaManagement(sgFormulaManagement));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改配方管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('feed:FormulaManagement:edit')")
|
||||
@Log(title = "配方管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult edit(@RequestBody SgFormulaManagement sgFormulaManagement) {
|
||||
List<SgFormulaList> sgFormulaList = sgFormulaManagement.getSgFormulaList();
|
||||
if (null != sgFormulaManagement.getFormulaId() && null != sgFormulaManagement.getBatchId()) {
|
||||
SgFormulaList delete = new SgFormulaList();
|
||||
delete.setFormulaId(sgFormulaManagement.getFormulaId());
|
||||
delete.setBatchId(sgFormulaManagement.getBatchId());
|
||||
sgFormulaListService.deleteSgFormulaListByFormulaIdAndBatchId(delete);
|
||||
} else {
|
||||
throw new RuntimeException("FormulaID & BatchID不能为空");
|
||||
}
|
||||
|
||||
// 配方表同步更新
|
||||
for (SgFormulaList sgFormulaListItem : sgFormulaList) {
|
||||
sgFormulaListItem.setBatchId(sgFormulaManagement.getBatchId());
|
||||
sgFormulaListItem.setFormulaId(sgFormulaManagement.getFormulaId());
|
||||
sgFormulaListService.insertSgFormulaList(sgFormulaListItem);
|
||||
}
|
||||
|
||||
// 通知配料清单刷新数据
|
||||
SgFeedListController.refresh = true;
|
||||
return toAjax(sgFormulaManagementService.updateSgFormulaManagement(sgFormulaManagement));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除配方管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('feed:FormulaManagement:remove')")
|
||||
@Log(title = "配方管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{formulaId}/{batchId}")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult remove(@PathVariable String formulaId, @PathVariable String batchId) {
|
||||
SgFormulaManagement sgFormulaManagement = new SgFormulaManagement();
|
||||
sgFormulaManagement.setFormulaId(formulaId);
|
||||
sgFormulaManagement.setBatchId(batchId);
|
||||
if (sgFormulaManagement.getBatchId().equals("0")) {
|
||||
sgFormulaManagement.setBatchId(null);
|
||||
List<SgFormulaManagement> list = sgFormulaManagementService.selectSgFormulaManagementList(sgFormulaManagement);
|
||||
if (list.size() > 1) {
|
||||
throw new RuntimeException("WARNING 该配方正被使用,无法删除");
|
||||
}
|
||||
sgFormulaManagement.setBatchId(batchId);
|
||||
}
|
||||
// 前置检查完毕 执行删除
|
||||
sgFormulaManagement.setBatchId(batchId);
|
||||
|
||||
// 通知配料清单刷新数据
|
||||
SgFeedListController.refresh = true;
|
||||
return toAjax(sgFormulaManagementService.deleteSgFormulaManagement(sgFormulaManagement));
|
||||
}
|
||||
}
|
@ -0,0 +1,106 @@
|
||||
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.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.zhyc.common.annotation.Log;
|
||||
import com.zhyc.common.core.controller.BaseController;
|
||||
import com.zhyc.common.core.domain.AjaxResult;
|
||||
import com.zhyc.common.enums.BusinessType;
|
||||
import com.zhyc.module.feed.domain.SgMaterial;
|
||||
import com.zhyc.module.feed.service.ISgMaterialService;
|
||||
import com.zhyc.common.utils.poi.ExcelUtil;
|
||||
import com.zhyc.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 原料Controller
|
||||
*
|
||||
* @author HashMap
|
||||
* @date 2025-08-11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/feed/material")
|
||||
public class SgMaterialController extends BaseController
|
||||
{
|
||||
private final ISgMaterialService sgMaterialService;
|
||||
|
||||
public SgMaterialController(ISgMaterialService sgMaterialService) {
|
||||
this.sgMaterialService = sgMaterialService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询原料列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('feed:material:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SgMaterial sgMaterial)
|
||||
{
|
||||
startPage();
|
||||
List<SgMaterial> list = sgMaterialService.selectSgMaterialList(sgMaterial);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出原料列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('feed:material:export')")
|
||||
@Log(title = "原料", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SgMaterial sgMaterial)
|
||||
{
|
||||
List<SgMaterial> list = sgMaterialService.selectSgMaterialList(sgMaterial);
|
||||
ExcelUtil<SgMaterial> util = new ExcelUtil<>(SgMaterial.class);
|
||||
util.exportExcel(response, list, "原料数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取原料详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('feed:material:query')")
|
||||
@GetMapping(value = "/{materialId}")
|
||||
public AjaxResult getInfo(@PathVariable("materialId") String materialId)
|
||||
{
|
||||
return success(sgMaterialService.selectSgMaterialByMaterialId(materialId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增原料
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('feed:material:add')")
|
||||
@Log(title = "原料", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SgMaterial sgMaterial)
|
||||
{
|
||||
return toAjax(sgMaterialService.insertSgMaterial(sgMaterial));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改原料
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('feed:material:edit')")
|
||||
@Log(title = "原料", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SgMaterial sgMaterial)
|
||||
{
|
||||
return toAjax(sgMaterialService.updateSgMaterial(sgMaterial));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除原料
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('feed:material:remove')")
|
||||
@Log(title = "原料", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{materialIds}")
|
||||
public AjaxResult remove(@PathVariable String[] materialIds)
|
||||
{
|
||||
return toAjax(sgMaterialService.deleteSgMaterialByMaterialIds(materialIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,67 @@
|
||||
package com.zhyc.module.feed.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 配料清单对象 sg_feed_list
|
||||
*
|
||||
* @author HashMap
|
||||
* @date 2025-08-19
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class SgFeedList extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 序号 */
|
||||
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;
|
||||
|
||||
private SgFormulaManagement rootFormula;
|
||||
|
||||
private SgFeedPlan rootPlan;
|
||||
|
||||
private Double morningTotal;
|
||||
private Double noonTotal;
|
||||
private Double afternoonTotal;
|
||||
|
||||
private List<SgFormulaList> formulaList;
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("formulaId", getFormulaId())
|
||||
.append("formulaBatchId", getFormulaBatchId())
|
||||
.append("zookeeper", getZookeeper())
|
||||
.append("deployDate", getDeployDate())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,135 @@
|
||||
package com.zhyc.module.feed.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 饲喂计划对象 sg_feed_plan
|
||||
*
|
||||
* @author HashMap
|
||||
* @date 2025-08-14
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class SgFeedPlan extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 创建日期 */
|
||||
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();
|
||||
}
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package com.zhyc.module.feed.domain;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 配方列表对象 sg_formula_list
|
||||
*
|
||||
* @author HashMap
|
||||
* @date 2025-08-09
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class SgFormulaList extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 序号 */
|
||||
private Long code;
|
||||
|
||||
/** 配方编号 */
|
||||
private String formulaId;
|
||||
|
||||
/** 配方编号 */
|
||||
private String batchId;
|
||||
/** 原料编号 */
|
||||
@Excel(name = "原料编号")
|
||||
private String materialId;
|
||||
|
||||
/** 原料名称 */
|
||||
@Excel(name = "原料名称")
|
||||
private String materialName;
|
||||
|
||||
/** 比例 */
|
||||
@Excel(name = "比例")
|
||||
private Long ratio;
|
||||
|
||||
/** 颗粒原料 */
|
||||
@Excel(name = "颗粒原料")
|
||||
private String isGranular;
|
||||
|
||||
/** 补饲 */
|
||||
@Excel(name = "补饲")
|
||||
private String isSupplement;
|
||||
|
||||
@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();
|
||||
}
|
||||
}
|
@ -0,0 +1,79 @@
|
||||
package com.zhyc.module.feed.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 配方管理对象 sg_formula_management
|
||||
*
|
||||
* @author HashMap
|
||||
* @date 2025-08-09
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class SgFormulaManagement extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 配方编号 */
|
||||
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<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();
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.zhyc.module.feed.domain;
|
||||
|
||||
import com.zhyc.common.core.domain.BaseEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public class SgMaterial extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String materialId;
|
||||
private String materialName;
|
||||
private String isGranular;
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
package com.zhyc.module.feed.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.zhyc.module.feed.domain.SgFeedList;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 配料清单Mapper接口
|
||||
*
|
||||
* @author HashMap
|
||||
* @date 2025-08-19
|
||||
*/
|
||||
@Mapper
|
||||
public interface SgFeedListMapper
|
||||
{
|
||||
/**
|
||||
* 查询配料清单
|
||||
*
|
||||
* @param id 配料清单主键
|
||||
* @return 配料清单
|
||||
*/
|
||||
SgFeedList selectSgFeedListById(Long id);
|
||||
|
||||
/**
|
||||
* 查询配料清单列表
|
||||
*
|
||||
* @param sgFeedList 配料清单
|
||||
* @return 配料清单集合
|
||||
*/
|
||||
List<SgFeedList> selectSgFeedListList(SgFeedList sgFeedList);
|
||||
|
||||
/**
|
||||
* 新增配料清单
|
||||
*
|
||||
* @param sgFeedList 配料清单
|
||||
* @return 结果
|
||||
*/
|
||||
int insertSgFeedList(SgFeedList sgFeedList);
|
||||
|
||||
/**
|
||||
* 修改配料清单
|
||||
*
|
||||
* @param sgFeedList 配料清单
|
||||
* @return 结果
|
||||
*/
|
||||
int updateSgFeedList(SgFeedList sgFeedList);
|
||||
|
||||
/**
|
||||
* 删除配料清单
|
||||
*
|
||||
* @param id 配料清单主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteSgFeedListById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除配料清单
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteSgFeedListByIds(Long[] ids);
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
package com.zhyc.module.feed.mapper;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import com.zhyc.module.feed.domain.SgFeedPlan;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 饲喂计划Mapper接口
|
||||
*
|
||||
* @author HashMap
|
||||
* @date 2025-08-14
|
||||
*/
|
||||
@Mapper
|
||||
public interface SgFeedPlanMapper
|
||||
{
|
||||
/**
|
||||
* 查询饲喂计划
|
||||
*
|
||||
* @param createDate 饲喂计划主键
|
||||
* @return 饲喂计划
|
||||
*/
|
||||
public SgFeedPlan selectSgFeedPlanByCreateDate(Date createDate);
|
||||
|
||||
/**
|
||||
* 查询饲喂计划列表
|
||||
*
|
||||
* @param sgFeedPlan 饲喂计划
|
||||
* @return 饲喂计划集合
|
||||
*/
|
||||
public List<SgFeedPlan> selectSgFeedPlanList(SgFeedPlan sgFeedPlan);
|
||||
|
||||
/**
|
||||
* 新增饲喂计划
|
||||
*
|
||||
* @param sgFeedPlan 饲喂计划
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSgFeedPlan(SgFeedPlan sgFeedPlan);
|
||||
|
||||
/**
|
||||
* 修改饲喂计划
|
||||
*
|
||||
* @param sgFeedPlan 饲喂计划
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSgFeedPlan(SgFeedPlan sgFeedPlan);
|
||||
|
||||
/**
|
||||
* 删除饲喂计划
|
||||
*
|
||||
* @param createDate 饲喂计划主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSgFeedPlanByCreateDate(Date createDate);
|
||||
|
||||
/**
|
||||
* 批量删除饲喂计划
|
||||
*
|
||||
* @param createDates 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSgFeedPlanByCreateDates(Date[] createDates);
|
||||
|
||||
int selectSheepCountByFoldId(Integer foldId);
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
package com.zhyc.module.feed.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.zhyc.module.feed.domain.SgFormulaList;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 配方列表Mapper接口
|
||||
*
|
||||
* @author HashMap
|
||||
* @date 2025-08-09
|
||||
*/
|
||||
@Mapper
|
||||
public interface SgFormulaListMapper
|
||||
{
|
||||
/**
|
||||
* 查询配方列表
|
||||
*
|
||||
* @param code 配方列表主键
|
||||
* @return 配方列表
|
||||
*/
|
||||
SgFormulaList selectSgFormulaListByCode(Long code);
|
||||
|
||||
/**
|
||||
* 查询配方列表列表
|
||||
*
|
||||
* @param sgFormulaList 配方列表
|
||||
* @return 配方列表集合
|
||||
*/
|
||||
List<SgFormulaList> selectSgFormulaListList(SgFormulaList sgFormulaList);
|
||||
|
||||
/**
|
||||
* 新增配方列表
|
||||
*
|
||||
* @param sgFormulaList 配方列表
|
||||
* @return 结果
|
||||
*/
|
||||
int insertSgFormulaList(SgFormulaList sgFormulaList);
|
||||
|
||||
/**
|
||||
* 修改配方列表
|
||||
*
|
||||
* @param sgFormulaList 配方列表
|
||||
* @return 结果
|
||||
*/
|
||||
int updateSgFormulaList(SgFormulaList sgFormulaList);
|
||||
|
||||
/**
|
||||
* 删除配方列表
|
||||
*
|
||||
* @param code 配方列表主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteSgFormulaListByCode(Long code);
|
||||
|
||||
/**
|
||||
* 批量删除配方列表
|
||||
*
|
||||
* @param codes 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteSgFormulaListByCodes(Long[] codes);
|
||||
|
||||
/**
|
||||
* 批量删除配方列表
|
||||
*
|
||||
* @param sgFormulaList 参数实体
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteSgFormulaListByFormulaIdAndBatchId(SgFormulaList sgFormulaList);
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package com.zhyc.module.feed.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.zhyc.module.feed.domain.SgFormulaManagement;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 配方管理Mapper接口
|
||||
*
|
||||
* @author HashMap
|
||||
* @date 2025-08-09
|
||||
*/
|
||||
@Mapper
|
||||
public interface SgFormulaManagementMapper
|
||||
{
|
||||
/**
|
||||
* 查询配方管理
|
||||
*
|
||||
* @param formulaId 配方管理主键
|
||||
* @return 配方管理
|
||||
*/
|
||||
SgFormulaManagement selectSgFormulaManagementByFormulaId(String formulaId);
|
||||
|
||||
/**
|
||||
* 查询配方管理列表
|
||||
*
|
||||
* @param sgFormulaManagement 配方管理
|
||||
* @return 配方管理集合
|
||||
*/
|
||||
List<SgFormulaManagement> selectSgFormulaManagementList(SgFormulaManagement sgFormulaManagement);
|
||||
|
||||
/**
|
||||
* 新增配方管理
|
||||
*
|
||||
* @param sgFormulaManagement 配方管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertSgFormulaManagement(SgFormulaManagement sgFormulaManagement);
|
||||
|
||||
/**
|
||||
* 修改配方管理
|
||||
*
|
||||
* @param sgFormulaManagement 配方管理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateSgFormulaManagement(SgFormulaManagement sgFormulaManagement);
|
||||
|
||||
/**
|
||||
* 删除配方管理
|
||||
*
|
||||
* @param formulaId 配方管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteSgFormulaManagementByFormulaId(String formulaId);
|
||||
|
||||
/**
|
||||
* 批量删除配方管理
|
||||
*
|
||||
* @param formulaIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteSgFormulaManagementByFormulaIds(String[] formulaIds);
|
||||
|
||||
int deleteSgFormulaManagement(SgFormulaManagement sgFormulaManagement);
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
package com.zhyc.module.feed.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.zhyc.module.feed.domain.SgMaterial;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 原料Mapper接口
|
||||
*
|
||||
* @author HashMap
|
||||
* @date 2025-08-11
|
||||
*/
|
||||
@Mapper
|
||||
public interface SgMaterialMapper
|
||||
{
|
||||
/**
|
||||
* 查询原料
|
||||
*
|
||||
* @param materialId 原料主键
|
||||
* @return 原料
|
||||
*/
|
||||
public SgMaterial selectSgMaterialByMaterialId(String materialId);
|
||||
|
||||
/**
|
||||
* 查询原料列表
|
||||
*
|
||||
* @param sgMaterial 原料
|
||||
* @return 原料集合
|
||||
*/
|
||||
public List<SgMaterial> selectSgMaterialList(SgMaterial sgMaterial);
|
||||
|
||||
/**
|
||||
* 新增原料
|
||||
*
|
||||
* @param sgMaterial 原料
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSgMaterial(SgMaterial sgMaterial);
|
||||
|
||||
/**
|
||||
* 修改原料
|
||||
*
|
||||
* @param sgMaterial 原料
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSgMaterial(SgMaterial sgMaterial);
|
||||
|
||||
/**
|
||||
* 删除原料
|
||||
*
|
||||
* @param materialId 原料主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSgMaterialByMaterialId(String materialId);
|
||||
|
||||
/**
|
||||
* 批量删除原料
|
||||
*
|
||||
* @param materialIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSgMaterialByMaterialIds(String[] materialIds);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.zhyc.module.feed.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.zhyc.module.feed.domain.SgFeedList;
|
||||
|
||||
/**
|
||||
* 配料清单Service接口
|
||||
*
|
||||
* @author HashMap
|
||||
* @date 2025-08-19
|
||||
*/
|
||||
public interface ISgFeedListService
|
||||
{
|
||||
/**
|
||||
* 查询配料清单
|
||||
*
|
||||
* @param id 配料清单主键
|
||||
* @return 配料清单
|
||||
*/
|
||||
SgFeedList selectSgFeedListById(Long id);
|
||||
|
||||
/**
|
||||
* 查询配料清单列表
|
||||
*
|
||||
* @param sgFeedList 配料清单
|
||||
* @return 配料清单集合
|
||||
*/
|
||||
List<SgFeedList> selectSgFeedListList(SgFeedList sgFeedList);
|
||||
|
||||
/**
|
||||
* 新增配料清单
|
||||
*
|
||||
* @param sgFeedList 配料清单
|
||||
* @return 结果
|
||||
*/
|
||||
int insertSgFeedList(SgFeedList sgFeedList);
|
||||
|
||||
/**
|
||||
* 修改配料清单
|
||||
*
|
||||
* @param sgFeedList 配料清单
|
||||
* @return 结果
|
||||
*/
|
||||
int updateSgFeedList(SgFeedList sgFeedList);
|
||||
|
||||
/**
|
||||
* 批量删除配料清单
|
||||
*
|
||||
* @param ids 需要删除的配料清单主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteSgFeedListByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除配料清单信息
|
||||
*
|
||||
* @param id 配料清单主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteSgFeedListById(Long id);
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.zhyc.module.feed.service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import com.zhyc.module.feed.domain.SgFeedPlan;
|
||||
|
||||
/**
|
||||
* 饲喂计划Service接口
|
||||
*
|
||||
* @author HashMap
|
||||
* @date 2025-08-14
|
||||
*/
|
||||
public interface ISgFeedPlanService
|
||||
{
|
||||
/**
|
||||
* 查询饲喂计划
|
||||
*
|
||||
* @param createDate 饲喂计划主键
|
||||
* @return 饲喂计划
|
||||
*/
|
||||
public SgFeedPlan selectSgFeedPlanByCreateDate(Date createDate);
|
||||
|
||||
/**
|
||||
* 查询饲喂计划列表
|
||||
*
|
||||
* @param sgFeedPlan 饲喂计划
|
||||
* @return 饲喂计划集合
|
||||
*/
|
||||
public List<SgFeedPlan> selectSgFeedPlanList(SgFeedPlan sgFeedPlan);
|
||||
|
||||
/**
|
||||
* 新增饲喂计划
|
||||
*
|
||||
* @param sgFeedPlan 饲喂计划
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSgFeedPlan(SgFeedPlan sgFeedPlan);
|
||||
|
||||
/**
|
||||
* 修改饲喂计划
|
||||
*
|
||||
* @param sgFeedPlan 饲喂计划
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSgFeedPlan(SgFeedPlan sgFeedPlan);
|
||||
|
||||
/**
|
||||
* 批量删除饲喂计划
|
||||
*
|
||||
* @param createDates 需要删除的饲喂计划主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSgFeedPlanByCreateDates(Date[] createDates);
|
||||
|
||||
/**
|
||||
* 删除饲喂计划信息
|
||||
*
|
||||
* @param createDate 饲喂计划主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSgFeedPlanByCreateDate(Date createDate);
|
||||
|
||||
int getSheepCountByFoldId(Integer foldId);
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
package com.zhyc.module.feed.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.zhyc.module.feed.domain.SgFormulaList;
|
||||
|
||||
/**
|
||||
* 配方列表Service接口
|
||||
*
|
||||
* @author HashMap
|
||||
* @date 2025-08-09
|
||||
*/
|
||||
public interface ISgFormulaListService
|
||||
{
|
||||
/**
|
||||
* 查询配方列表
|
||||
*
|
||||
* @param code 配方列表主键
|
||||
* @return 配方列表
|
||||
*/
|
||||
SgFormulaList selectSgFormulaListByCode(Long code);
|
||||
|
||||
/**
|
||||
* 查询配方列表列表
|
||||
*
|
||||
* @param sgFormulaList 配方列表
|
||||
* @return 配方列表集合
|
||||
*/
|
||||
List<SgFormulaList> selectSgFormulaListList(SgFormulaList sgFormulaList);
|
||||
|
||||
/**
|
||||
* 新增配方列表
|
||||
*
|
||||
* @param sgFormulaList 配方列表
|
||||
* @return 结果
|
||||
*/
|
||||
int insertSgFormulaList(SgFormulaList sgFormulaList);
|
||||
|
||||
/**
|
||||
* 修改配方列表
|
||||
*
|
||||
* @param sgFormulaList 配方列表
|
||||
* @return 结果
|
||||
*/
|
||||
int updateSgFormulaList(SgFormulaList sgFormulaList);
|
||||
|
||||
/**
|
||||
* 批量删除配方列表
|
||||
*
|
||||
* @param codes 需要删除的配方列表主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteSgFormulaListByCodes(Long[] codes);
|
||||
|
||||
/**
|
||||
* 删除配方列表信息
|
||||
*
|
||||
* @param code 配方列表主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteSgFormulaListByCode(Long code);
|
||||
|
||||
int deleteSgFormulaListByFormulaIdAndBatchId(SgFormulaList sgFormulaList);
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
package com.zhyc.module.feed.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.zhyc.module.feed.domain.SgFormulaManagement;
|
||||
|
||||
/**
|
||||
* 配方管理Service接口
|
||||
*
|
||||
* @author HashMap
|
||||
* @date 2025-08-09
|
||||
*/
|
||||
public interface ISgFormulaManagementService
|
||||
{
|
||||
/**
|
||||
* 查询配方管理
|
||||
*
|
||||
* @param formulaId 配方管理主键
|
||||
* @return 配方管理
|
||||
*/
|
||||
SgFormulaManagement selectSgFormulaManagementByFormulaId(String formulaId);
|
||||
|
||||
/**
|
||||
* 查询配方管理列表
|
||||
*
|
||||
* @param sgFormulaManagement 配方管理
|
||||
* @return 配方管理集合
|
||||
*/
|
||||
List<SgFormulaManagement> selectSgFormulaManagementList(SgFormulaManagement sgFormulaManagement);
|
||||
|
||||
/**
|
||||
* 新增配方管理
|
||||
*
|
||||
* @param sgFormulaManagement 配方管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertSgFormulaManagement(SgFormulaManagement sgFormulaManagement);
|
||||
|
||||
/**
|
||||
* 修改配方管理
|
||||
*
|
||||
* @param sgFormulaManagement 配方管理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateSgFormulaManagement(SgFormulaManagement sgFormulaManagement);
|
||||
|
||||
/**
|
||||
* 批量删除配方管理
|
||||
*
|
||||
* @param formulaIds 需要删除的配方管理主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteSgFormulaManagementByFormulaIds(String[] formulaIds);
|
||||
|
||||
/**
|
||||
* 删除配方管理信息
|
||||
*
|
||||
* @param formulaId 配方管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteSgFormulaManagementByFormulaId(String formulaId);
|
||||
|
||||
/***
|
||||
* 删除配方管理信息
|
||||
*/
|
||||
int deleteSgFormulaManagement(SgFormulaManagement sgFormulaManagement);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.zhyc.module.feed.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.zhyc.module.feed.domain.SgMaterial;
|
||||
|
||||
/**
|
||||
* 原料Service接口
|
||||
*
|
||||
* @author HashMap
|
||||
* @date 2025-08-11
|
||||
*/
|
||||
public interface ISgMaterialService
|
||||
{
|
||||
/**
|
||||
* 查询原料
|
||||
*
|
||||
* @param materialId 原料主键
|
||||
* @return 原料
|
||||
*/
|
||||
SgMaterial selectSgMaterialByMaterialId(String materialId);
|
||||
|
||||
/**
|
||||
* 查询原料列表
|
||||
*
|
||||
* @param sgMaterial 原料
|
||||
* @return 原料集合
|
||||
*/
|
||||
List<SgMaterial> selectSgMaterialList(SgMaterial sgMaterial);
|
||||
|
||||
/**
|
||||
* 新增原料
|
||||
*
|
||||
* @param sgMaterial 原料
|
||||
* @return 结果
|
||||
*/
|
||||
int insertSgMaterial(SgMaterial sgMaterial);
|
||||
|
||||
/**
|
||||
* 修改原料
|
||||
*
|
||||
* @param sgMaterial 原料
|
||||
* @return 结果
|
||||
*/
|
||||
int updateSgMaterial(SgMaterial sgMaterial);
|
||||
|
||||
/**
|
||||
* 批量删除原料
|
||||
*
|
||||
* @param materialIds 需要删除的原料主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteSgMaterialByMaterialIds(String[] materialIds);
|
||||
|
||||
/**
|
||||
* 删除原料信息
|
||||
*
|
||||
* @param materialId 原料主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteSgMaterialByMaterialId(String materialId);
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package com.zhyc.module.feed.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.zhyc.module.feed.mapper.SgFeedListMapper;
|
||||
import com.zhyc.module.feed.domain.SgFeedList;
|
||||
import com.zhyc.module.feed.service.ISgFeedListService;
|
||||
|
||||
/**
|
||||
* 配料清单Service业务层处理
|
||||
*
|
||||
* @author HashMap
|
||||
* @date 2025-08-19
|
||||
*/
|
||||
@Service
|
||||
public class SgFeedListServiceImpl implements ISgFeedListService
|
||||
{
|
||||
private final SgFeedListMapper sgFeedListMapper;
|
||||
|
||||
public SgFeedListServiceImpl(SgFeedListMapper sgFeedListMapper) {
|
||||
this.sgFeedListMapper = sgFeedListMapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询配料清单
|
||||
*
|
||||
* @param id 配料清单主键
|
||||
* @return 配料清单
|
||||
*/
|
||||
@Override
|
||||
public SgFeedList selectSgFeedListById(Long id)
|
||||
{
|
||||
return sgFeedListMapper.selectSgFeedListById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询配料清单列表
|
||||
*
|
||||
* @param sgFeedList 配料清单
|
||||
* @return 配料清单
|
||||
*/
|
||||
@Override
|
||||
public List<SgFeedList> selectSgFeedListList(SgFeedList sgFeedList)
|
||||
{
|
||||
return sgFeedListMapper.selectSgFeedListList(sgFeedList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增配料清单
|
||||
*
|
||||
* @param sgFeedList 配料清单
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSgFeedList(SgFeedList sgFeedList)
|
||||
{
|
||||
return sgFeedListMapper.insertSgFeedList(sgFeedList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改配料清单
|
||||
*
|
||||
* @param sgFeedList 配料清单
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSgFeedList(SgFeedList sgFeedList)
|
||||
{
|
||||
return sgFeedListMapper.updateSgFeedList(sgFeedList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除配料清单
|
||||
*
|
||||
* @param ids 需要删除的配料清单主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSgFeedListByIds(Long[] ids)
|
||||
{
|
||||
return sgFeedListMapper.deleteSgFeedListByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除配料清单信息
|
||||
*
|
||||
* @param id 配料清单主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSgFeedListById(Long id)
|
||||
{
|
||||
return sgFeedListMapper.deleteSgFeedListById(id);
|
||||
}
|
||||
}
|
@ -0,0 +1,104 @@
|
||||
package com.zhyc.module.feed.service.impl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.zhyc.module.feed.mapper.SgFeedPlanMapper;
|
||||
import com.zhyc.module.feed.domain.SgFeedPlan;
|
||||
import com.zhyc.module.feed.service.ISgFeedPlanService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 饲喂计划Service业务层处理
|
||||
*
|
||||
* @author HashMap
|
||||
* @date 2025-08-14
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor=Exception.class)
|
||||
public class SgFeedPlanServiceImpl implements ISgFeedPlanService
|
||||
{
|
||||
private final SgFeedPlanMapper sgFeedPlanMapper;
|
||||
|
||||
public SgFeedPlanServiceImpl(SgFeedPlanMapper sgFeedPlanMapper) {
|
||||
this.sgFeedPlanMapper = sgFeedPlanMapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询饲喂计划
|
||||
*
|
||||
* @param createDate 饲喂计划主键
|
||||
* @return 饲喂计划
|
||||
*/
|
||||
@Override
|
||||
public SgFeedPlan selectSgFeedPlanByCreateDate(Date createDate)
|
||||
{
|
||||
return sgFeedPlanMapper.selectSgFeedPlanByCreateDate(createDate);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询饲喂计划列表
|
||||
*
|
||||
* @param sgFeedPlan 饲喂计划
|
||||
* @return 饲喂计划
|
||||
*/
|
||||
@Override
|
||||
public List<SgFeedPlan> selectSgFeedPlanList(SgFeedPlan sgFeedPlan)
|
||||
{
|
||||
return sgFeedPlanMapper.selectSgFeedPlanList(sgFeedPlan);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增饲喂计划
|
||||
*
|
||||
* @param sgFeedPlan 饲喂计划
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSgFeedPlan(SgFeedPlan sgFeedPlan)
|
||||
{
|
||||
return sgFeedPlanMapper.insertSgFeedPlan(sgFeedPlan);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改饲喂计划
|
||||
*
|
||||
* @param sgFeedPlan 饲喂计划
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSgFeedPlan(SgFeedPlan sgFeedPlan)
|
||||
{
|
||||
return sgFeedPlanMapper.updateSgFeedPlan(sgFeedPlan);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除饲喂计划
|
||||
*
|
||||
* @param createDates 需要删除的饲喂计划主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSgFeedPlanByCreateDates(Date[] createDates)
|
||||
{
|
||||
return sgFeedPlanMapper.deleteSgFeedPlanByCreateDates(createDates);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除饲喂计划信息
|
||||
*
|
||||
* @param createDate 饲喂计划主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSgFeedPlanByCreateDate(Date createDate)
|
||||
{
|
||||
return sgFeedPlanMapper.deleteSgFeedPlanByCreateDate(createDate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSheepCountByFoldId(Integer foldId) {
|
||||
return sgFeedPlanMapper.selectSheepCountByFoldId(foldId);
|
||||
}
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package com.zhyc.module.feed.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.zhyc.module.feed.mapper.SgFormulaListMapper;
|
||||
import com.zhyc.module.feed.domain.SgFormulaList;
|
||||
import com.zhyc.module.feed.service.ISgFormulaListService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 配方列表Service业务层处理
|
||||
*
|
||||
* @author HashMap
|
||||
* @date 2025-08-09
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class SgFormulaListServiceImpl implements ISgFormulaListService {
|
||||
private final SgFormulaListMapper sgFormulaListMapper;
|
||||
|
||||
public SgFormulaListServiceImpl(SgFormulaListMapper sgFormulaListMapper) {
|
||||
this.sgFormulaListMapper = sgFormulaListMapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询配方列表
|
||||
*
|
||||
* @param code 配方列表主键
|
||||
* @return 配方列表
|
||||
*/
|
||||
@Override
|
||||
public SgFormulaList selectSgFormulaListByCode(Long code) {
|
||||
return sgFormulaListMapper.selectSgFormulaListByCode(code);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询配方列表列表
|
||||
*
|
||||
* @param sgFormulaList 配方列表
|
||||
* @return 配方列表
|
||||
*/
|
||||
@Override
|
||||
public List<SgFormulaList> selectSgFormulaListList(SgFormulaList sgFormulaList) {
|
||||
return sgFormulaListMapper.selectSgFormulaListList(sgFormulaList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增配方列表
|
||||
*
|
||||
* @param sgFormulaList 配方列表
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSgFormulaList(SgFormulaList sgFormulaList) {
|
||||
return sgFormulaListMapper.insertSgFormulaList(sgFormulaList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改配方列表
|
||||
*
|
||||
* @param sgFormulaList 配方列表
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSgFormulaList(SgFormulaList sgFormulaList) {
|
||||
return sgFormulaListMapper.updateSgFormulaList(sgFormulaList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除配方列表
|
||||
*
|
||||
* @param codes 需要删除的配方列表主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSgFormulaListByCodes(Long[] codes) {
|
||||
return sgFormulaListMapper.deleteSgFormulaListByCodes(codes);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除配方列表信息
|
||||
*
|
||||
* @param code 配方列表主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSgFormulaListByCode(Long code) {
|
||||
return sgFormulaListMapper.deleteSgFormulaListByCode(code);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteSgFormulaListByFormulaIdAndBatchId(SgFormulaList sgFormulaList) {
|
||||
return sgFormulaListMapper.deleteSgFormulaListByFormulaIdAndBatchId(sgFormulaList);
|
||||
}
|
||||
}
|
@ -0,0 +1,135 @@
|
||||
package com.zhyc.module.feed.service.impl;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.zhyc.module.feed.domain.SgFormulaList;
|
||||
import com.zhyc.module.feed.mapper.SgFormulaListMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.zhyc.module.feed.mapper.SgFormulaManagementMapper;
|
||||
import com.zhyc.module.feed.domain.SgFormulaManagement;
|
||||
import com.zhyc.module.feed.service.ISgFormulaManagementService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 配方管理Service业务层处理
|
||||
*
|
||||
* @author HashMap
|
||||
* @date 2025-08-09
|
||||
*/
|
||||
@Service
|
||||
public class SgFormulaManagementServiceImpl implements ISgFormulaManagementService {
|
||||
private final SgFormulaManagementMapper sgFormulaManagementMapper;
|
||||
private final SgFormulaListMapper sgFormulaListMapper;
|
||||
|
||||
public SgFormulaManagementServiceImpl(SgFormulaManagementMapper sgFormulaManagementMapper, SgFormulaListMapper sgFormulaListMapper) {
|
||||
this.sgFormulaManagementMapper = sgFormulaManagementMapper;
|
||||
this.sgFormulaListMapper = sgFormulaListMapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询配方管理
|
||||
*
|
||||
* @param formulaId 配方管理主键
|
||||
* @return 配方管理
|
||||
*/
|
||||
@Override
|
||||
public SgFormulaManagement selectSgFormulaManagementByFormulaId(String formulaId) {
|
||||
return sgFormulaManagementMapper.selectSgFormulaManagementByFormulaId(formulaId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询配方管理列表
|
||||
*
|
||||
* @param sgFormulaManagement 配方管理
|
||||
* @return 配方管理
|
||||
*/
|
||||
@Override
|
||||
public List<SgFormulaManagement> selectSgFormulaManagementList(SgFormulaManagement sgFormulaManagement) {
|
||||
List<SgFormulaManagement> sgFormulaManagements =
|
||||
sgFormulaManagementMapper.selectSgFormulaManagementList(sgFormulaManagement);
|
||||
|
||||
Iterator<SgFormulaManagement> iterator = sgFormulaManagements.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
SgFormulaManagement formulaManagement = iterator.next();
|
||||
// 子查询中去除重复的父项
|
||||
if (formulaManagement != null
|
||||
&& sgFormulaManagement.getQueryType() != null
|
||||
&& sgFormulaManagement.getQueryType().equals("Sub")
|
||||
&& Objects.equals(formulaManagement.getBatchId(), "0")) {
|
||||
iterator.remove(); // 安全删除
|
||||
continue; // 删除后跳过本次循环
|
||||
}
|
||||
// 绑定配方列表
|
||||
if (formulaManagement != null
|
||||
&& formulaManagement.getFormulaId() != null
|
||||
&& formulaManagement.getBatchId() != null) {
|
||||
SgFormulaList sgFormulaList = new SgFormulaList();
|
||||
sgFormulaList.setFormulaId(formulaManagement.getFormulaId());
|
||||
sgFormulaList.setBatchId(formulaManagement.getBatchId());
|
||||
List<SgFormulaList> formulaLists =
|
||||
sgFormulaListMapper.selectSgFormulaListList(sgFormulaList);
|
||||
formulaManagement.setSgFormulaList(formulaLists);
|
||||
}
|
||||
}
|
||||
|
||||
return sgFormulaManagements;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增配方管理
|
||||
*
|
||||
* @param sgFormulaManagement 配方管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSgFormulaManagement(SgFormulaManagement sgFormulaManagement) {
|
||||
return sgFormulaManagementMapper.insertSgFormulaManagement(sgFormulaManagement);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改配方管理
|
||||
*
|
||||
* @param sgFormulaManagement 配方管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSgFormulaManagement(SgFormulaManagement sgFormulaManagement) {
|
||||
return sgFormulaManagementMapper.updateSgFormulaManagement(sgFormulaManagement);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除配方管理
|
||||
*
|
||||
* @param formulaIds 需要删除的配方管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSgFormulaManagementByFormulaIds(String[] formulaIds) {
|
||||
return sgFormulaManagementMapper.deleteSgFormulaManagementByFormulaIds(formulaIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除配方管理信息
|
||||
*
|
||||
* @param formulaId 配方管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSgFormulaManagementByFormulaId(String formulaId) {
|
||||
return sgFormulaManagementMapper.deleteSgFormulaManagementByFormulaId(formulaId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int deleteSgFormulaManagement(SgFormulaManagement sgFormulaManagement) {
|
||||
// 删除关联配方表
|
||||
SgFormulaList sgFormulaList = new SgFormulaList();
|
||||
sgFormulaList.setFormulaId(sgFormulaManagement.getFormulaId());
|
||||
sgFormulaList.setBatchId(sgFormulaManagement.getBatchId());
|
||||
sgFormulaListMapper.deleteSgFormulaListByFormulaIdAndBatchId(sgFormulaList);
|
||||
return sgFormulaManagementMapper.deleteSgFormulaManagement(sgFormulaManagement);
|
||||
}
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package com.zhyc.module.feed.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.zhyc.module.feed.mapper.SgMaterialMapper;
|
||||
import com.zhyc.module.feed.domain.SgMaterial;
|
||||
import com.zhyc.module.feed.service.ISgMaterialService;
|
||||
|
||||
/**
|
||||
* 原料Service业务层处理
|
||||
*
|
||||
* @author HashMap
|
||||
* @date 2025-08-11
|
||||
*/
|
||||
@Service
|
||||
public class SgMaterialServiceImpl implements ISgMaterialService
|
||||
{
|
||||
private final SgMaterialMapper sgMaterialMapper;
|
||||
|
||||
public SgMaterialServiceImpl(SgMaterialMapper sgMaterialMapper) {
|
||||
this.sgMaterialMapper = sgMaterialMapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询原料
|
||||
*
|
||||
* @param materialId 原料主键
|
||||
* @return 原料
|
||||
*/
|
||||
@Override
|
||||
public SgMaterial selectSgMaterialByMaterialId(String materialId)
|
||||
{
|
||||
return sgMaterialMapper.selectSgMaterialByMaterialId(materialId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询原料列表
|
||||
*
|
||||
* @param sgMaterial 原料
|
||||
* @return 原料
|
||||
*/
|
||||
@Override
|
||||
public List<SgMaterial> selectSgMaterialList(SgMaterial sgMaterial)
|
||||
{
|
||||
return sgMaterialMapper.selectSgMaterialList(sgMaterial);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增原料
|
||||
*
|
||||
* @param sgMaterial 原料
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSgMaterial(SgMaterial sgMaterial)
|
||||
{
|
||||
return sgMaterialMapper.insertSgMaterial(sgMaterial);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改原料
|
||||
*
|
||||
* @param sgMaterial 原料
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSgMaterial(SgMaterial sgMaterial)
|
||||
{
|
||||
return sgMaterialMapper.updateSgMaterial(sgMaterial);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除原料
|
||||
*
|
||||
* @param materialIds 需要删除的原料主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSgMaterialByMaterialIds(String[] materialIds)
|
||||
{
|
||||
return sgMaterialMapper.deleteSgMaterialByMaterialIds(materialIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除原料信息
|
||||
*
|
||||
* @param materialId 原料主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSgMaterialByMaterialId(String materialId)
|
||||
{
|
||||
return sgMaterialMapper.deleteSgMaterialByMaterialId(materialId);
|
||||
}
|
||||
}
|
@ -3,7 +3,6 @@ package com.zhyc.module.produce.bodyManage.controller;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.zhyc.common.utils.SecurityUtils;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
@ -3,78 +3,183 @@ package com.zhyc.module.produce.bodyManage.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;
|
||||
import org.springframework.data.annotation.AccessType;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* 体尺测量对象 sc_body_measure
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-27
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ScBodyMeasure extends BaseEntity
|
||||
{
|
||||
public class ScBodyMeasure extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
/**
|
||||
* $column.columnComment
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/** 耳号 */
|
||||
/**
|
||||
* 耳号
|
||||
*/
|
||||
private Long sheepId;
|
||||
@Excel(name = "耳号")
|
||||
private String manageTags;
|
||||
|
||||
/** 体高 */
|
||||
/**
|
||||
* 羊舍ID
|
||||
*/
|
||||
private Long sheepfoldId;
|
||||
@Excel(name = "羊舍")
|
||||
/** 羊舍名称(用于展示) */
|
||||
private String sheepfoldName;
|
||||
|
||||
/**
|
||||
* 品种ID(关联羊只表)
|
||||
*/
|
||||
private Long varietyId;
|
||||
|
||||
/**
|
||||
* 品种名称(用于展示)
|
||||
*/
|
||||
@Excel(name = "羊只品种")
|
||||
private String varietyName;
|
||||
|
||||
/**
|
||||
* 事件类型
|
||||
*/
|
||||
@Excel(name = "事件类型")
|
||||
private String eventType;
|
||||
|
||||
/**
|
||||
* 测量日期
|
||||
*/
|
||||
@Excel(name = "测量日期")
|
||||
private LocalDate measureDate;
|
||||
/**
|
||||
* 羊只类别
|
||||
*/
|
||||
private Long sheepTypeId;
|
||||
@Excel(name = "羊只类别")
|
||||
private String sheepTypeName;
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
@Excel(name = "性别", readConverterExp = "1=母,2=公,3=阉羊")
|
||||
private String gender;
|
||||
/**
|
||||
* 胎次
|
||||
*/
|
||||
private Integer parity;
|
||||
/**
|
||||
* 出生体重
|
||||
*/
|
||||
private BigDecimal birthWeight;
|
||||
/**
|
||||
* 断奶体重
|
||||
*/
|
||||
private BigDecimal weaningWeight;
|
||||
/**
|
||||
* 当前体重
|
||||
*/
|
||||
private BigDecimal currentWeight;
|
||||
|
||||
/**
|
||||
* 体高
|
||||
*/
|
||||
@Excel(name = "体高")
|
||||
private Long height;
|
||||
|
||||
/** 胸围 */
|
||||
/**
|
||||
* 胸围
|
||||
*/
|
||||
@Excel(name = "胸围")
|
||||
private Long bust;
|
||||
|
||||
/** 体斜长 */
|
||||
/**
|
||||
* 体斜长
|
||||
*/
|
||||
@Excel(name = "体斜长")
|
||||
private Long bodyLength;
|
||||
|
||||
/** 管围 */
|
||||
/**
|
||||
* 管围
|
||||
*/
|
||||
@Excel(name = "管围")
|
||||
private Long pipeLength;
|
||||
|
||||
/** 胸深 */
|
||||
/**
|
||||
* 胸深
|
||||
*/
|
||||
@Excel(name = "胸深")
|
||||
private Long chestDepth;
|
||||
|
||||
/** 臀高 */
|
||||
/**
|
||||
* 臀高
|
||||
*/
|
||||
@Excel(name = "臀高")
|
||||
private Long hipHeight;
|
||||
|
||||
/** 尻宽 */
|
||||
/**
|
||||
* 尻宽
|
||||
*/
|
||||
@Excel(name = "尻宽")
|
||||
private Long rumpWidth;
|
||||
|
||||
/** 尻高 */
|
||||
/**
|
||||
* 尻高
|
||||
*/
|
||||
@Excel(name = "尻高")
|
||||
private Long rumpHeignt;
|
||||
|
||||
/** 腰角宽 */
|
||||
/**
|
||||
* 腰角宽
|
||||
*/
|
||||
@Excel(name = "腰角宽")
|
||||
private Long hipWidth;
|
||||
|
||||
/** 十字部高 */
|
||||
/**
|
||||
* 十字部高
|
||||
*/
|
||||
@Excel(name = "十字部高")
|
||||
private Long hipCrossHeight;
|
||||
|
||||
/** 备注 */
|
||||
/**
|
||||
* 繁育状态
|
||||
*/
|
||||
@Excel(name = "繁育状态")
|
||||
private String breedStatusName;
|
||||
/**
|
||||
* 泌乳天数
|
||||
*/
|
||||
@Excel(name = "泌乳天数")
|
||||
private Integer lactationDay;
|
||||
/**
|
||||
* 怀孕天数
|
||||
*/
|
||||
@Excel(name = "怀孕天数")
|
||||
private Integer gestationDay;
|
||||
/**
|
||||
* 配后天数
|
||||
*/
|
||||
@Excel(name = "配后天数")
|
||||
private Integer postMatingDay;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Excel(name = "备注")
|
||||
private String comment;
|
||||
|
||||
/** 技术员 */
|
||||
/**
|
||||
* 技术员
|
||||
*/
|
||||
@Excel(name = "技术员")
|
||||
private String technician;
|
||||
|
||||
|
@ -6,8 +6,6 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.zhyc.common.annotation.Excel;
|
||||
import com.zhyc.common.core.domain.BaseEntity;
|
||||
|
||||
@ -34,6 +32,20 @@ public class ScBodyScore extends BaseEntity {
|
||||
private String sheepId;
|
||||
@Excel(name = "管理耳号")
|
||||
private String manageTags;
|
||||
|
||||
/**
|
||||
* 品种
|
||||
*/
|
||||
private Long varietyId;
|
||||
@Excel(name = "品种")
|
||||
private String varietyName;
|
||||
|
||||
/**
|
||||
* 事件类型
|
||||
*/
|
||||
@Excel(name = "事件类型")
|
||||
private String eventType;
|
||||
|
||||
/**
|
||||
* 事件日期
|
||||
*/
|
||||
@ -51,7 +63,7 @@ public class ScBodyScore extends BaseEntity {
|
||||
* 羊舍id
|
||||
*/
|
||||
private Long sheepfold;
|
||||
@Excel(name = "羊舍名称")
|
||||
@Excel(name = "羊舍")
|
||||
private String sheepfoldName;
|
||||
/**
|
||||
* 备注
|
||||
|
@ -1,13 +1,14 @@
|
||||
package com.zhyc.module.produce.bodyManage.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.zhyc.common.annotation.Excel;
|
||||
import com.zhyc.common.core.domain.BaseEntity;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* 乳房评分对象 sc_breast_rating
|
||||
*
|
||||
@ -32,6 +33,35 @@ public class ScBreastRating extends BaseEntity {
|
||||
private String sheepId;
|
||||
@Excel(name = "羊只id")
|
||||
private String manageTags;
|
||||
|
||||
/**
|
||||
* 品种
|
||||
*/
|
||||
private Long varietyId;
|
||||
@Excel(name = "品种")
|
||||
private String varietyName;
|
||||
|
||||
/**
|
||||
* 事件类型
|
||||
*/
|
||||
@Excel(name = "事件类型")
|
||||
private String eventType;
|
||||
|
||||
/**
|
||||
* 事件日期
|
||||
*/
|
||||
@Excel(name = "事件日期")
|
||||
private LocalDate eventDate;
|
||||
|
||||
/**
|
||||
* 羊舍ID
|
||||
*/
|
||||
private Long sheepfoldId;
|
||||
@Excel(name = "羊舍")
|
||||
/** 羊舍名称(用于展示) */
|
||||
private String sheepfoldName;
|
||||
|
||||
|
||||
/**
|
||||
* 乳房深度
|
||||
*/
|
||||
|
@ -3,6 +3,7 @@ package com.zhyc.module.produce.breed.controller;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.zhyc.module.produce.breed.domain.ScBreedPlanGenerate;
|
||||
import com.zhyc.module.produce.breed.service.IScBreedPlanGenerateService;
|
||||
@ -21,6 +22,7 @@ import com.zhyc.common.core.controller.BaseController;
|
||||
import com.zhyc.common.core.domain.AjaxResult;
|
||||
import com.zhyc.common.enums.BusinessType;
|
||||
import com.zhyc.common.core.page.TableDataInfo;
|
||||
import com.zhyc.common.utils.poi.ExcelUtil;
|
||||
|
||||
/**
|
||||
* 配种计划生成Controller
|
||||
@ -78,6 +80,12 @@ public class ScBreedPlanGenerateController extends BaseController
|
||||
public AjaxResult autoGenerateBreedPlan(@RequestBody Map<String, Object> params)
|
||||
{
|
||||
try {
|
||||
// 获取计划类型
|
||||
Integer planType = params.get("planType") != null ? (Integer) params.get("planType") : 1;
|
||||
|
||||
// 计划名称由系统自动生成,不再从前端传入
|
||||
String planName = null;
|
||||
|
||||
// 安全的类型转换
|
||||
List<?> eweIdsRaw = (List<?>) params.get("eweIds");
|
||||
List<?> ramIdsRaw = (List<?>) params.get("ramIds");
|
||||
@ -110,7 +118,7 @@ public class ScBreedPlanGenerateController extends BaseController
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
|
||||
ScBreedPlanGenerate planGenerate = scBreedPlanGenerateService.autoGenerateBreedPlan(eweIds, ramIds);
|
||||
ScBreedPlanGenerate planGenerate = scBreedPlanGenerateService.autoGenerateBreedPlan(planType, planName, eweIds, ramIds);
|
||||
return success(planGenerate);
|
||||
} catch (Exception e) {
|
||||
logger.error("自动生成配种计划失败", e);
|
||||
@ -151,14 +159,38 @@ public class ScBreedPlanGenerateController extends BaseController
|
||||
}
|
||||
|
||||
/**
|
||||
* 审批配种计划
|
||||
* 获取审批配种计划详情
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mating_plan:generate:approve')")
|
||||
@Log(title = "审批配种计划", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/approve/{id}")
|
||||
public AjaxResult approve(@PathVariable Long id)
|
||||
@GetMapping("/approve/{id}")
|
||||
public AjaxResult getApproveInfo(@PathVariable Long id)
|
||||
{
|
||||
return toAjax(scBreedPlanGenerateService.approveBreedPlan(id));
|
||||
Map<String, Object> approveDetails = scBreedPlanGenerateService.getApproveBreedPlanDetails(id);
|
||||
return success(approveDetails);
|
||||
}
|
||||
|
||||
/**
|
||||
* 确认审批配种计划
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mating_plan:generate:approve')")
|
||||
@Log(title = "确认审批配种计划", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/approve/confirm")
|
||||
public AjaxResult confirmApprove(@RequestBody Map<String, Object> params)
|
||||
{
|
||||
try {
|
||||
Long planId = Long.valueOf(params.get("planId").toString());
|
||||
Integer status = Integer.valueOf(params.get("status").toString());
|
||||
String approveRemark = params.get("approveRemark") != null ? params.get("approveRemark").toString() : "";
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Map<String, Object>> planDetails = (List<Map<String, Object>>) params.get("planDetails");
|
||||
|
||||
int result = scBreedPlanGenerateService.confirmApproveBreedPlan(planId, planDetails, status, approveRemark);
|
||||
return toAjax(result);
|
||||
} catch (Exception e) {
|
||||
logger.error("确认审批配种计划失败", e);
|
||||
return error("确认审批配种计划失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -172,6 +204,41 @@ public class ScBreedPlanGenerateController extends BaseController
|
||||
return success(planDetails);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出配种计划列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mating_plan:generate:export')")
|
||||
@Log(title = "导出配种计划列表", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ScBreedPlanGenerate scBreedPlanGenerate)
|
||||
{
|
||||
List<ScBreedPlanGenerate> list = scBreedPlanGenerateService.selectScBreedPlanGenerateList(scBreedPlanGenerate);
|
||||
ExcelUtil<ScBreedPlanGenerate> util = new ExcelUtil<ScBreedPlanGenerate>(ScBreedPlanGenerate.class);
|
||||
util.exportExcel(response, list, "配种计划生成数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出配种计划详情
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mating_plan:generate:export')")
|
||||
@Log(title = "导出配种计划详情", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export/{id}")
|
||||
public void exportBreedPlanDetails(HttpServletResponse response, @PathVariable Long id)
|
||||
{
|
||||
try {
|
||||
scBreedPlanGenerateService.exportBreedPlanDetails(response, id);
|
||||
} catch (Exception e) {
|
||||
logger.error("导出配种计划详情失败", e);
|
||||
// 在出错时返回错误信息给前端
|
||||
try {
|
||||
response.setContentType("application/json;charset=utf-8");
|
||||
response.getWriter().write("{\"code\":500,\"msg\":\"导出失败:" + e.getMessage() + "\"}");
|
||||
} catch (Exception ex) {
|
||||
logger.error("返回错误信息失败", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除配种计划生成
|
||||
*/
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user