diff --git a/zhyc-module/src/main/java/com/zhyc/module/sheep_file/controller/BasSheepController.java b/zhyc-module/src/main/java/com/zhyc/module/sheep_file/controller/BasSheepController.java new file mode 100644 index 0000000..cbc8894 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/sheep_file/controller/BasSheepController.java @@ -0,0 +1,104 @@ +package com.zhyc.module.sheep_file.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.zhyc.common.annotation.Log; +import com.zhyc.common.core.controller.BaseController; +import com.zhyc.common.core.domain.AjaxResult; +import com.zhyc.common.enums.BusinessType; +import com.zhyc.module.sheep_file.domain.BasSheep; +import com.zhyc.module.sheep_file.service.IBasSheepService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 羊只基本信息Controller + * + * @author ruoyi + * @date 2025-07-10 + */ +@RestController +@RequestMapping("/sheep_file/sheep_file") +public class BasSheepController extends BaseController +{ + @Autowired + private IBasSheepService basSheepService; + + /** + * 查询羊只基本信息列表 + */ + @PreAuthorize("@ss.hasPermi('sheep_file:sheep_file:list')") + @GetMapping("/list") + public TableDataInfo list(BasSheep basSheep) + { + startPage(); + List list = basSheepService.selectBasSheepList(basSheep); + return getDataTable(list); + } + + /** + * 导出羊只基本信息列表 + */ + @PreAuthorize("@ss.hasPermi('sheep_file:sheep_file:export')") + @Log(title = "羊只基本信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, BasSheep basSheep) + { + List list = basSheepService.selectBasSheepList(basSheep); + ExcelUtil util = new ExcelUtil(BasSheep.class); + util.exportExcel(response, list, "羊只基本信息数据"); + } + + /** + * 获取羊只基本信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('sheep_file:sheep_file:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(basSheepService.selectBasSheepById(id)); + } + + /** + * 新增羊只基本信息 + */ + @PreAuthorize("@ss.hasPermi('sheep_file:sheep_file:add')") + @Log(title = "羊只基本信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody BasSheep basSheep) + { + return toAjax(basSheepService.insertBasSheep(basSheep)); + } + + /** + * 修改羊只基本信息 + */ + @PreAuthorize("@ss.hasPermi('sheep_file:sheep_file:edit')") + @Log(title = "羊只基本信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody BasSheep basSheep) + { + return toAjax(basSheepService.updateBasSheep(basSheep)); + } + + /** + * 删除羊只基本信息 + */ + @PreAuthorize("@ss.hasPermi('sheep_file:sheep_file:remove')") + @Log(title = "羊只基本信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(basSheepService.deleteBasSheepByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/sheep_file/domain/BasSheep.java b/zhyc-module/src/main/java/com/zhyc/module/sheep_file/domain/BasSheep.java new file mode 100644 index 0000000..2f488bd --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/sheep_file/domain/BasSheep.java @@ -0,0 +1,575 @@ +package com.zhyc.module.sheep_file.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; + +/** + * 羊只基本信息对象 bas_sheep + * + * @author ruoyi + * @date 2025-07-10 + */ +public class BasSheep extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 羊只id */ + private Long id; + + /** 管理耳号 */ + @Excel(name = "管理耳号") + private String manageTags; + + /** 牧场id */ + @Excel(name = "牧场id") + private Long ranchId; + + /** 羊舍id */ + @Excel(name = "羊舍id") + private Long sheepfoldId; + + /** 电子耳号 */ + @Excel(name = "电子耳号") + private String electronicTags; + + /** 品种id */ + @Excel(name = "品种id") + private Long varietyId; + + /** 家系 */ + @Excel(name = "家系") + private String family; + + /** 羊只类别 */ + @Excel(name = "羊只类别") + private Long typeId; + + /** 性别 */ + @Excel(name = "性别") + private Long gender; + + /** 出生日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "出生日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date birthday; + + /** 出生体重 */ + @Excel(name = "出生体重") + private Long birthWeight; + + /** 胎次 */ + @Excel(name = "胎次") + private Long parity; + + /** 羊只状态 */ + @Excel(name = "羊只状态") + private Long statusId; + + /** 断奶日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "断奶日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date weaningDate; + + /** 断奶体重 */ + @Excel(name = "断奶体重") + private Long weaningWeight; + + /** 繁育状态id */ + @Excel(name = "繁育状态id") + private Long breedStatusId; + + /** 父号id */ + @Excel(name = "父号id") + private Long fatherId; + + /** 母号id */ + @Excel(name = "母号id") + private Long motherId; + + /** 受体id */ + @Excel(name = "受体id") + private Long receptorId; + + /** 配种日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "配种日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date matingDate; + + /** 配种类型 */ + @Excel(name = "配种类型") + private Long matingTypeId; + + /** 孕检日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "孕检日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date pregDate; + + /** 产羔日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "产羔日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date lambingDate; + + /** 产羔时怀孕天数 */ + @Excel(name = "产羔时怀孕天数") + private Long lambingDay; + + /** 预产日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "预产日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date expectedDate; + + /** 是否性控 */ + @Excel(name = "是否性控") + private Long controlled; + + /** 配种次数 */ + @Excel(name = "配种次数") + private Long matingCounts; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Long matingTotal; + + /** 累计流产次数 */ + @Excel(name = "累计流产次数") + private Long miscarriageCounts; + + /** 体况评分 */ + @Excel(name = "体况评分") + private Long body; + + /** 乳房评分 */ + @Excel(name = "乳房评分") + private Long breast; + + /** 入群来源 */ + @Excel(name = "入群来源") + private String source; + + /** 入群日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "入群日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date soureDate; + + /** 来源牧场id */ + @Excel(name = "来源牧场id") + private Long sourceRanchId; + + /** 备注 */ + @Excel(name = "备注") + private String comment; + + /** 是否删除 */ + @Excel(name = "是否删除") + private Long isDelete; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public void setManageTags(String manageTags) + { + this.manageTags = manageTags; + } + + public String getManageTags() + { + return manageTags; + } + + public void setRanchId(Long ranchId) + { + this.ranchId = ranchId; + } + + public Long getRanchId() + { + return ranchId; + } + + public void setSheepfoldId(Long sheepfoldId) + { + this.sheepfoldId = sheepfoldId; + } + + public Long getSheepfoldId() + { + return sheepfoldId; + } + + 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 setFamily(String family) + { + this.family = family; + } + + public String getFamily() + { + return family; + } + + public void setTypeId(Long typeId) + { + this.typeId = typeId; + } + + public Long getTypeId() + { + return typeId; + } + + public void setGender(Long gender) + { + this.gender = gender; + } + + public Long getGender() + { + return gender; + } + + public void setBirthday(Date birthday) + { + this.birthday = birthday; + } + + public Date getBirthday() + { + return birthday; + } + + public void setBirthWeight(Long birthWeight) + { + this.birthWeight = birthWeight; + } + + public Long getBirthWeight() + { + return birthWeight; + } + + public void setParity(Long parity) + { + this.parity = parity; + } + + public Long getParity() + { + return parity; + } + + public void setStatusId(Long statusId) + { + this.statusId = statusId; + } + + public Long getStatusId() + { + return statusId; + } + + public void setWeaningDate(Date weaningDate) + { + this.weaningDate = weaningDate; + } + + public Date getWeaningDate() + { + return weaningDate; + } + + public void setWeaningWeight(Long weaningWeight) + { + this.weaningWeight = weaningWeight; + } + + public Long getWeaningWeight() + { + return weaningWeight; + } + + public void setBreedStatusId(Long breedStatusId) + { + this.breedStatusId = breedStatusId; + } + + public Long getBreedStatusId() + { + return breedStatusId; + } + + public void setFatherId(Long fatherId) + { + this.fatherId = fatherId; + } + + public Long getFatherId() + { + return fatherId; + } + + public void setMotherId(Long motherId) + { + this.motherId = motherId; + } + + public Long getMotherId() + { + return motherId; + } + + public void setReceptorId(Long receptorId) + { + this.receptorId = receptorId; + } + + public Long getReceptorId() + { + return receptorId; + } + + public void setMatingDate(Date matingDate) + { + this.matingDate = matingDate; + } + + public Date getMatingDate() + { + return matingDate; + } + + public void setMatingTypeId(Long matingTypeId) + { + this.matingTypeId = matingTypeId; + } + + public Long getMatingTypeId() + { + return matingTypeId; + } + + public void setPregDate(Date pregDate) + { + this.pregDate = pregDate; + } + + public Date getPregDate() + { + return pregDate; + } + + public void setLambingDate(Date lambingDate) + { + this.lambingDate = lambingDate; + } + + public Date getLambingDate() + { + return lambingDate; + } + + public void setLambingDay(Long lambingDay) + { + this.lambingDay = lambingDay; + } + + public Long getLambingDay() + { + return lambingDay; + } + + public void setExpectedDate(Date expectedDate) + { + this.expectedDate = expectedDate; + } + + public Date getExpectedDate() + { + return expectedDate; + } + + public void setControlled(Long controlled) + { + this.controlled = controlled; + } + + public Long getControlled() + { + return controlled; + } + + public void setMatingCounts(Long matingCounts) + { + this.matingCounts = matingCounts; + } + + public Long getMatingCounts() + { + return matingCounts; + } + + public void setMatingTotal(Long matingTotal) + { + this.matingTotal = matingTotal; + } + + public Long getMatingTotal() + { + return matingTotal; + } + + public void setMiscarriageCounts(Long miscarriageCounts) + { + this.miscarriageCounts = miscarriageCounts; + } + + public Long getMiscarriageCounts() + { + return miscarriageCounts; + } + + public void setBody(Long body) + { + this.body = body; + } + + public Long getBody() + { + return body; + } + + public void setBreast(Long breast) + { + this.breast = breast; + } + + public Long getBreast() + { + return breast; + } + + public void setSource(String source) + { + this.source = source; + } + + public String getSource() + { + return source; + } + + public void setSoureDate(Date soureDate) + { + this.soureDate = soureDate; + } + + public Date getSoureDate() + { + return soureDate; + } + + public void setSourceRanchId(Long sourceRanchId) + { + this.sourceRanchId = sourceRanchId; + } + + public Long getSourceRanchId() + { + return sourceRanchId; + } + + 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; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("manageTags", getManageTags()) + .append("ranchId", getRanchId()) + .append("sheepfoldId", getSheepfoldId()) + .append("electronicTags", getElectronicTags()) + .append("varietyId", getVarietyId()) + .append("family", getFamily()) + .append("typeId", getTypeId()) + .append("gender", getGender()) + .append("birthday", getBirthday()) + .append("birthWeight", getBirthWeight()) + .append("parity", getParity()) + .append("statusId", getStatusId()) + .append("weaningDate", getWeaningDate()) + .append("weaningWeight", getWeaningWeight()) + .append("breedStatusId", getBreedStatusId()) + .append("fatherId", getFatherId()) + .append("motherId", getMotherId()) + .append("receptorId", getReceptorId()) + .append("matingDate", getMatingDate()) + .append("matingTypeId", getMatingTypeId()) + .append("pregDate", getPregDate()) + .append("lambingDate", getLambingDate()) + .append("lambingDay", getLambingDay()) + .append("expectedDate", getExpectedDate()) + .append("controlled", getControlled()) + .append("matingCounts", getMatingCounts()) + .append("matingTotal", getMatingTotal()) + .append("miscarriageCounts", getMiscarriageCounts()) + .append("body", getBody()) + .append("breast", getBreast()) + .append("source", getSource()) + .append("soureDate", getSoureDate()) + .append("sourceRanchId", getSourceRanchId()) + .append("comment", getComment()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("isDelete", getIsDelete()) + .toString(); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/sheep_file/mapper/BasSheepMapper.java b/zhyc-module/src/main/java/com/zhyc/module/sheep_file/mapper/BasSheepMapper.java new file mode 100644 index 0000000..2ff48ee --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/sheep_file/mapper/BasSheepMapper.java @@ -0,0 +1,61 @@ +package com.zhyc.module.sheep_file.mapper; + +import java.util.List; +import com.zhyc.module.sheep_file.domain.BasSheep; + +/** + * 羊只基本信息Mapper接口 + * + * @author ruoyi + * @date 2025-07-10 + */ +public interface BasSheepMapper +{ + /** + * 查询羊只基本信息 + * + * @param id 羊只基本信息主键 + * @return 羊只基本信息 + */ + public BasSheep selectBasSheepById(Long id); + + /** + * 查询羊只基本信息列表 + * + * @param basSheep 羊只基本信息 + * @return 羊只基本信息集合 + */ + public List selectBasSheepList(BasSheep basSheep); + + /** + * 新增羊只基本信息 + * + * @param basSheep 羊只基本信息 + * @return 结果 + */ + public int insertBasSheep(BasSheep basSheep); + + /** + * 修改羊只基本信息 + * + * @param basSheep 羊只基本信息 + * @return 结果 + */ + public int updateBasSheep(BasSheep basSheep); + + /** + * 删除羊只基本信息 + * + * @param id 羊只基本信息主键 + * @return 结果 + */ + public int deleteBasSheepById(Long id); + + /** + * 批量删除羊只基本信息 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteBasSheepByIds(Long[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/sheep_file/service/IBasSheepService.java b/zhyc-module/src/main/java/com/zhyc/module/sheep_file/service/IBasSheepService.java new file mode 100644 index 0000000..72b6343 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/sheep_file/service/IBasSheepService.java @@ -0,0 +1,61 @@ +package com.zhyc.module.sheep_file.service; + +import java.util.List; +import com.zhyc.module.sheep_file.domain.BasSheep; + +/** + * 羊只基本信息Service接口 + * + * @author ruoyi + * @date 2025-07-10 + */ +public interface IBasSheepService +{ + /** + * 查询羊只基本信息 + * + * @param id 羊只基本信息主键 + * @return 羊只基本信息 + */ + public BasSheep selectBasSheepById(Long id); + + /** + * 查询羊只基本信息列表 + * + * @param basSheep 羊只基本信息 + * @return 羊只基本信息集合 + */ + public List selectBasSheepList(BasSheep basSheep); + + /** + * 新增羊只基本信息 + * + * @param basSheep 羊只基本信息 + * @return 结果 + */ + public int insertBasSheep(BasSheep basSheep); + + /** + * 修改羊只基本信息 + * + * @param basSheep 羊只基本信息 + * @return 结果 + */ + public int updateBasSheep(BasSheep basSheep); + + /** + * 批量删除羊只基本信息 + * + * @param ids 需要删除的羊只基本信息主键集合 + * @return 结果 + */ + public int deleteBasSheepByIds(Long[] ids); + + /** + * 删除羊只基本信息信息 + * + * @param id 羊只基本信息主键 + * @return 结果 + */ + public int deleteBasSheepById(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/sheep_file/service/impl/BasSheepServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/sheep_file/service/impl/BasSheepServiceImpl.java new file mode 100644 index 0000000..d776254 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/sheep_file/service/impl/BasSheepServiceImpl.java @@ -0,0 +1,96 @@ +package com.zhyc.module.sheep_file.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.sheep_file.mapper.BasSheepMapper; +import com.zhyc.module.sheep_file.domain.BasSheep; +import com.zhyc.module.sheep_file.service.IBasSheepService; + +/** + * 羊只基本信息Service业务层处理 + * + * @author ruoyi + * @date 2025-07-10 + */ +@Service +public class BasSheepServiceImpl implements IBasSheepService +{ + @Autowired + private BasSheepMapper basSheepMapper; + + /** + * 查询羊只基本信息 + * + * @param id 羊只基本信息主键 + * @return 羊只基本信息 + */ + @Override + public BasSheep selectBasSheepById(Long id) + { + return basSheepMapper.selectBasSheepById(id); + } + + /** + * 查询羊只基本信息列表 + * + * @param basSheep 羊只基本信息 + * @return 羊只基本信息 + */ + @Override + public List selectBasSheepList(BasSheep basSheep) + { + return basSheepMapper.selectBasSheepList(basSheep); + } + + /** + * 新增羊只基本信息 + * + * @param basSheep 羊只基本信息 + * @return 结果 + */ + @Override + public int insertBasSheep(BasSheep basSheep) + { + basSheep.setCreateTime(DateUtils.getNowDate()); + return basSheepMapper.insertBasSheep(basSheep); + } + + /** + * 修改羊只基本信息 + * + * @param basSheep 羊只基本信息 + * @return 结果 + */ + @Override + public int updateBasSheep(BasSheep basSheep) + { + basSheep.setUpdateTime(DateUtils.getNowDate()); + return basSheepMapper.updateBasSheep(basSheep); + } + + /** + * 批量删除羊只基本信息 + * + * @param ids 需要删除的羊只基本信息主键 + * @return 结果 + */ + @Override + public int deleteBasSheepByIds(Long[] ids) + { + return basSheepMapper.deleteBasSheepByIds(ids); + } + + /** + * 删除羊只基本信息信息 + * + * @param id 羊只基本信息主键 + * @return 结果 + */ + @Override + public int deleteBasSheepById(Long id) + { + return basSheepMapper.deleteBasSheepById(id); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/sheepfold_management/controller/DaSheepfoldController.java b/zhyc-module/src/main/java/com/zhyc/module/sheepfold_management/controller/DaSheepfoldController.java new file mode 100644 index 0000000..e961f58 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/sheepfold_management/controller/DaSheepfoldController.java @@ -0,0 +1,104 @@ +package com.zhyc.module.sheepfold_management.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.zhyc.common.annotation.Log; +import com.zhyc.common.core.controller.BaseController; +import com.zhyc.common.core.domain.AjaxResult; +import com.zhyc.common.enums.BusinessType; +import com.zhyc.module.sheepfold_management.domain.DaSheepfold; +import com.zhyc.module.sheepfold_management.service.IDaSheepfoldService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 羊舍管理Controller + * + * @author wyt + * @date 2025-07-11 + */ +@RestController +@RequestMapping("/sheepfold_management/sheepfold_management") +public class DaSheepfoldController extends BaseController +{ + @Autowired + private IDaSheepfoldService daSheepfoldService; + + /** + * 查询羊舍管理列表 + */ + @PreAuthorize("@ss.hasPermi('sheepfold_management:sheepfold_management:list')") + @GetMapping("/list") + public TableDataInfo list(DaSheepfold daSheepfold) + { + startPage(); + List list = daSheepfoldService.selectDaSheepfoldList(daSheepfold); + return getDataTable(list); + } + + /** + * 导出羊舍管理列表 + */ + @PreAuthorize("@ss.hasPermi('sheepfold_management:sheepfold_management:export')") + @Log(title = "羊舍管理", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, DaSheepfold daSheepfold) + { + List list = daSheepfoldService.selectDaSheepfoldList(daSheepfold); + ExcelUtil util = new ExcelUtil(DaSheepfold.class); + util.exportExcel(response, list, "羊舍管理数据"); + } + + /** + * 获取羊舍管理详细信息 + */ + @PreAuthorize("@ss.hasPermi('sheepfold_management:sheepfold_management:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(daSheepfoldService.selectDaSheepfoldById(id)); + } + + /** + * 新增羊舍管理 + */ + @PreAuthorize("@ss.hasPermi('sheepfold_management:sheepfold_management:add')") + @Log(title = "羊舍管理", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody DaSheepfold daSheepfold) + { + return toAjax(daSheepfoldService.insertDaSheepfold(daSheepfold)); + } + + /** + * 修改羊舍管理 + */ + @PreAuthorize("@ss.hasPermi('sheepfold_management:sheepfold_management:edit')") + @Log(title = "羊舍管理", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody DaSheepfold daSheepfold) + { + return toAjax(daSheepfoldService.updateDaSheepfold(daSheepfold)); + } + + /** + * 删除羊舍管理 + */ + @PreAuthorize("@ss.hasPermi('sheepfold_management:sheepfold_management:remove')") + @Log(title = "羊舍管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(daSheepfoldService.deleteDaSheepfoldByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/sheepfold_management/domain/DaSheepfold.java b/zhyc-module/src/main/java/com/zhyc/module/sheepfold_management/domain/DaSheepfold.java new file mode 100644 index 0000000..ab1319e --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/sheepfold_management/domain/DaSheepfold.java @@ -0,0 +1,143 @@ +package com.zhyc.module.sheepfold_management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 羊舍管理对象 da_sheepfold + * + * @author wyt + * @date 2025-07-11 + */ +public class DaSheepfold extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 羊舍id */ + @Excel(name = "羊舍id") + private Long id; + + /** 牧场 */ + @Excel(name = "牧场") + private Long ranchId; + + /** 羊舍名称 */ + @Excel(name = "羊舍名称") + private String sheepfoldName; + + /** 羊舍类型id */ + @Excel(name = "羊舍类型id") + private Long sheepfoldTypeId; + + /** 羊舍编号 */ + @Excel(name = "羊舍编号") + private String sheepfoldNo; + + /** 排号 */ + @Excel(name = "排号") + private String rowNo; + + /** 栏数 */ + @Excel(name = "栏数") + private String columns; + + /** 备注 */ + @Excel(name = "备注") + private String comment; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public void setRanchId(Long ranchId) + { + this.ranchId = ranchId; + } + + public Long getRanchId() + { + return ranchId; + } + + public void setSheepfoldName(String sheepfoldName) + { + this.sheepfoldName = sheepfoldName; + } + + public String getSheepfoldName() + { + return sheepfoldName; + } + + public void setSheepfoldTypeId(Long sheepfoldTypeId) + { + this.sheepfoldTypeId = sheepfoldTypeId; + } + + public Long getSheepfoldTypeId() + { + return sheepfoldTypeId; + } + + public void setSheepfoldNo(String sheepfoldNo) + { + this.sheepfoldNo = sheepfoldNo; + } + + public String getSheepfoldNo() + { + return sheepfoldNo; + } + + public void setRowNo(String rowNo) + { + this.rowNo = rowNo; + } + + public String getRowNo() + { + return rowNo; + } + + public void setColumns(String columns) + { + this.columns = columns; + } + + public String getColumns() + { + return columns; + } + + public void setComment(String comment) + { + this.comment = comment; + } + + public String getComment() + { + return comment; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("ranchId", getRanchId()) + .append("sheepfoldName", getSheepfoldName()) + .append("sheepfoldTypeId", getSheepfoldTypeId()) + .append("sheepfoldNo", getSheepfoldNo()) + .append("rowNo", getRowNo()) + .append("columns", getColumns()) + .append("comment", getComment()) + .toString(); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/sheepfold_management/mapper/DaSheepfoldMapper.java b/zhyc-module/src/main/java/com/zhyc/module/sheepfold_management/mapper/DaSheepfoldMapper.java new file mode 100644 index 0000000..f89504a --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/sheepfold_management/mapper/DaSheepfoldMapper.java @@ -0,0 +1,61 @@ +package com.zhyc.module.sheepfold_management.mapper; + +import java.util.List; +import com.zhyc.module.sheepfold_management.domain.DaSheepfold; + +/** + * 羊舍管理Mapper接口 + * + * @author wyt + * @date 2025-07-11 + */ +public interface DaSheepfoldMapper +{ + /** + * 查询羊舍管理 + * + * @param id 羊舍管理主键 + * @return 羊舍管理 + */ + public DaSheepfold selectDaSheepfoldById(Long id); + + /** + * 查询羊舍管理列表 + * + * @param daSheepfold 羊舍管理 + * @return 羊舍管理集合 + */ + public List selectDaSheepfoldList(DaSheepfold daSheepfold); + + /** + * 新增羊舍管理 + * + * @param daSheepfold 羊舍管理 + * @return 结果 + */ + public int insertDaSheepfold(DaSheepfold daSheepfold); + + /** + * 修改羊舍管理 + * + * @param daSheepfold 羊舍管理 + * @return 结果 + */ + public int updateDaSheepfold(DaSheepfold daSheepfold); + + /** + * 删除羊舍管理 + * + * @param id 羊舍管理主键 + * @return 结果 + */ + public int deleteDaSheepfoldById(Long id); + + /** + * 批量删除羊舍管理 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteDaSheepfoldByIds(Long[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/sheepfold_management/service/IDaSheepfoldService.java b/zhyc-module/src/main/java/com/zhyc/module/sheepfold_management/service/IDaSheepfoldService.java new file mode 100644 index 0000000..84e0190 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/sheepfold_management/service/IDaSheepfoldService.java @@ -0,0 +1,61 @@ +package com.zhyc.module.sheepfold_management.service; + +import java.util.List; +import com.zhyc.module.sheepfold_management.domain.DaSheepfold; + +/** + * 羊舍管理Service接口 + * + * @author wyt + * @date 2025-07-11 + */ +public interface IDaSheepfoldService +{ + /** + * 查询羊舍管理 + * + * @param id 羊舍管理主键 + * @return 羊舍管理 + */ + public DaSheepfold selectDaSheepfoldById(Long id); + + /** + * 查询羊舍管理列表 + * + * @param daSheepfold 羊舍管理 + * @return 羊舍管理集合 + */ + public List selectDaSheepfoldList(DaSheepfold daSheepfold); + + /** + * 新增羊舍管理 + * + * @param daSheepfold 羊舍管理 + * @return 结果 + */ + public int insertDaSheepfold(DaSheepfold daSheepfold); + + /** + * 修改羊舍管理 + * + * @param daSheepfold 羊舍管理 + * @return 结果 + */ + public int updateDaSheepfold(DaSheepfold daSheepfold); + + /** + * 批量删除羊舍管理 + * + * @param ids 需要删除的羊舍管理主键集合 + * @return 结果 + */ + public int deleteDaSheepfoldByIds(Long[] ids); + + /** + * 删除羊舍管理信息 + * + * @param id 羊舍管理主键 + * @return 结果 + */ + public int deleteDaSheepfoldById(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/sheepfold_management/service/impl/DaSheepfoldServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/sheepfold_management/service/impl/DaSheepfoldServiceImpl.java new file mode 100644 index 0000000..019cf55 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/sheepfold_management/service/impl/DaSheepfoldServiceImpl.java @@ -0,0 +1,93 @@ +package com.zhyc.module.sheepfold_management.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.zhyc.module.sheepfold_management.mapper.DaSheepfoldMapper; +import com.zhyc.module.sheepfold_management.domain.DaSheepfold; +import com.zhyc.module.sheepfold_management.service.IDaSheepfoldService; + +/** + * 羊舍管理Service业务层处理 + * + * @author wyt + * @date 2025-07-11 + */ +@Service +public class DaSheepfoldServiceImpl implements IDaSheepfoldService +{ + @Autowired + private DaSheepfoldMapper daSheepfoldMapper; + + /** + * 查询羊舍管理 + * + * @param id 羊舍管理主键 + * @return 羊舍管理 + */ + @Override + public DaSheepfold selectDaSheepfoldById(Long id) + { + return daSheepfoldMapper.selectDaSheepfoldById(id); + } + + /** + * 查询羊舍管理列表 + * + * @param daSheepfold 羊舍管理 + * @return 羊舍管理 + */ + @Override + public List selectDaSheepfoldList(DaSheepfold daSheepfold) + { + return daSheepfoldMapper.selectDaSheepfoldList(daSheepfold); + } + + /** + * 新增羊舍管理 + * + * @param daSheepfold 羊舍管理 + * @return 结果 + */ + @Override + public int insertDaSheepfold(DaSheepfold daSheepfold) + { + return daSheepfoldMapper.insertDaSheepfold(daSheepfold); + } + + /** + * 修改羊舍管理 + * + * @param daSheepfold 羊舍管理 + * @return 结果 + */ + @Override + public int updateDaSheepfold(DaSheepfold daSheepfold) + { + return daSheepfoldMapper.updateDaSheepfold(daSheepfold); + } + + /** + * 批量删除羊舍管理 + * + * @param ids 需要删除的羊舍管理主键 + * @return 结果 + */ + @Override + public int deleteDaSheepfoldByIds(Long[] ids) + { + return daSheepfoldMapper.deleteDaSheepfoldByIds(ids); + } + + /** + * 删除羊舍管理信息 + * + * @param id 羊舍管理主键 + * @return 结果 + */ + @Override + public int deleteDaSheepfoldById(Long id) + { + return daSheepfoldMapper.deleteDaSheepfoldById(id); + } +} diff --git a/zhyc-module/src/main/resources/mapper/sheep_file/BasSheepMapper.xml b/zhyc-module/src/main/resources/mapper/sheep_file/BasSheepMapper.xml new file mode 100644 index 0000000..1716dd3 --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/sheep_file/BasSheepMapper.xml @@ -0,0 +1,242 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, manage_tags, ranch_id, sheepfold_id, electronic_tags, variety_id, family, type_id, gender, birthday, birth_weight, parity, status_id, weaning_date, weaning_weight, breed_status_id, father_id, mother_id, receptor_id, mating_date, mating_type_id, preg_date, lambing_date, lambing_day, expected_date, controlled, mating_counts, mating_total, miscarriage_counts, body, breast, source, soure_date, source_ranch_id, comment, update_by, update_time, create_by, create_time, is_delete from bas_sheep + + + + + + + + insert into bas_sheep + + manage_tags, + ranch_id, + sheepfold_id, + electronic_tags, + variety_id, + family, + type_id, + gender, + birthday, + birth_weight, + parity, + status_id, + weaning_date, + weaning_weight, + breed_status_id, + father_id, + mother_id, + receptor_id, + mating_date, + mating_type_id, + preg_date, + lambing_date, + lambing_day, + expected_date, + controlled, + mating_counts, + mating_total, + miscarriage_counts, + body, + breast, + source, + soure_date, + source_ranch_id, + comment, + update_by, + update_time, + create_by, + create_time, + is_delete, + + + #{manageTags}, + #{ranchId}, + #{sheepfoldId}, + #{electronicTags}, + #{varietyId}, + #{family}, + #{typeId}, + #{gender}, + #{birthday}, + #{birthWeight}, + #{parity}, + #{statusId}, + #{weaningDate}, + #{weaningWeight}, + #{breedStatusId}, + #{fatherId}, + #{motherId}, + #{receptorId}, + #{matingDate}, + #{matingTypeId}, + #{pregDate}, + #{lambingDate}, + #{lambingDay}, + #{expectedDate}, + #{controlled}, + #{matingCounts}, + #{matingTotal}, + #{miscarriageCounts}, + #{body}, + #{breast}, + #{source}, + #{soureDate}, + #{sourceRanchId}, + #{comment}, + #{updateBy}, + #{updateTime}, + #{createBy}, + #{createTime}, + #{isDelete}, + + + + + update bas_sheep + + manage_tags = #{manageTags}, + ranch_id = #{ranchId}, + sheepfold_id = #{sheepfoldId}, + electronic_tags = #{electronicTags}, + variety_id = #{varietyId}, + family = #{family}, + type_id = #{typeId}, + gender = #{gender}, + birthday = #{birthday}, + birth_weight = #{birthWeight}, + parity = #{parity}, + status_id = #{statusId}, + weaning_date = #{weaningDate}, + weaning_weight = #{weaningWeight}, + breed_status_id = #{breedStatusId}, + father_id = #{fatherId}, + mother_id = #{motherId}, + receptor_id = #{receptorId}, + mating_date = #{matingDate}, + mating_type_id = #{matingTypeId}, + preg_date = #{pregDate}, + lambing_date = #{lambingDate}, + lambing_day = #{lambingDay}, + expected_date = #{expectedDate}, + controlled = #{controlled}, + mating_counts = #{matingCounts}, + mating_total = #{matingTotal}, + miscarriage_counts = #{miscarriageCounts}, + body = #{body}, + breast = #{breast}, + source = #{source}, + soure_date = #{soureDate}, + source_ranch_id = #{sourceRanchId}, + comment = #{comment}, + update_by = #{updateBy}, + update_time = #{updateTime}, + create_by = #{createBy}, + create_time = #{createTime}, + is_delete = #{isDelete}, + + where id = #{id} + + + + delete from bas_sheep where id = #{id} + + + + delete from bas_sheep where id in + + #{id} + + + \ No newline at end of file diff --git a/zhyc-module/src/main/resources/mapper/sheepfold_management/DaSheepfoldMapper.xml b/zhyc-module/src/main/resources/mapper/sheepfold_management/DaSheepfoldMapper.xml new file mode 100644 index 0000000..434206b --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/sheepfold_management/DaSheepfoldMapper.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + select id, ranch_id, sheepfold_name, sheepfold_type_id, sheepfold_no, row_no, columns, comment from da_sheepfold + + + + + + + + insert into da_sheepfold + + ranch_id, + sheepfold_name, + sheepfold_type_id, + sheepfold_no, + row_no, + columns, + comment, + + + #{ranchId}, + #{sheepfoldName}, + #{sheepfoldTypeId}, + #{sheepfoldNo}, + #{rowNo}, + #{columns}, + #{comment}, + + + + + update da_sheepfold + + ranch_id = #{ranchId}, + sheepfold_name = #{sheepfoldName}, + sheepfold_type_id = #{sheepfoldTypeId}, + sheepfold_no = #{sheepfoldNo}, + row_no = #{rowNo}, + columns = #{columns}, + comment = #{comment}, + + where id = #{id} + + + + delete from da_sheepfold where id = #{id} + + + + delete from da_sheepfold where id in + + #{id} + + + \ No newline at end of file