Merge remote-tracking branch 'origin/main'

This commit is contained in:
ll 2025-08-13 18:56:10 +08:00
commit 3841321ee7
82 changed files with 8907 additions and 13 deletions

View File

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

View File

@ -41,4 +41,7 @@ public class BasSheepGroup extends TreeEntity
@Excel(name = "祖级列表名称")
private String ancestorNames;
private Integer isLeaf;
}

View File

@ -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;
/** 乳体细胞SCSEBV */
@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();
}
}

View File

@ -78,4 +78,6 @@ public interface BasSheepMapper
//用于校验改耳号部分新管理/电子耳号
int existsByManageTag(@Param("tag") String tag);
int existsByElectronicTag(@Param("tag") String tag);
}

View File

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

View File

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

View File

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

View File

@ -0,0 +1,104 @@
package com.zhyc.module.feed.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
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.SgFeedDetails;
import com.zhyc.module.feed.service.ISgFeedDetailsService;
import com.zhyc.common.utils.poi.ExcelUtil;
import com.zhyc.common.core.page.TableDataInfo;
/**
* 饲喂记录详情Controller
*
* @author ruoyi
* @date 2025-08-01
*/
@RestController
@RequestMapping("/feed/details")
public class SgFeedDetailsController extends BaseController
{
@Autowired
private ISgFeedDetailsService sgFeedDetailsService;
/**
* 查询饲喂记录详情列表
*/
@PreAuthorize("@ss.hasPermi('feed:details:list')")
@GetMapping("/list")
public TableDataInfo list(SgFeedDetails sgFeedDetails)
{
startPage();
List<SgFeedDetails> list = sgFeedDetailsService.selectSgFeedDetailsList(sgFeedDetails);
return getDataTable(list);
}
/**
* 导出饲喂记录详情列表
*/
@PreAuthorize("@ss.hasPermi('feed:details:export')")
@Log(title = "饲喂记录详情", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SgFeedDetails sgFeedDetails)
{
List<SgFeedDetails> list = sgFeedDetailsService.selectSgFeedDetailsList(sgFeedDetails);
ExcelUtil<SgFeedDetails> util = new ExcelUtil<SgFeedDetails>(SgFeedDetails.class);
util.exportExcel(response, list, "饲喂记录详情数据");
}
/**
* 获取饲喂记录详情详细信息
*/
@PreAuthorize("@ss.hasPermi('feed:details:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(sgFeedDetailsService.selectSgFeedDetailsById(id));
}
/**
* 新增饲喂记录详情
*/
@PreAuthorize("@ss.hasPermi('feed:details:add')")
@Log(title = "饲喂记录详情", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SgFeedDetails sgFeedDetails)
{
return toAjax(sgFeedDetailsService.insertSgFeedDetails(sgFeedDetails));
}
/**
* 修改饲喂记录详情
*/
@PreAuthorize("@ss.hasPermi('feed:details:edit')")
@Log(title = "饲喂记录详情", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SgFeedDetails sgFeedDetails)
{
return toAjax(sgFeedDetailsService.updateSgFeedDetails(sgFeedDetails));
}
/**
* 删除饲喂记录详情
*/
@PreAuthorize("@ss.hasPermi('feed:details:remove')")
@Log(title = "饲喂记录详情", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(sgFeedDetailsService.deleteSgFeedDetailsByIds(ids));
}
}

View File

@ -0,0 +1,104 @@
package com.zhyc.module.feed.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
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.SgFeedInfo;
import com.zhyc.module.feed.service.ISgFeedInfoService;
import com.zhyc.common.utils.poi.ExcelUtil;
import com.zhyc.common.core.page.TableDataInfo;
/**
* 饲喂记录Controller
*
* @author ruoyi
* @date 2025-08-01
*/
@RestController
@RequestMapping("/feed/info")
public class SgFeedInfoController extends BaseController
{
@Autowired
private ISgFeedInfoService sgFeedInfoService;
/**
* 查询饲喂记录列表
*/
@PreAuthorize("@ss.hasPermi('feed:info:list')")
@GetMapping("/list")
public TableDataInfo list(SgFeedInfo sgFeedInfo)
{
startPage();
List<SgFeedInfo> list = sgFeedInfoService.selectSgFeedInfoList(sgFeedInfo);
return getDataTable(list);
}
/**
* 导出饲喂记录列表
*/
@PreAuthorize("@ss.hasPermi('feed:info:export')")
@Log(title = "饲喂记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SgFeedInfo sgFeedInfo)
{
List<SgFeedInfo> list = sgFeedInfoService.selectSgFeedInfoList(sgFeedInfo);
ExcelUtil<SgFeedInfo> util = new ExcelUtil<SgFeedInfo>(SgFeedInfo.class);
util.exportExcel(response, list, "饲喂记录数据");
}
/**
* 获取饲喂记录详细信息
*/
@PreAuthorize("@ss.hasPermi('feed:info:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(sgFeedInfoService.selectSgFeedInfoById(id));
}
/**
* 新增饲喂记录
*/
@PreAuthorize("@ss.hasPermi('feed:info:add')")
@Log(title = "饲喂记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SgFeedInfo sgFeedInfo)
{
return toAjax(sgFeedInfoService.insertSgFeedInfo(sgFeedInfo));
}
/**
* 修改饲喂记录
*/
@PreAuthorize("@ss.hasPermi('feed:info:edit')")
@Log(title = "饲喂记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SgFeedInfo sgFeedInfo)
{
return toAjax(sgFeedInfoService.updateSgFeedInfo(sgFeedInfo));
}
/**
* 删除饲喂记录
*/
@PreAuthorize("@ss.hasPermi('feed:info:remove')")
@Log(title = "饲喂记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(sgFeedInfoService.deleteSgFeedInfoByIds(ids));
}
}

View File

@ -0,0 +1,107 @@
package com.zhyc.module.feed.controller;
import java.util.Date;
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.SgFeedPlan;
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-08
*/
@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)
{
return toAjax(sgFeedPlanService.insertSgFeedPlan(sgFeedPlan));
}
/**
* 修改饲喂计划
*/
@PreAuthorize("@ss.hasPermi('feed:FeedPlan:edit')")
@Log(title = "饲喂计划", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SgFeedPlan sgFeedPlan)
{
return toAjax(sgFeedPlanService.updateSgFeedPlan(sgFeedPlan));
}
/**
* 删除饲喂计划
*/
@PreAuthorize("@ss.hasPermi('feed:FeedPlan:remove')")
@Log(title = "饲喂计划", businessType = BusinessType.DELETE)
@DeleteMapping("/{createDates}")
public AjaxResult remove(@PathVariable Date[] createDates)
{
return toAjax(sgFeedPlanService.deleteSgFeedPlanByCreateDates(createDates));
}
}

View File

@ -0,0 +1,104 @@
package com.zhyc.module.feed.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
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.SgFeedRatio;
import com.zhyc.module.feed.service.ISgFeedRatioService;
import com.zhyc.common.utils.poi.ExcelUtil;
import com.zhyc.common.core.page.TableDataInfo;
/**
* 饲喂比例Controller
*
* @author ruoyi
* @date 2025-08-01
*/
@RestController
@RequestMapping("/feed/ratio")
public class SgFeedRatioController extends BaseController
{
@Autowired
private ISgFeedRatioService sgFeedRatioService;
/**
* 查询饲喂比例列表
*/
@PreAuthorize("@ss.hasPermi('feed:ratio:list')")
@GetMapping("/list")
public TableDataInfo list(SgFeedRatio sgFeedRatio)
{
startPage();
List<SgFeedRatio> list = sgFeedRatioService.selectSgFeedRatioList(sgFeedRatio);
return getDataTable(list);
}
/**
* 导出饲喂比例列表
*/
@PreAuthorize("@ss.hasPermi('feed:ratio:export')")
@Log(title = "饲喂比例", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SgFeedRatio sgFeedRatio)
{
List<SgFeedRatio> list = sgFeedRatioService.selectSgFeedRatioList(sgFeedRatio);
ExcelUtil<SgFeedRatio> util = new ExcelUtil<SgFeedRatio>(SgFeedRatio.class);
util.exportExcel(response, list, "饲喂比例数据");
}
/**
* 获取饲喂比例详细信息
*/
@PreAuthorize("@ss.hasPermi('feed:ratio:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(sgFeedRatioService.selectSgFeedRatioById(id));
}
/**
* 新增饲喂比例
*/
@PreAuthorize("@ss.hasPermi('feed:ratio:add')")
@Log(title = "饲喂比例", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SgFeedRatio sgFeedRatio)
{
return toAjax(sgFeedRatioService.insertSgFeedRatio(sgFeedRatio));
}
/**
* 修改饲喂比例
*/
@PreAuthorize("@ss.hasPermi('feed:ratio:edit')")
@Log(title = "饲喂比例", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SgFeedRatio sgFeedRatio)
{
return toAjax(sgFeedRatioService.updateSgFeedRatio(sgFeedRatio));
}
/**
* 删除饲喂比例
*/
@PreAuthorize("@ss.hasPermi('feed:ratio:remove')")
@Log(title = "饲喂比例", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(sgFeedRatioService.deleteSgFeedRatioByIds(ids));
}
}

View File

@ -0,0 +1,104 @@
package com.zhyc.module.feed.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
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.SgFodder;
import com.zhyc.module.feed.service.ISgFodderService;
import com.zhyc.common.utils.poi.ExcelUtil;
import com.zhyc.common.core.page.TableDataInfo;
/**
* 原料Controller
*
* @author ruoyi
* @date 2025-08-01
*/
@RestController
@RequestMapping("/feed/fodder")
public class SgFodderController extends BaseController
{
@Autowired
private ISgFodderService sgFodderService;
/**
* 查询原料列表
*/
@PreAuthorize("@ss.hasPermi('feed:fodder:list')")
@GetMapping("/list")
public TableDataInfo list(SgFodder sgFodder)
{
startPage();
List<SgFodder> list = sgFodderService.selectSgFodderList(sgFodder);
return getDataTable(list);
}
/**
* 导出原料列表
*/
@PreAuthorize("@ss.hasPermi('feed:fodder:export')")
@Log(title = "原料", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SgFodder sgFodder)
{
List<SgFodder> list = sgFodderService.selectSgFodderList(sgFodder);
ExcelUtil<SgFodder> util = new ExcelUtil<SgFodder>(SgFodder.class);
util.exportExcel(response, list, "原料数据");
}
/**
* 获取原料详细信息
*/
@PreAuthorize("@ss.hasPermi('feed:fodder:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(sgFodderService.selectSgFodderById(id));
}
/**
* 新增原料
*/
@PreAuthorize("@ss.hasPermi('feed:fodder:add')")
@Log(title = "原料", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SgFodder sgFodder)
{
return toAjax(sgFodderService.insertSgFodder(sgFodder));
}
/**
* 修改原料
*/
@PreAuthorize("@ss.hasPermi('feed:fodder:edit')")
@Log(title = "原料", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SgFodder sgFodder)
{
return toAjax(sgFodderService.updateSgFodder(sgFodder));
}
/**
* 删除原料
*/
@PreAuthorize("@ss.hasPermi('feed:fodder:remove')")
@Log(title = "原料", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(sgFodderService.deleteSgFodderByIds(ids));
}
}

View File

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

View File

@ -0,0 +1,172 @@
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);
}
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);
return toAjax(sgFormulaManagementService.deleteSgFormulaManagement(sgFormulaManagement));
}
}

View File

@ -0,0 +1,107 @@
package com.zhyc.module.feed.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
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));
}
}

View File

@ -0,0 +1,82 @@
package com.zhyc.module.feed.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zhyc.common.annotation.Excel;
import com.zhyc.common.core.domain.BaseEntity;
/**
* 饲喂记录详情对象 sg_feed_details
*
* @author ruoyi
* @date 2025-08-01
*/
public class SgFeedDetails extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** id */
private Long id;
/** 原料id */
@Excel(name = "原料id")
private String fodder;
/** 数量 */
@Excel(name = "数量")
private Long number;
/** 单位 */
@Excel(name = "单位")
private String nuit;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setFodder(String fodder)
{
this.fodder = fodder;
}
public String getFodder()
{
return fodder;
}
public void setNumber(Long number)
{
this.number = number;
}
public Long getNumber()
{
return number;
}
public void setNuit(String nuit)
{
this.nuit = nuit;
}
public String getNuit()
{
return nuit;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("fodder", getFodder())
.append("number", getNumber())
.append("nuit", getNuit())
.toString();
}
}

View File

@ -0,0 +1,252 @@
package com.zhyc.module.feed.domain;
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;
/**
* 饲喂记录对象 sg_feed_info
*
* @author ruoyi
* @date 2025-08-01
*/
public class SgFeedInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** id */
private Long id;
/** 配方编码 */
@Excel(name = "配方编码")
private Long formulaId;
/** 羊舍 */
@Excel(name = "羊舍")
private String sheepfoldId;
/** 日均计划量 */
@Excel(name = "日均计划量")
private Long average;
/** 早上计划量(通过饲喂比例算出来) */
@Excel(name = "早上计划量(通过饲喂比例算出来)")
private Long planMonring;
/** 实际添加(早) */
@Excel(name = "实际添加", readConverterExp = "早=")
private Long actualMonring;
/** 中午计划量 */
@Excel(name = "中午计划量")
private Long planNoon;
/** 实际添加(中) */
@Excel(name = "实际添加", readConverterExp = "中=")
private Long actualNoon;
/** 下午计划量 */
@Excel(name = "下午计划量")
private Long planEvenig;
/** 实际添加(下) */
@Excel(name = "实际添加", readConverterExp = "下=")
private Long actualEvening;
/** 颗粒原料 */
@Excel(name = "颗粒原料")
private Long particle;
/** 其他原料 */
@Excel(name = "其他原料")
private Long other;
/** 补饲饲料 */
@Excel(name = "补饲饲料")
private Long replenish;
/** 饲喂日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "饲喂日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date planDate;
/** 备注 */
@Excel(name = "备注")
private String comment;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setFormulaId(Long formulaId)
{
this.formulaId = formulaId;
}
public Long getFormulaId()
{
return formulaId;
}
public void setSheepfoldId(String sheepfoldId)
{
this.sheepfoldId = sheepfoldId;
}
public String getSheepfoldId()
{
return sheepfoldId;
}
public void setAverage(Long average)
{
this.average = average;
}
public Long getAverage()
{
return average;
}
public void setPlanMonring(Long planMonring)
{
this.planMonring = planMonring;
}
public Long getPlanMonring()
{
return planMonring;
}
public void setActualMonring(Long actualMonring)
{
this.actualMonring = actualMonring;
}
public Long getActualMonring()
{
return actualMonring;
}
public void setPlanNoon(Long planNoon)
{
this.planNoon = planNoon;
}
public Long getPlanNoon()
{
return planNoon;
}
public void setActualNoon(Long actualNoon)
{
this.actualNoon = actualNoon;
}
public Long getActualNoon()
{
return actualNoon;
}
public void setPlanEvenig(Long planEvenig)
{
this.planEvenig = planEvenig;
}
public Long getPlanEvenig()
{
return planEvenig;
}
public void setActualEvening(Long actualEvening)
{
this.actualEvening = actualEvening;
}
public Long getActualEvening()
{
return actualEvening;
}
public void setParticle(Long particle)
{
this.particle = particle;
}
public Long getParticle()
{
return particle;
}
public void setOther(Long other)
{
this.other = other;
}
public Long getOther()
{
return other;
}
public void setReplenish(Long replenish)
{
this.replenish = replenish;
}
public Long getReplenish()
{
return replenish;
}
public void setPlanDate(Date planDate)
{
this.planDate = planDate;
}
public Date getPlanDate()
{
return planDate;
}
public void setComment(String comment)
{
this.comment = comment;
}
public String getComment()
{
return comment;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("formulaId", getFormulaId())
.append("sheepfoldId", getSheepfoldId())
.append("average", getAverage())
.append("planMonring", getPlanMonring())
.append("actualMonring", getActualMonring())
.append("planNoon", getPlanNoon())
.append("actualNoon", getActualNoon())
.append("planEvenig", getPlanEvenig())
.append("actualEvening", getActualEvening())
.append("particle", getParticle())
.append("other", getOther())
.append("replenish", getReplenish())
.append("planDate", getPlanDate())
.append("comment", getComment())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.toString();
}
}

View File

@ -0,0 +1,132 @@
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-08
*/
@Setter
@Getter
public class SgFeedPlan extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 创建日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "创建日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date createDate;
/** 配方编码 */
@Excel(name = "配方编码")
private String formulaId;
/** 羊舍 */
@Excel(name = "羊舍")
private Long sheepHouseId;
/** 羊只数量 */
@Excel(name = "羊只数量")
private Long sheepCount;
/** 日均计划量 */
@Excel(name = "日均计划量")
private Long planDailySize;
/** 计划量(早) */
@Excel(name = "计划量(早)")
private Long planMorningSize;
/** 计划总量(早) */
@Excel(name = "计划总量(早)")
private Long planMorningTotal;
/** 饲喂比例(早) */
@Excel(name = "饲喂比例(早)")
private Long ratioMorning;
/** 实际量(早) */
@Excel(name = "实际量(早)")
private Long actualMorningSize;
/** 计划量(中) */
@Excel(name = "计划量(中)")
private Long planNoonSize;
/** 计划总量(中) */
@Excel(name = "计划总量(中)")
private Long planNoonTotal;
/** 实际量(中) */
@Excel(name = "实际量(中)")
private Long actualNoonSize;
/** 饲喂比例(中) */
@Excel(name = "饲喂比例(中)")
private Long ratioNoon;
/** 计划量(下) */
@Excel(name = "计划量(下)")
private Long planAfternoonSize;
/** 计划总量(下) */
@Excel(name = "计划总量(下)")
private Long planAfternoonTotal;
/** 实际量(下) */
@Excel(name = "实际量(下)")
private Long actualAfternoonSize;
/** 饲喂比例(下) */
@Excel(name = "饲喂比例(下)")
private Long ratioAfternoon;
/** 计划饲喂总量 */
@Excel(name = "计划饲喂总量")
private Long 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("sheepHouseId", getSheepHouseId())
.append("sheepCount", getSheepCount())
.append("planDailySize", getPlanDailySize())
.append("planMorningSize", getPlanMorningSize())
.append("planMorningTotal", getPlanMorningTotal())
.append("ratioMorning", getRatioMorning())
.append("actualMorningSize", getActualMorningSize())
.append("planNoonSize", getPlanNoonSize())
.append("planNoonTotal", getPlanNoonTotal())
.append("actualNoonSize", getActualNoonSize())
.append("ratioNoon", getRatioNoon())
.append("planAfternoonSize", getPlanAfternoonSize())
.append("planAfternoonTotal", getPlanAfternoonTotal())
.append("actualAfternoonSize", getActualAfternoonSize())
.append("ratioAfternoon", getRatioAfternoon())
.append("planFeedTotal", getPlanFeedTotal())
.append("zookeeper", getZookeeper())
.append("planDate", getPlanDate())
.append("remark", getRemark())
.toString();
}
}

View File

@ -0,0 +1,82 @@
package com.zhyc.module.feed.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zhyc.common.annotation.Excel;
import com.zhyc.common.core.domain.BaseEntity;
/**
* 饲喂比例对象 sg_feed_ratio
*
* @author ruoyi
* @date 2025-08-01
*/
public class SgFeedRatio extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** id */
private Long id;
/** 早晨计划比列 */
@Excel(name = "早晨计划比列")
private String morning;
/** 中午计划比例 */
@Excel(name = "中午计划比例")
private String noon;
/** 下午计划比例 */
@Excel(name = "下午计划比例")
private String evening;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setMorning(String morning)
{
this.morning = morning;
}
public String getMorning()
{
return morning;
}
public void setNoon(String noon)
{
this.noon = noon;
}
public String getNoon()
{
return noon;
}
public void setEvening(String evening)
{
this.evening = evening;
}
public String getEvening()
{
return evening;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("morning", getMorning())
.append("noon", getNoon())
.append("evening", getEvening())
.toString();
}
}

View File

@ -0,0 +1,67 @@
package com.zhyc.module.feed.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zhyc.common.annotation.Excel;
import com.zhyc.common.core.domain.BaseEntity;
/**
* 原料对象 sg_fodder
*
* @author ruoyi
* @date 2025-08-01
*/
public class SgFodder extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** id */
private Long id;
/** 名称 */
@Excel(name = "名称")
private String name;
/** 0补饲饲料1配方原料2颗粒原料 */
@Excel(name = "0补饲饲料1配方原料2颗粒原料")
private Long fodderType;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setFodderType(Long fodderType)
{
this.fodderType = fodderType;
}
public Long getFodderType()
{
return fodderType;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("name", getName())
.append("fodderType", getFodderType())
.toString();
}
}

View File

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

View File

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

View File

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

View File

@ -0,0 +1,61 @@
package com.zhyc.module.feed.mapper;
import java.util.List;
import com.zhyc.module.feed.domain.SgFeedDetails;
/**
* 饲喂记录详情Mapper接口
*
* @author ruoyi
* @date 2025-08-01
*/
public interface SgFeedDetailsMapper
{
/**
* 查询饲喂记录详情
*
* @param id 饲喂记录详情主键
* @return 饲喂记录详情
*/
public SgFeedDetails selectSgFeedDetailsById(Long id);
/**
* 查询饲喂记录详情列表
*
* @param sgFeedDetails 饲喂记录详情
* @return 饲喂记录详情集合
*/
public List<SgFeedDetails> selectSgFeedDetailsList(SgFeedDetails sgFeedDetails);
/**
* 新增饲喂记录详情
*
* @param sgFeedDetails 饲喂记录详情
* @return 结果
*/
public int insertSgFeedDetails(SgFeedDetails sgFeedDetails);
/**
* 修改饲喂记录详情
*
* @param sgFeedDetails 饲喂记录详情
* @return 结果
*/
public int updateSgFeedDetails(SgFeedDetails sgFeedDetails);
/**
* 删除饲喂记录详情
*
* @param id 饲喂记录详情主键
* @return 结果
*/
public int deleteSgFeedDetailsById(Long id);
/**
* 批量删除饲喂记录详情
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteSgFeedDetailsByIds(Long[] ids);
}

View File

@ -0,0 +1,61 @@
package com.zhyc.module.feed.mapper;
import java.util.List;
import com.zhyc.module.feed.domain.SgFeedInfo;
/**
* 饲喂记录Mapper接口
*
* @author ruoyi
* @date 2025-08-01
*/
public interface SgFeedInfoMapper
{
/**
* 查询饲喂记录
*
* @param id 饲喂记录主键
* @return 饲喂记录
*/
public SgFeedInfo selectSgFeedInfoById(Long id);
/**
* 查询饲喂记录列表
*
* @param sgFeedInfo 饲喂记录
* @return 饲喂记录集合
*/
public List<SgFeedInfo> selectSgFeedInfoList(SgFeedInfo sgFeedInfo);
/**
* 新增饲喂记录
*
* @param sgFeedInfo 饲喂记录
* @return 结果
*/
public int insertSgFeedInfo(SgFeedInfo sgFeedInfo);
/**
* 修改饲喂记录
*
* @param sgFeedInfo 饲喂记录
* @return 结果
*/
public int updateSgFeedInfo(SgFeedInfo sgFeedInfo);
/**
* 删除饲喂记录
*
* @param id 饲喂记录主键
* @return 结果
*/
public int deleteSgFeedInfoById(Long id);
/**
* 批量删除饲喂记录
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteSgFeedInfoByIds(Long[] ids);
}

View File

@ -0,0 +1,64 @@
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-08
*/
@Mapper
public interface SgFeedPlanMapper
{
/**
* 查询饲喂计划
*
* @param createDate 饲喂计划主键
* @return 饲喂计划
*/
SgFeedPlan selectSgFeedPlanByCreateDate(Date createDate);
/**
* 查询饲喂计划列表
*
* @param sgFeedPlan 饲喂计划
* @return 饲喂计划集合
*/
List<SgFeedPlan> selectSgFeedPlanList(SgFeedPlan sgFeedPlan);
/**
* 新增饲喂计划
*
* @param sgFeedPlan 饲喂计划
* @return 结果
*/
int insertSgFeedPlan(SgFeedPlan sgFeedPlan);
/**
* 修改饲喂计划
*
* @param sgFeedPlan 饲喂计划
* @return 结果
*/
int updateSgFeedPlan(SgFeedPlan sgFeedPlan);
/**
* 删除饲喂计划
*
* @param createDate 饲喂计划主键
* @return 结果
*/
int deleteSgFeedPlanByCreateDate(Date createDate);
/**
* 批量删除饲喂计划
*
* @param createDates 需要删除的数据主键集合
* @return 结果
*/
int deleteSgFeedPlanByCreateDates(Date[] createDates);
}

View File

@ -0,0 +1,61 @@
package com.zhyc.module.feed.mapper;
import java.util.List;
import com.zhyc.module.feed.domain.SgFeedRatio;
/**
* 饲喂比例Mapper接口
*
* @author ruoyi
* @date 2025-08-01
*/
public interface SgFeedRatioMapper
{
/**
* 查询饲喂比例
*
* @param id 饲喂比例主键
* @return 饲喂比例
*/
public SgFeedRatio selectSgFeedRatioById(Long id);
/**
* 查询饲喂比例列表
*
* @param sgFeedRatio 饲喂比例
* @return 饲喂比例集合
*/
public List<SgFeedRatio> selectSgFeedRatioList(SgFeedRatio sgFeedRatio);
/**
* 新增饲喂比例
*
* @param sgFeedRatio 饲喂比例
* @return 结果
*/
public int insertSgFeedRatio(SgFeedRatio sgFeedRatio);
/**
* 修改饲喂比例
*
* @param sgFeedRatio 饲喂比例
* @return 结果
*/
public int updateSgFeedRatio(SgFeedRatio sgFeedRatio);
/**
* 删除饲喂比例
*
* @param id 饲喂比例主键
* @return 结果
*/
public int deleteSgFeedRatioById(Long id);
/**
* 批量删除饲喂比例
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteSgFeedRatioByIds(Long[] ids);
}

View File

@ -0,0 +1,61 @@
package com.zhyc.module.feed.mapper;
import java.util.List;
import com.zhyc.module.feed.domain.SgFodder;
/**
* 原料Mapper接口
*
* @author ruoyi
* @date 2025-08-01
*/
public interface SgFodderMapper
{
/**
* 查询原料
*
* @param id 原料主键
* @return 原料
*/
public SgFodder selectSgFodderById(Long id);
/**
* 查询原料列表
*
* @param sgFodder 原料
* @return 原料集合
*/
public List<SgFodder> selectSgFodderList(SgFodder sgFodder);
/**
* 新增原料
*
* @param sgFodder 原料
* @return 结果
*/
public int insertSgFodder(SgFodder sgFodder);
/**
* 修改原料
*
* @param sgFodder 原料
* @return 结果
*/
public int updateSgFodder(SgFodder sgFodder);
/**
* 删除原料
*
* @param id 原料主键
* @return 结果
*/
public int deleteSgFodderById(Long id);
/**
* 批量删除原料
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteSgFodderByIds(Long[] ids);
}

View File

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

View File

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

View File

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

View File

@ -0,0 +1,61 @@
package com.zhyc.module.feed.service;
import java.util.List;
import com.zhyc.module.feed.domain.SgFeedDetails;
/**
* 饲喂记录详情Service接口
*
* @author ruoyi
* @date 2025-08-01
*/
public interface ISgFeedDetailsService
{
/**
* 查询饲喂记录详情
*
* @param id 饲喂记录详情主键
* @return 饲喂记录详情
*/
public SgFeedDetails selectSgFeedDetailsById(Long id);
/**
* 查询饲喂记录详情列表
*
* @param sgFeedDetails 饲喂记录详情
* @return 饲喂记录详情集合
*/
public List<SgFeedDetails> selectSgFeedDetailsList(SgFeedDetails sgFeedDetails);
/**
* 新增饲喂记录详情
*
* @param sgFeedDetails 饲喂记录详情
* @return 结果
*/
public int insertSgFeedDetails(SgFeedDetails sgFeedDetails);
/**
* 修改饲喂记录详情
*
* @param sgFeedDetails 饲喂记录详情
* @return 结果
*/
public int updateSgFeedDetails(SgFeedDetails sgFeedDetails);
/**
* 批量删除饲喂记录详情
*
* @param ids 需要删除的饲喂记录详情主键集合
* @return 结果
*/
public int deleteSgFeedDetailsByIds(Long[] ids);
/**
* 删除饲喂记录详情信息
*
* @param id 饲喂记录详情主键
* @return 结果
*/
public int deleteSgFeedDetailsById(Long id);
}

View File

@ -0,0 +1,61 @@
package com.zhyc.module.feed.service;
import java.util.List;
import com.zhyc.module.feed.domain.SgFeedInfo;
/**
* 饲喂记录Service接口
*
* @author ruoyi
* @date 2025-08-01
*/
public interface ISgFeedInfoService
{
/**
* 查询饲喂记录
*
* @param id 饲喂记录主键
* @return 饲喂记录
*/
public SgFeedInfo selectSgFeedInfoById(Long id);
/**
* 查询饲喂记录列表
*
* @param sgFeedInfo 饲喂记录
* @return 饲喂记录集合
*/
public List<SgFeedInfo> selectSgFeedInfoList(SgFeedInfo sgFeedInfo);
/**
* 新增饲喂记录
*
* @param sgFeedInfo 饲喂记录
* @return 结果
*/
public int insertSgFeedInfo(SgFeedInfo sgFeedInfo);
/**
* 修改饲喂记录
*
* @param sgFeedInfo 饲喂记录
* @return 结果
*/
public int updateSgFeedInfo(SgFeedInfo sgFeedInfo);
/**
* 批量删除饲喂记录
*
* @param ids 需要删除的饲喂记录主键集合
* @return 结果
*/
public int deleteSgFeedInfoByIds(Long[] ids);
/**
* 删除饲喂记录信息
*
* @param id 饲喂记录主键
* @return 结果
*/
public int deleteSgFeedInfoById(Long id);
}

View File

@ -0,0 +1,62 @@
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-08
*/
public interface ISgFeedPlanService
{
/**
* 查询饲喂计划
*
* @param createDate 饲喂计划主键
* @return 饲喂计划
*/
SgFeedPlan selectSgFeedPlanByCreateDate(Date createDate);
/**
* 查询饲喂计划列表
*
* @param sgFeedPlan 饲喂计划
* @return 饲喂计划集合
*/
List<SgFeedPlan> selectSgFeedPlanList(SgFeedPlan sgFeedPlan);
/**
* 新增饲喂计划
*
* @param sgFeedPlan 饲喂计划
* @return 结果
*/
int insertSgFeedPlan(SgFeedPlan sgFeedPlan);
/**
* 修改饲喂计划
*
* @param sgFeedPlan 饲喂计划
* @return 结果
*/
int updateSgFeedPlan(SgFeedPlan sgFeedPlan);
/**
* 批量删除饲喂计划
*
* @param createDates 需要删除的饲喂计划主键集合
* @return 结果
*/
int deleteSgFeedPlanByCreateDates(Date[] createDates);
/**
* 删除饲喂计划信息
*
* @param createDate 饲喂计划主键
* @return 结果
*/
int deleteSgFeedPlanByCreateDate(Date createDate);
}

View File

@ -0,0 +1,61 @@
package com.zhyc.module.feed.service;
import java.util.List;
import com.zhyc.module.feed.domain.SgFeedRatio;
/**
* 饲喂比例Service接口
*
* @author ruoyi
* @date 2025-08-01
*/
public interface ISgFeedRatioService
{
/**
* 查询饲喂比例
*
* @param id 饲喂比例主键
* @return 饲喂比例
*/
public SgFeedRatio selectSgFeedRatioById(Long id);
/**
* 查询饲喂比例列表
*
* @param sgFeedRatio 饲喂比例
* @return 饲喂比例集合
*/
public List<SgFeedRatio> selectSgFeedRatioList(SgFeedRatio sgFeedRatio);
/**
* 新增饲喂比例
*
* @param sgFeedRatio 饲喂比例
* @return 结果
*/
public int insertSgFeedRatio(SgFeedRatio sgFeedRatio);
/**
* 修改饲喂比例
*
* @param sgFeedRatio 饲喂比例
* @return 结果
*/
public int updateSgFeedRatio(SgFeedRatio sgFeedRatio);
/**
* 批量删除饲喂比例
*
* @param ids 需要删除的饲喂比例主键集合
* @return 结果
*/
public int deleteSgFeedRatioByIds(Long[] ids);
/**
* 删除饲喂比例信息
*
* @param id 饲喂比例主键
* @return 结果
*/
public int deleteSgFeedRatioById(Long id);
}

View File

@ -0,0 +1,61 @@
package com.zhyc.module.feed.service;
import java.util.List;
import com.zhyc.module.feed.domain.SgFodder;
/**
* 原料Service接口
*
* @author ruoyi
* @date 2025-08-01
*/
public interface ISgFodderService
{
/**
* 查询原料
*
* @param id 原料主键
* @return 原料
*/
public SgFodder selectSgFodderById(Long id);
/**
* 查询原料列表
*
* @param sgFodder 原料
* @return 原料集合
*/
public List<SgFodder> selectSgFodderList(SgFodder sgFodder);
/**
* 新增原料
*
* @param sgFodder 原料
* @return 结果
*/
public int insertSgFodder(SgFodder sgFodder);
/**
* 修改原料
*
* @param sgFodder 原料
* @return 结果
*/
public int updateSgFodder(SgFodder sgFodder);
/**
* 批量删除原料
*
* @param ids 需要删除的原料主键集合
* @return 结果
*/
public int deleteSgFodderByIds(Long[] ids);
/**
* 删除原料信息
*
* @param id 原料主键
* @return 结果
*/
public int deleteSgFodderById(Long id);
}

View File

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

View File

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

View File

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

View File

@ -0,0 +1,93 @@
package com.zhyc.module.feed.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zhyc.module.feed.mapper.SgFeedDetailsMapper;
import com.zhyc.module.feed.domain.SgFeedDetails;
import com.zhyc.module.feed.service.ISgFeedDetailsService;
/**
* 饲喂记录详情Service业务层处理
*
* @author ruoyi
* @date 2025-08-01
*/
@Service
public class SgFeedDetailsServiceImpl implements ISgFeedDetailsService
{
@Autowired
private SgFeedDetailsMapper sgFeedDetailsMapper;
/**
* 查询饲喂记录详情
*
* @param id 饲喂记录详情主键
* @return 饲喂记录详情
*/
@Override
public SgFeedDetails selectSgFeedDetailsById(Long id)
{
return sgFeedDetailsMapper.selectSgFeedDetailsById(id);
}
/**
* 查询饲喂记录详情列表
*
* @param sgFeedDetails 饲喂记录详情
* @return 饲喂记录详情
*/
@Override
public List<SgFeedDetails> selectSgFeedDetailsList(SgFeedDetails sgFeedDetails)
{
return sgFeedDetailsMapper.selectSgFeedDetailsList(sgFeedDetails);
}
/**
* 新增饲喂记录详情
*
* @param sgFeedDetails 饲喂记录详情
* @return 结果
*/
@Override
public int insertSgFeedDetails(SgFeedDetails sgFeedDetails)
{
return sgFeedDetailsMapper.insertSgFeedDetails(sgFeedDetails);
}
/**
* 修改饲喂记录详情
*
* @param sgFeedDetails 饲喂记录详情
* @return 结果
*/
@Override
public int updateSgFeedDetails(SgFeedDetails sgFeedDetails)
{
return sgFeedDetailsMapper.updateSgFeedDetails(sgFeedDetails);
}
/**
* 批量删除饲喂记录详情
*
* @param ids 需要删除的饲喂记录详情主键
* @return 结果
*/
@Override
public int deleteSgFeedDetailsByIds(Long[] ids)
{
return sgFeedDetailsMapper.deleteSgFeedDetailsByIds(ids);
}
/**
* 删除饲喂记录详情信息
*
* @param id 饲喂记录详情主键
* @return 结果
*/
@Override
public int deleteSgFeedDetailsById(Long id)
{
return sgFeedDetailsMapper.deleteSgFeedDetailsById(id);
}
}

View File

@ -0,0 +1,95 @@
package com.zhyc.module.feed.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.feed.mapper.SgFeedInfoMapper;
import com.zhyc.module.feed.domain.SgFeedInfo;
import com.zhyc.module.feed.service.ISgFeedInfoService;
/**
* 饲喂记录Service业务层处理
*
* @author ruoyi
* @date 2025-08-01
*/
@Service
public class SgFeedInfoServiceImpl implements ISgFeedInfoService
{
@Autowired
private SgFeedInfoMapper sgFeedInfoMapper;
/**
* 查询饲喂记录
*
* @param id 饲喂记录主键
* @return 饲喂记录
*/
@Override
public SgFeedInfo selectSgFeedInfoById(Long id)
{
return sgFeedInfoMapper.selectSgFeedInfoById(id);
}
/**
* 查询饲喂记录列表
*
* @param sgFeedInfo 饲喂记录
* @return 饲喂记录
*/
@Override
public List<SgFeedInfo> selectSgFeedInfoList(SgFeedInfo sgFeedInfo)
{
return sgFeedInfoMapper.selectSgFeedInfoList(sgFeedInfo);
}
/**
* 新增饲喂记录
*
* @param sgFeedInfo 饲喂记录
* @return 结果
*/
@Override
public int insertSgFeedInfo(SgFeedInfo sgFeedInfo)
{
sgFeedInfo.setCreateTime(DateUtils.getNowDate());
return sgFeedInfoMapper.insertSgFeedInfo(sgFeedInfo);
}
/**
* 修改饲喂记录
*
* @param sgFeedInfo 饲喂记录
* @return 结果
*/
@Override
public int updateSgFeedInfo(SgFeedInfo sgFeedInfo)
{
return sgFeedInfoMapper.updateSgFeedInfo(sgFeedInfo);
}
/**
* 批量删除饲喂记录
*
* @param ids 需要删除的饲喂记录主键
* @return 结果
*/
@Override
public int deleteSgFeedInfoByIds(Long[] ids)
{
return sgFeedInfoMapper.deleteSgFeedInfoByIds(ids);
}
/**
* 删除饲喂记录信息
*
* @param id 饲喂记录主键
* @return 结果
*/
@Override
public int deleteSgFeedInfoById(Long id)
{
return sgFeedInfoMapper.deleteSgFeedInfoById(id);
}
}

View File

@ -0,0 +1,99 @@
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-08
*/
@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);
}
}

View File

@ -0,0 +1,93 @@
package com.zhyc.module.feed.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zhyc.module.feed.mapper.SgFeedRatioMapper;
import com.zhyc.module.feed.domain.SgFeedRatio;
import com.zhyc.module.feed.service.ISgFeedRatioService;
/**
* 饲喂比例Service业务层处理
*
* @author ruoyi
* @date 2025-08-01
*/
@Service
public class SgFeedRatioServiceImpl implements ISgFeedRatioService
{
@Autowired
private SgFeedRatioMapper sgFeedRatioMapper;
/**
* 查询饲喂比例
*
* @param id 饲喂比例主键
* @return 饲喂比例
*/
@Override
public SgFeedRatio selectSgFeedRatioById(Long id)
{
return sgFeedRatioMapper.selectSgFeedRatioById(id);
}
/**
* 查询饲喂比例列表
*
* @param sgFeedRatio 饲喂比例
* @return 饲喂比例
*/
@Override
public List<SgFeedRatio> selectSgFeedRatioList(SgFeedRatio sgFeedRatio)
{
return sgFeedRatioMapper.selectSgFeedRatioList(sgFeedRatio);
}
/**
* 新增饲喂比例
*
* @param sgFeedRatio 饲喂比例
* @return 结果
*/
@Override
public int insertSgFeedRatio(SgFeedRatio sgFeedRatio)
{
return sgFeedRatioMapper.insertSgFeedRatio(sgFeedRatio);
}
/**
* 修改饲喂比例
*
* @param sgFeedRatio 饲喂比例
* @return 结果
*/
@Override
public int updateSgFeedRatio(SgFeedRatio sgFeedRatio)
{
return sgFeedRatioMapper.updateSgFeedRatio(sgFeedRatio);
}
/**
* 批量删除饲喂比例
*
* @param ids 需要删除的饲喂比例主键
* @return 结果
*/
@Override
public int deleteSgFeedRatioByIds(Long[] ids)
{
return sgFeedRatioMapper.deleteSgFeedRatioByIds(ids);
}
/**
* 删除饲喂比例信息
*
* @param id 饲喂比例主键
* @return 结果
*/
@Override
public int deleteSgFeedRatioById(Long id)
{
return sgFeedRatioMapper.deleteSgFeedRatioById(id);
}
}

View File

@ -0,0 +1,93 @@
package com.zhyc.module.feed.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zhyc.module.feed.mapper.SgFodderMapper;
import com.zhyc.module.feed.domain.SgFodder;
import com.zhyc.module.feed.service.ISgFodderService;
/**
* 原料Service业务层处理
*
* @author ruoyi
* @date 2025-08-01
*/
@Service
public class SgFodderServiceImpl implements ISgFodderService
{
@Autowired
private SgFodderMapper sgFodderMapper;
/**
* 查询原料
*
* @param id 原料主键
* @return 原料
*/
@Override
public SgFodder selectSgFodderById(Long id)
{
return sgFodderMapper.selectSgFodderById(id);
}
/**
* 查询原料列表
*
* @param sgFodder 原料
* @return 原料
*/
@Override
public List<SgFodder> selectSgFodderList(SgFodder sgFodder)
{
return sgFodderMapper.selectSgFodderList(sgFodder);
}
/**
* 新增原料
*
* @param sgFodder 原料
* @return 结果
*/
@Override
public int insertSgFodder(SgFodder sgFodder)
{
return sgFodderMapper.insertSgFodder(sgFodder);
}
/**
* 修改原料
*
* @param sgFodder 原料
* @return 结果
*/
@Override
public int updateSgFodder(SgFodder sgFodder)
{
return sgFodderMapper.updateSgFodder(sgFodder);
}
/**
* 批量删除原料
*
* @param ids 需要删除的原料主键
* @return 结果
*/
@Override
public int deleteSgFodderByIds(Long[] ids)
{
return sgFodderMapper.deleteSgFodderByIds(ids);
}
/**
* 删除原料信息
*
* @param id 原料主键
* @return 结果
*/
@Override
public int deleteSgFodderById(Long id)
{
return sgFodderMapper.deleteSgFodderById(id);
}
}

View File

@ -0,0 +1,97 @@
package com.zhyc.module.feed.service.impl;
import java.util.List;
import java.util.Objects;
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);
}
}

View File

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

View File

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

View File

@ -0,0 +1,120 @@
package com.zhyc.module.produce.breed.controller;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zhyc.common.annotation.Log;
import com.zhyc.common.core.controller.BaseController;
import com.zhyc.common.core.domain.AjaxResult;
import com.zhyc.common.enums.BusinessType;
import com.zhyc.module.produce.breed.domain.ScSheepDeath;
import com.zhyc.module.produce.breed.service.IScSheepDeathService;
import com.zhyc.common.utils.poi.ExcelUtil;
import com.zhyc.common.core.page.TableDataInfo;
/**
* 羊只死淘记录Controller
*
* @author ruoyi
* @date 2025-08-06
*/
@RestController
@RequestMapping("/sheep_death/death")
public class ScSheepDeathController extends BaseController
{
@Autowired
private IScSheepDeathService scSheepDeathService;
/**
* 查询羊只死淘记录列表
*/
@PreAuthorize("@ss.hasPermi('sheep_death:death:list')")
@GetMapping("/list")
public TableDataInfo list(ScSheepDeath scSheepDeath)
{
startPage();
List<ScSheepDeath> list = scSheepDeathService.selectScSheepDeathList(scSheepDeath);
return getDataTable(list);
}
/**
* 根据管理耳号查询羊只信息
*/
@PreAuthorize("@ss.hasPermi('sheep_death:death:query')")
@GetMapping("/sheepInfo/{manageTags}")
public AjaxResult getSheepInfo(@PathVariable("manageTags") String manageTags)
{
Map<String, Object> sheepInfo = scSheepDeathService.selectSheepFileByManageTags(manageTags);
if (sheepInfo != null) {
return success(sheepInfo);
} else {
return error("未找到该耳号对应的羊只信息");
}
}
/**
* 导出羊只死淘记录列表
*/
@PreAuthorize("@ss.hasPermi('sheep_death:death:export')")
@Log(title = "羊只死淘记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ScSheepDeath scSheepDeath)
{
List<ScSheepDeath> list = scSheepDeathService.selectScSheepDeathList(scSheepDeath);
ExcelUtil<ScSheepDeath> util = new ExcelUtil<ScSheepDeath>(ScSheepDeath.class);
util.exportExcel(response, list, "羊只死淘记录数据");
}
/**
* 获取羊只死淘记录详细信息
*/
@PreAuthorize("@ss.hasPermi('sheep_death:death:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(scSheepDeathService.selectScSheepDeathById(id));
}
/**
* 新增羊只死淘记录
*/
@PreAuthorize("@ss.hasPermi('sheep_death:death:add')")
@Log(title = "羊只死淘记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ScSheepDeath scSheepDeath)
{
return toAjax(scSheepDeathService.insertScSheepDeath(scSheepDeath));
}
/**
* 修改羊只死淘记录
*/
@PreAuthorize("@ss.hasPermi('sheep_death:death:edit')")
@Log(title = "羊只死淘记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ScSheepDeath scSheepDeath)
{
return toAjax(scSheepDeathService.updateScSheepDeath(scSheepDeath));
}
/**
* 删除羊只死淘记录
*/
@PreAuthorize("@ss.hasPermi('sheep_death:death:remove')")
@Log(title = "羊只死淘记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(scSheepDeathService.deleteScSheepDeathByIds(ids));
}
}

View File

@ -0,0 +1,356 @@
package com.zhyc.module.produce.breed.domain;
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;
/**
* 羊只死淘记录对象 sc_sheep_death
*
* @author ruoyi
* @date 2025-08-06
*/
public class ScSheepDeath extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键ID */
private Long id;
/** 羊只ID */
@Excel(name = "羊只ID")
private Long sheepId;
/** 管理耳号 */
@Excel(name = "管理耳号")
private String manageTags;
/** 事件类型 */
@Excel(name = "事件类型")
private String eventType;
/** 死亡日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "死亡日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date deathDate;
/** 疾病类型ID */
@Excel(name = "疾病类型ID")
private Long diseaseTypeId;
/** 疾病子类型ID */
@Excel(name = "疾病子类型ID")
private Long diseaseSubtypeId;
/** 死淘去向 */
@Excel(name = "死淘去向")
private String disposalDirection;
/** 技术员 */
@Excel(name = "技术员")
private String technician;
/** 处理人 */
@Excel(name = "处理人")
private String handler;
/** 班组 */
@Excel(name = "班组")
private String workGroup;
/** 备注 */
@Excel(name = "备注")
private String comment;
/** 是否删除(0:未删除 1:已删除) */
@Excel(name = "是否删除(0:未删除 1:已删除)")
private Long isDelete;
// 以下字段仅用于前端显示不存储到数据库
/** 品种 */
private String variety;
/** 死亡时羊只类别 */
private String sheepType;
/** 性别 */
private Integer gender;
/** 日龄 */
private Long dayAge;
/** 胎次 */
private Integer parity;
/** 羊舍 */
private String sheepfoldName;
/** 繁育状态 */
private String breedStatus;
/** 死亡时产后天数 */
private Integer postLambingDay;
/** 死亡时泌乳天数 */
private Integer lactationDay;
/** 死亡时怀孕天数 */
private Integer gestationDay;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setSheepId(Long sheepId)
{
this.sheepId = sheepId;
}
public Long getSheepId()
{
return sheepId;
}
public void setManageTags(String manageTags)
{
this.manageTags = manageTags;
}
public String getManageTags()
{
return manageTags;
}
public void setEventType(String eventType)
{
this.eventType = eventType;
}
public String getEventType()
{
return eventType;
}
public void setDeathDate(Date deathDate)
{
this.deathDate = deathDate;
}
public Date getDeathDate()
{
return deathDate;
}
public void setDiseaseTypeId(Long diseaseTypeId)
{
this.diseaseTypeId = diseaseTypeId;
}
public Long getDiseaseTypeId()
{
return diseaseTypeId;
}
public void setDiseaseSubtypeId(Long diseaseSubtypeId)
{
this.diseaseSubtypeId = diseaseSubtypeId;
}
public Long getDiseaseSubtypeId()
{
return diseaseSubtypeId;
}
public void setDisposalDirection(String disposalDirection)
{
this.disposalDirection = disposalDirection;
}
public String getDisposalDirection()
{
return disposalDirection;
}
public void setTechnician(String technician)
{
this.technician = technician;
}
public String getTechnician()
{
return technician;
}
public void setHandler(String handler)
{
this.handler = handler;
}
public String getHandler()
{
return handler;
}
public void setWorkGroup(String workGroup)
{
this.workGroup = workGroup;
}
public String getWorkGroup()
{
return workGroup;
}
public void setComment(String comment)
{
this.comment = comment;
}
public String getComment()
{
return comment;
}
public void setIsDelete(Long isDelete)
{
this.isDelete = isDelete;
}
public Long getIsDelete()
{
return isDelete;
}
// 以下为仅用于显示的字段的getter/setter
public void setVariety(String variety)
{
this.variety = variety;
}
public String getVariety()
{
return variety;
}
public void setSheepType(String sheepType)
{
this.sheepType = sheepType;
}
public String getSheepType()
{
return sheepType;
}
public void setGender(Integer gender)
{
this.gender = gender;
}
public Integer getGender()
{
return gender;
}
public void setDayAge(Long dayAge)
{
this.dayAge = dayAge;
}
public Long getDayAge()
{
return dayAge;
}
public void setParity(Integer parity)
{
this.parity = parity;
}
public Integer getParity()
{
return parity;
}
public void setSheepfoldName(String sheepfoldName)
{
this.sheepfoldName = sheepfoldName;
}
public String getSheepfoldName()
{
return sheepfoldName;
}
public void setBreedStatus(String breedStatus)
{
this.breedStatus = breedStatus;
}
public String getBreedStatus()
{
return breedStatus;
}
public void setPostLambingDay(Integer postLambingDay)
{
this.postLambingDay = postLambingDay;
}
public Integer getPostLambingDay()
{
return postLambingDay;
}
public void setLactationDay(Integer lactationDay)
{
this.lactationDay = lactationDay;
}
public Integer getLactationDay()
{
return lactationDay;
}
public void setGestationDay(Integer gestationDay)
{
this.gestationDay = gestationDay;
}
public Integer getGestationDay()
{
return gestationDay;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("sheepId", getSheepId())
.append("manageTags", getManageTags())
.append("eventType", getEventType())
.append("deathDate", getDeathDate())
.append("diseaseTypeId", getDiseaseTypeId())
.append("diseaseSubtypeId", getDiseaseSubtypeId())
.append("disposalDirection", getDisposalDirection())
.append("technician", getTechnician())
.append("handler", getHandler())
.append("workGroup", getWorkGroup())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("comment", getComment())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("isDelete", getIsDelete())
.toString();
}
}

View File

@ -0,0 +1,70 @@
package com.zhyc.module.produce.breed.mapper;
import java.util.List;
import java.util.Map;
import com.zhyc.module.produce.breed.domain.ScSheepDeath;
/**
* 羊只死淘记录Mapper接口
*
* @author ruoyi
* @date 2025-08-06
*/
public interface ScSheepDeathMapper
{
/**
* 查询羊只死淘记录
*
* @param id 羊只死淘记录主键
* @return 羊只死淘记录
*/
public ScSheepDeath selectScSheepDeathById(Long id);
/**
* 查询羊只死淘记录列表
*
* @param scSheepDeath 羊只死淘记录
* @return 羊只死淘记录集合
*/
public List<ScSheepDeath> selectScSheepDeathList(ScSheepDeath scSheepDeath);
/**
* 根据管理耳号查询sheep_file视图信息
*
* @param manageTags 管理耳号
* @return 羊只信息
*/
public Map<String, Object> selectSheepFileByManageTags(String manageTags);
/**
* 新增羊只死淘记录
*
* @param scSheepDeath 羊只死淘记录
* @return 结果
*/
public int insertScSheepDeath(ScSheepDeath scSheepDeath);
/**
* 修改羊只死淘记录
*
* @param scSheepDeath 羊只死淘记录
* @return 结果
*/
public int updateScSheepDeath(ScSheepDeath scSheepDeath);
/**
* 删除羊只死淘记录
*
* @param id 羊只死淘记录主键
* @return 结果
*/
public int deleteScSheepDeathById(Long id);
/**
* 批量删除羊只死淘记录
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteScSheepDeathByIds(Long[] ids);
}

View File

@ -0,0 +1,70 @@
package com.zhyc.module.produce.breed.service;
import java.util.List;
import java.util.Map;
import com.zhyc.module.produce.breed.domain.ScSheepDeath;
/**
* 羊只死淘记录Service接口
*
* @author ruoyi
* @date 2025-08-06
*/
public interface IScSheepDeathService
{
/**
* 查询羊只死淘记录
*
* @param id 羊只死淘记录主键
* @return 羊只死淘记录
*/
public ScSheepDeath selectScSheepDeathById(Long id);
/**
* 查询羊只死淘记录列表
*
* @param scSheepDeath 羊只死淘记录
* @return 羊只死淘记录集合
*/
public List<ScSheepDeath> selectScSheepDeathList(ScSheepDeath scSheepDeath);
/**
* 根据管理耳号查询sheep_file视图信息
*
* @param manageTags 管理耳号
* @return 羊只信息
*/
public Map<String, Object> selectSheepFileByManageTags(String manageTags);
/**
* 新增羊只死淘记录
*
* @param scSheepDeath 羊只死淘记录
* @return 结果
*/
public int insertScSheepDeath(ScSheepDeath scSheepDeath);
/**
* 修改羊只死淘记录
*
* @param scSheepDeath 羊只死淘记录
* @return 结果
*/
public int updateScSheepDeath(ScSheepDeath scSheepDeath);
/**
* 批量删除羊只死淘记录
*
* @param ids 需要删除的羊只死淘记录主键集合
* @return 结果
*/
public int deleteScSheepDeathByIds(Long[] ids);
/**
* 删除羊只死淘记录信息
*
* @param id 羊只死淘记录主键
* @return 结果
*/
public int deleteScSheepDeathById(Long id);
}

View File

@ -0,0 +1,166 @@
package com.zhyc.module.produce.breed.service.impl;
import java.util.List;
import java.util.Map;
import com.zhyc.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zhyc.module.produce.breed.mapper.ScSheepDeathMapper;
import com.zhyc.module.produce.breed.domain.ScSheepDeath;
import com.zhyc.module.produce.breed.service.IScSheepDeathService;
/**
* 羊只死淘记录Service业务层处理
*
* @author ruoyi
* @date 2025-08-06
*/
@Service
public class ScSheepDeathServiceImpl implements IScSheepDeathService
{
@Autowired
private ScSheepDeathMapper scSheepDeathMapper;
/**
* 查询羊只死淘记录
*
* @param id 羊只死淘记录主键
* @return 羊只死淘记录
*/
@Override
public ScSheepDeath selectScSheepDeathById(Long id)
{
ScSheepDeath scSheepDeath = scSheepDeathMapper.selectScSheepDeathById(id);
// 查询时也需要填充显示字段
if (scSheepDeath != null && scSheepDeath.getManageTags() != null) {
Map<String, Object> sheepInfo = selectSheepFileByManageTags(scSheepDeath.getManageTags());
if (sheepInfo != null) {
scSheepDeath.setVariety(sheepInfo.get("variety") != null ? sheepInfo.get("variety").toString() : null);
scSheepDeath.setSheepType(sheepInfo.get("sheepType") != null ? sheepInfo.get("sheepType").toString() : null);
scSheepDeath.setGender(sheepInfo.get("gender") != null ? Integer.valueOf(sheepInfo.get("gender").toString()) : null);
scSheepDeath.setDayAge(sheepInfo.get("dayAge") != null ? Long.valueOf(sheepInfo.get("dayAge").toString()) : null);
scSheepDeath.setParity(sheepInfo.get("parity") != null ? Integer.valueOf(sheepInfo.get("parity").toString()) : null);
scSheepDeath.setSheepfoldName(sheepInfo.get("sheepfoldName") != null ? sheepInfo.get("sheepfoldName").toString() : null);
scSheepDeath.setBreedStatus(sheepInfo.get("breedStatus") != null ? sheepInfo.get("breedStatus").toString() : null);
scSheepDeath.setPostLambingDay(sheepInfo.get("postLambingDay") != null ? Integer.valueOf(sheepInfo.get("postLambingDay").toString()) : null);
scSheepDeath.setLactationDay(sheepInfo.get("lactationDay") != null ? Integer.valueOf(sheepInfo.get("lactationDay").toString()) : null);
scSheepDeath.setGestationDay(sheepInfo.get("gestationDay") != null ? Integer.valueOf(sheepInfo.get("gestationDay").toString()) : null);
}
}
return scSheepDeath;
}
/**
* 查询羊只死淘记录列表
*
* @param scSheepDeath 羊只死淘记录
* @return 羊只死淘记录
*/
@Override
public List<ScSheepDeath> selectScSheepDeathList(ScSheepDeath scSheepDeath)
{
List<ScSheepDeath> list = scSheepDeathMapper.selectScSheepDeathList(scSheepDeath);
// 为列表中的每条记录填充显示字段
for (ScSheepDeath death : list) {
if (death.getManageTags() != null) {
Map<String, Object> sheepInfo = selectSheepFileByManageTags(death.getManageTags());
if (sheepInfo != null) {
death.setVariety(sheepInfo.get("variety") != null ? sheepInfo.get("variety").toString() : null);
death.setSheepType(sheepInfo.get("sheepType") != null ? sheepInfo.get("sheepType").toString() : null);
death.setGender(sheepInfo.get("gender") != null ? Integer.valueOf(sheepInfo.get("gender").toString()) : null);
death.setDayAge(sheepInfo.get("dayAge") != null ? Long.valueOf(sheepInfo.get("dayAge").toString()) : null);
death.setParity(sheepInfo.get("parity") != null ? Integer.valueOf(sheepInfo.get("parity").toString()) : null);
death.setSheepfoldName(sheepInfo.get("sheepfoldName") != null ? sheepInfo.get("sheepfoldName").toString() : null);
death.setBreedStatus(sheepInfo.get("breedStatus") != null ? sheepInfo.get("breedStatus").toString() : null);
death.setPostLambingDay(sheepInfo.get("postLambingDay") != null ? Integer.valueOf(sheepInfo.get("postLambingDay").toString()) : null);
death.setLactationDay(sheepInfo.get("lactationDay") != null ? Integer.valueOf(sheepInfo.get("lactationDay").toString()) : null);
death.setGestationDay(sheepInfo.get("gestationDay") != null ? Integer.valueOf(sheepInfo.get("gestationDay").toString()) : null);
}
}
}
return list;
}
/**
* 根据管理耳号查询sheep_file视图信息
*
* @param manageTags 管理耳号
* @return 羊只信息
*/
@Override
public Map<String, Object> selectSheepFileByManageTags(String manageTags)
{
return scSheepDeathMapper.selectSheepFileByManageTags(manageTags);
}
/**
* 新增羊只死淘记录
*
* @param scSheepDeath 羊只死淘记录
* @return 结果
*/
@Override
public int insertScSheepDeath(ScSheepDeath scSheepDeath)
{
// 设置事件类型默认为"死亡"
if (scSheepDeath.getEventType() == null || scSheepDeath.getEventType().isEmpty()) {
scSheepDeath.setEventType("死亡");
}
// 如果有管理耳号查询并设置羊只ID
if (scSheepDeath.getManageTags() != null && !scSheepDeath.getManageTags().isEmpty()) {
Map<String, Object> sheepInfo = selectSheepFileByManageTags(scSheepDeath.getManageTags());
if (sheepInfo != null) {
scSheepDeath.setSheepId(sheepInfo.get("sheepId") != null ? Long.valueOf(sheepInfo.get("sheepId").toString()) : null);
}
}
scSheepDeath.setCreateTime(DateUtils.getNowDate());
return scSheepDeathMapper.insertScSheepDeath(scSheepDeath);
}
/**
* 修改羊只死淘记录
*
* @param scSheepDeath 羊只死淘记录
* @return 结果
*/
@Override
public int updateScSheepDeath(ScSheepDeath scSheepDeath)
{
// 如果管理耳号发生变化重新查询并设置羊只ID
if (scSheepDeath.getManageTags() != null && !scSheepDeath.getManageTags().isEmpty()) {
Map<String, Object> sheepInfo = selectSheepFileByManageTags(scSheepDeath.getManageTags());
if (sheepInfo != null) {
scSheepDeath.setSheepId(sheepInfo.get("sheepId") != null ? Long.valueOf(sheepInfo.get("sheepId").toString()) : null);
}
}
scSheepDeath.setUpdateTime(DateUtils.getNowDate());
return scSheepDeathMapper.updateScSheepDeath(scSheepDeath);
}
/**
* 批量删除羊只死淘记录
*
* @param ids 需要删除的羊只死淘记录主键
* @return 结果
*/
@Override
public int deleteScSheepDeathByIds(Long[] ids)
{
return scSheepDeathMapper.deleteScSheepDeathByIds(ids);
}
/**
* 删除羊只死淘记录信息
*
* @param id 羊只死淘记录主键
* @return 结果
*/
@Override
public int deleteScSheepDeathById(Long id)
{
return scSheepDeathMapper.deleteScSheepDeathById(id);
}
}

View File

@ -36,9 +36,9 @@ public class ScAddSheepServiceImpl implements IScAddSheepService {
@Override
@Transactional(rollbackFor = Exception.class)
public boolean insertScAddSheep(ScAddSheep scAddSheep) {
ScAddSheep exist = scAddSheepMapper.selectByEarNumber(scAddSheep.getEarNumber());
if (exist != null) {
throw new ServiceException("添加失败,耳号重复");
BasSheep existSheep =basSheepService.selectBasSheepByManageTags(scAddSheep.getEarNumber().trim());
if (existSheep != null) {
throw new ServiceException("添加失败,耳号已存在");
}
boolean ok = scAddSheepMapper.insert(scAddSheep) > 0;
@ -101,6 +101,7 @@ public class ScAddSheepServiceImpl implements IScAddSheepService {
for (int i = 0; i < list.size(); i++) {
ScAddSheep sheep = list.get(i);
try {
// 处理品种名称转换为品种ID
if (StringUtils.isNotBlank(sheep.getVarietyName())) {
Long varietyId = basSheepVarietyMapper.selectIdByName(sheep.getVarietyName());
if (varietyId == null) {
@ -121,6 +122,7 @@ public class ScAddSheepServiceImpl implements IScAddSheepService {
continue;
}
// 处理羊舍名称转换为羊舍ID
if (StringUtils.isNotBlank(sheep.getSheepfoldNameExcel())) {
DaSheepfold param = new DaSheepfold();
param.setSheepfoldName(sheep.getSheepfoldNameExcel());
@ -137,6 +139,7 @@ public class ScAddSheepServiceImpl implements IScAddSheepService {
sheep.setSheepfold(foldList.get(0).getId().intValue());
}
// 校验耳号是否为空
if (StringUtils.isBlank(sheep.getEarNumber())) {
failure++;
failureMsg.append("<br/>第")
@ -145,17 +148,19 @@ public class ScAddSheepServiceImpl implements IScAddSheepService {
continue;
}
ScAddSheep exist = scAddSheepMapper.selectByEarNumber(sheep.getEarNumber());
if (exist != null) {
// 核心校验判断羊只基本信息表中是否存在未删除的同名耳号
BasSheep existSheep = basSheepService.selectBasSheepByManageTags(sheep.getEarNumber().trim());
if (existSheep != null) {
failure++;
failureMsg.append("<br/>第")
.append(i + 1)
.append("行:耳号已存在")
.append("行:耳号已存在且未删除")
.append(sheep.getEarNumber())
.append("");
continue;
}
// 执行导入新增或更新
if (updateSupport && sheep.getId() != null) {
sheep.setUpdateBy(operName);
updateScAddSheep(sheep);

View File

@ -0,0 +1,116 @@
package com.zhyc.module.stock.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.stock.domain.WzMaterialsManagement;
import com.zhyc.module.stock.service.IWzMaterialsManagementService;
import com.zhyc.common.utils.poi.ExcelUtil;
import com.zhyc.common.core.page.TableDataInfo;
import org.springframework.web.multipart.MultipartFile;
/**
* 物资管理Controller
*
* @author HashMap
* @date 2025-08-05
*/
@RestController
@RequestMapping("/stock/management")
public class WzMaterialsManagementController extends BaseController {
private final IWzMaterialsManagementService wzMaterialsManagementService;
public WzMaterialsManagementController(IWzMaterialsManagementService wzMaterialsManagementService) {
this.wzMaterialsManagementService = wzMaterialsManagementService;
}
/**
* 查询物资管理列表
*/
@PreAuthorize("@ss.hasPermi('stock:management:list')")
@GetMapping("/list")
public TableDataInfo list(WzMaterialsManagement wzMaterialsManagement) {
startPage();
List<WzMaterialsManagement> list = wzMaterialsManagementService.selectWzMaterialsManagementList(wzMaterialsManagement);
return getDataTable(list);
}
/**
* 导出物资管理列表
*/
@PreAuthorize("@ss.hasPermi('stock:management:export')")
@Log(title = "物资管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WzMaterialsManagement wzMaterialsManagement) {
List<WzMaterialsManagement> list = wzMaterialsManagementService.selectWzMaterialsManagementList(wzMaterialsManagement);
ExcelUtil<WzMaterialsManagement> util = new ExcelUtil<>(WzMaterialsManagement.class);
util.exportExcel(response, list, "物资管理数据");
}
/**
* 获取物资管理详细信息
*/
@PreAuthorize("@ss.hasPermi('stock:management:query')")
@GetMapping(value = "/{materialManagementCode}")
public AjaxResult getInfo(@PathVariable("materialManagementCode") Long materialManagementCode) {
return success(wzMaterialsManagementService.selectWzMaterialsManagementByMaterialManagementCode(materialManagementCode));
}
/**
* 新增物资管理
*/
@PreAuthorize("@ss.hasPermi('stock:management:add')")
@Log(title = "物资管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WzMaterialsManagement wzMaterialsManagement) {
return toAjax(wzMaterialsManagementService.insertWzMaterialsManagement(wzMaterialsManagement));
}
/**
* 修改物资管理
*/
@PreAuthorize("@ss.hasPermi('stock:management:edit')")
@Log(title = "物资管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WzMaterialsManagement wzMaterialsManagement) {
return toAjax(wzMaterialsManagementService.updateWzMaterialsManagement(wzMaterialsManagement));
}
/**
* 删除物资管理
*/
@PreAuthorize("@ss.hasPermi('stock:management:remove')")
@Log(title = "物资管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{materialManagementCodes}")
public AjaxResult remove(@PathVariable Long[] materialManagementCodes) {
return toAjax(wzMaterialsManagementService.deleteWzMaterialsManagementByMaterialManagementCodes(materialManagementCodes));
}
@Log(title = "物资管理", businessType = BusinessType.IMPORT)
@PreAuthorize("@ss.hasPermi('stock:management:import')")
@PostMapping("/importData")
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
ExcelUtil<WzMaterialsManagement> util = new ExcelUtil<>(WzMaterialsManagement.class);
List<WzMaterialsManagement> stockInList = util.importExcel(file.getInputStream());
for (WzMaterialsManagement wzMaterialsManagement : stockInList) {
System.out.println(wzMaterialsManagement);
}
String operName = getUsername();
String message = wzMaterialsManagementService.importUser(stockInList, updateSupport, operName);
// String message = "OK We are testing";
return success(message);
}
}

View File

@ -0,0 +1,122 @@
package com.zhyc.module.stock.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.stock.domain.WzStockIn;
import com.zhyc.module.stock.service.IWzStockInService;
import com.zhyc.common.utils.poi.ExcelUtil;
import com.zhyc.common.core.page.TableDataInfo;
import org.springframework.web.multipart.MultipartFile;
/**
* 入库记录Controller
*
* @author HashMap
* @date 2025-08-05
*/
@RestController
@RequestMapping("/stock/in")
public class WzStockInController extends BaseController
{
private final IWzStockInService wzStockInService;
public WzStockInController(IWzStockInService wzStockInService) {
this.wzStockInService = wzStockInService;
}
/**
* 查询入库记录列表
*/
@PreAuthorize("@ss.hasPermi('stock:in:list')")
@GetMapping("/list")
public TableDataInfo list(WzStockIn wzStockIn)
{
startPage();
List<WzStockIn> list = wzStockInService.selectWzStockInList(wzStockIn);
return getDataTable(list);
}
/**
* 导出入库记录列表
*/
@PreAuthorize("@ss.hasPermi('stock:in:export')")
@Log(title = "入库记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WzStockIn wzStockIn)
{
List<WzStockIn> list = wzStockInService.selectWzStockInList(wzStockIn);
ExcelUtil<WzStockIn> util = new ExcelUtil<>(WzStockIn.class);
util.exportExcel(response, list, "入库记录数据");
}
/**
* 获取入库记录详细信息
*/
@PreAuthorize("@ss.hasPermi('stock:in:query')")
@GetMapping(value = "/{stockInCode}")
public AjaxResult getInfo(@PathVariable("stockInCode") Long stockInCode)
{
return success(wzStockInService.selectWzStockInByStockInCode(stockInCode));
}
/**
* 新增入库记录
*/
@PreAuthorize("@ss.hasPermi('stock:in:add')")
@Log(title = "入库记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WzStockIn wzStockIn)
{
return toAjax(wzStockInService.insertWzStockIn(wzStockIn));
}
/**
* 修改入库记录
*/
@PreAuthorize("@ss.hasPermi('stock:in:edit')")
@Log(title = "入库记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WzStockIn wzStockIn)
{
return toAjax(wzStockInService.updateWzStockIn(wzStockIn));
}
/**
* 删除入库记录
*/
@PreAuthorize("@ss.hasPermi('stock:in:remove')")
@Log(title = "入库记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{stockInCodes}")
public AjaxResult remove(@PathVariable Long[] stockInCodes)
{
return toAjax(wzStockInService.deleteWzStockInByStockInCodes(stockInCodes));
}
@Log(title = "用户管理", businessType = BusinessType.IMPORT)
@PreAuthorize("@ss.hasPermi('stock:in:import')")
@PostMapping("/importData")
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
{
ExcelUtil<WzStockIn> util = new ExcelUtil<>(WzStockIn.class);
List<WzStockIn> stockInList = util.importExcel(file.getInputStream());
stockInList.removeIf(wzStockIn -> wzStockIn.getDocDate() == null);
String operName = getUsername();
String message = wzStockInService.importUser(stockInList, updateSupport, operName);
// String message = "OK We are testing";
return success(message);
}
}

View File

@ -0,0 +1,130 @@
package com.zhyc.module.stock.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.stock.domain.WzStockOut;
import com.zhyc.module.stock.service.IWzStockOutService;
import com.zhyc.common.utils.poi.ExcelUtil;
import com.zhyc.common.core.page.TableDataInfo;
import org.springframework.web.multipart.MultipartFile;
/**
* 出库记录Controller
*
* @author HashMap
* @date 2025-08-05
*/
@RestController
@RequestMapping("/stock/out")
public class WzStockOutController extends BaseController
{
private final IWzStockOutService wzStockOutService;
public WzStockOutController(IWzStockOutService wzStockOutService) {
this.wzStockOutService = wzStockOutService;
}
/**
* 查询出库记录列表
*/
@PreAuthorize("@ss.hasPermi('stock:out:list')")
@GetMapping("/list")
public TableDataInfo list(WzStockOut wzStockOut)
{
startPage();
List<WzStockOut> list = wzStockOutService.selectWzStockOutList(wzStockOut);
return getDataTable(list);
}
/**
* 导出出库记录列表
*/
@PreAuthorize("@ss.hasPermi('stock:out:export')")
@Log(title = "出库记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WzStockOut wzStockOut)
{
List<WzStockOut> list = wzStockOutService.selectWzStockOutList(wzStockOut);
ExcelUtil<WzStockOut> util = new ExcelUtil<>(WzStockOut.class);
util.exportExcel(response, list, "出库记录数据");
}
/**
* 获取出库记录详细信息
*/
@PreAuthorize("@ss.hasPermi('stock:out:query')")
@GetMapping(value = "/{stockOutCode}")
public AjaxResult getInfo(@PathVariable("stockOutCode") Long stockOutCode)
{
return success(wzStockOutService.selectWzStockOutByStockOutCode(stockOutCode));
}
/**
* 新增出库记录
*/
@PreAuthorize("@ss.hasPermi('stock:out:add')")
@Log(title = "出库记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WzStockOut wzStockOut)
{
return toAjax(wzStockOutService.insertWzStockOut(wzStockOut));
}
/**
* 修改出库记录
*/
@PreAuthorize("@ss.hasPermi('stock:out:edit')")
@Log(title = "出库记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WzStockOut wzStockOut)
{
return toAjax(wzStockOutService.updateWzStockOut(wzStockOut));
}
/**
* 删除出库记录
*/
@PreAuthorize("@ss.hasPermi('stock:out:remove')")
@Log(title = "出库记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{stockOutCodes}")
public AjaxResult remove(@PathVariable Long[] stockOutCodes)
{
return toAjax(wzStockOutService.deleteWzStockOutByStockOutCodes(stockOutCodes));
}
/**
* 导入出库记录
*/
@Log(title = "出库记录", businessType = BusinessType.IMPORT)
@PreAuthorize("@ss.hasPermi('stock:out:import')")
@PostMapping("/importData")
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
{
ExcelUtil<WzStockOut> util = new ExcelUtil<>(WzStockOut.class);
List<WzStockOut> WzStockOutList = util.importExcel(file.getInputStream());
WzStockOutList.removeIf(wzStockOut -> wzStockOut.getDocId() == null);
String operName = getUsername();
String message;
try {
message = wzStockOutService.importUser(WzStockOutList, updateSupport, operName);
}catch (Exception e) {
message = e.getMessage();
logger.error(e.getMessage());
}
// String message = "OK We are testing";
return success(message);
}
}

View File

@ -0,0 +1,87 @@
package com.zhyc.module.stock.domain;
import java.math.BigDecimal;
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;
/**
* 物资管理对象 wz_materials_management
*
* @author HashMap
* @date 2025-08-05
*/
@Setter
@Getter
public class WzMaterialsManagement extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 序号 */
@Excel(name = "序号")
private Long materialManagementCode;
/** 存货编码 */
@Excel(name = "存货编码")
private String materialId;
/** 存货 */
@Excel(name = "存货")
private String materialName;
/** 批号 */
@Excel(name = "批号")
private String batchId;
/** 规格型号 */
@Excel(name = "规格型号")
private String materialSpecification;
/** 主计量 */
@Excel(name = "主计量")
private String materialUnit;
/** 现存量(主) */
@Excel(name = "现存量(主)")
private BigDecimal currentStock;
/** 库存预警 */
@Excel(name = "库存预警")
private String stockAlarm;
/** 生产日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date productionDate;
/** 失效日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "失效日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date expirationDate;
/** 失效预警 */
@Excel(name = "失效预警")
private String expirationAlarm;
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("materialManagementCode", getMaterialManagementCode())
.append("materialId", getMaterialId())
.append("materialName", getMaterialName())
.append("batchId", getBatchId())
.append("materialSpecification", getMaterialSpecification())
.append("materialUnit", getMaterialUnit())
.append("currentStock", getCurrentStock())
.append("stockAlarm", getStockAlarm())
.append("productionDate", getProductionDate())
.append("expirationDate", getExpirationDate())
.append("expirationAlarm", getExpirationAlarm())
.toString();
}
}

View File

@ -0,0 +1,142 @@
package com.zhyc.module.stock.domain;
import java.math.BigDecimal;
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;
/**
* 入库记录对象 wz_stock_in
*
* @author HashMap
* @date 2025-08-05
*/
@Setter
@Getter
public class WzStockIn extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 序号 */
private Long stockInCode;
/** 单据日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "单据日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date docDate;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date createDate;
/** 单据编号 */
@Excel(name = "单据编号")
private String docId;
/** 业务类型 */
@Excel(name = "业务类型")
private String businessType;
/** 仓库编码 */
@Excel(name = "仓库编码")
private String repositoryId;
/** 仓库 */
@Excel(name = "仓库")
private String repositoryName;
/** 入库类别 */
@Excel(name = "入库类别")
private String stockInType;
/** 供应商编码 */
@Excel(name = "供应商编码")
private String supplierId;
/** 供应商 */
@Excel(name = "供应商")
private String supplierName;
/** 部门编码 */
@Excel(name = "部门编码")
private String departmentId;
/** 部门 */
@Excel(name = "部门")
private String departmentName;
/** 经手人编码 */
@Excel(name = "经手人编码")
private String operatorId;
/** 经手人 */
@Excel(name = "经手人")
private String operatorName;
/** 制单人 */
@Excel(name = "制单人")
private String single;
/** 审核人 */
@Excel(name = "审核人")
private String reviewer;
/** 存货编码 */
@Excel(name = "存货编码")
private String materialId;
/** 存货 */
@Excel(name = "存货")
private String materialName;
/** 规格型号 */
@Excel(name = "规格型号")
private String materialSpecification;
/** 计量单位 */
@Excel(name = "计量单位")
private String materialUnit;
/** 实收数量 */
@Excel(name = "实收数量")
private BigDecimal count;
/** 入库调整 */
@Excel(name = "入库调整")
private String stockInAdjustRemark;
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("stockInCode", getStockInCode())
.append("docDate", getDocDate())
.append("createDate", getCreateDate())
.append("docId", getDocId())
.append("businessType", getBusinessType())
.append("repositoryId", getRepositoryId())
.append("repositoryName", getRepositoryName())
.append("stockInType", getStockInType())
.append("supplierId", getSupplierId())
.append("supplierName", getSupplierName())
.append("departmentId", getDepartmentId())
.append("departmentName", getDepartmentName())
.append("operatorId", getOperatorId())
.append("operatorName", getOperatorName())
.append("remark", getRemark())
.append("single", getSingle())
.append("reviewer", getReviewer())
.append("materialId", getMaterialId())
.append("materialName", getMaterialName())
.append("materialSpecification", getMaterialSpecification())
.append("materialUnit", getMaterialUnit())
.append("count", getCount())
.append("stockInAdjustRemark", getStockInAdjustRemark())
.toString();
}
}

View File

@ -0,0 +1,251 @@
package com.zhyc.module.stock.domain;
import java.math.BigDecimal;
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;
/**
* 出库记录对象 wz_stock_out
*
* @author HashMap
* @date 2025-08-05
*/
@Getter
@Setter
public class WzStockOut extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 序号
*/
private Long stockOutCode;
/**
* 单据日期
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "单据日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date docDate;
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date createDate;
/**
* 单据编号
*/
@Excel(name = "单据编号")
private String docId;
/**
* 业务类型
*/
@Excel(name = "业务类型")
private String businessType;
/**
* 仓库编码
*/
@Excel(name = "仓库编码")
private String repositoryId;
/**
* 仓库名称
*/
@Excel(name = "仓库")
private String repositoryName;
/**
* 项目分类
*/
@Excel(name = "项目分类")
private String projectClassification;
/**
* 项目编码
*/
@Excel(name = "项目编码")
private String projectId;
/**
* 项目
*/
@Excel(name = "项目")
private String projectName;
/**
* 生产车间编码
*/
@Excel(name = "生产车间编码")
private String departmentId;
/**
* 生产车间
*/
@Excel(name = "生产车间")
private String departmentName;
/**
* 领用人编码
*/
@Excel(name = "领用人编码")
private String receiverId;
/**
* 领用人
*/
@Excel(name = "领用人")
private String receiver;
/**
* 制单人
*/
@Excel(name = "制单人")
private String single;
/**
* 审核人
*/
@Excel(name = "审核人")
private String reviewer;
/**
* 审核时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "审核时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date reviewDate;
/**
* 修改人
*/
@Excel(name = "修改人")
private String modifier;
/**
* 材料分类编码
*/
@Excel(name = "材料分类编码")
private String materialClassId;
/**
* 材料分类
*/
@Excel(name = "材料分类")
private String materialClassName;
/**
* 材料编码
*/
@Excel(name = "材料编码")
private String materialId;
/**
* 材料名称
*/
@Excel(name = "材料名称")
private String materialName;
/**
* 材料规格
*/
@Excel(name = "材料规格")
private String materialSpecification;
/**
* 计量单位
*/
@Excel(name = "计量单位")
private String materialUnit;
/**
* 数量
*/
@Excel(name = "数量")
private BigDecimal count;
/**
* 批号
*/
@Excel(name = "批号")
private Long batchId;
/**
* 生产日期
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date productionDate;
/**
* 保质期
*/
@Excel(name = "保质期")
private Long shelfLife;
/**
* 保质期单位
*/
@Excel(name = "保质期单位")
private String shelfLifeUnit;
/**
* 失效日期
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "失效日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date expirationDate;
/**
* 代理人
*/
@Excel(name = "代理人")
private String agent;
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("stockOutCode", getStockOutCode())
.append("docDate", getDocDate())
.append("createDate", getCreateDate())
.append("docId", getDocId())
.append("businessType", getBusinessType())
.append("repositoryId", getRepositoryId())
.append("repositoryName", getRepositoryName())
.append("projectClassification", getProjectClassification())
.append("projectId", getProjectId())
.append("projectName", getProjectName())
.append("departmentId", getDepartmentId())
.append("departmentName", getDepartmentName())
.append("receiverId", getReceiverId())
.append("receiver", getReceiver())
.append("single", getSingle())
.append("reviewer", getReviewer())
.append("reviewDate", getReviewDate())
.append("modifier", getModifier())
.append("materialClassId", getMaterialClassId())
.append("materialClassName", getMaterialClassName())
.append("materialId", getMaterialId())
.append("materialName", getMaterialName())
.append("materialSpecification", getMaterialSpecification())
.append("materialUnit", getMaterialUnit())
.append("count", getCount())
.append("batchId", getBatchId())
.append("productionDate", getProductionDate())
.append("shelfLife", getShelfLife())
.append("shelfLifeUnit", getShelfLifeUnit())
.append("expirationDate", getExpirationDate())
.append("agent", getAgent())
.toString();
}
}

View File

@ -0,0 +1,71 @@
package com.zhyc.module.stock.mapper;
import java.util.List;
import com.zhyc.module.stock.domain.WzMaterialsManagement;
import org.apache.ibatis.annotations.Mapper;
/**
* 物资管理Mapper接口
*
* @author HashMap
* @date 2025-08-05
*/
@Mapper
public interface WzMaterialsManagementMapper
{
/**
* 查询物资管理
*
* @param materialManagementCode 物资管理主键
* @return 物资管理
*/
WzMaterialsManagement selectWzMaterialsManagementByMaterialManagementCode(Long materialManagementCode);
/**
* 查询物资管理列表
*
* @param wzMaterialsManagement 物资管理
* @return 物资管理集合
*/
List<WzMaterialsManagement> selectWzMaterialsManagementList(WzMaterialsManagement wzMaterialsManagement);
/**
* 新增物资管理
*
* @param wzMaterialsManagement 物资管理
* @return 结果
*/
int insertWzMaterialsManagement(WzMaterialsManagement wzMaterialsManagement);
/**
* 修改物资管理
*
* @param wzMaterialsManagement 物资管理
* @return 结果
*/
int updateWzMaterialsManagement(WzMaterialsManagement wzMaterialsManagement);
/**
* 删除物资管理
*
* @param materialManagementCode 物资管理主键
* @return 结果
*/
int deleteWzMaterialsManagementByMaterialManagementCode(Long materialManagementCode);
/**
* 批量删除物资管理
*
* @param materialManagementCodes 需要删除的数据主键集合
* @return 结果
*/
int deleteWzMaterialsManagementByMaterialManagementCodes(Long[] materialManagementCodes);
/**
* 以物资编码获取记录
*
* @param materialID 物资编码
* @return 结果
*/
WzMaterialsManagement selectWzMaterialsManagementByMaterialID(String materialID);
}

View File

@ -0,0 +1,70 @@
package com.zhyc.module.stock.mapper;
import java.util.List;
import com.zhyc.module.stock.domain.WzStockIn;
import org.apache.ibatis.annotations.Mapper;
/**
* 入库记录Mapper接口
*
* @author HashMap
* @date 2025-08-05
*/
@Mapper
public interface WzStockInMapper
{
/**
* 查询入库记录
*
* @param stockInCode 入库记录主键
* @return 入库记录
*/
WzStockIn selectWzStockInByStockInCode(Long stockInCode);
/**
* 查询入库记录列表
*
* @param wzStockIn 入库记录
* @return 入库记录集合
*/
List<WzStockIn> selectWzStockInList(WzStockIn wzStockIn);
/**
* 新增入库记录
*
* @param wzStockIn 入库记录
* @return 结果
*/
int insertWzStockIn(WzStockIn wzStockIn);
/**
* 修改入库记录
*
* @param wzStockIn 入库记录
* @return 结果
*/
int updateWzStockIn(WzStockIn wzStockIn);
/**
* 删除入库记录
*
* @param stockInCode 入库记录主键
* @return 结果
*/
int deleteWzStockInByStockInCode(Long stockInCode);
/**
* 批量删除入库记录
*
* @param stockInCodes 需要删除的数据主键集合
* @return 结果
*/
int deleteWzStockInByStockInCodes(Long[] stockInCodes);
/**
* 查询最近的入库记录
*
* @return 数据库中最近的入库记录
*/
WzStockIn getEarliestStockIn();
}

View File

@ -0,0 +1,70 @@
package com.zhyc.module.stock.mapper;
import java.util.List;
import com.zhyc.module.stock.domain.WzStockOut;
import org.apache.ibatis.annotations.Mapper;
/**
* 出库记录Mapper接口
*
* @author HashMap
* @date 2025-08-05
*/
@Mapper
public interface WzStockOutMapper
{
/**
* 查询出库记录
*
* @param stockOutCode 出库记录主键
* @return 出库记录
*/
WzStockOut selectWzStockOutByStockOutCode(Long stockOutCode);
/**
* 查询出库记录列表
*
* @param wzStockOut 出库记录
* @return 出库记录集合
*/
List<WzStockOut> selectWzStockOutList(WzStockOut wzStockOut);
/**
* 新增出库记录
*
* @param wzStockOut 出库记录
* @return 结果
*/
int insertWzStockOut(WzStockOut wzStockOut);
/**
* 修改出库记录
*
* @param wzStockOut 出库记录
* @return 结果
*/
int updateWzStockOut(WzStockOut wzStockOut);
/**
* 删除出库记录
*
* @param stockOutCode 出库记录主键
* @return 结果
*/
int deleteWzStockOutByStockOutCode(Long stockOutCode);
/**
* 批量删除出库记录
*
* @param stockOutCodes 需要删除的数据主键集合
* @return 结果
*/
int deleteWzStockOutByStockOutCodes(Long[] stockOutCodes);
/**
* 查询最近的记录
*
* @return 结果
*/
WzStockOut getEarliestStockOut();
}

View File

@ -0,0 +1,71 @@
package com.zhyc.module.stock.service;
import java.util.List;
import com.zhyc.module.stock.domain.WzMaterialsManagement;
/**
* 物资管理Service接口
*
* @author HashMap
* @date 2025-08-05
*/
public interface IWzMaterialsManagementService
{
/**
* 查询物资管理
*
* @param materialManagementCode 物资管理主键
* @return 物资管理
*/
WzMaterialsManagement selectWzMaterialsManagementByMaterialManagementCode(Long materialManagementCode);
/**
* 查询物资管理列表
*
* @param wzMaterialsManagement 物资管理
* @return 物资管理集合
*/
List<WzMaterialsManagement> selectWzMaterialsManagementList(WzMaterialsManagement wzMaterialsManagement);
/**
* 新增物资管理
*
* @param wzMaterialsManagement 物资管理
* @return 结果
*/
int insertWzMaterialsManagement(WzMaterialsManagement wzMaterialsManagement);
/**
* 修改物资管理
*
* @param wzMaterialsManagement 物资管理
* @return 结果
*/
int updateWzMaterialsManagement(WzMaterialsManagement wzMaterialsManagement);
/**
* 批量删除物资管理
*
* @param materialManagementCodes 需要删除的物资管理主键集合
* @return 结果
*/
int deleteWzMaterialsManagementByMaterialManagementCodes(Long[] materialManagementCodes);
/**
* 删除物资管理信息
*
* @param materialManagementCode 物资管理主键
* @return 结果
*/
int deleteWzMaterialsManagementByMaterialManagementCode(Long materialManagementCode);
/**
* 导入入库数据
*
* @param MaterialsManagementList 物资数据列表
* @param isUpdateSupport 是否更新支持如果已存在则进行更新数据
* @param operName 操作用户
* @return 结果
*/
String importUser(List<WzMaterialsManagement> MaterialsManagementList, Boolean isUpdateSupport, String operName);
}

View File

@ -0,0 +1,72 @@
package com.zhyc.module.stock.service;
import java.util.List;
import com.zhyc.module.stock.domain.WzStockIn;
/**
* 入库记录Service接口
*
* @author HashMap
* @date 2025-08-05
*/
public interface IWzStockInService
{
/**
* 查询入库记录
*
* @param stockInCode 入库记录主键
* @return 入库记录
*/
WzStockIn selectWzStockInByStockInCode(Long stockInCode);
/**
* 查询入库记录列表
*
* @param wzStockIn 入库记录
* @return 入库记录集合
*/
List<WzStockIn> selectWzStockInList(WzStockIn wzStockIn);
/**
* 新增入库记录
*
* @param wzStockIn 入库记录
* @return 结果
*/
int insertWzStockIn(WzStockIn wzStockIn);
/**
* 修改入库记录
*
* @param wzStockIn 入库记录
* @return 结果
*/
int updateWzStockIn(WzStockIn wzStockIn);
/**
* 批量删除入库记录
*
* @param stockInCodes 需要删除的入库记录主键集合
* @return 结果
*/
int deleteWzStockInByStockInCodes(Long[] stockInCodes);
/**
* 删除入库记录信息
*
* @param stockInCode 入库记录主键
* @return 结果
*/
int deleteWzStockInByStockInCode(Long stockInCode);
/**
* 导入入库数据
*
* @param StockInList 入库数据列表
* @param isUpdateSupport 是否更新支持如果已存在则进行更新数据
* @param operName 操作用户
* @return 结果
*/
String importUser(List<WzStockIn> StockInList, Boolean isUpdateSupport, String operName);
}

View File

@ -0,0 +1,72 @@
package com.zhyc.module.stock.service;
import java.util.List;
import com.zhyc.module.stock.domain.WzStockOut;
/**
* 出库记录Service接口
*
* @author HashMap
* @date 2025-08-05
*/
public interface IWzStockOutService
{
/**
* 查询出库记录
*
* @param stockOutCode 出库记录主键
* @return 出库记录
*/
WzStockOut selectWzStockOutByStockOutCode(Long stockOutCode);
/**
* 查询出库记录列表
*
* @param wzStockOut 出库记录
* @return 出库记录集合
*/
List<WzStockOut> selectWzStockOutList(WzStockOut wzStockOut);
/**
* 新增出库记录
*
* @param wzStockOut 出库记录
* @return 结果
*/
int insertWzStockOut(WzStockOut wzStockOut);
/**
* 修改出库记录
*
* @param wzStockOut 出库记录
* @return 结果
*/
int updateWzStockOut(WzStockOut wzStockOut);
/**
* 批量删除出库记录
*
* @param stockOutCodes 需要删除的出库记录主键集合
* @return 结果
*/
int deleteWzStockOutByStockOutCodes(Long[] stockOutCodes);
/**
* 删除出库记录信息
*
* @param stockOutCode 出库记录主键
* @return 结果
*/
int deleteWzStockOutByStockOutCode(Long stockOutCode);
/**
* 导入入库数据
*
* @param WzStockOutList 入库数据列表
* @param isUpdateSupport 是否更新支持如果已存在则进行更新数据
* @param operName 操作用户
* @return 结果
*/
String importUser(List<WzStockOut> WzStockOutList, Boolean isUpdateSupport, String operName) throws Exception;
}

View File

@ -0,0 +1,132 @@
package com.zhyc.module.stock.service.impl;
import java.util.List;
import com.zhyc.common.exception.ServiceException;
import com.zhyc.common.utils.StringUtils;
import org.springframework.stereotype.Service;
import com.zhyc.module.stock.mapper.WzMaterialsManagementMapper;
import com.zhyc.module.stock.domain.WzMaterialsManagement;
import com.zhyc.module.stock.service.IWzMaterialsManagementService;
import org.springframework.transaction.annotation.Transactional;
/**
* 物资管理Service业务层处理
*
* @author HashMap
* @date 2025-08-05
*/
@Service
public class WzMaterialsManagementServiceImpl implements IWzMaterialsManagementService {
private final WzMaterialsManagementMapper wzMaterialsManagementMapper;
public WzMaterialsManagementServiceImpl(WzMaterialsManagementMapper wzMaterialsManagementMapper) {
this.wzMaterialsManagementMapper = wzMaterialsManagementMapper;
}
/**
* 查询物资管理
*
* @param materialManagementCode 物资管理主键
* @return 物资管理
*/
@Override
public WzMaterialsManagement selectWzMaterialsManagementByMaterialManagementCode(Long materialManagementCode) {
return wzMaterialsManagementMapper.selectWzMaterialsManagementByMaterialManagementCode(materialManagementCode);
}
/**
* 查询物资管理列表
*
* @param wzMaterialsManagement 物资管理
* @return 物资管理
*/
@Override
public List<WzMaterialsManagement> selectWzMaterialsManagementList(WzMaterialsManagement wzMaterialsManagement) {
return wzMaterialsManagementMapper.selectWzMaterialsManagementList(wzMaterialsManagement);
}
/**
* 新增物资管理
*
* @param wzMaterialsManagement 物资管理
* @return 结果
*/
@Override
public int insertWzMaterialsManagement(WzMaterialsManagement wzMaterialsManagement) {
return wzMaterialsManagementMapper.insertWzMaterialsManagement(wzMaterialsManagement);
}
/**
* 修改物资管理
*
* @param wzMaterialsManagement 物资管理
* @return 结果
*/
@Override
public int updateWzMaterialsManagement(WzMaterialsManagement wzMaterialsManagement) {
return wzMaterialsManagementMapper.updateWzMaterialsManagement(wzMaterialsManagement);
}
/**
* 批量删除物资管理
*
* @param materialManagementCodes 需要删除的物资管理主键
* @return 结果
*/
@Override
public int deleteWzMaterialsManagementByMaterialManagementCodes(Long[] materialManagementCodes) {
return wzMaterialsManagementMapper.deleteWzMaterialsManagementByMaterialManagementCodes(materialManagementCodes);
}
/**
* 删除物资管理信息
*
* @param materialManagementCode 物资管理主键
* @return 结果
*/
@Override
public int deleteWzMaterialsManagementByMaterialManagementCode(Long materialManagementCode) {
return wzMaterialsManagementMapper.deleteWzMaterialsManagementByMaterialManagementCode(materialManagementCode);
}
/**
* 导入用户数据
*
* @param MaterialsManagementList 物资数据列表
* @param isUpdateSupport 是否更新支持如果已存在则进行更新数据
* @param operName 操作用户
* @return 结果
*/
@Override
@Transactional(rollbackFor = Exception.class)
public String importUser(List<WzMaterialsManagement> MaterialsManagementList, Boolean isUpdateSupport, String operName) {
if (StringUtils.isNull(MaterialsManagementList) || MaterialsManagementList.isEmpty()) {
throw new ServiceException("导入用户数据不能为空!");
}
int successNum = 0;
int sameNum = 0;
StringBuilder successMsg = new StringBuilder();
StringBuilder failureMsg = new StringBuilder();
try {
for (WzMaterialsManagement wzMaterialsManagement : MaterialsManagementList) {
if (wzMaterialsManagement.getMaterialId() != null) {
WzMaterialsManagement isExist = wzMaterialsManagementMapper.selectWzMaterialsManagementByMaterialID(wzMaterialsManagement.getMaterialId());
// 存在则更新
if (isExist != null) {
sameNum++;
wzMaterialsManagementMapper.updateWzMaterialsManagement(wzMaterialsManagement);
continue;
}
}
int result = wzMaterialsManagementMapper.insertWzMaterialsManagement(wzMaterialsManagement);
if (result > 0) successNum++;
}
} catch (Exception e) {
return failureMsg.append("导入出错:").append(e.getMessage()).toString();
}
successMsg.append("导入完成 导入 ").append(successNum).append("\n更新 ").append(sameNum).append(" 条(已存在记录)");
return successMsg.toString();
}
}

View File

@ -0,0 +1,139 @@
package com.zhyc.module.stock.service.impl;
import java.util.List;
import com.zhyc.common.exception.ServiceException;
import com.zhyc.common.utils.StringUtils;
import org.springframework.stereotype.Service;
import com.zhyc.module.stock.mapper.WzStockInMapper;
import com.zhyc.module.stock.domain.WzStockIn;
import com.zhyc.module.stock.service.IWzStockInService;
import org.springframework.transaction.annotation.Transactional;
/**
* 入库记录Service业务层处理
*
* @author HashMap
* @date 2025-08-05
*/
@Service
public class WzStockInServiceImpl implements IWzStockInService {
private final WzStockInMapper wzStockInMapper;
public WzStockInServiceImpl(WzStockInMapper wzStockInMapper) {
this.wzStockInMapper = wzStockInMapper;
}
/**
* 查询入库记录
*
* @param stockInCode 入库记录主键
* @return 入库记录
*/
@Override
public WzStockIn selectWzStockInByStockInCode(Long stockInCode) {
return wzStockInMapper.selectWzStockInByStockInCode(stockInCode);
}
/**
* 查询入库记录列表
*
* @param wzStockIn 入库记录
* @return 入库记录
*/
@Override
public List<WzStockIn> selectWzStockInList(WzStockIn wzStockIn) {
return wzStockInMapper.selectWzStockInList(wzStockIn);
}
/**
* 新增入库记录
*
* @param wzStockIn 入库记录
* @return 结果
*/
@Override
public int insertWzStockIn(WzStockIn wzStockIn) {
return wzStockInMapper.insertWzStockIn(wzStockIn);
}
/**
* 修改入库记录
*
* @param wzStockIn 入库记录
* @return 结果
*/
@Override
public int updateWzStockIn(WzStockIn wzStockIn) {
return wzStockInMapper.updateWzStockIn(wzStockIn);
}
/**
* 批量删除入库记录
*
* @param stockInCodes 需要删除的入库记录主键
* @return 结果
*/
@Override
public int deleteWzStockInByStockInCodes(Long[] stockInCodes) {
return wzStockInMapper.deleteWzStockInByStockInCodes(stockInCodes);
}
/**
* 删除入库记录信息
*
* @param stockInCode 入库记录主键
* @return 结果
*/
@Override
public int deleteWzStockInByStockInCode(Long stockInCode) {
return wzStockInMapper.deleteWzStockInByStockInCode(stockInCode);
}
/**
* 导入用户数据
*
* @param StockInList 用户数据列表
* @param isUpdateSupport 是否更新支持如果已存在则进行更新数据
* @param operName 操作用户
* @return 结果
*/
@Override
@Transactional(rollbackFor = Exception.class)
public String importUser(List<WzStockIn> StockInList, Boolean isUpdateSupport, String operName) {
if (StringUtils.isNull(StockInList) || StockInList.isEmpty()) {
throw new ServiceException("导入用户数据不能为空!");
}
int successNum = 0;
int failureNum = 0;
int sameNum = 0;
boolean emptyTable = true;
StringBuilder successMsg = new StringBuilder();
StringBuilder failureMsg = new StringBuilder();
try {
WzStockIn earliestStockIn = wzStockInMapper.getEarliestStockIn();
if (null != earliestStockIn) emptyTable = false;
System.out.println(earliestStockIn);
for (WzStockIn wzStockIn : StockInList) {
if (!emptyTable && earliestStockIn.getDocDate().getTime() >= wzStockIn.getDocDate().getTime()) {
sameNum++;
continue;
}
int result = wzStockInMapper.insertWzStockIn(wzStockIn);
if (result == 0) {
failureNum++;
failureMsg.append("失败的项:").append(wzStockIn.getDocId()).append("\n");
}
else successNum++;
}
} catch (Exception e) {
failureNum++;
}
if (failureNum > 0) {
return failureMsg.toString();
}
successMsg.append("导入完成 导入 ").append(successNum).append("\n跳过 ").append(sameNum).append(" 条(重复记录)");
return successMsg.toString();
}
}

View File

@ -0,0 +1,136 @@
package com.zhyc.module.stock.service.impl;
import java.util.Date;
import java.util.List;
import com.zhyc.common.exception.ServiceException;
import com.zhyc.common.utils.StringUtils;
import org.springframework.stereotype.Service;
import com.zhyc.module.stock.mapper.WzStockOutMapper;
import com.zhyc.module.stock.domain.WzStockOut;
import com.zhyc.module.stock.service.IWzStockOutService;
import org.springframework.transaction.annotation.Transactional;
/**
* 出库记录Service业务层处理
*
* @author HashMap
* @date 2025-08-05
*/
@Service
public class WzStockOutServiceImpl implements IWzStockOutService {
private final WzStockOutMapper wzStockOutMapper;
public WzStockOutServiceImpl(WzStockOutMapper wzStockOutMapper) {
this.wzStockOutMapper = wzStockOutMapper;
}
/**
* 查询出库记录
*
* @param stockOutCode 出库记录主键
* @return 出库记录
*/
@Override
public WzStockOut selectWzStockOutByStockOutCode(Long stockOutCode) {
return wzStockOutMapper.selectWzStockOutByStockOutCode(stockOutCode);
}
/**
* 查询出库记录列表
*
* @param wzStockOut 出库记录
* @return 出库记录
*/
@Override
public List<WzStockOut> selectWzStockOutList(WzStockOut wzStockOut) {
return wzStockOutMapper.selectWzStockOutList(wzStockOut);
}
/**
* 新增出库记录
*
* @param wzStockOut 出库记录
* @return 结果
*/
@Override
public int insertWzStockOut(WzStockOut wzStockOut) {
return wzStockOutMapper.insertWzStockOut(wzStockOut);
}
/**
* 修改出库记录
*
* @param wzStockOut 出库记录
* @return 结果
*/
@Override
public int updateWzStockOut(WzStockOut wzStockOut) {
return wzStockOutMapper.updateWzStockOut(wzStockOut);
}
/**
* 批量删除出库记录
*
* @param stockOutCodes 需要删除的出库记录主键
* @return 结果
*/
@Override
public int deleteWzStockOutByStockOutCodes(Long[] stockOutCodes) {
return wzStockOutMapper.deleteWzStockOutByStockOutCodes(stockOutCodes);
}
/**
* 删除出库记录信息
*
* @param stockOutCode 出库记录主键
* @return 结果
*/
@Override
public int deleteWzStockOutByStockOutCode(Long stockOutCode) {
return wzStockOutMapper.deleteWzStockOutByStockOutCode(stockOutCode);
}
/**
* 导入用户数据
*
* @param WzStockOutList 入库数据列表
* @param isUpdateSupport 是否更新支持如果已存在则进行更新数据
* @param operName 操作用户
* @return 结果
*/
@Override
@Transactional(rollbackFor = Exception.class)
public String importUser(List<WzStockOut> WzStockOutList, Boolean isUpdateSupport, String operName) throws Exception {
if (StringUtils.isNull(WzStockOutList) || WzStockOutList.isEmpty()) {
throw new ServiceException("导入入库数据不能为空!");
}
int successNum = 0;
int sameNum = 0;
StringBuilder successMsg = new StringBuilder();
WzStockOut earliestStockOut = wzStockOutMapper.getEarliestStockOut();
// 确保最近记录有值
if (null == earliestStockOut || earliestStockOut.getCreateDate() == null) {
if (earliestStockOut != null) {
earliestStockOut.setCreateDate(new Date(0));
} else {
earliestStockOut = new WzStockOut();
earliestStockOut.setCreateDate(new Date(0));
}
}
for (WzStockOut wzStockOut : WzStockOutList) {
if (null != wzStockOut && null != wzStockOut.getCreateDate()) {
if (earliestStockOut.getCreateDate().getTime() >= wzStockOut.getCreateDate().getTime()) {
sameNum++;
continue;
}
} else {
continue;
}
int result = wzStockOutMapper.insertWzStockOut(wzStockOut);
if (result > 0) successNum++;
}
successMsg.append("导入完成 导入 ").append(successNum).append("\n跳过 ").append(sameNum).append(" 条(重复记录)");
return successMsg.toString();
}
}

View File

@ -128,7 +128,8 @@
<if test="sourceDate != null ">and source_date = #{sourceDate}</if>
<if test="sourceRanchId != null ">and source_ranch_id = #{sourceRanchId}</if>
<if test="comment != null and comment != ''">and comment = #{comment}</if>
<if test="isDelete != null ">and is_delete = #{isDelete}</if>
<if test="isDelete == null">and is_delete = 0</if>
<if test="isDelete != null">and is_delete = #{isDelete}</if>
</where>
</select>
@ -151,20 +152,24 @@
bv.variety AS varietyName
FROM bas_sheep s
LEFT JOIN bas_sheep_variety bv ON s.variety_id = bv.id
WHERE s.manage_tags = #{manageTags} LIMIT 1
WHERE s.manage_tags = #{manageTags}
AND s.is_delete = 0 LIMIT 1
</select>
<select id="selectBasSheepBySheepfold" parameterType="BasSheep" resultMap="BasSheepResult">
<include refid="selectBasSheepVo"/>
<where>
sheepfold_id = #{id}
and is_delete = 0
</where>
</select>
<select id="getSheepByRanchId" resultMap="BasSheepResult">
SELECT *
FROM bas_sheep
WHERE ranch_id = #{ranchId}
<include refid="selectBasSheepVo"/>
<where>
ranch_id = #{ranchId}
and is_delete = 0
</where>
</select>
<select id="selectBasSheepListByIds" parameterType="list" resultMap="BasSheepResult">
@ -320,10 +325,16 @@
</delete>
<select id="existsByManageTag" resultType="int">
SELECT COUNT(*) FROM bas_sheep WHERE manage_tags = #{tag} AND is_delete = 0
SELECT COUNT(*)
FROM bas_sheep
WHERE manage_tags = #{tag}
AND s.is_delete = 0
</select>
<select id="existsByElectronicTag" resultType="int">
SELECT COUNT(*) FROM bas_sheep WHERE electronic_tags = #{tag} AND is_delete = 0
SELECT COUNT(*)
FROM bas_sheep
WHERE electronic_tags = #{tag}
AND is_delete = 0
</select>
</mapper>

View File

@ -0,0 +1,417 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhyc.module.base.mapper.BreedRamFileMapper">
<resultMap type="BreedRamFile" id="BreedRamFileResult">
<result property="id" column="id" />
<result property="ordinaryEarNumber" column="ordinary_ear_number" />
<result property="ranchId" column="ranch_id" />
<result property="ranchName" column="ranch_name" />
<result property="sheepfoldId" column="sheepfold_id" />
<result property="sheepfoldName" column="sheepfold_name" />
<result property="electronicTags" column="electronic_tags" />
<result property="varietyId" column="variety_id" />
<result property="variety" column="variety" />
<result property="sheepCategory" column="sheep_category" />
<result property="currentStatus" column="current_status" />
<result property="birthday" column="birthday" />
<result property="dynamicInfo" column="dynamic_info" />
<result property="monthAge" column="month_age" />
<result property="birthWeight" column="birth_weight" />
<result property="weaningDate" column="weaning_date" />
<result property="weaningDayAge" column="weaning_day_age" />
<result property="weaningWeight" column="weaning_weight" />
<result property="weaningDailyGain" column="weaning_daily_gain" />
<result property="postWeaningDailyGain" column="post_weaning_daily_gain" />
<result property="currentWeight" column="current_weight" />
<result property="currentWeightDate" column="current_weight_date" />
<result property="activityLevel" column="activity_level" />
<result property="sexualStatus" column="sexual_status" />
<result property="scrotumCircumference" column="scrotum_circumference" />
<result property="spermCollectionTime" column="sperm_collection_time" />
<result property="spermVolume" column="sperm_volume" />
<result property="spermVitality" column="sperm_vitality" />
<result property="spermDensity" column="sperm_density" />
<result property="spermQuality" column="sperm_quality" />
<result property="breedingStatus" column="breeding_status" />
<result property="lastPlanTime" column="last_plan_time" />
<result property="currentPlanTime" column="current_plan_time" />
<result property="remark" column="comment" />
<result property="proteinRateEbv" column="protein_rate_ebv" />
<result property="milkFatRateEbv" column="milk_fat_rate_ebv" />
<result property="scsEbv" column="scs_ebv" />
<result property="growthPerformanceEbv" column="growth_performance_ebv" />
<result property="resistanceEbv" column="resistance_ebv" />
<result property="reproductionPerformanceEbv" column="reproduction_performance_ebv" />
<result property="bodyTypeEbv" column="body_type_ebv" />
<result property="comprehensiveBreedingValue" column="comprehensive_breeding_value" />
<result property="fatherNumber" column="father_number" />
<result property="motherNumber" column="mother_number" />
<result property="grandfatherNumber" column="grandfather_number" />
<result property="grandmotherNumber" column="grandmother_number" />
<result property="maternalGrandfatherNumber" column="maternal_grandfather_number" />
<result property="maternalGrandmotherNumber" column="maternal_grandmother_number" />
<result property="isCoreFlock" column="is_core_flock" />
<result property="isBreedingUse" column="is_breeding_use" />
<result property="pregnancyCheck" column="pregnancy_check" />
<result property="totalMatedEwes" column="total_mated_ewes" />
<result property="naturalPregnancyCheckEwes" column="natural_pregnancy_check_ewes" />
<result property="naturalConceptionRate" column="natural_conception_rate" />
<result property="artificialPregnancyCheckEwes" column="artificial_pregnancy_check_ewes" />
<result property="artificialConceptionRate" column="artificial_conception_rate" />
<result property="ramMotherMilkVolume" column="ram_mother_milk_volume" />
<result property="milkProductionEbv" column="milk_production_ebv" />
<result property="accuracy" column="accuracy" />
<result property="informationCount" column="information_count" />
<result property="isPaternityTested" column="is_paternity_tested" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="isDelete" column="is_delete" />
</resultMap>
<sql id="selectBreedRamFileVo">
select id, ordinary_ear_number, ranch_id, ranch_name, sheepfold_id, sheepfold_name, electronic_tags, variety_id, variety, sheep_category, current_status, birthday, dynamic_info, month_age, birth_weight, weaning_date, weaning_day_age, weaning_weight, weaning_daily_gain, post_weaning_daily_gain, current_weight, current_weight_date, activity_level, sexual_status, scrotum_circumference, sperm_collection_time, sperm_volume, sperm_vitality, sperm_density, sperm_quality, breeding_status, last_plan_time, current_plan_time, comment, protein_rate_ebv, milk_fat_rate_ebv, scs_ebv, growth_performance_ebv, resistance_ebv, reproduction_performance_ebv, body_type_ebv, comprehensive_breeding_value, father_number, mother_number, grandfather_number, grandmother_number, maternal_grandfather_number, maternal_grandmother_number, is_core_flock, is_breeding_use, pregnancy_check, total_mated_ewes, natural_pregnancy_check_ewes, natural_conception_rate, artificial_pregnancy_check_ewes, artificial_conception_rate, ram_mother_milk_volume, milk_production_ebv, accuracy, information_count, is_paternity_tested, create_by, create_time, update_by, update_time, is_delete from breed_ram_file
</sql>
<select id="selectBreedRamFileList" parameterType="BreedRamFile" resultMap="BreedRamFileResult">
<include refid="selectBreedRamFileVo"/>
<where>
<if test="ordinaryEarNumber != null and ordinaryEarNumber != ''"> and ordinary_ear_number like concat('%', #{ordinaryEarNumber}, '%')</if>
<if test="ranchId != null "> and ranch_id = #{ranchId}</if>
<if test="ranchName != null and ranchName != ''"> and ranch_name like concat('%', #{ranchName}, '%')</if>
<if test="sheepfoldId != null "> and sheepfold_id = #{sheepfoldId}</if>
<if test="sheepfoldName != null and sheepfoldName != ''"> and sheepfold_name like concat('%', #{sheepfoldName}, '%')</if>
<if test="electronicTags != null and electronicTags != ''"> and electronic_tags like concat('%', #{electronicTags}, '%')</if>
<if test="varietyId != null "> and variety_id = #{varietyId}</if>
<if test="variety != null and variety != ''"> and variety like concat('%', #{variety}, '%')</if>
<if test="sheepCategory != null and sheepCategory != ''"> and sheep_category = #{sheepCategory}</if>
<if test="currentStatus != null and currentStatus != ''"> and current_status = #{currentStatus}</if>
<if test="birthday != null "> and birthday = #{birthday}</if>
<if test="dynamicInfo != null and dynamicInfo != ''"> and dynamic_info = #{dynamicInfo}</if>
<if test="monthAge != null "> and month_age = #{monthAge}</if>
<if test="birthWeight != null "> and birth_weight = #{birthWeight}</if>
<if test="weaningDate != null "> and weaning_date = #{weaningDate}</if>
<if test="weaningDayAge != null "> and weaning_day_age = #{weaningDayAge}</if>
<if test="weaningWeight != null "> and weaning_weight = #{weaningWeight}</if>
<if test="weaningDailyGain != null "> and weaning_daily_gain = #{weaningDailyGain}</if>
<if test="postWeaningDailyGain != null "> and post_weaning_daily_gain = #{postWeaningDailyGain}</if>
<if test="currentWeight != null "> and current_weight = #{currentWeight}</if>
<if test="currentWeightDate != null "> and current_weight_date = #{currentWeightDate}</if>
<if test="activityLevel != null and activityLevel != ''"> and activity_level = #{activityLevel}</if>
<if test="sexualStatus != null and sexualStatus != ''"> and sexual_status = #{sexualStatus}</if>
<if test="scrotumCircumference != null "> and scrotum_circumference = #{scrotumCircumference}</if>
<if test="spermCollectionTime != null "> and sperm_collection_time = #{spermCollectionTime}</if>
<if test="spermVolume != null "> and sperm_volume = #{spermVolume}</if>
<if test="spermVitality != null and spermVitality != ''"> and sperm_vitality = #{spermVitality}</if>
<if test="spermDensity != null and spermDensity != ''"> and sperm_density = #{spermDensity}</if>
<if test="spermQuality != null and spermQuality != ''"> and sperm_quality = #{spermQuality}</if>
<if test="breedingStatus != null "> and breeding_status = #{breedingStatus}</if>
<if test="lastPlanTime != null "> and last_plan_time = #{lastPlanTime}</if>
<if test="currentPlanTime != null "> and current_plan_time = #{currentPlanTime}</if>
<if test="proteinRateEbv != null "> and protein_rate_ebv = #{proteinRateEbv}</if>
<if test="milkFatRateEbv != null "> and milk_fat_rate_ebv = #{milkFatRateEbv}</if>
<if test="scsEbv != null "> and scs_ebv = #{scsEbv}</if>
<if test="growthPerformanceEbv != null "> and growth_performance_ebv = #{growthPerformanceEbv}</if>
<if test="resistanceEbv != null "> and resistance_ebv = #{resistanceEbv}</if>
<if test="reproductionPerformanceEbv != null "> and reproduction_performance_ebv = #{reproductionPerformanceEbv}</if>
<if test="bodyTypeEbv != null "> and body_type_ebv = #{bodyTypeEbv}</if>
<if test="comprehensiveBreedingValue != null "> and comprehensive_breeding_value = #{comprehensiveBreedingValue}</if>
<if test="fatherNumber != null and fatherNumber != ''"> and father_number = #{fatherNumber}</if>
<if test="motherNumber != null and motherNumber != ''"> and mother_number = #{motherNumber}</if>
<if test="grandfatherNumber != null and grandfatherNumber != ''"> and grandfather_number = #{grandfatherNumber}</if>
<if test="grandmotherNumber != null and grandmotherNumber != ''"> and grandmother_number = #{grandmotherNumber}</if>
<if test="maternalGrandfatherNumber != null and maternalGrandfatherNumber != ''"> and maternal_grandfather_number = #{maternalGrandfatherNumber}</if>
<if test="maternalGrandmotherNumber != null and maternalGrandmotherNumber != ''"> and maternal_grandmother_number = #{maternalGrandmotherNumber}</if>
<if test="isCoreFlock != null "> and is_core_flock = #{isCoreFlock}</if>
<if test="isBreedingUse != null "> and is_breeding_use = #{isBreedingUse}</if>
<if test="pregnancyCheck != null and pregnancyCheck != ''"> and pregnancy_check = #{pregnancyCheck}</if>
<if test="totalMatedEwes != null "> and total_mated_ewes = #{totalMatedEwes}</if>
<if test="naturalPregnancyCheckEwes != null "> and natural_pregnancy_check_ewes = #{naturalPregnancyCheckEwes}</if>
<if test="naturalConceptionRate != null "> and natural_conception_rate = #{naturalConceptionRate}</if>
<if test="artificialPregnancyCheckEwes != null "> and artificial_pregnancy_check_ewes = #{artificialPregnancyCheckEwes}</if>
<if test="artificialConceptionRate != null "> and artificial_conception_rate = #{artificialConceptionRate}</if>
<if test="ramMotherMilkVolume != null "> and ram_mother_milk_volume = #{ramMotherMilkVolume}</if>
<if test="milkProductionEbv != null "> and milk_production_ebv = #{milkProductionEbv}</if>
<if test="accuracy != null "> and accuracy = #{accuracy}</if>
<if test="informationCount != null "> and information_count = #{informationCount}</if>
<if test="isPaternityTested != null "> and is_paternity_tested = #{isPaternityTested}</if>
<if test="isDelete != null "> and is_delete = #{isDelete}</if>
</where>
order by create_time desc
</select>
<select id="selectBreedRamFileById" parameterType="Long" resultMap="BreedRamFileResult">
<include refid="selectBreedRamFileVo"/>
where id = #{id}
</select>
<select id="selectBreedRamFileByOrdinaryEarNumber" parameterType="String" resultMap="BreedRamFileResult">
<include refid="selectBreedRamFileVo"/>
where ordinary_ear_number = #{ordinaryEarNumber}
</select>
<select id="selectBreedRamFileByElectronicTags" parameterType="String" resultMap="BreedRamFileResult">
<include refid="selectBreedRamFileVo"/>
where electronic_tags = #{electronicTags}
</select>
<select id="selectBreedRamFileListByRanchId" parameterType="Long" resultMap="BreedRamFileResult">
<include refid="selectBreedRamFileVo"/>
where ranch_id = #{ranchId} and (is_delete = 0 or is_delete is null)
order by create_time desc
</select>
<select id="selectBreedRamFileListBySheepfoldId" parameterType="Long" resultMap="BreedRamFileResult">
<include refid="selectBreedRamFileVo"/>
where sheepfold_id = #{sheepfoldId} and (is_delete = 0 or is_delete is null)
order by create_time desc
</select>
<select id="selectCoreFlockBreedRamFileList" parameterType="BreedRamFile" resultMap="BreedRamFileResult">
<include refid="selectBreedRamFileVo"/>
<where>
is_core_flock = 1
<if test="ranchId != null "> and ranch_id = #{ranchId}</if>
<if test="varietyId != null "> and variety_id = #{varietyId}</if>
<if test="breedingStatus != null "> and breeding_status = #{breedingStatus}</if>
<if test="isDelete != null "> and is_delete = #{isDelete}</if>
</where>
order by create_time desc
</select>
<select id="selectBreedingUseBreedRamFileList" parameterType="BreedRamFile" resultMap="BreedRamFileResult">
<include refid="selectBreedRamFileVo"/>
<where>
is_breeding_use = 1
<if test="ranchId != null "> and ranch_id = #{ranchId}</if>
<if test="varietyId != null "> and variety_id = #{varietyId}</if>
<if test="breedingStatus != null "> and breeding_status = #{breedingStatus}</if>
<if test="isDelete != null "> and is_delete = #{isDelete}</if>
</where>
order by create_time desc
</select>
<insert id="insertBreedRamFile" parameterType="BreedRamFile" useGeneratedKeys="true" keyProperty="id">
insert into breed_ram_file
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="ordinaryEarNumber != null">ordinary_ear_number,</if>
<if test="ranchId != null">ranch_id,</if>
<if test="ranchName != null">ranch_name,</if>
<if test="sheepfoldId != null">sheepfold_id,</if>
<if test="sheepfoldName != null">sheepfold_name,</if>
<if test="electronicTags != null">electronic_tags,</if>
<if test="varietyId != null">variety_id,</if>
<if test="variety != null">variety,</if>
<if test="sheepCategory != null">sheep_category,</if>
<if test="currentStatus != null">current_status,</if>
<if test="birthday != null">birthday,</if>
<if test="dynamicInfo != null">dynamic_info,</if>
<if test="monthAge != null">month_age,</if>
<if test="birthWeight != null">birth_weight,</if>
<if test="weaningDate != null">weaning_date,</if>
<if test="weaningDayAge != null">weaning_day_age,</if>
<if test="weaningWeight != null">weaning_weight,</if>
<if test="weaningDailyGain != null">weaning_daily_gain,</if>
<if test="postWeaningDailyGain != null">post_weaning_daily_gain,</if>
<if test="currentWeight != null">current_weight,</if>
<if test="currentWeightDate != null">current_weight_date,</if>
<if test="activityLevel != null">activity_level,</if>
<if test="sexualStatus != null">sexual_status,</if>
<if test="scrotumCircumference != null">scrotum_circumference,</if>
<if test="spermCollectionTime != null">sperm_collection_time,</if>
<if test="spermVolume != null">sperm_volume,</if>
<if test="spermVitality != null">sperm_vitality,</if>
<if test="spermDensity != null">sperm_density,</if>
<if test="spermQuality != null">sperm_quality,</if>
<if test="breedingStatus != null">breeding_status,</if>
<if test="lastPlanTime != null">last_plan_time,</if>
<if test="currentPlanTime != null">current_plan_time,</if>
<if test="remark != null">comment,</if>
<if test="proteinRateEbv != null">protein_rate_ebv,</if>
<if test="milkFatRateEbv != null">milk_fat_rate_ebv,</if>
<if test="scsEbv != null">scs_ebv,</if>
<if test="growthPerformanceEbv != null">growth_performance_ebv,</if>
<if test="resistanceEbv != null">resistance_ebv,</if>
<if test="reproductionPerformanceEbv != null">reproduction_performance_ebv,</if>
<if test="bodyTypeEbv != null">body_type_ebv,</if>
<if test="comprehensiveBreedingValue != null">comprehensive_breeding_value,</if>
<if test="fatherNumber != null">father_number,</if>
<if test="motherNumber != null">mother_number,</if>
<if test="grandfatherNumber != null">grandfather_number,</if>
<if test="grandmotherNumber != null">grandmother_number,</if>
<if test="maternalGrandfatherNumber != null">maternal_grandfather_number,</if>
<if test="maternalGrandmotherNumber != null">maternal_grandmother_number,</if>
<if test="isCoreFlock != null">is_core_flock,</if>
<if test="isBreedingUse != null">is_breeding_use,</if>
<if test="pregnancyCheck != null">pregnancy_check,</if>
<if test="totalMatedEwes != null">total_mated_ewes,</if>
<if test="naturalPregnancyCheckEwes != null">natural_pregnancy_check_ewes,</if>
<if test="naturalConceptionRate != null">natural_conception_rate,</if>
<if test="artificialPregnancyCheckEwes != null">artificial_pregnancy_check_ewes,</if>
<if test="artificialConceptionRate != null">artificial_conception_rate,</if>
<if test="ramMotherMilkVolume != null">ram_mother_milk_volume,</if>
<if test="milkProductionEbv != null">milk_production_ebv,</if>
<if test="accuracy != null">accuracy,</if>
<if test="informationCount != null">information_count,</if>
<if test="isPaternityTested != null">is_paternity_tested,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="isDelete != null">is_delete,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="ordinaryEarNumber != null">#{ordinaryEarNumber},</if>
<if test="ranchId != null">#{ranchId},</if>
<if test="ranchName != null">#{ranchName},</if>
<if test="sheepfoldId != null">#{sheepfoldId},</if>
<if test="sheepfoldName != null">#{sheepfoldName},</if>
<if test="electronicTags != null">#{electronicTags},</if>
<if test="varietyId != null">#{varietyId},</if>
<if test="variety != null">#{variety},</if>
<if test="sheepCategory != null">#{sheepCategory},</if>
<if test="currentStatus != null">#{currentStatus},</if>
<if test="birthday != null">#{birthday},</if>
<if test="dynamicInfo != null">#{dynamicInfo},</if>
<if test="monthAge != null">#{monthAge},</if>
<if test="birthWeight != null">#{birthWeight},</if>
<if test="weaningDate != null">#{weaningDate},</if>
<if test="weaningDayAge != null">#{weaningDayAge},</if>
<if test="weaningWeight != null">#{weaningWeight},</if>
<if test="weaningDailyGain != null">#{weaningDailyGain},</if>
<if test="postWeaningDailyGain != null">#{postWeaningDailyGain},</if>
<if test="currentWeight != null">#{currentWeight},</if>
<if test="currentWeightDate != null">#{currentWeightDate},</if>
<if test="activityLevel != null">#{activityLevel},</if>
<if test="sexualStatus != null">#{sexualStatus},</if>
<if test="scrotumCircumference != null">#{scrotumCircumference},</if>
<if test="spermCollectionTime != null">#{spermCollectionTime},</if>
<if test="spermVolume != null">#{spermVolume},</if>
<if test="spermVitality != null">#{spermVitality},</if>
<if test="spermDensity != null">#{spermDensity},</if>
<if test="spermQuality != null">#{spermQuality},</if>
<if test="breedingStatus != null">#{breedingStatus},</if>
<if test="lastPlanTime != null">#{lastPlanTime},</if>
<if test="currentPlanTime != null">#{currentPlanTime},</if>
<if test="remark != null">#{remark},</if>
<if test="proteinRateEbv != null">#{proteinRateEbv},</if>
<if test="milkFatRateEbv != null">#{milkFatRateEbv},</if>
<if test="scsEbv != null">#{scsEbv},</if>
<if test="growthPerformanceEbv != null">#{growthPerformanceEbv},</if>
<if test="resistanceEbv != null">#{resistanceEbv},</if>
<if test="reproductionPerformanceEbv != null">#{reproductionPerformanceEbv},</if>
<if test="bodyTypeEbv != null">#{bodyTypeEbv},</if>
<if test="comprehensiveBreedingValue != null">#{comprehensiveBreedingValue},</if>
<if test="fatherNumber != null">#{fatherNumber},</if>
<if test="motherNumber != null">#{motherNumber},</if>
<if test="grandfatherNumber != null">#{grandfatherNumber},</if>
<if test="grandmotherNumber != null">#{grandmotherNumber},</if>
<if test="maternalGrandfatherNumber != null">#{maternalGrandfatherNumber},</if>
<if test="maternalGrandmotherNumber != null">#{maternalGrandmotherNumber},</if>
<if test="isCoreFlock != null">#{isCoreFlock},</if>
<if test="isBreedingUse != null">#{isBreedingUse},</if>
<if test="pregnancyCheck != null">#{pregnancyCheck},</if>
<if test="totalMatedEwes != null">#{totalMatedEwes},</if>
<if test="naturalPregnancyCheckEwes != null">#{naturalPregnancyCheckEwes},</if>
<if test="naturalConceptionRate != null">#{naturalConceptionRate},</if>
<if test="artificialPregnancyCheckEwes != null">#{artificialPregnancyCheckEwes},</if>
<if test="artificialConceptionRate != null">#{artificialConceptionRate},</if>
<if test="ramMotherMilkVolume != null">#{ramMotherMilkVolume},</if>
<if test="milkProductionEbv != null">#{milkProductionEbv},</if>
<if test="accuracy != null">#{accuracy},</if>
<if test="informationCount != null">#{informationCount},</if>
<if test="isPaternityTested != null">#{isPaternityTested},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="isDelete != null">#{isDelete},</if>
</trim>
</insert>
<update id="updateBreedRamFile" parameterType="BreedRamFile">
update breed_ram_file
<trim prefix="SET" suffixOverrides=",">
<if test="ordinaryEarNumber != null">ordinary_ear_number = #{ordinaryEarNumber},</if>
<if test="ranchId != null">ranch_id = #{ranchId},</if>
<if test="ranchName != null">ranch_name = #{ranchName},</if>
<if test="sheepfoldId != null">sheepfold_id = #{sheepfoldId},</if>
<if test="sheepfoldName != null">sheepfold_name = #{sheepfoldName},</if>
<if test="electronicTags != null">electronic_tags = #{electronicTags},</if>
<if test="varietyId != null">variety_id = #{varietyId},</if>
<if test="variety != null">variety = #{variety},</if>
<if test="sheepCategory != null">sheep_category = #{sheepCategory},</if>
<if test="currentStatus != null">current_status = #{currentStatus},</if>
<if test="birthday != null">birthday = #{birthday},</if>
<if test="dynamicInfo != null">dynamic_info = #{dynamicInfo},</if>
<if test="monthAge != null">month_age = #{monthAge},</if>
<if test="birthWeight != null">birth_weight = #{birthWeight},</if>
<if test="weaningDate != null">weaning_date = #{weaningDate},</if>
<if test="weaningDayAge != null">weaning_day_age = #{weaningDayAge},</if>
<if test="weaningWeight != null">weaning_weight = #{weaningWeight},</if>
<if test="weaningDailyGain != null">weaning_daily_gain = #{weaningDailyGain},</if>
<if test="postWeaningDailyGain != null">post_weaning_daily_gain = #{postWeaningDailyGain},</if>
<if test="currentWeight != null">current_weight = #{currentWeight},</if>
<if test="currentWeightDate != null">current_weight_date = #{currentWeightDate},</if>
<if test="activityLevel != null">activity_level = #{activityLevel},</if>
<if test="sexualStatus != null">sexual_status = #{sexualStatus},</if>
<if test="scrotumCircumference != null">scrotum_circumference = #{scrotumCircumference},</if>
<if test="spermCollectionTime != null">sperm_collection_time = #{spermCollectionTime},</if>
<if test="spermVolume != null">sperm_volume = #{spermVolume},</if>
<if test="spermVitality != null">sperm_vitality = #{spermVitality},</if>
<if test="spermDensity != null">sperm_density = #{spermDensity},</if>
<if test="spermQuality != null">sperm_quality = #{spermQuality},</if>
<if test="breedingStatus != null">breeding_status = #{breedingStatus},</if>
<if test="lastPlanTime != null">last_plan_time = #{lastPlanTime},</if>
<if test="currentPlanTime != null">current_plan_time = #{currentPlanTime},</if>
<if test="remark != null">comment = #{remark},</if>
<if test="proteinRateEbv != null">protein_rate_ebv = #{proteinRateEbv},</if>
<if test="milkFatRateEbv != null">milk_fat_rate_ebv = #{milkFatRateEbv},</if>
<if test="scsEbv != null">scs_ebv = #{scsEbv},</if>
<if test="growthPerformanceEbv != null">growth_performance_ebv = #{growthPerformanceEbv},</if>
<if test="resistanceEbv != null">resistance_ebv = #{resistanceEbv},</if>
<if test="reproductionPerformanceEbv != null">reproduction_performance_ebv = #{reproductionPerformanceEbv},</if>
<if test="bodyTypeEbv != null">body_type_ebv = #{bodyTypeEbv},</if>
<if test="comprehensiveBreedingValue != null">comprehensive_breeding_value = #{comprehensiveBreedingValue},</if>
<if test="fatherNumber != null">father_number = #{fatherNumber},</if>
<if test="motherNumber != null">mother_number = #{motherNumber},</if>
<if test="grandfatherNumber != null">grandfather_number = #{grandfatherNumber},</if>
<if test="grandmotherNumber != null">grandmother_number = #{grandmotherNumber},</if>
<if test="maternalGrandfatherNumber != null">maternal_grandfather_number = #{maternalGrandfatherNumber},</if>
<if test="maternalGrandmotherNumber != null">maternal_grandmother_number = #{maternalGrandmotherNumber},</if>
<if test="isCoreFlock != null">is_core_flock = #{isCoreFlock},</if>
<if test="isBreedingUse != null">is_breeding_use = #{isBreedingUse},</if>
<if test="pregnancyCheck != null">pregnancy_check = #{pregnancyCheck},</if>
<if test="totalMatedEwes != null">total_mated_ewes = #{totalMatedEwes},</if>
<if test="naturalPregnancyCheckEwes != null">natural_pregnancy_check_ewes = #{naturalPregnancyCheckEwes},</if>
<if test="naturalConceptionRate != null">natural_conception_rate = #{naturalConceptionRate},</if>
<if test="artificialPregnancyCheckEwes != null">artificial_pregnancy_check_ewes = #{artificialPregnancyCheckEwes},</if>
<if test="artificialConceptionRate != null">artificial_conception_rate = #{artificialConceptionRate},</if>
<if test="ramMotherMilkVolume != null">ram_mother_milk_volume = #{ramMotherMilkVolume},</if>
<if test="milkProductionEbv != null">milk_production_ebv = #{milkProductionEbv},</if>
<if test="accuracy != null">accuracy = #{accuracy},</if>
<if test="informationCount != null">information_count = #{informationCount},</if>
<if test="isPaternityTested != null">is_paternity_tested = #{isPaternityTested},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="isDelete != null">is_delete = #{isDelete},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteBreedRamFileById" parameterType="Long">
delete from breed_ram_file where id = #{id}
</delete>
<delete id="deleteBreedRamFileByIds" parameterType="String">
delete from breed_ram_file where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhyc.module.feed.mapper.SgFeedDetailsMapper">
<resultMap type="SgFeedDetails" id="SgFeedDetailsResult">
<result property="id" column="id" />
<result property="fodder" column="fodder" />
<result property="number" column="number" />
<result property="nuit" column="nuit" />
</resultMap>
<sql id="selectSgFeedDetailsVo">
select id, fodder, number, nuit from sg_feed_details
</sql>
<select id="selectSgFeedDetailsList" parameterType="SgFeedDetails" resultMap="SgFeedDetailsResult">
<include refid="selectSgFeedDetailsVo"/>
<where>
<if test="fodder != null and fodder != ''"> and fodder = #{fodder}</if>
<if test="number != null "> and number = #{number}</if>
<if test="nuit != null and nuit != ''"> and nuit = #{nuit}</if>
</where>
</select>
<select id="selectSgFeedDetailsById" parameterType="Long" resultMap="SgFeedDetailsResult">
<include refid="selectSgFeedDetailsVo"/>
where id = #{id}
</select>
<insert id="insertSgFeedDetails" parameterType="SgFeedDetails" useGeneratedKeys="true" keyProperty="id">
insert into sg_feed_details
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="fodder != null">fodder,</if>
<if test="number != null">number,</if>
<if test="nuit != null">nuit,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="fodder != null">#{fodder},</if>
<if test="number != null">#{number},</if>
<if test="nuit != null">#{nuit},</if>
</trim>
</insert>
<update id="updateSgFeedDetails" parameterType="SgFeedDetails">
update sg_feed_details
<trim prefix="SET" suffixOverrides=",">
<if test="fodder != null">fodder = #{fodder},</if>
<if test="number != null">number = #{number},</if>
<if test="nuit != null">nuit = #{nuit},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSgFeedDetailsById" parameterType="Long">
delete from sg_feed_details where id = #{id}
</delete>
<delete id="deleteSgFeedDetailsByIds" parameterType="String">
delete from sg_feed_details where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,129 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhyc.module.feed.mapper.SgFeedInfoMapper">
<resultMap type="SgFeedInfo" id="SgFeedInfoResult">
<result property="id" column="id" />
<result property="formulaId" column="formula_id" />
<result property="sheepfoldId" column="sheepfold_id" />
<result property="average" column="average" />
<result property="planMonring" column="plan_monring" />
<result property="actualMonring" column="actual_monring" />
<result property="planNoon" column="plan_noon" />
<result property="actualNoon" column="actual_noon" />
<result property="planEvenig" column="plan_evenig" />
<result property="actualEvening" column="actual_evening" />
<result property="particle" column="particle" />
<result property="other" column="other" />
<result property="replenish" column="replenish" />
<result property="planDate" column="plan_date" />
<result property="comment" column="comment" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
</resultMap>
<sql id="selectSgFeedInfoVo">
select id, formula_id, sheepfold_id, average, plan_monring, actual_monring, plan_noon, actual_noon, plan_evenig, actual_evening, particle, other, replenish, plan_date, comment, create_by, create_time from sg_feed_info
</sql>
<select id="selectSgFeedInfoList" parameterType="SgFeedInfo" resultMap="SgFeedInfoResult">
<include refid="selectSgFeedInfoVo"/>
<where>
<if test="formulaId != null "> and formula_id = #{formulaId}</if>
<if test="sheepfoldId != null and sheepfoldId != ''"> and sheepfold_id = #{sheepfoldId}</if>
<if test="average != null "> and average = #{average}</if>
<if test="planMonring != null "> and plan_monring = #{planMonring}</if>
<if test="actualMonring != null "> and actual_monring = #{actualMonring}</if>
<if test="planNoon != null "> and plan_noon = #{planNoon}</if>
<if test="actualNoon != null "> and actual_noon = #{actualNoon}</if>
<if test="planEvenig != null "> and plan_evenig = #{planEvenig}</if>
<if test="actualEvening != null "> and actual_evening = #{actualEvening}</if>
<if test="particle != null "> and particle = #{particle}</if>
<if test="other != null "> and other = #{other}</if>
<if test="replenish != null "> and replenish = #{replenish}</if>
<if test="planDate != null "> and plan_date = #{planDate}</if>
<if test="comment != null and comment != ''"> and comment = #{comment}</if>
</where>
</select>
<select id="selectSgFeedInfoById" parameterType="Long" resultMap="SgFeedInfoResult">
<include refid="selectSgFeedInfoVo"/>
where id = #{id}
</select>
<insert id="insertSgFeedInfo" parameterType="SgFeedInfo" useGeneratedKeys="true" keyProperty="id">
insert into sg_feed_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="formulaId != null">formula_id,</if>
<if test="sheepfoldId != null">sheepfold_id,</if>
<if test="average != null">average,</if>
<if test="planMonring != null">plan_monring,</if>
<if test="actualMonring != null">actual_monring,</if>
<if test="planNoon != null">plan_noon,</if>
<if test="actualNoon != null">actual_noon,</if>
<if test="planEvenig != null">plan_evenig,</if>
<if test="actualEvening != null">actual_evening,</if>
<if test="particle != null">particle,</if>
<if test="other != null">other,</if>
<if test="replenish != null">replenish,</if>
<if test="planDate != null">plan_date,</if>
<if test="comment != null">comment,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="formulaId != null">#{formulaId},</if>
<if test="sheepfoldId != null">#{sheepfoldId},</if>
<if test="average != null">#{average},</if>
<if test="planMonring != null">#{planMonring},</if>
<if test="actualMonring != null">#{actualMonring},</if>
<if test="planNoon != null">#{planNoon},</if>
<if test="actualNoon != null">#{actualNoon},</if>
<if test="planEvenig != null">#{planEvenig},</if>
<if test="actualEvening != null">#{actualEvening},</if>
<if test="particle != null">#{particle},</if>
<if test="other != null">#{other},</if>
<if test="replenish != null">#{replenish},</if>
<if test="planDate != null">#{planDate},</if>
<if test="comment != null">#{comment},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
</trim>
</insert>
<update id="updateSgFeedInfo" parameterType="SgFeedInfo">
update sg_feed_info
<trim prefix="SET" suffixOverrides=",">
<if test="formulaId != null">formula_id = #{formulaId},</if>
<if test="sheepfoldId != null">sheepfold_id = #{sheepfoldId},</if>
<if test="average != null">average = #{average},</if>
<if test="planMonring != null">plan_monring = #{planMonring},</if>
<if test="actualMonring != null">actual_monring = #{actualMonring},</if>
<if test="planNoon != null">plan_noon = #{planNoon},</if>
<if test="actualNoon != null">actual_noon = #{actualNoon},</if>
<if test="planEvenig != null">plan_evenig = #{planEvenig},</if>
<if test="actualEvening != null">actual_evening = #{actualEvening},</if>
<if test="particle != null">particle = #{particle},</if>
<if test="other != null">other = #{other},</if>
<if test="replenish != null">replenish = #{replenish},</if>
<if test="planDate != null">plan_date = #{planDate},</if>
<if test="comment != null">comment = #{comment},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSgFeedInfoById" parameterType="Long">
delete from sg_feed_info where id = #{id}
</delete>
<delete id="deleteSgFeedInfoByIds" parameterType="String">
delete from sg_feed_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,137 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhyc.module.feed.mapper.SgFeedPlanMapper">
<resultMap type="SgFeedPlan" id="SgFeedPlanResult">
<result property="createDate" column="create_date" />
<result property="formulaId" column="formula_id" />
<result property="sheepHouseId" column="sheep_house_id" />
<result property="sheepCount" column="sheep_count" />
<result property="planDailySize" column="plan_daily_size" />
<result property="planMorningSize" column="plan_morning_size" />
<result property="planMorningTotal" column="plan_morning_total" />
<result property="ratioMorning" column="ratio_morning" />
<result property="actualMorningSize" column="actual_morning_size" />
<result property="planNoonSize" column="plan_noon_size" />
<result property="planNoonTotal" column="plan_noon_total" />
<result property="actualNoonSize" column="actual_noon_size" />
<result property="ratioNoon" column="ratio_noon" />
<result property="planAfternoonSize" column="plan_afternoon_size" />
<result property="planAfternoonTotal" column="plan_afternoon_total" />
<result property="actualAfternoonSize" column="actual_afternoon_size" />
<result property="ratioAfternoon" column="ratio_afternoon" />
<result property="planFeedTotal" column="plan_feed_total" />
<result property="zookeeper" column="zookeeper" />
<result property="planDate" column="plan_date" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectSgFeedPlanVo">
select create_date, formula_id, sheep_house_id, sheep_count, plan_daily_size, plan_morning_size, plan_morning_total, ratio_morning, actual_morning_size, plan_noon_size, plan_noon_total, actual_noon_size, ratio_noon, plan_afternoon_size, plan_afternoon_total, actual_afternoon_size, ratio_afternoon, plan_feed_total, zookeeper, plan_date, remark from sg_feed_plan
</sql>
<select id="selectSgFeedPlanList" parameterType="SgFeedPlan" resultMap="SgFeedPlanResult">
<include refid="selectSgFeedPlanVo"/>
<where>
<if test="formulaId != null and formulaId != ''"> and formula_id = #{formulaId}</if>
<if test="sheepHouseId != null "> and sheep_house_id = #{sheepHouseId}</if>
<if test="zookeeper != null and zookeeper != ''"> and zookeeper = #{zookeeper}</if>
<if test="planDate != null "> and plan_date = #{planDate}</if>
</where>
</select>
<select id="selectSgFeedPlanByCreateDate" parameterType="Date" resultMap="SgFeedPlanResult">
<include refid="selectSgFeedPlanVo"/>
where create_date = #{createDate}
</select>
<insert id="insertSgFeedPlan" parameterType="SgFeedPlan">
insert into sg_feed_plan
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="createDate != null">create_date,</if>
<if test="formulaId != null and formulaId != ''">formula_id,</if>
<if test="sheepHouseId != null">sheep_house_id,</if>
<if test="sheepCount != null">sheep_count,</if>
<if test="planDailySize != null">plan_daily_size,</if>
<if test="planMorningSize != null">plan_morning_size,</if>
<if test="planMorningTotal != null">plan_morning_total,</if>
<if test="ratioMorning != null">ratio_morning,</if>
<if test="actualMorningSize != null">actual_morning_size,</if>
<if test="planNoonSize != null">plan_noon_size,</if>
<if test="planNoonTotal != null">plan_noon_total,</if>
<if test="actualNoonSize != null">actual_noon_size,</if>
<if test="ratioNoon != null">ratio_noon,</if>
<if test="planAfternoonSize != null">plan_afternoon_size,</if>
<if test="planAfternoonTotal != null">plan_afternoon_total,</if>
<if test="actualAfternoonSize != null">actual_afternoon_size,</if>
<if test="ratioAfternoon != null">ratio_afternoon,</if>
<if test="planFeedTotal != null">plan_feed_total,</if>
<if test="zookeeper != null">zookeeper,</if>
<if test="planDate != null">plan_date,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="createDate != null">#{createDate},</if>
<if test="formulaId != null and formulaId != ''">#{formulaId},</if>
<if test="sheepHouseId != null">#{sheepHouseId},</if>
<if test="sheepCount != null">#{sheepCount},</if>
<if test="planDailySize != null">#{planDailySize},</if>
<if test="planMorningSize != null">#{planMorningSize},</if>
<if test="planMorningTotal != null">#{planMorningTotal},</if>
<if test="ratioMorning != null">#{ratioMorning},</if>
<if test="actualMorningSize != null">#{actualMorningSize},</if>
<if test="planNoonSize != null">#{planNoonSize},</if>
<if test="planNoonTotal != null">#{planNoonTotal},</if>
<if test="actualNoonSize != null">#{actualNoonSize},</if>
<if test="ratioNoon != null">#{ratioNoon},</if>
<if test="planAfternoonSize != null">#{planAfternoonSize},</if>
<if test="planAfternoonTotal != null">#{planAfternoonTotal},</if>
<if test="actualAfternoonSize != null">#{actualAfternoonSize},</if>
<if test="ratioAfternoon != null">#{ratioAfternoon},</if>
<if test="planFeedTotal != null">#{planFeedTotal},</if>
<if test="zookeeper != null">#{zookeeper},</if>
<if test="planDate != null">#{planDate},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateSgFeedPlan" parameterType="SgFeedPlan">
update sg_feed_plan
<trim prefix="SET" suffixOverrides=",">
<if test="formulaId != null and formulaId != ''">formula_id = #{formulaId},</if>
<if test="sheepHouseId != null">sheep_house_id = #{sheepHouseId},</if>
<if test="sheepCount != null">sheep_count = #{sheepCount},</if>
<if test="planDailySize != null">plan_daily_size = #{planDailySize},</if>
<if test="planMorningSize != null">plan_morning_size = #{planMorningSize},</if>
<if test="planMorningTotal != null">plan_morning_total = #{planMorningTotal},</if>
<if test="ratioMorning != null">ratio_morning = #{ratioMorning},</if>
<if test="actualMorningSize != null">actual_morning_size = #{actualMorningSize},</if>
<if test="planNoonSize != null">plan_noon_size = #{planNoonSize},</if>
<if test="planNoonTotal != null">plan_noon_total = #{planNoonTotal},</if>
<if test="actualNoonSize != null">actual_noon_size = #{actualNoonSize},</if>
<if test="ratioNoon != null">ratio_noon = #{ratioNoon},</if>
<if test="planAfternoonSize != null">plan_afternoon_size = #{planAfternoonSize},</if>
<if test="planAfternoonTotal != null">plan_afternoon_total = #{planAfternoonTotal},</if>
<if test="actualAfternoonSize != null">actual_afternoon_size = #{actualAfternoonSize},</if>
<if test="ratioAfternoon != null">ratio_afternoon = #{ratioAfternoon},</if>
<if test="planFeedTotal != null">plan_feed_total = #{planFeedTotal},</if>
<if test="zookeeper != null">zookeeper = #{zookeeper},</if>
<if test="planDate != null">plan_date = #{planDate},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where create_date = #{createDate}
</update>
<delete id="deleteSgFeedPlanByCreateDate" parameterType="Date">
delete from sg_feed_plan where create_date = #{createDate}
</delete>
<delete id="deleteSgFeedPlanByCreateDates" parameterType="String">
delete from sg_feed_plan where create_date in
<foreach item="createDate" collection="array" open="(" separator="," close=")">
#{createDate}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhyc.module.feed.mapper.SgFeedRatioMapper">
<resultMap type="SgFeedRatio" id="SgFeedRatioResult">
<result property="id" column="id" />
<result property="morning" column="morning" />
<result property="noon" column="noon" />
<result property="evening" column="evening" />
</resultMap>
<sql id="selectSgFeedRatioVo">
select id, morning, noon, evening from sg_feed_ratio
</sql>
<select id="selectSgFeedRatioList" parameterType="SgFeedRatio" resultMap="SgFeedRatioResult">
<include refid="selectSgFeedRatioVo"/>
<where>
<if test="morning != null and morning != ''"> and morning = #{morning}</if>
<if test="noon != null and noon != ''"> and noon = #{noon}</if>
<if test="evening != null and evening != ''"> and evening = #{evening}</if>
</where>
</select>
<select id="selectSgFeedRatioById" parameterType="Long" resultMap="SgFeedRatioResult">
<include refid="selectSgFeedRatioVo"/>
where id = #{id}
</select>
<insert id="insertSgFeedRatio" parameterType="SgFeedRatio" useGeneratedKeys="true" keyProperty="id">
insert into sg_feed_ratio
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="morning != null">morning,</if>
<if test="noon != null">noon,</if>
<if test="evening != null">evening,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="morning != null">#{morning},</if>
<if test="noon != null">#{noon},</if>
<if test="evening != null">#{evening},</if>
</trim>
</insert>
<update id="updateSgFeedRatio" parameterType="SgFeedRatio">
update sg_feed_ratio
<trim prefix="SET" suffixOverrides=",">
<if test="morning != null">morning = #{morning},</if>
<if test="noon != null">noon = #{noon},</if>
<if test="evening != null">evening = #{evening},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSgFeedRatioById" parameterType="Long">
delete from sg_feed_ratio where id = #{id}
</delete>
<delete id="deleteSgFeedRatioByIds" parameterType="String">
delete from sg_feed_ratio where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhyc.module.feed.mapper.SgFodderMapper">
<resultMap type="SgFodder" id="SgFodderResult">
<result property="id" column="id" />
<result property="name" column="name" />
<result property="fodderType" column="fodder_type" />
</resultMap>
<sql id="selectSgFodderVo">
select id, name, fodder_type from sg_fodder
</sql>
<select id="selectSgFodderList" parameterType="SgFodder" resultMap="SgFodderResult">
<include refid="selectSgFodderVo"/>
<where>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="fodderType != null "> and fodder_type = #{fodderType}</if>
</where>
</select>
<select id="selectSgFodderById" parameterType="Long" resultMap="SgFodderResult">
<include refid="selectSgFodderVo"/>
where id = #{id}
</select>
<insert id="insertSgFodder" parameterType="SgFodder" useGeneratedKeys="true" keyProperty="id">
insert into sg_fodder
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">name,</if>
<if test="fodderType != null">fodder_type,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">#{name},</if>
<if test="fodderType != null">#{fodderType},</if>
</trim>
</insert>
<update id="updateSgFodder" parameterType="SgFodder">
update sg_fodder
<trim prefix="SET" suffixOverrides=",">
<if test="name != null">name = #{name},</if>
<if test="fodderType != null">fodder_type = #{fodderType},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSgFodderById" parameterType="Long">
delete from sg_fodder where id = #{id}
</delete>
<delete id="deleteSgFodderByIds" parameterType="String">
delete from sg_fodder where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhyc.module.feed.mapper.SgFormulaListMapper">
<resultMap type="SgFormulaList" id="SgFormulaListResult">
<result property="code" column="code" />
<result property="formulaId" column="formula_id" />
<result property="batchId" column="batch_id" />
<result property="materialId" column="material_id" />
<result property="materialName" column="material_name" />
<result property="ratio" column="ratio" />
<result property="isGranular" column="is_granular" />
<result property="isSupplement" column="is_supplement" />
</resultMap>
<sql id="selectSgFormulaListVo">
select code, formula_id, material_id, material_name, ratio, is_granular, is_supplement from sg_formula_list
</sql>
<select id="selectSgFormulaListList" parameterType="SgFormulaList" resultMap="SgFormulaListResult">
<include refid="selectSgFormulaListVo"/>
<where>
<if test="materialId != null and materialId != ''">material_id = #{materialId}</if>
<if test="formulaId != null and formulaId != ''">and formula_id = #{formulaId}</if>
<if test="batchId != null and batchId != ''"> and batch_id = #{batchId}</if>
</where>
</select>
<select id="selectSgFormulaListByCode" parameterType="Long" resultMap="SgFormulaListResult">
<include refid="selectSgFormulaListVo"/>
where code = #{code}
</select>
<insert id="insertSgFormulaList" parameterType="SgFormulaList">
insert into sg_formula_list
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="code != null">code,</if>
<if test="formulaId != null">formula_id,</if>
<if test="batchId != null">batch_id,</if>
<if test="materialId != null">material_id,</if>
<if test="materialName != null">material_name,</if>
<if test="ratio != null">ratio,</if>
<if test="isGranular != null">is_granular,</if>
<if test="isSupplement != null">is_supplement,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="code != null">#{code},</if>
<if test="formulaId != null">#{formulaId},</if>
<if test="batchId != null">#{batchId},</if>
<if test="materialId != null">#{materialId},</if>
<if test="materialName != null">#{materialName},</if>
<if test="ratio != null">#{ratio},</if>
<if test="isGranular != null">#{isGranular},</if>
<if test="isSupplement != null">#{isSupplement},</if>
</trim>
</insert>
<update id="updateSgFormulaList" parameterType="SgFormulaList">
update sg_formula_list
<trim prefix="SET" suffixOverrides=",">
<if test="formulaId != null">formula_id = #{formulaId},</if>
<if test="materialId != null">material_id = #{materialId},</if>
<if test="materialName != null">material_name = #{materialName},</if>
<if test="ratio != null">ratio = #{ratio},</if>
<if test="isGranular != null">is_granular = #{isGranular},</if>
<if test="isSupplement != null">is_supplement = #{isSupplement},</if>
</trim>
where code = #{code}
</update>
<delete id="deleteSgFormulaListByCode" parameterType="Long">
delete from sg_formula_list where code = #{code}
</delete>
<delete id="deleteSgFormulaListByCodes" parameterType="String">
delete from sg_formula_list where code in
<foreach item="code" collection="array" open="(" separator="," close=")">
#{code}
</foreach>
</delete>
<delete id="deleteSgFormulaListByFormulaIdAndBatchId" parameterType="SgFormulaList">
DELETE FROM sg_formula_list WHERE formula_id = #{formulaId} AND batch_id = #{batchId}
</delete>
</mapper>

View File

@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhyc.module.feed.mapper.SgFormulaManagementMapper">
<resultMap type="SgFormulaManagement" id="SgFormulaManagementResult">
<result property="formulaId" column="formula_id" />
<result property="feedStage" column="feed_stage" />
<result property="batchId" column="batch_id" />
<result property="useStartDate" column="use_start_date" />
<result property="useEndDate" column="use_end_date" />
<result property="useState" column="use_state" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectSgFormulaManagementVo">
select formula_id, feed_stage, batch_id, use_start_date, use_end_date, use_state, remark from sg_formula_management
</sql>
<select id="selectSgFormulaManagementList" parameterType="SgFormulaManagement" resultMap="SgFormulaManagementResult">
<include refid="selectSgFormulaManagementVo"/>
<where>
<if test="formulaId != null and formulaId != ''"> and formula_id = #{formulaId}</if>
<if test="feedStage != null and feedStage != ''"> and feed_stage = #{feedStage}</if>
<if test="batchId != null and batchId != ''"> and batch_id = #{batchId}</if>
</where>
</select>
<select id="selectSgFormulaManagementByFormulaId" parameterType="String" resultMap="SgFormulaManagementResult">
<include refid="selectSgFormulaManagementVo"/>
where formula_id = #{formulaId}
</select>
<insert id="insertSgFormulaManagement" parameterType="SgFormulaManagement">
insert into sg_formula_management
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="formulaId != null and formulaId != ''">formula_id,</if>
<if test="feedStage != null and feedStage != ''">feed_stage,</if>
<if test="batchId != null">batch_id,</if>
<if test="useStartDate != null">use_start_date,</if>
<if test="useEndDate != null">use_end_date,</if>
<if test="useState != null">use_state,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="formulaId != null and formulaId != ''">#{formulaId},</if>
<if test="feedStage != null and feedStage != ''">#{feedStage},</if>
<if test="batchId != null">#{batchId},</if>
<if test="useStartDate != null">#{useStartDate},</if>
<if test="useEndDate != null">#{useEndDate},</if>
<if test="useState != null">#{useState},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateSgFormulaManagement" parameterType="SgFormulaManagement">
update sg_formula_management
<trim prefix="SET" suffixOverrides=",">
<if test="feedStage != null and feedStage != ''">feed_stage = #{feedStage},</if>
<if test="useStartDate != null">use_start_date = #{useStartDate},</if>
<if test="useEndDate != null">use_end_date = #{useEndDate},</if>
<if test="useState != null">use_state = #{useState},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where formula_id = #{formulaId} AND batch_id = #{batchId}
</update>
<delete id="deleteSgFormulaManagementByFormulaId" parameterType="String">
delete from sg_formula_management where formula_id = #{formulaId}
</delete>
<delete id="deleteSgFormulaManagementByFormulaIds" parameterType="String">
delete from sg_formula_management where formula_id in
<foreach item="formulaId" collection="array" open="(" separator="," close=")">
#{formulaId}
</foreach>
</delete>
<delete id="deleteSgFormulaManagement" parameterType="SgFormulaManagement">
delete from sg_formula_management where formula_id = #{formulaId} and batch_id = #{batchId}
</delete>
</mapper>

View File

@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhyc.module.feed.mapper.SgMaterialMapper">
<resultMap type="SgMaterial" id="SgMaterialResult">
<result property="materialId" column="material_id" />
<result property="materialName" column="material_name" />
<result property="isGranular" column="is_granular" />
</resultMap>
<sql id="selectSgMaterialVo">
select material_id, material_name, is_granular from sg_material
</sql>
<select id="selectSgMaterialList" parameterType="SgMaterial" resultMap="SgMaterialResult">
<include refid="selectSgMaterialVo"/>
<where>
<if test="materialId != null and materialId != ''"> and material_id = #{materialId}</if>
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
<if test="isGranular != null "> and is_granular = #{isGranular}</if>
</where>
</select>
<select id="selectSgMaterialByMaterialId" parameterType="String" resultMap="SgMaterialResult">
<include refid="selectSgMaterialVo"/>
where material_id = #{materialId}
</select>
<insert id="insertSgMaterial" parameterType="SgMaterial">
insert into sg_material
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="materialId != null">material_id,</if>
<if test="materialName != null and materialName != ''">material_name,</if>
<if test="isGranular != null">is_granular,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="materialId != null">#{materialId},</if>
<if test="materialName != null and materialName != ''">#{materialName},</if>
<if test="isGranular != null">#{isGranular},</if>
</trim>
</insert>
<update id="updateSgMaterial" parameterType="SgMaterial">
update sg_material
<trim prefix="SET" suffixOverrides=",">
<if test="materialName != null and materialName != ''">material_name = #{materialName},</if>
<if test="isGranular != null">is_granular = #{isGranular},</if>
</trim>
where material_id = #{materialId}
</update>
<delete id="deleteSgMaterialByMaterialId" parameterType="String">
delete from sg_material where material_id = #{materialId}
</delete>
<delete id="deleteSgMaterialByMaterialIds" parameterType="String">
delete from sg_material where material_id in
<foreach item="materialId" collection="array" open="(" separator="," close=")">
#{materialId}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,134 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhyc.module.produce.breed.mapper.ScSheepDeathMapper">
<resultMap type="ScSheepDeath" id="ScSheepDeathResult">
<result property="id" column="id" />
<result property="sheepId" column="sheep_id" />
<result property="manageTags" column="manage_tags" />
<result property="eventType" column="event_type" />
<result property="deathDate" column="death_date" />
<result property="diseaseTypeId" column="disease_type_id" />
<result property="diseaseSubtypeId" column="disease_subtype_id" />
<result property="disposalDirection" column="disposal_direction" />
<result property="technician" column="technician" />
<result property="handler" column="handler" />
<result property="workGroup" column="work_group" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="comment" column="comment" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="isDelete" column="is_delete" />
</resultMap>
<sql id="selectScSheepDeathVo">
select id, sheep_id, manage_tags, event_type, death_date, disease_type_id, disease_subtype_id, disposal_direction, technician, handler, work_group, create_by, create_time, comment, update_by, update_time, is_delete from sc_sheep_death
</sql>
<select id="selectScSheepDeathList" parameterType="ScSheepDeath" resultMap="ScSheepDeathResult">
<include refid="selectScSheepDeathVo"/>
<where>
<if test="sheepId != null "> and sheep_id = #{sheepId}</if>
<if test="manageTags != null and manageTags != ''"> and manage_tags = #{manageTags}</if>
<if test="eventType != null and eventType != ''"> and event_type = #{eventType}</if>
<if test="deathDate != null "> and death_date = #{deathDate}</if>
<if test="diseaseTypeId != null "> and disease_type_id = #{diseaseTypeId}</if>
<if test="diseaseSubtypeId != null "> and disease_subtype_id = #{diseaseSubtypeId}</if>
<if test="disposalDirection != null and disposalDirection != ''"> and disposal_direction = #{disposalDirection}</if>
<if test="technician != null and technician != ''"> and technician = #{technician}</if>
<if test="handler != null and handler != ''"> and handler = #{handler}</if>
<if test="workGroup != null and workGroup != ''"> and work_group = #{workGroup}</if>
<if test="comment != null and comment != ''"> and comment = #{comment}</if>
<if test="isDelete != null "> and is_delete = #{isDelete}</if>
</where>
</select>
<select id="selectScSheepDeathById" parameterType="Long" resultMap="ScSheepDeathResult">
<include refid="selectScSheepDeathVo"/>
where id = #{id}
</select>
<!-- 根据管理耳号查询sheep_file视图信息 -->
<select id="selectSheepFileByManageTags" parameterType="String" resultType="java.util.Map">
select id as sheepId, variety, name as sheepType, gender, day_age as dayAge, parity, sheepfold_name as sheepfoldName, breed as breedStatus, post_lambing_day as postLambingDay, lactation_day as lactationDay, gestation_day as gestationDay
from sheep_file
where bs_manage_tags = #{manageTags} and is_delete = 0
</select>
<insert id="insertScSheepDeath" parameterType="ScSheepDeath" useGeneratedKeys="true" keyProperty="id">
insert into sc_sheep_death
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="sheepId != null">sheep_id,</if>
<if test="manageTags != null and manageTags != ''">manage_tags,</if>
<if test="eventType != null">event_type,</if>
<if test="deathDate != null">death_date,</if>
<if test="diseaseTypeId != null">disease_type_id,</if>
<if test="diseaseSubtypeId != null">disease_subtype_id,</if>
<if test="disposalDirection != null">disposal_direction,</if>
<if test="technician != null">technician,</if>
<if test="handler != null">handler,</if>
<if test="workGroup != null">work_group,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="comment != null">comment,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="isDelete != null">is_delete,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="sheepId != null">#{sheepId},</if>
<if test="manageTags != null and manageTags != ''">#{manageTags},</if>
<if test="eventType != null">#{eventType},</if>
<if test="deathDate != null">#{deathDate},</if>
<if test="diseaseTypeId != null">#{diseaseTypeId},</if>
<if test="diseaseSubtypeId != null">#{diseaseSubtypeId},</if>
<if test="disposalDirection != null">#{disposalDirection},</if>
<if test="technician != null">#{technician},</if>
<if test="handler != null">#{handler},</if>
<if test="workGroup != null">#{workGroup},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="comment != null">#{comment},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="isDelete != null">#{isDelete},</if>
</trim>
</insert>
<update id="updateScSheepDeath" parameterType="ScSheepDeath">
update sc_sheep_death
<trim prefix="SET" suffixOverrides=",">
<if test="sheepId != null">sheep_id = #{sheepId},</if>
<if test="manageTags != null and manageTags != ''">manage_tags = #{manageTags},</if>
<if test="eventType != null">event_type = #{eventType},</if>
<if test="deathDate != null">death_date = #{deathDate},</if>
<if test="diseaseTypeId != null">disease_type_id = #{diseaseTypeId},</if>
<if test="diseaseSubtypeId != null">disease_subtype_id = #{diseaseSubtypeId},</if>
<if test="disposalDirection != null">disposal_direction = #{disposalDirection},</if>
<if test="technician != null">technician = #{technician},</if>
<if test="handler != null">handler = #{handler},</if>
<if test="workGroup != null">work_group = #{workGroup},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="comment != null">comment = #{comment},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="isDelete != null">is_delete = #{isDelete},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteScSheepDeathById" parameterType="Long">
delete from sc_sheep_death where id = #{id}
</delete>
<delete id="deleteScSheepDeathByIds" parameterType="String">
delete from sc_sheep_death where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,97 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhyc.module.stock.mapper.WzMaterialsManagementMapper">
<resultMap type="WzMaterialsManagement" id="WzMaterialsManagementResult">
<result property="materialManagementCode" column="material_management_code" />
<result property="materialId" column="material_id" />
<result property="materialName" column="material_name" />
<result property="batchId" column="batch_id" />
<result property="materialSpecification" column="material_specification" />
<result property="materialUnit" column="material_unit" />
<result property="currentStock" column="current_stock" />
<result property="stockAlarm" column="stock_alarm" />
<result property="productionDate" column="production_date" />
<result property="expirationDate" column="expiration_date" />
<result property="expirationAlarm" column="expiration_alarm" />
</resultMap>
<sql id="selectWzMaterialsManagementVo">
select material_management_code, material_id, material_name, batch_id, material_specification, material_unit, current_stock, stock_alarm, production_date, expiration_date, expiration_alarm from wz_materials_management
</sql>
<select id="selectWzMaterialsManagementList" parameterType="WzMaterialsManagement" resultMap="WzMaterialsManagementResult">
<include refid="selectWzMaterialsManagementVo"/>
<where>
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
<if test="params.beginProductionDate != null and params.beginProductionDate != '' and params.endProductionDate != null and params.endProductionDate != ''"> and production_date between #{params.beginProductionDate} and #{params.endProductionDate}</if>
</where>
</select>
<select id="selectWzMaterialsManagementByMaterialManagementCode" parameterType="Long" resultMap="WzMaterialsManagementResult">
<include refid="selectWzMaterialsManagementVo"/>
where material_management_code = #{materialManagementCode}
</select>
<insert id="insertWzMaterialsManagement" parameterType="WzMaterialsManagement" useGeneratedKeys="true" keyProperty="materialManagementCode">
insert into wz_materials_management
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="materialId != null and materialId != ''">material_id,</if>
<if test="materialName != null and materialName != ''">material_name,</if>
<if test="batchId != null">batch_id,</if>
<if test="materialSpecification != null">material_specification,</if>
<if test="materialUnit != null">material_unit,</if>
<if test="currentStock != null">current_stock,</if>
<if test="stockAlarm != null">stock_alarm,</if>
<if test="productionDate != null">production_date,</if>
<if test="expirationDate != null">expiration_date,</if>
<if test="expirationAlarm != null">expiration_alarm,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="materialId != null and materialId != ''">#{materialId},</if>
<if test="materialName != null and materialName != ''">#{materialName},</if>
<if test="batchId != null">#{batchId},</if>
<if test="materialSpecification != null">#{materialSpecification},</if>
<if test="materialUnit != null">#{materialUnit},</if>
<if test="currentStock != null">#{currentStock},</if>
<if test="stockAlarm != null">#{stockAlarm},</if>
<if test="productionDate != null">#{productionDate},</if>
<if test="expirationDate != null">#{expirationDate},</if>
<if test="expirationAlarm != null">#{expirationAlarm},</if>
</trim>
</insert>
<update id="updateWzMaterialsManagement" parameterType="WzMaterialsManagement">
update wz_materials_management
<trim prefix="SET" suffixOverrides=",">
<if test="materialId != null and materialId != ''">material_id = #{materialId},</if>
<if test="materialName != null and materialName != ''">material_name = #{materialName},</if>
<if test="batchId != null">batch_id = #{batchId},</if>
<if test="materialSpecification != null">material_specification = #{materialSpecification},</if>
<if test="materialUnit != null">material_unit = #{materialUnit},</if>
<if test="currentStock != null">current_stock = #{currentStock},</if>
<if test="stockAlarm != null">stock_alarm = #{stockAlarm},</if>
<if test="productionDate != null">production_date = #{productionDate},</if>
<if test="expirationDate != null">expiration_date = #{expirationDate},</if>
<if test="expirationAlarm != null">expiration_alarm = #{expirationAlarm},</if>
</trim>
where material_id = #{materialId}
</update>
<delete id="deleteWzMaterialsManagementByMaterialManagementCode" parameterType="Long">
delete from wz_materials_management where material_management_code = #{materialManagementCode}
</delete>
<delete id="deleteWzMaterialsManagementByMaterialManagementCodes" parameterType="String">
delete from wz_materials_management where material_management_code in
<foreach item="materialManagementCode" collection="array" open="(" separator="," close=")">
#{materialManagementCode}
</foreach>
</delete>
<select id="selectWzMaterialsManagementByMaterialID" parameterType="String" resultMap="WzMaterialsManagementResult">
SELECT * FROM wz_materials_management WHERE material_id = #{materialID}
</select>
</mapper>

View File

@ -0,0 +1,147 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhyc.module.stock.mapper.WzStockInMapper">
<resultMap type="WzStockIn" id="WzStockInResult">
<result property="stockInCode" column="stock_in_code" />
<result property="docDate" column="doc_date" />
<result property="createDate" column="create_date" />
<result property="docId" column="doc_id" />
<result property="businessType" column="business_type" />
<result property="repositoryId" column="repository_id" />
<result property="repositoryName" column="repository_name" />
<result property="stockInType" column="stock_in_type" />
<result property="supplierId" column="supplier_id" />
<result property="supplierName" column="supplier_name" />
<result property="departmentId" column="department_id" />
<result property="departmentName" column="department_name" />
<result property="operatorId" column="operator_id" />
<result property="operatorName" column="operator_name" />
<result property="remark" column="remark" />
<result property="single" column="single" />
<result property="reviewer" column="reviewer" />
<result property="materialId" column="material_id" />
<result property="materialName" column="material_name" />
<result property="materialSpecification" column="material_specification" />
<result property="materialUnit" column="material_unit" />
<result property="count" column="count" />
<result property="stockInAdjustRemark" column="stock_in_adjust_remark" />
</resultMap>
<sql id="selectWzStockInVo">
select stock_in_code, doc_date, create_date, doc_id, business_type, repository_id, repository_name, stock_in_type, supplier_id, supplier_name, department_id, department_name, operator_id, operator_name, remark, single, reviewer, material_id, material_name, material_specification, material_unit, count, stock_in_adjust_remark from wz_stock_in
</sql>
<select id="selectWzStockInList" parameterType="WzStockIn" resultMap="WzStockInResult">
<include refid="selectWzStockInVo"/>
<where>
<if test="params.beginDocDate != null and params.beginDocDate != '' and params.endDocDate != null and params.endDocDate != ''"> and doc_date between #{params.beginDocDate} and #{params.endDocDate}</if>
<if test="businessType != null and businessType != ''"> and business_type = #{businessType}</if>
<if test="repositoryName != null and repositoryName != ''"> and repository_name like concat('%', #{repositoryName}, '%')</if>
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
</where>
</select>
<select id="selectWzStockInByStockInCode" parameterType="Long" resultMap="WzStockInResult">
<include refid="selectWzStockInVo"/>
where stock_in_code = #{stockInCode}
</select>
<insert id="insertWzStockIn" parameterType="WzStockIn" useGeneratedKeys="true" keyProperty="stockInCode">
insert into wz_stock_in
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="docDate != null">doc_date,</if>
<if test="createDate != null">create_date,</if>
<if test="docId != null">doc_id,</if>
<if test="businessType != null">business_type,</if>
<if test="repositoryId != null">repository_id,</if>
<if test="repositoryName != null">repository_name,</if>
<if test="stockInType != null">stock_in_type,</if>
<if test="supplierId != null">supplier_id,</if>
<if test="supplierName != null">supplier_name,</if>
<if test="departmentId != null">department_id,</if>
<if test="departmentName != null">department_name,</if>
<if test="operatorId != null">operator_id,</if>
<if test="operatorName != null">operator_name,</if>
<if test="remark != null">remark,</if>
<if test="single != null">single,</if>
<if test="reviewer != null">reviewer,</if>
<if test="materialId != null">material_id,</if>
<if test="materialName != null">material_name,</if>
<if test="materialSpecification != null">material_specification,</if>
<if test="materialUnit != null">material_unit,</if>
<if test="count != null">count,</if>
<if test="stockInAdjustRemark != null">stock_in_adjust_remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="docDate != null">#{docDate},</if>
<if test="createDate != null">#{createDate},</if>
<if test="docId != null">#{docId},</if>
<if test="businessType != null">#{businessType},</if>
<if test="repositoryId != null">#{repositoryId},</if>
<if test="repositoryName != null">#{repositoryName},</if>
<if test="stockInType != null">#{stockInType},</if>
<if test="supplierId != null">#{supplierId},</if>
<if test="supplierName != null">#{supplierName},</if>
<if test="departmentId != null">#{departmentId},</if>
<if test="departmentName != null">#{departmentName},</if>
<if test="operatorId != null">#{operatorId},</if>
<if test="operatorName != null">#{operatorName},</if>
<if test="remark != null">#{remark},</if>
<if test="single != null">#{single},</if>
<if test="reviewer != null">#{reviewer},</if>
<if test="materialId != null">#{materialId},</if>
<if test="materialName != null">#{materialName},</if>
<if test="materialSpecification != null">#{materialSpecification},</if>
<if test="materialUnit != null">#{materialUnit},</if>
<if test="count != null">#{count},</if>
<if test="stockInAdjustRemark != null">#{stockInAdjustRemark},</if>
</trim>
</insert>
<update id="updateWzStockIn" parameterType="WzStockIn">
update wz_stock_in
<trim prefix="SET" suffixOverrides=",">
<if test="docDate != null">doc_date = #{docDate},</if>
<if test="createDate != null">create_date = #{createDate},</if>
<if test="docId != null">doc_id = #{docId},</if>
<if test="businessType != null">business_type = #{businessType},</if>
<if test="repositoryId != null">repository_id = #{repositoryId},</if>
<if test="repositoryName != null">repository_name = #{repositoryName},</if>
<if test="stockInType != null">stock_in_type = #{stockInType},</if>
<if test="supplierId != null">supplier_id = #{supplierId},</if>
<if test="supplierName != null">supplier_name = #{supplierName},</if>
<if test="departmentId != null">department_id = #{departmentId},</if>
<if test="departmentName != null">department_name = #{departmentName},</if>
<if test="operatorId != null">operator_id = #{operatorId},</if>
<if test="operatorName != null">operator_name = #{operatorName},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="single != null">single = #{single},</if>
<if test="reviewer != null">reviewer = #{reviewer},</if>
<if test="materialId != null">material_id = #{materialId},</if>
<if test="materialName != null">material_name = #{materialName},</if>
<if test="materialSpecification != null">material_specification = #{materialSpecification},</if>
<if test="materialUnit != null">material_unit = #{materialUnit},</if>
<if test="count != null">count = #{count},</if>
<if test="stockInAdjustRemark != null">stock_in_adjust_remark = #{stockInAdjustRemark},</if>
</trim>
where stock_in_code = #{stockInCode}
</update>
<delete id="deleteWzStockInByStockInCode" parameterType="Long">
delete from wz_stock_in where stock_in_code = #{stockInCode}
</delete>
<delete id="deleteWzStockInByStockInCodes" parameterType="String">
delete from wz_stock_in where stock_in_code in
<foreach item="stockInCode" collection="array" open="(" separator="," close=")">
#{stockInCode}
</foreach>
</delete>
<select id="getEarliestStockIn" resultMap="WzStockInResult">
SELECT * FROM wz_stock_in ORDER BY doc_date DESC LIMIT 1
</select>
</mapper>

View File

@ -0,0 +1,180 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhyc.module.stock.mapper.WzStockOutMapper">
<resultMap type="WzStockOut" id="WzStockOutResult">
<result property="stockOutCode" column="stock_out_code" />
<result property="docDate" column="doc_date" />
<result property="createDate" column="create_date" />
<result property="docId" column="doc_id" />
<result property="businessType" column="business_type" />
<result property="repositoryId" column="repository_id" />
<result property="repositoryName" column="repository_name" />
<result property="projectClassification" column="project_classification" />
<result property="projectId" column="project_id" />
<result property="projectName" column="project_name" />
<result property="departmentId" column="department_id" />
<result property="departmentName" column="department_name" />
<result property="receiverId" column="receiver_id" />
<result property="receiver" column="receiver" />
<result property="single" column="single" />
<result property="reviewer" column="reviewer" />
<result property="reviewDate" column="review_date" />
<result property="modifier" column="modifier" />
<result property="materialClassId" column="material_class_id" />
<result property="materialClassName" column="material_class_name" />
<result property="materialId" column="material_id" />
<result property="materialName" column="material_name" />
<result property="materialSpecification" column="material_specification" />
<result property="materialUnit" column="material_unit" />
<result property="count" column="count" />
<result property="batchId" column="batch_id" />
<result property="productionDate" column="production_date" />
<result property="shelfLife" column="shelf_life" />
<result property="shelfLifeUnit" column="shelf_life_unit" />
<result property="expirationDate" column="expiration_date" />
<result property="agent" column="agent" />
</resultMap>
<sql id="selectWzStockOutVo">
select stock_out_code, doc_date, create_date, doc_id, business_type, repository_id, repository_name, project_classification, project_id, project_name, department_id, department_name,receiver_id, receiver, single, reviewer, review_date, modifier, material_class_id, material_class_name, material_id,material_name, material_specification, material_unit, count, batch_id, production_date, shelf_life, shelf_life_unit, expiration_date, agent from wz_stock_out
</sql>
<select id="selectWzStockOutList" parameterType="WzStockOut" resultMap="WzStockOutResult">
<include refid="selectWzStockOutVo"/>
<where>
<if test="businessType != null and businessType != ''"> and business_type = #{businessType}</if>
<if test="repositoryName != null and repositoryName != ''"> and repository_name like concat('%', #{repositoryName}, '%')</if>
<if test="projectName != null and projectName != ''"> and project_name like concat('%', #{projectName}, '%')</if>
<if test="departmentName != null and departmentName != ''"> and department_name like concat('%', #{departmentName}, '%')</if>
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
</where>
</select>
<select id="selectWzStockOutByStockOutCode" parameterType="Long" resultMap="WzStockOutResult">
<include refid="selectWzStockOutVo"/>
where stock_out_code = #{stockOutCode}
</select>
<insert id="insertWzStockOut" parameterType="WzStockOut" useGeneratedKeys="true" keyProperty="stockOutCode">
insert into wz_stock_out
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="docDate != null">doc_date,</if>
<if test="createDate != null">create_date,</if>
<if test="docId != null">doc_id,</if>
<if test="businessType != null">business_type,</if>
<if test="repositoryId != null">repository_id,</if>
<if test="repositoryName != null">repository_name,</if>
<if test="projectClassification != null">project_classification,</if>
<if test="projectId != null">project_id,</if>
<if test="projectName != null">project_name,</if>
<if test="departmentId != null">department_id,</if>
<if test="departmentName != null">department_name,</if>
<if test="receiverId != null">receiver_id,</if>
<if test="receiver != null">receiver,</if>
<if test="single != null">single,</if>
<if test="reviewer != null">reviewer,</if>
<if test="reviewDate != null">review_date,</if>
<if test="modifier != null">modifier,</if>
<if test="materialClassId != null">material_class_id,</if>
<if test="materialClassName != null">material_class_name,</if>
<if test="materialId != null">material_id,</if>
<if test="materialName != null">material_name,</if>
<if test="materialSpecification != null">material_specification,</if>
<if test="materialUnit != null">material_unit,</if>
<if test="count != null">count,</if>
<if test="batchId != null">batch_id,</if>
<if test="productionDate != null">production_date,</if>
<if test="shelfLife != null">shelf_life,</if>
<if test="shelfLifeUnit != null">shelf_life_unit,</if>
<if test="expirationDate != null">expiration_date,</if>
<if test="agent != null">agent,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="docDate != null">#{docDate},</if>
<if test="createDate != null">#{createDate},</if>
<if test="docId != null">#{docId},</if>
<if test="businessType != null">#{businessType},</if>
<if test="repositoryId != null">#{repositoryId},</if>
<if test="repositoryName != null">#{repositoryName},</if>
<if test="projectClassification != null">#{projectClassification},</if>
<if test="projectId != null">#{projectId},</if>
<if test="projectName != null">#{projectName},</if>
<if test="departmentId != null">#{departmentId},</if>
<if test="departmentName != null">#{departmentName},</if>
<if test="receiverId != null">#{receiverId},</if>
<if test="receiver != null">#{receiver},</if>
<if test="single != null">#{single},</if>
<if test="reviewer != null">#{reviewer},</if>
<if test="reviewDate != null">#{reviewDate},</if>
<if test="modifier != null">#{modifier},</if>
<if test="materialClassId != null">#{materialClassId},</if>
<if test="materialClassName != null">#{materialClassName},</if>
<if test="materialId != null">#{materialId},</if>
<if test="materialName != null">#{materialName},</if>
<if test="materialSpecification != null">#{materialSpecification},</if>
<if test="materialUnit != null">#{materialUnit},</if>
<if test="count != null">#{count},</if>
<if test="batchId != null">#{batchId},</if>
<if test="productionDate != null">#{productionDate},</if>
<if test="shelfLife != null">#{shelfLife},</if>
<if test="shelfLifeUnit != null">#{shelfLifeUnit},</if>
<if test="expirationDate != null">#{expirationDate},</if>
<if test="agent != null">#{agent},</if>
</trim>
</insert>
<update id="updateWzStockOut" parameterType="WzStockOut">
update wz_stock_out
<trim prefix="SET" suffixOverrides=",">
<if test="docDate != null">doc_date = #{docDate},</if>
<if test="createDate != null">create_date = #{createDate},</if>
<if test="docId != null">doc_id = #{docId},</if>
<if test="businessType != null">business_type = #{businessType},</if>
<if test="repositoryId != null">repository_id = #{repositoryId},</if>
<if test="repositoryName != null">repository_name = #{repositoryName},</if>
<if test="projectClassification != null">project_classification = #{projectClassification},</if>
<if test="projectId != null">project_id = #{projectId},</if>
<if test="projectName != null">project_name = #{projectName},</if>
<if test="departmentId != null">department_id = #{departmentId},</if>
<if test="departmentName != null">department_name = #{departmentName},</if>
<if test="receiverId != null">receiver_id = #{receiverId},</if>
<if test="receiver != null">receiver = #{receiver},</if>
<if test="single != null">single = #{single},</if>
<if test="reviewer != null">reviewer = #{reviewer},</if>
<if test="reviewDate != null">review_date = #{reviewDate},</if>
<if test="modifier != null">modifier = #{modifier},</if>
<if test="materialClassId != null">material_class_id = #{materialClassId},</if>
<if test="materialClassName != null">material_class_name = #{materialClassName},</if>
<if test="materialId != null">material_id = #{materialId},</if>
<if test="materialName != null">material_name = #{materialName},</if>
<if test="materialSpecification != null">material_specification = #{materialSpecification},</if>
<if test="materialUnit != null">material_unit = #{materialUnit},</if>
<if test="count != null">count = #{count},</if>
<if test="batchId != null">batch_id = #{batchId},</if>
<if test="productionDate != null">production_date = #{productionDate},</if>
<if test="shelfLife != null">shelf_life = #{shelfLife},</if>
<if test="shelfLifeUnit != null">shelf_life_unit = #{shelfLifeUnit},</if>
<if test="expirationDate != null">expiration_date = #{expirationDate},</if>
<if test="agent != null">agent = #{agent},</if>
</trim>
where stock_out_code = #{stockOutCode}
</update>
<delete id="deleteWzStockOutByStockOutCode" parameterType="Long">
delete from wz_stock_out where stock_out_code = #{stockOutCode}
</delete>
<delete id="deleteWzStockOutByStockOutCodes" parameterType="String">
delete from wz_stock_out where stock_out_code in
<foreach item="stockOutCode" collection="array" open="(" separator="," close=")">
#{stockOutCode}
</foreach>
</delete>
<select id="getEarliestStockOut" resultMap="WzStockOutResult">
SELECT * FROM wz_stock_out ORDER BY create_date DESC LIMIT 1
</select>
</mapper>