diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/controller/BreedRamFileController.java b/zhyc-module/src/main/java/com/zhyc/module/base/controller/BreedRamFileController.java new file mode 100644 index 0000000..7274064 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/controller/BreedRamFileController.java @@ -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 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 list = breedRamFileService.selectBreedRamFileList(breedRamFile); + ExcelUtil util = new ExcelUtil(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)); + } +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/domain/BasSheepGroup.java b/zhyc-module/src/main/java/com/zhyc/module/base/domain/BasSheepGroup.java index 810cad1..e0d1adb 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/base/domain/BasSheepGroup.java +++ b/zhyc-module/src/main/java/com/zhyc/module/base/domain/BasSheepGroup.java @@ -41,4 +41,7 @@ public class BasSheepGroup extends TreeEntity @Excel(name = "祖级列表名称") private String ancestorNames; + + private Integer isLeaf; + } diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/domain/BreedRamFile.java b/zhyc-module/src/main/java/com/zhyc/module/base/domain/BreedRamFile.java new file mode 100644 index 0000000..463308d --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/domain/BreedRamFile.java @@ -0,0 +1,890 @@ +package com.zhyc.module.base.domain; + +import java.math.BigDecimal; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 种公羊档案对象 breed_ram_file + * + * @author zhyc + * @date 2025-07-29 + */ +public class BreedRamFile extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 种公羊id */ + private Long id; + + /** 普通耳号 */ + @Excel(name = "普通耳号") + private String ordinaryEarNumber; + + /** 牧场id */ + @Excel(name = "牧场id") + private Long ranchId; + + /** 牧场名称 */ + @Excel(name = "牧场名称") + private String ranchName; + + /** 羊舍id */ + @Excel(name = "羊舍id") + private Long sheepfoldId; + + /** 羊舍名称 */ + @Excel(name = "羊舍名称") + private String sheepfoldName; + + /** 电子耳号 */ + @Excel(name = "电子耳号") + private String electronicTags; + + /** 品种id */ + @Excel(name = "品种id") + private Long varietyId; + + /** 品种 */ + @Excel(name = "品种") + private String variety; + + /** 羊只类别 */ + @Excel(name = "羊只类别") + private String sheepCategory; + + /** 当前状态 */ + @Excel(name = "当前状态") + private String currentStatus; + + /** 生日 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "生日", width = 30, dateFormat = "yyyy-MM-dd") + private Date birthday; + + /** 动态 */ + @Excel(name = "动态") + private String dynamicInfo; + + /** 月龄 */ + @Excel(name = "月龄") + private Long monthAge; + + /** 出生体重 */ + @Excel(name = "出生体重") + private BigDecimal birthWeight; + + /** 断奶日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "断奶日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date weaningDate; + + /** 断奶日龄 */ + @Excel(name = "断奶日龄") + private Long weaningDayAge; + + /** 断奶体重 */ + @Excel(name = "断奶体重") + private BigDecimal weaningWeight; + + /** 断奶日增重 */ + @Excel(name = "断奶日增重") + private BigDecimal weaningDailyGain; + + /** 断奶后日增重 */ + @Excel(name = "断奶后日增重") + private BigDecimal postWeaningDailyGain; + + /** 当前体重 */ + @Excel(name = "当前体重") + private BigDecimal currentWeight; + + /** 当前体重称重日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "当前体重称重日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date currentWeightDate; + + /** 活动量 */ + @Excel(name = "活动量") + private String activityLevel; + + /** 性欲情况 */ + @Excel(name = "性欲情况") + private String sexualStatus; + + /** 阴囊周长 */ + @Excel(name = "阴囊周长") + private BigDecimal scrotumCircumference; + + /** 采精时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "采精时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date spermCollectionTime; + + /** 精液量 */ + @Excel(name = "精液量") + private BigDecimal spermVolume; + + /** 精液活力 */ + @Excel(name = "精液活力") + private String spermVitality; + + /** 精液密度 */ + @Excel(name = "精液密度") + private String spermDensity; + + /** 精液品质 */ + @Excel(name = "精液品质") + private String spermQuality; + + /** 配种状态 */ + @Excel(name = "配种状态") + private Long breedingStatus; + + /** 上次计划时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "上次计划时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date lastPlanTime; + + /** 本次计划时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "本次计划时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date currentPlanTime; + + /** 蛋白率%EBV */ + @Excel(name = "蛋白率%EBV") + private BigDecimal proteinRateEbv; + + /** 乳脂率%EBV */ + @Excel(name = "乳脂率%EBV") + private BigDecimal milkFatRateEbv; + + /** 乳体细胞(SCS)EBV */ + @Excel(name = "乳体细胞", readConverterExp = "S=CS") + private BigDecimal scsEbv; + + /** 生长性能EBV */ + @Excel(name = "生长性能EBV") + private BigDecimal growthPerformanceEbv; + + /** 抗逆性EBV */ + @Excel(name = "抗逆性EBV") + private BigDecimal resistanceEbv; + + /** 繁殖性能EBV */ + @Excel(name = "繁殖性能EBV") + private BigDecimal reproductionPerformanceEbv; + + /** 体型性状EBV */ + @Excel(name = "体型性状EBV") + private BigDecimal bodyTypeEbv; + + /** 综合育种值 */ + @Excel(name = "综合育种值") + private BigDecimal comprehensiveBreedingValue; + + /** 父号 */ + @Excel(name = "父号") + private String fatherNumber; + + /** 母号 */ + @Excel(name = "母号") + private String motherNumber; + + /** 祖父 */ + @Excel(name = "祖父") + private String grandfatherNumber; + + /** 祖母 */ + @Excel(name = "祖母") + private String grandmotherNumber; + + /** 外祖父 */ + @Excel(name = "外祖父") + private String maternalGrandfatherNumber; + + /** 外祖母 */ + @Excel(name = "外祖母") + private String maternalGrandmotherNumber; + + /** 是否核心羊群(0否1是) */ + @Excel(name = "是否核心羊群", readConverterExp = "0=否,1=是") + private Long isCoreFlock; + + /** 是否种用(0否1是) */ + @Excel(name = "是否种用", readConverterExp = "0=否,1=是") + private Long isBreedingUse; + + /** 孕检 */ + @Excel(name = "孕检") + private String pregnancyCheck; + + /** 总配母羊数 */ + @Excel(name = "总配母羊数") + private Long totalMatedEwes; + + /** 本交孕检母羊数 */ + @Excel(name = "本交孕检母羊数") + private Long naturalPregnancyCheckEwes; + + /** 本交受孕率% */ + @Excel(name = "本交受孕率%") + private BigDecimal naturalConceptionRate; + + /** 人工孕检母羊数 */ + @Excel(name = "人工孕检母羊数") + private Long artificialPregnancyCheckEwes; + + /** 人工受孕率% */ + @Excel(name = "人工受孕率%") + private BigDecimal artificialConceptionRate; + + /** 公羊母亲奶量 */ + @Excel(name = "公羊母亲奶量") + private BigDecimal ramMotherMilkVolume; + + /** 产奶量估计育种值(Kg) */ + @Excel(name = "产奶量估计育种值", readConverterExp = "K=g") + private BigDecimal milkProductionEbv; + + /** 准确性 */ + @Excel(name = "准确性") + private BigDecimal accuracy; + + /** 信息数 */ + @Excel(name = "信息数") + private Long informationCount; + + /** 是否亲子鉴定(0否1是) */ + @Excel(name = "是否亲子鉴定", readConverterExp = "0=否,1=是") + private Long isPaternityTested; + + /** 是否删除(0否1是) */ + private Long isDelete; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setOrdinaryEarNumber(String ordinaryEarNumber) + { + this.ordinaryEarNumber = ordinaryEarNumber; + } + + public String getOrdinaryEarNumber() + { + return ordinaryEarNumber; + } + public void setRanchId(Long ranchId) + { + this.ranchId = ranchId; + } + + public Long getRanchId() + { + return ranchId; + } + public void setRanchName(String ranchName) + { + this.ranchName = ranchName; + } + + public String getRanchName() + { + return ranchName; + } + public void setSheepfoldId(Long sheepfoldId) + { + this.sheepfoldId = sheepfoldId; + } + + public Long getSheepfoldId() + { + return sheepfoldId; + } + public void setSheepfoldName(String sheepfoldName) + { + this.sheepfoldName = sheepfoldName; + } + + public String getSheepfoldName() + { + return sheepfoldName; + } + public void setElectronicTags(String electronicTags) + { + this.electronicTags = electronicTags; + } + + public String getElectronicTags() + { + return electronicTags; + } + public void setVarietyId(Long varietyId) + { + this.varietyId = varietyId; + } + + public Long getVarietyId() + { + return varietyId; + } + public void setVariety(String variety) + { + this.variety = variety; + } + + public String getVariety() + { + return variety; + } + public void setSheepCategory(String sheepCategory) + { + this.sheepCategory = sheepCategory; + } + + public String getSheepCategory() + { + return sheepCategory; + } + public void setCurrentStatus(String currentStatus) + { + this.currentStatus = currentStatus; + } + + public String getCurrentStatus() + { + return currentStatus; + } + public void setBirthday(Date birthday) + { + this.birthday = birthday; + } + + public Date getBirthday() + { + return birthday; + } + public void setDynamicInfo(String dynamicInfo) + { + this.dynamicInfo = dynamicInfo; + } + + public String getDynamicInfo() + { + return dynamicInfo; + } + public void setMonthAge(Long monthAge) + { + this.monthAge = monthAge; + } + + public Long getMonthAge() + { + return monthAge; + } + public void setBirthWeight(BigDecimal birthWeight) + { + this.birthWeight = birthWeight; + } + + public BigDecimal getBirthWeight() + { + return birthWeight; + } + public void setWeaningDate(Date weaningDate) + { + this.weaningDate = weaningDate; + } + + public Date getWeaningDate() + { + return weaningDate; + } + public void setWeaningDayAge(Long weaningDayAge) + { + this.weaningDayAge = weaningDayAge; + } + + public Long getWeaningDayAge() + { + return weaningDayAge; + } + public void setWeaningWeight(BigDecimal weaningWeight) + { + this.weaningWeight = weaningWeight; + } + + public BigDecimal getWeaningWeight() + { + return weaningWeight; + } + public void setWeaningDailyGain(BigDecimal weaningDailyGain) + { + this.weaningDailyGain = weaningDailyGain; + } + + public BigDecimal getWeaningDailyGain() + { + return weaningDailyGain; + } + public void setPostWeaningDailyGain(BigDecimal postWeaningDailyGain) + { + this.postWeaningDailyGain = postWeaningDailyGain; + } + + public BigDecimal getPostWeaningDailyGain() + { + return postWeaningDailyGain; + } + public void setCurrentWeight(BigDecimal currentWeight) + { + this.currentWeight = currentWeight; + } + + public BigDecimal getCurrentWeight() + { + return currentWeight; + } + public void setCurrentWeightDate(Date currentWeightDate) + { + this.currentWeightDate = currentWeightDate; + } + + public Date getCurrentWeightDate() + { + return currentWeightDate; + } + public void setActivityLevel(String activityLevel) + { + this.activityLevel = activityLevel; + } + + public String getActivityLevel() + { + return activityLevel; + } + public void setSexualStatus(String sexualStatus) + { + this.sexualStatus = sexualStatus; + } + + public String getSexualStatus() + { + return sexualStatus; + } + public void setScrotumCircumference(BigDecimal scrotumCircumference) + { + this.scrotumCircumference = scrotumCircumference; + } + + public BigDecimal getScrotumCircumference() + { + return scrotumCircumference; + } + public void setSpermCollectionTime(Date spermCollectionTime) + { + this.spermCollectionTime = spermCollectionTime; + } + + public Date getSpermCollectionTime() + { + return spermCollectionTime; + } + public void setSpermVolume(BigDecimal spermVolume) + { + this.spermVolume = spermVolume; + } + + public BigDecimal getSpermVolume() + { + return spermVolume; + } + public void setSpermVitality(String spermVitality) + { + this.spermVitality = spermVitality; + } + + public String getSpermVitality() + { + return spermVitality; + } + public void setSpermDensity(String spermDensity) + { + this.spermDensity = spermDensity; + } + + public String getSpermDensity() + { + return spermDensity; + } + public void setSpermQuality(String spermQuality) + { + this.spermQuality = spermQuality; + } + + public String getSpermQuality() + { + return spermQuality; + } + public void setBreedingStatus(Long breedingStatus) + { + this.breedingStatus = breedingStatus; + } + + public Long getBreedingStatus() + { + return breedingStatus; + } + public void setLastPlanTime(Date lastPlanTime) + { + this.lastPlanTime = lastPlanTime; + } + + public Date getLastPlanTime() + { + return lastPlanTime; + } + public void setCurrentPlanTime(Date currentPlanTime) + { + this.currentPlanTime = currentPlanTime; + } + + public Date getCurrentPlanTime() + { + return currentPlanTime; + } + public void setProteinRateEbv(BigDecimal proteinRateEbv) + { + this.proteinRateEbv = proteinRateEbv; + } + + public BigDecimal getProteinRateEbv() + { + return proteinRateEbv; + } + public void setMilkFatRateEbv(BigDecimal milkFatRateEbv) + { + this.milkFatRateEbv = milkFatRateEbv; + } + + public BigDecimal getMilkFatRateEbv() + { + return milkFatRateEbv; + } + public void setScsEbv(BigDecimal scsEbv) + { + this.scsEbv = scsEbv; + } + + public BigDecimal getScsEbv() + { + return scsEbv; + } + public void setGrowthPerformanceEbv(BigDecimal growthPerformanceEbv) + { + this.growthPerformanceEbv = growthPerformanceEbv; + } + + public BigDecimal getGrowthPerformanceEbv() + { + return growthPerformanceEbv; + } + public void setResistanceEbv(BigDecimal resistanceEbv) + { + this.resistanceEbv = resistanceEbv; + } + + public BigDecimal getResistanceEbv() + { + return resistanceEbv; + } + public void setReproductionPerformanceEbv(BigDecimal reproductionPerformanceEbv) + { + this.reproductionPerformanceEbv = reproductionPerformanceEbv; + } + + public BigDecimal getReproductionPerformanceEbv() + { + return reproductionPerformanceEbv; + } + public void setBodyTypeEbv(BigDecimal bodyTypeEbv) + { + this.bodyTypeEbv = bodyTypeEbv; + } + + public BigDecimal getBodyTypeEbv() + { + return bodyTypeEbv; + } + public void setComprehensiveBreedingValue(BigDecimal comprehensiveBreedingValue) + { + this.comprehensiveBreedingValue = comprehensiveBreedingValue; + } + + public BigDecimal getComprehensiveBreedingValue() + { + return comprehensiveBreedingValue; + } + public void setFatherNumber(String fatherNumber) + { + this.fatherNumber = fatherNumber; + } + + public String getFatherNumber() + { + return fatherNumber; + } + public void setMotherNumber(String motherNumber) + { + this.motherNumber = motherNumber; + } + + public String getMotherNumber() + { + return motherNumber; + } + public void setGrandfatherNumber(String grandfatherNumber) + { + this.grandfatherNumber = grandfatherNumber; + } + + public String getGrandfatherNumber() + { + return grandfatherNumber; + } + public void setGrandmotherNumber(String grandmotherNumber) + { + this.grandmotherNumber = grandmotherNumber; + } + + public String getGrandmotherNumber() + { + return grandmotherNumber; + } + public void setMaternalGrandfatherNumber(String maternalGrandfatherNumber) + { + this.maternalGrandfatherNumber = maternalGrandfatherNumber; + } + + public String getMaternalGrandfatherNumber() + { + return maternalGrandfatherNumber; + } + public void setMaternalGrandmotherNumber(String maternalGrandmotherNumber) + { + this.maternalGrandmotherNumber = maternalGrandmotherNumber; + } + + public String getMaternalGrandmotherNumber() + { + return maternalGrandmotherNumber; + } + public void setIsCoreFlock(Long isCoreFlock) + { + this.isCoreFlock = isCoreFlock; + } + + public Long getIsCoreFlock() + { + return isCoreFlock; + } + public void setIsBreedingUse(Long isBreedingUse) + { + this.isBreedingUse = isBreedingUse; + } + + public Long getIsBreedingUse() + { + return isBreedingUse; + } + public void setPregnancyCheck(String pregnancyCheck) + { + this.pregnancyCheck = pregnancyCheck; + } + + public String getPregnancyCheck() + { + return pregnancyCheck; + } + public void setTotalMatedEwes(Long totalMatedEwes) + { + this.totalMatedEwes = totalMatedEwes; + } + + public Long getTotalMatedEwes() + { + return totalMatedEwes; + } + public void setNaturalPregnancyCheckEwes(Long naturalPregnancyCheckEwes) + { + this.naturalPregnancyCheckEwes = naturalPregnancyCheckEwes; + } + + public Long getNaturalPregnancyCheckEwes() + { + return naturalPregnancyCheckEwes; + } + public void setNaturalConceptionRate(BigDecimal naturalConceptionRate) + { + this.naturalConceptionRate = naturalConceptionRate; + } + + public BigDecimal getNaturalConceptionRate() + { + return naturalConceptionRate; + } + public void setArtificialPregnancyCheckEwes(Long artificialPregnancyCheckEwes) + { + this.artificialPregnancyCheckEwes = artificialPregnancyCheckEwes; + } + + public Long getArtificialPregnancyCheckEwes() + { + return artificialPregnancyCheckEwes; + } + public void setArtificialConceptionRate(BigDecimal artificialConceptionRate) + { + this.artificialConceptionRate = artificialConceptionRate; + } + + public BigDecimal getArtificialConceptionRate() + { + return artificialConceptionRate; + } + public void setRamMotherMilkVolume(BigDecimal ramMotherMilkVolume) + { + this.ramMotherMilkVolume = ramMotherMilkVolume; + } + + public BigDecimal getRamMotherMilkVolume() + { + return ramMotherMilkVolume; + } + public void setMilkProductionEbv(BigDecimal milkProductionEbv) + { + this.milkProductionEbv = milkProductionEbv; + } + + public BigDecimal getMilkProductionEbv() + { + return milkProductionEbv; + } + public void setAccuracy(BigDecimal accuracy) + { + this.accuracy = accuracy; + } + + public BigDecimal getAccuracy() + { + return accuracy; + } + public void setInformationCount(Long informationCount) + { + this.informationCount = informationCount; + } + + public Long getInformationCount() + { + return informationCount; + } + public void setIsPaternityTested(Long isPaternityTested) + { + this.isPaternityTested = isPaternityTested; + } + + public Long getIsPaternityTested() + { + return isPaternityTested; + } + public void setIsDelete(Long isDelete) + { + this.isDelete = isDelete; + } + + public Long getIsDelete() + { + return isDelete; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("ordinaryEarNumber", getOrdinaryEarNumber()) + .append("ranchId", getRanchId()) + .append("ranchName", getRanchName()) + .append("sheepfoldId", getSheepfoldId()) + .append("sheepfoldName", getSheepfoldName()) + .append("electronicTags", getElectronicTags()) + .append("varietyId", getVarietyId()) + .append("variety", getVariety()) + .append("sheepCategory", getSheepCategory()) + .append("currentStatus", getCurrentStatus()) + .append("birthday", getBirthday()) + .append("dynamicInfo", getDynamicInfo()) + .append("monthAge", getMonthAge()) + .append("birthWeight", getBirthWeight()) + .append("weaningDate", getWeaningDate()) + .append("weaningDayAge", getWeaningDayAge()) + .append("weaningWeight", getWeaningWeight()) + .append("weaningDailyGain", getWeaningDailyGain()) + .append("postWeaningDailyGain", getPostWeaningDailyGain()) + .append("currentWeight", getCurrentWeight()) + .append("currentWeightDate", getCurrentWeightDate()) + .append("activityLevel", getActivityLevel()) + .append("sexualStatus", getSexualStatus()) + .append("scrotumCircumference", getScrotumCircumference()) + .append("spermCollectionTime", getSpermCollectionTime()) + .append("spermVolume", getSpermVolume()) + .append("spermVitality", getSpermVitality()) + .append("spermDensity", getSpermDensity()) + .append("spermQuality", getSpermQuality()) + .append("breedingStatus", getBreedingStatus()) + .append("lastPlanTime", getLastPlanTime()) + .append("currentPlanTime", getCurrentPlanTime()) + .append("remark", getRemark()) + .append("proteinRateEbv", getProteinRateEbv()) + .append("milkFatRateEbv", getMilkFatRateEbv()) + .append("scsEbv", getScsEbv()) + .append("growthPerformanceEbv", getGrowthPerformanceEbv()) + .append("resistanceEbv", getResistanceEbv()) + .append("reproductionPerformanceEbv", getReproductionPerformanceEbv()) + .append("bodyTypeEbv", getBodyTypeEbv()) + .append("comprehensiveBreedingValue", getComprehensiveBreedingValue()) + .append("fatherNumber", getFatherNumber()) + .append("motherNumber", getMotherNumber()) + .append("grandfatherNumber", getGrandfatherNumber()) + .append("grandmotherNumber", getGrandmotherNumber()) + .append("maternalGrandfatherNumber", getMaternalGrandfatherNumber()) + .append("maternalGrandmotherNumber", getMaternalGrandmotherNumber()) + .append("isCoreFlock", getIsCoreFlock()) + .append("isBreedingUse", getIsBreedingUse()) + .append("pregnancyCheck", getPregnancyCheck()) + .append("totalMatedEwes", getTotalMatedEwes()) + .append("naturalPregnancyCheckEwes", getNaturalPregnancyCheckEwes()) + .append("naturalConceptionRate", getNaturalConceptionRate()) + .append("artificialPregnancyCheckEwes", getArtificialPregnancyCheckEwes()) + .append("artificialConceptionRate", getArtificialConceptionRate()) + .append("ramMotherMilkVolume", getRamMotherMilkVolume()) + .append("milkProductionEbv", getMilkProductionEbv()) + .append("accuracy", getAccuracy()) + .append("informationCount", getInformationCount()) + .append("isPaternityTested", getIsPaternityTested()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("isDelete", getIsDelete()) + .toString(); + } +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/mapper/BasSheepMapper.java b/zhyc-module/src/main/java/com/zhyc/module/base/mapper/BasSheepMapper.java index 1b16800..4baaf89 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/base/mapper/BasSheepMapper.java +++ b/zhyc-module/src/main/java/com/zhyc/module/base/mapper/BasSheepMapper.java @@ -78,4 +78,6 @@ public interface BasSheepMapper //用于校验改耳号部分新管理/电子耳号 int existsByManageTag(@Param("tag") String tag); int existsByElectronicTag(@Param("tag") String tag); + + } diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/mapper/BreedRamFileMapper.java b/zhyc-module/src/main/java/com/zhyc/module/base/mapper/BreedRamFileMapper.java new file mode 100644 index 0000000..bb6eaa2 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/mapper/BreedRamFileMapper.java @@ -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 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 selectBreedRamFileListByRanchId(Long ranchId); + + /** + * 根据羊舍ID查询种公羊档案列表 + * + * @param sheepfoldId 羊舍ID + * @return 种公羊档案集合 + */ + public List selectBreedRamFileListBySheepfoldId(Long sheepfoldId); + + /** + * 查询核心羊群种公羊档案列表 + * + * @param breedRamFile 种公羊档案 + * @return 种公羊档案集合 + */ + public List selectCoreFlockBreedRamFileList(BreedRamFile breedRamFile); + + /** + * 查询种用种公羊档案列表 + * + * @param breedRamFile 种公羊档案 + * @return 种公羊档案集合 + */ + public List selectBreedingUseBreedRamFileList(BreedRamFile breedRamFile); +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/service/IBreedRamFileService.java b/zhyc-module/src/main/java/com/zhyc/module/base/service/IBreedRamFileService.java new file mode 100644 index 0000000..847f3b0 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/service/IBreedRamFileService.java @@ -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 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); +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/service/impl/BreedRamFileServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/base/service/impl/BreedRamFileServiceImpl.java new file mode 100644 index 0000000..7e7d8fe --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/service/impl/BreedRamFileServiceImpl.java @@ -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 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); + } +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/controller/ScSheepDeathController.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/controller/ScSheepDeathController.java new file mode 100644 index 0000000..cbd1964 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/controller/ScSheepDeathController.java @@ -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 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 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 list = scSheepDeathService.selectScSheepDeathList(scSheepDeath); + ExcelUtil util = new ExcelUtil(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)); + } +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/ScSheepDeath.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/ScSheepDeath.java new file mode 100644 index 0000000..52f04dd --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/ScSheepDeath.java @@ -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(); + } +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/mapper/ScSheepDeathMapper.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/mapper/ScSheepDeathMapper.java new file mode 100644 index 0000000..980d20d --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/mapper/ScSheepDeathMapper.java @@ -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 selectScSheepDeathList(ScSheepDeath scSheepDeath); + + /** + * 根据管理耳号查询sheep_file视图信息 + * + * @param manageTags 管理耳号 + * @return 羊只信息 + */ + public Map 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); +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/IScSheepDeathService.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/IScSheepDeathService.java new file mode 100644 index 0000000..e1100d5 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/IScSheepDeathService.java @@ -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 selectScSheepDeathList(ScSheepDeath scSheepDeath); + + /** + * 根据管理耳号查询sheep_file视图信息 + * + * @param manageTags 管理耳号 + * @return 羊只信息 + */ + public Map 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); +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/impl/ScSheepDeathServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/impl/ScSheepDeathServiceImpl.java new file mode 100644 index 0000000..12e7afd --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/impl/ScSheepDeathServiceImpl.java @@ -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 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 selectScSheepDeathList(ScSheepDeath scSheepDeath) + { + List list = scSheepDeathMapper.selectScSheepDeathList(scSheepDeath); + // 为列表中的每条记录填充显示字段 + for (ScSheepDeath death : list) { + if (death.getManageTags() != null) { + Map 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 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 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 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); + } +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/service/impl/ScAddSheepServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/service/impl/ScAddSheepServiceImpl.java index 278490e..b6ed6b4 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/service/impl/ScAddSheepServiceImpl.java +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/service/impl/ScAddSheepServiceImpl.java @@ -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("
第") @@ -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("
第") .append(i + 1) - .append("行:耳号已存在【") + .append("行:耳号已存在且未删除【") .append(sheep.getEarNumber()) .append("】"); continue; } + // 执行导入(新增或更新) if (updateSupport && sheep.getId() != null) { sheep.setUpdateBy(operName); updateScAddSheep(sheep); diff --git a/zhyc-module/src/main/java/com/zhyc/module/stock/controller/WzMaterialsManagementController.java b/zhyc-module/src/main/java/com/zhyc/module/stock/controller/WzMaterialsManagementController.java new file mode 100644 index 0000000..e1b567e --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/stock/controller/WzMaterialsManagementController.java @@ -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 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 list = wzMaterialsManagementService.selectWzMaterialsManagementList(wzMaterialsManagement); + ExcelUtil 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 util = new ExcelUtil<>(WzMaterialsManagement.class); + List 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); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/stock/controller/WzStockInController.java b/zhyc-module/src/main/java/com/zhyc/module/stock/controller/WzStockInController.java new file mode 100644 index 0000000..6705202 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/stock/controller/WzStockInController.java @@ -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 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 list = wzStockInService.selectWzStockInList(wzStockIn); + ExcelUtil 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 util = new ExcelUtil<>(WzStockIn.class); + List 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); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/stock/controller/WzStockOutController.java b/zhyc-module/src/main/java/com/zhyc/module/stock/controller/WzStockOutController.java new file mode 100644 index 0000000..cb80a44 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/stock/controller/WzStockOutController.java @@ -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 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 list = wzStockOutService.selectWzStockOutList(wzStockOut); + ExcelUtil 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 util = new ExcelUtil<>(WzStockOut.class); + List 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); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/stock/domain/WzMaterialsManagement.java b/zhyc-module/src/main/java/com/zhyc/module/stock/domain/WzMaterialsManagement.java new file mode 100644 index 0000000..88d3a53 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/stock/domain/WzMaterialsManagement.java @@ -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(); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/stock/domain/WzStockIn.java b/zhyc-module/src/main/java/com/zhyc/module/stock/domain/WzStockIn.java new file mode 100644 index 0000000..cda8b08 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/stock/domain/WzStockIn.java @@ -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(); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/stock/domain/WzStockOut.java b/zhyc-module/src/main/java/com/zhyc/module/stock/domain/WzStockOut.java new file mode 100644 index 0000000..c0a84a9 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/stock/domain/WzStockOut.java @@ -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(); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/stock/mapper/WzMaterialsManagementMapper.java b/zhyc-module/src/main/java/com/zhyc/module/stock/mapper/WzMaterialsManagementMapper.java new file mode 100644 index 0000000..a1c75a9 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/stock/mapper/WzMaterialsManagementMapper.java @@ -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 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); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/stock/mapper/WzStockInMapper.java b/zhyc-module/src/main/java/com/zhyc/module/stock/mapper/WzStockInMapper.java new file mode 100644 index 0000000..ed2fda8 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/stock/mapper/WzStockInMapper.java @@ -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 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(); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/stock/mapper/WzStockOutMapper.java b/zhyc-module/src/main/java/com/zhyc/module/stock/mapper/WzStockOutMapper.java new file mode 100644 index 0000000..a9ae9ce --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/stock/mapper/WzStockOutMapper.java @@ -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 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(); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/stock/service/IWzMaterialsManagementService.java b/zhyc-module/src/main/java/com/zhyc/module/stock/service/IWzMaterialsManagementService.java new file mode 100644 index 0000000..46e71dc --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/stock/service/IWzMaterialsManagementService.java @@ -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 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 MaterialsManagementList, Boolean isUpdateSupport, String operName); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/stock/service/IWzStockInService.java b/zhyc-module/src/main/java/com/zhyc/module/stock/service/IWzStockInService.java new file mode 100644 index 0000000..8d986a0 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/stock/service/IWzStockInService.java @@ -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 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 StockInList, Boolean isUpdateSupport, String operName); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/stock/service/IWzStockOutService.java b/zhyc-module/src/main/java/com/zhyc/module/stock/service/IWzStockOutService.java new file mode 100644 index 0000000..6e4c75b --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/stock/service/IWzStockOutService.java @@ -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 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 WzStockOutList, Boolean isUpdateSupport, String operName) throws Exception; +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/stock/service/impl/WzMaterialsManagementServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/stock/service/impl/WzMaterialsManagementServiceImpl.java new file mode 100644 index 0000000..ab6d272 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/stock/service/impl/WzMaterialsManagementServiceImpl.java @@ -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 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 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(); + } + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/stock/service/impl/WzStockInServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/stock/service/impl/WzStockInServiceImpl.java new file mode 100644 index 0000000..7632654 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/stock/service/impl/WzStockInServiceImpl.java @@ -0,0 +1,137 @@ +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 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 StockInList, Boolean isUpdateSupport, String operName) { + if (StringUtils.isNull(StockInList) || StockInList.isEmpty()) { + throw new ServiceException("导入用户数据不能为空!"); + } + int successNum = 0; + int failureNum = 0; + int sameNum = 0; + StringBuilder successMsg = new StringBuilder(); + StringBuilder failureMsg = new StringBuilder(); + try { + WzStockIn earliestStockIn = wzStockInMapper.getEarliestStockIn(); + System.out.println(earliestStockIn); + for (WzStockIn wzStockIn : StockInList) { + if (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(); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/stock/service/impl/WzStockOutServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/stock/service/impl/WzStockOutServiceImpl.java new file mode 100644 index 0000000..5fb6c36 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/stock/service/impl/WzStockOutServiceImpl.java @@ -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 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 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(); + } +} diff --git a/zhyc-module/src/main/resources/mapper/base/BasSheepMapper.xml b/zhyc-module/src/main/resources/mapper/base/BasSheepMapper.xml index c39e3a5..f42546a 100644 --- a/zhyc-module/src/main/resources/mapper/base/BasSheepMapper.xml +++ b/zhyc-module/src/main/resources/mapper/base/BasSheepMapper.xml @@ -128,7 +128,8 @@ and source_date = #{sourceDate} and source_ranch_id = #{sourceRanchId} and comment = #{comment} - and is_delete = #{isDelete} + and is_delete = 0 + and is_delete = #{isDelete} @@ -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 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 \ No newline at end of file diff --git a/zhyc-module/src/main/resources/mapper/base/BreedRamFileMapper.xml b/zhyc-module/src/main/resources/mapper/base/BreedRamFileMapper.xml new file mode 100644 index 0000000..6f666ee --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/base/BreedRamFileMapper.xml @@ -0,0 +1,417 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + insert into breed_ram_file + + 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, + + + #{ordinaryEarNumber}, + #{ranchId}, + #{ranchName}, + #{sheepfoldId}, + #{sheepfoldName}, + #{electronicTags}, + #{varietyId}, + #{variety}, + #{sheepCategory}, + #{currentStatus}, + #{birthday}, + #{dynamicInfo}, + #{monthAge}, + #{birthWeight}, + #{weaningDate}, + #{weaningDayAge}, + #{weaningWeight}, + #{weaningDailyGain}, + #{postWeaningDailyGain}, + #{currentWeight}, + #{currentWeightDate}, + #{activityLevel}, + #{sexualStatus}, + #{scrotumCircumference}, + #{spermCollectionTime}, + #{spermVolume}, + #{spermVitality}, + #{spermDensity}, + #{spermQuality}, + #{breedingStatus}, + #{lastPlanTime}, + #{currentPlanTime}, + #{remark}, + #{proteinRateEbv}, + #{milkFatRateEbv}, + #{scsEbv}, + #{growthPerformanceEbv}, + #{resistanceEbv}, + #{reproductionPerformanceEbv}, + #{bodyTypeEbv}, + #{comprehensiveBreedingValue}, + #{fatherNumber}, + #{motherNumber}, + #{grandfatherNumber}, + #{grandmotherNumber}, + #{maternalGrandfatherNumber}, + #{maternalGrandmotherNumber}, + #{isCoreFlock}, + #{isBreedingUse}, + #{pregnancyCheck}, + #{totalMatedEwes}, + #{naturalPregnancyCheckEwes}, + #{naturalConceptionRate}, + #{artificialPregnancyCheckEwes}, + #{artificialConceptionRate}, + #{ramMotherMilkVolume}, + #{milkProductionEbv}, + #{accuracy}, + #{informationCount}, + #{isPaternityTested}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{isDelete}, + + + + + update breed_ram_file + + ordinary_ear_number = #{ordinaryEarNumber}, + ranch_id = #{ranchId}, + ranch_name = #{ranchName}, + sheepfold_id = #{sheepfoldId}, + sheepfold_name = #{sheepfoldName}, + electronic_tags = #{electronicTags}, + variety_id = #{varietyId}, + variety = #{variety}, + sheep_category = #{sheepCategory}, + current_status = #{currentStatus}, + birthday = #{birthday}, + dynamic_info = #{dynamicInfo}, + month_age = #{monthAge}, + birth_weight = #{birthWeight}, + weaning_date = #{weaningDate}, + weaning_day_age = #{weaningDayAge}, + weaning_weight = #{weaningWeight}, + weaning_daily_gain = #{weaningDailyGain}, + post_weaning_daily_gain = #{postWeaningDailyGain}, + current_weight = #{currentWeight}, + current_weight_date = #{currentWeightDate}, + activity_level = #{activityLevel}, + sexual_status = #{sexualStatus}, + scrotum_circumference = #{scrotumCircumference}, + sperm_collection_time = #{spermCollectionTime}, + sperm_volume = #{spermVolume}, + sperm_vitality = #{spermVitality}, + sperm_density = #{spermDensity}, + sperm_quality = #{spermQuality}, + breeding_status = #{breedingStatus}, + last_plan_time = #{lastPlanTime}, + current_plan_time = #{currentPlanTime}, + comment = #{remark}, + protein_rate_ebv = #{proteinRateEbv}, + milk_fat_rate_ebv = #{milkFatRateEbv}, + scs_ebv = #{scsEbv}, + growth_performance_ebv = #{growthPerformanceEbv}, + resistance_ebv = #{resistanceEbv}, + reproduction_performance_ebv = #{reproductionPerformanceEbv}, + body_type_ebv = #{bodyTypeEbv}, + comprehensive_breeding_value = #{comprehensiveBreedingValue}, + father_number = #{fatherNumber}, + mother_number = #{motherNumber}, + grandfather_number = #{grandfatherNumber}, + grandmother_number = #{grandmotherNumber}, + maternal_grandfather_number = #{maternalGrandfatherNumber}, + maternal_grandmother_number = #{maternalGrandmotherNumber}, + is_core_flock = #{isCoreFlock}, + is_breeding_use = #{isBreedingUse}, + pregnancy_check = #{pregnancyCheck}, + total_mated_ewes = #{totalMatedEwes}, + natural_pregnancy_check_ewes = #{naturalPregnancyCheckEwes}, + natural_conception_rate = #{naturalConceptionRate}, + artificial_pregnancy_check_ewes = #{artificialPregnancyCheckEwes}, + artificial_conception_rate = #{artificialConceptionRate}, + ram_mother_milk_volume = #{ramMotherMilkVolume}, + milk_production_ebv = #{milkProductionEbv}, + accuracy = #{accuracy}, + information_count = #{informationCount}, + is_paternity_tested = #{isPaternityTested}, + update_by = #{updateBy}, + update_time = #{updateTime}, + is_delete = #{isDelete}, + + where id = #{id} + + + + delete from breed_ram_file where id = #{id} + + + + delete from breed_ram_file where id in + + #{id} + + + + \ No newline at end of file diff --git a/zhyc-module/src/main/resources/mapper/sheep_death/ScSheepDeathMapper.xml b/zhyc-module/src/main/resources/mapper/sheep_death/ScSheepDeathMapper.xml new file mode 100644 index 0000000..baedeeb --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/sheep_death/ScSheepDeathMapper.xml @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + insert into sc_sheep_death + + 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, + + + #{sheepId}, + #{manageTags}, + #{eventType}, + #{deathDate}, + #{diseaseTypeId}, + #{diseaseSubtypeId}, + #{disposalDirection}, + #{technician}, + #{handler}, + #{workGroup}, + #{createBy}, + #{createTime}, + #{comment}, + #{updateBy}, + #{updateTime}, + #{isDelete}, + + + + + update sc_sheep_death + + sheep_id = #{sheepId}, + manage_tags = #{manageTags}, + event_type = #{eventType}, + death_date = #{deathDate}, + disease_type_id = #{diseaseTypeId}, + disease_subtype_id = #{diseaseSubtypeId}, + disposal_direction = #{disposalDirection}, + technician = #{technician}, + handler = #{handler}, + work_group = #{workGroup}, + create_by = #{createBy}, + create_time = #{createTime}, + comment = #{comment}, + update_by = #{updateBy}, + update_time = #{updateTime}, + is_delete = #{isDelete}, + + where id = #{id} + + + + delete from sc_sheep_death where id = #{id} + + + + delete from sc_sheep_death where id in + + #{id} + + + \ No newline at end of file diff --git a/zhyc-module/src/main/resources/mapper/stock/WzMaterialsManagementMapper.xml b/zhyc-module/src/main/resources/mapper/stock/WzMaterialsManagementMapper.xml new file mode 100644 index 0000000..d2347c4 --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/stock/WzMaterialsManagementMapper.xml @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + insert into wz_materials_management + + material_id, + material_name, + batch_id, + material_specification, + material_unit, + current_stock, + stock_alarm, + production_date, + expiration_date, + expiration_alarm, + + + #{materialId}, + #{materialName}, + #{batchId}, + #{materialSpecification}, + #{materialUnit}, + #{currentStock}, + #{stockAlarm}, + #{productionDate}, + #{expirationDate}, + #{expirationAlarm}, + + + + + update wz_materials_management + + material_id = #{materialId}, + material_name = #{materialName}, + batch_id = #{batchId}, + material_specification = #{materialSpecification}, + material_unit = #{materialUnit}, + current_stock = #{currentStock}, + stock_alarm = #{stockAlarm}, + production_date = #{productionDate}, + expiration_date = #{expirationDate}, + expiration_alarm = #{expirationAlarm}, + + where material_id = #{materialId} + + + + delete from wz_materials_management where material_management_code = #{materialManagementCode} + + + + delete from wz_materials_management where material_management_code in + + #{materialManagementCode} + + + + + \ No newline at end of file diff --git a/zhyc-module/src/main/resources/mapper/stock/WzStockInMapper.xml b/zhyc-module/src/main/resources/mapper/stock/WzStockInMapper.xml new file mode 100644 index 0000000..55c5c1e --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/stock/WzStockInMapper.xml @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + insert into wz_stock_in + + 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, + + + #{docDate}, + #{createDate}, + #{docId}, + #{businessType}, + #{repositoryId}, + #{repositoryName}, + #{stockInType}, + #{supplierId}, + #{supplierName}, + #{departmentId}, + #{departmentName}, + #{operatorId}, + #{operatorName}, + #{remark}, + #{single}, + #{reviewer}, + #{materialId}, + #{materialName}, + #{materialSpecification}, + #{materialUnit}, + #{count}, + #{stockInAdjustRemark}, + + + + + update wz_stock_in + + doc_date = #{docDate}, + create_date = #{createDate}, + doc_id = #{docId}, + business_type = #{businessType}, + repository_id = #{repositoryId}, + repository_name = #{repositoryName}, + stock_in_type = #{stockInType}, + supplier_id = #{supplierId}, + supplier_name = #{supplierName}, + department_id = #{departmentId}, + department_name = #{departmentName}, + operator_id = #{operatorId}, + operator_name = #{operatorName}, + remark = #{remark}, + single = #{single}, + reviewer = #{reviewer}, + material_id = #{materialId}, + material_name = #{materialName}, + material_specification = #{materialSpecification}, + material_unit = #{materialUnit}, + count = #{count}, + stock_in_adjust_remark = #{stockInAdjustRemark}, + + where stock_in_code = #{stockInCode} + + + + delete from wz_stock_in where stock_in_code = #{stockInCode} + + + + delete from wz_stock_in where stock_in_code in + + #{stockInCode} + + + + + \ No newline at end of file diff --git a/zhyc-module/src/main/resources/mapper/stock/WzStockOutMapper.xml b/zhyc-module/src/main/resources/mapper/stock/WzStockOutMapper.xml new file mode 100644 index 0000000..5df3b87 --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/stock/WzStockOutMapper.xml @@ -0,0 +1,180 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + insert into wz_stock_out + + 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, + + + #{docDate}, + #{createDate}, + #{docId}, + #{businessType}, + #{repositoryId}, + #{repositoryName}, + #{projectClassification}, + #{projectId}, + #{projectName}, + #{departmentId}, + #{departmentName}, + #{receiverId}, + #{receiver}, + #{single}, + #{reviewer}, + #{reviewDate}, + #{modifier}, + #{materialClassId}, + #{materialClassName}, + #{materialId}, + #{materialName}, + #{materialSpecification}, + #{materialUnit}, + #{count}, + #{batchId}, + #{productionDate}, + #{shelfLife}, + #{shelfLifeUnit}, + #{expirationDate}, + #{agent}, + + + + + update wz_stock_out + + doc_date = #{docDate}, + create_date = #{createDate}, + doc_id = #{docId}, + business_type = #{businessType}, + repository_id = #{repositoryId}, + repository_name = #{repositoryName}, + project_classification = #{projectClassification}, + project_id = #{projectId}, + project_name = #{projectName}, + department_id = #{departmentId}, + department_name = #{departmentName}, + receiver_id = #{receiverId}, + receiver = #{receiver}, + single = #{single}, + reviewer = #{reviewer}, + review_date = #{reviewDate}, + modifier = #{modifier}, + material_class_id = #{materialClassId}, + material_class_name = #{materialClassName}, + material_id = #{materialId}, + material_name = #{materialName}, + material_specification = #{materialSpecification}, + material_unit = #{materialUnit}, + count = #{count}, + batch_id = #{batchId}, + production_date = #{productionDate}, + shelf_life = #{shelfLife}, + shelf_life_unit = #{shelfLifeUnit}, + expiration_date = #{expirationDate}, + agent = #{agent}, + + where stock_out_code = #{stockOutCode} + + + + delete from wz_stock_out where stock_out_code = #{stockOutCode} + + + + delete from wz_stock_out where stock_out_code in + + #{stockOutCode} + + + + + \ No newline at end of file