diff --git a/zhyc-module/pom.xml b/zhyc-module/pom.xml index a0b435f..a3a00b5 100644 --- a/zhyc-module/pom.xml +++ b/zhyc-module/pom.xml @@ -20,6 +20,8 @@ org.projectlombok lombok + 1.18.38 + provided diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/variety/controller/BasSheepVarietyController.java b/zhyc-module/src/main/java/com/zhyc/module/base/variety/controller/BasSheepVarietyController.java new file mode 100644 index 0000000..1c24dfa --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/variety/controller/BasSheepVarietyController.java @@ -0,0 +1,104 @@ +package com.zhyc.module.base.variety.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.base.variety.domain.BasSheepVariety; +import com.zhyc.module.base.variety.service.IBasSheepVarietyService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 羊只品种Controller + * + * @author ruoyi + * @date 2025-07-15 + */ +@RestController +@RequestMapping("/base/variety") +public class BasSheepVarietyController extends BaseController +{ + @Autowired + private IBasSheepVarietyService basSheepVarietyService; + + /** + * 查询羊只品种列表 + */ + @PreAuthorize("@ss.hasPermi('base:variety:list')") + @GetMapping("/list") + public TableDataInfo list(BasSheepVariety basSheepVariety) + { + startPage(); + List list = basSheepVarietyService.selectBasSheepVarietyList(basSheepVariety); + return getDataTable(list); + } + + /** + * 导出羊只品种列表 + */ + @PreAuthorize("@ss.hasPermi('base:variety:export')") + @Log(title = "羊只品种", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, BasSheepVariety basSheepVariety) + { + List list = basSheepVarietyService.selectBasSheepVarietyList(basSheepVariety); + ExcelUtil util = new ExcelUtil(BasSheepVariety.class); + util.exportExcel(response, list, "羊只品种数据"); + } + + /** + * 获取羊只品种详细信息 + */ + @PreAuthorize("@ss.hasPermi('base:variety:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(basSheepVarietyService.selectBasSheepVarietyById(id)); + } + + /** + * 新增羊只品种 + */ + @PreAuthorize("@ss.hasPermi('base:variety:add')") + @Log(title = "羊只品种", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody BasSheepVariety basSheepVariety) + { + return toAjax(basSheepVarietyService.insertBasSheepVariety(basSheepVariety)); + } + + /** + * 修改羊只品种 + */ + @PreAuthorize("@ss.hasPermi('base:variety:edit')") + @Log(title = "羊只品种", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody BasSheepVariety basSheepVariety) + { + return toAjax(basSheepVarietyService.updateBasSheepVariety(basSheepVariety)); + } + + /** + * 删除羊只品种 + */ + @PreAuthorize("@ss.hasPermi('base:variety:remove')") + @Log(title = "羊只品种", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(basSheepVarietyService.deleteBasSheepVarietyByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/variety/domain/BasSheepVariety.java b/zhyc-module/src/main/java/com/zhyc/module/base/variety/domain/BasSheepVariety.java new file mode 100644 index 0000000..35a541a --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/variety/domain/BasSheepVariety.java @@ -0,0 +1,52 @@ +package com.zhyc.module.base.variety.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; + +/** + * 羊只品种对象 bas_sheep_variety + * + * @author ruoyi + * @date 2025-07-15 + */ +public class BasSheepVariety extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + /** 品种 */ + @Excel(name = "品种") + private String variety; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public void setVariety(String variety) + { + this.variety = variety; + } + + public String getVariety() + { + return variety; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("variety", getVariety()) + .toString(); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/variety/mapper/BasSheepVarietyMapper.java b/zhyc-module/src/main/java/com/zhyc/module/base/variety/mapper/BasSheepVarietyMapper.java new file mode 100644 index 0000000..02927cb --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/variety/mapper/BasSheepVarietyMapper.java @@ -0,0 +1,61 @@ +package com.zhyc.module.base.variety.mapper; + +import java.util.List; +import com.zhyc.module.base.variety.domain.BasSheepVariety; + +/** + * 羊只品种Mapper接口 + * + * @author ruoyi + * @date 2025-07-15 + */ +public interface BasSheepVarietyMapper +{ + /** + * 查询羊只品种 + * + * @param id 羊只品种主键 + * @return 羊只品种 + */ + public BasSheepVariety selectBasSheepVarietyById(Long id); + + /** + * 查询羊只品种列表 + * + * @param basSheepVariety 羊只品种 + * @return 羊只品种集合 + */ + public List selectBasSheepVarietyList(BasSheepVariety basSheepVariety); + + /** + * 新增羊只品种 + * + * @param basSheepVariety 羊只品种 + * @return 结果 + */ + public int insertBasSheepVariety(BasSheepVariety basSheepVariety); + + /** + * 修改羊只品种 + * + * @param basSheepVariety 羊只品种 + * @return 结果 + */ + public int updateBasSheepVariety(BasSheepVariety basSheepVariety); + + /** + * 删除羊只品种 + * + * @param id 羊只品种主键 + * @return 结果 + */ + public int deleteBasSheepVarietyById(Long id); + + /** + * 批量删除羊只品种 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteBasSheepVarietyByIds(Long[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/variety/service/IBasSheepVarietyService.java b/zhyc-module/src/main/java/com/zhyc/module/base/variety/service/IBasSheepVarietyService.java new file mode 100644 index 0000000..f2fc713 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/variety/service/IBasSheepVarietyService.java @@ -0,0 +1,61 @@ +package com.zhyc.module.base.variety.service; + +import java.util.List; +import com.zhyc.module.base.variety.domain.BasSheepVariety; + +/** + * 羊只品种Service接口 + * + * @author ruoyi + * @date 2025-07-15 + */ +public interface IBasSheepVarietyService +{ + /** + * 查询羊只品种 + * + * @param id 羊只品种主键 + * @return 羊只品种 + */ + public BasSheepVariety selectBasSheepVarietyById(Long id); + + /** + * 查询羊只品种列表 + * + * @param basSheepVariety 羊只品种 + * @return 羊只品种集合 + */ + public List selectBasSheepVarietyList(BasSheepVariety basSheepVariety); + + /** + * 新增羊只品种 + * + * @param basSheepVariety 羊只品种 + * @return 结果 + */ + public int insertBasSheepVariety(BasSheepVariety basSheepVariety); + + /** + * 修改羊只品种 + * + * @param basSheepVariety 羊只品种 + * @return 结果 + */ + public int updateBasSheepVariety(BasSheepVariety basSheepVariety); + + /** + * 批量删除羊只品种 + * + * @param ids 需要删除的羊只品种主键集合 + * @return 结果 + */ + public int deleteBasSheepVarietyByIds(Long[] ids); + + /** + * 删除羊只品种信息 + * + * @param id 羊只品种主键 + * @return 结果 + */ + public int deleteBasSheepVarietyById(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/variety/service/impl/BasSheepVarietyServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/base/variety/service/impl/BasSheepVarietyServiceImpl.java new file mode 100644 index 0000000..beacc22 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/variety/service/impl/BasSheepVarietyServiceImpl.java @@ -0,0 +1,93 @@ +package com.zhyc.module.base.variety.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.zhyc.module.base.variety.mapper.BasSheepVarietyMapper; +import com.zhyc.module.base.variety.domain.BasSheepVariety; +import com.zhyc.module.base.variety.service.IBasSheepVarietyService; + +/** + * 羊只品种Service业务层处理 + * + * @author ruoyi + * @date 2025-07-15 + */ +@Service +public class BasSheepVarietyServiceImpl implements IBasSheepVarietyService +{ + @Autowired + private BasSheepVarietyMapper basSheepVarietyMapper; + + /** + * 查询羊只品种 + * + * @param id 羊只品种主键 + * @return 羊只品种 + */ + @Override + public BasSheepVariety selectBasSheepVarietyById(Long id) + { + return basSheepVarietyMapper.selectBasSheepVarietyById(id); + } + + /** + * 查询羊只品种列表 + * + * @param basSheepVariety 羊只品种 + * @return 羊只品种 + */ + @Override + public List selectBasSheepVarietyList(BasSheepVariety basSheepVariety) + { + return basSheepVarietyMapper.selectBasSheepVarietyList(basSheepVariety); + } + + /** + * 新增羊只品种 + * + * @param basSheepVariety 羊只品种 + * @return 结果 + */ + @Override + public int insertBasSheepVariety(BasSheepVariety basSheepVariety) + { + return basSheepVarietyMapper.insertBasSheepVariety(basSheepVariety); + } + + /** + * 修改羊只品种 + * + * @param basSheepVariety 羊只品种 + * @return 结果 + */ + @Override + public int updateBasSheepVariety(BasSheepVariety basSheepVariety) + { + return basSheepVarietyMapper.updateBasSheepVariety(basSheepVariety); + } + + /** + * 批量删除羊只品种 + * + * @param ids 需要删除的羊只品种主键 + * @return 结果 + */ + @Override + public int deleteBasSheepVarietyByIds(Long[] ids) + { + return basSheepVarietyMapper.deleteBasSheepVarietyByIds(ids); + } + + /** + * 删除羊只品种信息 + * + * @param id 羊只品种主键 + * @return 结果 + */ + @Override + public int deleteBasSheepVarietyById(Long id) + { + return basSheepVarietyMapper.deleteBasSheepVarietyById(id); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/DewormController.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/DewormController.java new file mode 100644 index 0000000..6b88da7 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/DewormController.java @@ -0,0 +1,105 @@ +package com.zhyc.module.biosafety.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.zhyc.module.biosafety.domain.Deworm; +import com.zhyc.module.biosafety.service.IDewormService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.zhyc.common.annotation.Log; +import com.zhyc.common.core.controller.BaseController; +import com.zhyc.common.core.domain.AjaxResult; +import com.zhyc.common.enums.BusinessType; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 驱虫Controller + * + * @author ruoyi + * @date 2025-07-15 + */ +@RestController +@RequestMapping("/biosafety/deworm") +public class DewormController extends BaseController +{ + @Autowired + private IDewormService dewormService; + + /** + * 查询驱虫列表 + */ + @PreAuthorize("@ss.hasPermi('biosafety:deworm:list')") + @GetMapping("/list") + public TableDataInfo list(Deworm deworm) + { + startPage(); + List list = dewormService.selectDewormList(deworm); + return getDataTable(list); + } + + /** + * 导出驱虫列表 + */ + @PreAuthorize("@ss.hasPermi('biosafety:deworm:export')") + @Log(title = "驱虫", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, Deworm deworm) + { + List list = dewormService.selectDewormList(deworm); + ExcelUtil util = new ExcelUtil(Deworm.class); + util.exportExcel(response, list, "驱虫数据"); + } + + /** + * 获取驱虫详细信息 + */ + @PreAuthorize("@ss.hasPermi('biosafety:deworm:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(dewormService.selectDewormById(id)); + } + + /** + * 新增驱虫 + */ + @PreAuthorize("@ss.hasPermi('biosafety:deworm:add')") + @Log(title = "驱虫", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody Deworm deworm) + { + return toAjax(dewormService.insertDeworm(deworm)); + } + + /** + * 修改驱虫 + */ + @PreAuthorize("@ss.hasPermi('biosafety:deworm:edit')") + @Log(title = "驱虫", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody Deworm deworm) + { + return toAjax(dewormService.updateDeworm(deworm)); + } + + /** + * 删除驱虫 + */ + @PreAuthorize("@ss.hasPermi('biosafety:deworm:remove')") + @Log(title = "驱虫", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(dewormService.deleteDewormByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/DiagnosisController.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/DiagnosisController.java new file mode 100644 index 0000000..d8138a2 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/DiagnosisController.java @@ -0,0 +1,104 @@ +package com.zhyc.module.biosafety.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.biosafety.domain.Diagnosis; +import com.zhyc.module.biosafety.service.IDiagnosisService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 诊疗结果Controller + * + * @author ruoyi + * @date 2025-07-15 + */ +@RestController +@RequestMapping("/diagnosis/diagnosis") +public class DiagnosisController extends BaseController +{ + @Autowired + private IDiagnosisService diagnosisService; + + /** + * 查询诊疗结果列表 + */ + @PreAuthorize("@ss.hasPermi('diagnosis:diagnosis:list')") + @GetMapping("/list") + public TableDataInfo list(Diagnosis diagnosis) + { + startPage(); + List list = diagnosisService.selectDiagnosisList(diagnosis); + return getDataTable(list); + } + + /** + * 导出诊疗结果列表 + */ + @PreAuthorize("@ss.hasPermi('diagnosis:diagnosis:export')") + @Log(title = "诊疗结果", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, Diagnosis diagnosis) + { + List list = diagnosisService.selectDiagnosisList(diagnosis); + ExcelUtil util = new ExcelUtil(Diagnosis.class); + util.exportExcel(response, list, "诊疗结果数据"); + } + + /** + * 获取诊疗结果详细信息 + */ + @PreAuthorize("@ss.hasPermi('diagnosis:diagnosis:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(diagnosisService.selectDiagnosisById(id)); + } + + /** + * 新增诊疗结果 + */ + @PreAuthorize("@ss.hasPermi('diagnosis:diagnosis:add')") + @Log(title = "诊疗结果", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody Diagnosis diagnosis) + { + return toAjax(diagnosisService.insertDiagnosis(diagnosis)); + } + + /** + * 修改诊疗结果 + */ + @PreAuthorize("@ss.hasPermi('diagnosis:diagnosis:edit')") + @Log(title = "诊疗结果", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody Diagnosis diagnosis) + { + return toAjax(diagnosisService.updateDiagnosis(diagnosis)); + } + + /** + * 删除诊疗结果 + */ + @PreAuthorize("@ss.hasPermi('diagnosis:diagnosis:remove')") + @Log(title = "诊疗结果", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(diagnosisService.deleteDiagnosisByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/DisinfectController.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/DisinfectController.java new file mode 100644 index 0000000..7e2f934 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/DisinfectController.java @@ -0,0 +1,105 @@ +package com.zhyc.module.biosafety.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.zhyc.module.biosafety.service.IDisinfectService; +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.biosafety.domain.Disinfect; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 消毒记录Controller + * + * @author ruoyi + * @date 2025-07-15 + */ +@RestController +@RequestMapping("/biosafety/disinfect") +public class DisinfectController extends BaseController +{ + @Autowired + private IDisinfectService disinfectService; + + /** + * 查询消毒记录列表 + */ + @PreAuthorize("@ss.hasPermi('biosafety:disinfect:list')") + @GetMapping("/list") + public TableDataInfo list(Disinfect disinfect) + { + startPage(); + List list = disinfectService.selectDisinfectList(disinfect); + return getDataTable(list); + } + + /** + * 导出消毒记录列表 + */ + @PreAuthorize("@ss.hasPermi('biosafety:disinfect:export')") + @Log(title = "消毒记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, Disinfect disinfect) + { + List list = disinfectService.selectDisinfectList(disinfect); + ExcelUtil util = new ExcelUtil(Disinfect.class); + util.exportExcel(response, list, "消毒记录数据"); + } + + /** + * 获取消毒记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('biosafety:disinfect:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(disinfectService.selectDisinfectById(id)); + } + + /** + * 新增消毒记录 + */ + @PreAuthorize("@ss.hasPermi('biosafety:disinfect:add')") + @Log(title = "消毒记录", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody Disinfect disinfect) + { + return toAjax(disinfectService.insertDisinfect(disinfect)); + } + + /** + * 修改消毒记录 + */ + @PreAuthorize("@ss.hasPermi('biosafety:disinfect:edit')") + @Log(title = "消毒记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody Disinfect disinfect) + { + return toAjax(disinfectService.updateDisinfect(disinfect)); + } + + /** + * 删除消毒记录 + */ + @PreAuthorize("@ss.hasPermi('biosafety:disinfect:remove')") + @Log(title = "消毒记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(disinfectService.deleteDisinfectByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/HealthController.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/HealthController.java new file mode 100644 index 0000000..5795ca8 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/HealthController.java @@ -0,0 +1,105 @@ +package com.zhyc.module.biosafety.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.zhyc.module.biosafety.service.IHealthService; +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.biosafety.domain.Health; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 保健Controller + * + * @author ruoyi + * @date 2025-07-15 + */ +@RestController +@RequestMapping("/biosafety/health") +public class HealthController extends BaseController +{ + @Autowired + private IHealthService healthService; + + /** + * 查询保健列表 + */ + @PreAuthorize("@ss.hasPermi('biosafety:health:list')") + @GetMapping("/list") + public TableDataInfo list(Health health) + { + startPage(); + List list = healthService.selectHealthList(health); + return getDataTable(list); + } + + /** + * 导出保健列表 + */ + @PreAuthorize("@ss.hasPermi('biosafety:health:export')") + @Log(title = "保健", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, Health health) + { + List list = healthService.selectHealthList(health); + ExcelUtil util = new ExcelUtil(Health.class); + util.exportExcel(response, list, "保健数据"); + } + + /** + * 获取保健详细信息 + */ + @PreAuthorize("@ss.hasPermi('biosafety:health:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(healthService.selectHealthById(id)); + } + + /** + * 新增保健 + */ + @PreAuthorize("@ss.hasPermi('biosafety:health:add')") + @Log(title = "保健", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody Health health) + { + return toAjax(healthService.insertHealth(health)); + } + + /** + * 修改保健 + */ + @PreAuthorize("@ss.hasPermi('biosafety:health:edit')") + @Log(title = "保健", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody Health health) + { + return toAjax(healthService.updateHealth(health)); + } + + /** + * 删除保健 + */ + @PreAuthorize("@ss.hasPermi('biosafety:health:remove')") + @Log(title = "保健", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(healthService.deleteHealthByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/ImmunityController.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/ImmunityController.java new file mode 100644 index 0000000..f49376c --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/ImmunityController.java @@ -0,0 +1,105 @@ +package com.zhyc.module.biosafety.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.zhyc.module.biosafety.service.IImmunityService; +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.biosafety.domain.Immunity; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 免疫Controller + * + * @author ruoyi + * @date 2025-07-15 + */ +@RestController +@RequestMapping("/biosafety/immunity") +public class ImmunityController extends BaseController +{ + @Autowired + private IImmunityService immunityService; + + /** + * 查询免疫列表 + */ + @PreAuthorize("@ss.hasPermi('biosafety:immunity:list')") + @GetMapping("/list") + public TableDataInfo list(Immunity immunity) + { + startPage(); + List list = immunityService.selectImmunityList(immunity); + return getDataTable(list); + } + + /** + * 导出免疫列表 + */ + @PreAuthorize("@ss.hasPermi('biosafety:immunity:export')") + @Log(title = "免疫", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, Immunity immunity) + { + List list = immunityService.selectImmunityList(immunity); + ExcelUtil util = new ExcelUtil(Immunity.class); + util.exportExcel(response, list, "免疫数据"); + } + + /** + * 获取免疫详细信息 + */ + @PreAuthorize("@ss.hasPermi('biosafety:immunity:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(immunityService.selectImmunityById(id)); + } + + /** + * 新增免疫 + */ + @PreAuthorize("@ss.hasPermi('biosafety:immunity:add')") + @Log(title = "免疫", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody Immunity immunity) + { + return toAjax(immunityService.insertImmunity(immunity)); + } + + /** + * 修改免疫 + */ + @PreAuthorize("@ss.hasPermi('biosafety:immunity:edit')") + @Log(title = "免疫", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody Immunity immunity) + { + return toAjax(immunityService.updateImmunity(immunity)); + } + + /** + * 删除免疫 + */ + @PreAuthorize("@ss.hasPermi('biosafety:immunity:remove')") + @Log(title = "免疫", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(immunityService.deleteImmunityByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/QuarantineItemsController.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/QuarantineItemsController.java new file mode 100644 index 0000000..3c1694a --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/QuarantineItemsController.java @@ -0,0 +1,105 @@ +package com.zhyc.module.biosafety.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.zhyc.module.biosafety.domain.QuarantineItems; +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.biosafety.service.IQuarantineItemsService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 检疫项目Controller + * + * @author ruoyi + * @date 2025-07-14 + */ +@RestController +@RequestMapping("/biosafety/items") +public class QuarantineItemsController extends BaseController +{ + @Autowired + private IQuarantineItemsService quarantineItemsService; + + /** + * 查询检疫项目列表 + */ + @PreAuthorize("@ss.hasPermi('biosafety:items:list')") + @GetMapping("/list") + public TableDataInfo list(QuarantineItems quarantineItems) + { + startPage(); + List list = quarantineItemsService.selectQuarantineItemsList(quarantineItems); + return getDataTable(list); + } + + /** + * 导出检疫项目列表 + */ + @PreAuthorize("@ss.hasPermi('biosafety:items:export')") + @Log(title = "检疫项目", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, QuarantineItems quarantineItems) + { + List list = quarantineItemsService.selectQuarantineItemsList(quarantineItems); + ExcelUtil util = new ExcelUtil(QuarantineItems.class); + util.exportExcel(response, list, "检疫项目数据"); + } + + /** + * 获取检疫项目详细信息 + */ + @PreAuthorize("@ss.hasPermi('biosafety:items:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(quarantineItemsService.selectQuarantineItemsById(id)); + } + + /** + * 新增检疫项目 + */ + @PreAuthorize("@ss.hasPermi('biosafety:items:add')") + @Log(title = "检疫项目", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody QuarantineItems quarantineItems) + { + return toAjax(quarantineItemsService.insertQuarantineItems(quarantineItems)); + } + + /** + * 修改检疫项目 + */ + @PreAuthorize("@ss.hasPermi('biosafety:items:edit')") + @Log(title = "检疫项目", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody QuarantineItems quarantineItems) + { + return toAjax(quarantineItemsService.updateQuarantineItems(quarantineItems)); + } + + /** + * 删除检疫项目 + */ + @PreAuthorize("@ss.hasPermi('biosafety:items:remove')") + @Log(title = "检疫项目", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(quarantineItemsService.deleteQuarantineItemsByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/QuarantineReportController.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/QuarantineReportController.java new file mode 100644 index 0000000..5c6847e --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/QuarantineReportController.java @@ -0,0 +1,105 @@ +package com.zhyc.module.biosafety.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.zhyc.module.biosafety.domain.QuarantineReport; +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.biosafety.service.IQuarantineReportService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 检疫记录Controller + * + * @author ruoyi + * @date 2025-07-14 + */ +@RestController +@RequestMapping("/bisosafety/quarantine") +public class QuarantineReportController extends BaseController +{ + @Autowired + private IQuarantineReportService quarantineReportService; + + /** + * 查询检疫记录列表 + */ + @PreAuthorize("@ss.hasPermi('bisosafety:quarantine:list')") + @GetMapping("/list") + public TableDataInfo list(QuarantineReport quarantineReport) + { + startPage(); + List list = quarantineReportService.selectQuarantineReportList(quarantineReport); + return getDataTable(list); + } + + /** + * 导出检疫记录列表 + */ + @PreAuthorize("@ss.hasPermi('bisosafety:quarantine:export')") + @Log(title = "检疫记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, QuarantineReport quarantineReport) + { + List list = quarantineReportService.selectQuarantineReportList(quarantineReport); + ExcelUtil util = new ExcelUtil(QuarantineReport.class); + util.exportExcel(response, list, "检疫记录数据"); + } + + /** + * 获取检疫记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('bisosafety:quarantine:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(quarantineReportService.selectQuarantineReportById(id)); + } + + /** + * 新增检疫记录 + */ + @PreAuthorize("@ss.hasPermi('bisosafety:quarantine:add')") + @Log(title = "检疫记录", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody QuarantineReport quarantineReport) + { + return toAjax(quarantineReportService.insertQuarantineReport(quarantineReport)); + } + + /** + * 修改检疫记录 + */ + @PreAuthorize("@ss.hasPermi('bisosafety:quarantine:edit')") + @Log(title = "检疫记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody QuarantineReport quarantineReport) + { + return toAjax(quarantineReportService.updateQuarantineReport(quarantineReport)); + } + + /** + * 删除检疫记录 + */ + @PreAuthorize("@ss.hasPermi('bisosafety:quarantine:remove')") + @Log(title = "检疫记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(quarantineReportService.deleteQuarantineReportByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/QuarantineSampleController.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/QuarantineSampleController.java new file mode 100644 index 0000000..439d3fb --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/QuarantineSampleController.java @@ -0,0 +1,105 @@ +package com.zhyc.module.biosafety.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.zhyc.module.biosafety.domain.QuarantineSample; +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.biosafety.service.IQuarantineSampleService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 样品类型Controller + * + * @author ruoyi + * @date 2025-07-14 + */ +@RestController +@RequestMapping("/biosafety/sample") +public class QuarantineSampleController extends BaseController +{ + @Autowired + private IQuarantineSampleService quarantineSampleService; + + /** + * 查询样品类型列表 + */ + @PreAuthorize("@ss.hasPermi('biosafety:sample:list')") + @GetMapping("/list") + public TableDataInfo list(QuarantineSample quarantineSample) + { + startPage(); + List list = quarantineSampleService.selectQuarantineSampleList(quarantineSample); + return getDataTable(list); + } + + /** + * 导出样品类型列表 + */ + @PreAuthorize("@ss.hasPermi('biosafety:sample:export')") + @Log(title = "样品类型", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, QuarantineSample quarantineSample) + { + List list = quarantineSampleService.selectQuarantineSampleList(quarantineSample); + ExcelUtil util = new ExcelUtil(QuarantineSample.class); + util.exportExcel(response, list, "样品类型数据"); + } + + /** + * 获取样品类型详细信息 + */ + @PreAuthorize("@ss.hasPermi('biosafety:sample:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(quarantineSampleService.selectQuarantineSampleById(id)); + } + + /** + * 新增样品类型 + */ + @PreAuthorize("@ss.hasPermi('biosafety:sample:add')") + @Log(title = "样品类型", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody QuarantineSample quarantineSample) + { + return toAjax(quarantineSampleService.insertQuarantineSample(quarantineSample)); + } + + /** + * 修改样品类型 + */ + @PreAuthorize("@ss.hasPermi('biosafety:sample:edit')") + @Log(title = "样品类型", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody QuarantineSample quarantineSample) + { + return toAjax(quarantineSampleService.updateQuarantineSample(quarantineSample)); + } + + /** + * 删除样品类型 + */ + @PreAuthorize("@ss.hasPermi('biosafety:sample:remove')") + @Log(title = "样品类型", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(quarantineSampleService.deleteQuarantineSampleByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/TreatmentController.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/TreatmentController.java new file mode 100644 index 0000000..0e7605e --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/TreatmentController.java @@ -0,0 +1,105 @@ +package com.zhyc.module.biosafety.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.zhyc.module.biosafety.domain.Treatment; +import com.zhyc.module.biosafety.service.ITreatmentService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.zhyc.common.annotation.Log; +import com.zhyc.common.core.controller.BaseController; +import com.zhyc.common.core.domain.AjaxResult; +import com.zhyc.common.enums.BusinessType; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 治疗记录Controller + * + * @author ruoyi + * @date 2025-07-15 + */ +@RestController +@RequestMapping("/treatment/treatment") +public class TreatmentController extends BaseController +{ + @Autowired + private ITreatmentService treatmentService; + + /** + * 查询治疗记录列表 + */ + @PreAuthorize("@ss.hasPermi('treatment:treatment:list')") + @GetMapping("/list") + public TableDataInfo list(Treatment treatment) + { + startPage(); + List list = treatmentService.selectTreatmentList(treatment); + return getDataTable(list); + } + + /** + * 导出治疗记录列表 + */ + @PreAuthorize("@ss.hasPermi('treatment:treatment:export')") + @Log(title = "治疗记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, Treatment treatment) + { + List list = treatmentService.selectTreatmentList(treatment); + ExcelUtil util = new ExcelUtil(Treatment.class); + util.exportExcel(response, list, "治疗记录数据"); + } + + /** + * 获取治疗记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('treatment:treatment:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(treatmentService.selectTreatmentById(id)); + } + + /** + * 新增治疗记录 + */ + @PreAuthorize("@ss.hasPermi('treatment:treatment:add')") + @Log(title = "治疗记录", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody Treatment treatment) + { + return toAjax(treatmentService.insertTreatment(treatment)); + } + + /** + * 修改治疗记录 + */ + @PreAuthorize("@ss.hasPermi('treatment:treatment:edit')") + @Log(title = "治疗记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody Treatment treatment) + { + return toAjax(treatmentService.updateTreatment(treatment)); + } + + /** + * 删除治疗记录 + */ + @PreAuthorize("@ss.hasPermi('treatment:treatment:remove')") + @Log(title = "治疗记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(treatmentService.deleteTreatmentByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/Deworm.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/Deworm.java new file mode 100644 index 0000000..89896da --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/Deworm.java @@ -0,0 +1,194 @@ +package com.zhyc.module.biosafety.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; + +/** + * 驱虫对象 sw_deworm + * + * @author ruoyi + * @date 2025-07-15 + */ +public class Deworm extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + /** 羊只id */ + @Excel(name = "羊只id") + private Long sheepId; + + /** 药品使用记录 */ + @Excel(name = "药品使用记录") + private Long usageId; + + /** 品种 */ + @Excel(name = "品种") + private String variety; + + /** 羊只类别 */ + @Excel(name = "羊只类别") + private String sheepType; + + /** 性别 */ + @Excel(name = "性别") + private String gender; + + /** 月龄 */ + @Excel(name = "月龄") + private Long monthAge; + + /** 胎次 */ + @Excel(name = "胎次") + private Long parity; + + /** 驱虫日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "驱虫日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date datetime; + + /** 技术员 */ + @Excel(name = "技术员") + private String technical; + + /** 备注 */ + @Excel(name = "备注") + private String comment; + + 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 setUsageId(Long usageId) + { + this.usageId = usageId; + } + + public Long getUsageId() + { + return usageId; + } + + 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(String gender) + { + this.gender = gender; + } + + public String getGender() + { + return gender; + } + + public void setMonthAge(Long monthAge) + { + this.monthAge = monthAge; + } + + public Long getMonthAge() + { + return monthAge; + } + + public void setParity(Long parity) + { + this.parity = parity; + } + + public Long getParity() + { + return parity; + } + + public void setDatetime(Date datetime) + { + this.datetime = datetime; + } + + public Date getDatetime() + { + return datetime; + } + + public void setTechnical(String technical) + { + this.technical = technical; + } + + public String getTechnical() + { + return technical; + } + + 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("sheepId", getSheepId()) + .append("usageId", getUsageId()) + .append("variety", getVariety()) + .append("sheepType", getSheepType()) + .append("gender", getGender()) + .append("monthAge", getMonthAge()) + .append("parity", getParity()) + .append("datetime", getDatetime()) + .append("technical", getTechnical()) + .append("comment", getComment()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .toString(); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/Diagnosis.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/Diagnosis.java new file mode 100644 index 0000000..05f9a98 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/Diagnosis.java @@ -0,0 +1,239 @@ +package com.zhyc.module.biosafety.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; + +/** + * 诊疗结果对象 sw_diagnosis + * + * @author ruoyi + * @date 2025-07-15 + */ +public class Diagnosis extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + /** 治疗记录id */ + @Excel(name = "治疗记录id") + private Long treatId; + + /** 羊只id */ + @Excel(name = "羊只id") + private Long sheepId; + + /** 时间日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "时间日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date datetime; + + /** 羊只类别 */ + @Excel(name = "羊只类别") + private String sheepType; + + /** 性别 */ + @Excel(name = "性别") + private String gender; + + /** 胎次 */ + @Excel(name = "胎次") + private String parity; + + /** 疾病类型 */ + @Excel(name = "疾病类型") + private Long diseasePid; + + /** 子疾病 */ + @Excel(name = "子疾病") + private Long diseaseId; + + /** 诊疗结果 */ + @Excel(name = "诊疗结果") + private Long result; + + /** 开始时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date begindate; + + /** 结束时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date enddate; + + /** 治疗天数 */ + @Excel(name = "治疗天数") + private Long treatDay; + + /** 羊舍id */ + @Excel(name = "羊舍id") + private Long sheepfoldId; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public void setTreatId(Long treatId) + { + this.treatId = treatId; + } + + public Long getTreatId() + { + return treatId; + } + + public void setSheepId(Long sheepId) + { + this.sheepId = sheepId; + } + + public Long getSheepId() + { + return sheepId; + } + + public void setDatetime(Date datetime) + { + this.datetime = datetime; + } + + public Date getDatetime() + { + return datetime; + } + + public void setSheepType(String sheepType) + { + this.sheepType = sheepType; + } + + public String getSheepType() + { + return sheepType; + } + + public void setGender(String gender) + { + this.gender = gender; + } + + public String getGender() + { + return gender; + } + + public void setParity(String parity) + { + this.parity = parity; + } + + public String getParity() + { + return parity; + } + + public void setDiseasePid(Long diseasePid) + { + this.diseasePid = diseasePid; + } + + public Long getDiseasePid() + { + return diseasePid; + } + + public void setDiseaseId(Long diseaseId) + { + this.diseaseId = diseaseId; + } + + public Long getDiseaseId() + { + return diseaseId; + } + + public void setResult(Long result) + { + this.result = result; + } + + public Long getResult() + { + return result; + } + + public void setBegindate(Date begindate) + { + this.begindate = begindate; + } + + public Date getBegindate() + { + return begindate; + } + + public void setEnddate(Date enddate) + { + this.enddate = enddate; + } + + public Date getEnddate() + { + return enddate; + } + + public void setTreatDay(Long treatDay) + { + this.treatDay = treatDay; + } + + public Long getTreatDay() + { + return treatDay; + } + + public void setSheepfoldId(Long sheepfoldId) + { + this.sheepfoldId = sheepfoldId; + } + + public Long getSheepfoldId() + { + return sheepfoldId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("treatId", getTreatId()) + .append("sheepId", getSheepId()) + .append("datetime", getDatetime()) + .append("sheepType", getSheepType()) + .append("gender", getGender()) + .append("parity", getParity()) + .append("diseasePid", getDiseasePid()) + .append("diseaseId", getDiseaseId()) + .append("result", getResult()) + .append("begindate", getBegindate()) + .append("enddate", getEnddate()) + .append("treatDay", getTreatDay()) + .append("sheepfoldId", getSheepfoldId()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .toString(); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/Disinfect.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/Disinfect.java new file mode 100644 index 0000000..4b30dd3 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/Disinfect.java @@ -0,0 +1,149 @@ +package com.zhyc.module.biosafety.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; + +/** + * 消毒记录对象 sw_disinfect + * + * @author ruoyi + * @date 2025-07-15 + */ +public class Disinfect extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** id */ + private Long id; + + /** 羊舍id */ + @Excel(name = "羊舍id") + private Long sheepfoldId; + + /** 消毒日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "消毒日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date datetime; + + /** 技术员 */ + @Excel(name = "技术员") + private String technician; + + /** 消毒方式 */ + @Excel(name = "消毒方式") + private String way; + + /** 药品使用记录id */ + @Excel(name = "药品使用记录id") + private Long usageId; + + /** 比例 */ + @Excel(name = "比例") + private String ratio; + + /** 备注 */ + @Excel(name = "备注") + private String comment; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public void setSheepfoldId(Long sheepfoldId) + { + this.sheepfoldId = sheepfoldId; + } + + public Long getSheepfoldId() + { + return sheepfoldId; + } + + public void setDatetime(Date datetime) + { + this.datetime = datetime; + } + + public Date getDatetime() + { + return datetime; + } + + public void setTechnician(String technician) + { + this.technician = technician; + } + + public String getTechnician() + { + return technician; + } + + public void setWay(String way) + { + this.way = way; + } + + public String getWay() + { + return way; + } + + public void setUsageId(Long usageId) + { + this.usageId = usageId; + } + + public Long getUsageId() + { + return usageId; + } + + public void setRatio(String ratio) + { + this.ratio = ratio; + } + + public String getRatio() + { + return ratio; + } + + 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("sheepfoldId", getSheepfoldId()) + .append("datetime", getDatetime()) + .append("technician", getTechnician()) + .append("way", getWay()) + .append("usageId", getUsageId()) + .append("ratio", getRatio()) + .append("comment", getComment()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .toString(); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/Health.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/Health.java new file mode 100644 index 0000000..2cd9347 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/Health.java @@ -0,0 +1,209 @@ +package com.zhyc.module.biosafety.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; + +/** + * 保健对象 sw_health + * + * @author ruoyi + * @date 2025-07-15 + */ +public class Health extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + /** 保健日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "保健日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date datetime; + + /** 羊只id */ + @Excel(name = "羊只id") + private Long sheepId; + + /** 用药记录 */ + @Excel(name = "用药记录") + private Long usageId; + + /** 品种 */ + @Excel(name = "品种") + private String variety; + + /** 羊只类别 */ + @Excel(name = "羊只类别") + private String sheepType; + + /** 性别 */ + @Excel(name = "性别") + private String gender; + + /** 月龄 */ + @Excel(name = "月龄") + private String monthAge; + + /** 胎次 */ + @Excel(name = "胎次") + private Long parity; + + /** 羊舍id */ + @Excel(name = "羊舍id") + private Long sheepfoldId; + + /** 技术员 */ + @Excel(name = "技术员") + private String technical; + + /** 备注 */ + @Excel(name = "备注") + private String comment; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public void setDatetime(Date datetime) + { + this.datetime = datetime; + } + + public Date getDatetime() + { + return datetime; + } + + public void setSheepId(Long sheepId) + { + this.sheepId = sheepId; + } + + public Long getSheepId() + { + return sheepId; + } + + public void setUsageId(Long usageId) + { + this.usageId = usageId; + } + + public Long getUsageId() + { + return usageId; + } + + 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(String gender) + { + this.gender = gender; + } + + public String getGender() + { + return gender; + } + + public void setMonthAge(String monthAge) + { + this.monthAge = monthAge; + } + + public String getMonthAge() + { + return monthAge; + } + + public void setParity(Long parity) + { + this.parity = parity; + } + + public Long getParity() + { + return parity; + } + + public void setSheepfoldId(Long sheepfoldId) + { + this.sheepfoldId = sheepfoldId; + } + + public Long getSheepfoldId() + { + return sheepfoldId; + } + + public void setTechnical(String technical) + { + this.technical = technical; + } + + public String getTechnical() + { + return technical; + } + + 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("datetime", getDatetime()) + .append("sheepId", getSheepId()) + .append("usageId", getUsageId()) + .append("variety", getVariety()) + .append("sheepType", getSheepType()) + .append("gender", getGender()) + .append("monthAge", getMonthAge()) + .append("parity", getParity()) + .append("sheepfoldId", getSheepfoldId()) + .append("technical", getTechnical()) + .append("comment", getComment()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .toString(); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/Immunity.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/Immunity.java new file mode 100644 index 0000000..6dda5ac --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/Immunity.java @@ -0,0 +1,209 @@ +package com.zhyc.module.biosafety.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; + +/** + * 免疫对象 sw_immunity + * + * @author ruoyi + * @date 2025-07-15 + */ +public class Immunity extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + /** 羊只id */ + @Excel(name = "羊只id") + private Long sheepId; + + /** 使用记录 */ + @Excel(name = "使用记录") + private Long usageId; + + /** 品种 */ + @Excel(name = "品种") + private String variety; + + /** 羊只类型 */ + @Excel(name = "羊只类型") + private Long sheepType; + + /** 羊只性别 */ + @Excel(name = "羊只性别") + private String gender; + + /** 月龄 */ + @Excel(name = "月龄") + private Long monthAge; + + /** 胎次 */ + @Excel(name = "胎次") + private Long parity; + + /** 羊舍id */ + @Excel(name = "羊舍id") + private Long sheepfoldId; + + /** 免疫日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "免疫日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date datetime; + + /** 技术员 */ + @Excel(name = "技术员") + private String technical; + + /** 备注 */ + @Excel(name = "备注") + private String comment; + + 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 setUsageId(Long usageId) + { + this.usageId = usageId; + } + + public Long getUsageId() + { + return usageId; + } + + public void setVariety(String variety) + { + this.variety = variety; + } + + public String getVariety() + { + return variety; + } + + public void setSheepType(Long sheepType) + { + this.sheepType = sheepType; + } + + public Long getSheepType() + { + return sheepType; + } + + public void setGender(String gender) + { + this.gender = gender; + } + + public String getGender() + { + return gender; + } + + public void setMonthAge(Long monthAge) + { + this.monthAge = monthAge; + } + + public Long getMonthAge() + { + return monthAge; + } + + public void setParity(Long parity) + { + this.parity = parity; + } + + public Long getParity() + { + return parity; + } + + public void setSheepfoldId(Long sheepfoldId) + { + this.sheepfoldId = sheepfoldId; + } + + public Long getSheepfoldId() + { + return sheepfoldId; + } + + public void setDatetime(Date datetime) + { + this.datetime = datetime; + } + + public Date getDatetime() + { + return datetime; + } + + public void setTechnical(String technical) + { + this.technical = technical; + } + + public String getTechnical() + { + return technical; + } + + 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("sheepId", getSheepId()) + .append("usageId", getUsageId()) + .append("variety", getVariety()) + .append("sheepType", getSheepType()) + .append("gender", getGender()) + .append("monthAge", getMonthAge()) + .append("parity", getParity()) + .append("sheepfoldId", getSheepfoldId()) + .append("datetime", getDatetime()) + .append("technical", getTechnical()) + .append("comment", getComment()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .toString(); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/QuarantineItems.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/QuarantineItems.java new file mode 100644 index 0000000..eb57ab0 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/QuarantineItems.java @@ -0,0 +1,52 @@ +package com.zhyc.module.biosafety.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; + +/** + * 检疫项目对象 sw_quarantine_items + * + * @author ruoyi + * @date 2025-07-14 + */ +public class QuarantineItems extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** id */ + private Long id; + + /** 名称 */ + @Excel(name = "名称") + private String name; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("name", getName()) + .toString(); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/QuarantineReport.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/QuarantineReport.java new file mode 100644 index 0000000..bfa931f --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/QuarantineReport.java @@ -0,0 +1,83 @@ +package com.zhyc.module.biosafety.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; +import org.apache.ibatis.type.Alias; + +/** + * 检疫记录对象 sw_quarantine_report + * + * @author ruoyi + * @date 2025-07-14 + */ +@Data +@Alias("QuarantineReport") +public class QuarantineReport extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** id */ + private Long id; + + /** 羊只 */ + private Long sheepId; + + @Excel(name = "羊只耳号") + private String sheepNo; + @Excel(name = "羊只类别") + private String sheepType; + @Excel(name = "羊只性别") + private String gender; + @Excel(name = "月龄") + private Integer monthAge; + @Excel(name = "胎次") + private Integer parity; + @Excel(name = "繁育状态") + private String breed; + + + /** 检疫日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "检疫日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date datetime; + + /** 检疫项目 */ + + private Long quarItem; + + /** 检疫项目 */ + @Excel(name = "检疫项目") + private String itemName; + + + /** 样品类型 */ + private Long sampleType; + + /** 样品 */ + @Excel(name = "样品类型") + private String sample; + + + /** 采样员 */ + @Excel(name = "采样员") + private String sampler; + + /** 检疫员 */ + @Excel(name = "检疫员") + private String quarOfficer; + + /** 检疫结果 */ + @Excel(name = "检疫结果") + private Long result; + + /** 状态 */ + @Excel(name = "状态") + private Long status; + + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/QuarantineSample.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/QuarantineSample.java new file mode 100644 index 0000000..e9e3ba3 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/QuarantineSample.java @@ -0,0 +1,52 @@ +package com.zhyc.module.biosafety.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; + +/** + * 样品类型对象 sw_quarantine_sample + * + * @author ruoyi + * @date 2025-07-14 + */ +public class QuarantineSample extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** id */ + private Long id; + + /** 样品类型 */ + @Excel(name = "样品类型") + private String name; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("name", getName()) + .toString(); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/Treatment.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/Treatment.java new file mode 100644 index 0000000..4ace5d1 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/Treatment.java @@ -0,0 +1,283 @@ +package com.zhyc.module.biosafety.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; + +/** + * 治疗记录对象 sw_treatment + * + * @author ruoyi + * @date 2025-07-15 + */ +public class Treatment extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + /** 诊疗记录id */ + private Long diagId; + + /** 羊只耳号 */ + @Excel(name = "羊只耳号") + private Long sheepId; + + /** 品种 */ + @Excel(name = "品种") + private String variety; + + /** 羊只类别 */ + @Excel(name = "羊只类别") + private String sheepType; + + /** 月龄 */ + @Excel(name = "月龄") + private Long monthAge; + + /** 性别 */ + @Excel(name = "性别") + private String gender; + + /** 胎次 */ + @Excel(name = "胎次") + private Long parity; + + /** 繁殖状态 */ + @Excel(name = "繁殖状态") + private String breed; + + /** 泌乳天数 */ + @Excel(name = "泌乳天数") + private Long lactDay; + + /** 怀孕天数 */ + @Excel(name = "怀孕天数") + private Long gestDay; + + /** 治疗日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "治疗日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date datetime; + + /** 疾病类型 */ + @Excel(name = "疾病类型") + private Long diseaseId; + + /** 父疾病 */ + @Excel(name = "父疾病") + private String diseasePid; + + /** 兽医 */ + @Excel(name = "兽医") + private String veterinary; + + /** 药品使用记录id */ + @Excel(name = "药品使用记录id") + private Long usageId; + + /** 备注 */ + @Excel(name = "备注") + private String comment; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public void setDiagId(Long diagId) + { + this.diagId = diagId; + } + + public Long getDiagId() + { + return diagId; + } + + public void setSheepId(Long sheepId) + { + this.sheepId = sheepId; + } + + public Long getSheepId() + { + return sheepId; + } + + 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 setMonthAge(Long monthAge) + { + this.monthAge = monthAge; + } + + public Long getMonthAge() + { + return monthAge; + } + + public void setGender(String gender) + { + this.gender = gender; + } + + public String getGender() + { + return gender; + } + + public void setParity(Long parity) + { + this.parity = parity; + } + + public Long getParity() + { + return parity; + } + + public void setBreed(String breed) + { + this.breed = breed; + } + + public String getBreed() + { + return breed; + } + + public void setLactDay(Long lactDay) + { + this.lactDay = lactDay; + } + + public Long getLactDay() + { + return lactDay; + } + + public void setGestDay(Long gestDay) + { + this.gestDay = gestDay; + } + + public Long getGestDay() + { + return gestDay; + } + + public void setDatetime(Date datetime) + { + this.datetime = datetime; + } + + public Date getDatetime() + { + return datetime; + } + + public void setDiseaseId(Long diseaseId) + { + this.diseaseId = diseaseId; + } + + public Long getDiseaseId() + { + return diseaseId; + } + + public void setDiseasePid(String diseasePid) + { + this.diseasePid = diseasePid; + } + + public String getDiseasePid() + { + return diseasePid; + } + + public void setVeterinary(String veterinary) + { + this.veterinary = veterinary; + } + + public String getVeterinary() + { + return veterinary; + } + + public void setUsageId(Long usageId) + { + this.usageId = usageId; + } + + public Long getUsageId() + { + return usageId; + } + + 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("diagId", getDiagId()) + .append("sheepId", getSheepId()) + .append("variety", getVariety()) + .append("sheepType", getSheepType()) + .append("monthAge", getMonthAge()) + .append("gender", getGender()) + .append("parity", getParity()) + .append("breed", getBreed()) + .append("lactDay", getLactDay()) + .append("gestDay", getGestDay()) + .append("datetime", getDatetime()) + .append("diseaseId", getDiseaseId()) + .append("diseasePid", getDiseasePid()) + .append("veterinary", getVeterinary()) + .append("usageId", getUsageId()) + .append("comment", getComment()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .toString(); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/DewormMapper.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/DewormMapper.java new file mode 100644 index 0000000..f346774 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/DewormMapper.java @@ -0,0 +1,62 @@ +package com.zhyc.module.biosafety.mapper; + +import java.util.List; + +import com.zhyc.module.biosafety.domain.Deworm; + +/** + * 驱虫Mapper接口 + * + * @author ruoyi + * @date 2025-07-15 + */ +public interface DewormMapper +{ + /** + * 查询驱虫 + * + * @param id 驱虫主键 + * @return 驱虫 + */ + public Deworm selectDewormById(Long id); + + /** + * 查询驱虫列表 + * + * @param deworm 驱虫 + * @return 驱虫集合 + */ + public List selectDewormList(Deworm deworm); + + /** + * 新增驱虫 + * + * @param deworm 驱虫 + * @return 结果 + */ + public int insertDeworm(Deworm deworm); + + /** + * 修改驱虫 + * + * @param deworm 驱虫 + * @return 结果 + */ + public int updateDeworm(Deworm deworm); + + /** + * 删除驱虫 + * + * @param id 驱虫主键 + * @return 结果 + */ + public int deleteDewormById(Long id); + + /** + * 批量删除驱虫 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteDewormByIds(Long[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/DiagnosisMapper.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/DiagnosisMapper.java new file mode 100644 index 0000000..47110b7 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/DiagnosisMapper.java @@ -0,0 +1,61 @@ +package com.zhyc.module.biosafety.mapper; + +import java.util.List; +import com.zhyc.module.biosafety.domain.Diagnosis; + +/** + * 诊疗结果Mapper接口 + * + * @author ruoyi + * @date 2025-07-15 + */ +public interface DiagnosisMapper +{ + /** + * 查询诊疗结果 + * + * @param id 诊疗结果主键 + * @return 诊疗结果 + */ + public Diagnosis selectDiagnosisById(Long id); + + /** + * 查询诊疗结果列表 + * + * @param diagnosis 诊疗结果 + * @return 诊疗结果集合 + */ + public List selectDiagnosisList(Diagnosis diagnosis); + + /** + * 新增诊疗结果 + * + * @param diagnosis 诊疗结果 + * @return 结果 + */ + public int insertDiagnosis(Diagnosis diagnosis); + + /** + * 修改诊疗结果 + * + * @param diagnosis 诊疗结果 + * @return 结果 + */ + public int updateDiagnosis(Diagnosis diagnosis); + + /** + * 删除诊疗结果 + * + * @param id 诊疗结果主键 + * @return 结果 + */ + public int deleteDiagnosisById(Long id); + + /** + * 批量删除诊疗结果 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteDiagnosisByIds(Long[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/DisinfectMapper.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/DisinfectMapper.java new file mode 100644 index 0000000..4092405 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/DisinfectMapper.java @@ -0,0 +1,61 @@ +package com.zhyc.module.biosafety.mapper; + +import java.util.List; +import com.zhyc.module.biosafety.domain.Disinfect; + +/** + * 消毒记录Mapper接口 + * + * @author ruoyi + * @date 2025-07-15 + */ +public interface DisinfectMapper +{ + /** + * 查询消毒记录 + * + * @param id 消毒记录主键 + * @return 消毒记录 + */ + public Disinfect selectDisinfectById(Long id); + + /** + * 查询消毒记录列表 + * + * @param disinfect 消毒记录 + * @return 消毒记录集合 + */ + public List selectDisinfectList(Disinfect disinfect); + + /** + * 新增消毒记录 + * + * @param disinfect 消毒记录 + * @return 结果 + */ + public int insertDisinfect(Disinfect disinfect); + + /** + * 修改消毒记录 + * + * @param disinfect 消毒记录 + * @return 结果 + */ + public int updateDisinfect(Disinfect disinfect); + + /** + * 删除消毒记录 + * + * @param id 消毒记录主键 + * @return 结果 + */ + public int deleteDisinfectById(Long id); + + /** + * 批量删除消毒记录 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteDisinfectByIds(Long[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/HealthMapper.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/HealthMapper.java new file mode 100644 index 0000000..0fbfafc --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/HealthMapper.java @@ -0,0 +1,61 @@ +package com.zhyc.module.biosafety.mapper; + +import java.util.List; +import com.zhyc.module.biosafety.domain.Health; + +/** + * 保健Mapper接口 + * + * @author ruoyi + * @date 2025-07-15 + */ +public interface HealthMapper +{ + /** + * 查询保健 + * + * @param id 保健主键 + * @return 保健 + */ + public Health selectHealthById(Long id); + + /** + * 查询保健列表 + * + * @param health 保健 + * @return 保健集合 + */ + public List selectHealthList(Health health); + + /** + * 新增保健 + * + * @param health 保健 + * @return 结果 + */ + public int insertHealth(Health health); + + /** + * 修改保健 + * + * @param health 保健 + * @return 结果 + */ + public int updateHealth(Health health); + + /** + * 删除保健 + * + * @param id 保健主键 + * @return 结果 + */ + public int deleteHealthById(Long id); + + /** + * 批量删除保健 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteHealthByIds(Long[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/ImmunityMapper.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/ImmunityMapper.java new file mode 100644 index 0000000..ea5161a --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/ImmunityMapper.java @@ -0,0 +1,61 @@ +package com.zhyc.module.biosafety.mapper; + +import java.util.List; +import com.zhyc.module.biosafety.domain.Immunity; + +/** + * 免疫Mapper接口 + * + * @author ruoyi + * @date 2025-07-15 + */ +public interface ImmunityMapper +{ + /** + * 查询免疫 + * + * @param id 免疫主键 + * @return 免疫 + */ + public Immunity selectImmunityById(Long id); + + /** + * 查询免疫列表 + * + * @param immunity 免疫 + * @return 免疫集合 + */ + public List selectImmunityList(Immunity immunity); + + /** + * 新增免疫 + * + * @param immunity 免疫 + * @return 结果 + */ + public int insertImmunity(Immunity immunity); + + /** + * 修改免疫 + * + * @param immunity 免疫 + * @return 结果 + */ + public int updateImmunity(Immunity immunity); + + /** + * 删除免疫 + * + * @param id 免疫主键 + * @return 结果 + */ + public int deleteImmunityById(Long id); + + /** + * 批量删除免疫 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteImmunityByIds(Long[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/QuarantineItemsMapper.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/QuarantineItemsMapper.java new file mode 100644 index 0000000..3f4dd36 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/QuarantineItemsMapper.java @@ -0,0 +1,62 @@ +package com.zhyc.module.biosafety.mapper; + +import java.util.List; + +import com.zhyc.module.biosafety.domain.QuarantineItems; + +/** + * 检疫项目Mapper接口 + * + * @author ruoyi + * @date 2025-07-14 + */ +public interface QuarantineItemsMapper +{ + /** + * 查询检疫项目 + * + * @param id 检疫项目主键 + * @return 检疫项目 + */ + public QuarantineItems selectQuarantineItemsById(Long id); + + /** + * 查询检疫项目列表 + * + * @param quarantineItems 检疫项目 + * @return 检疫项目集合 + */ + public List selectQuarantineItemsList(QuarantineItems quarantineItems); + + /** + * 新增检疫项目 + * + * @param quarantineItems 检疫项目 + * @return 结果 + */ + public int insertQuarantineItems(QuarantineItems quarantineItems); + + /** + * 修改检疫项目 + * + * @param quarantineItems 检疫项目 + * @return 结果 + */ + public int updateQuarantineItems(QuarantineItems quarantineItems); + + /** + * 删除检疫项目 + * + * @param id 检疫项目主键 + * @return 结果 + */ + public int deleteQuarantineItemsById(Long id); + + /** + * 批量删除检疫项目 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteQuarantineItemsByIds(Long[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/QuarantineReportMapper.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/QuarantineReportMapper.java new file mode 100644 index 0000000..b913852 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/QuarantineReportMapper.java @@ -0,0 +1,62 @@ +package com.zhyc.module.biosafety.mapper; + +import java.util.List; + +import com.zhyc.module.biosafety.domain.QuarantineReport; + +/** + * 检疫记录Mapper接口 + * + * @author ruoyi + * @date 2025-07-14 + */ +public interface QuarantineReportMapper +{ + /** + * 查询检疫记录 + * + * @param id 检疫记录主键 + * @return 检疫记录 + */ + public QuarantineReport selectQuarantineReportById(Long id); + + /** + * 查询检疫记录列表 + * + * @param quarantineReport 检疫记录 + * @return 检疫记录集合 + */ + public List selectQuarantineReportList(QuarantineReport quarantineReport); + + /** + * 新增检疫记录 + * + * @param quarantineReport 检疫记录 + * @return 结果 + */ + public int insertQuarantineReport(QuarantineReport quarantineReport); + + /** + * 修改检疫记录 + * + * @param quarantineReport 检疫记录 + * @return 结果 + */ + public int updateQuarantineReport(QuarantineReport quarantineReport); + + /** + * 删除检疫记录 + * + * @param id 检疫记录主键 + * @return 结果 + */ + public int deleteQuarantineReportById(Long id); + + /** + * 批量删除检疫记录 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteQuarantineReportByIds(Long[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/QuarantineSampleMapper.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/QuarantineSampleMapper.java new file mode 100644 index 0000000..76ce1d7 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/QuarantineSampleMapper.java @@ -0,0 +1,62 @@ +package com.zhyc.module.biosafety.mapper; + +import java.util.List; + +import com.zhyc.module.biosafety.domain.QuarantineSample; + +/** + * 样品类型Mapper接口 + * + * @author ruoyi + * @date 2025-07-14 + */ +public interface QuarantineSampleMapper +{ + /** + * 查询样品类型 + * + * @param id 样品类型主键 + * @return 样品类型 + */ + public QuarantineSample selectQuarantineSampleById(Long id); + + /** + * 查询样品类型列表 + * + * @param quarantineSample 样品类型 + * @return 样品类型集合 + */ + public List selectQuarantineSampleList(QuarantineSample quarantineSample); + + /** + * 新增样品类型 + * + * @param quarantineSample 样品类型 + * @return 结果 + */ + public int insertQuarantineSample(QuarantineSample quarantineSample); + + /** + * 修改样品类型 + * + * @param quarantineSample 样品类型 + * @return 结果 + */ + public int updateQuarantineSample(QuarantineSample quarantineSample); + + /** + * 删除样品类型 + * + * @param id 样品类型主键 + * @return 结果 + */ + public int deleteQuarantineSampleById(Long id); + + /** + * 批量删除样品类型 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteQuarantineSampleByIds(Long[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/TreatmentMapper.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/TreatmentMapper.java new file mode 100644 index 0000000..1807ed0 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/TreatmentMapper.java @@ -0,0 +1,62 @@ +package com.zhyc.module.biosafety.mapper; + +import java.util.List; + +import com.zhyc.module.biosafety.domain.Treatment; + +/** + * 治疗记录Mapper接口 + * + * @author ruoyi + * @date 2025-07-15 + */ +public interface TreatmentMapper +{ + /** + * 查询治疗记录 + * + * @param id 治疗记录主键 + * @return 治疗记录 + */ + public Treatment selectTreatmentById(Long id); + + /** + * 查询治疗记录列表 + * + * @param treatment 治疗记录 + * @return 治疗记录集合 + */ + public List selectTreatmentList(Treatment treatment); + + /** + * 新增治疗记录 + * + * @param treatment 治疗记录 + * @return 结果 + */ + public int insertTreatment(Treatment treatment); + + /** + * 修改治疗记录 + * + * @param treatment 治疗记录 + * @return 结果 + */ + public int updateTreatment(Treatment treatment); + + /** + * 删除治疗记录 + * + * @param id 治疗记录主键 + * @return 结果 + */ + public int deleteTreatmentById(Long id); + + /** + * 批量删除治疗记录 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteTreatmentByIds(Long[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/IDewormService.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/IDewormService.java new file mode 100644 index 0000000..f897fa4 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/IDewormService.java @@ -0,0 +1,62 @@ +package com.zhyc.module.biosafety.service; + +import java.util.List; + +import com.zhyc.module.biosafety.domain.Deworm; + +/** + * 驱虫Service接口 + * + * @author ruoyi + * @date 2025-07-15 + */ +public interface IDewormService +{ + /** + * 查询驱虫 + * + * @param id 驱虫主键 + * @return 驱虫 + */ + public Deworm selectDewormById(Long id); + + /** + * 查询驱虫列表 + * + * @param deworm 驱虫 + * @return 驱虫集合 + */ + public List selectDewormList(Deworm deworm); + + /** + * 新增驱虫 + * + * @param deworm 驱虫 + * @return 结果 + */ + public int insertDeworm(Deworm deworm); + + /** + * 修改驱虫 + * + * @param deworm 驱虫 + * @return 结果 + */ + public int updateDeworm(Deworm deworm); + + /** + * 批量删除驱虫 + * + * @param ids 需要删除的驱虫主键集合 + * @return 结果 + */ + public int deleteDewormByIds(Long[] ids); + + /** + * 删除驱虫信息 + * + * @param id 驱虫主键 + * @return 结果 + */ + public int deleteDewormById(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/IDiagnosisService.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/IDiagnosisService.java new file mode 100644 index 0000000..d88f954 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/IDiagnosisService.java @@ -0,0 +1,62 @@ +package com.zhyc.module.biosafety.service; + +import java.util.List; + +import com.zhyc.module.biosafety.domain.Diagnosis; + +/** + * 诊疗结果Service接口 + * + * @author ruoyi + * @date 2025-07-15 + */ +public interface IDiagnosisService +{ + /** + * 查询诊疗结果 + * + * @param id 诊疗结果主键 + * @return 诊疗结果 + */ + public Diagnosis selectDiagnosisById(Long id); + + /** + * 查询诊疗结果列表 + * + * @param diagnosis 诊疗结果 + * @return 诊疗结果集合 + */ + public List selectDiagnosisList(Diagnosis diagnosis); + + /** + * 新增诊疗结果 + * + * @param diagnosis 诊疗结果 + * @return 结果 + */ + public int insertDiagnosis(Diagnosis diagnosis); + + /** + * 修改诊疗结果 + * + * @param diagnosis 诊疗结果 + * @return 结果 + */ + public int updateDiagnosis(Diagnosis diagnosis); + + /** + * 批量删除诊疗结果 + * + * @param ids 需要删除的诊疗结果主键集合 + * @return 结果 + */ + public int deleteDiagnosisByIds(Long[] ids); + + /** + * 删除诊疗结果信息 + * + * @param id 诊疗结果主键 + * @return 结果 + */ + public int deleteDiagnosisById(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/IDisinfectService.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/IDisinfectService.java new file mode 100644 index 0000000..d6d20f2 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/IDisinfectService.java @@ -0,0 +1,61 @@ +package com.zhyc.module.biosafety.service; + +import java.util.List; +import com.zhyc.module.biosafety.domain.Disinfect; + +/** + * 消毒记录Service接口 + * + * @author ruoyi + * @date 2025-07-15 + */ +public interface IDisinfectService +{ + /** + * 查询消毒记录 + * + * @param id 消毒记录主键 + * @return 消毒记录 + */ + public Disinfect selectDisinfectById(Long id); + + /** + * 查询消毒记录列表 + * + * @param disinfect 消毒记录 + * @return 消毒记录集合 + */ + public List selectDisinfectList(Disinfect disinfect); + + /** + * 新增消毒记录 + * + * @param disinfect 消毒记录 + * @return 结果 + */ + public int insertDisinfect(Disinfect disinfect); + + /** + * 修改消毒记录 + * + * @param disinfect 消毒记录 + * @return 结果 + */ + public int updateDisinfect(Disinfect disinfect); + + /** + * 批量删除消毒记录 + * + * @param ids 需要删除的消毒记录主键集合 + * @return 结果 + */ + public int deleteDisinfectByIds(Long[] ids); + + /** + * 删除消毒记录信息 + * + * @param id 消毒记录主键 + * @return 结果 + */ + public int deleteDisinfectById(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/IHealthService.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/IHealthService.java new file mode 100644 index 0000000..b9d8e8e --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/IHealthService.java @@ -0,0 +1,61 @@ +package com.zhyc.module.biosafety.service; + +import java.util.List; +import com.zhyc.module.biosafety.domain.Health; + +/** + * 保健Service接口 + * + * @author ruoyi + * @date 2025-07-15 + */ +public interface IHealthService +{ + /** + * 查询保健 + * + * @param id 保健主键 + * @return 保健 + */ + public Health selectHealthById(Long id); + + /** + * 查询保健列表 + * + * @param health 保健 + * @return 保健集合 + */ + public List selectHealthList(Health health); + + /** + * 新增保健 + * + * @param health 保健 + * @return 结果 + */ + public int insertHealth(Health health); + + /** + * 修改保健 + * + * @param health 保健 + * @return 结果 + */ + public int updateHealth(Health health); + + /** + * 批量删除保健 + * + * @param ids 需要删除的保健主键集合 + * @return 结果 + */ + public int deleteHealthByIds(Long[] ids); + + /** + * 删除保健信息 + * + * @param id 保健主键 + * @return 结果 + */ + public int deleteHealthById(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/IImmunityService.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/IImmunityService.java new file mode 100644 index 0000000..1f75b9b --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/IImmunityService.java @@ -0,0 +1,61 @@ +package com.zhyc.module.biosafety.service; + +import java.util.List; +import com.zhyc.module.biosafety.domain.Immunity; + +/** + * 免疫Service接口 + * + * @author ruoyi + * @date 2025-07-15 + */ +public interface IImmunityService +{ + /** + * 查询免疫 + * + * @param id 免疫主键 + * @return 免疫 + */ + public Immunity selectImmunityById(Long id); + + /** + * 查询免疫列表 + * + * @param immunity 免疫 + * @return 免疫集合 + */ + public List selectImmunityList(Immunity immunity); + + /** + * 新增免疫 + * + * @param immunity 免疫 + * @return 结果 + */ + public int insertImmunity(Immunity immunity); + + /** + * 修改免疫 + * + * @param immunity 免疫 + * @return 结果 + */ + public int updateImmunity(Immunity immunity); + + /** + * 批量删除免疫 + * + * @param ids 需要删除的免疫主键集合 + * @return 结果 + */ + public int deleteImmunityByIds(Long[] ids); + + /** + * 删除免疫信息 + * + * @param id 免疫主键 + * @return 结果 + */ + public int deleteImmunityById(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/IQuarantineItemsService.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/IQuarantineItemsService.java new file mode 100644 index 0000000..59bbad1 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/IQuarantineItemsService.java @@ -0,0 +1,62 @@ +package com.zhyc.module.biosafety.service; + +import java.util.List; + +import com.zhyc.module.biosafety.domain.QuarantineItems; + +/** + * 检疫项目Service接口 + * + * @author ruoyi + * @date 2025-07-14 + */ +public interface IQuarantineItemsService +{ + /** + * 查询检疫项目 + * + * @param id 检疫项目主键 + * @return 检疫项目 + */ + public QuarantineItems selectQuarantineItemsById(Long id); + + /** + * 查询检疫项目列表 + * + * @param quarantineItems 检疫项目 + * @return 检疫项目集合 + */ + public List selectQuarantineItemsList(QuarantineItems quarantineItems); + + /** + * 新增检疫项目 + * + * @param quarantineItems 检疫项目 + * @return 结果 + */ + public int insertQuarantineItems(QuarantineItems quarantineItems); + + /** + * 修改检疫项目 + * + * @param quarantineItems 检疫项目 + * @return 结果 + */ + public int updateQuarantineItems(QuarantineItems quarantineItems); + + /** + * 批量删除检疫项目 + * + * @param ids 需要删除的检疫项目主键集合 + * @return 结果 + */ + public int deleteQuarantineItemsByIds(Long[] ids); + + /** + * 删除检疫项目信息 + * + * @param id 检疫项目主键 + * @return 结果 + */ + public int deleteQuarantineItemsById(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/IQuarantineReportService.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/IQuarantineReportService.java new file mode 100644 index 0000000..2aaeb26 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/IQuarantineReportService.java @@ -0,0 +1,62 @@ +package com.zhyc.module.biosafety.service; + +import java.util.List; + +import com.zhyc.module.biosafety.domain.QuarantineReport; + +/** + * 检疫记录Service接口 + * + * @author ruoyi + * @date 2025-07-14 + */ +public interface IQuarantineReportService +{ + /** + * 查询检疫记录 + * + * @param id 检疫记录主键 + * @return 检疫记录 + */ + public QuarantineReport selectQuarantineReportById(Long id); + + /** + * 查询检疫记录列表 + * + * @param quarantineReport 检疫记录 + * @return 检疫记录集合 + */ + public List selectQuarantineReportList(QuarantineReport quarantineReport); + + /** + * 新增检疫记录 + * + * @param quarantineReport 检疫记录 + * @return 结果 + */ + public int insertQuarantineReport(QuarantineReport quarantineReport); + + /** + * 修改检疫记录 + * + * @param quarantineReport 检疫记录 + * @return 结果 + */ + public int updateQuarantineReport(QuarantineReport quarantineReport); + + /** + * 批量删除检疫记录 + * + * @param ids 需要删除的检疫记录主键集合 + * @return 结果 + */ + public int deleteQuarantineReportByIds(Long[] ids); + + /** + * 删除检疫记录信息 + * + * @param id 检疫记录主键 + * @return 结果 + */ + public int deleteQuarantineReportById(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/IQuarantineSampleService.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/IQuarantineSampleService.java new file mode 100644 index 0000000..5741045 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/IQuarantineSampleService.java @@ -0,0 +1,62 @@ +package com.zhyc.module.biosafety.service; + +import java.util.List; + +import com.zhyc.module.biosafety.domain.QuarantineSample; + +/** + * 样品类型Service接口 + * + * @author ruoyi + * @date 2025-07-14 + */ +public interface IQuarantineSampleService +{ + /** + * 查询样品类型 + * + * @param id 样品类型主键 + * @return 样品类型 + */ + public QuarantineSample selectQuarantineSampleById(Long id); + + /** + * 查询样品类型列表 + * + * @param quarantineSample 样品类型 + * @return 样品类型集合 + */ + public List selectQuarantineSampleList(QuarantineSample quarantineSample); + + /** + * 新增样品类型 + * + * @param quarantineSample 样品类型 + * @return 结果 + */ + public int insertQuarantineSample(QuarantineSample quarantineSample); + + /** + * 修改样品类型 + * + * @param quarantineSample 样品类型 + * @return 结果 + */ + public int updateQuarantineSample(QuarantineSample quarantineSample); + + /** + * 批量删除样品类型 + * + * @param ids 需要删除的样品类型主键集合 + * @return 结果 + */ + public int deleteQuarantineSampleByIds(Long[] ids); + + /** + * 删除样品类型信息 + * + * @param id 样品类型主键 + * @return 结果 + */ + public int deleteQuarantineSampleById(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/ITreatmentService.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/ITreatmentService.java new file mode 100644 index 0000000..3d11b0a --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/ITreatmentService.java @@ -0,0 +1,62 @@ +package com.zhyc.module.biosafety.service; + +import java.util.List; + +import com.zhyc.module.biosafety.domain.Treatment; + +/** + * 治疗记录Service接口 + * + * @author ruoyi + * @date 2025-07-15 + */ +public interface ITreatmentService +{ + /** + * 查询治疗记录 + * + * @param id 治疗记录主键 + * @return 治疗记录 + */ + public Treatment selectTreatmentById(Long id); + + /** + * 查询治疗记录列表 + * + * @param treatment 治疗记录 + * @return 治疗记录集合 + */ + public List selectTreatmentList(Treatment treatment); + + /** + * 新增治疗记录 + * + * @param treatment 治疗记录 + * @return 结果 + */ + public int insertTreatment(Treatment treatment); + + /** + * 修改治疗记录 + * + * @param treatment 治疗记录 + * @return 结果 + */ + public int updateTreatment(Treatment treatment); + + /** + * 批量删除治疗记录 + * + * @param ids 需要删除的治疗记录主键集合 + * @return 结果 + */ + public int deleteTreatmentByIds(Long[] ids); + + /** + * 删除治疗记录信息 + * + * @param id 治疗记录主键 + * @return 结果 + */ + public int deleteTreatmentById(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/DewormServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/DewormServiceImpl.java new file mode 100644 index 0000000..d0afd0e --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/DewormServiceImpl.java @@ -0,0 +1,96 @@ +package com.zhyc.module.biosafety.service.impl; + +import java.util.List; +import com.zhyc.common.utils.DateUtils; +import com.zhyc.module.biosafety.domain.Deworm; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.zhyc.module.biosafety.mapper.DewormMapper; +import com.zhyc.module.biosafety.service.IDewormService; + +/** + * 驱虫Service业务层处理 + * + * @author ruoyi + * @date 2025-07-15 + */ +@Service +public class DewormServiceImpl implements IDewormService +{ + @Autowired + private DewormMapper dewormMapper; + + /** + * 查询驱虫 + * + * @param id 驱虫主键 + * @return 驱虫 + */ + @Override + public Deworm selectDewormById(Long id) + { + return dewormMapper.selectDewormById(id); + } + + /** + * 查询驱虫列表 + * + * @param deworm 驱虫 + * @return 驱虫 + */ + @Override + public List selectDewormList(Deworm deworm) + { + return dewormMapper.selectDewormList(deworm); + } + + /** + * 新增驱虫 + * + * @param deworm 驱虫 + * @return 结果 + */ + @Override + public int insertDeworm(Deworm deworm) + { + deworm.setCreateTime(DateUtils.getNowDate()); + return dewormMapper.insertDeworm(deworm); + } + + /** + * 修改驱虫 + * + * @param deworm 驱虫 + * @return 结果 + */ + @Override + public int updateDeworm(Deworm deworm) + { + deworm.setUpdateTime(DateUtils.getNowDate()); + return dewormMapper.updateDeworm(deworm); + } + + /** + * 批量删除驱虫 + * + * @param ids 需要删除的驱虫主键 + * @return 结果 + */ + @Override + public int deleteDewormByIds(Long[] ids) + { + return dewormMapper.deleteDewormByIds(ids); + } + + /** + * 删除驱虫信息 + * + * @param id 驱虫主键 + * @return 结果 + */ + @Override + public int deleteDewormById(Long id) + { + return dewormMapper.deleteDewormById(id); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/DiagnosisServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/DiagnosisServiceImpl.java new file mode 100644 index 0000000..319a658 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/DiagnosisServiceImpl.java @@ -0,0 +1,95 @@ +package com.zhyc.module.biosafety.service.impl; + +import java.util.List; +import com.zhyc.common.utils.DateUtils; +import com.zhyc.module.biosafety.mapper.DiagnosisMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.zhyc.module.biosafety.domain.Diagnosis; +import com.zhyc.module.biosafety.service.IDiagnosisService; + +/** + * 诊疗结果Service业务层处理 + * + * @author ruoyi + * @date 2025-07-15 + */ +@Service +public class DiagnosisServiceImpl implements IDiagnosisService +{ + @Autowired + private DiagnosisMapper diagnosisMapper; + + /** + * 查询诊疗结果 + * + * @param id 诊疗结果主键 + * @return 诊疗结果 + */ + @Override + public Diagnosis selectDiagnosisById(Long id) + { + return diagnosisMapper.selectDiagnosisById(id); + } + + /** + * 查询诊疗结果列表 + * + * @param diagnosis 诊疗结果 + * @return 诊疗结果 + */ + @Override + public List selectDiagnosisList(Diagnosis diagnosis) + { + return diagnosisMapper.selectDiagnosisList(diagnosis); + } + + /** + * 新增诊疗结果 + * + * @param diagnosis 诊疗结果 + * @return 结果 + */ + @Override + public int insertDiagnosis(Diagnosis diagnosis) + { + diagnosis.setCreateTime(DateUtils.getNowDate()); + return diagnosisMapper.insertDiagnosis(diagnosis); + } + + /** + * 修改诊疗结果 + * + * @param diagnosis 诊疗结果 + * @return 结果 + */ + @Override + public int updateDiagnosis(Diagnosis diagnosis) + { + return diagnosisMapper.updateDiagnosis(diagnosis); + } + + /** + * 批量删除诊疗结果 + * + * @param ids 需要删除的诊疗结果主键 + * @return 结果 + */ + @Override + public int deleteDiagnosisByIds(Long[] ids) + { + return diagnosisMapper.deleteDiagnosisByIds(ids); + } + + /** + * 删除诊疗结果信息 + * + * @param id 诊疗结果主键 + * @return 结果 + */ + @Override + public int deleteDiagnosisById(Long id) + { + return diagnosisMapper.deleteDiagnosisById(id); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/DisinfectServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/DisinfectServiceImpl.java new file mode 100644 index 0000000..18a014e --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/DisinfectServiceImpl.java @@ -0,0 +1,96 @@ +package com.zhyc.module.biosafety.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.biosafety.mapper.DisinfectMapper; +import com.zhyc.module.biosafety.domain.Disinfect; +import com.zhyc.module.biosafety.service.IDisinfectService; + +/** + * 消毒记录Service业务层处理 + * + * @author ruoyi + * @date 2025-07-15 + */ +@Service +public class DisinfectServiceImpl implements IDisinfectService +{ + @Autowired + private DisinfectMapper disinfectMapper; + + /** + * 查询消毒记录 + * + * @param id 消毒记录主键 + * @return 消毒记录 + */ + @Override + public Disinfect selectDisinfectById(Long id) + { + return disinfectMapper.selectDisinfectById(id); + } + + /** + * 查询消毒记录列表 + * + * @param disinfect 消毒记录 + * @return 消毒记录 + */ + @Override + public List selectDisinfectList(Disinfect disinfect) + { + return disinfectMapper.selectDisinfectList(disinfect); + } + + /** + * 新增消毒记录 + * + * @param disinfect 消毒记录 + * @return 结果 + */ + @Override + public int insertDisinfect(Disinfect disinfect) + { + disinfect.setCreateTime(DateUtils.getNowDate()); + return disinfectMapper.insertDisinfect(disinfect); + } + + /** + * 修改消毒记录 + * + * @param disinfect 消毒记录 + * @return 结果 + */ + @Override + public int updateDisinfect(Disinfect disinfect) + { + disinfect.setUpdateTime(DateUtils.getNowDate()); + return disinfectMapper.updateDisinfect(disinfect); + } + + /** + * 批量删除消毒记录 + * + * @param ids 需要删除的消毒记录主键 + * @return 结果 + */ + @Override + public int deleteDisinfectByIds(Long[] ids) + { + return disinfectMapper.deleteDisinfectByIds(ids); + } + + /** + * 删除消毒记录信息 + * + * @param id 消毒记录主键 + * @return 结果 + */ + @Override + public int deleteDisinfectById(Long id) + { + return disinfectMapper.deleteDisinfectById(id); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/HealthServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/HealthServiceImpl.java new file mode 100644 index 0000000..7986bf7 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/HealthServiceImpl.java @@ -0,0 +1,96 @@ +package com.zhyc.module.biosafety.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.biosafety.mapper.HealthMapper; +import com.zhyc.module.biosafety.domain.Health; +import com.zhyc.module.biosafety.service.IHealthService; + +/** + * 保健Service业务层处理 + * + * @author ruoyi + * @date 2025-07-15 + */ +@Service +public class HealthServiceImpl implements IHealthService +{ + @Autowired + private HealthMapper healthMapper; + + /** + * 查询保健 + * + * @param id 保健主键 + * @return 保健 + */ + @Override + public Health selectHealthById(Long id) + { + return healthMapper.selectHealthById(id); + } + + /** + * 查询保健列表 + * + * @param health 保健 + * @return 保健 + */ + @Override + public List selectHealthList(Health health) + { + return healthMapper.selectHealthList(health); + } + + /** + * 新增保健 + * + * @param health 保健 + * @return 结果 + */ + @Override + public int insertHealth(Health health) + { + health.setCreateTime(DateUtils.getNowDate()); + return healthMapper.insertHealth(health); + } + + /** + * 修改保健 + * + * @param health 保健 + * @return 结果 + */ + @Override + public int updateHealth(Health health) + { + health.setUpdateTime(DateUtils.getNowDate()); + return healthMapper.updateHealth(health); + } + + /** + * 批量删除保健 + * + * @param ids 需要删除的保健主键 + * @return 结果 + */ + @Override + public int deleteHealthByIds(Long[] ids) + { + return healthMapper.deleteHealthByIds(ids); + } + + /** + * 删除保健信息 + * + * @param id 保健主键 + * @return 结果 + */ + @Override + public int deleteHealthById(Long id) + { + return healthMapper.deleteHealthById(id); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/ImmunityServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/ImmunityServiceImpl.java new file mode 100644 index 0000000..145901b --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/ImmunityServiceImpl.java @@ -0,0 +1,96 @@ +package com.zhyc.module.biosafety.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.biosafety.mapper.ImmunityMapper; +import com.zhyc.module.biosafety.domain.Immunity; +import com.zhyc.module.biosafety.service.IImmunityService; + +/** + * 免疫Service业务层处理 + * + * @author ruoyi + * @date 2025-07-15 + */ +@Service +public class ImmunityServiceImpl implements IImmunityService +{ + @Autowired + private ImmunityMapper immunityMapper; + + /** + * 查询免疫 + * + * @param id 免疫主键 + * @return 免疫 + */ + @Override + public Immunity selectImmunityById(Long id) + { + return immunityMapper.selectImmunityById(id); + } + + /** + * 查询免疫列表 + * + * @param immunity 免疫 + * @return 免疫 + */ + @Override + public List selectImmunityList(Immunity immunity) + { + return immunityMapper.selectImmunityList(immunity); + } + + /** + * 新增免疫 + * + * @param immunity 免疫 + * @return 结果 + */ + @Override + public int insertImmunity(Immunity immunity) + { + immunity.setCreateTime(DateUtils.getNowDate()); + return immunityMapper.insertImmunity(immunity); + } + + /** + * 修改免疫 + * + * @param immunity 免疫 + * @return 结果 + */ + @Override + public int updateImmunity(Immunity immunity) + { + immunity.setUpdateTime(DateUtils.getNowDate()); + return immunityMapper.updateImmunity(immunity); + } + + /** + * 批量删除免疫 + * + * @param ids 需要删除的免疫主键 + * @return 结果 + */ + @Override + public int deleteImmunityByIds(Long[] ids) + { + return immunityMapper.deleteImmunityByIds(ids); + } + + /** + * 删除免疫信息 + * + * @param id 免疫主键 + * @return 结果 + */ + @Override + public int deleteImmunityById(Long id) + { + return immunityMapper.deleteImmunityById(id); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/QuarantineItemsServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/QuarantineItemsServiceImpl.java new file mode 100644 index 0000000..541a759 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/QuarantineItemsServiceImpl.java @@ -0,0 +1,94 @@ +package com.zhyc.module.biosafety.service.impl; + +import java.util.List; + +import com.zhyc.module.biosafety.domain.QuarantineItems; +import com.zhyc.module.biosafety.mapper.QuarantineItemsMapper; +import com.zhyc.module.biosafety.service.IQuarantineItemsService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * 检疫项目Service业务层处理 + * + * @author ruoyi + * @date 2025-07-14 + */ +@Service +public class QuarantineItemsServiceImpl implements IQuarantineItemsService +{ + @Autowired + private QuarantineItemsMapper quarantineItemsMapper; + + /** + * 查询检疫项目 + * + * @param id 检疫项目主键 + * @return 检疫项目 + */ + @Override + public QuarantineItems selectQuarantineItemsById(Long id) + { + return quarantineItemsMapper.selectQuarantineItemsById(id); + } + + /** + * 查询检疫项目列表 + * + * @param quarantineItems 检疫项目 + * @return 检疫项目 + */ + @Override + public List selectQuarantineItemsList(QuarantineItems quarantineItems) + { + return quarantineItemsMapper.selectQuarantineItemsList(quarantineItems); + } + + /** + * 新增检疫项目 + * + * @param quarantineItems 检疫项目 + * @return 结果 + */ + @Override + public int insertQuarantineItems(QuarantineItems quarantineItems) + { + return quarantineItemsMapper.insertQuarantineItems(quarantineItems); + } + + /** + * 修改检疫项目 + * + * @param quarantineItems 检疫项目 + * @return 结果 + */ + @Override + public int updateQuarantineItems(QuarantineItems quarantineItems) + { + return quarantineItemsMapper.updateQuarantineItems(quarantineItems); + } + + /** + * 批量删除检疫项目 + * + * @param ids 需要删除的检疫项目主键 + * @return 结果 + */ + @Override + public int deleteQuarantineItemsByIds(Long[] ids) + { + return quarantineItemsMapper.deleteQuarantineItemsByIds(ids); + } + + /** + * 删除检疫项目信息 + * + * @param id 检疫项目主键 + * @return 结果 + */ + @Override + public int deleteQuarantineItemsById(Long id) + { + return quarantineItemsMapper.deleteQuarantineItemsById(id); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/QuarantineReportServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/QuarantineReportServiceImpl.java new file mode 100644 index 0000000..7c693f5 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/QuarantineReportServiceImpl.java @@ -0,0 +1,96 @@ +package com.zhyc.module.biosafety.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.biosafety.mapper.QuarantineReportMapper; +import com.zhyc.module.biosafety.domain.QuarantineReport; +import com.zhyc.module.biosafety.service.IQuarantineReportService; + +/** + * 检疫记录Service业务层处理 + * + * @author ruoyi + * @date 2025-07-14 + */ +@Service +public class QuarantineReportServiceImpl implements IQuarantineReportService +{ + @Autowired + private QuarantineReportMapper quarantineReportMapper; + + /** + * 查询检疫记录 + * + * @param id 检疫记录主键 + * @return 检疫记录 + */ + @Override + public QuarantineReport selectQuarantineReportById(Long id) + { + return quarantineReportMapper.selectQuarantineReportById(id); + } + + /** + * 查询检疫记录列表 + * + * @param quarantineReport 检疫记录 + * @return 检疫记录 + */ + @Override + public List selectQuarantineReportList(QuarantineReport quarantineReport) + { + return quarantineReportMapper.selectQuarantineReportList(quarantineReport); + } + + /** + * 新增检疫记录 + * + * @param quarantineReport 检疫记录 + * @return 结果 + */ + @Override + public int insertQuarantineReport(QuarantineReport quarantineReport) + { + quarantineReport.setCreateTime(DateUtils.getNowDate()); + return quarantineReportMapper.insertQuarantineReport(quarantineReport); + } + + /** + * 修改检疫记录 + * + * @param quarantineReport 检疫记录 + * @return 结果 + */ + @Override + public int updateQuarantineReport(QuarantineReport quarantineReport) + { + quarantineReport.setUpdateTime(DateUtils.getNowDate()); + return quarantineReportMapper.updateQuarantineReport(quarantineReport); + } + + /** + * 批量删除检疫记录 + * + * @param ids 需要删除的检疫记录主键 + * @return 结果 + */ + @Override + public int deleteQuarantineReportByIds(Long[] ids) + { + return quarantineReportMapper.deleteQuarantineReportByIds(ids); + } + + /** + * 删除检疫记录信息 + * + * @param id 检疫记录主键 + * @return 结果 + */ + @Override + public int deleteQuarantineReportById(Long id) + { + return quarantineReportMapper.deleteQuarantineReportById(id); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/QuarantineSampleServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/QuarantineSampleServiceImpl.java new file mode 100644 index 0000000..6ac853d --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/QuarantineSampleServiceImpl.java @@ -0,0 +1,93 @@ +package com.zhyc.module.biosafety.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.zhyc.module.biosafety.mapper.QuarantineSampleMapper; +import com.zhyc.module.biosafety.domain.QuarantineSample; +import com.zhyc.module.biosafety.service.IQuarantineSampleService; + +/** + * 样品类型Service业务层处理 + * + * @author ruoyi + * @date 2025-07-14 + */ +@Service +public class QuarantineSampleServiceImpl implements IQuarantineSampleService +{ + @Autowired + private QuarantineSampleMapper quarantineSampleMapper; + + /** + * 查询样品类型 + * + * @param id 样品类型主键 + * @return 样品类型 + */ + @Override + public QuarantineSample selectQuarantineSampleById(Long id) + { + return quarantineSampleMapper.selectQuarantineSampleById(id); + } + + /** + * 查询样品类型列表 + * + * @param quarantineSample 样品类型 + * @return 样品类型 + */ + @Override + public List selectQuarantineSampleList(QuarantineSample quarantineSample) + { + return quarantineSampleMapper.selectQuarantineSampleList(quarantineSample); + } + + /** + * 新增样品类型 + * + * @param quarantineSample 样品类型 + * @return 结果 + */ + @Override + public int insertQuarantineSample(QuarantineSample quarantineSample) + { + return quarantineSampleMapper.insertQuarantineSample(quarantineSample); + } + + /** + * 修改样品类型 + * + * @param quarantineSample 样品类型 + * @return 结果 + */ + @Override + public int updateQuarantineSample(QuarantineSample quarantineSample) + { + return quarantineSampleMapper.updateQuarantineSample(quarantineSample); + } + + /** + * 批量删除样品类型 + * + * @param ids 需要删除的样品类型主键 + * @return 结果 + */ + @Override + public int deleteQuarantineSampleByIds(Long[] ids) + { + return quarantineSampleMapper.deleteQuarantineSampleByIds(ids); + } + + /** + * 删除样品类型信息 + * + * @param id 样品类型主键 + * @return 结果 + */ + @Override + public int deleteQuarantineSampleById(Long id) + { + return quarantineSampleMapper.deleteQuarantineSampleById(id); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/TreatmentServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/TreatmentServiceImpl.java new file mode 100644 index 0000000..502a05b --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/TreatmentServiceImpl.java @@ -0,0 +1,96 @@ +package com.zhyc.module.biosafety.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.biosafety.mapper.TreatmentMapper; +import com.zhyc.module.biosafety.domain.Treatment; +import com.zhyc.module.biosafety.service.ITreatmentService; + +/** + * 治疗记录Service业务层处理 + * + * @author ruoyi + * @date 2025-07-15 + */ +@Service +public class TreatmentServiceImpl implements ITreatmentService +{ + @Autowired + private TreatmentMapper treatmentMapper; + + /** + * 查询治疗记录 + * + * @param id 治疗记录主键 + * @return 治疗记录 + */ + @Override + public Treatment selectTreatmentById(Long id) + { + return treatmentMapper.selectTreatmentById(id); + } + + /** + * 查询治疗记录列表 + * + * @param treatment 治疗记录 + * @return 治疗记录 + */ + @Override + public List selectTreatmentList(Treatment treatment) + { + return treatmentMapper.selectTreatmentList(treatment); + } + + /** + * 新增治疗记录 + * + * @param treatment 治疗记录 + * @return 结果 + */ + @Override + public int insertTreatment(Treatment treatment) + { + treatment.setCreateTime(DateUtils.getNowDate()); + return treatmentMapper.insertTreatment(treatment); + } + + /** + * 修改治疗记录 + * + * @param treatment 治疗记录 + * @return 结果 + */ + @Override + public int updateTreatment(Treatment treatment) + { + treatment.setUpdateTime(DateUtils.getNowDate()); + return treatmentMapper.updateTreatment(treatment); + } + + /** + * 批量删除治疗记录 + * + * @param ids 需要删除的治疗记录主键 + * @return 结果 + */ + @Override + public int deleteTreatmentByIds(Long[] ids) + { + return treatmentMapper.deleteTreatmentByIds(ids); + } + + /** + * 删除治疗记录信息 + * + * @param id 治疗记录主键 + * @return 结果 + */ + @Override + public int deleteTreatmentById(Long id) + { + return treatmentMapper.deleteTreatmentById(id); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/controller/XzDryMatterCorrectionController.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/dryMatterCorrection/controller/XzDryMatterCorrectionController.java similarity index 81% rename from zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/controller/XzDryMatterCorrectionController.java rename to zhyc-module/src/main/java/com/zhyc/module/dairyProducts/dryMatterCorrection/controller/XzDryMatterCorrectionController.java index fdb90f6..d250d5c 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/controller/XzDryMatterCorrectionController.java +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/dryMatterCorrection/controller/XzDryMatterCorrectionController.java @@ -1,4 +1,4 @@ -package com.zhyc.module.dryMatterCorrection.controller; +package com.zhyc.module.dairyProducts.dryMatterCorrection.controller; import java.util.List; import javax.servlet.http.HttpServletResponse; @@ -16,11 +16,17 @@ 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.dryMatterCorrection.domain.XzDryMatterCorrection; -import com.zhyc.module.dryMatterCorrection.service.IXzDryMatterCorrectionService; +import com.zhyc.module.dairyProducts.dryMatterCorrection.domain.XzDryMatterCorrection; +import com.zhyc.module.dairyProducts.dryMatterCorrection.service.IXzDryMatterCorrectionService; import com.zhyc.common.utils.poi.ExcelUtil; import com.zhyc.common.core.page.TableDataInfo; +/** + * 干物质校正Controller + * + * @author ruoyi + * @date 2025-07-12 + */ @RestController @RequestMapping("/dryMatterCorrection/dryMatterCorrection") public class XzDryMatterCorrectionController extends BaseController @@ -28,33 +34,34 @@ public class XzDryMatterCorrectionController extends BaseController @Autowired private IXzDryMatterCorrectionService xzDryMatterCorrectionService; + /** + * 查询干物质校正列表 + */ @PreAuthorize("@ss.hasPermi('dryMatterCorrection:dryMatterCorrection:list')") @GetMapping("/list") public TableDataInfo list(XzDryMatterCorrection xzDryMatterCorrection) { - // 只保留年月查询条件,清空其他查询条件 - XzDryMatterCorrection query = new XzDryMatterCorrection(); - query.setDatetime(xzDryMatterCorrection.getDatetime()); - startPage(); - List list = xzDryMatterCorrectionService.selectXzDryMatterCorrectionList(query); + List list = xzDryMatterCorrectionService.selectXzDryMatterCorrectionList(xzDryMatterCorrection); return getDataTable(list); } + /** + * 导出干物质校正列表 + */ @PreAuthorize("@ss.hasPermi('dryMatterCorrection:dryMatterCorrection:export')") @Log(title = "干物质校正", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, XzDryMatterCorrection xzDryMatterCorrection) { - // 只保留年月查询条件,清空其他查询条件 - XzDryMatterCorrection query = new XzDryMatterCorrection(); - query.setDatetime(xzDryMatterCorrection.getDatetime()); - - List list = xzDryMatterCorrectionService.selectXzDryMatterCorrectionList(query); + List list = xzDryMatterCorrectionService.selectXzDryMatterCorrectionList(xzDryMatterCorrection); ExcelUtil util = new ExcelUtil(XzDryMatterCorrection.class); util.exportExcel(response, list, "干物质校正数据"); } + /** + * 获取干物质校正详细信息 + */ @PreAuthorize("@ss.hasPermi('dryMatterCorrection:dryMatterCorrection:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) @@ -62,6 +69,9 @@ public class XzDryMatterCorrectionController extends BaseController return success(xzDryMatterCorrectionService.selectXzDryMatterCorrectionById(id)); } + /** + * 新增干物质校正 + */ @PreAuthorize("@ss.hasPermi('dryMatterCorrection:dryMatterCorrection:add')") @Log(title = "干物质校正", businessType = BusinessType.INSERT) @PostMapping @@ -70,6 +80,9 @@ public class XzDryMatterCorrectionController extends BaseController return toAjax(xzDryMatterCorrectionService.insertXzDryMatterCorrection(xzDryMatterCorrection)); } + /** + * 修改干物质校正 + */ @PreAuthorize("@ss.hasPermi('dryMatterCorrection:dryMatterCorrection:edit')") @Log(title = "干物质校正", businessType = BusinessType.UPDATE) @PutMapping @@ -78,11 +91,14 @@ public class XzDryMatterCorrectionController extends BaseController return toAjax(xzDryMatterCorrectionService.updateXzDryMatterCorrection(xzDryMatterCorrection)); } + /** + * 删除干物质校正 + */ @PreAuthorize("@ss.hasPermi('dryMatterCorrection:dryMatterCorrection:remove')") @Log(title = "干物质校正", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") + @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(xzDryMatterCorrectionService.deleteXzDryMatterCorrectionByIds(ids)); } -} \ No newline at end of file +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/dryMatterCorrection/domain/XzDryMatterCorrection.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/dryMatterCorrection/domain/XzDryMatterCorrection.java new file mode 100644 index 0000000..5ea4e82 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/dryMatterCorrection/domain/XzDryMatterCorrection.java @@ -0,0 +1,56 @@ +package com.zhyc.module.dairyProducts.dryMatterCorrection.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; + +public class XzDryMatterCorrection extends BaseEntity { + private static final long serialVersionUID = 1L; + + private Long id; + + @JsonFormat(pattern = "yyyy-MM") + @Excel(name = "年月", width = 30, dateFormat = "yyyy-MM") + private Date datetime; + + @Excel(name = "厂区") + private String factory; + + @Excel(name = "干物质含量") + private Double content; + + @Excel(name = "干物质标准") + private Double standard; + + @Excel(name = "干物质系数") + private Double coefficient; + + // getters and setters... + public Long getId() { return id; } + public void setId(Long id) { this.id = id; } + public Date getDatetime() { return datetime; } + public void setDatetime(Date datetime) { this.datetime = datetime; } + public String getFactory() { return factory; } + public void setFactory(String factory) { this.factory = factory; } + public Double getContent() { return content; } + public void setContent(Double content) { this.content = content; } + public Double getStandard() { return standard; } + public void setStandard(Double standard) { this.standard = standard; } + public Double getCoefficient() { return coefficient; } + public void setCoefficient(Double coefficient) { this.coefficient = coefficient; } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", id) + .append("datetime", datetime) + .append("factory", factory) + .append("content", content) + .append("standard", standard) + .append("coefficient", coefficient) + .toString(); + } +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/mapper/XzDryMatterCorrectionMapper.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/dryMatterCorrection/mapper/XzDryMatterCorrectionMapper.java similarity index 88% rename from zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/mapper/XzDryMatterCorrectionMapper.java rename to zhyc-module/src/main/java/com/zhyc/module/dairyProducts/dryMatterCorrection/mapper/XzDryMatterCorrectionMapper.java index 912eaab..8566be9 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/mapper/XzDryMatterCorrectionMapper.java +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/dryMatterCorrection/mapper/XzDryMatterCorrectionMapper.java @@ -1,13 +1,13 @@ -package com.zhyc.module.dryMatterCorrection.mapper; +package com.zhyc.module.dairyProducts.dryMatterCorrection.mapper; import java.util.List; -import com.zhyc.module.dryMatterCorrection.domain.XzDryMatterCorrection; +import com.zhyc.module.dairyProducts.dryMatterCorrection.domain.XzDryMatterCorrection; /** * 干物质校正Mapper接口 * * @author ruoyi - * @date 2025-07-11 + * @date 2025-07-12 */ public interface XzDryMatterCorrectionMapper { diff --git a/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/service/IXzDryMatterCorrectionService.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/dryMatterCorrection/service/IXzDryMatterCorrectionService.java similarity index 82% rename from zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/service/IXzDryMatterCorrectionService.java rename to zhyc-module/src/main/java/com/zhyc/module/dairyProducts/dryMatterCorrection/service/IXzDryMatterCorrectionService.java index 90721f6..ce3a891 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/service/IXzDryMatterCorrectionService.java +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/dryMatterCorrection/service/IXzDryMatterCorrectionService.java @@ -1,19 +1,19 @@ -package com.zhyc.module.dryMatterCorrection.service; +package com.zhyc.module.dairyProducts.dryMatterCorrection.service; import java.util.List; -import com.zhyc.module.dryMatterCorrection.domain.XzDryMatterCorrection; +import com.zhyc.module.dairyProducts.dryMatterCorrection.domain.XzDryMatterCorrection; /** * 干物质校正Service接口 - * + * * @author ruoyi - * @date 2025-07-11 + * @date 2025-07-12 */ -public interface IXzDryMatterCorrectionService +public interface IXzDryMatterCorrectionService { /** * 查询干物质校正 - * + * * @param id 干物质校正主键 * @return 干物质校正 */ @@ -21,7 +21,7 @@ public interface IXzDryMatterCorrectionService /** * 查询干物质校正列表 - * + * * @param xzDryMatterCorrection 干物质校正 * @return 干物质校正集合 */ @@ -29,7 +29,7 @@ public interface IXzDryMatterCorrectionService /** * 新增干物质校正 - * + * * @param xzDryMatterCorrection 干物质校正 * @return 结果 */ @@ -37,7 +37,7 @@ public interface IXzDryMatterCorrectionService /** * 修改干物质校正 - * + * * @param xzDryMatterCorrection 干物质校正 * @return 结果 */ @@ -45,7 +45,7 @@ public interface IXzDryMatterCorrectionService /** * 批量删除干物质校正 - * + * * @param ids 需要删除的干物质校正主键集合 * @return 结果 */ @@ -53,7 +53,7 @@ public interface IXzDryMatterCorrectionService /** * 删除干物质校正信息 - * + * * @param id 干物质校正主键 * @return 结果 */ diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/dryMatterCorrection/service/impl/XzDryMatterCorrectionServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/dryMatterCorrection/service/impl/XzDryMatterCorrectionServiceImpl.java new file mode 100644 index 0000000..dcf666f --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/dryMatterCorrection/service/impl/XzDryMatterCorrectionServiceImpl.java @@ -0,0 +1,93 @@ +package com.zhyc.module.dairyProducts.dryMatterCorrection.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.zhyc.module.dairyProducts.dryMatterCorrection.mapper.XzDryMatterCorrectionMapper; +import com.zhyc.module.dairyProducts.dryMatterCorrection.domain.XzDryMatterCorrection; +import com.zhyc.module.dairyProducts.dryMatterCorrection.service.IXzDryMatterCorrectionService; + +/** + * 干物质校正Service业务层处理 + * + * @author ruoyi + * @date 2025-07-12 + */ +@Service +public class XzDryMatterCorrectionServiceImpl implements IXzDryMatterCorrectionService +{ + @Autowired + private XzDryMatterCorrectionMapper xzDryMatterCorrectionMapper; + + /** + * 查询干物质校正 + * + * @param id 干物质校正主键 + * @return 干物质校正 + */ + @Override + public XzDryMatterCorrection selectXzDryMatterCorrectionById(Long id) + { + return xzDryMatterCorrectionMapper.selectXzDryMatterCorrectionById(id); + } + + /** + * 查询干物质校正列表 + * + * @param xzDryMatterCorrection 干物质校正 + * @return 干物质校正 + */ + @Override + public List selectXzDryMatterCorrectionList(XzDryMatterCorrection xzDryMatterCorrection) + { + return xzDryMatterCorrectionMapper.selectXzDryMatterCorrectionList(xzDryMatterCorrection); + } + + /** + * 新增干物质校正 + * + * @param xzDryMatterCorrection 干物质校正 + * @return 结果 + */ + @Override + public int insertXzDryMatterCorrection(XzDryMatterCorrection xzDryMatterCorrection) + { + return xzDryMatterCorrectionMapper.insertXzDryMatterCorrection(xzDryMatterCorrection); + } + + /** + * 修改干物质校正 + * + * @param xzDryMatterCorrection 干物质校正 + * @return 结果 + */ + @Override + public int updateXzDryMatterCorrection(XzDryMatterCorrection xzDryMatterCorrection) + { + return xzDryMatterCorrectionMapper.updateXzDryMatterCorrection(xzDryMatterCorrection); + } + + /** + * 批量删除干物质校正 + * + * @param ids 需要删除的干物质校正主键 + * @return 结果 + */ + @Override + public int deleteXzDryMatterCorrectionByIds(Long[] ids) + { + return xzDryMatterCorrectionMapper.deleteXzDryMatterCorrectionByIds(ids); + } + + /** + * 删除干物质校正信息 + * + * @param id 干物质校正主键 + * @return 结果 + */ + @Override + public int deleteXzDryMatterCorrectionById(Long id) + { + return xzDryMatterCorrectionMapper.deleteXzDryMatterCorrectionById(id); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/parityCorrection/controller/XzParityCorrectionController.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/parityCorrection/controller/XzParityCorrectionController.java new file mode 100644 index 0000000..edc1fba --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/parityCorrection/controller/XzParityCorrectionController.java @@ -0,0 +1,104 @@ +package com.zhyc.module.dairyProducts.parityCorrection.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.dairyProducts.parityCorrection.domain.XzParityCorrection; +import com.zhyc.module.dairyProducts.parityCorrection.service.IXzParityCorrectionService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 胎次校正Controller + * + * @author ruoyi + * @date 2025-07-14 + */ +@RestController +@RequestMapping("/parityCorrection/parityCorrection") +public class XzParityCorrectionController extends BaseController +{ + @Autowired + private IXzParityCorrectionService xzParityCorrectionService; + + /** + * 查询胎次校正列表 + */ + @PreAuthorize("@ss.hasPermi('parityCorrection:parityCorrection:list')") + @GetMapping("/list") + public TableDataInfo list(XzParityCorrection xzParityCorrection) + { + startPage(); + List list = xzParityCorrectionService.selectXzParityCorrectionList(xzParityCorrection); + return getDataTable(list); + } + + /** + * 导出胎次校正列表 + */ + @PreAuthorize("@ss.hasPermi('parityCorrection:parityCorrection:export')") + @Log(title = "胎次校正", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, XzParityCorrection xzParityCorrection) + { + List list = xzParityCorrectionService.selectXzParityCorrectionList(xzParityCorrection); + ExcelUtil util = new ExcelUtil(XzParityCorrection.class); + util.exportExcel(response, list, "胎次校正数据"); + } + + /** + * 获取胎次校正详细信息 + */ + @PreAuthorize("@ss.hasPermi('parityCorrection:parityCorrection:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(xzParityCorrectionService.selectXzParityCorrectionById(id)); + } + + /** + * 新增胎次校正 + */ + @PreAuthorize("@ss.hasPermi('parityCorrection:parityCorrection:add')") + @Log(title = "胎次校正", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody XzParityCorrection xzParityCorrection) + { + return toAjax(xzParityCorrectionService.insertXzParityCorrection(xzParityCorrection)); + } + + /** + * 修改胎次校正 + */ + @PreAuthorize("@ss.hasPermi('parityCorrection:parityCorrection:edit')") + @Log(title = "胎次校正", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody XzParityCorrection xzParityCorrection) + { + return toAjax(xzParityCorrectionService.updateXzParityCorrection(xzParityCorrection)); + } + + /** + * 删除胎次校正 + */ + @PreAuthorize("@ss.hasPermi('parityCorrection:parityCorrection:remove')") + @Log(title = "胎次校正", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(xzParityCorrectionService.deleteXzParityCorrectionByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/parityCorrection/domain/XzParityCorrection.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/parityCorrection/domain/XzParityCorrection.java new file mode 100644 index 0000000..3c9e098 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/parityCorrection/domain/XzParityCorrection.java @@ -0,0 +1,67 @@ +package com.zhyc.module.dairyProducts.parityCorrection.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; + +/** + * 胎次校正对象 xz_parity_correction + * + * @author ruoyi + * @date 2025-07-14 + */ +public class XzParityCorrection extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + /** 胎次 */ + @Excel(name = "胎次") + private Integer parity; + + /** 系数 */ + @Excel(name = "系数") + private Double coef; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public void setParity(Integer parity) + { + this.parity = parity; + } + + public Integer getParity() + { + return parity; + } + + public void setCoef(Double coef) + { + this.coef = coef; + } + + public Double getCoef() + { + return coef; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("parity", getParity()) + .append("coef", getCoef()) + .toString(); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/parityCorrection/mapper/XzParityCorrectionMapper.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/parityCorrection/mapper/XzParityCorrectionMapper.java new file mode 100644 index 0000000..392ff04 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/parityCorrection/mapper/XzParityCorrectionMapper.java @@ -0,0 +1,61 @@ +package com.zhyc.module.dairyProducts.parityCorrection.mapper; + +import java.util.List; +import com.zhyc.module.dairyProducts.parityCorrection.domain.XzParityCorrection; + +/** + * 胎次校正Mapper接口 + * + * @author ruoyi + * @date 2025-07-14 + */ +public interface XzParityCorrectionMapper +{ + /** + * 查询胎次校正 + * + * @param id 胎次校正主键 + * @return 胎次校正 + */ + public XzParityCorrection selectXzParityCorrectionById(Long id); + + /** + * 查询胎次校正列表 + * + * @param xzParityCorrection 胎次校正 + * @return 胎次校正集合 + */ + public List selectXzParityCorrectionList(XzParityCorrection xzParityCorrection); + + /** + * 新增胎次校正 + * + * @param xzParityCorrection 胎次校正 + * @return 结果 + */ + public int insertXzParityCorrection(XzParityCorrection xzParityCorrection); + + /** + * 修改胎次校正 + * + * @param xzParityCorrection 胎次校正 + * @return 结果 + */ + public int updateXzParityCorrection(XzParityCorrection xzParityCorrection); + + /** + * 删除胎次校正 + * + * @param id 胎次校正主键 + * @return 结果 + */ + public int deleteXzParityCorrectionById(Long id); + + /** + * 批量删除胎次校正 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteXzParityCorrectionByIds(Long[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/parityCorrection/service/IXzParityCorrectionService.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/parityCorrection/service/IXzParityCorrectionService.java new file mode 100644 index 0000000..099dfa2 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/parityCorrection/service/IXzParityCorrectionService.java @@ -0,0 +1,61 @@ +package com.zhyc.module.dairyProducts.parityCorrection.service; + +import java.util.List; +import com.zhyc.module.dairyProducts.parityCorrection.domain.XzParityCorrection; + +/** + * 胎次校正Service接口 + * + * @author ruoyi + * @date 2025-07-14 + */ +public interface IXzParityCorrectionService +{ + /** + * 查询胎次校正 + * + * @param id 胎次校正主键 + * @return 胎次校正 + */ + public XzParityCorrection selectXzParityCorrectionById(Long id); + + /** + * 查询胎次校正列表 + * + * @param xzParityCorrection 胎次校正 + * @return 胎次校正集合 + */ + public List selectXzParityCorrectionList(XzParityCorrection xzParityCorrection); + + /** + * 新增胎次校正 + * + * @param xzParityCorrection 胎次校正 + * @return 结果 + */ + public int insertXzParityCorrection(XzParityCorrection xzParityCorrection); + + /** + * 修改胎次校正 + * + * @param xzParityCorrection 胎次校正 + * @return 结果 + */ + public int updateXzParityCorrection(XzParityCorrection xzParityCorrection); + + /** + * 批量删除胎次校正 + * + * @param ids 需要删除的胎次校正主键集合 + * @return 结果 + */ + public int deleteXzParityCorrectionByIds(Long[] ids); + + /** + * 删除胎次校正信息 + * + * @param id 胎次校正主键 + * @return 结果 + */ + public int deleteXzParityCorrectionById(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/parityCorrection/service/impl/XzParityCorrectionServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/parityCorrection/service/impl/XzParityCorrectionServiceImpl.java new file mode 100644 index 0000000..ef55515 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/parityCorrection/service/impl/XzParityCorrectionServiceImpl.java @@ -0,0 +1,93 @@ +package com.zhyc.module.dairyProducts.parityCorrection.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.zhyc.module.dairyProducts.parityCorrection.mapper.XzParityCorrectionMapper; +import com.zhyc.module.dairyProducts.parityCorrection.domain.XzParityCorrection; +import com.zhyc.module.dairyProducts.parityCorrection.service.IXzParityCorrectionService; + +/** + * 胎次校正Service业务层处理 + * + * @author ruoyi + * @date 2025-07-14 + */ +@Service +public class XzParityCorrectionServiceImpl implements IXzParityCorrectionService +{ + @Autowired + private XzParityCorrectionMapper xzParityCorrectionMapper; + + /** + * 查询胎次校正 + * + * @param id 胎次校正主键 + * @return 胎次校正 + */ + @Override + public XzParityCorrection selectXzParityCorrectionById(Long id) + { + return xzParityCorrectionMapper.selectXzParityCorrectionById(id); + } + + /** + * 查询胎次校正列表 + * + * @param xzParityCorrection 胎次校正 + * @return 胎次校正 + */ + @Override + public List selectXzParityCorrectionList(XzParityCorrection xzParityCorrection) + { + return xzParityCorrectionMapper.selectXzParityCorrectionList(xzParityCorrection); + } + + /** + * 新增胎次校正 + * + * @param xzParityCorrection 胎次校正 + * @return 结果 + */ + @Override + public int insertXzParityCorrection(XzParityCorrection xzParityCorrection) + { + return xzParityCorrectionMapper.insertXzParityCorrection(xzParityCorrection); + } + + /** + * 修改胎次校正 + * + * @param xzParityCorrection 胎次校正 + * @return 结果 + */ + @Override + public int updateXzParityCorrection(XzParityCorrection xzParityCorrection) + { + return xzParityCorrectionMapper.updateXzParityCorrection(xzParityCorrection); + } + + /** + * 批量删除胎次校正 + * + * @param ids 需要删除的胎次校正主键 + * @return 结果 + */ + @Override + public int deleteXzParityCorrectionByIds(Long[] ids) + { + return xzParityCorrectionMapper.deleteXzParityCorrectionByIds(ids); + } + + /** + * 删除胎次校正信息 + * + * @param id 胎次校正主键 + * @return 结果 + */ + @Override + public int deleteXzParityCorrectionById(Long id) + { + return xzParityCorrectionMapper.deleteXzParityCorrectionById(id); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/weightCorrection/controller/XzWegihCorrectionController.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/weightCorrection/controller/XzWegihCorrectionController.java new file mode 100644 index 0000000..36baa44 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/weightCorrection/controller/XzWegihCorrectionController.java @@ -0,0 +1,104 @@ +package com.zhyc.module.dairyProducts.weightCorrection.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.dairyProducts.weightCorrection.domain.XzWegihCorrection; +import com.zhyc.module.dairyProducts.weightCorrection.service.IXzWegihCorrectionService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 称重校正Controller + * + * @author ruoyi + * @date 2025-07-12 + */ +@RestController +@RequestMapping("/weightCorrection/weightCorrection") +public class XzWegihCorrectionController extends BaseController +{ + @Autowired + private IXzWegihCorrectionService xzWegihCorrectionService; + + /** + * 查询称重校正列表 + */ + @PreAuthorize("@ss.hasPermi('weightCorrection:weightCorrection:list')") + @GetMapping("/list") + public TableDataInfo list(XzWegihCorrection xzWegihCorrection) + { + startPage(); + List list = xzWegihCorrectionService.selectXzWegihCorrectionList(xzWegihCorrection); + return getDataTable(list); + } + + /** + * 导出称重校正列表 + */ + @PreAuthorize("@ss.hasPermi('weightCorrection:weightCorrection:export')") + @Log(title = "称重校正", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, XzWegihCorrection xzWegihCorrection) + { + List list = xzWegihCorrectionService.selectXzWegihCorrectionList(xzWegihCorrection); + ExcelUtil util = new ExcelUtil(XzWegihCorrection.class); + util.exportExcel(response, list, "称重校正数据"); + } + + /** + * 获取称重校正详细信息 + */ + @PreAuthorize("@ss.hasPermi('weightCorrection:weightCorrection:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(xzWegihCorrectionService.selectXzWegihCorrectionById(id)); + } + + /** + * 新增称重校正 + */ + @PreAuthorize("@ss.hasPermi('weightCorrection:weightCorrection:add')") + @Log(title = "称重校正", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody XzWegihCorrection xzWegihCorrection) + { + return toAjax(xzWegihCorrectionService.insertXzWegihCorrection(xzWegihCorrection)); + } + + /** + * 修改称重校正 + */ + @PreAuthorize("@ss.hasPermi('weightCorrection:weightCorrection:edit')") + @Log(title = "称重校正", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody XzWegihCorrection xzWegihCorrection) + { + return toAjax(xzWegihCorrectionService.updateXzWegihCorrection(xzWegihCorrection)); + } + + /** + * 删除称重校正 + */ + @PreAuthorize("@ss.hasPermi('weightCorrection:weightCorrection:remove')") + @Log(title = "称重校正", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(xzWegihCorrectionService.deleteXzWegihCorrectionByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/weightCorrection/domain/XzWegihCorrection.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/weightCorrection/domain/XzWegihCorrection.java new file mode 100644 index 0000000..5a53ac8 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/weightCorrection/domain/XzWegihCorrection.java @@ -0,0 +1,113 @@ +package com.zhyc.module.dairyProducts.weightCorrection.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; + +/** + * 称重校正对象 xz_wegih_correction + * + * @author ruoyi + * @date 2025-07-12 + */ +public class XzWegihCorrection extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + /** 日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date datetime; + + /** 厂区 */ + @Excel(name = "厂区") + private String factory; + + /** 实际奶量 */ + @Excel(name = "实际奶量") + private Double actual; + + /** 系统奶量 */ + @Excel(name = "系统奶量") + private Double systemMilk; // 修改字段名 + + /** 称重系数(计算字段) */ + @Excel(name = "称重系数") + private Double coefficient; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public void setDatetime(Date datetime) + { + this.datetime = datetime; + } + + public Date getDatetime() + { + return datetime; + } + + public void setFactory(String factory) + { + this.factory = factory; + } + + public String getFactory() + { + return factory; + } + + public void setActual(Double actual) + { + this.actual = actual; + } + + public Double getActual() + { + return actual; + } + + public void setSystemMilk(Double systemMilk) + { + this.systemMilk = systemMilk; + } + + public Double getSystemMilk() + { + return systemMilk; + } + + public Double getCoefficient() { + return coefficient; + } + + public void setCoefficient(Double coefficient) { + this.coefficient = coefficient; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("datetime", getDatetime()) + .append("factory", getFactory()) + .append("actual", getActual()) + .append("systemMilk", getSystemMilk()) + .append("coefficient", getCoefficient()) + .toString(); + } +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/weightCorrection/mapper/XzWegihCorrectionMapper.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/weightCorrection/mapper/XzWegihCorrectionMapper.java new file mode 100644 index 0000000..2d1a65b --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/weightCorrection/mapper/XzWegihCorrectionMapper.java @@ -0,0 +1,61 @@ +package com.zhyc.module.dairyProducts.weightCorrection.mapper; + +import java.util.List; +import com.zhyc.module.dairyProducts.weightCorrection.domain.XzWegihCorrection; + +/** + * 称重校正Mapper接口 + * + * @author ruoyi + * @date 2025-07-12 + */ +public interface XzWegihCorrectionMapper +{ + /** + * 查询称重校正 + * + * @param id 称重校正主键 + * @return 称重校正 + */ + public XzWegihCorrection selectXzWegihCorrectionById(Long id); + + /** + * 查询称重校正列表 + * + * @param xzWegihCorrection 称重校正 + * @return 称重校正集合 + */ + public List selectXzWegihCorrectionList(XzWegihCorrection xzWegihCorrection); + + /** + * 新增称重校正 + * + * @param xzWegihCorrection 称重校正 + * @return 结果 + */ + public int insertXzWegihCorrection(XzWegihCorrection xzWegihCorrection); + + /** + * 修改称重校正 + * + * @param xzWegihCorrection 称重校正 + * @return 结果 + */ + public int updateXzWegihCorrection(XzWegihCorrection xzWegihCorrection); + + /** + * 删除称重校正 + * + * @param id 称重校正主键 + * @return 结果 + */ + public int deleteXzWegihCorrectionById(Long id); + + /** + * 批量删除称重校正 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteXzWegihCorrectionByIds(Long[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/weightCorrection/service/IXzWegihCorrectionService.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/weightCorrection/service/IXzWegihCorrectionService.java new file mode 100644 index 0000000..04f070a --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/weightCorrection/service/IXzWegihCorrectionService.java @@ -0,0 +1,61 @@ +package com.zhyc.module.dairyProducts.weightCorrection.service; + +import java.util.List; +import com.zhyc.module.dairyProducts.weightCorrection.domain.XzWegihCorrection; + +/** + * 称重校正Service接口 + * + * @author ruoyi + * @date 2025-07-12 + */ +public interface IXzWegihCorrectionService +{ + /** + * 查询称重校正 + * + * @param id 称重校正主键 + * @return 称重校正 + */ + public XzWegihCorrection selectXzWegihCorrectionById(Long id); + + /** + * 查询称重校正列表 + * + * @param xzWegihCorrection 称重校正 + * @return 称重校正集合 + */ + public List selectXzWegihCorrectionList(XzWegihCorrection xzWegihCorrection); + + /** + * 新增称重校正 + * + * @param xzWegihCorrection 称重校正 + * @return 结果 + */ + public int insertXzWegihCorrection(XzWegihCorrection xzWegihCorrection); + + /** + * 修改称重校正 + * + * @param xzWegihCorrection 称重校正 + * @return 结果 + */ + public int updateXzWegihCorrection(XzWegihCorrection xzWegihCorrection); + + /** + * 批量删除称重校正 + * + * @param ids 需要删除的称重校正主键集合 + * @return 结果 + */ + public int deleteXzWegihCorrectionByIds(Long[] ids); + + /** + * 删除称重校正信息 + * + * @param id 称重校正主键 + * @return 结果 + */ + public int deleteXzWegihCorrectionById(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/weightCorrection/service/impl/XzWegihCorrectionServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/weightCorrection/service/impl/XzWegihCorrectionServiceImpl.java new file mode 100644 index 0000000..a8c59fb --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/weightCorrection/service/impl/XzWegihCorrectionServiceImpl.java @@ -0,0 +1,93 @@ +package com.zhyc.module.dairyProducts.weightCorrection.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.zhyc.module.dairyProducts.weightCorrection.mapper.XzWegihCorrectionMapper; +import com.zhyc.module.dairyProducts.weightCorrection.domain.XzWegihCorrection; +import com.zhyc.module.dairyProducts.weightCorrection.service.IXzWegihCorrectionService; + +/** + * 称重校正Service业务层处理 + * + * @author ruoyi + * @date 2025-07-12 + */ +@Service +public class XzWegihCorrectionServiceImpl implements IXzWegihCorrectionService +{ + @Autowired + private XzWegihCorrectionMapper xzWegihCorrectionMapper; + + /** + * 查询称重校正 + * + * @param id 称重校正主键 + * @return 称重校正 + */ + @Override + public XzWegihCorrection selectXzWegihCorrectionById(Long id) + { + return xzWegihCorrectionMapper.selectXzWegihCorrectionById(id); + } + + /** + * 查询称重校正列表 + * + * @param xzWegihCorrection 称重校正 + * @return 称重校正 + */ + @Override + public List selectXzWegihCorrectionList(XzWegihCorrection xzWegihCorrection) + { + return xzWegihCorrectionMapper.selectXzWegihCorrectionList(xzWegihCorrection); + } + + /** + * 新增称重校正 + * + * @param xzWegihCorrection 称重校正 + * @return 结果 + */ + @Override + public int insertXzWegihCorrection(XzWegihCorrection xzWegihCorrection) + { + return xzWegihCorrectionMapper.insertXzWegihCorrection(xzWegihCorrection); + } + + /** + * 修改称重校正 + * + * @param xzWegihCorrection 称重校正 + * @return 结果 + */ + @Override + public int updateXzWegihCorrection(XzWegihCorrection xzWegihCorrection) + { + return xzWegihCorrectionMapper.updateXzWegihCorrection(xzWegihCorrection); + } + + /** + * 批量删除称重校正 + * + * @param ids 需要删除的称重校正主键 + * @return 结果 + */ + @Override + public int deleteXzWegihCorrectionByIds(Long[] ids) + { + return xzWegihCorrectionMapper.deleteXzWegihCorrectionByIds(ids); + } + + /** + * 删除称重校正信息 + * + * @param id 称重校正主键 + * @return 结果 + */ + @Override + public int deleteXzWegihCorrectionById(Long id) + { + return xzWegihCorrectionMapper.deleteXzWegihCorrectionById(id); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/domain/XzDryMatterCorrection.java b/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/domain/XzDryMatterCorrection.java deleted file mode 100644 index 15045a8..0000000 --- a/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/domain/XzDryMatterCorrection.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.zhyc.module.dryMatterCorrection.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; - -/** - * 干物质校正对象 xz_dry_matter_correction - */ -public class XzDryMatterCorrection extends BaseEntity { - private static final long serialVersionUID = 1L; - - /** 主键ID */ - private Long id; - - /** 年月 */ - @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "年月", width = 30, dateFormat = "yyyy-MM-dd") - private Date datetime; - - /** 厂区 */ - @Excel(name = "厂区") - private String factory; - - /** 干物质含量 */ - @Excel(name = "干物质含量") - private String content; - - /** 干物质标准 */ - @Excel(name = "干物质标准") - private String standard; - - /** 干物质系数 */ - @Excel(name = "干物质系数") // 移除了numFormat - private Double coefficient; - - // Getter和Setter - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Date getDatetime() { - return datetime; - } - - public void setDatetime(Date datetime) { - this.datetime = datetime; - } - - public String getFactory() { - return factory; - } - - public void setFactory(String factory) { - this.factory = factory; - } - - public String getContent() { - return content; - } - - public void setContent(String content) { - this.content = content; - } - - public String getStandard() { - return standard; - } - - public void setStandard(String standard) { - this.standard = standard; - } - - public Double getCoefficient() { - return coefficient; - } - - public void setCoefficient(Double coefficient) { - this.coefficient = coefficient; - } - - @Override - public String toString() { - return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) - .append("id", id) - .append("datetime", datetime) - .append("factory", factory) - .append("content", content) - .append("standard", standard) - .append("coefficient", coefficient) - .toString(); - } -} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/service/impl/XzDryMatterCorrectionServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/service/impl/XzDryMatterCorrectionServiceImpl.java deleted file mode 100644 index cb52506..0000000 --- a/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/service/impl/XzDryMatterCorrectionServiceImpl.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.zhyc.module.dryMatterCorrection.service.impl; - -import java.util.List; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.zhyc.module.dryMatterCorrection.mapper.XzDryMatterCorrectionMapper; -import com.zhyc.module.dryMatterCorrection.domain.XzDryMatterCorrection; -import com.zhyc.module.dryMatterCorrection.service.IXzDryMatterCorrectionService; - -@Service -public class XzDryMatterCorrectionServiceImpl implements IXzDryMatterCorrectionService { - - @Autowired - private XzDryMatterCorrectionMapper xzDryMatterCorrectionMapper; - - @Override - public XzDryMatterCorrection selectXzDryMatterCorrectionById(Long id) { - return xzDryMatterCorrectionMapper.selectXzDryMatterCorrectionById(id); - } - - @Override - public List selectXzDryMatterCorrectionList(XzDryMatterCorrection xzDryMatterCorrection) { - return xzDryMatterCorrectionMapper.selectXzDryMatterCorrectionList(xzDryMatterCorrection); - } - - @Override - public int insertXzDryMatterCorrection(XzDryMatterCorrection xzDryMatterCorrection) { - calculateCoefficient(xzDryMatterCorrection); - return xzDryMatterCorrectionMapper.insertXzDryMatterCorrection(xzDryMatterCorrection); - } - - @Override - public int updateXzDryMatterCorrection(XzDryMatterCorrection xzDryMatterCorrection) { - calculateCoefficient(xzDryMatterCorrection); - return xzDryMatterCorrectionMapper.updateXzDryMatterCorrection(xzDryMatterCorrection); - } - - @Override - public int deleteXzDryMatterCorrectionByIds(Long[] ids) { - return xzDryMatterCorrectionMapper.deleteXzDryMatterCorrectionByIds(ids); - } - - @Override - public int deleteXzDryMatterCorrectionById(Long id) { - return xzDryMatterCorrectionMapper.deleteXzDryMatterCorrectionById(id); - } - - /** - * 计算干物质系数(含格式控制) - */ - private void calculateCoefficient(XzDryMatterCorrection xzDryMatterCorrection) { - if (xzDryMatterCorrection.getContent() != null && - xzDryMatterCorrection.getStandard() != null) { - try { - double content = Double.parseDouble(xzDryMatterCorrection.getContent()); - double standard = Double.parseDouble(xzDryMatterCorrection.getStandard()); - - if (standard != 0) { - double coefficient = content / standard; - // 手动控制4位小数(替代numFormat功能) - xzDryMatterCorrection.setCoefficient( - Double.parseDouble(String.format("%.4f", coefficient)) - ); - } else { - xzDryMatterCorrection.setCoefficient(null); - } - } catch (NumberFormatException e) { - xzDryMatterCorrection.setCoefficient(null); - } - } else { - xzDryMatterCorrection.setCoefficient(null); - } - } -} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/fileManagement/controller/BasSheepGroupController.java b/zhyc-module/src/main/java/com/zhyc/module/fileManagement/controller/BasSheepGroupController.java new file mode 100644 index 0000000..7326485 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/fileManagement/controller/BasSheepGroupController.java @@ -0,0 +1,97 @@ +package com.zhyc.module.fileManagement.controller; + +import com.zhyc.common.annotation.Log; +import com.zhyc.common.core.controller.BaseController; +import com.zhyc.common.core.domain.AjaxResult; +import com.zhyc.common.enums.BusinessType; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.module.fileManagement.domain.BasSheepGroup; +import com.zhyc.module.fileManagement.service.IBasSheepGroupService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 分组管理Controller + * + * @author wyt + * @date 2025-07-14 + */ +@RestController +@RequestMapping("/group_management/group_management") +public class BasSheepGroupController extends BaseController +{ + @Autowired + private IBasSheepGroupService basSheepGroupService; + + /** + * 查询分组管理列表 + */ + @PreAuthorize("@ss.hasPermi('group_management:group_management:list')") + @GetMapping("/list") + public AjaxResult list(BasSheepGroup basSheepGroup) + { + List list = basSheepGroupService.selectBasSheepGroupList(basSheepGroup); + return success(list); + } + + /** + * 导出分组管理列表 + */ + @PreAuthorize("@ss.hasPermi('group_management:group_management:export')") + @Log(title = "分组管理", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, BasSheepGroup basSheepGroup) + { + List list = basSheepGroupService.selectBasSheepGroupList(basSheepGroup); + ExcelUtil util = new ExcelUtil(BasSheepGroup.class); + util.exportExcel(response, list, "分组管理数据"); + } + + /** + * 获取分组管理详细信息 + */ + @PreAuthorize("@ss.hasPermi('group_management:group_management:query')") + @GetMapping(value = "/{groupId}") + public AjaxResult getInfo(@PathVariable("groupId") Long groupId) + { + return success(basSheepGroupService.selectBasSheepGroupByGroupId(groupId)); + } + + /** + * 新增分组管理 + */ + @PreAuthorize("@ss.hasPermi('group_management:group_management:add')") + @Log(title = "分组管理", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody BasSheepGroup basSheepGroup) + { + return toAjax(basSheepGroupService.insertBasSheepGroup(basSheepGroup)); + } + + /** + * 修改分组管理 + */ + @PreAuthorize("@ss.hasPermi('group_management:group_management:edit')") + @Log(title = "分组管理", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody BasSheepGroup basSheepGroup) + { + return toAjax(basSheepGroupService.updateBasSheepGroup(basSheepGroup)); + } + + /** + * 删除分组管理 + */ + @PreAuthorize("@ss.hasPermi('group_management:group_management:remove')") + @Log(title = "分组管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{groupIds}") + public AjaxResult remove(@PathVariable Long[] groupIds) + { + return toAjax(basSheepGroupService.deleteBasSheepGroupByGroupIds(groupIds)); + } + +} 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/fileManagement/controller/DaSheepfoldController.java similarity index 81% rename from zhyc-module/src/main/java/com/zhyc/module/sheepfold_management/controller/DaSheepfoldController.java rename to zhyc-module/src/main/java/com/zhyc/module/fileManagement/controller/DaSheepfoldController.java index e961f58..2a8f8bc 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/sheepfold_management/controller/DaSheepfoldController.java +++ b/zhyc-module/src/main/java/com/zhyc/module/fileManagement/controller/DaSheepfoldController.java @@ -1,25 +1,19 @@ -package com.zhyc.module.sheepfold_management.controller; +package com.zhyc.module.fileManagement.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; +import com.zhyc.common.enums.BusinessType; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.module.fileManagement.domain.DaSheepfold; +import com.zhyc.module.fileManagement.service.IDaSheepfoldService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; /** * 羊舍管理Controller @@ -101,4 +95,16 @@ public class DaSheepfoldController extends BaseController { return toAjax(daSheepfoldService.deleteDaSheepfoldByIds(ids)); } + /** + * 检查羊舍编号是否已存在 + */ + @GetMapping("/checkSheepfoldNoExist") + public AjaxResult checkSheepfoldNoExist( + @RequestParam Long ranchId, + @RequestParam Long sheepfoldTypeId, + @RequestParam String sheepfoldNo + ) { + boolean exist = daSheepfoldService.checkSheepfoldNoExist(ranchId, sheepfoldTypeId, sheepfoldNo); + return AjaxResult.success(exist); + } } diff --git a/zhyc-module/src/main/java/com/zhyc/module/sheep_file/controller/SheepFileController.java b/zhyc-module/src/main/java/com/zhyc/module/fileManagement/controller/SheepFileController.java similarity index 81% rename from zhyc-module/src/main/java/com/zhyc/module/sheep_file/controller/SheepFileController.java rename to zhyc-module/src/main/java/com/zhyc/module/fileManagement/controller/SheepFileController.java index 25ff2e5..4ac2cd7 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/sheep_file/controller/SheepFileController.java +++ b/zhyc-module/src/main/java/com/zhyc/module/fileManagement/controller/SheepFileController.java @@ -1,25 +1,19 @@ -package com.zhyc.module.sheep_file.controller; +package com.zhyc.module.fileManagement.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.SheepFile; -import com.zhyc.module.sheep_file.service.ISheepFileService; -import com.zhyc.common.utils.poi.ExcelUtil; import com.zhyc.common.core.page.TableDataInfo; +import com.zhyc.common.enums.BusinessType; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.module.fileManagement.domain.SheepFile; +import com.zhyc.module.fileManagement.service.ISheepFileService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; /** * 羊只档案Controller diff --git a/zhyc-module/src/main/java/com/zhyc/module/fileManagement/domain/BasSheepGroup.java b/zhyc-module/src/main/java/com/zhyc/module/fileManagement/domain/BasSheepGroup.java new file mode 100644 index 0000000..c39a308 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/fileManagement/domain/BasSheepGroup.java @@ -0,0 +1,113 @@ +package com.zhyc.module.fileManagement.domain; + +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.TreeEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 分组管理对象 bas_sheep_group + * + * @author wyt + * @date 2025-07-14 + */ +public class BasSheepGroup extends TreeEntity +{ + private static final long serialVersionUID = 1L; + + /** 分组ID */ + @Excel(name = "分组ID") + private Long groupId; + + /** 分组名称 */ + @Excel(name = "分组名称") + private String groupName; + + /** 状态(0正常 1停用) */ + @Excel(name = "状态", readConverterExp = "0=正常,1=停用") + private String status; + + /** 状态(0正常 1停用) */ + @Excel(name = "祖级列表") + private String ancestors; + + /** 祖级列表名称 */ + @Excel(name = "祖级列表名称") + private String ancestorNames; + + public void setAncestorNames(String ancestorNames) { + this.ancestorNames = ancestorNames; + } + + public String getAncestorNames() { + return ancestorNames; + } + + @Override + public String getAncestors() { + return ancestors; + } + + @Override + public void setAncestors(String ancestors) { + this.ancestors = ancestors; + } + + /** 是否为叶子节点 */ + private Boolean isLeaf; + + // ... getter 和 setter + public Boolean getIsLeaf() { + return isLeaf; + } + + public void setIsLeaf(Boolean isLeaf) { + this.isLeaf = isLeaf; + } + + public void setGroupId(Long groupId) + { + this.groupId = groupId; + } + + public Long getGroupId() + { + return groupId; + } + + public void setGroupName(String groupName) + { + this.groupName = groupName; + } + + public String getGroupName() + { + return groupName; + } + + public void setStatus(String status) + { + this.status = status; + } + + public String getStatus() + { + return status; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("groupId", getGroupId()) + .append("parentId", getParentId()) + .append("groupName", getGroupName()) + .append("ancestors", getAncestors()) + .append("ancestorNames", getAncestorNames()) // 新增这一行 + .append("status", getStatus()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} 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/fileManagement/domain/DaSheepfold.java similarity index 98% rename from zhyc-module/src/main/java/com/zhyc/module/sheepfold_management/domain/DaSheepfold.java rename to zhyc-module/src/main/java/com/zhyc/module/fileManagement/domain/DaSheepfold.java index ab1319e..4b19b03 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/sheepfold_management/domain/DaSheepfold.java +++ b/zhyc-module/src/main/java/com/zhyc/module/fileManagement/domain/DaSheepfold.java @@ -1,9 +1,9 @@ -package com.zhyc.module.sheepfold_management.domain; +package com.zhyc.module.fileManagement.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; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; /** * 羊舍管理对象 da_sheepfold diff --git a/zhyc-module/src/main/java/com/zhyc/module/sheep_file/domain/SheepFile.java b/zhyc-module/src/main/java/com/zhyc/module/fileManagement/domain/SheepFile.java similarity index 99% rename from zhyc-module/src/main/java/com/zhyc/module/sheep_file/domain/SheepFile.java rename to zhyc-module/src/main/java/com/zhyc/module/fileManagement/domain/SheepFile.java index 917c2d4..d8aea83 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/sheep_file/domain/SheepFile.java +++ b/zhyc-module/src/main/java/com/zhyc/module/fileManagement/domain/SheepFile.java @@ -1,11 +1,12 @@ -package com.zhyc.module.sheep_file.domain; +package com.zhyc.module.fileManagement.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; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; /** * 羊只档案对象 sheep_file diff --git a/zhyc-module/src/main/java/com/zhyc/module/fileManagement/mapper/BasSheepGroupMapper.java b/zhyc-module/src/main/java/com/zhyc/module/fileManagement/mapper/BasSheepGroupMapper.java new file mode 100644 index 0000000..dcdcaeb --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/fileManagement/mapper/BasSheepGroupMapper.java @@ -0,0 +1,63 @@ +package com.zhyc.module.fileManagement.mapper; + +import com.zhyc.module.fileManagement.domain.BasSheepGroup; + +import java.util.List; + +/** + * 分组管理Mapper接口 + * + * @author wyt + * @date 2025-07-14 + */ +public interface BasSheepGroupMapper +{ + /** + * 查询分组管理 + * + * @param groupId 分组管理主键 + * @return 分组管理 + */ + public BasSheepGroup selectBasSheepGroupByGroupId(Long groupId); + + /** + * 查询分组管理列表 + * + * @param basSheepGroup 分组管理 + * @return 分组管理集合 + */ + public List selectBasSheepGroupList(BasSheepGroup basSheepGroup); + + /** + * 新增分组管理 + * + * @param basSheepGroup 分组管理 + * @return 结果 + */ + public int insertBasSheepGroup(BasSheepGroup basSheepGroup); + + /** + * 修改分组管理 + * + * @param basSheepGroup 分组管理 + * @return 结果 + */ + public int updateBasSheepGroup(BasSheepGroup basSheepGroup); + + /** + * 删除分组管理 + * + * @param groupId 分组管理主键 + * @return 结果 + */ + public int deleteBasSheepGroupByGroupId(Long groupId); + + /** + * 批量删除分组管理 + * + * @param groupIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteBasSheepGroupByGroupIds(Long[] groupIds); + +} 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/fileManagement/mapper/DaSheepfoldMapper.java similarity index 88% rename from zhyc-module/src/main/java/com/zhyc/module/sheepfold_management/mapper/DaSheepfoldMapper.java rename to zhyc-module/src/main/java/com/zhyc/module/fileManagement/mapper/DaSheepfoldMapper.java index 0a82b50..0d9a57c 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/sheepfold_management/mapper/DaSheepfoldMapper.java +++ b/zhyc-module/src/main/java/com/zhyc/module/fileManagement/mapper/DaSheepfoldMapper.java @@ -1,7 +1,8 @@ -package com.zhyc.module.sheepfold_management.mapper; +package com.zhyc.module.fileManagement.mapper; + +import com.zhyc.module.fileManagement.domain.DaSheepfold; import java.util.List; -import com.zhyc.module.sheepfold_management.domain.DaSheepfold; /** * 羊舍管理Mapper接口 @@ -58,5 +59,7 @@ public interface DaSheepfoldMapper * @return 结果 */ public int deleteDaSheepfoldByIds(Long[] ids); + + public int selectCount(DaSheepfold daSheepfold); } diff --git a/zhyc-module/src/main/java/com/zhyc/module/sheep_file/mapper/SheepFileMapper.java b/zhyc-module/src/main/java/com/zhyc/module/fileManagement/mapper/SheepFileMapper.java similarity index 91% rename from zhyc-module/src/main/java/com/zhyc/module/sheep_file/mapper/SheepFileMapper.java rename to zhyc-module/src/main/java/com/zhyc/module/fileManagement/mapper/SheepFileMapper.java index 76543f3..ef9c9a0 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/sheep_file/mapper/SheepFileMapper.java +++ b/zhyc-module/src/main/java/com/zhyc/module/fileManagement/mapper/SheepFileMapper.java @@ -1,7 +1,8 @@ -package com.zhyc.module.sheep_file.mapper; +package com.zhyc.module.fileManagement.mapper; + +import com.zhyc.module.fileManagement.domain.SheepFile; import java.util.List; -import com.zhyc.module.sheep_file.domain.SheepFile; /** * 羊只档案Mapper接口 diff --git a/zhyc-module/src/main/java/com/zhyc/module/fileManagement/service/IBasSheepGroupService.java b/zhyc-module/src/main/java/com/zhyc/module/fileManagement/service/IBasSheepGroupService.java new file mode 100644 index 0000000..2bd5c60 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/fileManagement/service/IBasSheepGroupService.java @@ -0,0 +1,64 @@ +package com.zhyc.module.fileManagement.service; + +import com.zhyc.module.fileManagement.domain.BasSheepGroup; + +import java.util.List; + +/** + * 分组管理Service接口 + * + * @author wyt + * @date 2025-07-14 + */ +public interface IBasSheepGroupService +{ + /** + * 查询分组管理 + * + * @param groupId 分组管理主键 + * @return 分组管理 + */ + public BasSheepGroup selectBasSheepGroupByGroupId(Long groupId); + + /** + * 查询分组管理列表 + * + * @param basSheepGroup 分组管理 + * @return 分组管理集合 + */ + public List selectBasSheepGroupList(BasSheepGroup basSheepGroup); + + /** + * 新增分组管理 + * + * @param basSheepGroup 分组管理 + * @return 结果 + */ + public int insertBasSheepGroup(BasSheepGroup basSheepGroup); + + /** + * 修改分组管理 + * + * @param basSheepGroup 分组管理 + * @return 结果 + */ + public int updateBasSheepGroup(BasSheepGroup basSheepGroup); + + /** + * 批量删除分组管理 + * + * @param groupIds 需要删除的分组管理主键集合 + * @return 结果 + */ + public int deleteBasSheepGroupByGroupIds(Long[] groupIds); + + /** + * 删除分组管理信息 + * + * @param groupId 分组管理主键 + * @return 结果 + */ + public int deleteBasSheepGroupByGroupId(Long groupId); + + +} 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/fileManagement/service/IDaSheepfoldService.java similarity index 74% rename from zhyc-module/src/main/java/com/zhyc/module/sheepfold_management/service/IDaSheepfoldService.java rename to zhyc-module/src/main/java/com/zhyc/module/fileManagement/service/IDaSheepfoldService.java index 84e0190..83a336b 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/sheepfold_management/service/IDaSheepfoldService.java +++ b/zhyc-module/src/main/java/com/zhyc/module/fileManagement/service/IDaSheepfoldService.java @@ -1,7 +1,8 @@ -package com.zhyc.module.sheepfold_management.service; +package com.zhyc.module.fileManagement.service; + +import com.zhyc.module.fileManagement.domain.DaSheepfold; import java.util.List; -import com.zhyc.module.sheepfold_management.domain.DaSheepfold; /** * 羊舍管理Service接口 @@ -58,4 +59,14 @@ public interface IDaSheepfoldService * @return 结果 */ public int deleteDaSheepfoldById(Long id); + + /** + * 检查羊舍编号是否已存在 + * + * @param ranchId 羊舍所属牧场ID + * @param sheepfoldTypeId 羊舍类型ID + * @param sheepfoldNo 羊舍编号 + * @return 是否已存在 + */ + boolean checkSheepfoldNoExist(Long ranchId, Long sheepfoldTypeId, String sheepfoldNo); } diff --git a/zhyc-module/src/main/java/com/zhyc/module/sheep_file/service/ISheepFileService.java b/zhyc-module/src/main/java/com/zhyc/module/fileManagement/service/ISheepFileService.java similarity index 91% rename from zhyc-module/src/main/java/com/zhyc/module/sheep_file/service/ISheepFileService.java rename to zhyc-module/src/main/java/com/zhyc/module/fileManagement/service/ISheepFileService.java index a5f012f..7bc76ed 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/sheep_file/service/ISheepFileService.java +++ b/zhyc-module/src/main/java/com/zhyc/module/fileManagement/service/ISheepFileService.java @@ -1,7 +1,8 @@ -package com.zhyc.module.sheep_file.service; +package com.zhyc.module.fileManagement.service; + +import com.zhyc.module.fileManagement.domain.SheepFile; import java.util.List; -import com.zhyc.module.sheep_file.domain.SheepFile; /** * 羊只档案Service接口 diff --git a/zhyc-module/src/main/java/com/zhyc/module/fileManagement/service/impl/BasSheepGroupServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/fileManagement/service/impl/BasSheepGroupServiceImpl.java new file mode 100644 index 0000000..970e21d --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/fileManagement/service/impl/BasSheepGroupServiceImpl.java @@ -0,0 +1,111 @@ +package com.zhyc.module.fileManagement.service.impl; + +import com.zhyc.common.utils.DateUtils; +import com.zhyc.module.fileManagement.domain.BasSheepGroup; +import com.zhyc.module.fileManagement.mapper.BasSheepGroupMapper; +import com.zhyc.module.fileManagement.service.IBasSheepGroupService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 分组管理Service业务层处理 + * + * @author wyt + * @date 2025-07-14 + */ +@Service +public class BasSheepGroupServiceImpl implements IBasSheepGroupService +{ + @Autowired + private BasSheepGroupMapper basSheepGroupMapper; + + /** + * 查询分组管理 + * + * @param groupId 分组管理主键 + * @return 分组管理 + */ + @Override + public BasSheepGroup selectBasSheepGroupByGroupId(Long groupId) + { + return basSheepGroupMapper.selectBasSheepGroupByGroupId(groupId); + } + + /** + * 查询分组管理列表 + * + * @param basSheepGroup 分组管理 + * @return 分组管理 + */ +// @Override +// public List selectBasSheepGroupList(BasSheepGroup basSheepGroup) +// { +// return basSheepGroupMapper.selectBasSheepGroupList(basSheepGroup); +// } + @Override + public List selectBasSheepGroupList(BasSheepGroup basSheepGroup) { + List groups = basSheepGroupMapper.selectBasSheepGroupList(basSheepGroup); + + // 处理祖先名称显示格式 + groups.forEach(group -> { + if (group.getAncestorNames() != null) { + String formattedNames = group.getAncestorNames().replace(",", " / "); + group.setAncestorNames(formattedNames); + } + }); + + return groups; + } + + /** + * 新增分组管理 + * + * @param basSheepGroup 分组管理 + * @return 结果 + */ + @Override + public int insertBasSheepGroup(BasSheepGroup basSheepGroup) + { + basSheepGroup.setCreateTime(DateUtils.getNowDate()); + return basSheepGroupMapper.insertBasSheepGroup(basSheepGroup); + } + + /** + * 修改分组管理 + * + * @param basSheepGroup 分组管理 + * @return 结果 + */ + @Override + public int updateBasSheepGroup(BasSheepGroup basSheepGroup) + { + basSheepGroup.setUpdateTime(DateUtils.getNowDate()); + return basSheepGroupMapper.updateBasSheepGroup(basSheepGroup); + } + + /** + * 批量删除分组管理 + * + * @param groupIds 需要删除的分组管理主键 + * @return 结果 + */ + @Override + public int deleteBasSheepGroupByGroupIds(Long[] groupIds) + { + return basSheepGroupMapper.deleteBasSheepGroupByGroupIds(groupIds); + } + + /** + * 删除分组管理信息 + * + * @param groupId 分组管理主键 + * @return 结果 + */ + @Override + public int deleteBasSheepGroupByGroupId(Long groupId) + { + return basSheepGroupMapper.deleteBasSheepGroupByGroupId(groupId); + } +} 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/fileManagement/service/impl/DaSheepfoldServiceImpl.java similarity index 76% rename from zhyc-module/src/main/java/com/zhyc/module/sheepfold_management/service/impl/DaSheepfoldServiceImpl.java rename to zhyc-module/src/main/java/com/zhyc/module/fileManagement/service/impl/DaSheepfoldServiceImpl.java index 019cf55..6e8189a 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/sheepfold_management/service/impl/DaSheepfoldServiceImpl.java +++ b/zhyc-module/src/main/java/com/zhyc/module/fileManagement/service/impl/DaSheepfoldServiceImpl.java @@ -1,11 +1,12 @@ -package com.zhyc.module.sheepfold_management.service.impl; +package com.zhyc.module.fileManagement.service.impl; -import java.util.List; +import com.zhyc.module.fileManagement.domain.DaSheepfold; +import com.zhyc.module.fileManagement.mapper.DaSheepfoldMapper; +import com.zhyc.module.fileManagement.service.IDaSheepfoldService; 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; + +import java.util.List; /** * 羊舍管理Service业务层处理 @@ -90,4 +91,14 @@ public class DaSheepfoldServiceImpl implements IDaSheepfoldService { return daSheepfoldMapper.deleteDaSheepfoldById(id); } + + + @Override + public boolean checkSheepfoldNoExist(Long ranchId, Long sheepfoldTypeId, String sheepfoldNo) { + DaSheepfold query = new DaSheepfold(); + query.setRanchId(ranchId); + query.setSheepfoldTypeId(sheepfoldTypeId); + query.setSheepfoldNo(sheepfoldNo); + return daSheepfoldMapper.selectCount(query) > 0; + } } diff --git a/zhyc-module/src/main/java/com/zhyc/module/sheep_file/service/impl/SheepFileServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/fileManagement/service/impl/SheepFileServiceImpl.java similarity index 89% rename from zhyc-module/src/main/java/com/zhyc/module/sheep_file/service/impl/SheepFileServiceImpl.java rename to zhyc-module/src/main/java/com/zhyc/module/fileManagement/service/impl/SheepFileServiceImpl.java index 6a61101..b5e8d29 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/sheep_file/service/impl/SheepFileServiceImpl.java +++ b/zhyc-module/src/main/java/com/zhyc/module/fileManagement/service/impl/SheepFileServiceImpl.java @@ -1,12 +1,13 @@ -package com.zhyc.module.sheep_file.service.impl; +package com.zhyc.module.fileManagement.service.impl; -import java.util.List; import com.zhyc.common.utils.DateUtils; +import com.zhyc.module.fileManagement.domain.SheepFile; +import com.zhyc.module.fileManagement.mapper.SheepFileMapper; +import com.zhyc.module.fileManagement.service.ISheepFileService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import com.zhyc.module.sheep_file.mapper.SheepFileMapper; -import com.zhyc.module.sheep_file.domain.SheepFile; -import com.zhyc.module.sheep_file.service.ISheepFileService; + +import java.util.List; /** * 羊只档案Service业务层处理 diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/controller/ScLambingRecordController.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/controller/ScLambingRecordController.java new file mode 100644 index 0000000..04bce38 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/controller/ScLambingRecordController.java @@ -0,0 +1,146 @@ +package com.zhyc.module.produce.breed.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.produce.breed.domain.ScLambingRecord; +import com.zhyc.module.produce.breed.domain.ScLambDetail; +import com.zhyc.module.produce.breed.service.IScLambingRecordService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 产羔记录Controller + */ +@RestController +@RequestMapping("/breed/lambing_records") +public class ScLambingRecordController extends BaseController { + + @Autowired + private IScLambingRecordService scLambingRecordService; + + /** + * 查询产羔记录列表 + */ + @PreAuthorize("@ss.hasPermi('breed:lambing_records:list')") + @GetMapping("/list") + public TableDataInfo list(ScLambingRecord scLambingRecord) { + startPage(); + List list = scLambingRecordService.selectScLambingRecordList(scLambingRecord); + return getDataTable(list); + } + + /** + * 导出产羔记录列表 + */ + @PreAuthorize("@ss.hasPermi('breed:lambing_records:export')") + @Log(title = "产羔记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, ScLambingRecord scLambingRecord) { + List list = scLambingRecordService.selectScLambingRecordList(scLambingRecord); + ExcelUtil util = new ExcelUtil(ScLambingRecord.class); + util.exportExcel(response, list, "产羔记录数据"); + } + + /** + * 获取产羔记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('breed:lambing_records:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return success(scLambingRecordService.selectScLambingRecordById(id)); + } + + /** + * 新增产羔记录(包含羔羊详情) + */ + @PreAuthorize("@ss.hasPermi('breed:lambing_records:add')") + @Log(title = "产羔记录", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ScLambingRecord scLambingRecord) { + try { + // 设置创建人 + scLambingRecord.setCreateBy(getUsername()); + + // 如果没有设置创建时间,使用当前时间 + if (scLambingRecord.getCreateTime() == null) { + scLambingRecord.setCreateTime(new java.util.Date()); + } + + int result = scLambingRecordService.insertScLambingRecord(scLambingRecord); + + if (result > 0) { + String message = "新增产羔记录成功"; + if (scLambingRecord.getLambDetails() != null && !scLambingRecord.getLambDetails().isEmpty()) { + message += ",同时录入了 " + scLambingRecord.getLambDetails().size() + " 只羔羊详情"; + } + return success(message); + } else { + return error("新增产羔记录失败"); + } + } catch (Exception e) { + logger.error("新增产羔记录异常", e); + return error("新增产羔记录失败:" + e.getMessage()); + } + } + + /** + * 修改产羔记录 + */ + @PreAuthorize("@ss.hasPermi('breed:lambing_records:edit')") + @Log(title = "产羔记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ScLambingRecord scLambingRecord) { + try { + scLambingRecord.setUpdateBy(getUsername()); + scLambingRecord.setUpdateTime(new java.util.Date()); + return toAjax(scLambingRecordService.updateScLambingRecord(scLambingRecord)); + } catch (Exception e) { + logger.error("修改产羔记录异常", e); + return error("修改产羔记录失败:" + e.getMessage()); + } + } + + /** + * 删除产羔记录 + */ + @PreAuthorize("@ss.hasPermi('breed:lambing_records:remove')") + @Log(title = "产羔记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + try { + return toAjax(scLambingRecordService.deleteScLambingRecordByIds(ids)); + } catch (Exception e) { + logger.error("删除产羔记录异常", e); + return error("删除产羔记录失败:" + e.getMessage()); + } + } + + /** + * 查询羔羊详情 + */ + @PreAuthorize("@ss.hasPermi('breed:lambing_records:query')") + @GetMapping("/lamb_detail/{lambingRecordId}") + public AjaxResult getLambDetail(@PathVariable("lambingRecordId") Long lambingRecordId) { + try { + List lambDetails = scLambingRecordService.selectLambDetailByLambingRecordId(lambingRecordId); + return success(lambDetails); + } catch (Exception e) { + logger.error("查询羔羊详情异常", e); + return error("查询羔羊详情失败:" + e.getMessage()); + } + } +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/ScLambDetail.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/ScLambDetail.java new file mode 100644 index 0000000..f2bcb3a --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/ScLambDetail.java @@ -0,0 +1,242 @@ +package com.zhyc.module.produce.breed.domain; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +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_lamb_detail + * + * @author ruoyi + * @date 2025-07-11 + */ +public class ScLambDetail extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键ID */ + private Long id; + + /** 产羔记录ID */ + @Excel(name = "产羔记录ID") + private Long lambingRecordId; + + /** 羔羊耳号 */ + @Excel(name = "羔羊耳号") + private String lambEarNumber; + + /** 羔羊品种ID */ + @Excel(name = "羔羊品种ID") + private Integer lambBreed; // 改为Integer类型,存储品种ID + + /** 性别 */ + @Excel(name = "性别") + private Integer gender; + + /** 出生重量 */ + @Excel(name = "出生重量") + private BigDecimal birthWeight; + + /** 是否留养 */ + @Excel(name = "是否留养") + private Boolean isRetained; + + /** 家系 */ + @Excel(name = "家系") + private String lineage; + + /** 生日 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "生日", width = 30, dateFormat = "yyyy-MM-dd") + private Date birthday; + + private List lambDetails; + + /** 母羊ID */ + private Long motherId; + + /** 父羊ID */ + private Long fatherId; + + /** 牧场ID */ + private Integer ranchId; + + /** 羊舍ID */ + private Integer sheepfoldId; + + /** 胎次 */ + private Integer parity; + + // getter和setter方法 + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public void setLambingRecordId(Long lambingRecordId) + { + this.lambingRecordId = lambingRecordId; + } + + public Long getLambingRecordId() + { + return lambingRecordId; + } + + public void setLambEarNumber(String lambEarNumber) + { + this.lambEarNumber = lambEarNumber; + } + + public String getLambEarNumber() + { + return lambEarNumber; + } + + public void setLambBreed(Integer lambBreed) // 改为Integer类型 + { + this.lambBreed = lambBreed; + } + + public Integer getLambBreed() // 改为Integer类型 + { + return lambBreed; + } + + public void setGender(Integer gender) + { + this.gender = gender; + } + + public Integer getGender() + { + return gender; + } + + public void setBirthWeight(BigDecimal birthWeight) + { + this.birthWeight = birthWeight; + } + + public BigDecimal getBirthWeight() + { + return birthWeight; + } + + public void setIsRetained(Boolean isRetained) + { + this.isRetained = isRetained; + } + + public Boolean getIsRetained() + { + return isRetained; + } + + public void setLineage(String lineage) + { + this.lineage = lineage; + } + + public String getLineage() + { + return lineage; + } + + public void setBirthday(Date birthday) + { + this.birthday = birthday; + } + + public Date getBirthday() + { + return birthday; + } + + public List getLambDetails() + { + return lambDetails; + } + + public void setLambDetails(List lambDetails) + { + this.lambDetails = lambDetails; + } + + public Long getMotherId() + { + return motherId; + } + + public void setMotherId(Long motherId) + { + this.motherId = motherId; + } + + public Long getFatherId() + { + return fatherId; + } + + public void setFatherId(Long fatherId) + { + this.fatherId = fatherId; + } + + public Integer getRanchId() + { + return ranchId; + } + + public void setRanchId(Integer ranchId) + { + this.ranchId = ranchId; + } + + public Integer getSheepfoldId() + { + return sheepfoldId; + } + + public void setSheepfoldId(Integer sheepfoldId) + { + this.sheepfoldId = sheepfoldId; + } + + public Integer getParity() + { + return parity; + } + + public void setParity(Integer parity) + { + this.parity = parity; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("lambingRecordId", getLambingRecordId()) + .append("lambEarNumber", getLambEarNumber()) + .append("lambBreed", getLambBreed()) + .append("gender", getGender()) + .append("birthWeight", getBirthWeight()) + .append("isRetained", getIsRetained()) + .append("lineage", getLineage()) + .append("birthday", getBirthday()) + .append("createTime", getCreateTime()) + .toString(); + } +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/ScLambingRecord.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/ScLambingRecord.java new file mode 100644 index 0000000..895ad55 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/ScLambingRecord.java @@ -0,0 +1,401 @@ +package com.zhyc.module.produce.breed.domain; + +import java.util.Date; +import java.util.List; +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_lambing_record + * + * @author ruoyi + * @date 2025-07-11 + */ +public class ScLambingRecord extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键ID */ + private Long id; + + /** 羊只id */ + @Excel(name = "羊只id") + private String sheepId; + + /** 胎次 */ + @Excel(name = "胎次") + private Long parity; + + /** 产羔数量 */ + @Excel(name = "产羔数量") + private Long lambsBorn; + + /** 活羔数量 */ + @Excel(name = "活羔数量") + private Long survival; + + /** 技术员 */ + @Excel(name = "技术员") + private String technician; + + /** 产羔评分 */ + @Excel(name = "产羔评分") + private Long score; + + /** 备注 */ + @Excel(name = "备注") + private String comment; + + /** 创建日期 */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @Excel(name = "创建日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date createTime; // 改为 createTime + + // ========== 关联查询字段(简化版) ========== + + /** 母羊耳号 */ + @Excel(name = "母羊耳号") + private String femaleEarNumber; + + /** 母羊品种 */ + @Excel(name = "母羊品种") + private String femaleBreed; + + /** 月龄 */ + @Excel(name = "月龄") + private Integer monthAge; + + /** 当前羊舍 */ + @Excel(name = "当前羊舍") + private String currentShed; + + /** 所在牧场 */ + @Excel(name = "所在牧场") + private String farm; + + /** 配种日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "配种日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date breedingDate; + + /** 公羊耳号 */ + @Excel(name = "公羊耳号") + private String maleEarNumber; + + /** 公羊品种 */ + @Excel(name = "公羊品种") + private String maleBreed; + + /** 产羔时怀孕天数 */ + @Excel(name = "产羔时怀孕天数") + private Integer pregnancyDays; + + /** 折损数(计算字段) */ + @Excel(name = "折损数") + private Integer loss; + + /** 公羔数量(从羊只信息表统计) */ + @Excel(name = "公羔数量") + private Integer maleCount; + + /** 母羔数量(从羊只信息表统计) */ + @Excel(name = "母羔数量") + private Integer femaleCount; + + /** 留养公羔数量 */ + @Excel(name = "留养公羔数量") + private Integer retainedMaleCount; + + /** 留养母羔数量 */ + @Excel(name = "留养母羔数量") + private Integer retainedFemaleCount; + + /** 未留养公羔数量 */ + @Excel(name = "未留养公羔数量") + private Integer unretainedMaleCount; + + /** 未留养母羔数量 */ + @Excel(name = "未留养母羔数量") + private Integer unretainedFemaleCount; + + /** 羔羊信息列表(从羊只信息表查询) */ + private List lambInfoList; + + private List lambDetails; + + // ========== 原有getter和setter方法 ========== + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public void setSheepId(String sheepId) + { + this.sheepId = sheepId; + } + + public String getSheepId() + { + return sheepId; + } + + public void setParity(Long parity) + { + this.parity = parity; + } + + public Long getParity() + { + return parity; + } + + public void setLambsBorn(Long lambsBorn) + { + this.lambsBorn = lambsBorn; + } + + public Long getLambsBorn() + { + return lambsBorn; + } + + public void setSurvival(Long survival) + { + this.survival = survival; + } + + public Long getSurvival() + { + return survival; + } + + public void setTechnician(String technician) + { + this.technician = technician; + } + + public String getTechnician() + { + return technician; + } + + public void setScore(Long score) + { + this.score = score; + } + + public Long getScore() + { + return score; + } + + public void setComment(String comment) + { + this.comment = comment; + } + + public String getComment() + { + return comment; + } + + public void setCreateTime(Date createTime) + { + this.createTime = createTime; + } + + public Date getCreateTime() + { + return createTime; + } + + // ========== 简化版关联字段的getter和setter方法 ========== + + public String getFemaleEarNumber() { + return femaleEarNumber; + } + + public void setFemaleEarNumber(String femaleEarNumber) { + this.femaleEarNumber = femaleEarNumber; + } + + public String getFemaleBreed() { + return femaleBreed; + } + + public void setFemaleBreed(String femaleBreed) { + this.femaleBreed = femaleBreed; + } + + public Integer getMonthAge() { + return monthAge; + } + + public void setMonthAge(Integer monthAge) { + this.monthAge = monthAge; + } + + public String getCurrentShed() { + return currentShed; + } + + public void setCurrentShed(String currentShed) { + this.currentShed = currentShed; + } + + public String getFarm() { + return farm; + } + + public void setFarm(String farm) { + this.farm = farm; + } + + public Date getBreedingDate() { + return breedingDate; + } + + public void setBreedingDate(Date breedingDate) { + this.breedingDate = breedingDate; + } + + public String getMaleEarNumber() { + return maleEarNumber; + } + + public void setMaleEarNumber(String maleEarNumber) { + this.maleEarNumber = maleEarNumber; + } + + public String getMaleBreed() { + return maleBreed; + } + + public void setMaleBreed(String maleBreed) { + this.maleBreed = maleBreed; + } + + + public Integer getPregnancyDays() { + return pregnancyDays; + } + + public void setPregnancyDays(Integer pregnancyDays) { + this.pregnancyDays = pregnancyDays; + } + + public Integer getLoss() { + return loss; + } + + public void setLoss(Integer loss) { + this.loss = loss; + } + + public Integer getMaleCount() { + return maleCount; + } + + public void setMaleCount(Integer maleCount) { + this.maleCount = maleCount; + } + + public Integer getFemaleCount() { + return femaleCount; + } + + public void setFemaleCount(Integer femaleCount) { + this.femaleCount = femaleCount; + } + + public Integer getRetainedMaleCount() { + return retainedMaleCount; + } + + public void setRetainedMaleCount(Integer retainedMaleCount) { + this.retainedMaleCount = retainedMaleCount; + } + + public Integer getRetainedFemaleCount() { + return retainedFemaleCount; + } + + public void setRetainedFemaleCount(Integer retainedFemaleCount) { + this.retainedFemaleCount = retainedFemaleCount; + } + + public Integer getUnretainedMaleCount() { + return unretainedMaleCount; + } + + public void setUnretainedMaleCount(Integer unretainedMaleCount) { + this.unretainedMaleCount = unretainedMaleCount; + } + + public Integer getUnretainedFemaleCount() { + return unretainedFemaleCount; + } + + public void setUnretainedFemaleCount(Integer unretainedFemaleCount) { + this.unretainedFemaleCount = unretainedFemaleCount; + } + + public List getLambInfoList() { + return lambInfoList; + } + + public void setLambInfoList(List lambInfoList) { + this.lambInfoList = lambInfoList; + } + + public List getLambDetails() { + return lambDetails; + } + + public void setLambDetails(List lambDetails) { + this.lambDetails = lambDetails; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("sheepId", getSheepId()) + .append("parity", getParity()) + .append("lambsBorn", getLambsBorn()) + .append("survival", getSurvival()) + .append("technician", getTechnician()) + .append("score", getScore()) + .append("comment", getComment()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) // 改为 createTime + .append("femaleEarNumber", getFemaleEarNumber()) + .append("femaleBreed", getFemaleBreed()) + .append("farm", getFarm()) + .toString(); + } +} + +/** + * 羊只羔羊信息对象(用于产羔详情显示) + */ +class SheepLambInfo { + private String lambEarNumber; // 羔羊耳号 + private String lambBreed; // 羔羊品种 + private Integer gender; // 性别 + private Double birthWeight; // 出生重量 + private Boolean isRetained; // 是否留养 + private String lineage; // 家系 + private Date birthday; // 生日 + + // getter和setter方法... +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/mapper/ScLambDetailMapper.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/mapper/ScLambDetailMapper.java new file mode 100644 index 0000000..2ba02de --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/mapper/ScLambDetailMapper.java @@ -0,0 +1,63 @@ +package com.zhyc.module.produce.breed.mapper; + +import java.util.List; +import com.zhyc.module.produce.breed.domain.ScLambDetail; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 羔羊详情Mapper接口 + */ +@Mapper +public interface ScLambDetailMapper { + + /** + * 查询羔羊详情列表 + */ + public List selectScLambDetailList(ScLambDetail scLambDetail); + + /** + * 新增羔羊详情 + */ + public int insertScLambDetail(ScLambDetail scLambDetail); + public int insertBasSheep(ScLambDetail scLambDetail); + /** + * 批量新增羔羊详情 + */ + public int insertScLambDetailBatch(@Param("list") List scLambDetailList); + public int insertBasSheepBatch(@Param("list") List scLambDetailList); + /** + * 修改羔羊详情 + */ + public int updateScLambDetail(ScLambDetail scLambDetail); + + /** + * 删除羔羊详情 + */ + public int deleteScLambDetailById(Long id); + + /** + * 批量删除羔羊详情 + */ + public int deleteScLambDetailByIds(Long[] ids); + + /** + * 根据产羔记录ID删除羔羊详情 + */ + public int deleteScLambDetailByLambingRecordId(Long lambingRecordId); + + /** + * 查询羔羊详情 + */ + public ScLambDetail selectScLambDetailById(Long id); + + /** + * 根据产羔记录ID查询羔羊详情列表 + */ + public List selectScLambDetailByLambingRecordId(Long lambingRecordId); + + /** + * 检查羔羊耳号是否已存在 + */ + public int checkLambEarNumberExists(@Param("lambEarNumber") String lambEarNumber, @Param("excludeId") Long excludeId); +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/mapper/ScLambingRecordMapper.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/mapper/ScLambingRecordMapper.java new file mode 100644 index 0000000..7719104 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/mapper/ScLambingRecordMapper.java @@ -0,0 +1,70 @@ +package com.zhyc.module.produce.breed.mapper; + +import java.util.List; +import com.zhyc.module.produce.breed.domain.ScLambingRecord; +import com.zhyc.module.produce.breed.domain.ScLambDetail; + +/** + * 产羔记录Mapper接口 + * + * @author ruoyi + * @date 2025-07-11 + */ +public interface ScLambingRecordMapper +{ + /** + * 查询产羔记录 + * + * @param id 产羔记录主键 + * @return 产羔记录 + */ + public ScLambingRecord selectScLambingRecordById(Long id); + + /** + * 查询产羔记录列表(包含关联信息) + * + * @param scLambingRecord 产羔记录 + * @return 产羔记录集合 + */ + public List selectScLambingRecordList(ScLambingRecord scLambingRecord); + + /** + * 查询产羔记录详细信息(包含关联信息) + * + * @param id 产羔记录主键 + * @return 产羔记录 + */ + public ScLambingRecord selectScLambingRecordDetailById(Long id); + + /** + * 新增产羔记录 + * + * @param scLambingRecord 产羔记录 + * @return 结果 + */ + public int insertScLambingRecord(ScLambingRecord scLambingRecord); + + /** + * 修改产羔记录 + * + * @param scLambingRecord 产羔记录 + * @return 结果 + */ + public int updateScLambingRecord(ScLambingRecord scLambingRecord); + + /** + * 删除产羔记录 + * + * @param id 产羔记录主键 + * @return 结果 + */ + public int deleteScLambingRecordById(Long id); + + /** + * 批量删除产羔记录 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteScLambingRecordByIds(Long[] ids); +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/IScLambingRecordService.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/IScLambingRecordService.java new file mode 100644 index 0000000..83a6497 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/IScLambingRecordService.java @@ -0,0 +1,46 @@ +package com.zhyc.module.produce.breed.service; + +import java.util.List; +import com.zhyc.module.produce.breed.domain.ScLambingRecord; +import com.zhyc.module.produce.breed.domain.ScLambDetail; + +/** + * 产羔记录Service接口 + */ +public interface IScLambingRecordService { + + /** + * 查询产羔记录列表 + */ + public List selectScLambingRecordList(ScLambingRecord scLambingRecord); + + /** + * 新增产羔记录(包含羔羊详情) + */ + public int insertScLambingRecord(ScLambingRecord scLambingRecord); + + /** + * 修改产羔记录 + */ + public int updateScLambingRecord(ScLambingRecord scLambingRecord); + + /** + * 批量删除产羔记录 + */ + public int deleteScLambingRecordByIds(Long[] ids); + + /** + * 删除产羔记录信息 + */ + public int deleteScLambingRecordById(Long id); + + /** + * 查询产羔记录 + */ + public ScLambingRecord selectScLambingRecordById(Long id); + + /** + * 查询羔羊详情 + */ + public List selectLambDetailByLambingRecordId(Long lambingRecordId); +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/impl/ScLambingRecordServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/impl/ScLambingRecordServiceImpl.java new file mode 100644 index 0000000..74b6715 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/impl/ScLambingRecordServiceImpl.java @@ -0,0 +1,192 @@ +package com.zhyc.module.produce.breed.service.impl; + +import java.math.BigDecimal; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import com.zhyc.module.produce.breed.mapper.ScLambingRecordMapper; +import com.zhyc.module.produce.breed.mapper.ScLambDetailMapper; +import com.zhyc.module.produce.breed.domain.ScLambingRecord; +import com.zhyc.module.produce.breed.domain.ScLambDetail; +import com.zhyc.module.produce.breed.service.IScLambingRecordService; + +/** + * 产羔记录Service业务层处理 + */ +@Service +public class ScLambingRecordServiceImpl implements IScLambingRecordService { + + @Autowired + private ScLambingRecordMapper scLambingRecordMapper; + + @Autowired + private ScLambDetailMapper scLambDetailMapper; + + /** + * 查询产羔记录列表 + */ + @Override + public List selectScLambingRecordList(ScLambingRecord scLambingRecord) { + return scLambingRecordMapper.selectScLambingRecordList(scLambingRecord); + } + + /** + * 新增产羔记录(包含羔羊详情) + */ + @Override + @Transactional + public int insertScLambingRecord(ScLambingRecord scLambingRecord) { + // 1. 插入产羔记录 + int result = scLambingRecordMapper.insertScLambingRecord(scLambingRecord); + + // 2. 如果有羔羊详情,则批量插入羔羊详情 + if (scLambingRecord.getLambDetails() != null && !scLambingRecord.getLambDetails().isEmpty()) { + insertLambDetails(scLambingRecord); + } + + return result; + } + + /** + * 批量插入羔羊详情 + */ + private void insertLambDetails(ScLambingRecord scLambingRecord) { + // 遍历羔羊详情列表,逐个插入 + for (ScLambDetail lambDetail : scLambingRecord.getLambDetails()) { + // 设置产羔记录ID + lambDetail.setLambingRecordId(scLambingRecord.getId()); + + // 设置创建信息 + lambDetail.setCreateBy(scLambingRecord.getCreateBy()); + lambDetail.setCreateTime(scLambingRecord.getCreateTime()); + + // 数据验证和转换 + validateAndConvertLambDetail(lambDetail); + + // 插入羔羊详情 + scLambDetailMapper.insertScLambDetail(lambDetail); + scLambDetailMapper.insertBasSheep(lambDetail); + } + } + + + + /** + * 验证和转换羔羊详情 + */ + /** + * 验证和转换羔羊详情 + */ + private void validateAndConvertLambDetail(ScLambDetail lambDetail) { + // 验证必填字段 + if (lambDetail.getLambEarNumber() == null || lambDetail.getLambEarNumber().trim().isEmpty()) { + throw new RuntimeException("羔羊耳号不能为空"); + } + + if (lambDetail.getGender() == null) { // 改为检查Integer类型 + throw new RuntimeException("羔羊性别不能为空"); + } + + // 验证性别值的有效性(假设0=母羊,1=公羊) + if (lambDetail.getGender() < 0 || lambDetail.getGender() > 1) { + throw new RuntimeException("羔羊性别值无效,请使用0(母羊)或1(公羊)"); + } + + // 检查耳号是否已存在 + int count = scLambDetailMapper.checkLambEarNumberExists(lambDetail.getLambEarNumber().trim(), null); + if (count > 0) { + throw new RuntimeException("羔羊耳号 [" + lambDetail.getLambEarNumber() + "] 已存在,请使用其他耳号"); + } + + // 设置默认值 + if (lambDetail.getIsRetained() == null) { + lambDetail.setIsRetained(false); + } + + if (lambDetail.getBirthday() == null) { + lambDetail.setBirthday(new java.util.Date()); + } + + // 处理体重(前端可能传来的是number类型) + if (lambDetail.getBirthWeight() == null) { + lambDetail.setBirthWeight(BigDecimal.ZERO); + } + + // 验证品种ID + if (lambDetail.getLambBreed() == null) { + throw new RuntimeException("羔羊品种不能为空"); + } + + // 去除空格 + lambDetail.setLambEarNumber(lambDetail.getLambEarNumber().trim()); + if (lambDetail.getLineage() != null) { + lambDetail.setLineage(lambDetail.getLineage().trim()); + } + } + + /** + * 修改产羔记录 + */ + @Override + @Transactional + public int updateScLambingRecord(ScLambingRecord scLambingRecord) { + // 更新产羔记录 + int result = scLambingRecordMapper.updateScLambingRecord(scLambingRecord); + + // 如果包含羔羊详情,先删除原有的,再插入新的 + if (scLambingRecord.getLambDetails() != null) { + // 删除原有羔羊详情 + scLambDetailMapper.deleteScLambDetailByLambingRecordId(scLambingRecord.getId()); + + // 插入新的羔羊详情 + if (!scLambingRecord.getLambDetails().isEmpty()) { + insertLambDetails(scLambingRecord); + } + } + + return result; + } + + /** + * 批量删除产羔记录 + */ + @Override + @Transactional + public int deleteScLambingRecordByIds(Long[] ids) { + // 先删除关联的羔羊详情 + for (Long id : ids) { + scLambDetailMapper.deleteScLambDetailByLambingRecordId(id); + } + // 再删除产羔记录 + return scLambingRecordMapper.deleteScLambingRecordByIds(ids); + } + + /** + * 删除产羔记录信息 + */ + @Override + @Transactional + public int deleteScLambingRecordById(Long id) { + // 先删除关联的羔羊详情 + scLambDetailMapper.deleteScLambDetailByLambingRecordId(id); + // 再删除产羔记录 + return scLambingRecordMapper.deleteScLambingRecordById(id); + } + + /** + * 查询产羔记录 + */ + @Override + public ScLambingRecord selectScLambingRecordById(Long id) { + return scLambingRecordMapper.selectScLambingRecordById(id); + } + + /** + * 查询羔羊详情 + */ + @Override + public List selectLambDetailByLambingRecordId(Long lambingRecordId) { + return scLambDetailMapper.selectScLambDetailByLambingRecordId(lambingRecordId); + } +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/wean/controller/ScWeanRecordController.java b/zhyc-module/src/main/java/com/zhyc/module/produce/wean/controller/ScWeanRecordController.java new file mode 100644 index 0000000..79c05c5 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/wean/controller/ScWeanRecordController.java @@ -0,0 +1,161 @@ +package com.zhyc.module.produce.wean.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.produce.wean.domain.ScWeanRecord; +import com.zhyc.module.produce.wean.service.IScWeanRecordService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 断奶记录Controller + * + * @author zhyc + * @date 2024-01-01 + */ +@RestController +@RequestMapping("/Weaning/weaning_record") +public class ScWeanRecordController extends BaseController { + @Autowired + private IScWeanRecordService scWeanRecordService; + + /** + * 查询断奶记录列表 + */ + @PreAuthorize("@ss.hasPermi('Weaning:weaning_record:list')") + @GetMapping("/list") + public TableDataInfo list(ScWeanRecord scWeanRecord) { + startPage(); + List list = scWeanRecordService.selectScWeanRecordList(scWeanRecord); + return getDataTable(list); + } + + /** + * 导出断奶记录列表 + */ + @PreAuthorize("@ss.hasPermi('Weaning:weaning_record:export')") + @Log(title = "断奶记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, ScWeanRecord scWeanRecord) { + List list = scWeanRecordService.selectScWeanRecordList(scWeanRecord); + ExcelUtil util = new ExcelUtil(ScWeanRecord.class); + util.exportExcel(response, list, "断奶记录数据"); + } + + /** + * 获取断奶记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('Weaning:weaning_record:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return success(scWeanRecordService.selectScWeanRecordById(id)); + } + + /** + * 根据耳号查询羊只ID + */ + @PreAuthorize("@ss.hasPermi('Weaning:weaning_record:query')") + @GetMapping(value = "/sheepId/{earNumber}") + public AjaxResult getSheepIdByEarNumber(@PathVariable("earNumber") String earNumber) { + Long sheepId = scWeanRecordService.selectSheepIdByEarNumber(earNumber); + if (sheepId != null) { + return success(sheepId); + } else { + return error("未找到对应的羊只信息"); + } + } + + /** + * 新增断奶记录 + */ + @PreAuthorize("@ss.hasPermi('Weaning:weaning_record:add')") + @Log(title = "断奶记录", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ScWeanRecord scWeanRecord) { + // 验证耳号是否存在 + if (scWeanRecord.getEarNumber() != null) { + Long sheepId = scWeanRecordService.selectSheepIdByEarNumber(scWeanRecord.getEarNumber()); + if (sheepId == null) { + return error("耳号不存在,请检查后重新输入"); + } + scWeanRecord.setSheepId(sheepId); + } + + // 验证必要字段 + if (scWeanRecord.getSheepId() == null) { + return error("羊只信息不能为空"); + } + if (scWeanRecord.getDatetime() == null) { + return error("断奶日期不能为空"); + } + if (scWeanRecord.getWeight() == null) { + return error("断奶重量不能为空"); + } + if (scWeanRecord.getStatus() == null) { + return error("是否留养不能为空"); + } + + scWeanRecord.setCreateBy(getUsername()); + return toAjax(scWeanRecordService.insertScWeanRecord(scWeanRecord)); + } + + /** + * 修改断奶记录 + */ + @PreAuthorize("@ss.hasPermi('Weaning:weaning_record:edit')") + @Log(title = "断奶记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ScWeanRecord scWeanRecord) { + // 验证耳号是否存在 + if (scWeanRecord.getEarNumber() != null) { + Long sheepId = scWeanRecordService.selectSheepIdByEarNumber(scWeanRecord.getEarNumber()); + if (sheepId == null) { + return error("耳号不存在,请检查后重新输入"); + } + scWeanRecord.setSheepId(sheepId); + } + + // 验证必要字段 + if (scWeanRecord.getId() == null) { + return error("记录ID不能为空"); + } + if (scWeanRecord.getSheepId() == null) { + return error("羊只信息不能为空"); + } + if (scWeanRecord.getDatetime() == null) { + return error("断奶日期不能为空"); + } + if (scWeanRecord.getWeight() == null) { + return error("断奶重量不能为空"); + } + if (scWeanRecord.getStatus() == null) { + return error("是否留养不能为空"); + } + + return toAjax(scWeanRecordService.updateScWeanRecord(scWeanRecord)); + } + + /** + * 删除断奶记录 + */ + @PreAuthorize("@ss.hasPermi('Weaning:weaning_record:remove')") + @Log(title = "断奶记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + return toAjax(scWeanRecordService.deleteScWeanRecordByIds(ids)); + } +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/wean/domain/ScWeanRecord.java b/zhyc-module/src/main/java/com/zhyc/module/produce/wean/domain/ScWeanRecord.java new file mode 100644 index 0000000..1d11f7d --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/wean/domain/ScWeanRecord.java @@ -0,0 +1,262 @@ +package com.zhyc.module.produce.wean.domain; + +import java.math.BigDecimal; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 断奶记录对象 sc_wean_record + * + * @author zhyc + * @date 2024-01-01 + */ +public class ScWeanRecord extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** 主键ID */ + private Long id; + + /** 羊只ID */ + @Excel(name = "羊只ID") + private Long sheepId; + + /** 断奶日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "断奶日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date datetime; + + /** 断奶重量 */ + @Excel(name = "断奶重量") + private BigDecimal weight; + + /** 是否留养 */ + @Excel(name = "是否留养") + private String status; + + /** 技术员 */ + @Excel(name = "技术员") + private String technician; + + /** 备注 */ + @Excel(name = "备注") + private String comment; + + /** 电子耳号 */ + @Excel(name = "电子耳号") + private String electronicTags; + + // 关联查询字段 + /** 耳号 */ + @Excel(name = "耳号") + private String earNumber; + + /** 品种 */ + @Excel(name = "品种") + private String breed; + + /** 事件类型 */ + @Excel(name = "事件类型") + private String eventType; + + /** 性别 */ + @Excel(name = "性别") + private String gender; + + /** 父号 */ + @Excel(name = "父号") + private String fatherNumber; + + /** 母号 */ + @Excel(name = "母号") + private String motherNumber; + + /** 月龄 */ + @Excel(name = "月龄") + private Integer monthAge; + + /** 出生重量 */ + @Excel(name = "出生重量") + private BigDecimal birthWeight; + + /** 羊舍 */ + @Excel(name = "羊舍") + private String sheepPen; + + /** 繁育状态 */ + @Excel(name = "繁育状态") + private String breedingStatus; + + 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 setDatetime(Date datetime) { + this.datetime = datetime; + } + + public Date getDatetime() { + return datetime; + } + + public void setWeight(BigDecimal weight) { + this.weight = weight; + } + + public BigDecimal getWeight() { + return weight; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getStatus() { + return status; + } + + public void setTechnician(String technician) { + this.technician = technician; + } + + public String getTechnician() { + return technician; + } + + public void setComment(String comment) { + this.comment = comment; + } + + public String getComment() { + return comment; + } + + public void setElectronicTags(String electronicTags) { + this.electronicTags = electronicTags; + } + + public String getElectronicTags() { + return electronicTags; + } + + public void setEarNumber(String earNumber) { + this.earNumber = earNumber; + } + + public String getEarNumber() { + return earNumber; + } + + public void setBreed(String breed) { + this.breed = breed; + } + + public String getBreed() { + return breed; + } + + public void setEventType(String eventType) { + this.eventType = eventType; + } + + public String getEventType() { + return eventType; + } + + public void setGender(String gender) { + this.gender = gender; + } + + public String getGender() { + return gender; + } + + 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 setMonthAge(Integer monthAge) { + this.monthAge = monthAge; + } + + public Integer getMonthAge() { + return monthAge; + } + + public void setBirthWeight(BigDecimal birthWeight) { + this.birthWeight = birthWeight; + } + + public BigDecimal getBirthWeight() { + return birthWeight; + } + + public void setSheepPen(String sheepPen) { + this.sheepPen = sheepPen; + } + + public String getSheepPen() { + return sheepPen; + } + + public void setBreedingStatus(String breedingStatus) { + this.breedingStatus = breedingStatus; + } + + public String getBreedingStatus() { + return breedingStatus; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("sheepId", getSheepId()) + .append("datetime", getDatetime()) + .append("weight", getWeight()) + .append("status", getStatus()) + .append("technician", getTechnician()) + .append("comment", getComment()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("electronicTags", getElectronicTags()) + .append("earNumber", getEarNumber()) + .append("breed", getBreed()) + .append("eventType", getEventType()) + .append("gender", getGender()) + .append("fatherNumber", getFatherNumber()) + .append("motherNumber", getMotherNumber()) + .append("monthAge", getMonthAge()) + .append("birthWeight", getBirthWeight()) + .append("sheepPen", getSheepPen()) + .append("breedingStatus", getBreedingStatus()) + .toString(); + } +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/wean/mapper/ScWeanRecordMapper.java b/zhyc-module/src/main/java/com/zhyc/module/produce/wean/mapper/ScWeanRecordMapper.java new file mode 100644 index 0000000..b8b5d5e --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/wean/mapper/ScWeanRecordMapper.java @@ -0,0 +1,68 @@ +package com.zhyc.module.produce.wean.mapper; + +import java.util.List; +import com.zhyc.module.produce.wean.domain.ScWeanRecord; + +/** + * 断奶记录Mapper接口 + * + * @author zhyc + * @date 2024-01-01 + */ +public interface ScWeanRecordMapper { + /** + * 查询断奶记录 + * + * @param id 断奶记录主键 + * @return 断奶记录 + */ + public ScWeanRecord selectScWeanRecordById(Long id); + + /** + * 查询断奶记录列表 + * + * @param scWeanRecord 断奶记录 + * @return 断奶记录集合 + */ + public List selectScWeanRecordList(ScWeanRecord scWeanRecord); + + /** + * 新增断奶记录 + * + * @param scWeanRecord 断奶记录 + * @return 结果 + */ + public int insertScWeanRecord(ScWeanRecord scWeanRecord); + + /** + * 修改断奶记录 + * + * @param scWeanRecord 断奶记录 + * @return 结果 + */ + public int updateScWeanRecord(ScWeanRecord scWeanRecord); + + /** + * 删除断奶记录 + * + * @param id 断奶记录主键 + * @return 结果 + */ + public int deleteScWeanRecordById(Long id); + + /** + * 批量删除断奶记录 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteScWeanRecordByIds(Long[] ids); + + /** + * 根据耳号查询羊只ID + * + * @param earNumber 耳号 + * @return 羊只ID + */ + public Long selectSheepIdByEarNumber(String earNumber); +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/wean/service/IScWeanRecordService.java b/zhyc-module/src/main/java/com/zhyc/module/produce/wean/service/IScWeanRecordService.java new file mode 100644 index 0000000..9926de0 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/wean/service/IScWeanRecordService.java @@ -0,0 +1,68 @@ +package com.zhyc.module.produce.wean.service; + +import java.util.List; +import com.zhyc.module.produce.wean.domain.ScWeanRecord; + +/** + * 断奶记录Service接口 + * + * @author ruoyi + * @date 2025-07-13 + */ +public interface IScWeanRecordService { + /** + * 查询断奶记录 + * + * @param id 断奶记录主键 + * @return 断奶记录 + */ + public ScWeanRecord selectScWeanRecordById(Long id); + + /** + * 查询断奶记录列表 + * + * @param scWeanRecord 断奶记录 + * @return 断奶记录集合 + */ + public List selectScWeanRecordList(ScWeanRecord scWeanRecord); + + /** + * 新增断奶记录 + * + * @param scWeanRecord 断奶记录 + * @return 结果 + */ + public int insertScWeanRecord(ScWeanRecord scWeanRecord); + + /** + * 修改断奶记录 + * + * @param scWeanRecord 断奶记录 + * @return 结果 + */ + public int updateScWeanRecord(ScWeanRecord scWeanRecord); + + /** + * 批量删除断奶记录 + * + * @param ids 需要删除的断奶记录主键集合 + * @return 结果 + */ + public int deleteScWeanRecordByIds(Long[] ids); + + /** + * 删除断奶记录信息 + * + * @param id 断奶记录主键 + * @return 结果 + */ + public int deleteScWeanRecordById(Long id); + + /** + * 根据耳号查询羊只ID + * + * @param earNumber 耳号 + * @return 羊只ID + */ + public Long selectSheepIdByEarNumber(String earNumber); +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/wean/service/impl/ScWeanRecordServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/produce/wean/service/impl/ScWeanRecordServiceImpl.java new file mode 100644 index 0000000..2bc63c2 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/wean/service/impl/ScWeanRecordServiceImpl.java @@ -0,0 +1,113 @@ +package com.zhyc.module.produce.wean.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.produce.wean.mapper.ScWeanRecordMapper; +import com.zhyc.module.produce.wean.domain.ScWeanRecord; +import com.zhyc.module.produce.wean.service.IScWeanRecordService; + +/** + * 断奶记录Service业务层处理 + * + * @author ruoyi + * @date 2025-07-13 + */ +@Service +public class ScWeanRecordServiceImpl implements IScWeanRecordService { + @Autowired + private ScWeanRecordMapper scWeanRecordMapper; + + /** + * 查询断奶记录 + * + * @param id 断奶记录主键 + * @return 断奶记录 + */ + @Override + public ScWeanRecord selectScWeanRecordById(Long id) { + return scWeanRecordMapper.selectScWeanRecordById(id); + } + + /** + * 查询断奶记录列表 + * + * @param scWeanRecord 断奶记录 + * @return 断奶记录 + */ + @Override + public List selectScWeanRecordList(ScWeanRecord scWeanRecord) { + return scWeanRecordMapper.selectScWeanRecordList(scWeanRecord); + } + + /** + * 新增断奶记录 + * + * @param scWeanRecord 断奶记录 + * @return 结果 + */ + @Override + public int insertScWeanRecord(ScWeanRecord scWeanRecord) { + // 如果前端传递的是耳号,需要先获取羊只ID + if (scWeanRecord.getEarNumber() != null && scWeanRecord.getSheepId() == null) { + Long sheepId = scWeanRecordMapper.selectSheepIdByEarNumber(scWeanRecord.getEarNumber()); + if (sheepId != null) { + scWeanRecord.setSheepId(sheepId); + } + } + scWeanRecord.setCreateTime(DateUtils.getNowDate()); + return scWeanRecordMapper.insertScWeanRecord(scWeanRecord); + } + + /** + * 修改断奶记录 + * + * @param scWeanRecord 断奶记录 + * @return 结果 + */ + @Override + public int updateScWeanRecord(ScWeanRecord scWeanRecord) { + // 如果前端传递的是耳号,需要先获取羊只ID + if (scWeanRecord.getEarNumber() != null && scWeanRecord.getSheepId() == null) { + Long sheepId = scWeanRecordMapper.selectSheepIdByEarNumber(scWeanRecord.getEarNumber()); + if (sheepId != null) { + scWeanRecord.setSheepId(sheepId); + } + } + return scWeanRecordMapper.updateScWeanRecord(scWeanRecord); + } + + /** + * 批量删除断奶记录 + * + * @param ids 需要删除的断奶记录主键 + * @return 结果 + */ + @Override + public int deleteScWeanRecordByIds(Long[] ids) { + return scWeanRecordMapper.deleteScWeanRecordByIds(ids); + } + + /** + * 删除断奶记录信息 + * + * @param id 断奶记录主键 + * @return 结果 + */ + @Override + public int deleteScWeanRecordById(Long id) { + return scWeanRecordMapper.deleteScWeanRecordById(id); + } + + /** + * 根据耳号查询羊只ID + * + * @param earNumber 耳号 + * @return 羊只ID + */ + @Override + public Long selectSheepIdByEarNumber(String earNumber) { + return scWeanRecordMapper.selectSheepIdByEarNumber(earNumber); + } +} \ No newline at end of file diff --git a/zhyc-module/src/main/resources/mapper/Weaning/ScWeanRecordMapper.xml b/zhyc-module/src/main/resources/mapper/Weaning/ScWeanRecordMapper.xml new file mode 100644 index 0000000..a5cdc3b --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/Weaning/ScWeanRecordMapper.xml @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select + wr.id, wr.sheep_id, wr.datetime, wr.weight, wr.status, wr.technician, + wr.comment, wr.create_by, wr.create_time, wr.electronic_tags, + sf.bs_manage_tags, sf.variety, sf.gender, sf.father_manage_tags, sf.mother_manage_tags, + sf.birth_weight, sf.sheepfold_name, sf.breed, sf.month_age, + '断奶' as event_type + from sc_wean_record wr + left join sheep_file sf on wr.sheep_id = sf.id + + + + + + + + + + + + + + insert into sc_wean_record + + sheep_id, + datetime, + weight, + status, + technician, + comment, + create_by, + create_time, + electronic_tags, + + + #{sheepId}, + #{datetime}, + #{weight}, + #{status}, + #{technician}, + #{comment}, + #{createBy}, + #{createTime}, + #{electronicTags}, + + + + + + update sc_wean_record + + sheep_id = #{sheepId}, + datetime = #{datetime}, + weight = #{weight}, + status = #{status}, + technician = #{technician}, + comment = #{comment}, + create_by = #{createBy}, + create_time = #{createTime}, + electronic_tags = #{electronicTags}, + + where id = #{id} + + + + + delete from sc_wean_record where id = #{id} + + + + + delete from sc_wean_record where id in + + #{id} + + + \ No newline at end of file diff --git a/zhyc-module/src/main/resources/mapper/biosafety/DewormMapper.xml b/zhyc-module/src/main/resources/mapper/biosafety/DewormMapper.xml new file mode 100644 index 0000000..91cc932 --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/biosafety/DewormMapper.xml @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + select id, sheep_id, usage_id, variety, sheep_type, gender, month_age, parity, datetime, technical, comment, update_by, update_time, create_by, create_time from sw_deworm + + + + + + + + insert into sw_deworm + + sheep_id, + usage_id, + variety, + sheep_type, + gender, + month_age, + parity, + datetime, + technical, + comment, + update_by, + update_time, + create_by, + create_time, + + + #{sheepId}, + #{usageId}, + #{variety}, + #{sheepType}, + #{gender}, + #{monthAge}, + #{parity}, + #{datetime}, + #{technical}, + #{comment}, + #{updateBy}, + #{updateTime}, + #{createBy}, + #{createTime}, + + + + + update sw_deworm + + sheep_id = #{sheepId}, + usage_id = #{usageId}, + variety = #{variety}, + sheep_type = #{sheepType}, + gender = #{gender}, + month_age = #{monthAge}, + parity = #{parity}, + datetime = #{datetime}, + technical = #{technical}, + comment = #{comment}, + update_by = #{updateBy}, + update_time = #{updateTime}, + create_by = #{createBy}, + create_time = #{createTime}, + + where id = #{id} + + + + delete from sw_deworm where id = #{id} + + + + delete from sw_deworm where id in + + #{id} + + + \ No newline at end of file diff --git a/zhyc-module/src/main/resources/mapper/biosafety/DiagnosisMapper.xml b/zhyc-module/src/main/resources/mapper/biosafety/DiagnosisMapper.xml new file mode 100644 index 0000000..68cfea1 --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/biosafety/DiagnosisMapper.xml @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + select id, treat_id, sheep_id, datetime, sheep_type, gender, parity, disease_pid, disease_id, result, begindate, enddate, treat_day, sheepfold_id, create_by, create_time from sw_diagnosis + + + + + + + + insert into sw_diagnosis + + treat_id, + sheep_id, + datetime, + sheep_type, + gender, + parity, + disease_pid, + disease_id, + result, + begindate, + enddate, + treat_day, + sheepfold_id, + create_by, + create_time, + + + #{treatId}, + #{sheepId}, + #{datetime}, + #{sheepType}, + #{gender}, + #{parity}, + #{diseasePid}, + #{diseaseId}, + #{result}, + #{begindate}, + #{enddate}, + #{treatDay}, + #{sheepfoldId}, + #{createBy}, + #{createTime}, + + + + + update sw_diagnosis + + treat_id = #{treatId}, + sheep_id = #{sheepId}, + datetime = #{datetime}, + sheep_type = #{sheepType}, + gender = #{gender}, + parity = #{parity}, + disease_pid = #{diseasePid}, + disease_id = #{diseaseId}, + result = #{result}, + begindate = #{begindate}, + enddate = #{enddate}, + treat_day = #{treatDay}, + sheepfold_id = #{sheepfoldId}, + create_by = #{createBy}, + create_time = #{createTime}, + + where id = #{id} + + + + delete from sw_diagnosis where id = #{id} + + + + delete from sw_diagnosis where id in + + #{id} + + + \ No newline at end of file diff --git a/zhyc-module/src/main/resources/mapper/biosafety/DisinfectMapper.xml b/zhyc-module/src/main/resources/mapper/biosafety/DisinfectMapper.xml new file mode 100644 index 0000000..175d4a7 --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/biosafety/DisinfectMapper.xml @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + + select id, sheepfold_id, datetime, technician, way, usage_id, ratio, comment, update_by, update_time, create_by, create_time from sw_disinfect + + + + + + + + insert into sw_disinfect + + sheepfold_id, + datetime, + technician, + way, + usage_id, + ratio, + comment, + update_by, + update_time, + create_by, + create_time, + + + #{sheepfoldId}, + #{datetime}, + #{technician}, + #{way}, + #{usageId}, + #{ratio}, + #{comment}, + #{updateBy}, + #{updateTime}, + #{createBy}, + #{createTime}, + + + + + update sw_disinfect + + sheepfold_id = #{sheepfoldId}, + datetime = #{datetime}, + technician = #{technician}, + way = #{way}, + usage_id = #{usageId}, + ratio = #{ratio}, + comment = #{comment}, + update_by = #{updateBy}, + update_time = #{updateTime}, + create_by = #{createBy}, + create_time = #{createTime}, + + where id = #{id} + + + + delete from sw_disinfect where id = #{id} + + + + delete from sw_disinfect where id in + + #{id} + + + \ No newline at end of file diff --git a/zhyc-module/src/main/resources/mapper/biosafety/HealthMapper.xml b/zhyc-module/src/main/resources/mapper/biosafety/HealthMapper.xml new file mode 100644 index 0000000..6c5610d --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/biosafety/HealthMapper.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + select id, datetime, sheep_id, usage_id, variety, sheep_type, gender, month_age, parity, sheepfold_id, technical, comment, update_by, update_time, create_by, create_time from sw_health + + + + + + + + insert into sw_health + + datetime, + sheep_id, + usage_id, + variety, + sheep_type, + gender, + month_age, + parity, + sheepfold_id, + technical, + comment, + update_by, + update_time, + create_by, + create_time, + + + #{datetime}, + #{sheepId}, + #{usageId}, + #{variety}, + #{sheepType}, + #{gender}, + #{monthAge}, + #{parity}, + #{sheepfoldId}, + #{technical}, + #{comment}, + #{updateBy}, + #{updateTime}, + #{createBy}, + #{createTime}, + + + + + update sw_health + + datetime = #{datetime}, + sheep_id = #{sheepId}, + usage_id = #{usageId}, + variety = #{variety}, + sheep_type = #{sheepType}, + gender = #{gender}, + month_age = #{monthAge}, + parity = #{parity}, + sheepfold_id = #{sheepfoldId}, + technical = #{technical}, + comment = #{comment}, + update_by = #{updateBy}, + update_time = #{updateTime}, + create_by = #{createBy}, + create_time = #{createTime}, + + where id = #{id} + + + + delete from sw_health where id = #{id} + + + + delete from sw_health where id in + + #{id} + + + \ No newline at end of file diff --git a/zhyc-module/src/main/resources/mapper/biosafety/ImmunityMapper.xml b/zhyc-module/src/main/resources/mapper/biosafety/ImmunityMapper.xml new file mode 100644 index 0000000..c7c57a0 --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/biosafety/ImmunityMapper.xml @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + select id, sheep_id, usage_id, variety, sheep_type, gender, month_age, parity, sheepfold_id, datetime, technical, comment, update_by, update_time, create_by, create_time from sw_immunity + + + + + + + + insert into sw_immunity + + sheep_id, + usage_id, + variety, + sheep_type, + gender, + month_age, + parity, + sheepfold_id, + datetime, + technical, + comment, + update_by, + update_time, + create_by, + create_time, + + + #{sheepId}, + #{usageId}, + #{variety}, + #{sheepType}, + #{gender}, + #{monthAge}, + #{parity}, + #{sheepfoldId}, + #{datetime}, + #{technical}, + #{comment}, + #{updateBy}, + #{updateTime}, + #{createBy}, + #{createTime}, + + + + + update sw_immunity + + sheep_id = #{sheepId}, + usage_id = #{usageId}, + variety = #{variety}, + sheep_type = #{sheepType}, + gender = #{gender}, + month_age = #{monthAge}, + parity = #{parity}, + sheepfold_id = #{sheepfoldId}, + datetime = #{datetime}, + technical = #{technical}, + comment = #{comment}, + update_by = #{updateBy}, + update_time = #{updateTime}, + create_by = #{createBy}, + create_time = #{createTime}, + + where id = #{id} + + + + delete from sw_immunity where id = #{id} + + + + delete from sw_immunity where id in + + #{id} + + + \ No newline at end of file diff --git a/zhyc-module/src/main/resources/mapper/biosafety/QuarantineItemsMapper.xml b/zhyc-module/src/main/resources/mapper/biosafety/QuarantineItemsMapper.xml new file mode 100644 index 0000000..382970e --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/biosafety/QuarantineItemsMapper.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + select id, name from sw_quarantine_items + + + + + + + + insert into sw_quarantine_items + + name, + + + #{name}, + + + + + update sw_quarantine_items + + name = #{name}, + + where id = #{id} + + + + delete from sw_quarantine_items where id = #{id} + + + + delete from sw_quarantine_items where id in + + #{id} + + + \ No newline at end of file diff --git a/zhyc-module/src/main/resources/mapper/biosafety/QuarantineReportMapper.xml b/zhyc-module/src/main/resources/mapper/biosafety/QuarantineReportMapper.xml new file mode 100644 index 0000000..525c60c --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/biosafety/QuarantineReportMapper.xml @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select sqr.id, sheep_type,sheep_id, datetime, quar_item, sample_type, sampler, quar_officer, result, status, + sqr.update_by, sqr.update_time, sqr.create_by, sqr.create_time, + sqi.name as item_name, + sqs.name as sample, + sf.bs_manage_tags sheep_no,sf.gender,sf.parity,sf.breed,sf.month_age + from sw_quarantine_report sqr + left join sw_quarantine_items sqi on sqr.quar_item = sqi.id + left join sw_quarantine_sample sqs on sqr.sample_type = sqs.id + left join sheep_file sf on sqr.sheep_id = sf.id + + + + + + + + insert into sw_quarantine_report + + sheep_id, + datetime, + quar_item, + sample_type, + sampler, + quar_officer, + result, + status, + update_by, + update_time, + create_by, + create_time, + + + #{sheepId}, + #{datetime}, + #{quarItem}, + #{sampleType}, + #{sampler}, + #{quarOfficer}, + #{result}, + #{status}, + #{updateBy}, + #{updateTime}, + #{createBy}, + #{createTime}, + + + + + update sw_quarantine_report + + sheep_id = #{sheepId}, + datetime = #{datetime}, + quar_item = #{quarItem}, + sample_type = #{sampleType}, + sampler = #{sampler}, + quar_officer = #{quarOfficer}, + result = #{result}, + status = #{status}, + update_by = #{updateBy}, + update_time = #{updateTime}, + create_by = #{createBy}, + create_time = #{createTime}, + + where id = #{id} + + + + delete from sw_quarantine_report where id = #{id} + + + + delete from sw_quarantine_report where id in + + #{id} + + + \ No newline at end of file diff --git a/zhyc-module/src/main/resources/mapper/biosafety/QuarantineSampleMapper.xml b/zhyc-module/src/main/resources/mapper/biosafety/QuarantineSampleMapper.xml new file mode 100644 index 0000000..7deacd0 --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/biosafety/QuarantineSampleMapper.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + select id, name from sw_quarantine_sample + + + + + + + + insert into sw_quarantine_sample + + name, + + + #{name}, + + + + + update sw_quarantine_sample + + name = #{name}, + + where id = #{id} + + + + delete from sw_quarantine_sample where id = #{id} + + + + delete from sw_quarantine_sample where id in + + #{id} + + + \ No newline at end of file diff --git a/zhyc-module/src/main/resources/mapper/biosafety/TreatmentMapper.xml b/zhyc-module/src/main/resources/mapper/biosafety/TreatmentMapper.xml new file mode 100644 index 0000000..ea9b470 --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/biosafety/TreatmentMapper.xml @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, diag_id, sheep_id, variety, sheep_type, month_age, gender, parity, breed, lact_day, gest_day, datetime, disease_id, disease_pid, veterinary, usage_id, comment, update_by, update_time, create_by, create_time from sw_treatment + + + + + + + + insert into sw_treatment + + diag_id, + sheep_id, + variety, + sheep_type, + month_age, + gender, + parity, + breed, + lact_day, + gest_day, + datetime, + disease_id, + disease_pid, + veterinary, + usage_id, + comment, + update_by, + update_time, + create_by, + create_time, + + + #{diagId}, + #{sheepId}, + #{variety}, + #{sheepType}, + #{monthAge}, + #{gender}, + #{parity}, + #{breed}, + #{lactDay}, + #{gestDay}, + #{datetime}, + #{diseaseId}, + #{diseasePid}, + #{veterinary}, + #{usageId}, + #{comment}, + #{updateBy}, + #{updateTime}, + #{createBy}, + #{createTime}, + + + + + update sw_treatment + + diag_id = #{diagId}, + sheep_id = #{sheepId}, + variety = #{variety}, + sheep_type = #{sheepType}, + month_age = #{monthAge}, + gender = #{gender}, + parity = #{parity}, + breed = #{breed}, + lact_day = #{lactDay}, + gest_day = #{gestDay}, + datetime = #{datetime}, + disease_id = #{diseaseId}, + disease_pid = #{diseasePid}, + veterinary = #{veterinary}, + usage_id = #{usageId}, + comment = #{comment}, + update_by = #{updateBy}, + update_time = #{updateTime}, + create_by = #{createBy}, + create_time = #{createTime}, + + where id = #{id} + + + + delete from sw_treatment where id = #{id} + + + + delete from sw_treatment where id in + + #{id} + + + \ No newline at end of file diff --git a/zhyc-module/src/main/resources/mapper/breed/ScLambDetailMapper.xml b/zhyc-module/src/main/resources/mapper/breed/ScLambDetailMapper.xml new file mode 100644 index 0000000..c94b857 --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/breed/ScLambDetailMapper.xml @@ -0,0 +1,256 @@ + + + + + + + + + + + + + + + + + + + + + + + + select id, lambing_record_id, lamb_ear_number, lamb_breed, gender, birth_weight, + is_retained, lineage, birthday, create_by, create_time, update_by, update_time + from sc_lamb_detail + + + + + + + + + + + + + + + + + + insert into sc_lamb_detail + + lambing_record_id, + lamb_ear_number, + lamb_breed, + gender, + birth_weight, + is_retained, + lineage, + birthday, + create_by, + create_time, + + + #{lambingRecordId}, + #{lambEarNumber}, + #{lambBreed}, + #{gender}, + #{birthWeight}, + #{isRetained}, + #{lineage}, + #{birthday}, + #{createBy}, + #{createTime}, + + + + + + insert into bas_sheep + + manage_tags, + variety_id, + gender, + birthday, + birth_weight, + family, + mother_id, + father_id, + ranch_id, + sheepfold_id, + parity, + status_id, + type_id, + breed_status_id, + is_delete, + create_by, + create_time, + + + #{lambEarNumber}, + #{lambBreed}, + #{gender}, + #{birthday}, + #{birthWeight}, + #{lineage}, + #{motherId}, + #{fatherId}, + #{ranchId}, + #{sheepfoldId}, + #{parity}, + #{isRetained}, + 3, + 1, + 0, + #{createBy}, + #{createTime}, + + + + + + + insert into sc_lamb_detail (lambing_record_id, lamb_ear_number, lamb_breed, gender, birth_weight, + is_retained, lineage, birthday, create_by, create_time) + values + + (#{item.lambingRecordId}, #{item.lambEarNumber}, #{item.lambBreed}, #{item.gender}, + #{item.birthWeight}, #{item.isRetained}, #{item.lineage}, #{item.birthday}, + #{item.createBy}, #{item.createTime}) + + + + + + insert into bas_sheep (manage_tags, variety_id, gender, birthday, birth_weight, family, + mother_id, father_id, ranch_id, sheepfold_id, parity, status_id, type_id, breed_status_id, is_delete, create_by, create_time) + values + + (#{item.lambEarNumber}, #{item.lambBreed}, #{item.gender}, #{item.birthday}, + #{item.birthWeight}, #{item.lineage}, #{item.motherId}, #{item.fatherId}, + #{item.ranchId}, #{item.sheepfoldId}, #{item.parity}, #{item.isRetained}, + 3, 1, 0, #{item.createBy}, #{item.createTime}) + + + + + + update sc_lamb_detail + + lambing_record_id = #{lambingRecordId}, + lamb_ear_number = #{lambEarNumber}, + lamb_breed = #{lambBreed}, + gender = #{gender}, + birth_weight = #{birthWeight}, + is_retained = #{isRetained}, + lineage = #{lineage}, + birthday = #{birthday}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where id = #{id} + + + + + update bas_sheep + + manage_tags = #{lambEarNumber}, + variety_id = #{lambBreed}, + gender = #{gender}, + birthday = #{birthday}, + birth_weight = #{birthWeight}, + family = #{lineage}, + status_id = #{isRetained}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where manage_tags = #{lambEarNumber} and is_delete = 0 + + + + + delete from sc_lamb_detail where id = #{id} + + + + + update bas_sheep set is_delete = 1 where manage_tags = #{lambEarNumber} + + + + + delete from sc_lamb_detail where id in + + #{id} + + + + + + update bas_sheep set is_delete = 1 where manage_tags in + + #{earNumber} + + + + + + delete from sc_lamb_detail where lambing_record_id = #{lambingRecordId} + + + + + update bas_sheep set is_delete = 1 + where manage_tags in ( + select lamb_ear_number from sc_lamb_detail + where lambing_record_id = #{lambingRecordId} + ) + + + + + + \ No newline at end of file diff --git a/zhyc-module/src/main/resources/mapper/breed/ScLambingRecordMapper.xml b/zhyc-module/src/main/resources/mapper/breed/ScLambingRecordMapper.xml new file mode 100644 index 0000000..937834b --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/breed/ScLambingRecordMapper.xml @@ -0,0 +1,212 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, sheep_id, parity, lambs_born, survival, technician, score, comment, create_by, create_tme from sc_lambing_record + + + + + SELECT + lr.id, lr.sheep_id, lr.parity, lr.lambs_born, lr.survival, + lr.technician, lr.score, lr.comment, lr.create_by, lr.create_tme, + + -- 从bas_sheep表获取母羊信息 + mother.manage_tags as female_ear_number, + mother.variety_id as female_breed, + TIMESTAMPDIFF(MONTH, mother.birthday, NOW()) as month_age, + mother.sheepfold_id as current_shed, + mother.ranch_id as farm, + + -- 从sc_breed_record表获取配种信息 + br.create_time as breeding_date, + DATEDIFF(lr.create_tme, br.create_time) as pregnancy_days, + + -- 从bas_sheep表获取公羊信息 + father.manage_tags as male_ear_number, + father.variety_id as male_breed, + + -- 统计羔羊信息(从bas_sheep表统计,根据母羊ID) + (SELECT COUNT(*) FROM bas_sheep lamb WHERE lamb.mother_id = lr.sheep_id AND lamb.gender = 1 AND lamb.is_delete = 0) as male_count, + (SELECT COUNT(*) FROM bas_sheep lamb WHERE lamb.mother_id = lr.sheep_id AND lamb.gender = 0 AND lamb.is_delete = 0) as female_count, + (SELECT COUNT(*) FROM bas_sheep lamb WHERE lamb.mother_id = lr.sheep_id AND lamb.gender = 1 AND lamb.status_id = 1 AND lamb.is_delete = 0) as retained_male_count, + (SELECT COUNT(*) FROM bas_sheep lamb WHERE lamb.mother_id = lr.sheep_id AND lamb.gender = 0 AND lamb.status_id = 1 AND lamb.is_delete = 0) as retained_female_count, + (SELECT COUNT(*) FROM bas_sheep lamb WHERE lamb.mother_id = lr.sheep_id AND lamb.gender = 1 AND lamb.status_id != 1 AND lamb.is_delete = 0) as unretained_male_count, + (SELECT COUNT(*) FROM bas_sheep lamb WHERE lamb.mother_id = lr.sheep_id AND lamb.gender = 0 AND lamb.status_id != 1 AND lamb.is_delete = 0) as unretained_female_count + + FROM sc_lambing_record lr + LEFT JOIN bas_sheep mother ON lr.sheep_id = mother.id + LEFT JOIN sc_breed_record br ON lr.sheep_id = br.ewe_id AND lr.parity = mother.parity + LEFT JOIN bas_sheep father ON br.ram_id = father.id + + + + + + + + + + + + + + + + + insert into sc_lambing_record + + sheep_id, + parity, + lambs_born, + survival, + technician, + score, + comment, + create_by, + create_tme, + + + #{sheepId}, + #{parity}, + #{lambsBorn}, + #{survival}, + #{technician}, + #{score}, + #{comment}, + #{createBy}, + #{createTime}, + + + + + + update sc_lambing_record + + sheep_id = #{sheepId}, + parity = #{parity}, + lambs_born = #{lambsBorn}, + survival = #{survival}, + technician = #{technician}, + score = #{score}, + comment = #{comment}, + create_by = #{createBy}, + create_tme = #{createTime}, + + where id = #{id} + + + + + delete from sc_lambing_record where id = #{id} + + + + + delete from sc_lambing_record where id in + + #{id} + + + \ No newline at end of file diff --git a/zhyc-module/src/main/resources/mapper/dryMatterCorrection/XzDryMatterCorrectionMapper.xml b/zhyc-module/src/main/resources/mapper/dairyProducts/dryMatterCorrection/XzDryMatterCorrectionMapper.xml similarity index 59% rename from zhyc-module/src/main/resources/mapper/dryMatterCorrection/XzDryMatterCorrectionMapper.xml rename to zhyc-module/src/main/resources/mapper/dairyProducts/dryMatterCorrection/XzDryMatterCorrectionMapper.xml index 6d36991..4099d6e 100644 --- a/zhyc-module/src/main/resources/mapper/dryMatterCorrection/XzDryMatterCorrectionMapper.xml +++ b/zhyc-module/src/main/resources/mapper/dairyProducts/dryMatterCorrection/XzDryMatterCorrectionMapper.xml @@ -2,7 +2,7 @@ - + @@ -14,57 +14,65 @@ - select id, datetime, factory, content, standard, coefficient from xz_dry_matter_correction + SELECT + id, + datetime, + factory, + content, + standard, + CASE + WHEN standard = 0 OR standard IS NULL THEN NULL + ELSE content / standard + END AS coefficient + FROM xz_dry_matter_correction - insert into xz_dry_matter_correction + INSERT INTO xz_dry_matter_correction - datetime, - factory, - content, - standard, - coefficient, + datetime, factory, content, standard - - #{datetime}, - #{factory}, - #{content}, - #{standard}, - #{coefficient}, + + #{datetime}, #{factory}, #{content}, #{standard} - update xz_dry_matter_correction - + UPDATE xz_dry_matter_correction + datetime = #{datetime}, factory = #{factory}, content = #{content}, standard = #{standard}, - coefficient = #{coefficient}, - - where id = #{id} + + WHERE id = #{id} - delete from xz_dry_matter_correction where id = #{id} + DELETE FROM xz_dry_matter_correction WHERE id = #{id} - - delete from xz_dry_matter_correction where id in + + DELETE FROM xz_dry_matter_correction WHERE id IN #{id} diff --git a/zhyc-module/src/main/resources/mapper/dairyProducts/parityCorrection/XzParityCorrectionMapper.xml b/zhyc-module/src/main/resources/mapper/dairyProducts/parityCorrection/XzParityCorrectionMapper.xml new file mode 100644 index 0000000..3e76551 --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/dairyProducts/parityCorrection/XzParityCorrectionMapper.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + select id, parity, coef from xz_parity_correction + + + + + + + + insert into xz_parity_correction + + parity, + coef, + + + #{parity}, + #{coef}, + + + + + update xz_parity_correction + + parity = #{parity}, + coef = #{coef}, + + where id = #{id} + + + + delete from xz_parity_correction where id = #{id} + + + + delete from xz_parity_correction where id in + + #{id} + + + \ No newline at end of file diff --git a/zhyc-module/src/main/resources/mapper/dairyProducts/weightCorrection/XzWegihCorrectionMapper.xml b/zhyc-module/src/main/resources/mapper/dairyProducts/weightCorrection/XzWegihCorrectionMapper.xml new file mode 100644 index 0000000..38696ad --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/dairyProducts/weightCorrection/XzWegihCorrectionMapper.xml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + select + id, + datetime, + factory, + actual, + system_milk, + CASE + WHEN system_milk = 0 THEN 0 + ELSE ROUND(actual / system_milk, 4) + END as coefficient + from xz_wegih_correction + + + + + + + + insert into xz_wegih_correction + + datetime, + factory, + actual, + system_milk, + + + #{datetime}, + #{factory}, + #{actual}, + #{systemMilk}, + + + + + update xz_wegih_correction + + datetime = #{datetime}, + factory = #{factory}, + actual = #{actual}, + system_milk = #{systemMilk}, + + where id = #{id} + + + + delete from xz_wegih_correction where id = #{id} + + + + delete from xz_wegih_correction where id in + + #{id} + + + \ No newline at end of file diff --git a/zhyc-module/src/main/resources/mapper/fileManagement/BasSheepGroupMapper.xml b/zhyc-module/src/main/resources/mapper/fileManagement/BasSheepGroupMapper.xml new file mode 100644 index 0000000..dd632fd --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/fileManagement/BasSheepGroupMapper.xml @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + SELECT + g.group_id, + g.parent_id, + g.group_name, + g.ancestors, + g.status, + g.create_by, + g.create_time, + g.update_by, + g.update_time, + + (SELECT GROUP_CONCAT(parent.group_name ORDER BY FIND_IN_SET(parent.group_id, g.ancestors)) + FROM bas_sheep_group parent + WHERE FIND_IN_SET(parent.group_id, g.ancestors) > 0 + ) AS ancestor_names, + (CASE WHEN (SELECT COUNT(1) FROM bas_sheep_group child WHERE child.parent_id = g.group_id) > 0 THEN 0 ELSE 1 END) AS is_leaf + FROM bas_sheep_group g + + + + + + + + insert into bas_sheep_group + + parent_id, + group_name, + ancestors, + status, + create_by, + create_time, + update_by, + update_time, + + + #{parentId}, + #{groupName}, + #{ancestors}, + #{status}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update bas_sheep_group + + parent_id = #{parentId}, + group_name = #{groupName}, + ancestors = #{ancestors}, + status = #{status}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where group_id = #{groupId} + + + + delete from bas_sheep_group where group_id = #{groupId} + + + + delete from bas_sheep_group where group_id in + + #{groupId} + + + + + \ 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/fileManagement/DaSheepfoldMapper.xml similarity index 91% rename from zhyc-module/src/main/resources/mapper/sheepfold_management/DaSheepfoldMapper.xml rename to zhyc-module/src/main/resources/mapper/fileManagement/DaSheepfoldMapper.xml index 434206b..6b25173 100644 --- a/zhyc-module/src/main/resources/mapper/sheepfold_management/DaSheepfoldMapper.xml +++ b/zhyc-module/src/main/resources/mapper/fileManagement/DaSheepfoldMapper.xml @@ -2,7 +2,7 @@ - + @@ -78,4 +78,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{id} + + \ No newline at end of file diff --git a/zhyc-module/src/main/resources/mapper/sheep_file/SheepFileMapper.xml b/zhyc-module/src/main/resources/mapper/fileManagement/SheepFileMapper.xml similarity index 99% rename from zhyc-module/src/main/resources/mapper/sheep_file/SheepFileMapper.xml rename to zhyc-module/src/main/resources/mapper/fileManagement/SheepFileMapper.xml index 40bd0ef..e1280ed 100644 --- a/zhyc-module/src/main/resources/mapper/sheep_file/SheepFileMapper.xml +++ b/zhyc-module/src/main/resources/mapper/fileManagement/SheepFileMapper.xml @@ -2,7 +2,7 @@ - + diff --git a/zhyc-module/src/main/resources/mapper/variety/BasSheepVarietyMapper.xml b/zhyc-module/src/main/resources/mapper/variety/BasSheepVarietyMapper.xml new file mode 100644 index 0000000..dcc97fc --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/variety/BasSheepVarietyMapper.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + select id, variety from bas_sheep_variety + + + + + + + + insert into bas_sheep_variety + + variety, + + + #{variety}, + + + + + update bas_sheep_variety + + variety = #{variety}, + + where id = #{id} + + + + delete from bas_sheep_variety where id = #{id} + + + + delete from bas_sheep_variety where id in + + #{id} + + + \ No newline at end of file