diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/controller/BasSheepController.java b/zhyc-module/src/main/java/com/zhyc/module/base/controller/BasSheepController.java new file mode 100644 index 0000000..fede094 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/controller/BasSheepController.java @@ -0,0 +1,204 @@ +package com.zhyc.module.base.controller; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.servlet.http.HttpServletResponse; + +import com.zhyc.module.base.domain.BasSheep; +import com.zhyc.module.base.domain.BasSheepVariety; +import com.zhyc.module.base.mapper.BasSheepMapper; +import com.zhyc.module.base.service.IBasSheepService; +import com.zhyc.module.base.service.IBasSheepVarietyService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +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("/sheep/sheep") +public class BasSheepController extends BaseController { + @Autowired + private IBasSheepService basSheepService; + + @Autowired + private IBasSheepVarietyService basSheepVarietyService; + + /** + * 查询羊只基本信息列表 + */ + @PreAuthorize("@ss.hasPermi('sheep:sheep:list')") + @GetMapping("/list") + public TableDataInfo list(BasSheep basSheep) { + startPage(); + List list = basSheepService.selectBasSheepList(basSheep); + return getDataTable(list); + } + + /** + * 导出羊只基本信息列表 + */ + @PreAuthorize("@ss.hasPermi('sheep:sheep:export')") + @Log(title = "羊只基本信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, BasSheep basSheep) { + List list = basSheepService.selectBasSheepList(basSheep); + ExcelUtil util = new ExcelUtil(BasSheep.class); + util.exportExcel(response, list, "羊只基本信息数据"); + } + + /** + * 获取羊只基本信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('sheep:sheep:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return success(basSheepService.selectBasSheepById(id)); + } + + /** + * 新增羊只基本信息 + */ + @PreAuthorize("@ss.hasPermi('sheep:sheep:add')") + @Log(title = "羊只基本信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody BasSheep basSheep) { + return toAjax(basSheepService.insertBasSheep(basSheep)); + } + + /** + * 修改羊只基本信息 + */ + @PreAuthorize("@ss.hasPermi('sheep:sheep:edit')") + @Log(title = "羊只基本信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody BasSheep basSheep) { + return toAjax(basSheepService.updateBasSheep(basSheep)); + } + + /** + * 删除羊只基本信息 + */ + @PreAuthorize("@ss.hasPermi('sheep:sheep:remove')") + @Log(title = "羊只基本信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + return toAjax(basSheepService.deleteBasSheepByIds(ids)); + } + + /** + * 根据耳号查询 + */ + @GetMapping("/byManageTags/{manageTags}") + public AjaxResult byManageTags(@PathVariable String manageTags) { + BasSheep sheep = basSheepService.selectBasSheepByManageTags(manageTags.trim()); + if (sheep == null) { + return error("未找到对应的羊只"); + } + + // 补品种名称 + BasSheepVariety variety = basSheepVarietyService.selectBasSheepVarietyById(sheep.getVarietyId()); + sheep.setVarietyName(variety == null ? "" : variety.getVariety()); + + return success(sheep); + } + + /** + * 根据羊只类型ID查询羊只列表 + */ + @PreAuthorize("@ss.hasPermi('sheep:sheep:query')") + @GetMapping("/listByTypeId") + public TableDataInfo listByTypeId(Integer typeId) { + if (typeId == null) { + return getDataTable(new ArrayList<>()); + } + BasSheep query = new BasSheep(); + query.setTypeId(typeId.longValue()); + startPage(); + List list = basSheepService.selectBasSheepList(query); + return getDataTable(list); + } + + /** + * 根据羊舍ID和羊只类型ID组合查询羊只列表 + */ + @PreAuthorize("@ss.hasPermi('sheep:sheep:query')") + @GetMapping("/listBySheepfoldAndType") + public TableDataInfo listBySheepfoldAndType(Integer sheepfoldId, Integer typeId) { + if (sheepfoldId == null || typeId == null) { + return getDataTable(new ArrayList<>()); + } + BasSheep query = new BasSheep(); + query.setSheepfoldId(sheepfoldId.longValue()); + query.setTypeId(typeId.longValue()); + startPage(); + List list = basSheepService.selectBasSheepList(query); + return getDataTable(list); + } + + + /** + * 根据耳号(管理耳号或电子耳号)+ 耳号类型 查询羊只信息 + * earType:0-电子耳号,1-管理耳号 + */ + @GetMapping("/byEarNumber") + public AjaxResult byEarNumber(@RequestParam String earNumber, @RequestParam Integer earType) { + BasSheep query = new BasSheep(); + query.setManageTags(earNumber); + List list = basSheepService.selectBasSheepList(query); + + if (list.isEmpty()) { + query.setManageTags(null); + query.setElectronicTags(earNumber); + list = basSheepService.selectBasSheepList(query); + } + + if (list.isEmpty()) { + return error("未找到对应的羊只"); + } + + BasSheep sheep = list.get(0); + + String oldTag = earType == 0 ? sheep.getElectronicTags() : sheep.getManageTags(); + + Map result = new HashMap<>(); + result.put("sheep", sheep); + result.put("oldTag", oldTag); + + return success(result); + } + + + /** + * 判断耳号是否存在(用于新增羊只时校验) + */ + @GetMapping("/existsByManageTags/{manageTags}") + public AjaxResult existsByManageTags(@PathVariable String manageTags) { + BasSheep sheep = basSheepService.selectBasSheepByManageTags(manageTags.trim()); + if (sheep != null) { + return success(true); + } + return success(false); + } + + + @GetMapping("/existsByTag") + public AjaxResult existsByTag(@RequestParam String tag, @RequestParam Integer earType) { + boolean exists = basSheepService.existsByTag(tag, earType); + Map result = new HashMap<>(); + result.put("exists", exists); + return success(result); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/controller/BasSheepGroupController.java b/zhyc-module/src/main/java/com/zhyc/module/base/controller/BasSheepGroupController.java new file mode 100644 index 0000000..f681ab3 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/controller/BasSheepGroupController.java @@ -0,0 +1,104 @@ +package com.zhyc.module.base.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.base.domain.BasSheepGroup; +import com.zhyc.module.base.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)); + } + + @PreAuthorize("@ss.hasPermi('group_management:group_management:list')") + @GetMapping("/leaf") + public AjaxResult selectLeafNodes() { + List leafNodes = basSheepGroupService.selectLeafNodes(); + return success(leafNodes); + } + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/controller/BasSheepGroupMappingController.java b/zhyc-module/src/main/java/com/zhyc/module/base/controller/BasSheepGroupMappingController.java new file mode 100644 index 0000000..31196e4 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/controller/BasSheepGroupMappingController.java @@ -0,0 +1,148 @@ +package com.zhyc.module.base.controller; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import javax.servlet.http.HttpServletResponse; + +import com.zhyc.common.utils.StringUtils; +import com.zhyc.module.base.domain.BasSheepGroupMapping; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +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.service.IBasSheepGroupMappingService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +// 1. 导入 +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +/** + * 羊只分组关联Controller + * + * @author wyt + * @date 2025-07-16 + */ +@RestController +@RequestMapping("/sheep_grouping/sheep_grouping") +public class BasSheepGroupMappingController extends BaseController +{ + @Autowired + private IBasSheepGroupMappingService basSheepGroupMappingService; + + /** + * 查询羊只分组关联列表 + */ + @PreAuthorize("@ss.hasPermi('sheep_grouping:sheep_grouping:list')") + @GetMapping("/list") + public TableDataInfo list(BasSheepGroupMapping basSheepGroupMapping) + { + startPage(); + List list = basSheepGroupMappingService.selectBasSheepGroupMappingList(basSheepGroupMapping); + return getDataTable(list); + } + + // 2. 声明(放在类内部、方法外部) + private static final Logger log = LoggerFactory.getLogger(BasSheepGroupMappingController.class); + + + @PreAuthorize("@ss.hasPermi('sheep_grouping:sheep_grouping:list')") + @GetMapping("/listJoin") + public TableDataInfo list( + @RequestParam(required = false) Long sheepId, + @RequestParam(required = false) Long groupId, + @RequestParam(required = false) String bsManageTags) { + + List earList = null; + if (StringUtils.hasText(bsManageTags)) { + earList = Arrays.asList(bsManageTags.split("[,,\\s]+")); + } + startPage(); + List> list = basSheepGroupMappingService + .selectBasSheepGroupMappingList(sheepId, groupId, earList); + return getDataTable(list); + } + + + /** + * 导出羊只分组关联列表 + */ + @PreAuthorize("@ss.hasPermi('sheep_grouping:sheep_grouping:export')") + @Log(title = "羊只分组关联", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, BasSheepGroupMapping basSheepGroupMapping) + { + List list = basSheepGroupMappingService.selectBasSheepGroupMappingList(basSheepGroupMapping); + ExcelUtil util = new ExcelUtil(BasSheepGroupMapping.class); + util.exportExcel(response, list, "羊只分组关联数据"); + } + + /** + * 获取羊只分组关联详细信息 + */ + @PreAuthorize("@ss.hasPermi('sheep_grouping:sheep_grouping:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(basSheepGroupMappingService.selectBasSheepGroupMappingById(id)); + } + + /** + * 新增羊只分组关联 + */ + @PreAuthorize("@ss.hasPermi('sheep_grouping:sheep_grouping:add')") + @Log(title = "羊只分组关联", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody BasSheepGroupMapping basSheepGroupMapping) + { + return toAjax(basSheepGroupMappingService.insertBasSheepGroupMapping(basSheepGroupMapping)); + } + + /** + * 修改羊只分组关联 + */ + @PreAuthorize("@ss.hasPermi('sheep_grouping:sheep_grouping:edit')") + @Log(title = "羊只分组关联", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody BasSheepGroupMapping basSheepGroupMapping) + { + try { + return toAjax(basSheepGroupMappingService.updateBasSheepGroupMapping(basSheepGroupMapping)); + } catch (RuntimeException e) { + return error(e.getMessage()); + } + } + + /** + * 删除羊只分组关联 + */ + @PreAuthorize("@ss.hasPermi('sheep_grouping:sheep_grouping:remove')") + @Log(title = "羊只分组关联", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(basSheepGroupMappingService.deleteBasSheepGroupMappingByIds(ids)); + } + + + @PostMapping("/addByEarTags") + public AjaxResult addByEarTags(@RequestBody Map params) { + List earTags = (List) params.get("earTags"); + Long groupId = Long.valueOf(params.get("groupId").toString()); + + if (earTags == null || earTags.isEmpty()) { + return error("耳号列表不能为空"); + } + + return basSheepGroupMappingService.addByEarTags(earTags, groupId); + } + + + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/controller/BasSheepTypeController.java b/zhyc-module/src/main/java/com/zhyc/module/base/controller/BasSheepTypeController.java new file mode 100644 index 0000000..f847204 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/controller/BasSheepTypeController.java @@ -0,0 +1,114 @@ +package com.zhyc.module.base.controller; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import javax.servlet.http.HttpServletResponse; + +import com.zhyc.module.base.domain.BasSheep; +import com.zhyc.module.base.service.IBasSheepService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +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.domain.BasSheepType; +import com.zhyc.module.base.service.IBasSheepTypeService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 羊只类型Controller + * + * @author ruoyi + * @date 2025-07-22 + */ +@RestController +@RequestMapping("/base/base") +public class BasSheepTypeController extends BaseController +{ + @Autowired + private IBasSheepTypeService basSheepTypeService; + + @Autowired + private IBasSheepService basSheepService; + /** + * 查询羊只类型列表 + */ + @PreAuthorize("@ss.hasPermi('base:base:list')") + @GetMapping("/list") + public TableDataInfo list(BasSheepType basSheepType) + { + startPage(); + List list = basSheepTypeService.selectBasSheepTypeList(basSheepType); + return getDataTable(list); + } + + /** + * 导出羊只类型列表 + */ + @PreAuthorize("@ss.hasPermi('base:base:export')") + @Log(title = "羊只类型", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, BasSheepType basSheepType) + { + List list = basSheepTypeService.selectBasSheepTypeList(basSheepType); + ExcelUtil util = new ExcelUtil(BasSheepType.class); + util.exportExcel(response, list, "羊只类型数据"); + } + + /** + * 获取羊只类型详细信息 + */ + @PreAuthorize("@ss.hasPermi('base:base:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Integer id) + { + return success(basSheepTypeService.selectBasSheepTypeById(id)); + } + + /** + * 新增羊只类型 + */ + @PreAuthorize("@ss.hasPermi('base:base:add')") + @Log(title = "羊只类型", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody BasSheepType basSheepType) + { + return toAjax(basSheepTypeService.insertBasSheepType(basSheepType)); + } + + /** + * 修改羊只类型 + */ + @PreAuthorize("@ss.hasPermi('base:base:edit')") + @Log(title = "羊只类型", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody BasSheepType basSheepType) + { + return toAjax(basSheepTypeService.updateBasSheepType(basSheepType)); + } + + /** + * 删除羊只类型 + */ + @PreAuthorize("@ss.hasPermi('base:base:remove')") + @Log(title = "羊只类型", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Integer[] ids) + { + return toAjax(basSheepTypeService.deleteBasSheepTypeByIds(ids)); + } + + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/controller/BasSheepVarietyController.java b/zhyc-module/src/main/java/com/zhyc/module/base/controller/BasSheepVarietyController.java new file mode 100644 index 0000000..0954dc3 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/controller/BasSheepVarietyController.java @@ -0,0 +1,105 @@ +package com.zhyc.module.base.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.zhyc.module.base.domain.BasSheepVariety; +import com.zhyc.module.base.service.IBasSheepVarietyService; +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("/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/controller/BreedRamFileController.java b/zhyc-module/src/main/java/com/zhyc/module/base/controller/BreedRamFileController.java new file mode 100644 index 0000000..7274064 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/controller/BreedRamFileController.java @@ -0,0 +1,104 @@ +package com.zhyc.module.base.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.zhyc.common.annotation.Log; +import com.zhyc.common.enums.BusinessType; +import com.zhyc.module.base.domain.BreedRamFile; +import com.zhyc.module.base.service.IBreedRamFileService; +import com.zhyc.common.core.controller.BaseController; +import com.zhyc.common.core.domain.AjaxResult; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 种公羊档案Controller + * + * @author zhyc + * @date 2025-07-29 + */ +@RestController +@RequestMapping("/ram_file/bas_ram_file") +public class BreedRamFileController extends BaseController +{ + @Autowired + private IBreedRamFileService breedRamFileService; + + /** + * 查询种公羊档案列表 + */ + @PreAuthorize("@ss.hasPermi('breed_ram_file:breed_ram_file:list')") + @GetMapping("/list") + public TableDataInfo list(BreedRamFile breedRamFile) + { + startPage(); + List list = breedRamFileService.selectBreedRamFileList(breedRamFile); + return getDataTable(list); + } + + /** + * 导出种公羊档案列表 + */ + @PreAuthorize("@ss.hasPermi('breed_ram_file:breed_ram_file:export')") + @Log(title = "种公羊档案", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, BreedRamFile breedRamFile) + { + List list = breedRamFileService.selectBreedRamFileList(breedRamFile); + ExcelUtil util = new ExcelUtil(BreedRamFile.class); + util.exportExcel(response, list, "种公羊档案数据"); + } + + /** + * 获取种公羊档案详细信息 + */ + @PreAuthorize("@ss.hasPermi('breed_ram_file:breed_ram_file:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(breedRamFileService.selectBreedRamFileById(id)); + } + + /** + * 新增种公羊档案 + */ + @PreAuthorize("@ss.hasPermi('breed_ram_file:breed_ram_file:add')") + @Log(title = "种公羊档案", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody BreedRamFile breedRamFile) + { + return toAjax(breedRamFileService.insertBreedRamFile(breedRamFile)); + } + + /** + * 修改种公羊档案 + */ + @PreAuthorize("@ss.hasPermi('breed_ram_file:breed_ram_file:edit')") + @Log(title = "种公羊档案", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody BreedRamFile breedRamFile) + { + return toAjax(breedRamFileService.updateBreedRamFile(breedRamFile)); + } + + /** + * 删除种公羊档案 + */ + @PreAuthorize("@ss.hasPermi('breed_ram_file:breed_ram_file:remove')") + @Log(title = "种公羊档案", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(breedRamFileService.deleteBreedRamFileByIds(ids)); + } +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/controller/DaRanchController.java b/zhyc-module/src/main/java/com/zhyc/module/base/controller/DaRanchController.java new file mode 100644 index 0000000..a519335 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/controller/DaRanchController.java @@ -0,0 +1,119 @@ +package com.zhyc.module.base.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.zhyc.module.base.domain.BasSheep; +import com.zhyc.module.base.service.IBasSheepService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +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.domain.DaRanch; +import com.zhyc.module.base.service.IDaRanchService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 牧场管理Controller + * + * @author ruoyi + * @date 2025-07-22 + */ +@RestController +@RequestMapping("/ranch/ranch") +public class DaRanchController extends BaseController +{ + @Autowired + private IDaRanchService daRanchService; + + @Autowired + private IBasSheepService basSheepService; + /** + * 查询牧场管理列表 + */ + @PreAuthorize("@ss.hasPermi('ranch:ranch:list')") + @GetMapping("/list") + public TableDataInfo list(DaRanch daRanch) + { + startPage(); + List list = daRanchService.selectDaRanchList(daRanch); + return getDataTable(list); + } + + /** + * 导出牧场管理列表 + */ + @PreAuthorize("@ss.hasPermi('ranch:ranch:export')") + @Log(title = "牧场管理", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, DaRanch daRanch) + { + List list = daRanchService.selectDaRanchList(daRanch); + ExcelUtil util = new ExcelUtil(DaRanch.class); + util.exportExcel(response, list, "牧场管理数据"); + } + + /** + * 获取牧场管理详细信息 + */ + @PreAuthorize("@ss.hasPermi('ranch:ranch:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(daRanchService.selectDaRanchById(id)); + } + + /** + * 获取指定牧场下的所有羊只耳号 + */ + @GetMapping("/getSheepByRanchId/{ranchId}") + public AjaxResult getSheepByRanchId(@PathVariable Long ranchId) { + List sheepList = basSheepService.getSheepByRanchId(ranchId); + return AjaxResult.success(sheepList); + } + + + /** + * 新增牧场管理 + */ + @PreAuthorize("@ss.hasPermi('ranch:ranch:add')") + @Log(title = "牧场管理", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody DaRanch daRanch) + { + return toAjax(daRanchService.insertDaRanch(daRanch)); + } + + /** + * 修改牧场管理 + */ + @PreAuthorize("@ss.hasPermi('ranch:ranch:edit')") + @Log(title = "牧场管理", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody DaRanch daRanch) + { + return toAjax(daRanchService.updateDaRanch(daRanch)); + } + + /** + * 删除牧场管理 + */ + @PreAuthorize("@ss.hasPermi('ranch:ranch:remove')") + @Log(title = "牧场管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(daRanchService.deleteDaRanchByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/controller/DaSheepfoldController.java b/zhyc-module/src/main/java/com/zhyc/module/base/controller/DaSheepfoldController.java new file mode 100644 index 0000000..7b72788 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/controller/DaSheepfoldController.java @@ -0,0 +1,122 @@ +package com.zhyc.module.base.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.core.page.TableDataInfo; +import com.zhyc.common.enums.BusinessType; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.module.base.domain.BasSheep; +import com.zhyc.module.base.domain.DaSheepfold; +import com.zhyc.module.base.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 + * + * @author wyt + * @date 2025-07-11 + */ +@RestController +@RequestMapping("/sheepfold_management/sheepfold_management") +public class DaSheepfoldController extends BaseController +{ + @Autowired + private IDaSheepfoldService daSheepfoldService; + + /** + * 查询羊舍管理列表 + */ + @PreAuthorize("@ss.hasPermi('sheepfold_management:sheepfold_management:list')") + @GetMapping("/list") + public TableDataInfo list(DaSheepfold daSheepfold) + { + startPage(); + List list = daSheepfoldService.selectDaSheepfoldList(daSheepfold); + return getDataTable(list); + } + /* + * 根据羊舍ids查询羊只id + * */ + + @GetMapping("/getSheepById") + public AjaxResult getSheepfold(@RequestParam String id) { + List list = daSheepfoldService.sheepListById(id); + return AjaxResult.success(list); + } + + + + /** + * 导出羊舍管理列表 + */ + @PreAuthorize("@ss.hasPermi('sheepfold_management:sheepfold_management:export')") + @Log(title = "羊舍管理", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, DaSheepfold daSheepfold) + { + List list = daSheepfoldService.selectDaSheepfoldList(daSheepfold); + ExcelUtil util = new ExcelUtil(DaSheepfold.class); + util.exportExcel(response, list, "羊舍管理数据"); + } + + /** + * 获取羊舍管理详细信息 + */ + @PreAuthorize("@ss.hasPermi('sheepfold_management:sheepfold_management:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(daSheepfoldService.selectDaSheepfoldById(id)); + } + + /** + * 新增羊舍管理 + */ + @PreAuthorize("@ss.hasPermi('sheepfold_management:sheepfold_management:add')") + @Log(title = "羊舍管理", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody DaSheepfold daSheepfold) + { + return toAjax(daSheepfoldService.insertDaSheepfold(daSheepfold)); + } + + /** + * 修改羊舍管理 + */ + @PreAuthorize("@ss.hasPermi('sheepfold_management:sheepfold_management:edit')") + @Log(title = "羊舍管理", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody DaSheepfold daSheepfold) + { + return toAjax(daSheepfoldService.updateDaSheepfold(daSheepfold)); + } + + /** + * 删除羊舍管理 + */ + @PreAuthorize("@ss.hasPermi('sheepfold_management:sheepfold_management:remove')") + @Log(title = "羊舍管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(daSheepfoldService.deleteDaSheepfoldByIds(ids)); + } + /** + * 检查羊舍编号是否已存在 + */ + @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/base/controller/SheepFileController.java b/zhyc-module/src/main/java/com/zhyc/module/base/controller/SheepFileController.java new file mode 100644 index 0000000..5046e7c --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/controller/SheepFileController.java @@ -0,0 +1,103 @@ +package com.zhyc.module.base.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.core.page.TableDataInfo; +import com.zhyc.common.enums.BusinessType; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.module.base.domain.BasSheep; +import com.zhyc.module.base.domain.SheepFile; +import com.zhyc.module.base.service.ISheepFileService; +import org.springframework.beans.factory.annotation.Autowired; +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-13 + */ +@RestController +@RequestMapping("/sheep_file/sheep_file") +public class SheepFileController extends BaseController +{ + @Autowired + private ISheepFileService sheepFileService; + + /** + * 查询羊只档案列表 + */ + @PreAuthorize("@ss.hasPermi('sheep_file:sheep_file:list')") + @GetMapping("/list") + public TableDataInfo list(SheepFile sheepFile) + { + startPage(); + List list = sheepFileService.selectSheepFileList(sheepFile); + return getDataTable(list); + } + + /** + * 导出羊只档案列表 + */ + @PreAuthorize("@ss.hasPermi('sheep_file:sheep_file:export')") + @Log(title = "羊只档案", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, SheepFile sheepFile) + { + List list = sheepFileService.selectSheepFileList(sheepFile); + ExcelUtil util = new ExcelUtil(SheepFile.class); + util.exportExcel(response, list, "羊只档案数据"); + } + + /** + * 获取羊只档案详细信息 + */ + @PreAuthorize("@ss.hasPermi('sheep_file:sheep_file:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(sheepFileService.selectSheepFileById(id)); + } + + /* + * 根据耳号查询是否存在羊舍 + * */ + @GetMapping("/byNo/{manageTags}") + public AjaxResult byManageTags(@PathVariable String manageTags){ + SheepFile sheep=sheepFileService.selectBasSheepByManageTags(manageTags.trim()); + return success(sheep); + } + + + @GetMapping("/stat/sheepType") + public AjaxResult statSheepType() { + return success(sheepFileService.countBySheepType()); + } + + @GetMapping("/stat/breedStatus") + public AjaxResult statBreedStatus() { + return success(sheepFileService.countByBreedStatus()); + } + + @GetMapping("/stat/variety") + public AjaxResult statVariety() { + return success(sheepFileService.countByVariety()); + } + + @GetMapping("/stat/lactationParity") + public AjaxResult statLactationParity() { + return success(sheepFileService.countParityOfLactation()); + } + + // 在群总数 + @GetMapping("/stat/inGroupCount") + public AjaxResult inGroupCount() { + return success(sheepFileService.countInGroup()); + } + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/domain/BasSheep.java b/zhyc-module/src/main/java/com/zhyc/module/base/domain/BasSheep.java new file mode 100644 index 0000000..047d376 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/domain/BasSheep.java @@ -0,0 +1,182 @@ +package com.zhyc.module.base.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 羊只基本信息对象 bas_sheep + * + * @author ruoyi + * @date 2025-07-15 + */ + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class BasSheep extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + /** 管理耳号 */ + @Excel(name = "管理耳号") + private String manageTags; + + /** 牧场id */ + @Excel(name = "牧场id") + private Long ranchId; + + /** 羊舍id */ + @Excel(name = "羊舍id") + private Long sheepfoldId; + private String sheepfoldName; + + /** 电子耳号 */ + @Excel(name = "电子耳号") + private String electronicTags; + + /** 品种id */ + @Excel(name = "品种id") + private Long varietyId; + + //仅用于改品种页面的回显 + private String varietyName; + + /** 家系 */ + @Excel(name = "家系") + private String family; + + /** 羊只类别 */ + @Excel(name = "羊只类别") + private Long typeId; + + /** 性别 */ + @Excel(name = "性别") + private Long gender; + + /** 出生日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "出生日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date birthday; + + /** 出生体重 */ + @Excel(name = "出生体重") + private Long birthWeight; + + /** 胎次 */ + @Excel(name = "胎次") + private Long parity; + + /** 羊只状态 */ + @Excel(name = "羊只状态") + private Long statusId; + + /** 断奶日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "断奶日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date weaningDate; + + /** 断奶体重 */ + @Excel(name = "断奶体重") + private Long weaningWeight; + + /** 繁育状态id */ + @Excel(name = "繁育状态id") + private Long breedStatusId; + + /** 父号id */ + @Excel(name = "父号id") + private Long fatherId; + + /** 母号id */ + @Excel(name = "母号id") + private Long motherId; + + /** 受体id */ + @Excel(name = "受体id") + private Long receptorId; + + /** 配种日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "配种日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date matingDate; + + /** 配种类型 */ + @Excel(name = "配种类型") + private Long matingTypeId; + + /** 孕检日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "孕检日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date pregDate; + + /** 产羔日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "产羔日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date lambingDate; + + /** 产羔时怀孕天数 */ + @Excel(name = "产羔时怀孕天数") + private Long lambingDay; + + /** 预产日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "预产日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date expectedDate; + + /** 是否性控 */ + @Excel(name = "是否性控") + private Long controlled; + + /** 配种次数 */ + @Excel(name = "配种次数") + private Long matingCounts; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Long matingTotal; + + /** 累计流产次数 */ + @Excel(name = "累计流产次数") + private Long miscarriageCounts; + + /** 体况评分 */ + @Excel(name = "体况评分") + private Long body; + + /** 乳房评分 */ + @Excel(name = "乳房评分") + private Long breast; + + /** 入群来源 */ + @Excel(name = "入群来源") + private String source; + + /** 入群日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "入群日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date sourceDate; + + /** 来源牧场id */ + @Excel(name = "来源牧场id") + private Long sourceRanchId; + + /** 备注 */ + @Excel(name = "备注") + private String comment; + + /** 是否删除 */ + @Excel(name = "是否删除") + private Long isDelete; + + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/domain/BasSheepGroup.java b/zhyc-module/src/main/java/com/zhyc/module/base/domain/BasSheepGroup.java new file mode 100644 index 0000000..e0d1adb --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/domain/BasSheepGroup.java @@ -0,0 +1,47 @@ +package com.zhyc.module.base.domain; + +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.TreeEntity; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 分组管理对象 bas_sheep_group + * + * @author wyt + * @date 2025-07-14 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +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; + + + private Integer isLeaf; + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/domain/BasSheepGroupMapping.java b/zhyc-module/src/main/java/com/zhyc/module/base/domain/BasSheepGroupMapping.java new file mode 100644 index 0000000..eed7c36 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/domain/BasSheepGroupMapping.java @@ -0,0 +1,36 @@ +package com.zhyc.module.base.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 羊只分组关联对象 bas_sheep_group_mapping + * + * @author wyt + * @date 2025-07-16 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class BasSheepGroupMapping extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键ID */ + @Excel(name = "主键ID") + private Long id; + + /** 羊只ID */ + @Excel(name = "羊只ID") + private Long sheepId; + + /** 分组ID */ + @Excel(name = "分组ID") + private Long groupId; + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/domain/BasSheepType.java b/zhyc-module/src/main/java/com/zhyc/module/base/domain/BasSheepType.java new file mode 100644 index 0000000..edf709e --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/domain/BasSheepType.java @@ -0,0 +1,31 @@ +package com.zhyc.module.base.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 羊只类型对象 bas_sheep_type + * + * @author ruoyi + * @date 2025-07-22 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class BasSheepType extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Integer id; + + /** 羊只类型 */ + private String name; + + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/domain/BasSheepVariety.java b/zhyc-module/src/main/java/com/zhyc/module/base/domain/BasSheepVariety.java new file mode 100644 index 0000000..56e8a36 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/domain/BasSheepVariety.java @@ -0,0 +1,31 @@ +package com.zhyc.module.base.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 羊只品种对象 bas_sheep_variety + * + * @author ruoyi + * @date 2025-07-15 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class BasSheepVariety extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + /** 品种 */ + @Excel(name = "品种") + private String variety; + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/domain/BreedRamFile.java b/zhyc-module/src/main/java/com/zhyc/module/base/domain/BreedRamFile.java new file mode 100644 index 0000000..463308d --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/domain/BreedRamFile.java @@ -0,0 +1,890 @@ +package com.zhyc.module.base.domain; + +import java.math.BigDecimal; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 种公羊档案对象 breed_ram_file + * + * @author zhyc + * @date 2025-07-29 + */ +public class BreedRamFile extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 种公羊id */ + private Long id; + + /** 普通耳号 */ + @Excel(name = "普通耳号") + private String ordinaryEarNumber; + + /** 牧场id */ + @Excel(name = "牧场id") + private Long ranchId; + + /** 牧场名称 */ + @Excel(name = "牧场名称") + private String ranchName; + + /** 羊舍id */ + @Excel(name = "羊舍id") + private Long sheepfoldId; + + /** 羊舍名称 */ + @Excel(name = "羊舍名称") + private String sheepfoldName; + + /** 电子耳号 */ + @Excel(name = "电子耳号") + private String electronicTags; + + /** 品种id */ + @Excel(name = "品种id") + private Long varietyId; + + /** 品种 */ + @Excel(name = "品种") + private String variety; + + /** 羊只类别 */ + @Excel(name = "羊只类别") + private String sheepCategory; + + /** 当前状态 */ + @Excel(name = "当前状态") + private String currentStatus; + + /** 生日 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "生日", width = 30, dateFormat = "yyyy-MM-dd") + private Date birthday; + + /** 动态 */ + @Excel(name = "动态") + private String dynamicInfo; + + /** 月龄 */ + @Excel(name = "月龄") + private Long monthAge; + + /** 出生体重 */ + @Excel(name = "出生体重") + private BigDecimal birthWeight; + + /** 断奶日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "断奶日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date weaningDate; + + /** 断奶日龄 */ + @Excel(name = "断奶日龄") + private Long weaningDayAge; + + /** 断奶体重 */ + @Excel(name = "断奶体重") + private BigDecimal weaningWeight; + + /** 断奶日增重 */ + @Excel(name = "断奶日增重") + private BigDecimal weaningDailyGain; + + /** 断奶后日增重 */ + @Excel(name = "断奶后日增重") + private BigDecimal postWeaningDailyGain; + + /** 当前体重 */ + @Excel(name = "当前体重") + private BigDecimal currentWeight; + + /** 当前体重称重日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "当前体重称重日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date currentWeightDate; + + /** 活动量 */ + @Excel(name = "活动量") + private String activityLevel; + + /** 性欲情况 */ + @Excel(name = "性欲情况") + private String sexualStatus; + + /** 阴囊周长 */ + @Excel(name = "阴囊周长") + private BigDecimal scrotumCircumference; + + /** 采精时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "采精时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date spermCollectionTime; + + /** 精液量 */ + @Excel(name = "精液量") + private BigDecimal spermVolume; + + /** 精液活力 */ + @Excel(name = "精液活力") + private String spermVitality; + + /** 精液密度 */ + @Excel(name = "精液密度") + private String spermDensity; + + /** 精液品质 */ + @Excel(name = "精液品质") + private String spermQuality; + + /** 配种状态 */ + @Excel(name = "配种状态") + private Long breedingStatus; + + /** 上次计划时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "上次计划时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date lastPlanTime; + + /** 本次计划时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "本次计划时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date currentPlanTime; + + /** 蛋白率%EBV */ + @Excel(name = "蛋白率%EBV") + private BigDecimal proteinRateEbv; + + /** 乳脂率%EBV */ + @Excel(name = "乳脂率%EBV") + private BigDecimal milkFatRateEbv; + + /** 乳体细胞(SCS)EBV */ + @Excel(name = "乳体细胞", readConverterExp = "S=CS") + private BigDecimal scsEbv; + + /** 生长性能EBV */ + @Excel(name = "生长性能EBV") + private BigDecimal growthPerformanceEbv; + + /** 抗逆性EBV */ + @Excel(name = "抗逆性EBV") + private BigDecimal resistanceEbv; + + /** 繁殖性能EBV */ + @Excel(name = "繁殖性能EBV") + private BigDecimal reproductionPerformanceEbv; + + /** 体型性状EBV */ + @Excel(name = "体型性状EBV") + private BigDecimal bodyTypeEbv; + + /** 综合育种值 */ + @Excel(name = "综合育种值") + private BigDecimal comprehensiveBreedingValue; + + /** 父号 */ + @Excel(name = "父号") + private String fatherNumber; + + /** 母号 */ + @Excel(name = "母号") + private String motherNumber; + + /** 祖父 */ + @Excel(name = "祖父") + private String grandfatherNumber; + + /** 祖母 */ + @Excel(name = "祖母") + private String grandmotherNumber; + + /** 外祖父 */ + @Excel(name = "外祖父") + private String maternalGrandfatherNumber; + + /** 外祖母 */ + @Excel(name = "外祖母") + private String maternalGrandmotherNumber; + + /** 是否核心羊群(0否1是) */ + @Excel(name = "是否核心羊群", readConverterExp = "0=否,1=是") + private Long isCoreFlock; + + /** 是否种用(0否1是) */ + @Excel(name = "是否种用", readConverterExp = "0=否,1=是") + private Long isBreedingUse; + + /** 孕检 */ + @Excel(name = "孕检") + private String pregnancyCheck; + + /** 总配母羊数 */ + @Excel(name = "总配母羊数") + private Long totalMatedEwes; + + /** 本交孕检母羊数 */ + @Excel(name = "本交孕检母羊数") + private Long naturalPregnancyCheckEwes; + + /** 本交受孕率% */ + @Excel(name = "本交受孕率%") + private BigDecimal naturalConceptionRate; + + /** 人工孕检母羊数 */ + @Excel(name = "人工孕检母羊数") + private Long artificialPregnancyCheckEwes; + + /** 人工受孕率% */ + @Excel(name = "人工受孕率%") + private BigDecimal artificialConceptionRate; + + /** 公羊母亲奶量 */ + @Excel(name = "公羊母亲奶量") + private BigDecimal ramMotherMilkVolume; + + /** 产奶量估计育种值(Kg) */ + @Excel(name = "产奶量估计育种值", readConverterExp = "K=g") + private BigDecimal milkProductionEbv; + + /** 准确性 */ + @Excel(name = "准确性") + private BigDecimal accuracy; + + /** 信息数 */ + @Excel(name = "信息数") + private Long informationCount; + + /** 是否亲子鉴定(0否1是) */ + @Excel(name = "是否亲子鉴定", readConverterExp = "0=否,1=是") + private Long isPaternityTested; + + /** 是否删除(0否1是) */ + private Long isDelete; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setOrdinaryEarNumber(String ordinaryEarNumber) + { + this.ordinaryEarNumber = ordinaryEarNumber; + } + + public String getOrdinaryEarNumber() + { + return ordinaryEarNumber; + } + public void setRanchId(Long ranchId) + { + this.ranchId = ranchId; + } + + public Long getRanchId() + { + return ranchId; + } + public void setRanchName(String ranchName) + { + this.ranchName = ranchName; + } + + public String getRanchName() + { + return ranchName; + } + public void setSheepfoldId(Long sheepfoldId) + { + this.sheepfoldId = sheepfoldId; + } + + public Long getSheepfoldId() + { + return sheepfoldId; + } + public void setSheepfoldName(String sheepfoldName) + { + this.sheepfoldName = sheepfoldName; + } + + public String getSheepfoldName() + { + return sheepfoldName; + } + public void setElectronicTags(String electronicTags) + { + this.electronicTags = electronicTags; + } + + public String getElectronicTags() + { + return electronicTags; + } + public void setVarietyId(Long varietyId) + { + this.varietyId = varietyId; + } + + public Long getVarietyId() + { + return varietyId; + } + public void setVariety(String variety) + { + this.variety = variety; + } + + public String getVariety() + { + return variety; + } + public void setSheepCategory(String sheepCategory) + { + this.sheepCategory = sheepCategory; + } + + public String getSheepCategory() + { + return sheepCategory; + } + public void setCurrentStatus(String currentStatus) + { + this.currentStatus = currentStatus; + } + + public String getCurrentStatus() + { + return currentStatus; + } + public void setBirthday(Date birthday) + { + this.birthday = birthday; + } + + public Date getBirthday() + { + return birthday; + } + public void setDynamicInfo(String dynamicInfo) + { + this.dynamicInfo = dynamicInfo; + } + + public String getDynamicInfo() + { + return dynamicInfo; + } + public void setMonthAge(Long monthAge) + { + this.monthAge = monthAge; + } + + public Long getMonthAge() + { + return monthAge; + } + public void setBirthWeight(BigDecimal birthWeight) + { + this.birthWeight = birthWeight; + } + + public BigDecimal getBirthWeight() + { + return birthWeight; + } + public void setWeaningDate(Date weaningDate) + { + this.weaningDate = weaningDate; + } + + public Date getWeaningDate() + { + return weaningDate; + } + public void setWeaningDayAge(Long weaningDayAge) + { + this.weaningDayAge = weaningDayAge; + } + + public Long getWeaningDayAge() + { + return weaningDayAge; + } + public void setWeaningWeight(BigDecimal weaningWeight) + { + this.weaningWeight = weaningWeight; + } + + public BigDecimal getWeaningWeight() + { + return weaningWeight; + } + public void setWeaningDailyGain(BigDecimal weaningDailyGain) + { + this.weaningDailyGain = weaningDailyGain; + } + + public BigDecimal getWeaningDailyGain() + { + return weaningDailyGain; + } + public void setPostWeaningDailyGain(BigDecimal postWeaningDailyGain) + { + this.postWeaningDailyGain = postWeaningDailyGain; + } + + public BigDecimal getPostWeaningDailyGain() + { + return postWeaningDailyGain; + } + public void setCurrentWeight(BigDecimal currentWeight) + { + this.currentWeight = currentWeight; + } + + public BigDecimal getCurrentWeight() + { + return currentWeight; + } + public void setCurrentWeightDate(Date currentWeightDate) + { + this.currentWeightDate = currentWeightDate; + } + + public Date getCurrentWeightDate() + { + return currentWeightDate; + } + public void setActivityLevel(String activityLevel) + { + this.activityLevel = activityLevel; + } + + public String getActivityLevel() + { + return activityLevel; + } + public void setSexualStatus(String sexualStatus) + { + this.sexualStatus = sexualStatus; + } + + public String getSexualStatus() + { + return sexualStatus; + } + public void setScrotumCircumference(BigDecimal scrotumCircumference) + { + this.scrotumCircumference = scrotumCircumference; + } + + public BigDecimal getScrotumCircumference() + { + return scrotumCircumference; + } + public void setSpermCollectionTime(Date spermCollectionTime) + { + this.spermCollectionTime = spermCollectionTime; + } + + public Date getSpermCollectionTime() + { + return spermCollectionTime; + } + public void setSpermVolume(BigDecimal spermVolume) + { + this.spermVolume = spermVolume; + } + + public BigDecimal getSpermVolume() + { + return spermVolume; + } + public void setSpermVitality(String spermVitality) + { + this.spermVitality = spermVitality; + } + + public String getSpermVitality() + { + return spermVitality; + } + public void setSpermDensity(String spermDensity) + { + this.spermDensity = spermDensity; + } + + public String getSpermDensity() + { + return spermDensity; + } + public void setSpermQuality(String spermQuality) + { + this.spermQuality = spermQuality; + } + + public String getSpermQuality() + { + return spermQuality; + } + public void setBreedingStatus(Long breedingStatus) + { + this.breedingStatus = breedingStatus; + } + + public Long getBreedingStatus() + { + return breedingStatus; + } + public void setLastPlanTime(Date lastPlanTime) + { + this.lastPlanTime = lastPlanTime; + } + + public Date getLastPlanTime() + { + return lastPlanTime; + } + public void setCurrentPlanTime(Date currentPlanTime) + { + this.currentPlanTime = currentPlanTime; + } + + public Date getCurrentPlanTime() + { + return currentPlanTime; + } + public void setProteinRateEbv(BigDecimal proteinRateEbv) + { + this.proteinRateEbv = proteinRateEbv; + } + + public BigDecimal getProteinRateEbv() + { + return proteinRateEbv; + } + public void setMilkFatRateEbv(BigDecimal milkFatRateEbv) + { + this.milkFatRateEbv = milkFatRateEbv; + } + + public BigDecimal getMilkFatRateEbv() + { + return milkFatRateEbv; + } + public void setScsEbv(BigDecimal scsEbv) + { + this.scsEbv = scsEbv; + } + + public BigDecimal getScsEbv() + { + return scsEbv; + } + public void setGrowthPerformanceEbv(BigDecimal growthPerformanceEbv) + { + this.growthPerformanceEbv = growthPerformanceEbv; + } + + public BigDecimal getGrowthPerformanceEbv() + { + return growthPerformanceEbv; + } + public void setResistanceEbv(BigDecimal resistanceEbv) + { + this.resistanceEbv = resistanceEbv; + } + + public BigDecimal getResistanceEbv() + { + return resistanceEbv; + } + public void setReproductionPerformanceEbv(BigDecimal reproductionPerformanceEbv) + { + this.reproductionPerformanceEbv = reproductionPerformanceEbv; + } + + public BigDecimal getReproductionPerformanceEbv() + { + return reproductionPerformanceEbv; + } + public void setBodyTypeEbv(BigDecimal bodyTypeEbv) + { + this.bodyTypeEbv = bodyTypeEbv; + } + + public BigDecimal getBodyTypeEbv() + { + return bodyTypeEbv; + } + public void setComprehensiveBreedingValue(BigDecimal comprehensiveBreedingValue) + { + this.comprehensiveBreedingValue = comprehensiveBreedingValue; + } + + public BigDecimal getComprehensiveBreedingValue() + { + return comprehensiveBreedingValue; + } + public void setFatherNumber(String fatherNumber) + { + this.fatherNumber = fatherNumber; + } + + public String getFatherNumber() + { + return fatherNumber; + } + public void setMotherNumber(String motherNumber) + { + this.motherNumber = motherNumber; + } + + public String getMotherNumber() + { + return motherNumber; + } + public void setGrandfatherNumber(String grandfatherNumber) + { + this.grandfatherNumber = grandfatherNumber; + } + + public String getGrandfatherNumber() + { + return grandfatherNumber; + } + public void setGrandmotherNumber(String grandmotherNumber) + { + this.grandmotherNumber = grandmotherNumber; + } + + public String getGrandmotherNumber() + { + return grandmotherNumber; + } + public void setMaternalGrandfatherNumber(String maternalGrandfatherNumber) + { + this.maternalGrandfatherNumber = maternalGrandfatherNumber; + } + + public String getMaternalGrandfatherNumber() + { + return maternalGrandfatherNumber; + } + public void setMaternalGrandmotherNumber(String maternalGrandmotherNumber) + { + this.maternalGrandmotherNumber = maternalGrandmotherNumber; + } + + public String getMaternalGrandmotherNumber() + { + return maternalGrandmotherNumber; + } + public void setIsCoreFlock(Long isCoreFlock) + { + this.isCoreFlock = isCoreFlock; + } + + public Long getIsCoreFlock() + { + return isCoreFlock; + } + public void setIsBreedingUse(Long isBreedingUse) + { + this.isBreedingUse = isBreedingUse; + } + + public Long getIsBreedingUse() + { + return isBreedingUse; + } + public void setPregnancyCheck(String pregnancyCheck) + { + this.pregnancyCheck = pregnancyCheck; + } + + public String getPregnancyCheck() + { + return pregnancyCheck; + } + public void setTotalMatedEwes(Long totalMatedEwes) + { + this.totalMatedEwes = totalMatedEwes; + } + + public Long getTotalMatedEwes() + { + return totalMatedEwes; + } + public void setNaturalPregnancyCheckEwes(Long naturalPregnancyCheckEwes) + { + this.naturalPregnancyCheckEwes = naturalPregnancyCheckEwes; + } + + public Long getNaturalPregnancyCheckEwes() + { + return naturalPregnancyCheckEwes; + } + public void setNaturalConceptionRate(BigDecimal naturalConceptionRate) + { + this.naturalConceptionRate = naturalConceptionRate; + } + + public BigDecimal getNaturalConceptionRate() + { + return naturalConceptionRate; + } + public void setArtificialPregnancyCheckEwes(Long artificialPregnancyCheckEwes) + { + this.artificialPregnancyCheckEwes = artificialPregnancyCheckEwes; + } + + public Long getArtificialPregnancyCheckEwes() + { + return artificialPregnancyCheckEwes; + } + public void setArtificialConceptionRate(BigDecimal artificialConceptionRate) + { + this.artificialConceptionRate = artificialConceptionRate; + } + + public BigDecimal getArtificialConceptionRate() + { + return artificialConceptionRate; + } + public void setRamMotherMilkVolume(BigDecimal ramMotherMilkVolume) + { + this.ramMotherMilkVolume = ramMotherMilkVolume; + } + + public BigDecimal getRamMotherMilkVolume() + { + return ramMotherMilkVolume; + } + public void setMilkProductionEbv(BigDecimal milkProductionEbv) + { + this.milkProductionEbv = milkProductionEbv; + } + + public BigDecimal getMilkProductionEbv() + { + return milkProductionEbv; + } + public void setAccuracy(BigDecimal accuracy) + { + this.accuracy = accuracy; + } + + public BigDecimal getAccuracy() + { + return accuracy; + } + public void setInformationCount(Long informationCount) + { + this.informationCount = informationCount; + } + + public Long getInformationCount() + { + return informationCount; + } + public void setIsPaternityTested(Long isPaternityTested) + { + this.isPaternityTested = isPaternityTested; + } + + public Long getIsPaternityTested() + { + return isPaternityTested; + } + public void setIsDelete(Long isDelete) + { + this.isDelete = isDelete; + } + + public Long getIsDelete() + { + return isDelete; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("ordinaryEarNumber", getOrdinaryEarNumber()) + .append("ranchId", getRanchId()) + .append("ranchName", getRanchName()) + .append("sheepfoldId", getSheepfoldId()) + .append("sheepfoldName", getSheepfoldName()) + .append("electronicTags", getElectronicTags()) + .append("varietyId", getVarietyId()) + .append("variety", getVariety()) + .append("sheepCategory", getSheepCategory()) + .append("currentStatus", getCurrentStatus()) + .append("birthday", getBirthday()) + .append("dynamicInfo", getDynamicInfo()) + .append("monthAge", getMonthAge()) + .append("birthWeight", getBirthWeight()) + .append("weaningDate", getWeaningDate()) + .append("weaningDayAge", getWeaningDayAge()) + .append("weaningWeight", getWeaningWeight()) + .append("weaningDailyGain", getWeaningDailyGain()) + .append("postWeaningDailyGain", getPostWeaningDailyGain()) + .append("currentWeight", getCurrentWeight()) + .append("currentWeightDate", getCurrentWeightDate()) + .append("activityLevel", getActivityLevel()) + .append("sexualStatus", getSexualStatus()) + .append("scrotumCircumference", getScrotumCircumference()) + .append("spermCollectionTime", getSpermCollectionTime()) + .append("spermVolume", getSpermVolume()) + .append("spermVitality", getSpermVitality()) + .append("spermDensity", getSpermDensity()) + .append("spermQuality", getSpermQuality()) + .append("breedingStatus", getBreedingStatus()) + .append("lastPlanTime", getLastPlanTime()) + .append("currentPlanTime", getCurrentPlanTime()) + .append("remark", getRemark()) + .append("proteinRateEbv", getProteinRateEbv()) + .append("milkFatRateEbv", getMilkFatRateEbv()) + .append("scsEbv", getScsEbv()) + .append("growthPerformanceEbv", getGrowthPerformanceEbv()) + .append("resistanceEbv", getResistanceEbv()) + .append("reproductionPerformanceEbv", getReproductionPerformanceEbv()) + .append("bodyTypeEbv", getBodyTypeEbv()) + .append("comprehensiveBreedingValue", getComprehensiveBreedingValue()) + .append("fatherNumber", getFatherNumber()) + .append("motherNumber", getMotherNumber()) + .append("grandfatherNumber", getGrandfatherNumber()) + .append("grandmotherNumber", getGrandmotherNumber()) + .append("maternalGrandfatherNumber", getMaternalGrandfatherNumber()) + .append("maternalGrandmotherNumber", getMaternalGrandmotherNumber()) + .append("isCoreFlock", getIsCoreFlock()) + .append("isBreedingUse", getIsBreedingUse()) + .append("pregnancyCheck", getPregnancyCheck()) + .append("totalMatedEwes", getTotalMatedEwes()) + .append("naturalPregnancyCheckEwes", getNaturalPregnancyCheckEwes()) + .append("naturalConceptionRate", getNaturalConceptionRate()) + .append("artificialPregnancyCheckEwes", getArtificialPregnancyCheckEwes()) + .append("artificialConceptionRate", getArtificialConceptionRate()) + .append("ramMotherMilkVolume", getRamMotherMilkVolume()) + .append("milkProductionEbv", getMilkProductionEbv()) + .append("accuracy", getAccuracy()) + .append("informationCount", getInformationCount()) + .append("isPaternityTested", getIsPaternityTested()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("isDelete", getIsDelete()) + .toString(); + } +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/domain/DaRanch.java b/zhyc-module/src/main/java/com/zhyc/module/base/domain/DaRanch.java new file mode 100644 index 0000000..ef3c938 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/domain/DaRanch.java @@ -0,0 +1,31 @@ +package com.zhyc.module.base.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 牧场管理对象 da_ranch + * + * @author ruoyi + * @date 2025-07-22 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class DaRanch extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + /** 牧场名称 */ + private String ranch; + + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/domain/DaSheepfold.java b/zhyc-module/src/main/java/com/zhyc/module/base/domain/DaSheepfold.java new file mode 100644 index 0000000..0216feb --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/domain/DaSheepfold.java @@ -0,0 +1,57 @@ +package com.zhyc.module.base.domain; + +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 羊舍管理对象 da_sheepfold + * + * @author wyt + * @date 2025-07-11 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class DaSheepfold extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 羊舍id */ + @Excel(name = "羊舍id") + private Long id; + + /** 牧场 */ + @Excel(name = "牧场") + private Long ranchId; + + /** 羊舍名称 */ + @Excel(name = "羊舍名称") + private String sheepfoldName; + + /** 羊舍类型id */ + @Excel(name = "羊舍类型id") + private Long sheepfoldTypeId; + + /** 羊舍编号 */ + @Excel(name = "羊舍编号") + private String sheepfoldNo; + + /** 排号 */ + @Excel(name = "排号") + private String rowNo; + + /** 栏数 */ + @Excel(name = "栏数") + private String columns; + + /** 备注 */ + @Excel(name = "备注") + private String comment; + + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/domain/SheepFile.java b/zhyc-module/src/main/java/com/zhyc/module/base/domain/SheepFile.java new file mode 100644 index 0000000..acefce9 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/domain/SheepFile.java @@ -0,0 +1,273 @@ +package com.zhyc.module.base.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; + +/** + * 羊只档案对象 sheep_file + * + * @author wyt + * @date 2025-07-13 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class SheepFile extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 羊只id */ + private Long id; + + /** 管理耳号 */ + @Excel(name = "管理耳号") + private String bsManageTags; + + /** 牧场id */ + @Excel(name = "牧场id") + private Long ranchId; + + /** 牧场名称 */ + @Excel(name = "牧场名称") + private String drRanch; + + /** 羊舍id */ + @Excel(name = "羊舍id") + private Long sheepfoldId; + + /** 羊舍名称 */ + @Excel(name = "羊舍名称") + private String sheepfoldName; + + /** 电子耳号 */ + @Excel(name = "电子耳号") + private String electronicTags; + + /** 品种id */ + @Excel(name = "品种id") + private Long varietyId; + + /** 品种 */ + @Excel(name = "品种") + private String variety; + + /** 家系 */ + @Excel(name = "家系") + private String family; + + /** 羊只类型 */ + @Excel(name = "羊只类型") + private String name; + + /** 性别 */ + @Excel(name = "性别") + private Long gender; + + /** 出生日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "出生日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date birthday; + + /** 日龄 */ + @Excel(name = "日龄") + private Long dayAge; + + /** 月龄 */ + @Excel(name = "月龄") + private Long monthAge; + + /** 胎次 */ + @Excel(name = "胎次") + private Long parity; + + /** 出生体重 */ + @Excel(name = "出生体重") + private Long birthWeight; + + /** 断奶日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "断奶日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date weaningDate; + + /** 羊只状态 */ + @Excel(name = "羊只状态") + private Long statusId; + + /** 断奶体重 */ + @Excel(name = "断奶体重") + private Long weaningWeight; + + /** 当前体重 */ + @Excel(name = "当前体重") + private Long currentWeight; + + /** 繁育状态id */ + @Excel(name = "繁育状态id") + private Long breedStatusId; + + /** 繁殖状态 */ + @Excel(name = "繁殖状态") + private String breed; + + /** 父号id */ + @Excel(name = "父号id") + private Long bsFatherId; + + /** 父亲管理耳号 */ + @Excel(name = "父亲管理耳号") + private String fatherManageTags; + + /** 母号id */ + @Excel(name = "母号id") + private Long bsMotherId; + + /** 母亲管理耳号 */ + @Excel(name = "母亲管理耳号") + private String motherManageTags; + + /** 受体id */ + @Excel(name = "受体id") + private Long receptorId; + + /** 受体管理耳号 */ + @Excel(name = "受体管理耳号") + private String receptorManageTags; + + /** 祖父号id */ + @Excel(name = "祖父号id") + private Long fatherFatherId; + + /** 祖父管理耳号 */ + @Excel(name = "祖父管理耳号") + private String grandfatherManageTags; + + /** 祖母号id */ + @Excel(name = "祖母号id") + private Long fatherMotherId; + + /** 祖母管理耳号 */ + @Excel(name = "祖母管理耳号") + private String grandmotherManageTags; + + /** 外祖父号id */ + @Excel(name = "外祖父号id") + private Long fatherId; + + /** 外祖父管理耳号 */ + @Excel(name = "外祖父管理耳号") + private String maternalGrandfatherManageTags; + + /** 外祖母号id */ + @Excel(name = "外祖母号id") + private Long motherId; + + /** 外祖母管理耳号 */ + @Excel(name = "外祖母管理耳号") + private String maternalGrandmotherManageTags; + + /** 配种日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "配种日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date matingDate; + + /** 配种类型 */ + @Excel(name = "配种类型") + private Long matingTypeId; + + /** 孕检日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "孕检日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date pregDate; + + /** 产羔日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "产羔日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date lambingDate; + + /** 产羔时怀孕天数 */ + @Excel(name = "产羔时怀孕天数") + private Long lambingDay; + + /** 配后天数 */ + @Excel(name = "配后天数") + private Long matingDay; + + /** 怀孕天数 */ + @Excel(name = "怀孕天数") + private Long gestationDay; + + /** 预产日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "预产日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date expectedDate; + + /** 产后天数 */ + @Excel(name = "产后天数") + private Long postLambingDay; + + /** 泌乳天数 */ + @Excel(name = "泌乳天数") + private Long lactationDay; + + /** 空怀天数 */ + @Excel(name = "空怀天数") + private Long anestrousDay; + + /** 配种次数 */ + @Excel(name = "配种次数") + private Long matingCounts; + + /** 累计配种次数 */ + @Excel(name = "累计配种次数") + private Long matingTotal; + + /** 累计流产次数 */ + @Excel(name = "累计流产次数") + private Long miscarriageCounts; + + /** 备注 */ + @Excel(name = "备注") + private String comment; + + /** 是否性控 */ + @Excel(name = "是否性控") + private Long controlled; + + /** 体况评分 */ + @Excel(name = "体况评分") + private Long body; + + /** 乳房评分 */ + @Excel(name = "乳房评分") + private Long breast; + + /** 入群来源 */ + @Excel(name = "入群来源") + private String source; + + /** 入群日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "入群日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date sourceDate; + + /** 来源牧场id */ + @Excel(name = "来源牧场id") + private Long sourceRanchId; + + /** 来源牧场 */ + @Excel(name = "来源牧场") + private String sourceRanch; + + /** 是否删除 */ + private Long isDelete; + + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/mapper/BasSheepGroupMapper.java b/zhyc-module/src/main/java/com/zhyc/module/base/mapper/BasSheepGroupMapper.java new file mode 100644 index 0000000..52abe57 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/mapper/BasSheepGroupMapper.java @@ -0,0 +1,67 @@ +package com.zhyc.module.base.mapper; + +import com.zhyc.module.base.domain.BasSheepGroup; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 分组管理Mapper接口 + * + * @author wyt + * @date 2025-07-14 + */ +@Mapper +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); + + List selectLeafNodes(); + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/mapper/BasSheepGroupMappingMapper.java b/zhyc-module/src/main/java/com/zhyc/module/base/mapper/BasSheepGroupMappingMapper.java new file mode 100644 index 0000000..2e4f1cc --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/mapper/BasSheepGroupMappingMapper.java @@ -0,0 +1,88 @@ +package com.zhyc.module.base.mapper; + +import java.util.List; +import java.util.Map; + +import com.zhyc.module.base.domain.BasSheepGroupMapping; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +/** + * 羊只分组关联Mapper接口 + * + * @author wyt + * @date 2025-07-16 + */ +@Mapper +public interface BasSheepGroupMappingMapper +{ + /** + * 查询羊只分组关联 + * + * @param id 羊只分组关联主键 + * @return 羊只分组关联 + */ + public BasSheepGroupMapping selectBasSheepGroupMappingById(Long id); + + /** + * 查询羊只分组关联列表 + * + * @param basSheepGroupMapping 羊只分组关联 + * @return 羊只分组关联集合 + */ + public List selectBasSheepGroupMappingList(BasSheepGroupMapping basSheepGroupMapping); + + + /** + * 联表查询羊只分组关联列表(支持耳号列表) + */ + List> selectBasSheepGroupMappingList( + @Param("sheepId") Long sheepId, + @Param("groupId") Long groupId, + @Param("bsManageTags") List bsManageTags + ); + + + + + + /** + * 新增羊只分组关联 + * + * @param basSheepGroupMapping 羊只分组关联 + * @return 结果 + */ + public int insertBasSheepGroupMapping(BasSheepGroupMapping basSheepGroupMapping); + + /** + * 修改羊只分组关联 + * + * @param basSheepGroupMapping 羊只分组关联 + * @return 结果 + */ + public int updateBasSheepGroupMapping(BasSheepGroupMapping basSheepGroupMapping); + + /** + * 删除羊只分组关联 + * + * @param id 羊只分组关联主键 + * @return 结果 + */ + public int deleteBasSheepGroupMappingById(Long id); + + /** + * 批量删除羊只分组关联 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteBasSheepGroupMappingByIds(Long[] ids); + + + List> selectSheepIdsByEarTags(@Param("earTags") List earTags); + + int batchInsert(@Param("list") List list); + + + List selectListByGroupId(@Param("groupId") Long groupId); + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/mapper/BasSheepMapper.java b/zhyc-module/src/main/java/com/zhyc/module/base/mapper/BasSheepMapper.java new file mode 100644 index 0000000..4baaf89 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/mapper/BasSheepMapper.java @@ -0,0 +1,83 @@ +package com.zhyc.module.base.mapper; + +import java.util.List; + +import com.zhyc.module.base.domain.BasSheep; +import org.apache.ibatis.annotations.Param; + +/** + * 羊只基本信息Mapper接口 + * + * @author ruoyi + * @date 2025-07-15 + */ +public interface BasSheepMapper +{ + /** + * 查询羊只基本信息 + * + * @param id 羊只基本信息主键 + * @return 羊只基本信息 + */ + public BasSheep selectBasSheepById(Long id); + + /** + * 查询羊只基本信息列表 + * + * @param basSheep 羊只基本信息 + * @return 羊只基本信息集合 + */ + public List selectBasSheepList(BasSheep basSheep); + + /** + * 新增羊只基本信息 + * + * @param basSheep 羊只基本信息 + * @return 结果 + */ + public int insertBasSheep(BasSheep basSheep); + + /** + * 修改羊只基本信息 + * + * @param basSheep 羊只基本信息 + * @return 结果 + */ + public int updateBasSheep(BasSheep basSheep); + + /** + * 删除羊只基本信息 + * + * @param id 羊只基本信息主键 + * @return 结果 + */ + public int deleteBasSheepById(Long id); + + /** + * 批量删除羊只基本信息 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteBasSheepByIds(Long[] ids); + + + /** + * 根据管理耳号查询 + */ + BasSheep selectBasSheepByManageTags(String manageTags); + + + List selectBasSheepBySheepfold(String id); + +// 根据牧场ID获取羊只列表 + List getSheepByRanchId(Long ranchId); + + List selectBasSheepListByIds(List ids); + + //用于校验改耳号部分新管理/电子耳号 + int existsByManageTag(@Param("tag") String tag); + int existsByElectronicTag(@Param("tag") String tag); + + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/mapper/BasSheepTypeMapper.java b/zhyc-module/src/main/java/com/zhyc/module/base/mapper/BasSheepTypeMapper.java new file mode 100644 index 0000000..4afe2e9 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/mapper/BasSheepTypeMapper.java @@ -0,0 +1,61 @@ +package com.zhyc.module.base.mapper; + +import java.util.List; +import com.zhyc.module.base.domain.BasSheepType; + +/** + * 羊只类型Mapper接口 + * + * @author ruoyi + * @date 2025-07-22 + */ +public interface BasSheepTypeMapper +{ + /** + * 查询羊只类型 + * + * @param id 羊只类型主键 + * @return 羊只类型 + */ + public BasSheepType selectBasSheepTypeById(Integer id); + + /** + * 查询羊只类型列表 + * + * @param basSheepType 羊只类型 + * @return 羊只类型集合 + */ + public List selectBasSheepTypeList(BasSheepType basSheepType); + + /** + * 新增羊只类型 + * + * @param basSheepType 羊只类型 + * @return 结果 + */ + public int insertBasSheepType(BasSheepType basSheepType); + + /** + * 修改羊只类型 + * + * @param basSheepType 羊只类型 + * @return 结果 + */ + public int updateBasSheepType(BasSheepType basSheepType); + + /** + * 删除羊只类型 + * + * @param id 羊只类型主键 + * @return 结果 + */ + public int deleteBasSheepTypeById(Integer id); + + /** + * 批量删除羊只类型 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteBasSheepTypeByIds(Integer[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/mapper/BasSheepVarietyMapper.java b/zhyc-module/src/main/java/com/zhyc/module/base/mapper/BasSheepVarietyMapper.java new file mode 100644 index 0000000..0802830 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/mapper/BasSheepVarietyMapper.java @@ -0,0 +1,75 @@ +package com.zhyc.module.base.mapper; + +import java.util.List; + +import com.zhyc.module.base.domain.BasSheepVariety; +import org.apache.ibatis.annotations.Mapper; + +/** + * 羊只品种Mapper接口 + * + * @author ruoyi + * @date 2025-07-15 + */ +@Mapper +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); + + + /** + * 根据品种名称查询品种 ID 用于导入羊只 + * + * @param varietyName 品种名称 + * @return 品种 ID + */ + Long selectIdByName(String varietyName); + + BasSheepVariety selectByVarietyName(String varietyName); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/mapper/BreedRamFileMapper.java b/zhyc-module/src/main/java/com/zhyc/module/base/mapper/BreedRamFileMapper.java new file mode 100644 index 0000000..bb6eaa2 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/mapper/BreedRamFileMapper.java @@ -0,0 +1,109 @@ +package com.zhyc.module.base.mapper; + +import java.util.List; +import com.zhyc.module.base.domain.BreedRamFile; + +/** + * 种公羊档案Mapper接口 + * + * @author zhyc + * @date 2025-07-29 + */ +public interface BreedRamFileMapper +{ + /** + * 查询种公羊档案 + * + * @param id 种公羊档案主键 + * @return 种公羊档案 + */ + public BreedRamFile selectBreedRamFileById(Long id); + + /** + * 查询种公羊档案列表 + * + * @param breedRamFile 种公羊档案 + * @return 种公羊档案集合 + */ + public List selectBreedRamFileList(BreedRamFile breedRamFile); + + /** + * 新增种公羊档案 + * + * @param breedRamFile 种公羊档案 + * @return 结果 + */ + public int insertBreedRamFile(BreedRamFile breedRamFile); + + /** + * 修改种公羊档案 + * + * @param breedRamFile 种公羊档案 + * @return 结果 + */ + public int updateBreedRamFile(BreedRamFile breedRamFile); + + /** + * 删除种公羊档案 + * + * @param id 种公羊档案主键 + * @return 结果 + */ + public int deleteBreedRamFileById(Long id); + + /** + * 批量删除种公羊档案 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteBreedRamFileByIds(Long[] ids); + + /** + * 根据普通耳号查询种公羊档案 + * + * @param ordinaryEarNumber 普通耳号 + * @return 种公羊档案 + */ + public BreedRamFile selectBreedRamFileByOrdinaryEarNumber(String ordinaryEarNumber); + + /** + * 根据电子耳号查询种公羊档案 + * + * @param electronicTags 电子耳号 + * @return 种公羊档案 + */ + public BreedRamFile selectBreedRamFileByElectronicTags(String electronicTags); + + /** + * 根据牧场ID查询种公羊档案列表 + * + * @param ranchId 牧场ID + * @return 种公羊档案集合 + */ + public List selectBreedRamFileListByRanchId(Long ranchId); + + /** + * 根据羊舍ID查询种公羊档案列表 + * + * @param sheepfoldId 羊舍ID + * @return 种公羊档案集合 + */ + public List selectBreedRamFileListBySheepfoldId(Long sheepfoldId); + + /** + * 查询核心羊群种公羊档案列表 + * + * @param breedRamFile 种公羊档案 + * @return 种公羊档案集合 + */ + public List selectCoreFlockBreedRamFileList(BreedRamFile breedRamFile); + + /** + * 查询种用种公羊档案列表 + * + * @param breedRamFile 种公羊档案 + * @return 种公羊档案集合 + */ + public List selectBreedingUseBreedRamFileList(BreedRamFile breedRamFile); +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/mapper/DaRanchMapper.java b/zhyc-module/src/main/java/com/zhyc/module/base/mapper/DaRanchMapper.java new file mode 100644 index 0000000..5e3c949 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/mapper/DaRanchMapper.java @@ -0,0 +1,61 @@ +package com.zhyc.module.base.mapper; + +import java.util.List; +import com.zhyc.module.base.domain.DaRanch; + +/** + * 牧场管理Mapper接口 + * + * @author ruoyi + * @date 2025-07-22 + */ +public interface DaRanchMapper +{ + /** + * 查询牧场管理 + * + * @param id 牧场管理主键 + * @return 牧场管理 + */ + public DaRanch selectDaRanchById(Long id); + + /** + * 查询牧场管理列表 + * + * @param daRanch 牧场管理 + * @return 牧场管理集合 + */ + public List selectDaRanchList(DaRanch daRanch); + + /** + * 新增牧场管理 + * + * @param daRanch 牧场管理 + * @return 结果 + */ + public int insertDaRanch(DaRanch daRanch); + + /** + * 修改牧场管理 + * + * @param daRanch 牧场管理 + * @return 结果 + */ + public int updateDaRanch(DaRanch daRanch); + + /** + * 删除牧场管理 + * + * @param id 牧场管理主键 + * @return 结果 + */ + public int deleteDaRanchById(Long id); + + /** + * 批量删除牧场管理 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteDaRanchByIds(Long[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/mapper/DaSheepfoldMapper.java b/zhyc-module/src/main/java/com/zhyc/module/base/mapper/DaSheepfoldMapper.java new file mode 100644 index 0000000..9b690ce --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/mapper/DaSheepfoldMapper.java @@ -0,0 +1,67 @@ +package com.zhyc.module.base.mapper; + +import com.zhyc.module.base.domain.DaSheepfold; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 羊舍管理Mapper接口 + * + * @author wyt + * @date 2025-07-11 + */ +@Mapper +public interface DaSheepfoldMapper +{ + /** + * 查询羊舍管理 + * + * @param id 羊舍管理主键 + * @return 羊舍管理 + */ + public DaSheepfold selectDaSheepfoldById(Long id); + + /** + * 查询羊舍管理列表 + * + * @param daSheepfold 羊舍管理 + * @return 羊舍管理集合 + */ + public List selectDaSheepfoldList(DaSheepfold daSheepfold); + + /** + * 新增羊舍管理 + * + * @param daSheepfold 羊舍管理 + * @return 结果 + */ + public int insertDaSheepfold(DaSheepfold daSheepfold); + + /** + * 修改羊舍管理 + * + * @param daSheepfold 羊舍管理 + * @return 结果 + */ + public int updateDaSheepfold(DaSheepfold daSheepfold); + + /** + * 删除羊舍管理 + * + * @param id 羊舍管理主键 + * @return 结果 + */ + public int deleteDaSheepfoldById(Long id); + + /** + * 批量删除羊舍管理 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteDaSheepfoldByIds(Long[] ids); + + public int selectCount(DaSheepfold daSheepfold); + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/mapper/SheepFileMapper.java b/zhyc-module/src/main/java/com/zhyc/module/base/mapper/SheepFileMapper.java new file mode 100644 index 0000000..9d4fc5a --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/mapper/SheepFileMapper.java @@ -0,0 +1,63 @@ +package com.zhyc.module.base.mapper; + +import com.zhyc.module.base.domain.SheepFile; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +import java.util.Map; + +/** + * 羊只档案Mapper接口 + * + * @author wyt + * @date 2025-07-13 + */ +@Mapper +public interface SheepFileMapper +{ + /** + * 查询羊只档案 + * + * @param id 羊只档案主键 + * @return 羊只档案 + */ + public SheepFile selectSheepFileById(Long id); + + /** + * 查询羊只档案列表 + * + * @param sheepFile 羊只档案 + * @return 羊只档案集合 + */ + public List selectSheepFileList(SheepFile sheepFile); + + + /** + * 根据管理耳号查询 + * + * @param tags 管理耳号 + * @return 结果 + */ + SheepFile selectSheepByManageTags(String tags); + + + // 在群羊只总数 + Long countInGroup(); + + + // 羊只类别分布(按 name 分组) + List> countBySheepType(); + + // 繁育状态分布(按 breed 分组) + List> countByBreedStatus(); + + // 品种分布(按 variety 分组) + List> countByVariety(); + + // 泌乳羊胎次分布(name = '泌乳羊' 时按 parity 分组) + List> countParityOfLactation(); + + + + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/service/IBasSheepGroupMappingService.java b/zhyc-module/src/main/java/com/zhyc/module/base/service/IBasSheepGroupMappingService.java new file mode 100644 index 0000000..d6b5c7a --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/service/IBasSheepGroupMappingService.java @@ -0,0 +1,73 @@ +package com.zhyc.module.base.service; + +import java.util.List; +import java.util.Map; + +import com.zhyc.common.core.domain.AjaxResult; +import com.zhyc.module.base.domain.BasSheepGroupMapping; + +/** + * 羊只分组关联Service接口 + * + * @author wyt + * @date 2025-07-16 + */ +public interface IBasSheepGroupMappingService +{ + /** + * 查询羊只分组关联 + * + * @param id 羊只分组关联主键 + * @return 羊只分组关联 + */ + public BasSheepGroupMapping selectBasSheepGroupMappingById(Long id); + + /** + * 查询羊只分组关联列表 + * + * @param basSheepGroupMapping 羊只分组关联 + * @return 羊只分组关联集合 + */ + public List selectBasSheepGroupMappingList(BasSheepGroupMapping basSheepGroupMapping); + + + /** + * 联表查询羊只分组关联列表(支持耳号列表) + */ + List> selectBasSheepGroupMappingList(Long sheepId, Long groupId, List bsManageTags); + + + /** + * 新增羊只分组关联 + * + * @param basSheepGroupMapping 羊只分组关联 + * @return 结果 + */ + public int insertBasSheepGroupMapping(BasSheepGroupMapping basSheepGroupMapping); + + /** + * 修改羊只分组关联 + * + * @param basSheepGroupMapping 羊只分组关联 + * @return 结果 + */ + public int updateBasSheepGroupMapping(BasSheepGroupMapping basSheepGroupMapping); + + /** + * 批量删除羊只分组关联 + * + * @param ids 需要删除的羊只分组关联主键集合 + * @return 结果 + */ + public int deleteBasSheepGroupMappingByIds(Long[] ids); + + /** + * 删除羊只分组关联信息 + * + * @param id 羊只分组关联主键 + * @return 结果 + */ + public int deleteBasSheepGroupMappingById(Long id); + + public AjaxResult addByEarTags(List earTags, Long groupId); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/service/IBasSheepGroupService.java b/zhyc-module/src/main/java/com/zhyc/module/base/service/IBasSheepGroupService.java new file mode 100644 index 0000000..330d5fc --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/service/IBasSheepGroupService.java @@ -0,0 +1,64 @@ +package com.zhyc.module.base.service; + +import com.zhyc.module.base.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); + + List selectLeafNodes(); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/service/IBasSheepService.java b/zhyc-module/src/main/java/com/zhyc/module/base/service/IBasSheepService.java new file mode 100644 index 0000000..18c7351 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/service/IBasSheepService.java @@ -0,0 +1,77 @@ +package com.zhyc.module.base.service; + +import java.util.List; + +import com.zhyc.module.base.domain.BasSheep; + +/** + * 羊只基本信息Service接口 + * + * @author ruoyi + * @date 2025-07-15 + */ +public interface IBasSheepService +{ + /** + * 查询羊只基本信息 + * + * @param id 羊只基本信息主键 + * @return 羊只基本信息 + */ + public BasSheep selectBasSheepById(Long id); + + /** + * 查询羊只基本信息列表 + * + * @param basSheep 羊只基本信息 + * @return 羊只基本信息集合 + */ + public List selectBasSheepList(BasSheep basSheep); + + /** + * 新增羊只基本信息 + * + * @param basSheep 羊只基本信息 + * @return 结果 + */ + public int insertBasSheep(BasSheep basSheep); + + /** + * 修改羊只基本信息 + * + * @param basSheep 羊只基本信息 + * @return 结果 + */ + public int updateBasSheep(BasSheep basSheep); + + /** + * 批量删除羊只基本信息 + * + * @param ids 需要删除的羊只基本信息主键集合 + * @return 结果 + */ + public int deleteBasSheepByIds(Long[] ids); + + /** + * 删除羊只基本信息信息 + * + * @param id 羊只基本信息主键 + * @return 结果 + */ + public int deleteBasSheepById(Long id); + + /** + * 根据羊只耳号获取羊只 + */ + BasSheep selectBasSheepByManageTags(String trim); + + /** + * 根据牧场ID获取羊只列表 + */ + List getSheepByRanchId(Long ranchId); + + List selectBasSheepListByIds(List ids); + + //校验新管理/电子耳号 + boolean existsByTag(String tag, Integer earType); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/service/IBasSheepTypeService.java b/zhyc-module/src/main/java/com/zhyc/module/base/service/IBasSheepTypeService.java new file mode 100644 index 0000000..5f9721d --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/service/IBasSheepTypeService.java @@ -0,0 +1,65 @@ +package com.zhyc.module.base.service; + +import java.util.List; + +import com.zhyc.module.base.domain.BasSheep; +import com.zhyc.module.base.domain.BasSheepType; + +/** + * 羊只类型Service接口 + * + * @author ruoyi + * @date 2025-07-22 + */ +public interface IBasSheepTypeService +{ + /** + * 查询羊只类型 + * + * @param id 羊只类型主键 + * @return 羊只类型 + */ + public BasSheepType selectBasSheepTypeById(Integer id); + + /** + * 查询羊只类型列表 + * + * @param basSheepType 羊只类型 + * @return 羊只类型集合 + */ + public List selectBasSheepTypeList(BasSheepType basSheepType); + + /** + * 新增羊只类型 + * + * @param basSheepType 羊只类型 + * @return 结果 + */ + public int insertBasSheepType(BasSheepType basSheepType); + + /** + * 修改羊只类型 + * + * @param basSheepType 羊只类型 + * @return 结果 + */ + public int updateBasSheepType(BasSheepType basSheepType); + + /** + * 批量删除羊只类型 + * + * @param ids 需要删除的羊只类型主键集合 + * @return 结果 + */ + public int deleteBasSheepTypeByIds(Integer[] ids); + + /** + * 删除羊只类型信息 + * + * @param id 羊只类型主键 + * @return 结果 + */ + public int deleteBasSheepTypeById(Integer id); + + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/service/IBasSheepVarietyService.java b/zhyc-module/src/main/java/com/zhyc/module/base/service/IBasSheepVarietyService.java new file mode 100644 index 0000000..04369a6 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/service/IBasSheepVarietyService.java @@ -0,0 +1,67 @@ +package com.zhyc.module.base.service; + +import java.util.List; + +import com.zhyc.module.base.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); + + + // 根据品种名称查询品种 + public BasSheepVariety selectByVarietyName(String varietyName); + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/service/IBreedRamFileService.java b/zhyc-module/src/main/java/com/zhyc/module/base/service/IBreedRamFileService.java new file mode 100644 index 0000000..847f3b0 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/service/IBreedRamFileService.java @@ -0,0 +1,61 @@ +package com.zhyc.module.base.service; + +import java.util.List; +import com.zhyc.module.base.domain.BreedRamFile; + +/** + * 种公羊档案Service接口 + * + * @author zhyc + * @date 2025-07-29 + */ +public interface IBreedRamFileService +{ + /** + * 查询种公羊档案 + * + * @param id 种公羊档案主键 + * @return 种公羊档案 + */ + public BreedRamFile selectBreedRamFileById(Long id); + + /** + * 查询种公羊档案列表 + * + * @param breedRamFile 种公羊档案 + * @return 种公羊档案集合 + */ + public List selectBreedRamFileList(BreedRamFile breedRamFile); + + /** + * 新增种公羊档案 + * + * @param breedRamFile 种公羊档案 + * @return 结果 + */ + public int insertBreedRamFile(BreedRamFile breedRamFile); + + /** + * 修改种公羊档案 + * + * @param breedRamFile 种公羊档案 + * @return 结果 + */ + public int updateBreedRamFile(BreedRamFile breedRamFile); + + /** + * 批量删除种公羊档案 + * + * @param ids 需要删除的种公羊档案主键集合 + * @return 结果 + */ + public int deleteBreedRamFileByIds(Long[] ids); + + /** + * 删除种公羊档案信息 + * + * @param id 种公羊档案主键 + * @return 结果 + */ + public int deleteBreedRamFileById(Long id); +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/service/IDaRanchService.java b/zhyc-module/src/main/java/com/zhyc/module/base/service/IDaRanchService.java new file mode 100644 index 0000000..5428460 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/service/IDaRanchService.java @@ -0,0 +1,61 @@ +package com.zhyc.module.base.service; + +import java.util.List; +import com.zhyc.module.base.domain.DaRanch; + +/** + * 牧场管理Service接口 + * + * @author ruoyi + * @date 2025-07-22 + */ +public interface IDaRanchService +{ + /** + * 查询牧场管理 + * + * @param id 牧场管理主键 + * @return 牧场管理 + */ + public DaRanch selectDaRanchById(Long id); + + /** + * 查询牧场管理列表 + * + * @param daRanch 牧场管理 + * @return 牧场管理集合 + */ + public List selectDaRanchList(DaRanch daRanch); + + /** + * 新增牧场管理 + * + * @param daRanch 牧场管理 + * @return 结果 + */ + public int insertDaRanch(DaRanch daRanch); + + /** + * 修改牧场管理 + * + * @param daRanch 牧场管理 + * @return 结果 + */ + public int updateDaRanch(DaRanch daRanch); + + /** + * 批量删除牧场管理 + * + * @param ids 需要删除的牧场管理主键集合 + * @return 结果 + */ + public int deleteDaRanchByIds(Long[] ids); + + /** + * 删除牧场管理信息 + * + * @param id 牧场管理主键 + * @return 结果 + */ + public int deleteDaRanchById(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/service/IDaSheepfoldService.java b/zhyc-module/src/main/java/com/zhyc/module/base/service/IDaSheepfoldService.java new file mode 100644 index 0000000..26bac8f --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/service/IDaSheepfoldService.java @@ -0,0 +1,76 @@ +package com.zhyc.module.base.service; + +import com.zhyc.module.base.domain.BasSheep; +import com.zhyc.module.base.domain.DaSheepfold; + +import java.util.List; + +/** + * 羊舍管理Service接口 + * + * @author wyt + * @date 2025-07-11 + */ +public interface IDaSheepfoldService +{ + /** + * 查询羊舍管理 + * + * @param id 羊舍管理主键 + * @return 羊舍管理 + */ + public DaSheepfold selectDaSheepfoldById(Long id); + + /** + * 查询羊舍管理列表 + * + * @param daSheepfold 羊舍管理 + * @return 羊舍管理集合 + */ + public List selectDaSheepfoldList(DaSheepfold daSheepfold); + + /** + * 新增羊舍管理 + * + * @param daSheepfold 羊舍管理 + * @return 结果 + */ + public int insertDaSheepfold(DaSheepfold daSheepfold); + + /** + * 修改羊舍管理 + * + * @param daSheepfold 羊舍管理 + * @return 结果 + */ + public int updateDaSheepfold(DaSheepfold daSheepfold); + + /** + * 批量删除羊舍管理 + * + * @param ids 需要删除的羊舍管理主键集合 + * @return 结果 + */ + public int deleteDaSheepfoldByIds(Long[] ids); + + /** + * 删除羊舍管理信息 + * + * @param id 羊舍管理主键 + * @return 结果 + */ + public int deleteDaSheepfoldById(Long id); + + /** + * 检查羊舍编号是否已存在 + * + * @param ranchId 羊舍所属牧场ID + * @param sheepfoldTypeId 羊舍类型ID + * @param sheepfoldNo 羊舍编号 + * @return 是否已存在 + */ + boolean checkSheepfoldNoExist(Long ranchId, Long sheepfoldTypeId, String sheepfoldNo); + +// 根据羊舍id获取该羊舍的羊 + List sheepListById(String id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/service/ISheepFileService.java b/zhyc-module/src/main/java/com/zhyc/module/base/service/ISheepFileService.java new file mode 100644 index 0000000..8280603 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/service/ISheepFileService.java @@ -0,0 +1,41 @@ +package com.zhyc.module.base.service; + +import com.zhyc.module.base.domain.SheepFile; + +import java.util.List; +import java.util.Map; + +/** + * 羊只档案Service接口 + * + * @author wyt + * @date 2025-07-13 + */ +public interface ISheepFileService +{ + /** + * 查询羊只档案 + * + * @param id 羊只档案主键 + * @return 羊只档案 + */ + public SheepFile selectSheepFileById(Long id); + + /** + * 查询羊只档案列表 + * + * @param sheepFile 羊只档案 + * @return 羊只档案集合 + */ + public List selectSheepFileList(SheepFile sheepFile); + + + SheepFile selectBasSheepByManageTags(String trim); + + Long countInGroup(); + + List> countBySheepType(); + List> countByBreedStatus(); + List> countByVariety(); + List> countParityOfLactation(); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/service/impl/BasSheepGroupMappingServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/base/service/impl/BasSheepGroupMappingServiceImpl.java new file mode 100644 index 0000000..74418da --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/service/impl/BasSheepGroupMappingServiceImpl.java @@ -0,0 +1,189 @@ +package com.zhyc.module.base.service.impl; + +import java.util.*; +import java.util.stream.Collectors; + +import com.zhyc.common.core.domain.AjaxResult; +import com.zhyc.module.base.domain.BasSheepGroupMapping; +import com.zhyc.module.base.mapper.BasSheepGroupMappingMapper; +import com.zhyc.module.base.service.IBasSheepGroupMappingService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * 羊只分组关联Service业务层处理 + * + * @author wyt + * @date 2025-07-16 + */ +@Service +public class BasSheepGroupMappingServiceImpl implements IBasSheepGroupMappingService +{ + @Autowired + private BasSheepGroupMappingMapper basSheepGroupMappingMapper; + + /** + * 查询羊只分组关联 + * + * @param id 羊只分组关联主键 + * @return 羊只分组关联 + */ + @Override + public BasSheepGroupMapping selectBasSheepGroupMappingById(Long id) + { + return basSheepGroupMappingMapper.selectBasSheepGroupMappingById(id); + } + + /** + * 查询羊只分组关联列表 + * + * @param basSheepGroupMapping 羊只分组关联 + * @return 羊只分组关联 + */ + @Override + public List selectBasSheepGroupMappingList(BasSheepGroupMapping basSheepGroupMapping) + { + return basSheepGroupMappingMapper.selectBasSheepGroupMappingList(basSheepGroupMapping); + } + + + @Override + public List> selectBasSheepGroupMappingList( + Long sheepId, Long groupId, List bsManageTags) { + return basSheepGroupMappingMapper.selectBasSheepGroupMappingList(sheepId, groupId, bsManageTags); + } + + /** + * 新增羊只分组关联 + * + * @param basSheepGroupMapping 羊只分组关联 + * @return 结果 + */ + @Override + public int insertBasSheepGroupMapping(BasSheepGroupMapping basSheepGroupMapping) + { + return basSheepGroupMappingMapper.insertBasSheepGroupMapping(basSheepGroupMapping); + } + + /** + * 修改羊只分组关联 + * + * @param basSheepGroupMapping 羊只分组关联 + * @return 结果 + */ +// @Override +// public int updateBasSheepGroupMapping(BasSheepGroupMapping basSheepGroupMapping) +// { +// return basSheepGroupMappingMapper.updateBasSheepGroupMapping(basSheepGroupMapping); +// } + @Override + public int updateBasSheepGroupMapping(BasSheepGroupMapping basSheepGroupMapping) { + + Long SheepId = basSheepGroupMapping.getSheepId(); + Long GroupId = basSheepGroupMapping.getGroupId(); + existsInGroup(SheepId,GroupId); + + if (existsInGroup(basSheepGroupMapping.getSheepId(), basSheepGroupMapping.getGroupId())) { + throw new RuntimeException("该羊已在此分组,无需修改"); + } + return basSheepGroupMappingMapper.updateBasSheepGroupMapping(basSheepGroupMapping); + } + + /** + * 批量删除羊只分组关联 + * + * @param ids 需要删除的羊只分组关联主键 + * @return 结果 + */ + @Override + public int deleteBasSheepGroupMappingByIds(Long[] ids) + { + return basSheepGroupMappingMapper.deleteBasSheepGroupMappingByIds(ids); + } + + /** + * 删除羊只分组关联信息 + * + * @param id 羊只分组关联主键 + * @return 结果 + */ + @Override + public int deleteBasSheepGroupMappingById(Long id) + { + return basSheepGroupMappingMapper.deleteBasSheepGroupMappingById(id); + } + + + + @Override + public AjaxResult addByEarTags(List earTags, Long groupId) { + // 1. 参数判空 + if (earTags == null || earTags.isEmpty()) { + return AjaxResult.error("耳号列表不能为空"); + } + + // 2. 根据耳号查询羊只(manage_tags -> id) + List> sheepList = basSheepGroupMappingMapper.selectSheepIdsByEarTags(earTags); + Map tagToId = new HashMap<>(); + for (Map s : sheepList) { + tagToId.put((String) s.get("manage_tags"), ((Number) s.get("id")).longValue()); + } + + // 3. 不存在的耳号 + List missing = new ArrayList<>(); + for (String tag : earTags) { + if (!tagToId.containsKey(tag)) { + missing.add(tag); + } + } + if (!missing.isEmpty()) { + Map res = new HashMap<>(); + res.put("success", false); + res.put("missing", missing); + return AjaxResult.success(res); + } + + // 4. 查询该分组下已存在的羊只ID + List existingRows = basSheepGroupMappingMapper.selectListByGroupId(groupId); + System.out.println("🔍 existingRows 类型 = " + existingRows.getClass()); + + Set existingIds = existingRows.stream() + .map(BasSheepGroupMapping::getSheepId) + .collect(Collectors.toSet()); + + System.out.println("🔍 existingIds = " + existingIds); + + // 5. 过滤出未在该分组的羊只 + List toInsert = new ArrayList<>(); + for (Map.Entry e : tagToId.entrySet()) { + Long sheepId = e.getValue(); + if (!existingIds.contains(sheepId)) { + BasSheepGroupMapping m = new BasSheepGroupMapping(); + m.setSheepId(sheepId); + m.setGroupId(groupId); + toInsert.add(m); + } + } + + if (toInsert.isEmpty()) { + return AjaxResult.success("所选羊只已全部在该分组中"); + } + + // 6. 批量插入 + int rows = basSheepGroupMappingMapper.batchInsert(toInsert); + Map res = new HashMap<>(); + res.put("success", true); + res.put("inserted", rows); + return AjaxResult.success(res); + } + + private boolean existsInGroup(Long sheepId, Long groupId) { + BasSheepGroupMapping param = new BasSheepGroupMapping(); + List> list = basSheepGroupMappingMapper + .selectBasSheepGroupMappingList(sheepId, groupId, null); + return !list.isEmpty(); + } + + + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/service/impl/BasSheepGroupServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/base/service/impl/BasSheepGroupServiceImpl.java new file mode 100644 index 0000000..3d375b3 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/service/impl/BasSheepGroupServiceImpl.java @@ -0,0 +1,123 @@ +package com.zhyc.module.base.service.impl; + +import com.zhyc.common.utils.DateUtils; +import com.zhyc.module.base.domain.BasSheepGroup; +import com.zhyc.module.base.mapper.BasSheepGroupMapper; +import com.zhyc.module.base.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); + } + + @Override + public List selectLeafNodes() { + List leafNodes = basSheepGroupMapper.selectLeafNodes(); + // 如果 ancestorNames 需要格式化,可以复用已有的逻辑 + leafNodes.forEach(group -> { + if (group.getAncestorNames() != null) { + group.setAncestorNames(group.getAncestorNames().replace(",", " / ")); + } + }); + return leafNodes; + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/service/impl/BasSheepServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/base/service/impl/BasSheepServiceImpl.java new file mode 100644 index 0000000..7135f73 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/service/impl/BasSheepServiceImpl.java @@ -0,0 +1,125 @@ +package com.zhyc.module.base.service.impl; + +import java.util.List; +import com.zhyc.common.utils.DateUtils; +import com.zhyc.module.base.domain.BasSheep; +import com.zhyc.module.base.mapper.BasSheepMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.zhyc.module.base.service.IBasSheepService; + +/** + * 羊只基本信息Service业务层处理 + * + * @author ruoyi + * @date 2025-07-15 + */ +@Service +public class BasSheepServiceImpl implements IBasSheepService +{ + @Autowired + private BasSheepMapper basSheepMapper; + + /** + * 查询羊只基本信息 + * + * @param id 羊只基本信息主键 + * @return 羊只基本信息 + */ + @Override + public BasSheep selectBasSheepById(Long id) + { + return basSheepMapper.selectBasSheepById(id); + } + + /** + * 查询羊只基本信息列表 + * + * @param basSheep 羊只基本信息 + * @return 羊只基本信息 + */ + @Override + public List selectBasSheepList(BasSheep basSheep) + { + return basSheepMapper.selectBasSheepList(basSheep); + } + + /** + * 新增羊只基本信息 + * + * @param basSheep 羊只基本信息 + * @return 结果 + */ + @Override + public int insertBasSheep(BasSheep basSheep) + { + basSheep.setCreateTime(DateUtils.getNowDate()); + return basSheepMapper.insertBasSheep(basSheep); + } + + /** + * 修改羊只基本信息 + * + * @param basSheep 羊只基本信息 + * @return 结果 + */ + @Override + public int updateBasSheep(BasSheep basSheep) + { + basSheep.setUpdateTime(DateUtils.getNowDate()); + return basSheepMapper.updateBasSheep(basSheep); + } + + /** + * 批量删除羊只基本信息 + * + * @param ids 需要删除的羊只基本信息主键 + * @return 结果 + */ + @Override + public int deleteBasSheepByIds(Long[] ids) + { + return basSheepMapper.deleteBasSheepByIds(ids); + } + + /** + * 删除羊只基本信息信息 + * + * @param id 羊只基本信息主键 + * @return 结果 + */ + @Override + public int deleteBasSheepById(Long id) + { + return basSheepMapper.deleteBasSheepById(id); + } + + + @Override + public BasSheep selectBasSheepByManageTags(String manageTags){ + return basSheepMapper.selectBasSheepByManageTags(manageTags); + } + + @Override + public List getSheepByRanchId(Long ranchId) { + return basSheepMapper.getSheepByRanchId(ranchId); + } + + @Override + public List selectBasSheepListByIds(List ids) { + return basSheepMapper.selectBasSheepListByIds(ids); + } + + //校验新管理/电子耳号 + @Override + public boolean existsByTag(String tag, Integer earType) { + if (earType == 0) { + return basSheepMapper.existsByElectronicTag(tag) > 0; + } else if (earType == 1) { + return basSheepMapper.existsByManageTag(tag) > 0; + } + return false; + } + + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/service/impl/BasSheepTypeServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/base/service/impl/BasSheepTypeServiceImpl.java new file mode 100644 index 0000000..4c1a362 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/service/impl/BasSheepTypeServiceImpl.java @@ -0,0 +1,89 @@ +package com.zhyc.module.base.service.impl; + +import java.util.List; + +import com.zhyc.module.base.domain.BasSheep; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.zhyc.module.base.mapper.BasSheepTypeMapper; +import com.zhyc.module.base.domain.BasSheepType; +import com.zhyc.module.base.service.IBasSheepTypeService; + +/** + * 羊只类型Service业务层处理 + * + * @author ruoyi + * @date 2025-07-22 + */ +@Service +public class BasSheepTypeServiceImpl implements IBasSheepTypeService { + @Autowired + private BasSheepTypeMapper basSheepTypeMapper; + + /** + * 查询羊只类型 + * + * @param id 羊只类型主键 + * @return 羊只类型 + */ + @Override + public BasSheepType selectBasSheepTypeById(Integer id) { + return basSheepTypeMapper.selectBasSheepTypeById(id); + } + + /** + * 查询羊只类型列表 + * + * @param basSheepType 羊只类型 + * @return 羊只类型 + */ + @Override + public List selectBasSheepTypeList(BasSheepType basSheepType) { + return basSheepTypeMapper.selectBasSheepTypeList(basSheepType); + } + + /** + * 新增羊只类型 + * + * @param basSheepType 羊只类型 + * @return 结果 + */ + @Override + public int insertBasSheepType(BasSheepType basSheepType) { + return basSheepTypeMapper.insertBasSheepType(basSheepType); + } + + /** + * 修改羊只类型 + * + * @param basSheepType 羊只类型 + * @return 结果 + */ + @Override + public int updateBasSheepType(BasSheepType basSheepType) { + return basSheepTypeMapper.updateBasSheepType(basSheepType); + } + + /** + * 批量删除羊只类型 + * + * @param ids 需要删除的羊只类型主键 + * @return 结果 + */ + @Override + public int deleteBasSheepTypeByIds(Integer[] ids) { + return basSheepTypeMapper.deleteBasSheepTypeByIds(ids); + } + + /** + * 删除羊只类型信息 + * + * @param id 羊只类型主键 + * @return 结果 + */ + @Override + public int deleteBasSheepTypeById(Integer id) { + return basSheepTypeMapper.deleteBasSheepTypeById(id); + } + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/service/impl/BasSheepVarietyServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/base/service/impl/BasSheepVarietyServiceImpl.java new file mode 100644 index 0000000..7a1285f --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/service/impl/BasSheepVarietyServiceImpl.java @@ -0,0 +1,99 @@ +package com.zhyc.module.base.service.impl; + +import java.util.List; + +import com.zhyc.module.base.domain.BasSheepVariety; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.zhyc.module.base.mapper.BasSheepVarietyMapper; +import com.zhyc.module.base.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); + } + + @Override + public BasSheepVariety selectByVarietyName(String varietyName) { + return basSheepVarietyMapper.selectByVarietyName(varietyName); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/service/impl/BreedRamFileServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/base/service/impl/BreedRamFileServiceImpl.java new file mode 100644 index 0000000..7e7d8fe --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/service/impl/BreedRamFileServiceImpl.java @@ -0,0 +1,96 @@ +package com.zhyc.module.base.service.impl; + +import java.util.List; +import com.zhyc.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.zhyc.module.base.mapper.BreedRamFileMapper; +import com.zhyc.module.base.domain.BreedRamFile; +import com.zhyc.module.base.service.IBreedRamFileService; + +/** + * 种公羊档案Service业务层处理 + * + * @author zhyc + * @date 2025-07-29 + */ +@Service +public class BreedRamFileServiceImpl implements IBreedRamFileService +{ + @Autowired + private BreedRamFileMapper breedRamFileMapper; + + /** + * 查询种公羊档案 + * + * @param id 种公羊档案主键 + * @return 种公羊档案 + */ + @Override + public BreedRamFile selectBreedRamFileById(Long id) + { + return breedRamFileMapper.selectBreedRamFileById(id); + } + + /** + * 查询种公羊档案列表 + * + * @param breedRamFile 种公羊档案 + * @return 种公羊档案 + */ + @Override + public List selectBreedRamFileList(BreedRamFile breedRamFile) + { + return breedRamFileMapper.selectBreedRamFileList(breedRamFile); + } + + /** + * 新增种公羊档案 + * + * @param breedRamFile 种公羊档案 + * @return 结果 + */ + @Override + public int insertBreedRamFile(BreedRamFile breedRamFile) + { + breedRamFile.setCreateTime(DateUtils.getNowDate()); + return breedRamFileMapper.insertBreedRamFile(breedRamFile); + } + + /** + * 修改种公羊档案 + * + * @param breedRamFile 种公羊档案 + * @return 结果 + */ + @Override + public int updateBreedRamFile(BreedRamFile breedRamFile) + { + breedRamFile.setUpdateTime(DateUtils.getNowDate()); + return breedRamFileMapper.updateBreedRamFile(breedRamFile); + } + + /** + * 批量删除种公羊档案 + * + * @param ids 需要删除的种公羊档案主键 + * @return 结果 + */ + @Override + public int deleteBreedRamFileByIds(Long[] ids) + { + return breedRamFileMapper.deleteBreedRamFileByIds(ids); + } + + /** + * 删除种公羊档案信息 + * + * @param id 种公羊档案主键 + * @return 结果 + */ + @Override + public int deleteBreedRamFileById(Long id) + { + return breedRamFileMapper.deleteBreedRamFileById(id); + } +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/service/impl/DaRanchServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/base/service/impl/DaRanchServiceImpl.java new file mode 100644 index 0000000..fbdf04c --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/service/impl/DaRanchServiceImpl.java @@ -0,0 +1,93 @@ +package com.zhyc.module.base.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.zhyc.module.base.mapper.DaRanchMapper; +import com.zhyc.module.base.domain.DaRanch; +import com.zhyc.module.base.service.IDaRanchService; + +/** + * 牧场管理Service业务层处理 + * + * @author ruoyi + * @date 2025-07-22 + */ +@Service +public class DaRanchServiceImpl implements IDaRanchService +{ + @Autowired + private DaRanchMapper daRanchMapper; + + /** + * 查询牧场管理 + * + * @param id 牧场管理主键 + * @return 牧场管理 + */ + @Override + public DaRanch selectDaRanchById(Long id) + { + return daRanchMapper.selectDaRanchById(id); + } + + /** + * 查询牧场管理列表 + * + * @param daRanch 牧场管理 + * @return 牧场管理 + */ + @Override + public List selectDaRanchList(DaRanch daRanch) + { + return daRanchMapper.selectDaRanchList(daRanch); + } + + /** + * 新增牧场管理 + * + * @param daRanch 牧场管理 + * @return 结果 + */ + @Override + public int insertDaRanch(DaRanch daRanch) + { + return daRanchMapper.insertDaRanch(daRanch); + } + + /** + * 修改牧场管理 + * + * @param daRanch 牧场管理 + * @return 结果 + */ + @Override + public int updateDaRanch(DaRanch daRanch) + { + return daRanchMapper.updateDaRanch(daRanch); + } + + /** + * 批量删除牧场管理 + * + * @param ids 需要删除的牧场管理主键 + * @return 结果 + */ + @Override + public int deleteDaRanchByIds(Long[] ids) + { + return daRanchMapper.deleteDaRanchByIds(ids); + } + + /** + * 删除牧场管理信息 + * + * @param id 牧场管理主键 + * @return 结果 + */ + @Override + public int deleteDaRanchById(Long id) + { + return daRanchMapper.deleteDaRanchById(id); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/service/impl/DaSheepfoldServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/base/service/impl/DaSheepfoldServiceImpl.java new file mode 100644 index 0000000..4753929 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/service/impl/DaSheepfoldServiceImpl.java @@ -0,0 +1,114 @@ +package com.zhyc.module.base.service.impl; + +import com.zhyc.module.base.domain.BasSheep; +import com.zhyc.module.base.domain.DaSheepfold; +import com.zhyc.module.base.mapper.BasSheepMapper; +import com.zhyc.module.base.mapper.DaSheepfoldMapper; +import com.zhyc.module.base.service.IDaSheepfoldService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 羊舍管理Service业务层处理 + * + * @author wyt + * @date 2025-07-11 + */ +@Service +public class DaSheepfoldServiceImpl implements IDaSheepfoldService +{ + @Autowired + private DaSheepfoldMapper daSheepfoldMapper; + @Autowired + private BasSheepMapper basSheepMapper; + + /** + * 查询羊舍管理 + * + * @param id 羊舍管理主键 + * @return 羊舍管理 + */ + @Override + public DaSheepfold selectDaSheepfoldById(Long id) + { + return daSheepfoldMapper.selectDaSheepfoldById(id); + } + + /** + * 查询羊舍管理列表 + * + * @param daSheepfold 羊舍管理 + * @return 羊舍管理 + */ + @Override + public List selectDaSheepfoldList(DaSheepfold daSheepfold) + { + return daSheepfoldMapper.selectDaSheepfoldList(daSheepfold); + } + + /** + * 新增羊舍管理 + * + * @param daSheepfold 羊舍管理 + * @return 结果 + */ + @Override + public int insertDaSheepfold(DaSheepfold daSheepfold) + { + return daSheepfoldMapper.insertDaSheepfold(daSheepfold); + } + + /** + * 修改羊舍管理 + * + * @param daSheepfold 羊舍管理 + * @return 结果 + */ + @Override + public int updateDaSheepfold(DaSheepfold daSheepfold) + { + return daSheepfoldMapper.updateDaSheepfold(daSheepfold); + } + + /** + * 批量删除羊舍管理 + * + * @param ids 需要删除的羊舍管理主键 + * @return 结果 + */ + @Override + public int deleteDaSheepfoldByIds(Long[] ids) + { + return daSheepfoldMapper.deleteDaSheepfoldByIds(ids); + } + + /** + * 删除羊舍管理信息 + * + * @param id 羊舍管理主键 + * @return 结果 + */ + @Override + public int deleteDaSheepfoldById(Long id) + { + return daSheepfoldMapper.deleteDaSheepfoldById(id); + } + + + @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; + } + + @Override + public List sheepListById(String id) { + List basSheep = basSheepMapper.selectBasSheepBySheepfold(id); + return basSheep; + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/base/service/impl/SheepFileServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/base/service/impl/SheepFileServiceImpl.java new file mode 100644 index 0000000..351a4ad --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/base/service/impl/SheepFileServiceImpl.java @@ -0,0 +1,74 @@ +package com.zhyc.module.base.service.impl; + +import com.zhyc.common.utils.DateUtils; +import com.zhyc.module.base.domain.SheepFile; +import com.zhyc.module.base.mapper.SheepFileMapper; +import com.zhyc.module.base.service.ISheepFileService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List;import java.util.Map; + +/** + * 羊只档案Service业务层处理 + * + * @author wyt + * @date 2025-07-13 + */ +@Service +public class SheepFileServiceImpl implements ISheepFileService { + @Autowired + private SheepFileMapper sheepFileMapper; + + /** + * 查询羊只档案 + * + * @param id 羊只档案主键 + * @return 羊只档案 + */ + @Override + public SheepFile selectSheepFileById(Long id) { + return sheepFileMapper.selectSheepFileById(id); + } + + /** + * 查询羊只档案列表 + * + * @param sheepFile 羊只档案 + * @return 羊只档案 + */ + @Override + public List selectSheepFileList(SheepFile sheepFile) { + return sheepFileMapper.selectSheepFileList(sheepFile); + } + + @Override + public SheepFile selectBasSheepByManageTags(String tags) { + return sheepFileMapper.selectSheepByManageTags(tags); + } + + + @Override + public List> countBySheepType() { + return sheepFileMapper.countBySheepType(); + } + + @Override + public List> countByBreedStatus() { + return sheepFileMapper.countByBreedStatus(); + } + + @Override + public List> countByVariety() { + return sheepFileMapper.countByVariety(); + } + + @Override + public List> countParityOfLactation() { + return sheepFileMapper.countParityOfLactation(); + } + @Override + public Long countInGroup() { return sheepFileMapper.countInGroup(); } + + +} 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..6fb5fba --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/DewormController.java @@ -0,0 +1,106 @@ +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) + { + System.out.println(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..39149cc --- /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..1c06745 --- /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("/biosafety/quarantine") +public class QuarantineReportController extends BaseController +{ + @Autowired + private IQuarantineReportService quarantineReportService; + + /** + * 查询检疫记录列表 + */ + @PreAuthorize("@ss.hasPermi('biosafety:quarantine:list')") + @GetMapping("/list") + public TableDataInfo list(QuarantineReport quarantineReport) + { + startPage(); + List list = quarantineReportService.selectQuarantineReportList(quarantineReport); + return getDataTable(list); + } + + /** + * 导出检疫记录列表 + */ + @PreAuthorize("@ss.hasPermi('biosafety: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('biosafety:quarantine:add')") + @Log(title = "检疫记录", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody QuarantineReport quarantineReport) + { + return toAjax(quarantineReportService.insertQuarantineReport(quarantineReport)); + } + + /** + * 修改检疫记录 + */ + @PreAuthorize("@ss.hasPermi('biosafety:quarantine:edit')") + @Log(title = "检疫记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody QuarantineReport quarantineReport) + { + return toAjax(quarantineReportService.updateQuarantineReport(quarantineReport)); + } + + /** + * 删除检疫记录 + */ + @PreAuthorize("@ss.hasPermi('biosafety: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/SwDiseaseController.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/SwDiseaseController.java new file mode 100644 index 0000000..d049ae6 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/SwDiseaseController.java @@ -0,0 +1,103 @@ +package com.zhyc.module.biosafety.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.zhyc.module.biosafety.domain.SwDisease; +import com.zhyc.module.biosafety.service.ISwDiseaseService; +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; + +/** + * 疾病Controller + * + * @author ruoyi + * @date 2025-07-09 + */ +@RestController +@RequestMapping("/biosafety/disease") +public class SwDiseaseController extends BaseController +{ + @Autowired + private ISwDiseaseService swDiseaseService; + + /** + * 查询疾病列表 + */ + @PreAuthorize("@ss.hasPermi('disease:disease:list')") + @GetMapping("/list") + public AjaxResult list(SwDisease swDisease) + { + List list = swDiseaseService.selectSwDiseaseList(swDisease); + return success(list); + } + + /** + * 导出疾病列表 + */ + @PreAuthorize("@ss.hasPermi('disease:disease:export')") + @Log(title = "疾病", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, SwDisease swDisease) + { + List list = swDiseaseService.selectSwDiseaseList(swDisease); + ExcelUtil util = new ExcelUtil(SwDisease.class); + util.exportExcel(response, list, "疾病数据"); + } + + /** + * 获取疾病详细信息 + */ + @PreAuthorize("@ss.hasPermi('disease:disease:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(swDiseaseService.selectSwDiseaseById(id)); + } + + /** + * 新增疾病 + */ + @PreAuthorize("@ss.hasPermi('disease:disease:add')") + @Log(title = "疾病", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody SwDisease swDisease) + { + return toAjax(swDiseaseService.insertSwDisease(swDisease)); + } + + /** + * 修改疾病 + */ + @PreAuthorize("@ss.hasPermi('disease:disease:edit')") + @Log(title = "疾病", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody SwDisease swDisease) + { + return toAjax(swDiseaseService.updateSwDisease(swDisease)); + } + + /** + * 删除疾病 + */ + @PreAuthorize("@ss.hasPermi('disease:disease:remove')") + @Log(title = "疾病", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(swDiseaseService.deleteSwDiseaseByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/SwMedicTypeController.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/SwMedicTypeController.java new file mode 100644 index 0000000..0a4f67b --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/SwMedicTypeController.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.SwMedicType; +import com.zhyc.module.biosafety.service.ISwMedicTypeService; +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-11 + */ +@RestController +@RequestMapping("/biosafety/type") +public class SwMedicTypeController extends BaseController +{ + @Autowired + private ISwMedicTypeService swMedicTypeService; + + /** + * 查询药品类型列表 + */ + @PreAuthorize("@ss.hasPermi('biosafety:type:list')") + @GetMapping("/list") + public TableDataInfo list(SwMedicType swMedicType) + { + startPage(); + List list = swMedicTypeService.selectSwMedicTypeList(swMedicType); + return getDataTable(list); + } + + /** + * 导出药品类型列表 + */ + @PreAuthorize("@ss.hasPermi('biosafety:type:export')") + @Log(title = "药品类型", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, SwMedicType swMedicType) + { + List list = swMedicTypeService.selectSwMedicTypeList(swMedicType); + ExcelUtil util = new ExcelUtil(SwMedicType.class); + util.exportExcel(response, list, "药品类型数据"); + } + + /** + * 获取药品类型详细信息 + */ + @PreAuthorize("@ss.hasPermi('biosafety:type:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(swMedicTypeService.selectSwMedicTypeById(id)); + } + + /** + * 新增药品类型 + */ + @PreAuthorize("@ss.hasPermi('biosafety:type:add')") + @Log(title = "药品类型", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody SwMedicType swMedicType) + { + return toAjax(swMedicTypeService.insertSwMedicType(swMedicType)); + } + + /** + * 修改药品类型 + */ + @PreAuthorize("@ss.hasPermi('biosafety:type:edit')") + @Log(title = "药品类型", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody SwMedicType swMedicType) + { + return toAjax(swMedicTypeService.updateSwMedicType(swMedicType)); + } + + /** + * 删除药品类型 + */ + @PreAuthorize("@ss.hasPermi('biosafety:type:remove')") + @Log(title = "药品类型", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(swMedicTypeService.deleteSwMedicTypeByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/SwMedicineController.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/SwMedicineController.java new file mode 100644 index 0000000..c6cbc0f --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/SwMedicineController.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.SwMedicine; +import com.zhyc.module.biosafety.service.ISwMedicineService; +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-11 + */ +@RestController +@RequestMapping("/system/medicine") +public class SwMedicineController extends BaseController +{ + @Autowired + private ISwMedicineService swMedicineService; + + /** + * 查询药品列表 + */ + @PreAuthorize("@ss.hasPermi('system:medicine:list')") + @GetMapping("/list") + public TableDataInfo list(SwMedicine swMedicine) + { + startPage(); + List list = swMedicineService.selectSwMedicineList(swMedicine); + return getDataTable(list); + } + + /** + * 导出药品列表 + */ + @PreAuthorize("@ss.hasPermi('system:medicine:export')") + @Log(title = "药品", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, SwMedicine swMedicine) + { + List list = swMedicineService.selectSwMedicineList(swMedicine); + ExcelUtil util = new ExcelUtil(SwMedicine.class); + util.exportExcel(response, list, "药品数据"); + } + + /** + * 获取药品详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:medicine:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(swMedicineService.selectSwMedicineById(id)); + } + + /** + * 新增药品 + */ + @PreAuthorize("@ss.hasPermi('system:medicine:add')") + @Log(title = "药品", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody SwMedicine swMedicine) + { + return toAjax(swMedicineService.insertSwMedicine(swMedicine)); + } + + /** + * 修改药品 + */ + @PreAuthorize("@ss.hasPermi('system:medicine:edit')") + @Log(title = "药品", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody SwMedicine swMedicine) + { + return toAjax(swMedicineService.updateSwMedicine(swMedicine)); + } + + /** + * 删除药品 + */ + @PreAuthorize("@ss.hasPermi('system:medicine:remove')") + @Log(title = "药品", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(swMedicineService.deleteSwMedicineByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/SwMedicineUsageController.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/SwMedicineUsageController.java new file mode 100644 index 0000000..c3661aa --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/SwMedicineUsageController.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.SwMedicineUsage; +import com.zhyc.module.biosafety.service.ISwMedicineUsageService; +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-12 + */ +@RestController +@RequestMapping("/biosafety/usageInfo") +public class SwMedicineUsageController extends BaseController +{ + @Autowired + private ISwMedicineUsageService swMedicineUsageService; + + /** + * 查询药品使用记录列表 + */ + @PreAuthorize("@ss.hasPermi('biosafety:usageInfo:list')") + @GetMapping("/list") + public TableDataInfo list(SwMedicineUsage swMedicineUsage) + { + startPage(); + List list = swMedicineUsageService.selectSwMedicineUsageList(swMedicineUsage); + return getDataTable(list); + } + + /** + * 导出药品使用记录列表 + */ + @PreAuthorize("@ss.hasPermi('biosafety:usageInfo:export')") + @Log(title = "药品使用记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, SwMedicineUsage swMedicineUsage) + { + List list = swMedicineUsageService.selectSwMedicineUsageList(swMedicineUsage); + ExcelUtil util = new ExcelUtil(SwMedicineUsage.class); + util.exportExcel(response, list, "药品使用记录数据"); + } + + /** + * 获取药品使用记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('biosafety:usageInfo:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Integer id) + { + return success(swMedicineUsageService.selectSwMedicineUsageById(id)); + } + + /** + * 新增药品使用记录 + */ + @PreAuthorize("@ss.hasPermi('biosafety:usageInfo:add')") + @Log(title = "药品使用记录", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody SwMedicineUsage swMedicineUsage) + { + return toAjax(swMedicineUsageService.insertSwMedicineUsage(swMedicineUsage)); + } + + /** + * 修改药品使用记录 + */ + @PreAuthorize("@ss.hasPermi('biosafety:usageInfo:edit')") + @Log(title = "药品使用记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody SwMedicineUsage swMedicineUsage) + { + return toAjax(swMedicineUsageService.updateSwMedicineUsage(swMedicineUsage)); + } + + /** + * 删除药品使用记录 + */ + @PreAuthorize("@ss.hasPermi('biosafety:usageInfo:remove')") + @Log(title = "药品使用记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(swMedicineUsageService.deleteSwMedicineUsageByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/SwPrescriptionController.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/SwPrescriptionController.java new file mode 100644 index 0000000..44eed9b --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/SwPrescriptionController.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.ISwPrescriptionService; +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.SwPrescription; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 处方Controller + * + * @author ruoyi + * @date 2025-07-11 + */ +@RestController +@RequestMapping("/biosafety/prescription") +public class SwPrescriptionController extends BaseController +{ + @Autowired + private ISwPrescriptionService swPrescriptionService; + + /** + * 查询处方列表 + */ + @PreAuthorize("@ss.hasPermi('biosafety:prescription:list')") + @GetMapping("/list") + public TableDataInfo list(SwPrescription swPrescription) + { + startPage(); + List list = swPrescriptionService.selectSwPrescriptionList(swPrescription); + return getDataTable(list); + } + + /** + * 导出处方列表 + */ + @PreAuthorize("@ss.hasPermi('biosafety:prescription:export')") + @Log(title = "处方", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, SwPrescription swPrescription) + { + List list = swPrescriptionService.selectSwPrescriptionList(swPrescription); + ExcelUtil util = new ExcelUtil(SwPrescription.class); + util.exportExcel(response, list, "处方数据"); + } + + /** + * 获取处方详细信息 + */ + @PreAuthorize("@ss.hasPermi('biosafety:prescription:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(swPrescriptionService.selectSwPrescriptionById(id)); + } + + /** + * 新增处方 + */ + @PreAuthorize("@ss.hasPermi('biosafety:prescription:add')") + @Log(title = "处方", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody SwPrescription swPrescription) + { + return toAjax(swPrescriptionService.insertSwPrescription(swPrescription)); + } + + /** + * 修改处方 + */ + @PreAuthorize("@ss.hasPermi('biosafety:prescription:edit')") + @Log(title = "处方", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody SwPrescription swPrescription) + { + return toAjax(swPrescriptionService.updateSwPrescription(swPrescription)); + } + + /** + * 删除处方 + */ + @PreAuthorize("@ss.hasPermi('biosafety:prescription:remove')") + @Log(title = "处方", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(swPrescriptionService.deleteSwPrescriptionByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/SwUnitController.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/SwUnitController.java new file mode 100644 index 0000000..db8dfe5 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/SwUnitController.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.SwUnit; +import com.zhyc.module.biosafety.service.ISwUnitService; +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-11 + */ +@RestController +@RequestMapping("/biosafety/unit") +public class SwUnitController extends BaseController +{ + @Autowired + private ISwUnitService swUnitService; + + /** + * 查询药品单位列表 + */ + @PreAuthorize("@ss.hasPermi('biosafety:unit:list')") + @GetMapping("/list") + public TableDataInfo list(SwUnit swUnit) + { + startPage(); + List list = swUnitService.selectSwUnitList(swUnit); + return getDataTable(list); + } + + /** + * 导出药品单位列表 + */ + @PreAuthorize("@ss.hasPermi('biosafety:unit:export')") + @Log(title = "药品单位", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, SwUnit swUnit) + { + List list = swUnitService.selectSwUnitList(swUnit); + ExcelUtil util = new ExcelUtil(SwUnit.class); + util.exportExcel(response, list, "药品单位数据"); + } + + /** + * 获取药品单位详细信息 + */ + @PreAuthorize("@ss.hasPermi('biosafety:unit:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(swUnitService.selectSwUnitById(id)); + } + + /** + * 新增药品单位 + */ + @PreAuthorize("@ss.hasPermi('biosafety:unit:add')") + @Log(title = "药品单位", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody SwUnit swUnit) + { + return toAjax(swUnitService.insertSwUnit(swUnit)); + } + + /** + * 修改药品单位 + */ + @PreAuthorize("@ss.hasPermi('biosafety:unit:edit')") + @Log(title = "药品单位", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody SwUnit swUnit) + { + return toAjax(swUnitService.updateSwUnit(swUnit)); + } + + /** + * 删除药品单位 + */ + @PreAuthorize("@ss.hasPermi('biosafety:unit:remove')") + @Log(title = "药品单位", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(swUnitService.deleteSwUnitByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/SwUsageController.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/SwUsageController.java new file mode 100644 index 0000000..ea0c207 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/SwUsageController.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.SwUsage; +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.ISwUsageService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 药品使用方法Controller + * + * @author ruoyi + * @date 2025-07-11 + */ +@RestController +@RequestMapping("/biosafety/usage") +public class SwUsageController extends BaseController +{ + @Autowired + private ISwUsageService swUsageService; + + /** + * 查询药品使用方法列表 + */ + @PreAuthorize("@ss.hasPermi('biosafety:usage:list')") + @GetMapping("/list") + public TableDataInfo list(SwUsage swUsage) + { + startPage(); + List list = swUsageService.selectSwUsageList(swUsage); + return getDataTable(list); + } + + /** + * 导出药品使用方法列表 + */ + @PreAuthorize("@ss.hasPermi('biosafety:usage:export')") + @Log(title = "药品使用方法", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, SwUsage swUsage) + { + List list = swUsageService.selectSwUsageList(swUsage); + ExcelUtil util = new ExcelUtil(SwUsage.class); + util.exportExcel(response, list, "药品使用方法数据"); + } + + /** + * 获取药品使用方法详细信息 + */ + @PreAuthorize("@ss.hasPermi('biosafety:usage:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(swUsageService.selectSwUsageById(id)); + } + + /** + * 新增药品使用方法 + */ + @PreAuthorize("@ss.hasPermi('biosafety:usage:add')") + @Log(title = "药品使用方法", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody SwUsage swUsage) + { + return toAjax(swUsageService.insertSwUsage(swUsage)); + } + + /** + * 修改药品使用方法 + */ + @PreAuthorize("@ss.hasPermi('biosafety:usage:edit')") + @Log(title = "药品使用方法", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody SwUsage swUsage) + { + return toAjax(swUsageService.updateSwUsage(swUsage)); + } + + /** + * 删除药品使用方法 + */ + @PreAuthorize("@ss.hasPermi('biosafety:usage:remove')") + @Log(title = "药品使用方法", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(swUsageService.deleteSwUsageByIds(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..85d5591 --- /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..c3b60c5 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/Deworm.java @@ -0,0 +1,75 @@ +package com.zhyc.module.biosafety.domain; + +import java.util.Date; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 驱虫对象 sw_deworm + * + * @author ruoyi + * @date 2025-07-15 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class Deworm extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + private Long sheepId; + + private Integer[] sheepIds; + + /** 羊只id */ + @Excel(name = "羊只耳号") + private String sheepNo; + @Excel(name = "品种") + private String variety; + @Excel(name = "羊只类别") + private String sheepType; + @Excel(name = "羊只性别") + private String gender; + @Excel(name = "月龄") + private Long monthAge; + @Excel(name = "繁殖状态") + private String breed; + /** 胎次 */ + @Excel(name = "胎次") + private Long parity; + + + + /** 药品使用记录 */ + @Excel(name = "药品使用记录") + private Integer usageId; + + + // 药品使用 + private List usageDetails; + + /** 驱虫日期 */ + @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; + +} 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..05fe6ad --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/Diagnosis.java @@ -0,0 +1,97 @@ +package com.zhyc.module.biosafety.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 诊疗结果对象 sw_diagnosis + * + * @author ruoyi + * @date 2025-07-15 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class Diagnosis extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + /** 治疗记录id */ + @Excel(name = "治疗记录") + private Long treatId; + + /** 羊只id */ + @Excel(name = "羊只耳号") + private String sheepNo; + + 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 Long monthAge; + + + /** 胎次 */ + @Excel(name = "胎次") + private String parity; + + /** 疾病类型 */ + @Excel(name = "疾病类型") + private String diseasePName; + + private Long diseasePid; + + /** 子疾病 */ + @Excel(name = "子疾病") + private String diseaseName; + + private Long diseaseId; + + /** 诊疗结果 */ + @Excel(name = "诊疗结果") + private String 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 = "羊舍") + private String sheepfold; + + private Long sheepfoldId; + +} 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..773ec33 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/Disinfect.java @@ -0,0 +1,67 @@ +package com.zhyc.module.biosafety.domain; + +import java.util.Date; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 消毒记录对象 sw_disinfect + * + * @author ruoyi + * @date 2025-07-15 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class Disinfect extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** id */ + private Long id; + + /** 羊舍id */ + @Excel(name = "羊舍") + private String sheepfoldName; + + private Integer sheepfoldId; + + private Integer[] sheepfoldIds; + + /** 消毒日期 */ + @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 Integer usageId; + + /** 比例 */ + @Excel(name = "比例") + private String ratio; + + /** 备注 */ + @Excel(name = "备注") + private String comment; + + // 药品使用 + private List usageDetails; + +} 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..05e591a --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/Health.java @@ -0,0 +1,68 @@ +package com.zhyc.module.biosafety.domain; + +import java.util.Date; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 保健对象 sw_health + * + * @author ruoyi + * @date 2025-07-15 + */ +@Data +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; + + private Integer[] sheepIds; + + /** 羊只id */ + @Excel(name = "羊只耳号") + private String sheepNo; + @Excel(name = "品种") + private String variety; + @Excel(name = "羊只类别") + private String sheepType; + @Excel(name = "羊只性别") + private String gender; + @Excel(name = "月龄") + private Long monthAge; + @Excel(name = "繁殖状态") + private String breed; + /** 胎次 */ + @Excel(name = "胎次") + private Long parity; + + /** 用药记录 */ + @Excel(name = "用药记录") + private Integer usageId; + + + /** 技术员 */ + @Excel(name = "技术员") + private String technical; + + /** 备注 */ + @Excel(name = "备注") + private String comment; + + // 药品使用 + private List usageDetails; +} 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..1a77298 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/Immunity.java @@ -0,0 +1,79 @@ +package com.zhyc.module.biosafety.domain; + +import java.util.Date; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 免疫对象 sw_immunity + * + * @author ruoyi + * @date 2025-07-15 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class Immunity extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + /** 羊只id */ + @Excel(name = "羊只id") + private Long sheepId; + + private Integer[] sheepIds; + + /** 羊只id */ + @Excel(name = "羊只耳号") + private String sheepNo; + @Excel(name = "品种") + + private String variety; + @Excel(name = "羊只类别") + private String sheepType; + + @Excel(name = "羊只性别") + private String gender; + + @Excel(name = "月龄") + private Long monthAge; + + @Excel(name = "繁殖状态") + private String breed; + /** 胎次 */ + @Excel(name = "胎次") + private Long parity; + + /** 使用记录 */ + @Excel(name = "使用记录") + private Integer usageId; + + + /** 免疫日期 */ + @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; + + // 药品使用 + private List usageDetails; + +} 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..807962a --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/QuarantineItems.java @@ -0,0 +1,31 @@ +package com.zhyc.module.biosafety.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 检疫项目对象 sw_quarantine_items + * + * @author ruoyi + * @date 2025-07-14 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class QuarantineItems extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** id */ + private Long id; + + /** 名称 */ + @Excel(name = "名称") + private String name; + +} 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..0fa8f88 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/QuarantineReport.java @@ -0,0 +1,95 @@ +package com.zhyc.module.biosafety.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; +import org.apache.ibatis.type.Alias; + +/** + * 检疫记录对象 sw_quarantine_report + * + * @author ruoyi + * @date 2025-07-14 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@Alias("QuarantineReport") +public class QuarantineReport extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** id */ + private Long id; + + +// 羊只耳号 + private String[] ids; + + /** 羊只 */ + private Long sheepId; + + @Excel(name = "羊只耳号") + private String sheepNo; + @Excel(name = "羊只类别") + private String sheepType; + @Excel(name = "羊只性别") + private String gender; + @Excel(name = "月龄") + private Long monthAge; + @Excel(name = "胎次") + private Long 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 String result; + + /** 状态 */ + @Excel(name = "状态") + private Integer status; + + /** 备注*/ + @Excel(name = "备注") + private String comment; + + +} 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..e128a0e --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/QuarantineSample.java @@ -0,0 +1,31 @@ +package com.zhyc.module.biosafety.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 样品类型对象 sw_quarantine_sample + * + * @author ruoyi + * @date 2025-07-14 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class QuarantineSample extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** id */ + private Long id; + + /** 样品类型 */ + @Excel(name = "样品类型") + private String name; + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwDisease.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwDisease.java new file mode 100644 index 0000000..65ab2c1 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwDisease.java @@ -0,0 +1,40 @@ +package com.zhyc.module.biosafety.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.TreeEntity; + +/** + * 疾病对象 sw_disease + * + * @author ruoyi + * @date 2025-07-09 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class SwDisease extends TreeEntity +{ + private static final long serialVersionUID = 1L; + + /** id */ + private Long id; + + /** 名称 */ + @Excel(name = "名称") + private String name; + + /** 描述 */ + @Excel(name = "描述") + private String comment; + + /** */ + @Excel(name = "") + private Long pid; + + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwMedicType.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwMedicType.java new file mode 100644 index 0000000..46893c5 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwMedicType.java @@ -0,0 +1,58 @@ +package com.zhyc.module.biosafety.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 药品类型对象 sw_medic_type + * + * @author ruoyi + * @date 2025-07-11 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class SwMedicType extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 编号 */ + 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/SwMedicine.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwMedicine.java new file mode 100644 index 0000000..247ef20 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwMedicine.java @@ -0,0 +1,49 @@ +package com.zhyc.module.biosafety.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 药品对象 sw_medicine + * + * @author ruoyi + * @date 2025-07-11 + */ + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class SwMedicine extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** */ + private Long id; + + /** 药品编号 */ + @Excel(name = "药品编号") + private String medica; + + /** 药品名称 */ + @Excel(name = "药品名称") + private String name; + + /** 药品类型 */ + @Excel(name = "药品类型") + private Long medicType; + + /** 使用方法 */ + @Excel(name = "使用方法") + private Long usageId; + + /** 备注 */ + @Excel(name = "备注") + private String comment; + + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwMedicineUsage.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwMedicineUsage.java new file mode 100644 index 0000000..95a6aea --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwMedicineUsage.java @@ -0,0 +1,41 @@ +package com.zhyc.module.biosafety.domain; + +import java.util.List; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 药品使用记录对象 sw_medicine_usage + * + * @author ruoyi + * @date 2025-07-12 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class SwMedicineUsage extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** id */ + private Integer id; + + /** 使用名称 */ + @Excel(name = "使用名称") + private String name; + + /** 使用类型 */ + @Excel(name = "使用类型") + private String useType; + + /** 药品使用记录详情信息 */ + private List swMedicineUsageDetailsList; + + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwMedicineUsageDetails.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwMedicineUsageDetails.java new file mode 100644 index 0000000..86eb829 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwMedicineUsageDetails.java @@ -0,0 +1,59 @@ +package com.zhyc.module.biosafety.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 药品使用记录详情对象 sw_medicine_usage_details + * + * @author ruoyi + * @date 2025-07-12 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class SwMedicineUsageDetails extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** id */ + private Long id; + + /** 药品使用记录id */ + @Excel(name = "药品使用记录id") + private Integer mediUsage; + + /** 药品id */ + @Excel(name = "药品id") + private Long mediId; + +/** 药品名称*/ + @Excel(name = "药品名称") + private String mediName; + + /** 用量 */ + @Excel(name = "用量") + private String dosage; + + /** 单位 */ + @Excel(name = "单位") + private String unit; + + /** 使用方法 */ + @Excel(name = "使用方法") + private String usageId; + + /** 生产厂家 */ + @Excel(name = "生产厂家") + private String manufacturer; + + /** 生产批号 */ + @Excel(name = "生产批号") + private String batchNumber; + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwPresDetail.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwPresDetail.java new file mode 100644 index 0000000..e03540b --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwPresDetail.java @@ -0,0 +1,114 @@ +package com.zhyc.module.biosafety.domain; + +import java.math.BigDecimal; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 处方详情对象 sw_pres_detail + * + * @author ruoyi + * @date 2025-07-11 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class SwPresDetail extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** id */ + private Long id; + + /** 处方id */ + private Long persId; + + /** 药品id */ + @Excel(name = "药品id") + private Integer mediId; + + /** 用量 */ + @Excel(name = "用量") + private BigDecimal dosage; + + /** 单位 */ + @Excel(name = "单位") + private Integer unitId; + + /** 使用方法 */ + @Excel(name = "使用方法") + private Integer usageId; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setPersId(Long persId) + { + this.persId = persId; + } + + public Long getPersId() + { + return persId; + } + public void setMediId(Integer mediId) + { + this.mediId = mediId; + } + + public Integer getMediId() + { + return mediId; + } + public void setDosage(BigDecimal dosage) + { + this.dosage = dosage; + } + + public BigDecimal getDosage() + { + return dosage; + } + public void setUnitId(Integer unitId) + { + this.unitId = unitId; + } + + public Integer getUnitId() + { + return unitId; + } + public void setUsageId(Integer usageId) + { + this.usageId = usageId; + } + + public Integer getUsageId() + { + return usageId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("persId", getPersId()) + .append("mediId", getMediId()) + .append("dosage", getDosage()) + .append("unitId", getUnitId()) + .append("usageId", getUsageId()) + .toString(); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwPrescription.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwPrescription.java new file mode 100644 index 0000000..ae22e43 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwPrescription.java @@ -0,0 +1,138 @@ +package com.zhyc.module.biosafety.domain; + +import java.util.List; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 处方对象 sw_prescription + * + * @author ruoyi + * @date 2025-07-11 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class SwPrescription extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** id */ + private Long id; + + /** 处方编号 */ + @Excel(name = "处方编号") + private String no; + + /** 处方名称 */ + @Excel(name = "处方名称") + private String name; + + /** 类型(免疫/保健/驱虫/消毒/疾病治疗) */ + @Excel(name = "类型", readConverterExp = "免疫/保健/驱虫/消毒/疾病治疗") + private Integer persType; + + /** 备注 */ + @Excel(name = "备注") + private String comment; + + /** 状态(0禁用1启用) */ + @Excel(name = "状态(0禁用1启用)") + private Integer status; + + /** 处方详情信息 */ + private List swPresDetailList; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public void setNo(String no) + { + this.no = no; + } + + public String getNo() + { + return no; + } + + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + + public void setPersType(Integer persType) + { + this.persType = persType; + } + + public Integer getPersType() + { + return persType; + } + + public void setComment(String comment) + { + this.comment = comment; + } + + public String getComment() + { + return comment; + } + + public void setStatus(Integer status) + { + this.status = status; + } + + public Integer getStatus() + { + return status; + } + + public List getSwPresDetailList() + { + return swPresDetailList; + } + + public void setSwPresDetailList(List swPresDetailList) + { + this.swPresDetailList = swPresDetailList; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("no", getNo()) + .append("name", getName()) + .append("persType", getPersType()) + .append("comment", getComment()) + .append("status", getStatus()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("swPresDetailList", getSwPresDetailList()) + .toString(); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwUnit.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwUnit.java new file mode 100644 index 0000000..9820928 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwUnit.java @@ -0,0 +1,33 @@ +package com.zhyc.module.biosafety.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 药品单位对象 sw_unit + * + * @author ruoyi + * @date 2025-07-11 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class SwUnit extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 编号 */ + private Integer id; + + /** 单位 */ + @Excel(name = "单位") + private String name; + +/* 国际单位*/ + private String unit; +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwUsage.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwUsage.java new file mode 100644 index 0000000..450c220 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwUsage.java @@ -0,0 +1,32 @@ +package com.zhyc.module.biosafety.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 药品使用方法对象 sw_usage + * + * @author ruoyi + * @date 2025-07-11 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class SwUsage extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 编号 */ + private Integer id; + + /** 使用方法 */ + @Excel(name = "使用方法") + private String name; + + +} 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..e4217fc --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/Treatment.java @@ -0,0 +1,107 @@ +package com.zhyc.module.biosafety.domain; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 治疗记录对象 sw_treatment + * + * @author ruoyi + * @date 2025-07-15 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class Treatment extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + private Long id; + + /** 诊疗记录id */ + private Long diagId; + + /** 羊只耳号 */ + @Excel(name = "羊只耳号") + private String sheepNo; + + private Long sheepId; +// 用于批量新增 + private List sheepIds; + + /** 品种 */ + @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 String diseaseName; + + private Long diseaseId; + + + /** 父疾病 */ + @Excel(name = "父疾病") + private String diseasePName; + + private Long diseasePid; + + /** 兽医 */ + @Excel(name = "兽医") + private String veterinary; + + /** 药品使用记录id */ + @Excel(name = "药品使用记录id") + private Integer usageId; + +// 药品使用 + private List usageDetails; + + /** 备注 */ + @Excel(name = "备注") + private String comment; + +} 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..8ce542c --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/DewormMapper.java @@ -0,0 +1,64 @@ +package com.zhyc.module.biosafety.mapper; + +import java.util.List; + +import com.zhyc.module.biosafety.domain.Deworm; +import org.apache.ibatis.annotations.Mapper; + +/** + * 驱虫Mapper接口 + * + * @author ruoyi + * @date 2025-07-15 + */ +@Mapper +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(List 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..f9f8076 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/DiagnosisMapper.java @@ -0,0 +1,63 @@ +package com.zhyc.module.biosafety.mapper; + +import java.util.List; +import com.zhyc.module.biosafety.domain.Diagnosis; +import org.apache.ibatis.annotations.Mapper; + +/** + * 诊疗结果Mapper接口 + * + * @author ruoyi + * @date 2025-07-15 + */ +@Mapper +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..885bf2e --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/DisinfectMapper.java @@ -0,0 +1,63 @@ +package com.zhyc.module.biosafety.mapper; + +import java.util.List; +import com.zhyc.module.biosafety.domain.Disinfect; +import org.apache.ibatis.annotations.Mapper; + +/** + * 消毒记录Mapper接口 + * + * @author ruoyi + * @date 2025-07-15 + */ +@Mapper +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(List 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..bcdc175 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/HealthMapper.java @@ -0,0 +1,63 @@ +package com.zhyc.module.biosafety.mapper; + +import java.util.List; +import com.zhyc.module.biosafety.domain.Health; +import org.apache.ibatis.annotations.Mapper; + +/** + * 保健Mapper接口 + * + * @author ruoyi + * @date 2025-07-15 + */ +@Mapper +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(List 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..a500a9e --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/ImmunityMapper.java @@ -0,0 +1,63 @@ +package com.zhyc.module.biosafety.mapper; + +import java.util.List; +import com.zhyc.module.biosafety.domain.Immunity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 免疫Mapper接口 + * + * @author ruoyi + * @date 2025-07-15 + */ +@Mapper +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(List 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..30b19d7 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/QuarantineItemsMapper.java @@ -0,0 +1,64 @@ +package com.zhyc.module.biosafety.mapper; + +import java.util.List; + +import com.zhyc.module.biosafety.domain.QuarantineItems; +import org.apache.ibatis.annotations.Mapper; + +/** + * 检疫项目Mapper接口 + * + * @author ruoyi + * @date 2025-07-14 + */ +@Mapper +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..bc4c181 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/QuarantineReportMapper.java @@ -0,0 +1,64 @@ +package com.zhyc.module.biosafety.mapper; + +import java.util.List; + +import com.zhyc.module.biosafety.domain.QuarantineReport; +import org.apache.ibatis.annotations.Mapper; + +/** + * 检疫记录Mapper接口 + * + * @author ruoyi + * @date 2025-07-14 + */ +@Mapper +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(List 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..5df4a8a --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/QuarantineSampleMapper.java @@ -0,0 +1,64 @@ +package com.zhyc.module.biosafety.mapper; + +import java.util.List; + +import com.zhyc.module.biosafety.domain.QuarantineSample; +import org.apache.ibatis.annotations.Mapper; + +/** + * 样品类型Mapper接口 + * + * @author ruoyi + * @date 2025-07-14 + */ +@Mapper +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/SwDiseaseMapper.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/SwDiseaseMapper.java new file mode 100644 index 0000000..ed5de79 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/SwDiseaseMapper.java @@ -0,0 +1,63 @@ +package com.zhyc.module.biosafety.mapper; + +import java.util.List; +import com.zhyc.module.biosafety.domain.SwDisease; +import org.apache.ibatis.annotations.Mapper; + +/** + * 疾病Mapper接口 + * + * @author ruoyi + * @date 2025-07-09 + */ +@Mapper +public interface SwDiseaseMapper +{ + /** + * 查询疾病 + * + * @param id 疾病主键 + * @return 疾病 + */ + public SwDisease selectSwDiseaseById(Long id); + + /** + * 查询疾病列表 + * + * @param swDisease 疾病 + * @return 疾病集合 + */ + public List selectSwDiseaseList(SwDisease swDisease); + + /** + * 新增疾病 + * + * @param swDisease 疾病 + * @return 结果 + */ + public int insertSwDisease(SwDisease swDisease); + + /** + * 修改疾病 + * + * @param swDisease 疾病 + * @return 结果 + */ + public int updateSwDisease(SwDisease swDisease); + + /** + * 删除疾病 + * + * @param id 疾病主键 + * @return 结果 + */ + public int deleteSwDiseaseById(Long id); + + /** + * 批量删除疾病 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteSwDiseaseByIds(Long[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/SwMedicTypeMapper.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/SwMedicTypeMapper.java new file mode 100644 index 0000000..19e73c4 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/SwMedicTypeMapper.java @@ -0,0 +1,64 @@ +package com.zhyc.module.biosafety.mapper; + +import java.util.List; + +import com.zhyc.module.biosafety.domain.SwMedicType; +import org.apache.ibatis.annotations.Mapper; + +/** + * 药品类型Mapper接口 + * + * @author ruoyi + * @date 2025-07-11 + */ +@Mapper +public interface SwMedicTypeMapper +{ + /** + * 查询药品类型 + * + * @param id 药品类型主键 + * @return 药品类型 + */ + public SwMedicType selectSwMedicTypeById(Long id); + + /** + * 查询药品类型列表 + * + * @param swMedicType 药品类型 + * @return 药品类型集合 + */ + public List selectSwMedicTypeList(SwMedicType swMedicType); + + /** + * 新增药品类型 + * + * @param swMedicType 药品类型 + * @return 结果 + */ + public int insertSwMedicType(SwMedicType swMedicType); + + /** + * 修改药品类型 + * + * @param swMedicType 药品类型 + * @return 结果 + */ + public int updateSwMedicType(SwMedicType swMedicType); + + /** + * 删除药品类型 + * + * @param id 药品类型主键 + * @return 结果 + */ + public int deleteSwMedicTypeById(Long id); + + /** + * 批量删除药品类型 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteSwMedicTypeByIds(Long[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/SwMedicineMapper.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/SwMedicineMapper.java new file mode 100644 index 0000000..dd1ed67 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/SwMedicineMapper.java @@ -0,0 +1,63 @@ +package com.zhyc.module.biosafety.mapper; + +import java.util.List; +import com.zhyc.module.biosafety.domain.SwMedicine; +import org.apache.ibatis.annotations.Mapper; + +/** + * 药品Mapper接口 + * + * @author ruoyi + * @date 2025-07-11 + */ +@Mapper +public interface SwMedicineMapper +{ + /** + * 查询药品 + * + * @param id 药品主键 + * @return 药品 + */ + public SwMedicine selectSwMedicineById(Long id); + + /** + * 查询药品列表 + * + * @param swMedicine 药品 + * @return 药品集合 + */ + public List selectSwMedicineList(SwMedicine swMedicine); + + /** + * 新增药品 + * + * @param swMedicine 药品 + * @return 结果 + */ + public int insertSwMedicine(SwMedicine swMedicine); + + /** + * 修改药品 + * + * @param swMedicine 药品 + * @return 结果 + */ + public int updateSwMedicine(SwMedicine swMedicine); + + /** + * 删除药品 + * + * @param id 药品主键 + * @return 结果 + */ + public int deleteSwMedicineById(Long id); + + /** + * 批量删除药品 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteSwMedicineByIds(Long[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/SwMedicineUsageMapper.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/SwMedicineUsageMapper.java new file mode 100644 index 0000000..3d60eb0 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/SwMedicineUsageMapper.java @@ -0,0 +1,90 @@ +package com.zhyc.module.biosafety.mapper; + +import java.util.List; + +import com.zhyc.module.biosafety.domain.SwMedicineUsage; +import com.zhyc.module.biosafety.domain.SwMedicineUsageDetails; +import org.apache.ibatis.annotations.Mapper; + +/** + * 药品使用记录Mapper接口 + * + * @author ruoyi + * @date 2025-07-12 + */ +@Mapper +public interface SwMedicineUsageMapper +{ + /** + * 查询药品使用记录 + * + * @param id 药品使用记录主键 + * @return 药品使用记录 + */ + public SwMedicineUsage selectSwMedicineUsageById(Integer id); + + /** + * 查询药品使用记录列表 + * + * @param swMedicineUsage 药品使用记录 + * @return 药品使用记录集合 + */ + public List selectSwMedicineUsageList(SwMedicineUsage swMedicineUsage); + + /** + * 新增药品使用记录 + * + * @param swMedicineUsage 药品使用记录 + * @return 结果 + */ + public int insertSwMedicineUsage(SwMedicineUsage swMedicineUsage); + + /** + * 修改药品使用记录 + * + * @param swMedicineUsage 药品使用记录 + * @return 结果 + */ + public int updateSwMedicineUsage(SwMedicineUsage swMedicineUsage); + + /** + * 删除药品使用记录 + * + * @param id 药品使用记录主键 + * @return 结果 + */ + public int deleteSwMedicineUsageById(Integer id); + + /** + * 批量删除药品使用记录 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteSwMedicineUsageByIds(Long[] ids); + + /** + * 批量删除药品使用记录详情 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteSwMedicineUsageDetailsByMediUsages(Long[] ids); + + /** + * 批量新增药品使用记录详情 + * + * @param swMedicineUsageDetailsList 药品使用记录详情列表 + * @return 结果 + */ + public int batchSwMedicineUsageDetails(List swMedicineUsageDetailsList); + + + /** + * 通过药品使用记录主键删除药品使用记录详情信息 + * + * @param id 药品使用记录ID + * @return 结果 + */ + public int deleteSwMedicineUsageDetailsByMediUsage(Integer id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/SwPrescriptionMapper.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/SwPrescriptionMapper.java new file mode 100644 index 0000000..35796dc --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/SwPrescriptionMapper.java @@ -0,0 +1,89 @@ +package com.zhyc.module.biosafety.mapper; + +import java.util.List; +import com.zhyc.module.biosafety.domain.SwPrescription; +import com.zhyc.module.biosafety.domain.SwPresDetail; +import org.apache.ibatis.annotations.Mapper; + +/** + * 处方Mapper接口 + * + * @author ruoyi + * @date 2025-07-11 + */ +@Mapper +public interface SwPrescriptionMapper +{ + /** + * 查询处方 + * + * @param id 处方主键 + * @return 处方 + */ + public SwPrescription selectSwPrescriptionById(Long id); + + /** + * 查询处方列表 + * + * @param swPrescription 处方 + * @return 处方集合 + */ + public List selectSwPrescriptionList(SwPrescription swPrescription); + + /** + * 新增处方 + * + * @param swPrescription 处方 + * @return 结果 + */ + public int insertSwPrescription(SwPrescription swPrescription); + + /** + * 修改处方 + * + * @param swPrescription 处方 + * @return 结果 + */ + public int updateSwPrescription(SwPrescription swPrescription); + + /** + * 删除处方 + * + * @param id 处方主键 + * @return 结果 + */ + public int deleteSwPrescriptionById(Long id); + + /** + * 批量删除处方 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteSwPrescriptionByIds(Long[] ids); + + /** + * 批量删除处方详情 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteSwPresDetailByPersIds(Long[] ids); + + /** + * 批量新增处方详情 + * + * @param swPresDetailList 处方详情列表 + * @return 结果 + */ + public int batchSwPresDetail(List swPresDetailList); + + + /** + * 通过处方主键删除处方详情信息 + * + * @param id 处方ID + * @return 结果 + */ + public int deleteSwPresDetailByPersId(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/SwUnitMapper.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/SwUnitMapper.java new file mode 100644 index 0000000..417b3aa --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/SwUnitMapper.java @@ -0,0 +1,64 @@ +package com.zhyc.module.biosafety.mapper; + +import com.zhyc.module.biosafety.domain.SwUnit; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 药品单位Mapper接口 + * + * @author ruoyi + * @date 2025-07-11 + */ +@Mapper +public interface SwUnitMapper +{ + /** + * 查询药品单位 + * + * @param id 药品单位主键 + * @return 药品单位 + */ + public SwUnit selectSwUnitById(Long id); + + /** + * 查询药品单位列表 + * + * @param swUnit 药品单位 + * @return 药品单位集合 + */ + public List selectSwUnitList(SwUnit swUnit); + + /** + * 新增药品单位 + * + * @param swUnit 药品单位 + * @return 结果 + */ + public int insertSwUnit(SwUnit swUnit); + + /** + * 修改药品单位 + * + * @param swUnit 药品单位 + * @return 结果 + */ + public int updateSwUnit(SwUnit swUnit); + + /** + * 删除药品单位 + * + * @param id 药品单位主键 + * @return 结果 + */ + public int deleteSwUnitById(Long id); + + /** + * 批量删除药品单位 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteSwUnitByIds(Long[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/SwUsageMapper.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/SwUsageMapper.java new file mode 100644 index 0000000..a2b591b --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/SwUsageMapper.java @@ -0,0 +1,63 @@ +package com.zhyc.module.biosafety.mapper; + +import java.util.List; +import com.zhyc.module.biosafety.domain.SwUsage; +import org.apache.ibatis.annotations.Mapper; + +/** + * 药品使用方法Mapper接口 + * + * @author ruoyi + * @date 2025-07-11 + */ +@Mapper +public interface SwUsageMapper +{ + /** + * 查询药品使用方法 + * + * @param id 药品使用方法主键 + * @return 药品使用方法 + */ + public SwUsage selectSwUsageById(Long id); + + /** + * 查询药品使用方法列表 + * + * @param swUsage 药品使用方法 + * @return 药品使用方法集合 + */ + public List selectSwUsageList(SwUsage swUsage); + + /** + * 新增药品使用方法 + * + * @param swUsage 药品使用方法 + * @return 结果 + */ + public int insertSwUsage(SwUsage swUsage); + + /** + * 修改药品使用方法 + * + * @param swUsage 药品使用方法 + * @return 结果 + */ + public int updateSwUsage(SwUsage swUsage); + + /** + * 删除药品使用方法 + * + * @param id 药品使用方法主键 + * @return 结果 + */ + public int deleteSwUsageById(Long id); + + /** + * 批量删除药品使用方法 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteSwUsageByIds(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..643d9a0 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/TreatmentMapper.java @@ -0,0 +1,66 @@ +package com.zhyc.module.biosafety.mapper; + +import java.util.List; + +import com.zhyc.module.biosafety.domain.Treatment; +import org.apache.ibatis.annotations.Mapper; + +/** + * 治疗记录Mapper接口 + * + * @author ruoyi + * @date 2025-07-15 + */ +@Mapper +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); + + int insertTreatmentList(List treatments); +} 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/ISwDiseaseService.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/ISwDiseaseService.java new file mode 100644 index 0000000..94dcb7b --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/ISwDiseaseService.java @@ -0,0 +1,61 @@ +package com.zhyc.module.biosafety.service; + +import java.util.List; +import com.zhyc.module.biosafety.domain.SwDisease; + +/** + * 疾病Service接口 + * + * @author ruoyi + * @date 2025-07-09 + */ +public interface ISwDiseaseService +{ + /** + * 查询疾病 + * + * @param id 疾病主键 + * @return 疾病 + */ + public SwDisease selectSwDiseaseById(Long id); + + /** + * 查询疾病列表 + * + * @param swDisease 疾病 + * @return 疾病集合 + */ + public List selectSwDiseaseList(SwDisease swDisease); + + /** + * 新增疾病 + * + * @param swDisease 疾病 + * @return 结果 + */ + public int insertSwDisease(SwDisease swDisease); + + /** + * 修改疾病 + * + * @param swDisease 疾病 + * @return 结果 + */ + public int updateSwDisease(SwDisease swDisease); + + /** + * 批量删除疾病 + * + * @param ids 需要删除的疾病主键集合 + * @return 结果 + */ + public int deleteSwDiseaseByIds(Long[] ids); + + /** + * 删除疾病信息 + * + * @param id 疾病主键 + * @return 结果 + */ + public int deleteSwDiseaseById(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/ISwMedicTypeService.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/ISwMedicTypeService.java new file mode 100644 index 0000000..186af6c --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/ISwMedicTypeService.java @@ -0,0 +1,62 @@ +package com.zhyc.module.biosafety.service; + +import java.util.List; + +import com.zhyc.module.biosafety.domain.SwMedicType; + +/** + * 药品类型Service接口 + * + * @author ruoyi + * @date 2025-07-11 + */ +public interface ISwMedicTypeService +{ + /** + * 查询药品类型 + * + * @param id 药品类型主键 + * @return 药品类型 + */ + public SwMedicType selectSwMedicTypeById(Long id); + + /** + * 查询药品类型列表 + * + * @param swMedicType 药品类型 + * @return 药品类型集合 + */ + public List selectSwMedicTypeList(SwMedicType swMedicType); + + /** + * 新增药品类型 + * + * @param swMedicType 药品类型 + * @return 结果 + */ + public int insertSwMedicType(SwMedicType swMedicType); + + /** + * 修改药品类型 + * + * @param swMedicType 药品类型 + * @return 结果 + */ + public int updateSwMedicType(SwMedicType swMedicType); + + /** + * 批量删除药品类型 + * + * @param ids 需要删除的药品类型主键集合 + * @return 结果 + */ + public int deleteSwMedicTypeByIds(Long[] ids); + + /** + * 删除药品类型信息 + * + * @param id 药品类型主键 + * @return 结果 + */ + public int deleteSwMedicTypeById(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/ISwMedicineService.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/ISwMedicineService.java new file mode 100644 index 0000000..abc52b5 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/ISwMedicineService.java @@ -0,0 +1,62 @@ +package com.zhyc.module.biosafety.service; + +import java.util.List; + +import com.zhyc.module.biosafety.domain.SwMedicine; + +/** + * 药品Service接口 + * + * @author ruoyi + * @date 2025-07-11 + */ +public interface ISwMedicineService +{ + /** + * 查询药品 + * + * @param id 药品主键 + * @return 药品 + */ + public SwMedicine selectSwMedicineById(Long id); + + /** + * 查询药品列表 + * + * @param swMedicine 药品 + * @return 药品集合 + */ + public List selectSwMedicineList(SwMedicine swMedicine); + + /** + * 新增药品 + * + * @param swMedicine 药品 + * @return 结果 + */ + public int insertSwMedicine(SwMedicine swMedicine); + + /** + * 修改药品 + * + * @param swMedicine 药品 + * @return 结果 + */ + public int updateSwMedicine(SwMedicine swMedicine); + + /** + * 批量删除药品 + * + * @param ids 需要删除的药品主键集合 + * @return 结果 + */ + public int deleteSwMedicineByIds(Long[] ids); + + /** + * 删除药品信息 + * + * @param id 药品主键 + * @return 结果 + */ + public int deleteSwMedicineById(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/ISwMedicineUsageService.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/ISwMedicineUsageService.java new file mode 100644 index 0000000..70e3dd8 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/ISwMedicineUsageService.java @@ -0,0 +1,61 @@ +package com.zhyc.module.biosafety.service; + +import java.util.List; +import com.zhyc.module.biosafety.domain.SwMedicineUsage; + +/** + * 药品使用记录Service接口 + * + * @author ruoyi + * @date 2025-07-12 + */ +public interface ISwMedicineUsageService +{ + /** + * 查询药品使用记录 + * + * @param id 药品使用记录主键 + * @return 药品使用记录 + */ + public SwMedicineUsage selectSwMedicineUsageById(Integer id); + + /** + * 查询药品使用记录列表 + * + * @param swMedicineUsage 药品使用记录 + * @return 药品使用记录集合 + */ + public List selectSwMedicineUsageList(SwMedicineUsage swMedicineUsage); + + /** + * 新增药品使用记录 + * + * @param swMedicineUsage 药品使用记录 + * @return 结果 + */ + public int insertSwMedicineUsage(SwMedicineUsage swMedicineUsage); + + /** + * 修改药品使用记录 + * + * @param swMedicineUsage 药品使用记录 + * @return 结果 + */ + public int updateSwMedicineUsage(SwMedicineUsage swMedicineUsage); + + /** + * 批量删除药品使用记录 + * + * @param ids 需要删除的药品使用记录主键集合 + * @return 结果 + */ + public int deleteSwMedicineUsageByIds(Long[] ids); + + /** + * 删除药品使用记录信息 + * + * @param id 药品使用记录主键 + * @return 结果 + */ + public int deleteSwMedicineUsageById(Integer id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/ISwPrescriptionService.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/ISwPrescriptionService.java new file mode 100644 index 0000000..97c79fc --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/ISwPrescriptionService.java @@ -0,0 +1,61 @@ +package com.zhyc.module.biosafety.service; + +import java.util.List; +import com.zhyc.module.biosafety.domain.SwPrescription; + +/** + * 处方Service接口 + * + * @author ruoyi + * @date 2025-07-11 + */ +public interface ISwPrescriptionService +{ + /** + * 查询处方 + * + * @param id 处方主键 + * @return 处方 + */ + public SwPrescription selectSwPrescriptionById(Long id); + + /** + * 查询处方列表 + * + * @param swPrescription 处方 + * @return 处方集合 + */ + public List selectSwPrescriptionList(SwPrescription swPrescription); + + /** + * 新增处方 + * + * @param swPrescription 处方 + * @return 结果 + */ + public int insertSwPrescription(SwPrescription swPrescription); + + /** + * 修改处方 + * + * @param swPrescription 处方 + * @return 结果 + */ + public int updateSwPrescription(SwPrescription swPrescription); + + /** + * 批量删除处方 + * + * @param ids 需要删除的处方主键集合 + * @return 结果 + */ + public int deleteSwPrescriptionByIds(Long[] ids); + + /** + * 删除处方信息 + * + * @param id 处方主键 + * @return 结果 + */ + public int deleteSwPrescriptionById(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/ISwUnitService.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/ISwUnitService.java new file mode 100644 index 0000000..13ee078 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/ISwUnitService.java @@ -0,0 +1,62 @@ +package com.zhyc.module.biosafety.service; + +import java.util.List; + +import com.zhyc.module.biosafety.domain.SwUnit; + +/** + * 药品单位Service接口 + * + * @author ruoyi + * @date 2025-07-11 + */ +public interface ISwUnitService +{ + /** + * 查询药品单位 + * + * @param id 药品单位主键 + * @return 药品单位 + */ + public SwUnit selectSwUnitById(Long id); + + /** + * 查询药品单位列表 + * + * @param swUnit 药品单位 + * @return 药品单位集合 + */ + public List selectSwUnitList(SwUnit swUnit); + + /** + * 新增药品单位 + * + * @param swUnit 药品单位 + * @return 结果 + */ + public int insertSwUnit(SwUnit swUnit); + + /** + * 修改药品单位 + * + * @param swUnit 药品单位 + * @return 结果 + */ + public int updateSwUnit(SwUnit swUnit); + + /** + * 批量删除药品单位 + * + * @param ids 需要删除的药品单位主键集合 + * @return 结果 + */ + public int deleteSwUnitByIds(Long[] ids); + + /** + * 删除药品单位信息 + * + * @param id 药品单位主键 + * @return 结果 + */ + public int deleteSwUnitById(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/ISwUsageService.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/ISwUsageService.java new file mode 100644 index 0000000..e6d3152 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/ISwUsageService.java @@ -0,0 +1,61 @@ +package com.zhyc.module.biosafety.service; + +import java.util.List; +import com.zhyc.module.biosafety.domain.SwUsage; + +/** + * 药品使用方法Service接口 + * + * @author ruoyi + * @date 2025-07-11 + */ +public interface ISwUsageService +{ + /** + * 查询药品使用方法 + * + * @param id 药品使用方法主键 + * @return 药品使用方法 + */ + public SwUsage selectSwUsageById(Long id); + + /** + * 查询药品使用方法列表 + * + * @param swUsage 药品使用方法 + * @return 药品使用方法集合 + */ + public List selectSwUsageList(SwUsage swUsage); + + /** + * 新增药品使用方法 + * + * @param swUsage 药品使用方法 + * @return 结果 + */ + public int insertSwUsage(SwUsage swUsage); + + /** + * 修改药品使用方法 + * + * @param swUsage 药品使用方法 + * @return 结果 + */ + public int updateSwUsage(SwUsage swUsage); + + /** + * 批量删除药品使用方法 + * + * @param ids 需要删除的药品使用方法主键集合 + * @return 结果 + */ + public int deleteSwUsageByIds(Long[] ids); + + /** + * 删除药品使用方法信息 + * + * @param id 药品使用方法主键 + * @return 结果 + */ + public int deleteSwUsageById(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..ed72447 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/ITreatmentService.java @@ -0,0 +1,64 @@ +package com.zhyc.module.biosafety.service; + +import java.util.List; + +import com.zhyc.module.biosafety.domain.Treatment; +import org.springframework.transaction.annotation.Transactional; + +/** + * 治疗记录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..c6f850c --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/DewormServiceImpl.java @@ -0,0 +1,160 @@ +package com.zhyc.module.biosafety.service.impl; + +import java.util.ArrayList; +import java.util.List; +import com.zhyc.common.utils.DateUtils; +import com.zhyc.common.utils.SecurityUtils; +import com.zhyc.common.utils.bean.BeanUtils; +import com.zhyc.module.base.domain.SheepFile; +import com.zhyc.module.base.mapper.SheepFileMapper; +import com.zhyc.module.biosafety.domain.Deworm; +import com.zhyc.module.biosafety.domain.SwMedicineUsage; +import com.zhyc.module.biosafety.domain.SwMedicineUsageDetails; +import com.zhyc.module.biosafety.domain.Treatment; +import com.zhyc.module.biosafety.mapper.SwMedicineUsageMapper; +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; +import org.springframework.transaction.annotation.Transactional; + +/** + * 驱虫Service业务层处理 + * + * @author ruoyi + * @date 2025-07-15 + */ +@Service +public class DewormServiceImpl implements IDewormService +{ + @Autowired + private DewormMapper dewormMapper; + @Autowired + private SwMedicineUsageServiceImpl medicineUsageService; + @Autowired + private SwMedicineUsageMapper medicineUsageMapper; + @Autowired + private SheepFileMapper sheepFileMapper; + + /** + * 查询驱虫 + * + * @param id 驱虫主键 + * @return 驱虫 + */ + @Override + public Deworm selectDewormById(Long id) + { + Deworm deworm = dewormMapper.selectDewormById(id); + SwMedicineUsage swMedicineUsage = medicineUsageMapper.selectSwMedicineUsageById(deworm.getUsageId()); + deworm.setUsageDetails(swMedicineUsage.getSwMedicineUsageDetailsList()); + return deworm; + } + + /** + * 查询驱虫列表 + * + * @param deworm 驱虫 + * @return 驱虫 + */ + @Override + public List selectDewormList(Deworm deworm) + { + return dewormMapper.selectDewormList(deworm); + } + + /** + * 新增驱虫 + * + * @param deworm 驱虫 + * @return 结果 + */ + @Override + @Transactional + public int insertDeworm(Deworm deworm) + { + String username = SecurityUtils.getUsername(); + // 使用记录的文件 + SwMedicineUsage medicineUsage = new SwMedicineUsage(); + medicineUsage.setSwMedicineUsageDetailsList(deworm.getUsageDetails()); + medicineUsage.setName("羊只驱虫"); + medicineUsage.setUseType("1"); + + List deworms = new ArrayList<>(); + + deworm.setCreateBy(username); + deworm.setCreateTime(DateUtils.getNowDate()); + for (Integer sheepId : deworm.getSheepIds()) { + SheepFile sheepFile = sheepFileMapper.selectSheepFileById(Long.valueOf(sheepId)); + + Deworm dew = new Deworm(); + BeanUtils.copyProperties(deworm, dew); + dew.setSheepId(Long.valueOf(sheepId)); + dew.setVariety(sheepFile.getVariety()); + dew.setSheepType(sheepFile.getName()); + dew.setMonthAge(sheepFile.getMonthAge()); + dew.setGender(String.valueOf(sheepFile.getGender())); + dew.setBreed(sheepFile.getBreed()); + dew.setParity(sheepFile.getParity()); +// 获取药品使用记录的id + Integer usageId = medicineUsageService.insertSwMedicineUsage(medicineUsage); + dew.setUsageId(usageId); + deworms.add(dew); + } + + + return dewormMapper.insertDeworm(deworms); + } + + /** + * 修改驱虫 + * + * @param deworm 驱虫 + * @return 结果 + */ + @Override + @Transactional + public int updateDeworm(Deworm deworm) + { + String username = SecurityUtils.getUsername(); + for (SwMedicineUsageDetails usageDetail : deworm.getUsageDetails()) { + usageDetail.setMediUsage(deworm.getUsageId()); + } + medicineUsageMapper.deleteSwMedicineUsageDetailsByMediUsage(deworm.getUsageId()); + SwMedicineUsage swMedicineUsage = new SwMedicineUsage(); + + swMedicineUsage.setId(deworm.getUsageId()); + swMedicineUsage.setUpdateBy(username); + swMedicineUsage.setUpdateTime(DateUtils.getNowDate()); + medicineUsageMapper.updateSwMedicineUsage(swMedicineUsage); + + medicineUsageMapper.batchSwMedicineUsageDetails(deworm.getUsageDetails()); + deworm.setUpdateBy(username); + 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..c17e8ec --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/DiagnosisServiceImpl.java @@ -0,0 +1,133 @@ +package com.zhyc.module.biosafety.service.impl; + +import java.util.List; +import java.util.Objects; + +import com.zhyc.common.utils.DateUtils; +import com.zhyc.common.utils.SecurityUtils; +import com.zhyc.module.base.domain.BasSheep; +import com.zhyc.module.base.domain.SheepFile; +import com.zhyc.module.base.mapper.BasSheepMapper; +import com.zhyc.module.base.mapper.SheepFileMapper; +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; +import org.springframework.transaction.annotation.Transactional; + +/** + * 诊疗结果Service业务层处理 + * + * @author ruoyi + * @date 2025-07-15 + */ +@Service +public class DiagnosisServiceImpl implements IDiagnosisService +{ + @Autowired + private DiagnosisMapper diagnosisMapper; + @Autowired + private SheepFileMapper sheepFileMapper; + @Autowired + private BasSheepMapper sheepMapper; + + /** + * 查询诊疗结果 + * + * @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 + @Transactional + public int insertDiagnosis(Diagnosis diagnosis) + { + SheepFile sheepFile = sheepFileMapper.selectSheepFileById(diagnosis.getSheepId()); + diagnosis.setSheepType(sheepFile.getName()); + diagnosis.setParity(String.valueOf(sheepFile.getParity())); + diagnosis.setGender(String.valueOf(sheepFile.getGender())); + diagnosis.setMonthAge(sheepFile.getMonthAge()); + + String username = SecurityUtils.getUsername(); + diagnosis.setCreateBy(username); + diagnosis.setCreateTime(DateUtils.getNowDate()); + if (!Objects.equals(sheepFile.getSheepfoldId(), diagnosis.getSheepfoldId())){ + BasSheep basSheep = new BasSheep(); + basSheep.setId(diagnosis.getSheepId()); + basSheep.setSheepfoldId(diagnosis.getSheepfoldId()); + sheepMapper.updateBasSheep(basSheep); + } +// 转入其他羊舍 + return diagnosisMapper.insertDiagnosis(diagnosis); + } + + /** + * 修改诊疗结果 + * + * @param diagnosis 诊疗结果 + * @return 结果 + */ + @Override + @Transactional + public int updateDiagnosis(Diagnosis diagnosis) + { + BasSheep basSheep = new BasSheep(); + basSheep.setId(diagnosis.getSheepId()); + basSheep.setSheepfoldId(diagnosis.getSheepfoldId()); + String username = SecurityUtils.getUsername(); + basSheep.setUpdateBy(username); + basSheep.setUpdateTime(DateUtils.getNowDate()); + diagnosis.setUpdateBy(username); + diagnosis.setUpdateTime(DateUtils.getNowDate()); + sheepMapper.updateBasSheep(basSheep); + 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..24918ef --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/DisinfectServiceImpl.java @@ -0,0 +1,148 @@ +package com.zhyc.module.biosafety.service.impl; + +import java.util.ArrayList; +import java.util.List; +import com.zhyc.common.utils.DateUtils; +import com.zhyc.common.utils.SecurityUtils; +import com.zhyc.common.utils.bean.BeanUtils; +import com.zhyc.module.base.domain.SheepFile; +import com.zhyc.module.base.mapper.SheepFileMapper; +import com.zhyc.module.biosafety.domain.Deworm; +import com.zhyc.module.biosafety.domain.SwMedicineUsage; +import com.zhyc.module.biosafety.domain.SwMedicineUsageDetails; +import com.zhyc.module.biosafety.mapper.SwMedicineUsageMapper; +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; +import org.springframework.transaction.annotation.Transactional; + +/** + * 消毒记录Service业务层处理 + * + * @author ruoyi + * @date 2025-07-15 + */ +@Service +public class DisinfectServiceImpl implements IDisinfectService +{ + @Autowired + private DisinfectMapper disinfectMapper; + + @Autowired + private SwMedicineUsageServiceImpl medicineUsageService; + + @Autowired + private SwMedicineUsageMapper medicineUsageMapper; + + @Autowired + private SheepFileMapper sheepFileMapper; + + /** + * 查询消毒记录 + * + * @param id 消毒记录主键 + * @return 消毒记录 + */ + @Override + public Disinfect selectDisinfectById(Long id) + { + Disinfect disinfect = disinfectMapper.selectDisinfectById(id); + SwMedicineUsage swMedicineUsage = medicineUsageService.selectSwMedicineUsageById(disinfect.getUsageId()); + disinfect.setUsageDetails(swMedicineUsage.getSwMedicineUsageDetailsList()); + return disinfect; + } + + /** + * 查询消毒记录列表 + * + * @param disinfect 消毒记录 + * @return 消毒记录 + */ + @Override + public List selectDisinfectList(Disinfect disinfect) + { + return disinfectMapper.selectDisinfectList(disinfect); + } + + /** + * 新增消毒记录 + * + * @param disinfect 消毒记录 + * @return 结果 + */ + @Override + public int insertDisinfect(Disinfect disinfect) + { + String username = SecurityUtils.getUsername(); + // 使用记录的文件 + SwMedicineUsage medicineUsage = new SwMedicineUsage(); + medicineUsage.setSwMedicineUsageDetailsList(disinfect.getUsageDetails()); + medicineUsage.setName("羊舍消毒"); + medicineUsage.setUseType("3"); + + + List disinfects = new ArrayList<>(); + + disinfect.setCreateBy(username); + disinfect.setCreateTime(DateUtils.getNowDate()); + + for (Integer sheepfold : disinfect.getSheepfoldIds()) { + Disinfect dis = new Disinfect(); + BeanUtils.copyProperties(disinfect,dis); + dis.setSheepfoldId(sheepfold); +// 获取药品使用记录的id + Integer usageId = medicineUsageService.insertSwMedicineUsage(medicineUsage); + dis.setUsageId(usageId); + disinfects.add(dis); + } + + return disinfectMapper.insertDisinfect(disinfects); + } + + /** + * 修改消毒记录 + * + * @param disinfect 消毒记录 + * @return 结果 + */ + @Override + @Transactional + public int updateDisinfect(Disinfect disinfect) + { + for (SwMedicineUsageDetails usageDetail : disinfect.getUsageDetails()) { + usageDetail.setMediUsage(disinfect.getUsageId()); + } + medicineUsageMapper.deleteSwMedicineUsageDetailsByMediUsage(disinfect.getUsageId()); + medicineUsageMapper.batchSwMedicineUsageDetails(disinfect.getUsageDetails()); + String username = SecurityUtils.getUsername(); + disinfect.setUpdateBy(username); + 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..bef0199 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/HealthServiceImpl.java @@ -0,0 +1,152 @@ +package com.zhyc.module.biosafety.service.impl; + +import java.util.ArrayList; +import java.util.List; +import com.zhyc.common.utils.DateUtils; +import com.zhyc.common.utils.SecurityUtils; +import com.zhyc.common.utils.bean.BeanUtils; +import com.zhyc.module.base.domain.SheepFile; +import com.zhyc.module.base.mapper.SheepFileMapper; +import com.zhyc.module.biosafety.domain.Health; +import com.zhyc.module.biosafety.domain.SwMedicineUsage; +import com.zhyc.module.biosafety.domain.SwMedicineUsageDetails; +import com.zhyc.module.biosafety.mapper.SwMedicineUsageMapper; +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; + + @Autowired + private SwMedicineUsageServiceImpl medicineUsageService; + + @Autowired + private SwMedicineUsageMapper medicineUsageMapper; + + @Autowired + private SheepFileMapper sheepFileMapper; + + /** + * 查询保健 + * + * @param id 保健主键 + * @return 保健 + */ + @Override + public Health selectHealthById(Long id) + { + Health health = healthMapper.selectHealthById(id); + SwMedicineUsage swMedicineUsage = medicineUsageMapper.selectSwMedicineUsageById(health.getUsageId()); + health.setUsageDetails(swMedicineUsage.getSwMedicineUsageDetailsList()); + return health; + } + + /** + * 查询保健列表 + * + * @param health 保健 + * @return 保健 + */ + @Override + public List selectHealthList(Health health) + { + return healthMapper.selectHealthList(health); + } + + /** + * 新增保健 + * + * @param health 保健 + * @return 结果 + */ + @Override + public int insertHealth(Health health) + { + String username = SecurityUtils.getUsername(); + + // 使用记录的文件 + SwMedicineUsage medicineUsage = new SwMedicineUsage(); + medicineUsage.setSwMedicineUsageDetailsList(health.getUsageDetails()); + medicineUsage.setName("羊只保健"); + medicineUsage.setUseType("2"); + + List healths = new ArrayList<>(); + health.setCreateBy(username); + health.setCreateTime(DateUtils.getNowDate()); + for (Integer sheepId : health.getSheepIds()) { + SheepFile sheepFile = sheepFileMapper.selectSheepFileById(Long.valueOf(sheepId)); + Health heal = new Health(); + BeanUtils.copyProperties(health, heal); + heal.setSheepId(Long.valueOf(sheepId)); + heal.setVariety(sheepFile.getVariety()); + heal.setSheepType(sheepFile.getName()); + heal.setMonthAge(sheepFile.getMonthAge()); + heal.setGender(String.valueOf(sheepFile.getGender())); + heal.setBreed(sheepFile.getBreed()); + heal.setParity(sheepFile.getParity()); + +// 获取药品使用记录的id + Integer usageId = medicineUsageService.insertSwMedicineUsage(medicineUsage); + + heal.setUsageId(usageId); + healths.add(heal); + } + return healthMapper.insertHealth(healths); + } + + /** + * 修改保健 + * + * @param health 保健 + * @return 结果 + */ + @Override + public int updateHealth(Health health) + { + for (SwMedicineUsageDetails usageDetail : health.getUsageDetails()) { + usageDetail.setMediUsage(health.getUsageId()); + } + medicineUsageMapper.deleteSwMedicineUsageDetailsByMediUsage(health.getUsageId()); + medicineUsageMapper.batchSwMedicineUsageDetails(health.getUsageDetails()); + String username = SecurityUtils.getUsername(); + health.setUpdateBy(username); + 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..6556faf --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/ImmunityServiceImpl.java @@ -0,0 +1,159 @@ +package com.zhyc.module.biosafety.service.impl; + +import java.util.ArrayList; +import java.util.List; +import com.zhyc.common.utils.DateUtils; +import com.zhyc.common.utils.SecurityUtils; +import com.zhyc.common.utils.bean.BeanUtils; +import com.zhyc.module.base.domain.SheepFile; +import com.zhyc.module.base.mapper.SheepFileMapper; +import com.zhyc.module.biosafety.domain.Deworm; +import com.zhyc.module.biosafety.domain.SwMedicineUsage; +import com.zhyc.module.biosafety.domain.SwMedicineUsageDetails; +import com.zhyc.module.biosafety.mapper.SwMedicineUsageMapper; +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; +import org.springframework.transaction.annotation.Transactional; + +/** + * 免疫Service业务层处理 + * + * @author ruoyi + * @date 2025-07-15 + */ +@Service +public class ImmunityServiceImpl implements IImmunityService +{ + @Autowired + private ImmunityMapper immunityMapper; + + @Autowired + private SwMedicineUsageServiceImpl medicineUsageService; + + @Autowired + private SwMedicineUsageMapper medicineUsageMapper; + + @Autowired + private SheepFileMapper sheepFileMapper; + + + /** + * 查询免疫 + * + * @param id 免疫主键 + * @return 免疫 + */ + @Override + public Immunity selectImmunityById(Long id) + { + Immunity immunity = immunityMapper.selectImmunityById(id); + SwMedicineUsage swMedicineUsage = medicineUsageMapper.selectSwMedicineUsageById(immunity.getUsageId()); + immunity.setUsageDetails(swMedicineUsage.getSwMedicineUsageDetailsList()); + return immunity; + } + + /** + * 查询免疫列表 + * + * @param immunity 免疫 + * @return 免疫 + */ + @Override + public List selectImmunityList(Immunity immunity) + { + return immunityMapper.selectImmunityList(immunity); + } + + /** + * 新增免疫 + * + * @param immunity 免疫 + * @return 结果 + */ + @Override + public int insertImmunity(Immunity immunity) + { + String username = SecurityUtils.getUsername(); + + // 使用记录的文件 + SwMedicineUsage medicineUsage = new SwMedicineUsage(); + medicineUsage.setSwMedicineUsageDetailsList(immunity.getUsageDetails()); + medicineUsage.setName("羊只免疫"); + medicineUsage.setUseType("0"); + medicineUsage.setCreateBy(username); + + List immunities = new ArrayList<>(); + + immunity.setUpdateBy(username); + immunity.setCreateTime(DateUtils.getNowDate()); + + for (Integer sheepId : immunity.getSheepIds()) { + SheepFile sheepFile = sheepFileMapper.selectSheepFileById(Long.valueOf(sheepId)); + + Immunity imm = new Immunity(); + BeanUtils.copyProperties(immunity, imm); + imm.setSheepId(Long.valueOf(sheepId)); + imm.setVariety(sheepFile.getVariety()); + imm.setSheepType(sheepFile.getName()); + imm.setMonthAge(sheepFile.getMonthAge()); + imm.setGender(String.valueOf(sheepFile.getGender())); + imm.setBreed(sheepFile.getBreed()); + imm.setParity(sheepFile.getParity()); +// 获取药品使用记录的id + Integer usageId = medicineUsageService.insertSwMedicineUsage(medicineUsage); + + imm.setUsageId(usageId); + immunities.add(imm); + } + + + immunity.setCreateTime(DateUtils.getNowDate()); + return immunityMapper.insertImmunity(immunities); + } + + /** + * 修改免疫 + * + * @param immunity 免疫 + * @return 结果 + */ + @Override + @Transactional + public int updateImmunity(Immunity immunity) + { + for (SwMedicineUsageDetails usageDetail : immunity.getUsageDetails()) { + usageDetail.setMediUsage(immunity.getUsageId()); + } + medicineUsageMapper.deleteSwMedicineUsageDetailsByMediUsage(immunity.getUsageId()); + medicineUsageMapper.batchSwMedicineUsageDetails(immunity.getUsageDetails()); + 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..4c55e78 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/QuarantineReportServiceImpl.java @@ -0,0 +1,129 @@ +package com.zhyc.module.biosafety.service.impl; + +import java.util.ArrayList; +import java.util.List; +import com.zhyc.common.utils.DateUtils; +import com.zhyc.common.utils.SecurityUtils; +import com.zhyc.common.utils.StringUtils; +import com.zhyc.common.utils.bean.BeanUtils; +import com.zhyc.module.base.domain.SheepFile; +import com.zhyc.module.base.service.impl.SheepFileServiceImpl; +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; + @Autowired + private SheepFileServiceImpl sheepFileService; + + /** + * 查询检疫记录 + * + * @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) + { + String username = SecurityUtils.getUsername(); + quarantineReport.setCreateBy(username); + quarantineReport.setCreateTime(DateUtils.getNowDate()); + if (quarantineReport.getResult()==null){ + quarantineReport.setStatus(0); + }else { + quarantineReport.setStatus(1); + } + List list = new ArrayList(); + for (String sheepId : quarantineReport.getIds()) { + SheepFile sheepFile = sheepFileService.selectSheepFileById(Long.parseLong(sheepId)); + QuarantineReport quarantine= new QuarantineReport(); + BeanUtils.copyProperties(quarantineReport, quarantine); + quarantine.setSheepId(sheepFile.getId()); + quarantine.setSheepNo(sheepFile.getElectronicTags()); + quarantine.setSheepType(sheepFile.getName()); + +// 性别前端处理 + quarantine.setGender(String.valueOf(sheepFile.getGender())); + quarantine.setMonthAge(sheepFile.getMonthAge()); + quarantine.setParity(sheepFile.getParity()); + quarantine.setBreed(sheepFile.getBreed()); + list.add(quarantine); + } + return quarantineReportMapper.insertQuarantineReport(list); + } + + /** + * 修改检疫记录 + * + * @param quarantineReport 检疫记录 + * @return 结果 + */ + @Override + public int updateQuarantineReport(QuarantineReport quarantineReport) + { + String username = SecurityUtils.getUsername(); + quarantineReport.setUpdateBy(username); + 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/SwDiseaseServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/SwDiseaseServiceImpl.java new file mode 100644 index 0000000..8945257 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/SwDiseaseServiceImpl.java @@ -0,0 +1,94 @@ +package com.zhyc.module.biosafety.service.impl; + +import java.util.List; + +import com.zhyc.module.biosafety.domain.SwDisease; +import com.zhyc.module.biosafety.mapper.SwDiseaseMapper; +import com.zhyc.module.biosafety.service.ISwDiseaseService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * 疾病Service业务层处理 + * + * @author ruoyi + * @date 2025-07-09 + */ +@Service +public class SwDiseaseServiceImpl implements ISwDiseaseService +{ + @Autowired + private SwDiseaseMapper swDiseaseMapper; + + /** + * 查询疾病 + * + * @param id 疾病主键 + * @return 疾病 + */ + @Override + public SwDisease selectSwDiseaseById(Long id) + { + return swDiseaseMapper.selectSwDiseaseById(id); + } + + /** + * 查询疾病列表 + * + * @param swDisease 疾病 + * @return 疾病 + */ + @Override + public List selectSwDiseaseList(SwDisease swDisease) + { + return swDiseaseMapper.selectSwDiseaseList(swDisease); + } + + /** + * 新增疾病 + * + * @param swDisease 疾病 + * @return 结果 + */ + @Override + public int insertSwDisease(SwDisease swDisease) + { + return swDiseaseMapper.insertSwDisease(swDisease); + } + + /** + * 修改疾病 + * + * @param swDisease 疾病 + * @return 结果 + */ + @Override + public int updateSwDisease(SwDisease swDisease) + { + return swDiseaseMapper.updateSwDisease(swDisease); + } + + /** + * 批量删除疾病 + * + * @param ids 需要删除的疾病主键 + * @return 结果 + */ + @Override + public int deleteSwDiseaseByIds(Long[] ids) + { + return swDiseaseMapper.deleteSwDiseaseByIds(ids); + } + + /** + * 删除疾病信息 + * + * @param id 疾病主键 + * @return 结果 + */ + @Override + public int deleteSwDiseaseById(Long id) + { + return swDiseaseMapper.deleteSwDiseaseById(id); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/SwMedicTypeServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/SwMedicTypeServiceImpl.java new file mode 100644 index 0000000..2e1b20a --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/SwMedicTypeServiceImpl.java @@ -0,0 +1,94 @@ +package com.zhyc.module.biosafety.service.impl; + +import java.util.List; + +import com.zhyc.module.biosafety.domain.SwMedicType; +import com.zhyc.module.biosafety.mapper.SwMedicTypeMapper; +import com.zhyc.module.biosafety.service.ISwMedicTypeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * 药品类型Service业务层处理 + * + * @author ruoyi + * @date 2025-07-11 + */ +@Service +public class SwMedicTypeServiceImpl implements ISwMedicTypeService +{ + @Autowired + private SwMedicTypeMapper swMedicTypeMapper; + + /** + * 查询药品类型 + * + * @param id 药品类型主键 + * @return 药品类型 + */ + @Override + public SwMedicType selectSwMedicTypeById(Long id) + { + return swMedicTypeMapper.selectSwMedicTypeById(id); + } + + /** + * 查询药品类型列表 + * + * @param swMedicType 药品类型 + * @return 药品类型 + */ + @Override + public List selectSwMedicTypeList(SwMedicType swMedicType) + { + return swMedicTypeMapper.selectSwMedicTypeList(swMedicType); + } + + /** + * 新增药品类型 + * + * @param swMedicType 药品类型 + * @return 结果 + */ + @Override + public int insertSwMedicType(SwMedicType swMedicType) + { + return swMedicTypeMapper.insertSwMedicType(swMedicType); + } + + /** + * 修改药品类型 + * + * @param swMedicType 药品类型 + * @return 结果 + */ + @Override + public int updateSwMedicType(SwMedicType swMedicType) + { + return swMedicTypeMapper.updateSwMedicType(swMedicType); + } + + /** + * 批量删除药品类型 + * + * @param ids 需要删除的药品类型主键 + * @return 结果 + */ + @Override + public int deleteSwMedicTypeByIds(Long[] ids) + { + return swMedicTypeMapper.deleteSwMedicTypeByIds(ids); + } + + /** + * 删除药品类型信息 + * + * @param id 药品类型主键 + * @return 结果 + */ + @Override + public int deleteSwMedicTypeById(Long id) + { + return swMedicTypeMapper.deleteSwMedicTypeById(id); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/SwMedicineServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/SwMedicineServiceImpl.java new file mode 100644 index 0000000..78d9ba5 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/SwMedicineServiceImpl.java @@ -0,0 +1,94 @@ +package com.zhyc.module.biosafety.service.impl; + +import java.util.List; + +import com.zhyc.module.biosafety.domain.SwMedicine; +import com.zhyc.module.biosafety.mapper.SwMedicineMapper; +import com.zhyc.module.biosafety.service.ISwMedicineService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * 药品Service业务层处理 + * + * @author ruoyi + * @date 2025-07-11 + */ +@Service +public class SwMedicineServiceImpl implements ISwMedicineService +{ + @Autowired + private SwMedicineMapper swMedicineMapper; + + /** + * 查询药品 + * + * @param id 药品主键 + * @return 药品 + */ + @Override + public SwMedicine selectSwMedicineById(Long id) + { + return swMedicineMapper.selectSwMedicineById(id); + } + + /** + * 查询药品列表 + * + * @param swMedicine 药品 + * @return 药品 + */ + @Override + public List selectSwMedicineList(SwMedicine swMedicine) + { + return swMedicineMapper.selectSwMedicineList(swMedicine); + } + + /** + * 新增药品 + * + * @param swMedicine 药品 + * @return 结果 + */ + @Override + public int insertSwMedicine(SwMedicine swMedicine) + { + return swMedicineMapper.insertSwMedicine(swMedicine); + } + + /** + * 修改药品 + * + * @param swMedicine 药品 + * @return 结果 + */ + @Override + public int updateSwMedicine(SwMedicine swMedicine) + { + return swMedicineMapper.updateSwMedicine(swMedicine); + } + + /** + * 批量删除药品 + * + * @param ids 需要删除的药品主键 + * @return 结果 + */ + @Override + public int deleteSwMedicineByIds(Long[] ids) + { + return swMedicineMapper.deleteSwMedicineByIds(ids); + } + + /** + * 删除药品信息 + * + * @param id 药品主键 + * @return 结果 + */ + @Override + public int deleteSwMedicineById(Long id) + { + return swMedicineMapper.deleteSwMedicineById(id); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/SwMedicineUsageServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/SwMedicineUsageServiceImpl.java new file mode 100644 index 0000000..d5d06f9 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/SwMedicineUsageServiceImpl.java @@ -0,0 +1,139 @@ +package com.zhyc.module.biosafety.service.impl; + +import java.util.List; +import com.zhyc.common.utils.DateUtils; +import com.zhyc.common.utils.SecurityUtils; +import com.zhyc.module.biosafety.service.ISwMedicineUsageService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import java.util.ArrayList; +import com.zhyc.common.utils.StringUtils; +import org.springframework.transaction.annotation.Transactional; +import com.zhyc.module.biosafety.domain.SwMedicineUsageDetails; +import com.zhyc.module.biosafety.mapper.SwMedicineUsageMapper; +import com.zhyc.module.biosafety.domain.SwMedicineUsage; + +/** + * 药品使用记录Service业务层处理 + * + * @author ruoyi + * @date 2025-07-12 + */ +@Service +public class SwMedicineUsageServiceImpl implements ISwMedicineUsageService +{ + @Autowired + private SwMedicineUsageMapper swMedicineUsageMapper; + + /** + * 查询药品使用记录 + * + * @param id 药品使用记录主键 + * @return 药品使用记录 + */ + @Override + public SwMedicineUsage selectSwMedicineUsageById(Integer id) + { + return swMedicineUsageMapper.selectSwMedicineUsageById(id); + } + + /** + * 查询药品使用记录列表 + * + * @param swMedicineUsage 药品使用记录 + * @return 药品使用记录 + */ + @Override + public List selectSwMedicineUsageList(SwMedicineUsage swMedicineUsage) + { + return swMedicineUsageMapper.selectSwMedicineUsageList(swMedicineUsage); + } + + /** + * 新增药品使用记录 + * + * @param swMedicineUsage 药品使用记录 + * @return 结果 + */ + @Transactional + @Override + public int insertSwMedicineUsage(SwMedicineUsage swMedicineUsage) + { + String username = SecurityUtils.getUsername(); + swMedicineUsage.setCreateBy(username); + swMedicineUsage.setCreateTime(DateUtils.getNowDate()); + int rows = swMedicineUsageMapper.insertSwMedicineUsage(swMedicineUsage); + insertSwMedicineUsageDetails(swMedicineUsage); + return swMedicineUsage.getId(); + } + + /** + * 修改药品使用记录 + * + * @param swMedicineUsage 药品使用记录 + * @return 结果 + */ + @Transactional + @Override + public int updateSwMedicineUsage(SwMedicineUsage swMedicineUsage) + { + String username = SecurityUtils.getUsername(); + swMedicineUsage.setUpdateBy(username); + swMedicineUsage.setUpdateTime(DateUtils.getNowDate()); + swMedicineUsageMapper.deleteSwMedicineUsageDetailsByMediUsage(swMedicineUsage.getId()); + insertSwMedicineUsageDetails(swMedicineUsage); + return swMedicineUsageMapper.updateSwMedicineUsage(swMedicineUsage); + } + + /** + * 批量删除药品使用记录 + * + * @param ids 需要删除的药品使用记录主键 + * @return 结果 + */ + @Transactional + @Override + public int deleteSwMedicineUsageByIds(Long[] ids) + { + swMedicineUsageMapper.deleteSwMedicineUsageDetailsByMediUsages(ids); + return swMedicineUsageMapper.deleteSwMedicineUsageByIds(ids); + } + + /** + * 删除药品使用记录信息 + * + * @param id 药品使用记录主键 + * @return 结果 + */ + @Transactional + @Override + public int deleteSwMedicineUsageById(Integer id) + { + swMedicineUsageMapper.deleteSwMedicineUsageDetailsByMediUsage(id); + return swMedicineUsageMapper.deleteSwMedicineUsageById(id); + } + + /** + * 新增药品使用记录详情信息 + * + * @param swMedicineUsage 药品使用记录对象 + */ + public void insertSwMedicineUsageDetails(SwMedicineUsage swMedicineUsage) + { + List swMedicineUsageDetailsList = swMedicineUsage.getSwMedicineUsageDetailsList(); + Integer id = swMedicineUsage.getId(); + if (StringUtils.isNotNull(swMedicineUsageDetailsList)) + { + List list = new ArrayList(); + for (SwMedicineUsageDetails swMedicineUsageDetails : swMedicineUsageDetailsList) + { + swMedicineUsageDetails.setMediUsage(id); + list.add(swMedicineUsageDetails); + } + if (list.size() > 0) + { + swMedicineUsageMapper.batchSwMedicineUsageDetails(list); + } + } + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/SwPrescriptionServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/SwPrescriptionServiceImpl.java new file mode 100644 index 0000000..59841b8 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/SwPrescriptionServiceImpl.java @@ -0,0 +1,139 @@ +package com.zhyc.module.biosafety.service.impl; + +import java.util.List; +import com.zhyc.common.utils.DateUtils; +import com.zhyc.common.utils.SecurityUtils; +import com.zhyc.module.biosafety.domain.SwPresDetail; +import com.zhyc.module.biosafety.domain.SwPrescription; +import com.zhyc.module.biosafety.mapper.SwPrescriptionMapper; +import com.zhyc.module.biosafety.service.ISwPrescriptionService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import java.util.ArrayList; +import com.zhyc.common.utils.StringUtils; +import org.springframework.transaction.annotation.Transactional; + +/** + * 处方Service业务层处理 + * + * @author ruoyi + * @date 2025-07-11 + */ +@Service +public class SwPrescriptionServiceImpl implements ISwPrescriptionService +{ + @Autowired + private SwPrescriptionMapper swPrescriptionMapper; + + /** + * 查询处方 + * + * @param id 处方主键 + * @return 处方 + */ + @Override + public SwPrescription selectSwPrescriptionById(Long id) + { + return swPrescriptionMapper.selectSwPrescriptionById(id); + } + + /** + * 查询处方列表 + * + * @param swPrescription 处方 + * @return 处方 + */ + @Override + public List selectSwPrescriptionList(SwPrescription swPrescription) + { + return swPrescriptionMapper.selectSwPrescriptionList(swPrescription); + } + + /** + * 新增处方 + * + * @param swPrescription 处方 + * @return 结果 + */ + @Transactional + @Override + public int insertSwPrescription(SwPrescription swPrescription) + { + String username = SecurityUtils.getUsername(); + swPrescription.setCreateBy(username); + swPrescription.setCreateTime(DateUtils.getNowDate()); + int rows = swPrescriptionMapper.insertSwPrescription(swPrescription); + insertSwPresDetail(swPrescription); + return rows; + } + + /** + * 修改处方 + * + * @param swPrescription 处方 + * @return 结果 + */ + @Transactional + @Override + public int updateSwPrescription(SwPrescription swPrescription) + { + String username = SecurityUtils.getUsername(); + swPrescription.setUpdateBy(username); + swPrescription.setUpdateTime(DateUtils.getNowDate()); + swPrescriptionMapper.deleteSwPresDetailByPersId(swPrescription.getId()); + insertSwPresDetail(swPrescription); + return swPrescriptionMapper.updateSwPrescription(swPrescription); + } + + /** + * 批量删除处方 + * + * @param ids 需要删除的处方主键 + * @return 结果 + */ + @Transactional + @Override + public int deleteSwPrescriptionByIds(Long[] ids) + { + swPrescriptionMapper.deleteSwPresDetailByPersIds(ids); + return swPrescriptionMapper.deleteSwPrescriptionByIds(ids); + } + + /** + * 删除处方信息 + * + * @param id 处方主键 + * @return 结果 + */ + @Transactional + @Override + public int deleteSwPrescriptionById(Long id) + { + swPrescriptionMapper.deleteSwPresDetailByPersId(id); + return swPrescriptionMapper.deleteSwPrescriptionById(id); + } + + /** + * 新增处方详情信息 + * + * @param swPrescription 处方对象 + */ + public void insertSwPresDetail(SwPrescription swPrescription) + { + List swPresDetailList = swPrescription.getSwPresDetailList(); + Long id = swPrescription.getId(); + if (StringUtils.isNotNull(swPresDetailList)) + { + List list = new ArrayList(); + for (SwPresDetail swPresDetail : swPresDetailList) + { + swPresDetail.setPersId(id); + list.add(swPresDetail); + } + if (list.size() > 0) + { + swPrescriptionMapper.batchSwPresDetail(list); + } + } + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/SwUnitServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/SwUnitServiceImpl.java new file mode 100644 index 0000000..513c76d --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/SwUnitServiceImpl.java @@ -0,0 +1,95 @@ +package com.zhyc.module.biosafety.service.impl; + +import java.util.List; + +import com.zhyc.module.biosafety.domain.SwUnit; +import com.zhyc.module.biosafety.mapper.SwUnitMapper; +import com.zhyc.module.biosafety.service.ISwUnitService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + + +/** + * 药品单位Service业务层处理 + * + * @author ruoyi + * @date 2025-07-11 + */ +@Service +public class SwUnitServiceImpl implements ISwUnitService +{ + @Autowired + private SwUnitMapper swUnitMapper; + + /** + * 查询药品单位 + * + * @param id 药品单位主键 + * @return 药品单位 + */ + @Override + public SwUnit selectSwUnitById(Long id) + { + return swUnitMapper.selectSwUnitById(id); + } + + /** + * 查询药品单位列表 + * + * @param swUnit 药品单位 + * @return 药品单位 + */ + @Override + public List selectSwUnitList(SwUnit swUnit) + { + return swUnitMapper.selectSwUnitList(swUnit); + } + + /** + * 新增药品单位 + * + * @param swUnit 药品单位 + * @return 结果 + */ + @Override + public int insertSwUnit(SwUnit swUnit) + { + return swUnitMapper.insertSwUnit(swUnit); + } + + /** + * 修改药品单位 + * + * @param swUnit 药品单位 + * @return 结果 + */ + @Override + public int updateSwUnit(SwUnit swUnit) + { + return swUnitMapper.updateSwUnit(swUnit); + } + + /** + * 批量删除药品单位 + * + * @param ids 需要删除的药品单位主键 + * @return 结果 + */ + @Override + public int deleteSwUnitByIds(Long[] ids) + { + return swUnitMapper.deleteSwUnitByIds(ids); + } + + /** + * 删除药品单位信息 + * + * @param id 药品单位主键 + * @return 结果 + */ + @Override + public int deleteSwUnitById(Long id) + { + return swUnitMapper.deleteSwUnitById(id); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/SwUsageServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/SwUsageServiceImpl.java new file mode 100644 index 0000000..203445b --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/SwUsageServiceImpl.java @@ -0,0 +1,94 @@ +package com.zhyc.module.biosafety.service.impl; + +import java.util.List; + +import com.zhyc.module.biosafety.domain.SwUsage; +import com.zhyc.module.biosafety.mapper.SwUsageMapper; +import com.zhyc.module.biosafety.service.ISwUsageService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * 药品使用方法Service业务层处理 + * + * @author ruoyi + * @date 2025-07-11 + */ +@Service +public class SwUsageServiceImpl implements ISwUsageService +{ + @Autowired + private SwUsageMapper swUsageMapper; + + /** + * 查询药品使用方法 + * + * @param id 药品使用方法主键 + * @return 药品使用方法 + */ + @Override + public SwUsage selectSwUsageById(Long id) + { + return swUsageMapper.selectSwUsageById(id); + } + + /** + * 查询药品使用方法列表 + * + * @param swUsage 药品使用方法 + * @return 药品使用方法 + */ + @Override + public List selectSwUsageList(SwUsage swUsage) + { + return swUsageMapper.selectSwUsageList(swUsage); + } + + /** + * 新增药品使用方法 + * + * @param swUsage 药品使用方法 + * @return 结果 + */ + @Override + public int insertSwUsage(SwUsage swUsage) + { + return swUsageMapper.insertSwUsage(swUsage); + } + + /** + * 修改药品使用方法 + * + * @param swUsage 药品使用方法 + * @return 结果 + */ + @Override + public int updateSwUsage(SwUsage swUsage) + { + return swUsageMapper.updateSwUsage(swUsage); + } + + /** + * 批量删除药品使用方法 + * + * @param ids 需要删除的药品使用方法主键 + * @return 结果 + */ + @Override + public int deleteSwUsageByIds(Long[] ids) + { + return swUsageMapper.deleteSwUsageByIds(ids); + } + + /** + * 删除药品使用方法信息 + * + * @param id 药品使用方法主键 + * @return 结果 + */ + @Override + public int deleteSwUsageById(Long id) + { + return swUsageMapper.deleteSwUsageById(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..7ecd944 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/TreatmentServiceImpl.java @@ -0,0 +1,176 @@ +package com.zhyc.module.biosafety.service.impl; + +import java.util.ArrayList; +import java.util.List; +import com.zhyc.common.utils.DateUtils; +import com.zhyc.common.utils.SecurityUtils; +import com.zhyc.common.utils.bean.BeanUtils; +import com.zhyc.module.base.domain.SheepFile; +import com.zhyc.module.base.mapper.SheepFileMapper; +import com.zhyc.module.base.service.impl.SheepFileServiceImpl; +import com.zhyc.module.biosafety.domain.SwMedicineUsage; +import com.zhyc.module.biosafety.domain.SwMedicineUsageDetails; +import com.zhyc.module.biosafety.mapper.SwMedicineUsageMapper; +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; +import org.springframework.transaction.annotation.Transactional; + +/** + * 治疗记录Service业务层处理 + * + * @author ruoyi + * @date 2025-07-15 + */ +@Service +public class TreatmentServiceImpl implements ITreatmentService +{ + @Autowired + private TreatmentMapper treatmentMapper; + @Autowired + private SwMedicineUsageServiceImpl medicineUsageService; + @Autowired + private SwMedicineUsageMapper medicineUsageMapper; + @Autowired + private SheepFileMapper sheepFileMapper; + + /** + * 查询治疗记录 + * + * @param id 治疗记录主键 + * @return 治疗记录 + */ + @Override + public Treatment selectTreatmentById(Long id) + { + Treatment treatment = treatmentMapper.selectTreatmentById(id); +// 获取药品使用记录 + SwMedicineUsage swMedicineUsage = medicineUsageService.selectSwMedicineUsageById(treatment.getUsageId()); + treatment.setUsageDetails(swMedicineUsage.getSwMedicineUsageDetailsList()); + return treatment; + } + + /** + * 查询治疗记录列表 + * + * @param treatment 治疗记录 + * @return 治疗记录 + */ + @Override + public List selectTreatmentList(Treatment treatment) + { + return treatmentMapper.selectTreatmentList(treatment); + } + + /** + * 新增治疗记录 + * + * @param treatment 治疗记录 + * @return 结果 + */ + @Override + @Transactional + public int insertTreatment(Treatment treatment) + { + String username = SecurityUtils.getUsername(); +// 使用记录的文件 + SwMedicineUsage medicineUsage = new SwMedicineUsage(); + medicineUsage.setSwMedicineUsageDetailsList(treatment.getUsageDetails()); + medicineUsage.setName("羊只治疗"); + medicineUsage.setUseType("4"); + medicineUsage.setCreateBy(username); + medicineUsage.setCreateTime(DateUtils.getNowDate()); +// 新增单挑数据 + if (treatment.getSheepId()!=null){ +// 药品使用记录 + Integer id=medicineUsageService.insertSwMedicineUsage(medicineUsage); +// 药品使用记录id + treatment.setUsageId(id); + treatment.setCreateTime(DateUtils.getNowDate()); + return treatmentMapper.insertTreatment(treatment); + +// 批量新增 + }else { + + List treatments = new ArrayList<>(); + treatment.setCreateTime(DateUtils.getNowDate()); + for (String sheepId : treatment.getSheepIds()) { + SheepFile sheepFile = sheepFileMapper.selectSheepFileById(Long.valueOf(sheepId)); + Treatment treat = new Treatment(); + BeanUtils.copyProperties(treatment, treat); + treat.setSheepId(Long.valueOf(sheepId)); + treat.setVariety(sheepFile.getVariety()); + treat.setSheepType(sheepFile.getName()); + treat.setMonthAge(sheepFile.getMonthAge()); + treat.setGender(String.valueOf(sheepFile.getGender())); + treat.setBreed(sheepFile.getBreed()); + treat.setParity(sheepFile.getParity()); + treat.setLactDay(sheepFile.getLactationDay()); + treat.setGestDay(sheepFile.getGestationDay()); +// 获取药品使用记录的id + Integer usageId = medicineUsageService.insertSwMedicineUsage(medicineUsage); + System.out.println(medicineUsage); + System.out.println(usageId); + treat.setUsageId(usageId); + treatments.add(treat); + } +// 药品使用记录 + medicineUsage.setSwMedicineUsageDetailsList(treatment.getUsageDetails()); + + + return treatmentMapper.insertTreatmentList(treatments); + } + + } + + /** + * 修改治疗记录 + * + * @param treatment 治疗记录 + * @return 结果 + */ + @Override + @Transactional + public int updateTreatment(Treatment treatment) + { + String username = SecurityUtils.getUsername(); + for (SwMedicineUsageDetails usageDetail : treatment.getUsageDetails()) { + usageDetail.setMediUsage(treatment.getUsageId()); + } + medicineUsageMapper.deleteSwMedicineUsageDetailsByMediUsage(treatment.getUsageId()); + SwMedicineUsage swMedicineUsage = new SwMedicineUsage(); + swMedicineUsage.setId(treatment.getUsageId()); + swMedicineUsage.setUpdateBy(username); + medicineUsageMapper.updateSwMedicineUsage(swMedicineUsage); + medicineUsageMapper.batchSwMedicineUsageDetails(treatment.getUsageDetails()); + treatment.setUpdateBy(username); + 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/dairyProducts/controller/NpFreshMilkInspController.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/controller/NpFreshMilkInspController.java new file mode 100644 index 0000000..4c1aa3f --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/controller/NpFreshMilkInspController.java @@ -0,0 +1,104 @@ +package com.zhyc.module.dairyProducts.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.domain.NpFreshMilkInsp; +import com.zhyc.module.dairyProducts.service.INpFreshMilkInspService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 鲜奶生产,成品检验记录Controller + * + * @author ruoyi + * @date 2025-07-18 + */ +@RestController +@RequestMapping("/freshMilkTest/freshMilkTest") +public class NpFreshMilkInspController extends BaseController +{ + @Autowired + private INpFreshMilkInspService npFreshMilkInspService; + + /** + * 查询鲜奶生产,成品检验记录列表 + */ + @PreAuthorize("@ss.hasPermi('freshMilkTest:freshMilkTest:list')") + @GetMapping("/list") + public TableDataInfo list(NpFreshMilkInsp npFreshMilkInsp) + { + startPage(); + List list = npFreshMilkInspService.selectNpFreshMilkInspList(npFreshMilkInsp); + return getDataTable(list); + } + + /** + * 导出鲜奶生产,成品检验记录列表 + */ + @PreAuthorize("@ss.hasPermi('freshMilkTest:freshMilkTest:export')") + @Log(title = "鲜奶生产,成品检验记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, NpFreshMilkInsp npFreshMilkInsp) + { + List list = npFreshMilkInspService.selectNpFreshMilkInspList(npFreshMilkInsp); + ExcelUtil util = new ExcelUtil(NpFreshMilkInsp.class); + util.exportExcel(response, list, "鲜奶生产,成品检验记录数据"); + } + + /** + * 获取鲜奶生产,成品检验记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('freshMilkTest:freshMilkTest:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(npFreshMilkInspService.selectNpFreshMilkInspById(id)); + } + + /** + * 新增鲜奶生产,成品检验记录 + */ + @PreAuthorize("@ss.hasPermi('freshMilkTest:freshMilkTest:add')") + @Log(title = "鲜奶生产,成品检验记录", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody NpFreshMilkInsp npFreshMilkInsp) + { + return toAjax(npFreshMilkInspService.insertNpFreshMilkInsp(npFreshMilkInsp)); + } + + /** + * 修改鲜奶生产,成品检验记录 + */ + @PreAuthorize("@ss.hasPermi('freshMilkTest:freshMilkTest:edit')") + @Log(title = "鲜奶生产,成品检验记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody NpFreshMilkInsp npFreshMilkInsp) + { + return toAjax(npFreshMilkInspService.updateNpFreshMilkInsp(npFreshMilkInsp)); + } + + /** + * 删除鲜奶生产,成品检验记录 + */ + @PreAuthorize("@ss.hasPermi('freshMilkTest:freshMilkTest:remove')") + @Log(title = "鲜奶生产,成品检验记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(npFreshMilkInspService.deleteNpFreshMilkInspByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/controller/NpMilkInOutStoreController.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/controller/NpMilkInOutStoreController.java new file mode 100644 index 0000000..44cbccb --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/controller/NpMilkInOutStoreController.java @@ -0,0 +1,70 @@ +package com.zhyc.module.dairyProducts.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.module.dairyProducts.domain.NpMilkInOutStore; +import com.zhyc.module.dairyProducts.service.INpMilkInOutStoreService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.util.Date; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("/milkInOutStore") +public class NpMilkInOutStoreController extends BaseController { + + @Autowired + private INpMilkInOutStoreService service; + + /** 查询(日期区间)+ 动态列 */ + @PreAuthorize("@ss.hasPermi('milkInOutStore:list')") + @GetMapping("/list") + public TableDataInfo list( + @RequestParam(required=false) Date datetimeStart, + @RequestParam(required=false) Date datetimeEnd + ) { + startPage(); + List> rows = service.selectWithDynamicColumns(datetimeStart, datetimeEnd); + return getDataTable(rows); + } + + /** 导入 Excel */ + @Log(title="导入羊奶出入库", businessType=BusinessType.IMPORT) + @PreAuthorize("@ss.hasPermi('milkInOutStore:import')") + @PostMapping("/import") + public AjaxResult importExcel(@RequestParam("file") MultipartFile file) throws Exception { + List> list = service.parseImportExcel(file); + service.batchInsertFromRows(list); + return AjaxResult.success("导入成功"); + } + /** 导出 Excel */ + @PreAuthorize("@ss.hasPermi('milkInOutStore:export')") + @Log(title="导出羊奶出入库", businessType=BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, + @RequestParam(required=false) Date datetimeStart, + @RequestParam(required=false) Date datetimeEnd + ) { + List> rows = service.selectWithDynamicColumns(datetimeStart, datetimeEnd); + // 解决方案:强制转换并压制警告 + @SuppressWarnings("unchecked") + ExcelUtil> util = new ExcelUtil<>((Class>) (Class) Map.class); + } + + /** 获取可选列定义(饲喂来源 + 销售去向) */ + @PreAuthorize("@ss.hasPermi('milkInOutStore:cols')") + @GetMapping("/columns") + public AjaxResult getColumns(){ + return AjaxResult.success(service.getAllColumnOptions()); + } +} + diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/controller/NpMilkProdClassesController.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/controller/NpMilkProdClassesController.java new file mode 100644 index 0000000..32e7db8 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/controller/NpMilkProdClassesController.java @@ -0,0 +1,69 @@ +package com.zhyc.module.dairyProducts.controller; + +import java.util.Date; +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +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.core.page.TableDataInfo; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.module.dairyProducts.domain.NpMilkProdClasses; +import com.zhyc.module.dairyProducts.service.INpMilkProdClassesService; + +@RestController +@RequestMapping("/milkProdclasses/milkProdclasses") +public class NpMilkProdClassesController extends BaseController { + + @Autowired + private INpMilkProdClassesService npMilkProdClassesService; + + @PreAuthorize("@ss.hasPermi('milkProdclasses:milkProdclasses:list')") + @GetMapping("/list") + public TableDataInfo list( + @RequestParam(required = false) Date datetimeStart, + @RequestParam(required = false) Date datetimeEnd, + @RequestParam(required = false) String manageEarNo, // 改为单个字符串,模糊 + @RequestParam(required = false) String factory, + @RequestParam(required = false) Integer classes) { + startPage(); + List list = npMilkProdClassesService + .selectNpMilkProdClassesList(datetimeStart, datetimeEnd, + manageEarNo, factory, classes); + return getDataTable(list); + } + + @PreAuthorize("@ss.hasPermi('milkProdclasses:milkProdclasses:import')") + @Log(title = "班次产奶", businessType = BusinessType.IMPORT) + @PostMapping("/import") + public AjaxResult importData(MultipartFile file) { + try { + ExcelUtil util = new ExcelUtil<>(NpMilkProdClasses.class); + List list = util.importExcel(file.getInputStream()); + int rows = npMilkProdClassesService.importMilkProdClasses(list); + return success("成功导入 " + rows + " 行数据"); + } catch (Exception e) { + return error("导入失败:" + e.getMessage()); + } + } + + @PreAuthorize("@ss.hasPermi('milkProdclasses:milkProdclasses:export')") + @Log(title = "班次产奶", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, + @RequestParam(required = false) Date datetimeStart, + @RequestParam(required = false) Date datetimeEnd, + @RequestParam(required = false) String manageEarNos, + @RequestParam(required = false) String factory, + @RequestParam(required = false) Integer classes) { + List list = npMilkProdClassesService.selectNpMilkProdClassesList(datetimeStart, datetimeEnd, manageEarNos, factory, classes); + ExcelUtil util = new ExcelUtil<>(NpMilkProdClasses.class); + util.exportExcel(response, list, "班次产奶数据"); + } +} + diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/controller/NpRawMilkInspeController.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/controller/NpRawMilkInspeController.java new file mode 100644 index 0000000..bf88fcd --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/controller/NpRawMilkInspeController.java @@ -0,0 +1,105 @@ +package com.zhyc.module.dairyProducts.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.zhyc.module.dairyProducts.service.INpRawMilkInspeService; +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.domain.NpRawMilkInspe; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 生乳检验记录Controller + * + * @author ruoyi + * @date 2025-07-15 + */ +@RestController +@RequestMapping("/rawMilkTest/rawMilkTest") +public class NpRawMilkInspeController extends BaseController +{ + @Autowired + private INpRawMilkInspeService npRawMilkInspeService; + + /** + * 查询生乳检验记录列表 + */ + @PreAuthorize("@ss.hasPermi('rawMilkTest:rawMilkTest:list')") + @GetMapping("/list") + public TableDataInfo list(NpRawMilkInspe npRawMilkInspe) + { + startPage(); + List list = npRawMilkInspeService.selectNpRawMilkInspeList(npRawMilkInspe); + return getDataTable(list); + } + + /** + * 导出生乳检验记录列表 + */ + @PreAuthorize("@ss.hasPermi('rawMilkTest:rawMilkTest:export')") + @Log(title = "生乳检验记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, NpRawMilkInspe npRawMilkInspe) + { + List list = npRawMilkInspeService.selectNpRawMilkInspeList(npRawMilkInspe); + ExcelUtil util = new ExcelUtil(NpRawMilkInspe.class); + util.exportExcel(response, list, "生乳检验记录数据"); + } + + /** + * 获取生乳检验记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('rawMilkTest:rawMilkTest:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(npRawMilkInspeService.selectNpRawMilkInspeById(id)); + } + + /** + * 新增生乳检验记录 + */ + @PreAuthorize("@ss.hasPermi('rawMilkTest:rawMilkTest:add')") + @Log(title = "生乳检验记录", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody NpRawMilkInspe npRawMilkInspe) + { + return toAjax(npRawMilkInspeService.insertNpRawMilkInspe(npRawMilkInspe)); + } + + /** + * 修改生乳检验记录 + */ + @PreAuthorize("@ss.hasPermi('rawMilkTest:rawMilkTest:edit')") + @Log(title = "生乳检验记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody NpRawMilkInspe npRawMilkInspe) + { + return toAjax(npRawMilkInspeService.updateNpRawMilkInspe(npRawMilkInspe)); + } + + /** + * 删除生乳检验记录 + */ + @PreAuthorize("@ss.hasPermi('rawMilkTest:rawMilkTest:remove')") + @Log(title = "生乳检验记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(npRawMilkInspeService.deleteNpRawMilkInspeByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/controller/NpSheepMilkAnalysisController.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/controller/NpSheepMilkAnalysisController.java new file mode 100644 index 0000000..0c2955d --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/controller/NpSheepMilkAnalysisController.java @@ -0,0 +1,79 @@ +package com.zhyc.module.dairyProducts.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.core.page.TableDataInfo; +import com.zhyc.common.enums.BusinessType; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.module.dairyProducts.domain.NpSheepMilkAnalysis; +import com.zhyc.module.dairyProducts.service.INpSheepMilkAnalysisService; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@RestController +@RequestMapping("/dairyProducts/sheepMilkAnalysis") +public class NpSheepMilkAnalysisController extends BaseController { + + @Autowired + private INpSheepMilkAnalysisService npSheepMilkAnalysisService; + + /** + * 查询奶产量分析列表 + */ + @GetMapping("/list") + public TableDataInfo list(NpSheepMilkAnalysis analysis) { + startPage(); + List list = npSheepMilkAnalysisService.selectNpSheepMilkAnalysisList(analysis); + return getDataTable(list); + } + + /** + * 获取单个分析记录详细信息 + */ + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return AjaxResult.success(npSheepMilkAnalysisService.selectNpSheepMilkAnalysisById(id)); + } + /** + * 新增奶产量分析记录 + */ + @Log(title = "奶产量分析", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody NpSheepMilkAnalysis analysis) { + return toAjax(npSheepMilkAnalysisService.insertNpSheepMilkAnalysis(analysis)); + } + + /** + * 修改奶产量分析记录 + */ + @Log(title = "奶产量分析", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody NpSheepMilkAnalysis analysis) { + return toAjax(npSheepMilkAnalysisService.updateNpSheepMilkAnalysis(analysis)); + } + + /** + * 删除奶产量分析记录 + */ + @Log(title = "奶产量分析", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + return toAjax(npSheepMilkAnalysisService.deleteNpSheepMilkAnalysisByIds(ids)); + } + + /** + * 导出奶产量分析记录 + */ + @Log(title = "奶产量分析", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(NpSheepMilkAnalysis analysis) { + List list = npSheepMilkAnalysisService.selectNpSheepMilkAnalysisList(analysis); + ExcelUtil util = new ExcelUtil<>(NpSheepMilkAnalysis.class); + return util.exportExcel(list, "奶产量分析数据"); + } +} + diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/controller/NpYogurtInspController.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/controller/NpYogurtInspController.java new file mode 100644 index 0000000..fc7fda2 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/controller/NpYogurtInspController.java @@ -0,0 +1,105 @@ +package com.zhyc.module.dairyProducts.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.zhyc.module.dairyProducts.domain.NpYogurtInsp; +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.service.INpYogurtInspService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 酸奶生产,成品检疫记录Controller + * + * @author ruoyi + * @date 2025-07-17 + */ +@RestController +@RequestMapping("/yogurtTest/yogurtTest") +public class NpYogurtInspController extends BaseController +{ + @Autowired + private INpYogurtInspService npYogurtInspService; + + /** + * 查询酸奶生产,成品检疫记录列表 + */ + @PreAuthorize("@ss.hasPermi('yogurtTest:yogurtTest:list')") + @GetMapping("/list") + public TableDataInfo list(NpYogurtInsp npYogurtInsp) + { + startPage(); + List list = npYogurtInspService.selectNpYogurtInspList(npYogurtInsp); + return getDataTable(list); + } + + /** + * 导出酸奶生产,成品检疫记录列表 + */ + @PreAuthorize("@ss.hasPermi('yogurtTest:yogurtTest:export')") + @Log(title = "酸奶生产,成品检疫记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, NpYogurtInsp npYogurtInsp) + { + List list = npYogurtInspService.selectNpYogurtInspList(npYogurtInsp); + ExcelUtil util = new ExcelUtil(NpYogurtInsp.class); + util.exportExcel(response, list, "酸奶生产,成品检疫记录数据"); + } + + /** + * 获取酸奶生产,成品检疫记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('yogurtTest:yogurtTest:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(npYogurtInspService.selectNpYogurtInspById(id)); + } + + /** + * 新增酸奶生产,成品检疫记录 + */ + @PreAuthorize("@ss.hasPermi('yogurtTest:yogurtTest:add')") + @Log(title = "酸奶生产,成品检疫记录", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody NpYogurtInsp npYogurtInsp) + { + return toAjax(npYogurtInspService.insertNpYogurtInsp(npYogurtInsp)); + } + + /** + * 修改酸奶生产,成品检疫记录 + */ + @PreAuthorize("@ss.hasPermi('yogurtTest:yogurtTest:edit')") + @Log(title = "酸奶生产,成品检疫记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody NpYogurtInsp npYogurtInsp) + { + return toAjax(npYogurtInspService.updateNpYogurtInsp(npYogurtInsp)); + } + + /** + * 删除酸奶生产,成品检疫记录 + */ + @PreAuthorize("@ss.hasPermi('yogurtTest:yogurtTest:remove')") + @Log(title = "酸奶生产,成品检疫记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(npYogurtInspService.deleteNpYogurtInspByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/controller/RanchController.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/controller/RanchController.java new file mode 100644 index 0000000..9447a07 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/controller/RanchController.java @@ -0,0 +1,23 @@ +package com.zhyc.module.dairyProducts.controller; + +import com.zhyc.common.core.controller.BaseController; +import com.zhyc.common.core.domain.AjaxResult; +import com.zhyc.module.dairyProducts.domain.Ranch; +import com.zhyc.module.dairyProducts.service.IRanchService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@RestController +@RequestMapping("/dairyProducts/ranch") +public class RanchController extends BaseController { + + @Autowired + private IRanchService ranchService; + + @GetMapping("/list") + public AjaxResult list() { + return success(ranchService.selectAllRanch()); + } +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/controller/XzDryMatterCorrectionController.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/controller/XzDryMatterCorrectionController.java new file mode 100644 index 0000000..bca0801 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/controller/XzDryMatterCorrectionController.java @@ -0,0 +1,104 @@ +package com.zhyc.module.dairyProducts.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.domain.XzDryMatterCorrection; +import com.zhyc.module.dairyProducts.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 +{ + @Autowired + private IXzDryMatterCorrectionService xzDryMatterCorrectionService; + + /** + * 查询干物质校正列表 + */ + @PreAuthorize("@ss.hasPermi('dryMatterCorrection:dryMatterCorrection:list')") + @GetMapping("/list") + public TableDataInfo list(XzDryMatterCorrection xzDryMatterCorrection) + { + startPage(); + 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) + { + 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) + { + return success(xzDryMatterCorrectionService.selectXzDryMatterCorrectionById(id)); + } + + /** + * 新增干物质校正 + */ + @PreAuthorize("@ss.hasPermi('dryMatterCorrection:dryMatterCorrection:add')") + @Log(title = "干物质校正", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody XzDryMatterCorrection xzDryMatterCorrection) + { + return toAjax(xzDryMatterCorrectionService.insertXzDryMatterCorrection(xzDryMatterCorrection)); + } + + /** + * 修改干物质校正 + */ + @PreAuthorize("@ss.hasPermi('dryMatterCorrection:dryMatterCorrection:edit')") + @Log(title = "干物质校正", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody XzDryMatterCorrection xzDryMatterCorrection) + { + return toAjax(xzDryMatterCorrectionService.updateXzDryMatterCorrection(xzDryMatterCorrection)); + } + + /** + * 删除干物质校正 + */ + @PreAuthorize("@ss.hasPermi('dryMatterCorrection:dryMatterCorrection:remove')") + @Log(title = "干物质校正", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(xzDryMatterCorrectionService.deleteXzDryMatterCorrectionByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/controller/XzParityCorrectionController.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/controller/XzParityCorrectionController.java new file mode 100644 index 0000000..ee52381 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/controller/XzParityCorrectionController.java @@ -0,0 +1,112 @@ +package com.zhyc.module.dairyProducts.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.domain.XzParityCorrection; +import com.zhyc.module.dairyProducts.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); +// } + /** + * 获取全部胎次校正(无需分页,供下拉/列表直接显示) + */ + @GetMapping("/listAll") + public AjaxResult listAll(XzParityCorrection xzParityCorrection){ + List list = xzParityCorrectionService.selectXzParityCorrectionList(xzParityCorrection); + return success(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/controller/XzWegihCorrectionController.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/controller/XzWegihCorrectionController.java new file mode 100644 index 0000000..ace94f9 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/controller/XzWegihCorrectionController.java @@ -0,0 +1,105 @@ +package com.zhyc.module.dairyProducts.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.zhyc.module.dairyProducts.domain.XzWegihCorrection; +import com.zhyc.module.dairyProducts.service.IXzWegihCorrectionService; +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-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/domain/NpFreshMilkInsp.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/domain/NpFreshMilkInsp.java new file mode 100644 index 0000000..64e71f6 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/domain/NpFreshMilkInsp.java @@ -0,0 +1,90 @@ +package com.zhyc.module.dairyProducts.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 鲜奶生产,成品检验记录对象 np_fresh_milk_insp + * + * @author ruoyi + * @date 2025-07-18 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class NpFreshMilkInsp extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + /** 来源 */ + @Excel(name = "来源") + private String source; + + /** 检测日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "检测日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date datetime; + + /** 脂肪g/100g */ + @Excel(name = "脂肪g/100g") + private Double fat; + + /** 蛋白质g/100g */ + @Excel(name = "蛋白质g/100g") + private Double protein; + + /** 非脂g/100g */ + @Excel(name = "非脂g/100g") + private Double nonFat; + + /** 酸度oT */ + @Excel(name = "酸度oT") + private Double acidity; + + /** 菌落总数CFU/ml_1 */ + @Excel(name = "菌落总数CFU/ml_1") + private Double bacterialColony1; + + /** 菌落总数CFU/ml_2 */ + @Excel(name = "菌落总数CFU/ml_2") + private Double bacterialColony2; + + /** 菌落总数CFU/ml_3 */ + @Excel(name = "菌落总数CFU/ml_3") + private Double bacterialColony3; + + /** 菌落总数CFU/ml_4 */ + @Excel(name = "菌落总数CFU/ml_4") + private Double bacterialColony4; + + /** 菌落总数CFU/ml_5 */ + @Excel(name = "菌落总数CFU/ml_5") + private Double bacterialColony5; + + /** 大肠菌群CFU/ml */ + @Excel(name = "大肠菌群CFU/ml") + private Double coli; + + /** 乳铁蛋白(mg/L) */ + @Excel(name = "乳铁蛋白", readConverterExp = "m=g/L") + private Double lactoferrin; + + /** 免疫球蛋白(mg/l) */ + @Excel(name = "免疫球蛋白", readConverterExp = "m=g/l") + private Double ig; + + /** 备注 */ + @Excel(name = "备注") + private String commnet; + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/domain/NpMilkInOutStore.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/domain/NpMilkInOutStore.java new file mode 100644 index 0000000..770ace1 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/domain/NpMilkInOutStore.java @@ -0,0 +1,128 @@ +package com.zhyc.module.dairyProducts.domain; + +import java.math.BigDecimal; +import java.util.Date; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +public class NpMilkInOutStore extends BaseEntity { + private Integer id; + + @Excel(name = "日期") + private Date datetime; + + @Excel(name = "羊数") + private Integer num; + + @Excel(name = "初乳羊") + private Integer colostSheep; + + @Excel(name = "商乳入库") + private BigDecimal commercialIntake; + + @Excel(name = "抗乳入库") + private BigDecimal antiIntake; + + @Excel(name = "初乳入库") + private BigDecimal colostIntake; + + @Excel(name = "入库小计") + private BigDecimal intakeTotal; + + @Excel(name = "商乳实验用奶") + private BigDecimal commercialTest; + + @Excel(name = "初乳实验用奶") + private BigDecimal colostTest; + + @Excel(name = "商乳调拨出库") + private BigDecimal transferCommercial; + + @Excel(name = "抗乳调拨出库") + private BigDecimal transferAnti; + + @Excel(name = "初乳调拨出库") + private BigDecimal transferColost; + + @Excel(name = "调拨小计") + private BigDecimal transferTotal; + + @Excel(name = "损耗") + private BigDecimal loss; + + @Excel(name = "商乳库存") + private BigDecimal stockCommercial; + + @Excel(name = "抗乳库存") + private BigDecimal stockAnti; + + @Excel(name = "初乳库存") + private BigDecimal colost; + + @Excel(name = "爱特退回鲜奶") + private BigDecimal returnFresh; + + @Excel(name = "爱特退回酸奶") + private BigDecimal returnYogurt; + + // --- getters and setters --- + public Integer getId() { return id; } + public void setId(Integer id) { this.id = id; } + + public Date getDatetime() { return datetime; } + public void setDatetime(Date datetime) { this.datetime = datetime; } + + public Integer getNum() { return num; } + public void setNum(Integer num) { this.num = num; } + + public Integer getColostSheep() { return colostSheep; } + public void setColostSheep(Integer colostSheep) { this.colostSheep = colostSheep; } + + public BigDecimal getCommercialIntake() { return commercialIntake; } + public void setCommercialIntake(BigDecimal commercialIntake) { this.commercialIntake = commercialIntake; } + + public BigDecimal getAntiIntake() { return antiIntake; } + public void setAntiIntake(BigDecimal antiIntake) { this.antiIntake = antiIntake; } + + public BigDecimal getColostIntake() { return colostIntake; } + public void setColostIntake(BigDecimal colostIntake) { this.colostIntake = colostIntake; } + + public BigDecimal getIntakeTotal() { return intakeTotal; } + public void setIntakeTotal(BigDecimal intakeTotal) { this.intakeTotal = intakeTotal; } + + public BigDecimal getCommercialTest() { return commercialTest; } + public void setCommercialTest(BigDecimal commercialTest) { this.commercialTest = commercialTest; } + + public BigDecimal getColostTest() { return colostTest; } + public void setColostTest(BigDecimal colostTest) { this.colostTest = colostTest; } + + public BigDecimal getTransferCommercial() { return transferCommercial; } + public void setTransferCommercial(BigDecimal transferCommercial) { this.transferCommercial = transferCommercial; } + + public BigDecimal getTransferAnti() { return transferAnti; } + public void setTransferAnti(BigDecimal transferAnti) { this.transferAnti = transferAnti; } + + public BigDecimal getTransferColost() { return transferColost; } + public void setTransferColost(BigDecimal transferColost) { this.transferColost = transferColost; } + + public BigDecimal getTransferTotal() { return transferTotal; } + public void setTransferTotal(BigDecimal transferTotal) { this.transferTotal = transferTotal; } + + public BigDecimal getLoss() { return loss; } + public void setLoss(BigDecimal loss) { this.loss = loss; } + + public BigDecimal getStockCommercial() { return stockCommercial; } + public void setStockCommercial(BigDecimal stockCommercial) { this.stockCommercial = stockCommercial; } + + public BigDecimal getStockAnti() { return stockAnti; } + public void setStockAnti(BigDecimal stockAnti) { this.stockAnti = stockAnti; } + + public BigDecimal getColost() { return colost; } + public void setColost(BigDecimal colost) { this.colost = colost; } + + public BigDecimal getReturnFresh() { return returnFresh; } + public void setReturnFresh(BigDecimal returnFresh) { this.returnFresh = returnFresh; } + + public BigDecimal getReturnYogurt() { return returnYogurt; } + public void setReturnYogurt(BigDecimal returnYogurt) { this.returnYogurt = returnYogurt; } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/domain/NpMilkProdClasses.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/domain/NpMilkProdClasses.java new file mode 100644 index 0000000..19e2ce9 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/domain/NpMilkProdClasses.java @@ -0,0 +1,80 @@ +package com.zhyc.module.dairyProducts.domain; + +import java.io.Serializable; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.zhyc.common.annotation.Excel; + + + +public class NpMilkProdClasses implements Serializable { + private static final long serialVersionUID = 1L; + + private Long id; // 主键ID + private Date createTime; // 创建时间 + private Date updateTime; // 更新时间 + + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "日期") + private Date datetime; + + @Excel(name = "管理耳号") + private String manageEarNo; + + @Excel(name = "电子耳号") + private String electronicEarNo; + + @Excel(name = "胎次") + private Integer parity; + + @Excel(name = "厂区") + private String factory; + + @Excel(name = "班次") + private Integer classes; + + @Excel(name = "班次产奶量") + private Double milk; + + @Excel(name = "班次校正奶量") + private Double correctedMilk; + + private String sheepId; + + // Getters and Setters + public Long getId() { return id; } + public void setId(Long id) { this.id = id; } + + public Date getCreateTime() { return createTime; } + public void setCreateTime(Date createTime) { this.createTime = createTime; } + + public Date getUpdateTime() { return updateTime; } + public void setUpdateTime(Date updateTime) { this.updateTime = updateTime; } + + public Date getDatetime() { return datetime; } + public void setDatetime(Date datetime) { this.datetime = datetime; } + + public String getManageEarNo() { return manageEarNo; } + public void setManageEarNo(String manageEarNo) { this.manageEarNo = manageEarNo; } + + public String getElectronicEarNo() { return electronicEarNo; } + public void setElectronicEarNo(String electronicEarNo) { this.electronicEarNo = electronicEarNo; } + + public Integer getParity() { return parity; } + public void setParity(Integer parity) { this.parity = parity; } + + public String getFactory() { return factory; } + public void setFactory(String factory) { this.factory = factory; } + + public Integer getClasses() { return classes; } + public void setClasses(Integer classes) { this.classes = classes; } + + public Double getMilk() { return milk; } + public void setMilk(Double milk) { this.milk = milk; } + + public Double getCorrectedMilk() { return correctedMilk; } + public void setCorrectedMilk(Double correctedMilk) { this.correctedMilk = correctedMilk; } + + public String getSheepId() { return sheepId; } + public void setSheepId(String sheepId) { this.sheepId = sheepId; } +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/domain/NpRawMilkInspe.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/domain/NpRawMilkInspe.java new file mode 100644 index 0000000..0c71d35 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/domain/NpRawMilkInspe.java @@ -0,0 +1,456 @@ +//package com.zhyc.module.dairyProducts.rawMilkTest.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; +// +///** +// * 生乳检验记录对象 np_raw_milk_inspe +// * +// * @author ruoyi +// * @date 2025-07-15 +// */ +//public class NpRawMilkInspe 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 source; +// +// /** 冰点(摄氏度) */ +// @Excel(name = "冰点", readConverterExp = "摄=氏度") +// private Double freeze; +// +// /** 相对密度(20摄氏度/40摄氏度) */ +// @Excel(name = "相对密度", readConverterExp = "2=0摄氏度/40摄氏度") +// private Double density; +// +// /** 脂肪g/100g */ +// @Excel(name = "脂肪g/100g") +// private Double fat; +// +// /** 蛋白质g/100g */ +// @Excel(name = "蛋白质g/100g") +// private Double protein; +// +// /** 非脂g/100g */ +// @Excel(name = "非脂g/100g") +// private Double nonFat; +// +// /** 干物质mg/100g */ +// @Excel(name = "干物质mg/100g") +// private Double dryMatter; +// +// /** 杂物质mg/100g */ +// @Excel(name = "杂物质mg/100g") +// private Double impurity; +// +// /** 乳糖g/100g */ +// @Excel(name = "乳糖g/100g") +// private Double lactose; +// +// /** 灰度g/100g */ +// @Excel(name = "灰度g/100g") +// private Double ashContent; +// +// /** 酸度 */ +// @Excel(name = "酸度") +// private Double acidity; +// +// /** ph */ +// @Excel(name = "ph") +// private Double ph; +// +// /** 菌落总数(CFU/g) */ +// @Excel(name = "菌落总数", readConverterExp = "C=FU/g") +// private Double bacterialColony; +// +// /** 乳铁蛋白(mg/L) */ +// @Excel(name = "乳铁蛋白", readConverterExp = "m=g/L") +// private Double lactoferrin; +// +// /** 免疫球蛋白(mg/L) */ +// @Excel(name = "免疫球蛋白", readConverterExp = "m=g/L") +// private Double ig; +// +// /** 体细胞(scc/ml) */ +// @Excel(name = "体细胞", readConverterExp = "s=cc/ml") +// private Double somaticCell; +// +// /** 尿素氮 */ +// @Excel(name = "尿素氮") +// private Double usea; +// +// /** 脂蛋比 */ +// @Excel(name = "脂蛋比") +// private Double fatRatio; +// +// /** 备注 */ +// @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 setSource(String source) +// { +// this.source = source; +// } +// +// public String getSource() +// { +// return source; +// } +// +// public void setFreeze(Double freeze) +// { +// this.freeze = freeze; +// } +// +// public Double getFreeze() +// { +// return freeze; +// } +// +// public void setDensity(Double density) +// { +// this.density = density; +// } +// +// public Double getDensity() +// { +// return density; +// } +// +// public void setFat(Double fat) +// { +// this.fat = fat; +// } +// +// public Double getFat() +// { +// return fat; +// } +// +// public void setProtein(Double protein) +// { +// this.protein = protein; +// } +// +// public Double getProtein() +// { +// return protein; +// } +// +// public void setNonFat(Double nonFat) +// { +// this.nonFat = nonFat; +// } +// +// public Double getNonFat() +// { +// return nonFat; +// } +// +// public void setDryMatter(Double dryMatter) +// { +// this.dryMatter = dryMatter; +// } +// +// public Double getDryMatter() +// { +// return dryMatter; +// } +// +// public void setImpurity(Double impurity) +// { +// this.impurity = impurity; +// } +// +// public Double getImpurity() +// { +// return impurity; +// } +// +// public void setLactose(Double lactose) +// { +// this.lactose = lactose; +// } +// +// public Double getLactose() +// { +// return lactose; +// } +// +// public void setAshContent(Double ashContent) +// { +// this.ashContent = ashContent; +// } +// +// public Double getAshContent() +// { +// return ashContent; +// } +// +// public void setAcidity(Double acidity) +// { +// this.acidity = acidity; +// } +// +// public Double getAcidity() +// { +// return acidity; +// } +// +// public void setPh(Double ph) +// { +// this.ph = ph; +// } +// +// public Double getPh() +// { +// return ph; +// } +// +// public void setBacterialColony(Double bacterialColony) +// { +// this.bacterialColony = bacterialColony; +// } +// +// public Double getBacterialColony() +// { +// return bacterialColony; +// } +// +// public void setLactoferrin(Double lactoferrin) +// { +// this.lactoferrin = lactoferrin; +// } +// +// public Double getLactoferrin() +// { +// return lactoferrin; +// } +// +// public void setIg(Double ig) +// { +// this.ig = ig; +// } +// +// public Double getIg() +// { +// return ig; +// } +// +// public void setSomaticCell(Double somaticCell) +// { +// this.somaticCell = somaticCell; +// } +// +// public Double getSomaticCell() +// { +// return somaticCell; +// } +// +// public void setUsea(Double usea) +// { +// this.usea = usea; +// } +// +// public Double getUsea() +// { +// return usea; +// } +// +// public void setFatRatio(Double fatRatio) +// { +// this.fatRatio = fatRatio; +// } +// +// public Double getFatRatio() +// { +// return fatRatio; +// } +// +// 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("source", getSource()) +// .append("freeze", getFreeze()) +// .append("density", getDensity()) +// .append("fat", getFat()) +// .append("protein", getProtein()) +// .append("nonFat", getNonFat()) +// .append("dryMatter", getDryMatter()) +// .append("impurity", getImpurity()) +// .append("lactose", getLactose()) +// .append("ashContent", getAshContent()) +// .append("acidity", getAcidity()) +// .append("ph", getPh()) +// .append("bacterialColony", getBacterialColony()) +// .append("lactoferrin", getLactoferrin()) +// .append("ig", getIg()) +// .append("somaticCell", getSomaticCell()) +// .append("usea", getUsea()) +// .append("fatRatio", getFatRatio()) +// .append("comment", getComment()) +// .append("createBy", getCreateBy()) +// .append("createTime", getCreateTime()) +// .toString(); +// } +//} +package com.zhyc.module.dairyProducts.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 生乳检验记录对象 np_raw_milk_inspe + * + * @author ruoyi + * @date 2025-07-15 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class NpRawMilkInspe 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 source; + + /** 冰点(摄氏度) */ + @Excel(name = "冰点", readConverterExp = "摄=氏度") + private Double freeze; + + /** 相对密度(20摄氏度/40摄氏度) */ + @Excel(name = "相对密度", readConverterExp = "2=0摄氏度/40摄氏度") + private Double density; + + /** 脂肪g/100g */ + @Excel(name = "脂肪g/100g") + private Double fat; + + /** 蛋白质g/100g */ + @Excel(name = "蛋白质g/100g") + private Double protein; + + /** 非脂g/100g */ + @Excel(name = "非脂g/100g") + private Double nonFat; + + /** 干物质mg/100g */ + @Excel(name = "干物质mg/100g") + private Double dryMatter; + + /** 杂质度mg/100g */ + @Excel(name = "杂质度mg/100g") + private Double impurityDegree; + + /** 乳糖g/100g */ + @Excel(name = "乳糖g/100g") + private Double lactose; + + /** 灰度g/100g */ + @Excel(name = "灰度g/100g") + private Double ashContent; + + /** 酸度 */ + @Excel(name = "酸度") + private Double acidity; + + /** ph */ + @Excel(name = "ph") + private Double ph; + + /** 菌落总数(CFU/g) */ + @Excel(name = "菌落总数", readConverterExp = "C=FU/g") + private Double bacterialColony; + + /** 乳铁蛋白(mg/L) */ + @Excel(name = "乳铁蛋白", readConverterExp = "m=g/L") + private Double lactoferrin; + + /** 免疫球蛋白(mg/L) */ + @Excel(name = "免疫球蛋白", readConverterExp = "m=g/L") + private Double ig; + + /** 体细胞(scc/ml) */ + @Excel(name = "体细胞", readConverterExp = "s=cc/ml") + private Double somaticCell; + + /** 尿素氮 */ + @Excel(name = "尿素氮") + private Double usea; + + /** 脂蛋比 */ + @Excel(name = "脂蛋比") + private Double fatRatio; + + /** 备注 */ + @Excel(name = "备注") + private String comment; + + /** 创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/domain/NpSheepMilkAnalysis.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/domain/NpSheepMilkAnalysis.java new file mode 100644 index 0000000..05972f6 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/domain/NpSheepMilkAnalysis.java @@ -0,0 +1,162 @@ +package com.zhyc.module.dairyProducts.domain; + +import java.util.Date; +public class NpSheepMilkAnalysis { + private String sheepId; + private String manageEarTag; + private String variety; + private Date milkingStartTime; + private Date dryEndTime; + private Integer milkingDays; + private Integer analysisDays; + private Integer maxParity; + private Double sumSystemMilk; + private Double sumCorrectedMilk; + private Double avgCorrectedDaily; + private Double sumParity1Milk; + private Double sumParity2Milk; + private Double sumParity3Milk; + private Double sumParity4Milk; + private Double avgParity1Daily; + private Double avgParity2Daily; + private Double avgParity3Daily; + private Double avgParity4Daily; + private Integer lactationDays; + private Double avgLast7Milk; + private Double avgLast7Corrected; + private Double avgLast14Milk; + private Double avgLast30Milk; + private String sheepCategory; + private Date birthday; + private Integer parity; + private Integer monthAge; + private Double currentWeight; + private String breedStatus; + private String fatherManageTags; + private String motherManageTags; + private String ranchName; + private String family; + private Integer motherMilkingDays; + private Double motherSumCorrected; + private Integer motherMaxParity; + private Double motherAvgCorrectedDaily; + private Date lastUpdate; + + public String getSheepId() { return sheepId; } + public void setSheepId(String sheepId) { this.sheepId = sheepId; } + + public String getManageEarTag() { return manageEarTag; } + public void setManageEarTag(String manageEarTag) { this.manageEarTag = manageEarTag; } + + public String getVariety() { return variety; } + public void setVariety(String variety) { this.variety = variety; } + + public Date getMilkingStartTime() { return milkingStartTime; } + public void setMilkingStartTime(Date milkingStartTime) { this.milkingStartTime = milkingStartTime; } + + public Date getDryEndTime() { return dryEndTime; } + public void setDryEndTime(Date dryEndTime) { this.dryEndTime = dryEndTime; } + + public Integer getMilkingDays() { return milkingDays; } + public void setMilkingDays(Integer milkingDays) { this.milkingDays = milkingDays; } + + public Integer getAnalysisDays() { return analysisDays; } + public void setAnalysisDays(Integer analysisDays) { this.analysisDays = analysisDays; } + + public Integer getMaxParity() { return maxParity; } + public void setMaxParity(Integer maxParity) { this.maxParity = maxParity; } + + public Double getSumSystemMilk() { return sumSystemMilk; } + public void setSumSystemMilk(Double sumSystemMilk) { this.sumSystemMilk = sumSystemMilk; } + + public Double getSumCorrectedMilk() { return sumCorrectedMilk; } + public void setSumCorrectedMilk(Double sumCorrectedMilk) { this.sumCorrectedMilk = sumCorrectedMilk; } + + public Double getAvgCorrectedDaily() { return avgCorrectedDaily; } + public void setAvgCorrectedDaily(Double avgCorrectedDaily) { this.avgCorrectedDaily = avgCorrectedDaily; } + + public Double getSumParity1Milk() { return sumParity1Milk; } + public void setSumParity1Milk(Double sumParity1Milk) { this.sumParity1Milk = sumParity1Milk; } + + public Double getSumParity2Milk() { return sumParity2Milk; } + public void setSumParity2Milk(Double sumParity2Milk) { this.sumParity2Milk = sumParity2Milk; } + + public Double getSumParity3Milk() { return sumParity3Milk; } + public void setSumParity3Milk(Double sumParity3Milk) { this.sumParity3Milk = sumParity3Milk; } + + public Double getSumParity4Milk() { return sumParity4Milk; } + public void setSumParity4Milk(Double sumParity4Milk) { this.sumParity4Milk = sumParity4Milk; } + + public Double getAvgParity1Daily() { return avgParity1Daily; } + public void setAvgParity1Daily(Double avgParity1Daily) { this.avgParity1Daily = avgParity1Daily; } + + public Double getAvgParity2Daily() { return avgParity2Daily; } + public void setAvgParity2Daily(Double avgParity2Daily) { this.avgParity2Daily = avgParity2Daily; } + + public Double getAvgParity3Daily() { return avgParity3Daily; } + public void setAvgParity3Daily(Double avgParity3Daily) { this.avgParity3Daily = avgParity3Daily; } + + public Double getAvgParity4Daily() { return avgParity4Daily; } + public void setAvgParity4Daily(Double avgParity4Daily) { this.avgParity4Daily = avgParity4Daily; } + + public Integer getLactationDays() { return lactationDays; } + public void setLactationDays(Integer lactationDays) { this.lactationDays = lactationDays; } + + public Double getAvgLast7Milk() { return avgLast7Milk; } + public void setAvgLast7Milk(Double avgLast7Milk) { this.avgLast7Milk = avgLast7Milk; } + + public Double getAvgLast7Corrected() { return avgLast7Corrected; } + public void setAvgLast7Corrected(Double avgLast7Corrected) { this.avgLast7Corrected = avgLast7Corrected; } + + public Double getAvgLast14Milk() { return avgLast14Milk; } + public void setAvgLast14Milk(Double avgLast14Milk) { this.avgLast14Milk = avgLast14Milk; } + + public Double getAvgLast30Milk() { return avgLast30Milk; } + public void setAvgLast30Milk(Double avgLast30Milk) { this.avgLast30Milk = avgLast30Milk; } + + public String getSheepCategory() { return sheepCategory; } + public void setSheepCategory(String sheepCategory) { this.sheepCategory = sheepCategory; } + + public Date getBirthday() { return birthday; } + public void setBirthday(Date birthday) { this.birthday = birthday; } + + public Integer getParity() { return parity; } + public void setParity(Integer parity) { this.parity = parity; } + + public Integer getMonthAge() { return monthAge; } + public void setMonthAge(Integer monthAge) { this.monthAge = monthAge; } + + public Double getCurrentWeight() { return currentWeight; } + public void setCurrentWeight(Double currentWeight) { this.currentWeight = currentWeight; } + + public String getBreedStatus() { return breedStatus; } + public void setBreedStatus(String breedStatus) { this.breedStatus = breedStatus; } + + public String getFatherManageTags() { return fatherManageTags; } + public void setFatherManageTags(String fatherManageTags) { this.fatherManageTags = fatherManageTags; } + + public String getMotherManageTags() { return motherManageTags; } + public void setMotherManageTags(String motherManageTags) { this.motherManageTags = motherManageTags; } + + public String getRanchName() { return ranchName; } + public void setRanchName(String ranchName) { this.ranchName = ranchName; } + + public String getFamily() { return family; } + public void setFamily(String family) { this.family = family; } + + public Integer getMotherMilkingDays() { return motherMilkingDays; } + public void setMotherMilkingDays(Integer motherMilkingDays) { this.motherMilkingDays = motherMilkingDays; } + + public Double getMotherSumCorrected() { return motherSumCorrected; } + public void setMotherSumCorrected(Double motherSumCorrected) { this.motherSumCorrected = motherSumCorrected; } + + public Integer getMotherMaxParity() { return motherMaxParity; } + public void setMotherMaxParity(Integer motherMaxParity) { this.motherMaxParity = motherMaxParity; } + + public Double getMotherAvgCorrectedDaily() { return motherAvgCorrectedDaily; } + public void setMotherAvgCorrectedDaily(Double motherAvgCorrectedDaily) { this.motherAvgCorrectedDaily = motherAvgCorrectedDaily; } + + public Date getLastUpdate() { return lastUpdate; } + public void setLastUpdate(Date lastUpdate) { this.lastUpdate = lastUpdate; } +} + diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/domain/NpYogurtInsp.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/domain/NpYogurtInsp.java new file mode 100644 index 0000000..e284508 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/domain/NpYogurtInsp.java @@ -0,0 +1,91 @@ +package com.zhyc.module.dairyProducts.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 酸奶生产,成品检疫记录对象 np_yogurt_insp + * + * @author ruoyi + * @date 2025-07-17 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class NpYogurtInsp extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + /** 来源 */ + @Excel(name = "来源") + private String source; + + /** 检测日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "检测日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date datetime; + + /** 脂肪g/100g */ + @Excel(name = "脂肪g/100g") + private Double fat; + + /** 蛋白质g/100g */ + @Excel(name = "蛋白质g/100g") + private Double protein; + + /** 非脂g/100g + */ + @Excel(name = "非脂g/100g") + private Double nonFat; + + /** 酸度oT */ + @Excel(name = "酸度oT") + private Double acidity; + + /** 菌落总数(CFU/g)_1 */ + @Excel(name = "菌落总数", readConverterExp = "C=FU/g") + private Double bacterialColony1; + + /** 菌落总数(CFU/g)_2 */ + @Excel(name = "菌落总数", readConverterExp = "C=FU/g") + private Double bacterialClony2; + + /** 菌落总数(CFU/g)_3 */ + @Excel(name = "菌落总数", readConverterExp = "C=FU/g") + private Double bacterialClony3; + + /** 菌落总数(CFU/g)_4 */ + @Excel(name = "菌落总数", readConverterExp = "C=FU/g") + private Double bacterialClony4; + + /** 菌落总数(CFU/g)_5 */ + @Excel(name = "菌落总数", readConverterExp = "C=FU/g") + private Double bacterialClony5; + + /** 酵母菌(CFU/g) */ + @Excel(name = "酵母菌(CFU/g)") + private Double yeast; + + /** 霉菌(CFU/g) */ + @Excel(name = "霉菌", readConverterExp = "C=FU/g") + private Double mould; + + /** 乳酸菌数(CFU/g) */ + @Excel(name = "乳酸菌数", readConverterExp = "C=FU/g") + private Double lacto; + + /** 备注 */ + @Excel(name = "备注") + private String comment; + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/domain/Ranch.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/domain/Ranch.java new file mode 100644 index 0000000..7486310 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/domain/Ranch.java @@ -0,0 +1,12 @@ +package com.zhyc.module.dairyProducts.domain; + +public class Ranch { + private String ranchCode; + private String ranchName; + + public String getRanchCode() { return ranchCode; } + public void setRanchCode(String ranchCode) { this.ranchCode = ranchCode; } + + public String getRanchName() { return ranchName; } + public void setRanchName(String ranchName) { this.ranchName = ranchName; } +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/domain/XzDryMatterCorrection.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/domain/XzDryMatterCorrection.java new file mode 100644 index 0000000..a211abb --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/domain/XzDryMatterCorrection.java @@ -0,0 +1,37 @@ +package com.zhyc.module.dairyProducts.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +@Data +@NoArgsConstructor +@AllArgsConstructor +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; + +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/domain/XzParityCorrection.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/domain/XzParityCorrection.java new file mode 100644 index 0000000..d1a93e6 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/domain/XzParityCorrection.java @@ -0,0 +1,35 @@ +package com.zhyc.module.dairyProducts.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 胎次校正对象 xz_parity_correction + * + * @author ruoyi + * @date 2025-07-14 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +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; + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/domain/XzWegihCorrection.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/domain/XzWegihCorrection.java new file mode 100644 index 0000000..6bba703 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/domain/XzWegihCorrection.java @@ -0,0 +1,51 @@ +package com.zhyc.module.dairyProducts.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 称重校正对象 xz_wegih_correction + * + * @author ruoyi + * @date 2025-07-12 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +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; + + +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/mapper/NpFreshMilkInspMapper.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/mapper/NpFreshMilkInspMapper.java new file mode 100644 index 0000000..bb5ca20 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/mapper/NpFreshMilkInspMapper.java @@ -0,0 +1,63 @@ +package com.zhyc.module.dairyProducts.mapper; + +import java.util.List; +import com.zhyc.module.dairyProducts.domain.NpFreshMilkInsp; +import org.apache.ibatis.annotations.Mapper; + +/** + * 鲜奶生产,成品检验记录Mapper接口 + * + * @author ruoyi + * @date 2025-07-18 + */ +@Mapper +public interface NpFreshMilkInspMapper +{ + /** + * 查询鲜奶生产,成品检验记录 + * + * @param id 鲜奶生产,成品检验记录主键 + * @return 鲜奶生产,成品检验记录 + */ + public NpFreshMilkInsp selectNpFreshMilkInspById(Long id); + + /** + * 查询鲜奶生产,成品检验记录列表 + * + * @param npFreshMilkInsp 鲜奶生产,成品检验记录 + * @return 鲜奶生产,成品检验记录集合 + */ + public List selectNpFreshMilkInspList(NpFreshMilkInsp npFreshMilkInsp); + + /** + * 新增鲜奶生产,成品检验记录 + * + * @param npFreshMilkInsp 鲜奶生产,成品检验记录 + * @return 结果 + */ + public int insertNpFreshMilkInsp(NpFreshMilkInsp npFreshMilkInsp); + + /** + * 修改鲜奶生产,成品检验记录 + * + * @param npFreshMilkInsp 鲜奶生产,成品检验记录 + * @return 结果 + */ + public int updateNpFreshMilkInsp(NpFreshMilkInsp npFreshMilkInsp); + + /** + * 删除鲜奶生产,成品检验记录 + * + * @param id 鲜奶生产,成品检验记录主键 + * @return 结果 + */ + public int deleteNpFreshMilkInspById(Long id); + + /** + * 批量删除鲜奶生产,成品检验记录 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteNpFreshMilkInspByIds(Long[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/mapper/NpMilkInOutStoreMapper.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/mapper/NpMilkInOutStoreMapper.java new file mode 100644 index 0000000..aa4ed29 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/mapper/NpMilkInOutStoreMapper.java @@ -0,0 +1,23 @@ +package com.zhyc.module.dairyProducts.mapper; + +import com.zhyc.module.dairyProducts.domain.NpMilkInOutStore; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +public interface NpMilkInOutStoreMapper { + List> selectWithColumns( + @Param("start") Date start, @Param("end") Date end, + @Param("feedSources") List feedSources, + @Param("saleDestinations") List saleDestinations + ); + int insertStore(NpMilkInOutStore store); + void insertFeedRecord(@Param("storeId") Integer storeId, @Param("source") String source, @Param("amount") java.math.BigDecimal amount); + void insertSaleRecord(@Param("storeId") Integer storeId, @Param("destination") String dest, @Param("amount") java.math.BigDecimal amount); + + List selectFeedSources(); + List selectSaleDestinations(); +} + diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/mapper/NpMilkProdClassesMapper.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/mapper/NpMilkProdClassesMapper.java new file mode 100644 index 0000000..82a3238 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/mapper/NpMilkProdClassesMapper.java @@ -0,0 +1,25 @@ +package com.zhyc.module.dairyProducts.mapper; + +import org.apache.ibatis.annotations.Param; +import com.zhyc.module.dairyProducts.domain.NpMilkProdClasses; +import java.util.Date; +import java.util.List; + +public interface NpMilkProdClassesMapper { + List selectNpMilkProdClassesList( + @Param("datetimeStart") Date datetimeStart, + @Param("datetimeEnd") Date datetimeEnd, + @Param("manageEarNo") String manageEarNo, + @Param("factory") String factory, + @Param("classes") Integer classes); + + int insertNpMilkProdClasses(NpMilkProdClasses row); + + String selectSheepIdByManageEarNo(@Param("manageEarNo") String manageEarNo); + + Double getWeightCorrection(@Param("date") Date date, @Param("factory") String factory); + + Double getParityCorrection(@Param("parity") Integer parity); + + Double getDryMatterCorrection(@Param("date") Date date, @Param("factory") String factory); +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/mapper/NpRawMilkInspeMapper.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/mapper/NpRawMilkInspeMapper.java new file mode 100644 index 0000000..8b455ba --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/mapper/NpRawMilkInspeMapper.java @@ -0,0 +1,63 @@ +package com.zhyc.module.dairyProducts.mapper; + +import java.util.List; +import com.zhyc.module.dairyProducts.domain.NpRawMilkInspe; +import org.apache.ibatis.annotations.Mapper; + +/** + * 生乳检验记录Mapper接口 + * + * @author ruoyi + * @date 2025-07-15 + */ +@Mapper +public interface NpRawMilkInspeMapper +{ + /** + * 查询生乳检验记录 + * + * @param id 生乳检验记录主键 + * @return 生乳检验记录 + */ + public NpRawMilkInspe selectNpRawMilkInspeById(Long id); + + /** + * 查询生乳检验记录列表 + * + * @param npRawMilkInspe 生乳检验记录 + * @return 生乳检验记录集合 + */ + public List selectNpRawMilkInspeList(NpRawMilkInspe npRawMilkInspe); + + /** + * 新增生乳检验记录 + * + * @param npRawMilkInspe 生乳检验记录 + * @return 结果 + */ + public int insertNpRawMilkInspe(NpRawMilkInspe npRawMilkInspe); + + /** + * 修改生乳检验记录 + * + * @param npRawMilkInspe 生乳检验记录 + * @return 结果 + */ + public int updateNpRawMilkInspe(NpRawMilkInspe npRawMilkInspe); + + /** + * 删除生乳检验记录 + * + * @param id 生乳检验记录主键 + * @return 结果 + */ + public int deleteNpRawMilkInspeById(Long id); + + /** + * 批量删除生乳检验记录 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteNpRawMilkInspeByIds(Long[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/mapper/NpSheepMilkAnalysisMapper.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/mapper/NpSheepMilkAnalysisMapper.java new file mode 100644 index 0000000..f330707 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/mapper/NpSheepMilkAnalysisMapper.java @@ -0,0 +1,19 @@ +package com.zhyc.module.dairyProducts.mapper; + +import com.zhyc.module.dairyProducts.domain.NpSheepMilkAnalysis; +import java.util.List; + +public interface NpSheepMilkAnalysisMapper { + + NpSheepMilkAnalysis selectNpSheepMilkAnalysisById(Long id); + + List selectNpSheepMilkAnalysisList(NpSheepMilkAnalysis analysis); + + int insertNpSheepMilkAnalysis(NpSheepMilkAnalysis analysis); + + int updateNpSheepMilkAnalysis(NpSheepMilkAnalysis analysis); + + int deleteNpSheepMilkAnalysisById(Long id); + + int deleteNpSheepMilkAnalysisByIds(Long[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/mapper/NpYogurtInspMapper.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/mapper/NpYogurtInspMapper.java new file mode 100644 index 0000000..5a736d7 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/mapper/NpYogurtInspMapper.java @@ -0,0 +1,64 @@ +package com.zhyc.module.dairyProducts.mapper; + +import java.util.List; + +import com.zhyc.module.dairyProducts.domain.NpYogurtInsp; +import org.apache.ibatis.annotations.Mapper; + +/** + * 酸奶生产,成品检疫记录Mapper接口 + * + * @author ruoyi + * @date 2025-07-17 + */ +@Mapper +public interface NpYogurtInspMapper +{ + /** + * 查询酸奶生产,成品检疫记录 + * + * @param id 酸奶生产,成品检疫记录主键 + * @return 酸奶生产,成品检疫记录 + */ + public NpYogurtInsp selectNpYogurtInspById(Long id); + + /** + * 查询酸奶生产,成品检疫记录列表 + * + * @param npYogurtInsp 酸奶生产,成品检疫记录 + * @return 酸奶生产,成品检疫记录集合 + */ + public List selectNpYogurtInspList(NpYogurtInsp npYogurtInsp); + + /** + * 新增酸奶生产,成品检疫记录 + * + * @param npYogurtInsp 酸奶生产,成品检疫记录 + * @return 结果 + */ + public int insertNpYogurtInsp(NpYogurtInsp npYogurtInsp); + + /** + * 修改酸奶生产,成品检疫记录 + * + * @param npYogurtInsp 酸奶生产,成品检疫记录 + * @return 结果 + */ + public int updateNpYogurtInsp(NpYogurtInsp npYogurtInsp); + + /** + * 删除酸奶生产,成品检疫记录 + * + * @param id 酸奶生产,成品检疫记录主键 + * @return 结果 + */ + public int deleteNpYogurtInspById(Long id); + + /** + * 批量删除酸奶生产,成品检疫记录 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteNpYogurtInspByIds(Long[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/mapper/RanchMapper.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/mapper/RanchMapper.java new file mode 100644 index 0000000..a234521 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/mapper/RanchMapper.java @@ -0,0 +1,10 @@ +package com.zhyc.module.dairyProducts.mapper; + +import com.zhyc.module.dairyProducts.domain.Ranch; +import org.apache.ibatis.annotations.Select; +import java.util.List; + +public interface RanchMapper { + @Select("SELECT ranch AS ranchName, ranch AS ranchCode FROM da_ranch") + List selectAllRanch(); +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/mapper/XzDryMatterCorrectionMapper.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/mapper/XzDryMatterCorrectionMapper.java new file mode 100644 index 0000000..b84955b --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/mapper/XzDryMatterCorrectionMapper.java @@ -0,0 +1,63 @@ +package com.zhyc.module.dairyProducts.mapper; + +import java.util.List; +import com.zhyc.module.dairyProducts.domain.XzDryMatterCorrection; +import org.apache.ibatis.annotations.Mapper; + +/** + * 干物质校正Mapper接口 + * + * @author ruoyi + * @date 2025-07-12 + */ +@Mapper +public interface XzDryMatterCorrectionMapper +{ + /** + * 查询干物质校正 + * + * @param id 干物质校正主键 + * @return 干物质校正 + */ + public XzDryMatterCorrection selectXzDryMatterCorrectionById(Long id); + + /** + * 查询干物质校正列表 + * + * @param xzDryMatterCorrection 干物质校正 + * @return 干物质校正集合 + */ + public List selectXzDryMatterCorrectionList(XzDryMatterCorrection xzDryMatterCorrection); + + /** + * 新增干物质校正 + * + * @param xzDryMatterCorrection 干物质校正 + * @return 结果 + */ + public int insertXzDryMatterCorrection(XzDryMatterCorrection xzDryMatterCorrection); + + /** + * 修改干物质校正 + * + * @param xzDryMatterCorrection 干物质校正 + * @return 结果 + */ + public int updateXzDryMatterCorrection(XzDryMatterCorrection xzDryMatterCorrection); + + /** + * 删除干物质校正 + * + * @param id 干物质校正主键 + * @return 结果 + */ + public int deleteXzDryMatterCorrectionById(Long id); + + /** + * 批量删除干物质校正 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteXzDryMatterCorrectionByIds(Long[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/mapper/XzParityCorrectionMapper.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/mapper/XzParityCorrectionMapper.java new file mode 100644 index 0000000..d2f4654 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/mapper/XzParityCorrectionMapper.java @@ -0,0 +1,63 @@ +package com.zhyc.module.dairyProducts.mapper; + +import java.util.List; +import com.zhyc.module.dairyProducts.domain.XzParityCorrection; +import org.apache.ibatis.annotations.Mapper; + +/** + * 胎次校正Mapper接口 + * + * @author ruoyi + * @date 2025-07-14 + */ +@Mapper +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/mapper/XzWegihCorrectionMapper.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/mapper/XzWegihCorrectionMapper.java new file mode 100644 index 0000000..b6313bd --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/mapper/XzWegihCorrectionMapper.java @@ -0,0 +1,63 @@ +package com.zhyc.module.dairyProducts.mapper; + +import java.util.List; +import com.zhyc.module.dairyProducts.domain.XzWegihCorrection; +import org.apache.ibatis.annotations.Mapper; + +/** + * 称重校正Mapper接口 + * + * @author ruoyi + * @date 2025-07-12 + */ +@Mapper +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/service/INpFreshMilkInspService.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/INpFreshMilkInspService.java new file mode 100644 index 0000000..3f7c523 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/INpFreshMilkInspService.java @@ -0,0 +1,61 @@ +package com.zhyc.module.dairyProducts.service; + +import java.util.List; +import com.zhyc.module.dairyProducts.domain.NpFreshMilkInsp; + +/** + * 鲜奶生产,成品检验记录Service接口 + * + * @author ruoyi + * @date 2025-07-18 + */ +public interface INpFreshMilkInspService +{ + /** + * 查询鲜奶生产,成品检验记录 + * + * @param id 鲜奶生产,成品检验记录主键 + * @return 鲜奶生产,成品检验记录 + */ + public NpFreshMilkInsp selectNpFreshMilkInspById(Long id); + + /** + * 查询鲜奶生产,成品检验记录列表 + * + * @param npFreshMilkInsp 鲜奶生产,成品检验记录 + * @return 鲜奶生产,成品检验记录集合 + */ + public List selectNpFreshMilkInspList(NpFreshMilkInsp npFreshMilkInsp); + + /** + * 新增鲜奶生产,成品检验记录 + * + * @param npFreshMilkInsp 鲜奶生产,成品检验记录 + * @return 结果 + */ + public int insertNpFreshMilkInsp(NpFreshMilkInsp npFreshMilkInsp); + + /** + * 修改鲜奶生产,成品检验记录 + * + * @param npFreshMilkInsp 鲜奶生产,成品检验记录 + * @return 结果 + */ + public int updateNpFreshMilkInsp(NpFreshMilkInsp npFreshMilkInsp); + + /** + * 批量删除鲜奶生产,成品检验记录 + * + * @param ids 需要删除的鲜奶生产,成品检验记录主键集合 + * @return 结果 + */ + public int deleteNpFreshMilkInspByIds(Long[] ids); + + /** + * 删除鲜奶生产,成品检验记录信息 + * + * @param id 鲜奶生产,成品检验记录主键 + * @return 结果 + */ + public int deleteNpFreshMilkInspById(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/INpMilkInOutStoreService.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/INpMilkInOutStoreService.java new file mode 100644 index 0000000..992573a --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/INpMilkInOutStoreService.java @@ -0,0 +1,16 @@ +package com.zhyc.module.dairyProducts.service; + +import com.zhyc.module.dairyProducts.domain.NpMilkInOutStore; +import org.springframework.web.multipart.MultipartFile; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +public interface INpMilkInOutStoreService { + List> selectWithDynamicColumns(Date start, Date end); + List> getAllColumnOptions(); + List> parseImportExcel(MultipartFile file) throws Exception; + void batchInsertFromRows(List> rows) throws Exception; +} + diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/INpMilkProdClassesService.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/INpMilkProdClassesService.java new file mode 100644 index 0000000..b582994 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/INpMilkProdClassesService.java @@ -0,0 +1,16 @@ +package com.zhyc.module.dairyProducts.service; + +import java.util.Date; +import java.util.List; +import com.zhyc.module.dairyProducts.domain.NpMilkProdClasses; + +public interface INpMilkProdClassesService { + List selectNpMilkProdClassesList( + Date datetimeStart, + Date datetimeEnd, + String manageEarNo, // 改为单个 String + String factory, + Integer classes); + + int importMilkProdClasses(List list); +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/INpRawMilkInspeService.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/INpRawMilkInspeService.java new file mode 100644 index 0000000..dd12502 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/INpRawMilkInspeService.java @@ -0,0 +1,61 @@ +package com.zhyc.module.dairyProducts.service; + +import java.util.List; +import com.zhyc.module.dairyProducts.domain.NpRawMilkInspe; + +/** + * 生乳检验记录Service接口 + * + * @author ruoyi + * @date 2025-07-15 + */ +public interface INpRawMilkInspeService +{ + /** + * 查询生乳检验记录 + * + * @param id 生乳检验记录主键 + * @return 生乳检验记录 + */ + public NpRawMilkInspe selectNpRawMilkInspeById(Long id); + + /** + * 查询生乳检验记录列表 + * + * @param npRawMilkInspe 生乳检验记录 + * @return 生乳检验记录集合 + */ + public List selectNpRawMilkInspeList(NpRawMilkInspe npRawMilkInspe); + + /** + * 新增生乳检验记录 + * + * @param npRawMilkInspe 生乳检验记录 + * @return 结果 + */ + public int insertNpRawMilkInspe(NpRawMilkInspe npRawMilkInspe); + + /** + * 修改生乳检验记录 + * + * @param npRawMilkInspe 生乳检验记录 + * @return 结果 + */ + public int updateNpRawMilkInspe(NpRawMilkInspe npRawMilkInspe); + + /** + * 批量删除生乳检验记录 + * + * @param ids 需要删除的生乳检验记录主键集合 + * @return 结果 + */ + public int deleteNpRawMilkInspeByIds(Long[] ids); + + /** + * 删除生乳检验记录信息 + * + * @param id 生乳检验记录主键 + * @return 结果 + */ + public int deleteNpRawMilkInspeById(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/INpSheepMilkAnalysisService.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/INpSheepMilkAnalysisService.java new file mode 100644 index 0000000..7750a5f --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/INpSheepMilkAnalysisService.java @@ -0,0 +1,20 @@ +package com.zhyc.module.dairyProducts.service; + +import com.zhyc.module.dairyProducts.domain.NpSheepMilkAnalysis; +import java.util.List; + +public interface INpSheepMilkAnalysisService { + + NpSheepMilkAnalysis selectNpSheepMilkAnalysisById(Long id); + + List selectNpSheepMilkAnalysisList(NpSheepMilkAnalysis analysis); + + int insertNpSheepMilkAnalysis(NpSheepMilkAnalysis analysis); + + int updateNpSheepMilkAnalysis(NpSheepMilkAnalysis analysis); + + int deleteNpSheepMilkAnalysisById(Long id); + + int deleteNpSheepMilkAnalysisByIds(Long[] ids); +} + diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/INpYogurtInspService.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/INpYogurtInspService.java new file mode 100644 index 0000000..01582c4 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/INpYogurtInspService.java @@ -0,0 +1,62 @@ +package com.zhyc.module.dairyProducts.service; + +import java.util.List; + +import com.zhyc.module.dairyProducts.domain.NpYogurtInsp; + +/** + * 酸奶生产,成品检疫记录Service接口 + * + * @author ruoyi + * @date 2025-07-17 + */ +public interface INpYogurtInspService +{ + /** + * 查询酸奶生产,成品检疫记录 + * + * @param id 酸奶生产,成品检疫记录主键 + * @return 酸奶生产,成品检疫记录 + */ + public NpYogurtInsp selectNpYogurtInspById(Long id); + + /** + * 查询酸奶生产,成品检疫记录列表 + * + * @param npYogurtInsp 酸奶生产,成品检疫记录 + * @return 酸奶生产,成品检疫记录集合 + */ + public List selectNpYogurtInspList(NpYogurtInsp npYogurtInsp); + + /** + * 新增酸奶生产,成品检疫记录 + * + * @param npYogurtInsp 酸奶生产,成品检疫记录 + * @return 结果 + */ + public int insertNpYogurtInsp(NpYogurtInsp npYogurtInsp); + + /** + * 修改酸奶生产,成品检疫记录 + * + * @param npYogurtInsp 酸奶生产,成品检疫记录 + * @return 结果 + */ + public int updateNpYogurtInsp(NpYogurtInsp npYogurtInsp); + + /** + * 批量删除酸奶生产,成品检疫记录 + * + * @param ids 需要删除的酸奶生产,成品检疫记录主键集合 + * @return 结果 + */ + public int deleteNpYogurtInspByIds(Long[] ids); + + /** + * 删除酸奶生产,成品检疫记录信息 + * + * @param id 酸奶生产,成品检疫记录主键 + * @return 结果 + */ + public int deleteNpYogurtInspById(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/IRanchService.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/IRanchService.java new file mode 100644 index 0000000..15d3e1d --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/IRanchService.java @@ -0,0 +1,8 @@ +package com.zhyc.module.dairyProducts.service; + +import com.zhyc.module.dairyProducts.domain.Ranch; +import java.util.List; + +public interface IRanchService { + List selectAllRanch(); +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/IXzDryMatterCorrectionService.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/IXzDryMatterCorrectionService.java new file mode 100644 index 0000000..522d857 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/IXzDryMatterCorrectionService.java @@ -0,0 +1,61 @@ +package com.zhyc.module.dairyProducts.service; + +import java.util.List; +import com.zhyc.module.dairyProducts.domain.XzDryMatterCorrection; + +/** + * 干物质校正Service接口 + * + * @author ruoyi + * @date 2025-07-12 + */ +public interface IXzDryMatterCorrectionService +{ + /** + * 查询干物质校正 + * + * @param id 干物质校正主键 + * @return 干物质校正 + */ + public XzDryMatterCorrection selectXzDryMatterCorrectionById(Long id); + + /** + * 查询干物质校正列表 + * + * @param xzDryMatterCorrection 干物质校正 + * @return 干物质校正集合 + */ + public List selectXzDryMatterCorrectionList(XzDryMatterCorrection xzDryMatterCorrection); + + /** + * 新增干物质校正 + * + * @param xzDryMatterCorrection 干物质校正 + * @return 结果 + */ + public int insertXzDryMatterCorrection(XzDryMatterCorrection xzDryMatterCorrection); + + /** + * 修改干物质校正 + * + * @param xzDryMatterCorrection 干物质校正 + * @return 结果 + */ + public int updateXzDryMatterCorrection(XzDryMatterCorrection xzDryMatterCorrection); + + /** + * 批量删除干物质校正 + * + * @param ids 需要删除的干物质校正主键集合 + * @return 结果 + */ + public int deleteXzDryMatterCorrectionByIds(Long[] ids); + + /** + * 删除干物质校正信息 + * + * @param id 干物质校正主键 + * @return 结果 + */ + public int deleteXzDryMatterCorrectionById(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/IXzParityCorrectionService.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/IXzParityCorrectionService.java new file mode 100644 index 0000000..d5c9ce2 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/IXzParityCorrectionService.java @@ -0,0 +1,62 @@ +package com.zhyc.module.dairyProducts.service; + +import java.util.List; + +import com.zhyc.module.dairyProducts.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/service/IXzWegihCorrectionService.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/IXzWegihCorrectionService.java new file mode 100644 index 0000000..d24ed2b --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/IXzWegihCorrectionService.java @@ -0,0 +1,61 @@ +package com.zhyc.module.dairyProducts.service; + +import java.util.List; +import com.zhyc.module.dairyProducts.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/service/impl/NpFreshMilkInspServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/impl/NpFreshMilkInspServiceImpl.java new file mode 100644 index 0000000..cd59779 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/impl/NpFreshMilkInspServiceImpl.java @@ -0,0 +1,95 @@ +package com.zhyc.module.dairyProducts.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.dairyProducts.mapper.NpFreshMilkInspMapper; +import com.zhyc.module.dairyProducts.domain.NpFreshMilkInsp; +import com.zhyc.module.dairyProducts.service.INpFreshMilkInspService; + +/** + * 鲜奶生产,成品检验记录Service业务层处理 + * + * @author ruoyi + * @date 2025-07-18 + */ +@Service +public class NpFreshMilkInspServiceImpl implements INpFreshMilkInspService +{ + @Autowired + private NpFreshMilkInspMapper npFreshMilkInspMapper; + + /** + * 查询鲜奶生产,成品检验记录 + * + * @param id 鲜奶生产,成品检验记录主键 + * @return 鲜奶生产,成品检验记录 + */ + @Override + public NpFreshMilkInsp selectNpFreshMilkInspById(Long id) + { + return npFreshMilkInspMapper.selectNpFreshMilkInspById(id); + } + + /** + * 查询鲜奶生产,成品检验记录列表 + * + * @param npFreshMilkInsp 鲜奶生产,成品检验记录 + * @return 鲜奶生产,成品检验记录 + */ + @Override + public List selectNpFreshMilkInspList(NpFreshMilkInsp npFreshMilkInsp) + { + return npFreshMilkInspMapper.selectNpFreshMilkInspList(npFreshMilkInsp); + } + + /** + * 新增鲜奶生产,成品检验记录 + * + * @param npFreshMilkInsp 鲜奶生产,成品检验记录 + * @return 结果 + */ + @Override + public int insertNpFreshMilkInsp(NpFreshMilkInsp npFreshMilkInsp) + { + npFreshMilkInsp.setCreateTime(DateUtils.getNowDate()); + return npFreshMilkInspMapper.insertNpFreshMilkInsp(npFreshMilkInsp); + } + + /** + * 修改鲜奶生产,成品检验记录 + * + * @param npFreshMilkInsp 鲜奶生产,成品检验记录 + * @return 结果 + */ + @Override + public int updateNpFreshMilkInsp(NpFreshMilkInsp npFreshMilkInsp) + { + return npFreshMilkInspMapper.updateNpFreshMilkInsp(npFreshMilkInsp); + } + + /** + * 批量删除鲜奶生产,成品检验记录 + * + * @param ids 需要删除的鲜奶生产,成品检验记录主键 + * @return 结果 + */ + @Override + public int deleteNpFreshMilkInspByIds(Long[] ids) + { + return npFreshMilkInspMapper.deleteNpFreshMilkInspByIds(ids); + } + + /** + * 删除鲜奶生产,成品检验记录信息 + * + * @param id 鲜奶生产,成品检验记录主键 + * @return 结果 + */ + @Override + public int deleteNpFreshMilkInspById(Long id) + { + return npFreshMilkInspMapper.deleteNpFreshMilkInspById(id); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/impl/NpMilkInOutStoreServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/impl/NpMilkInOutStoreServiceImpl.java new file mode 100644 index 0000000..fc99d05 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/impl/NpMilkInOutStoreServiceImpl.java @@ -0,0 +1,82 @@ +package com.zhyc.module.dairyProducts.service.impl; + +import com.zhyc.module.dairyProducts.domain.NpMilkInOutStore; +import com.zhyc.module.dairyProducts.mapper.NpMilkInOutStoreMapper; +import com.zhyc.module.dairyProducts.service.INpMilkInOutStoreService; +import org.apache.poi.ss.usermodel.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; + +import java.io.InputStream; +import java.math.BigDecimal; +import java.util.*; + +@Service +public class NpMilkInOutStoreServiceImpl implements INpMilkInOutStoreService { + + @Autowired + private NpMilkInOutStoreMapper mapper; + + @Override + public List> selectWithDynamicColumns(Date start, Date end) { + List feed = mapper.selectFeedSources(); + List sale = mapper.selectSaleDestinations(); + return mapper.selectWithColumns(start, end, feed, sale); + } + + @Override + public List> getAllColumnOptions() { + Map m = new HashMap<>(); + m.put("feed", mapper.selectFeedSources()); + m.put("sale", mapper.selectSaleDestinations()); + return Collections.singletonList(m); + } + @Override + public List> parseImportExcel(MultipartFile file) throws Exception { + // 用 Apache POI 解析 Excel 第一行标题,动态映射列名跟 unit cells + InputStream in = file.getInputStream(); + Workbook wb = WorkbookFactory.create(in); + Sheet sheet = wb.getSheetAt(0); + Row header = sheet.getRow(0); + int cols = header.getLastCellNum(); + List titles = new ArrayList<>(); + for (int i = 0; i < cols; i++) titles.add(header.getCell(i).getStringCellValue()); + List> rows = new ArrayList<>(); + for (int r = 1; r <= sheet.getLastRowNum(); r++) { + Row row = sheet.getRow(r); + if (row == null) continue; + Map map = new LinkedHashMap<>(); + for (int c = 0; c < cols; c++) { + Cell cell = row.getCell(c); + map.put(titles.get(c), cell == null ? null : cell.toString()); + } + rows.add(map); + } + return rows; + } + + @Override + public void batchInsertFromRows(List> rows) throws Exception { + for (Map row : rows) { + // 提取主表字段 + NpMilkInOutStore store = new NpMilkInOutStore(); + store.setDatetime(java.sql.Date.valueOf(row.get("日期").toString())); + store.setNum(Integer.valueOf(row.get("羊数").toString())); + // ... 设置其它固定字段 ... + mapper.insertStore(store); + Integer sid = store.getId(); + // 其余列为动态饲喂或销售,根据字典决定分类: + for (Map.Entry ent: row.entrySet()) { + String col = ent.getKey(); + BigDecimal amt = new BigDecimal(ent.getValue().toString()); + if (mapper.selectFeedSources().contains(col)) { + mapper.insertFeedRecord(sid, col, amt); + } else if (mapper.selectSaleDestinations().contains(col)) { + mapper.insertSaleRecord(sid, col, amt); + } + } + } + } +} + diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/impl/NpMilkProdClassesServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/impl/NpMilkProdClassesServiceImpl.java new file mode 100644 index 0000000..1c26057 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/impl/NpMilkProdClassesServiceImpl.java @@ -0,0 +1,62 @@ +package com.zhyc.module.dairyProducts.service.impl; + +import com.zhyc.module.dairyProducts.domain.NpMilkProdClasses; +import com.zhyc.module.dairyProducts.mapper.NpMilkProdClassesMapper; +import com.zhyc.module.dairyProducts.service.INpMilkProdClassesService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +@Service +public class NpMilkProdClassesServiceImpl implements INpMilkProdClassesService { + + @Autowired + private NpMilkProdClassesMapper mapper; + + @Override + public List selectNpMilkProdClassesList(Date datetimeStart, Date datetimeEnd, + String manageEarNo, String factory, Integer classes) { + return mapper.selectNpMilkProdClassesList(datetimeStart, datetimeEnd, manageEarNo, factory, classes); + } + + @Override + public int importMilkProdClasses(List list) { + int count = 0; + for (NpMilkProdClasses item : list) { + // 根据管理耳号查 sheep_id + String sheepId = mapper.selectSheepIdByManageEarNo(item.getManageEarNo()); + if (sheepId == null) continue; + + item.setSheepId(sheepId); + + // 计算校正奶量 + Double correctedMilk = calculateCorrectedMilk(item); + item.setCorrectedMilk(correctedMilk); + + // 插入数据 + count += mapper.insertNpMilkProdClasses(item); + } + return count; + } + + private Double calculateCorrectedMilk(NpMilkProdClasses item) { + Double milk = item.getMilk(); + if (milk == null) return null; + + // 1. 称重矫正系数 + Double weightCorrection = mapper.getWeightCorrection(item.getDatetime(), item.getFactory()); + if (weightCorrection == null) weightCorrection = 1.0; + + // 2. 胎次矫正系数 + Double parityCorrection = mapper.getParityCorrection(item.getParity()); + if (parityCorrection == null) parityCorrection = 1.0; + + // 3. 干物质矫正系数 + Double dryMatterCorrection = mapper.getDryMatterCorrection(item.getDatetime(), item.getFactory()); + if (dryMatterCorrection == null) dryMatterCorrection = 1.0; + + return milk * weightCorrection * parityCorrection * dryMatterCorrection; + } +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/impl/NpRawMilkInspeServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/impl/NpRawMilkInspeServiceImpl.java new file mode 100644 index 0000000..3422dff --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/impl/NpRawMilkInspeServiceImpl.java @@ -0,0 +1,95 @@ +package com.zhyc.module.dairyProducts.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.dairyProducts.mapper.NpRawMilkInspeMapper; +import com.zhyc.module.dairyProducts.domain.NpRawMilkInspe; +import com.zhyc.module.dairyProducts.service.INpRawMilkInspeService; + +/** + * 生乳检验记录Service业务层处理 + * + * @author ruoyi + * @date 2025-07-15 + */ +@Service +public class NpRawMilkInspeServiceImpl implements INpRawMilkInspeService +{ + @Autowired + private NpRawMilkInspeMapper npRawMilkInspeMapper; + + /** + * 查询生乳检验记录 + * + * @param id 生乳检验记录主键 + * @return 生乳检验记录 + */ + @Override + public NpRawMilkInspe selectNpRawMilkInspeById(Long id) + { + return npRawMilkInspeMapper.selectNpRawMilkInspeById(id); + } + + /** + * 查询生乳检验记录列表 + * + * @param npRawMilkInspe 生乳检验记录 + * @return 生乳检验记录 + */ + @Override + public List selectNpRawMilkInspeList(NpRawMilkInspe npRawMilkInspe) + { + return npRawMilkInspeMapper.selectNpRawMilkInspeList(npRawMilkInspe); + } + + /** + * 新增生乳检验记录 + * + * @param npRawMilkInspe 生乳检验记录 + * @return 结果 + */ + @Override + public int insertNpRawMilkInspe(NpRawMilkInspe npRawMilkInspe) + { + npRawMilkInspe.setCreateTime(DateUtils.getNowDate()); + return npRawMilkInspeMapper.insertNpRawMilkInspe(npRawMilkInspe); + } + + /** + * 修改生乳检验记录 + * + * @param npRawMilkInspe 生乳检验记录 + * @return 结果 + */ + @Override + public int updateNpRawMilkInspe(NpRawMilkInspe npRawMilkInspe) + { + return npRawMilkInspeMapper.updateNpRawMilkInspe(npRawMilkInspe); + } + + /** + * 批量删除生乳检验记录 + * + * @param ids 需要删除的生乳检验记录主键 + * @return 结果 + */ + @Override + public int deleteNpRawMilkInspeByIds(Long[] ids) + { + return npRawMilkInspeMapper.deleteNpRawMilkInspeByIds(ids); + } + + /** + * 删除生乳检验记录信息 + * + * @param id 生乳检验记录主键 + * @return 结果 + */ + @Override + public int deleteNpRawMilkInspeById(Long id) + { + return npRawMilkInspeMapper.deleteNpRawMilkInspeById(id); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/impl/NpSheepMilkAnalysisServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/impl/NpSheepMilkAnalysisServiceImpl.java new file mode 100644 index 0000000..c2476ee --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/impl/NpSheepMilkAnalysisServiceImpl.java @@ -0,0 +1,47 @@ +package com.zhyc.module.dairyProducts.service.impl; + +import java.util.List; + +import com.zhyc.module.dairyProducts.mapper.NpSheepMilkAnalysisMapper; +import com.zhyc.module.dairyProducts.domain.NpSheepMilkAnalysis; +import com.zhyc.module.dairyProducts.service.INpSheepMilkAnalysisService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class NpSheepMilkAnalysisServiceImpl implements INpSheepMilkAnalysisService { + + @Autowired + private NpSheepMilkAnalysisMapper npSheepMilkAnalysisMapper; + + @Override + public NpSheepMilkAnalysis selectNpSheepMilkAnalysisById(Long id) { + return npSheepMilkAnalysisMapper.selectNpSheepMilkAnalysisById(id); + } + + @Override + public List selectNpSheepMilkAnalysisList(NpSheepMilkAnalysis analysis) { + return npSheepMilkAnalysisMapper.selectNpSheepMilkAnalysisList(analysis); + } + + @Override + public int insertNpSheepMilkAnalysis(NpSheepMilkAnalysis analysis) { + return npSheepMilkAnalysisMapper.insertNpSheepMilkAnalysis(analysis); + } + + @Override + public int updateNpSheepMilkAnalysis(NpSheepMilkAnalysis analysis) { + return npSheepMilkAnalysisMapper.updateNpSheepMilkAnalysis(analysis); + } + + @Override + public int deleteNpSheepMilkAnalysisById(Long id) { + return npSheepMilkAnalysisMapper.deleteNpSheepMilkAnalysisById(id); + } + + @Override + public int deleteNpSheepMilkAnalysisByIds(Long[] ids) { + return npSheepMilkAnalysisMapper.deleteNpSheepMilkAnalysisByIds(ids); + } +} + diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/impl/NpYogurtInspServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/impl/NpYogurtInspServiceImpl.java new file mode 100644 index 0000000..f80e745 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/impl/NpYogurtInspServiceImpl.java @@ -0,0 +1,95 @@ +package com.zhyc.module.dairyProducts.service.impl; + +import java.util.List; +import com.zhyc.common.utils.DateUtils; +import com.zhyc.module.dairyProducts.domain.NpYogurtInsp; +import com.zhyc.module.dairyProducts.mapper.NpYogurtInspMapper; +import com.zhyc.module.dairyProducts.service.INpYogurtInspService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * 酸奶生产,成品检疫记录Service业务层处理 + * + * @author ruoyi + * @date 2025-07-17 + */ +@Service +public class NpYogurtInspServiceImpl implements INpYogurtInspService +{ + @Autowired + private NpYogurtInspMapper npYogurtInspMapper; + + /** + * 查询酸奶生产,成品检疫记录 + * + * @param id 酸奶生产,成品检疫记录主键 + * @return 酸奶生产,成品检疫记录 + */ + @Override + public NpYogurtInsp selectNpYogurtInspById(Long id) + { + return npYogurtInspMapper.selectNpYogurtInspById(id); + } + + /** + * 查询酸奶生产,成品检疫记录列表 + * + * @param npYogurtInsp 酸奶生产,成品检疫记录 + * @return 酸奶生产,成品检疫记录 + */ + @Override + public List selectNpYogurtInspList(NpYogurtInsp npYogurtInsp) + { + return npYogurtInspMapper.selectNpYogurtInspList(npYogurtInsp); + } + + /** + * 新增酸奶生产,成品检疫记录 + * + * @param npYogurtInsp 酸奶生产,成品检疫记录 + * @return 结果 + */ + @Override + public int insertNpYogurtInsp(NpYogurtInsp npYogurtInsp) + { + npYogurtInsp.setCreateTime(DateUtils.getNowDate()); + return npYogurtInspMapper.insertNpYogurtInsp(npYogurtInsp); + } + + /** + * 修改酸奶生产,成品检疫记录 + * + * @param npYogurtInsp 酸奶生产,成品检疫记录 + * @return 结果 + */ + @Override + public int updateNpYogurtInsp(NpYogurtInsp npYogurtInsp) + { + return npYogurtInspMapper.updateNpYogurtInsp(npYogurtInsp); + } + + /** + * 批量删除酸奶生产,成品检疫记录 + * + * @param ids 需要删除的酸奶生产,成品检疫记录主键 + * @return 结果 + */ + @Override + public int deleteNpYogurtInspByIds(Long[] ids) + { + return npYogurtInspMapper.deleteNpYogurtInspByIds(ids); + } + + /** + * 删除酸奶生产,成品检疫记录信息 + * + * @param id 酸奶生产,成品检疫记录主键 + * @return 结果 + */ + @Override + public int deleteNpYogurtInspById(Long id) + { + return npYogurtInspMapper.deleteNpYogurtInspById(id); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/impl/RanchServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/impl/RanchServiceImpl.java new file mode 100644 index 0000000..281d32e --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/impl/RanchServiceImpl.java @@ -0,0 +1,19 @@ +package com.zhyc.module.dairyProducts.service.impl; + +import com.zhyc.module.dairyProducts.domain.Ranch; +import com.zhyc.module.dairyProducts.mapper.RanchMapper; +import com.zhyc.module.dairyProducts.service.IRanchService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import java.util.List; + +@Service +public class RanchServiceImpl implements IRanchService { + @Autowired + private RanchMapper ranchMapper; + + @Override + public List selectAllRanch() { + return ranchMapper.selectAllRanch(); + } +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/impl/XzDryMatterCorrectionServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/impl/XzDryMatterCorrectionServiceImpl.java new file mode 100644 index 0000000..4bf9fb2 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/impl/XzDryMatterCorrectionServiceImpl.java @@ -0,0 +1,93 @@ +package com.zhyc.module.dairyProducts.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.zhyc.module.dairyProducts.mapper.XzDryMatterCorrectionMapper; +import com.zhyc.module.dairyProducts.domain.XzDryMatterCorrection; +import com.zhyc.module.dairyProducts.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/service/impl/XzParityCorrectionServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/impl/XzParityCorrectionServiceImpl.java new file mode 100644 index 0000000..49f5731 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/impl/XzParityCorrectionServiceImpl.java @@ -0,0 +1,94 @@ +package com.zhyc.module.dairyProducts.service.impl; + +import java.util.List; + +import com.zhyc.module.dairyProducts.mapper.XzParityCorrectionMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.zhyc.module.dairyProducts.domain.XzParityCorrection; +import com.zhyc.module.dairyProducts.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/service/impl/XzWegihCorrectionServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/impl/XzWegihCorrectionServiceImpl.java new file mode 100644 index 0000000..7869c42 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/service/impl/XzWegihCorrectionServiceImpl.java @@ -0,0 +1,94 @@ +package com.zhyc.module.dairyProducts.service.impl; + +import java.util.List; + +import com.zhyc.module.dairyProducts.domain.XzWegihCorrection; +import com.zhyc.module.dairyProducts.mapper.XzWegihCorrectionMapper; +import com.zhyc.module.dairyProducts.service.IXzWegihCorrectionService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * 称重校正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/produce/bodyManage/controller/ScBodyMeasureController.java b/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/controller/ScBodyMeasureController.java new file mode 100644 index 0000000..23ac1e1 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/controller/ScBodyMeasureController.java @@ -0,0 +1,107 @@ +package com.zhyc.module.produce.bodyManage.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.zhyc.common.utils.SecurityUtils; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +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.bodyManage.domain.ScBodyMeasure; +import com.zhyc.module.produce.bodyManage.service.IScBodyMeasureService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 体尺测量Controller + * + * @author ruoyi + * @date 2025-07-27 + */ +@RestController +@RequestMapping("/body_measure/body_measure") +public class ScBodyMeasureController extends BaseController +{ + @Autowired + private IScBodyMeasureService scBodyMeasureService; + + + /** + * 查询体尺测量列表 + */ + @PreAuthorize("@ss.hasPermi('body_measure:body_measure:list')") + @GetMapping("/list") + public TableDataInfo list(ScBodyMeasure scBodyMeasure) + { + startPage(); + List list = scBodyMeasureService.selectScBodyMeasureList(scBodyMeasure); + return getDataTable(list); + } + + /** + * 导出体尺测量列表 + */ + @PreAuthorize("@ss.hasPermi('body_measure:body_measure:export')") + @Log(title = "体尺测量", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, ScBodyMeasure scBodyMeasure) + { + List list = scBodyMeasureService.selectScBodyMeasureList(scBodyMeasure); + ExcelUtil util = new ExcelUtil(ScBodyMeasure.class); + util.exportExcel(response, list, "体尺测量数据"); + } + + /** + * 获取体尺测量详细信息 + */ + @PreAuthorize("@ss.hasPermi('body_measure:body_measure:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(scBodyMeasureService.selectScBodyMeasureById(id)); + } + + /** + * 新增体尺测量 + */ + @PreAuthorize("@ss.hasPermi('body_measure:body_measure:add')") + @Log(title = "体尺测量", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ScBodyMeasure scBodyMeasure) + { + return toAjax(scBodyMeasureService.insertScBodyMeasure(scBodyMeasure)); + } + + /** + * 修改体尺测量 + */ + @PreAuthorize("@ss.hasPermi('body_measure:body_measure:edit')") + @Log(title = "体尺测量", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ScBodyMeasure scBodyMeasure) + { + return toAjax(scBodyMeasureService.updateScBodyMeasure(scBodyMeasure)); + } + + /** + * 删除体尺测量 + */ + @PreAuthorize("@ss.hasPermi('body_measure:body_measure:remove')") + @Log(title = "体尺测量", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(scBodyMeasureService.deleteScBodyMeasureByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/controller/ScBodyScoreController.java b/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/controller/ScBodyScoreController.java new file mode 100644 index 0000000..d2438a7 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/controller/ScBodyScoreController.java @@ -0,0 +1,104 @@ +package com.zhyc.module.produce.bodyManage.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.bodyManage.domain.ScBodyScore; +import com.zhyc.module.produce.bodyManage.service.IScBodyScoreService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 体况评分Controller + * + * @author ruoyi + * @date 2025-07-27 + */ +@RestController +@RequestMapping("/body_score/body_score") +public class ScBodyScoreController extends BaseController +{ + @Autowired + private IScBodyScoreService scBodyScoreService; + + /** + * 查询体况评分列表 + */ + @PreAuthorize("@ss.hasPermi('body_score:body_score:list')") + @GetMapping("/list") + public TableDataInfo list(ScBodyScore scBodyScore) + { + startPage(); + List list = scBodyScoreService.selectScBodyScoreList(scBodyScore); + return getDataTable(list); + } + + /** + * 导出体况评分列表 + */ + @PreAuthorize("@ss.hasPermi('body_score:body_score:export')") + @Log(title = "体况评分", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, ScBodyScore scBodyScore) + { + List list = scBodyScoreService.selectScBodyScoreList(scBodyScore); + ExcelUtil util = new ExcelUtil(ScBodyScore.class); + util.exportExcel(response, list, "体况评分数据"); + } + + /** + * 获取体况评分详细信息 + */ + @PreAuthorize("@ss.hasPermi('body_score:body_score:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(scBodyScoreService.selectScBodyScoreById(id)); + } + + /** + * 新增体况评分 + */ + @PreAuthorize("@ss.hasPermi('body_score:body_score:add')") + @Log(title = "体况评分", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ScBodyScore scBodyScore) + { + return toAjax(scBodyScoreService.insertScBodyScore(scBodyScore)); + } + + /** + * 修改体况评分 + */ + @PreAuthorize("@ss.hasPermi('body_score:body_score:edit')") + @Log(title = "体况评分", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ScBodyScore scBodyScore) + { + return toAjax(scBodyScoreService.updateScBodyScore(scBodyScore)); + } + + /** + * 删除体况评分 + */ + @PreAuthorize("@ss.hasPermi('body_score:body_score:remove')") + @Log(title = "体况评分", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(scBodyScoreService.deleteScBodyScoreByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/controller/ScBreastRatingController.java b/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/controller/ScBreastRatingController.java new file mode 100644 index 0000000..e6a9cad --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/controller/ScBreastRatingController.java @@ -0,0 +1,104 @@ +package com.zhyc.module.produce.bodyManage.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.bodyManage.domain.ScBreastRating; +import com.zhyc.module.produce.bodyManage.service.IScBreastRatingService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 乳房评分Controller + * + * @author ruoyi + * @date 2025-07-27 + */ +@RestController +@RequestMapping("/breast_rating/breast_rating") +public class ScBreastRatingController extends BaseController +{ + @Autowired + private IScBreastRatingService scBreastRatingService; + + /** + * 查询乳房评分列表 + */ + @PreAuthorize("@ss.hasPermi('breast_rating:breast_rating:list')") + @GetMapping("/list") + public TableDataInfo list(ScBreastRating scBreastRating) + { + startPage(); + List list = scBreastRatingService.selectScBreastRatingList(scBreastRating); + return getDataTable(list); + } + + /** + * 导出乳房评分列表 + */ + @PreAuthorize("@ss.hasPermi('breast_rating:breast_rating:export')") + @Log(title = "乳房评分", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, ScBreastRating scBreastRating) + { + List list = scBreastRatingService.selectScBreastRatingList(scBreastRating); + ExcelUtil util = new ExcelUtil(ScBreastRating.class); + util.exportExcel(response, list, "乳房评分数据"); + } + + /** + * 获取乳房评分详细信息 + */ + @PreAuthorize("@ss.hasPermi('breast_rating:breast_rating:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(scBreastRatingService.selectScBreastRatingById(id)); + } + + /** + * 新增乳房评分 + */ + @PreAuthorize("@ss.hasPermi('breast_rating:breast_rating:add')") + @Log(title = "乳房评分", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ScBreastRating scBreastRating) + { + return toAjax(scBreastRatingService.insertScBreastRating(scBreastRating)); + } + + /** + * 修改乳房评分 + */ + @PreAuthorize("@ss.hasPermi('breast_rating:breast_rating:edit')") + @Log(title = "乳房评分", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ScBreastRating scBreastRating) + { + return toAjax(scBreastRatingService.updateScBreastRating(scBreastRating)); + } + + /** + * 删除乳房评分 + */ + @PreAuthorize("@ss.hasPermi('breast_rating:breast_rating:remove')") + @Log(title = "乳房评分", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(scBreastRatingService.deleteScBreastRatingByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/domain/ScBodyMeasure.java b/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/domain/ScBodyMeasure.java new file mode 100644 index 0000000..cf9e617 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/domain/ScBodyMeasure.java @@ -0,0 +1,189 @@ +package com.zhyc.module.produce.bodyManage.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; +import org.springframework.data.annotation.AccessType; + +import java.math.BigDecimal; +import java.time.LocalDate; + +/** + * 体尺测量对象 sc_body_measure + * + * @author ruoyi + * @date 2025-07-27 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class ScBodyMeasure extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * $column.columnComment + */ + private Long id; + + /** + * 耳号 + */ + private Long sheepId; + @Excel(name = "耳号") + private String manageTags; + + /** + * 羊舍ID + */ + private Long sheepfoldId; + @Excel(name = "羊舍") + /** 羊舍名称(用于展示) */ + private String sheepfoldName; + + /** + * 品种ID(关联羊只表) + */ + private Long varietyId; + + /** + * 品种名称(用于展示) + */ + @Excel(name = "羊只品种") + private String varietyName; + + /** + * 事件类型 + */ + @Excel(name = "事件类型") + private String eventType; + + /** + * 测量日期 + */ + @Excel(name = "测量日期") + private LocalDate measureDate; + /** + * 羊只类别 + */ + private Long sheepTypeId; + @Excel(name = "羊只类别") + private String sheepTypeName; + /** + * 性别 + */ + @Excel(name = "性别", readConverterExp = "1=母,2=公,3=阉羊") + private String gender; + /** + * 胎次 + */ + private Integer parity; + /** + * 出生体重 + */ + private BigDecimal birthWeight; + /** + * 断奶体重 + */ + private BigDecimal weaningWeight; + /** + * 当前体重 + */ + private BigDecimal currentWeight; + + /** + * 体高 + */ + @Excel(name = "体高") + private Long height; + + /** + * 胸围 + */ + @Excel(name = "胸围") + private Long bust; + + /** + * 体斜长 + */ + @Excel(name = "体斜长") + private Long bodyLength; + + /** + * 管围 + */ + @Excel(name = "管围") + private Long pipeLength; + + /** + * 胸深 + */ + @Excel(name = "胸深") + private Long chestDepth; + + /** + * 臀高 + */ + @Excel(name = "臀高") + private Long hipHeight; + + /** + * 尻宽 + */ + @Excel(name = "尻宽") + private Long rumpWidth; + + /** + * 尻高 + */ + @Excel(name = "尻高") + private Long rumpHeignt; + + /** + * 腰角宽 + */ + @Excel(name = "腰角宽") + private Long hipWidth; + + /** + * 十字部高 + */ + @Excel(name = "十字部高") + private Long hipCrossHeight; + + /** + * 繁育状态 + */ + @Excel(name = "繁育状态") + private String breedStatusName; + /** + * 泌乳天数 + */ + @Excel(name = "泌乳天数") + private Integer lactationDay; + /** + * 怀孕天数 + */ + @Excel(name = "怀孕天数") + private Integer gestationDay; + /** + * 配后天数 + */ + @Excel(name = "配后天数") + private Integer postMatingDay; + /** + * 备注 + */ + @Excel(name = "备注") + private String comment; + + /** + * 技术员 + */ + @Excel(name = "技术员") + private String technician; + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/domain/ScBodyScore.java b/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/domain/ScBodyScore.java new file mode 100644 index 0000000..005eb4b --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/domain/ScBodyScore.java @@ -0,0 +1,82 @@ +package com.zhyc.module.produce.bodyManage.domain; + +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 体况评分对象 sc_body_score + * + * @author ruoyi + * @date 2025-07-27 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class ScBodyScore extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * $column.columnComment + */ + private Long id; + + /** + * 羊只id + */ + private String sheepId; + @Excel(name = "管理耳号") + private String manageTags; + + /** + * 品种 + */ + private Long varietyId; + @Excel(name = "品种") + private String varietyName; + + /** + * 事件类型 + */ + @Excel(name = "事件类型") + private String eventType; + + /** + * 事件日期 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "事件日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date datetime; + + /** + * 体况评分 + */ + @Excel(name = "体况评分") + private Long score; + + /** + * 羊舍id + */ + private Long sheepfold; + @Excel(name = "羊舍") + private String sheepfoldName; + /** + * 备注 + */ + @Excel(name = "备注") + private String comment; + + /** + * 技术员 + */ + @Excel(name = "技术员") + private String technician; + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/domain/ScBreastRating.java b/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/domain/ScBreastRating.java new file mode 100644 index 0000000..3699f57 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/domain/ScBreastRating.java @@ -0,0 +1,116 @@ +package com.zhyc.module.produce.bodyManage.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +import java.time.LocalDate; + +/** + * 乳房评分对象 sc_breast_rating + * + * @author ruoyi + * @date 2025-07-27 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class ScBreastRating extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * $column.columnComment + */ + private Long id; + + /** + * 羊只id + */ + + private String sheepId; + @Excel(name = "羊只id") + private String manageTags; + + /** + * 品种 + */ + private Long varietyId; + @Excel(name = "品种") + private String varietyName; + + /** + * 事件类型 + */ + @Excel(name = "事件类型") + private String eventType; + + /** + * 事件日期 + */ + @Excel(name = "事件日期") + private LocalDate eventDate; + + /** + * 羊舍ID + */ + private Long sheepfoldId; + @Excel(name = "羊舍") + /** 羊舍名称(用于展示) */ + private String sheepfoldName; + + + /** + * 乳房深度 + */ + @Excel(name = "乳房深度") + private Long depth; + + /** + * 乳房长度 + */ + @Excel(name = "乳房长度") + private Long length; + + /** + * 乳房位置 + */ + @Excel(name = "乳房位置") + private String position; + + /** + * 乳房附着 + */ + @Excel(name = "乳房附着") + private String adbere; + + /** + * 乳房间隔度 + */ + @Excel(name = "乳房间隔度") + private String spacing; + + /** + * 乳房评分 + */ + @Excel(name = "乳房评分") + private Long score; + + /** + * 备注 + */ + @Excel(name = "备注") + private String comment; + + /** + * 技术员 + */ + @Excel(name = "技术员") + private String technician; + + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/mapper/ScBodyMeasureMapper.java b/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/mapper/ScBodyMeasureMapper.java new file mode 100644 index 0000000..7566ff1 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/mapper/ScBodyMeasureMapper.java @@ -0,0 +1,61 @@ +package com.zhyc.module.produce.bodyManage.mapper; + +import java.util.List; +import com.zhyc.module.produce.bodyManage.domain.ScBodyMeasure; + +/** + * 体尺测量Mapper接口 + * + * @author ruoyi + * @date 2025-07-27 + */ +public interface ScBodyMeasureMapper +{ + /** + * 查询体尺测量 + * + * @param id 体尺测量主键 + * @return 体尺测量 + */ + public ScBodyMeasure selectScBodyMeasureById(Long id); + + /** + * 查询体尺测量列表 + * + * @param scBodyMeasure 体尺测量 + * @return 体尺测量集合 + */ + public List selectScBodyMeasureList(ScBodyMeasure scBodyMeasure); + + /** + * 新增体尺测量 + * + * @param scBodyMeasure 体尺测量 + * @return 结果 + */ + public int insertScBodyMeasure(ScBodyMeasure scBodyMeasure); + + /** + * 修改体尺测量 + * + * @param scBodyMeasure 体尺测量 + * @return 结果 + */ + public int updateScBodyMeasure(ScBodyMeasure scBodyMeasure); + + /** + * 删除体尺测量 + * + * @param id 体尺测量主键 + * @return 结果 + */ + public int deleteScBodyMeasureById(Long id); + + /** + * 批量删除体尺测量 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteScBodyMeasureByIds(Long[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/mapper/ScBodyScoreMapper.java b/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/mapper/ScBodyScoreMapper.java new file mode 100644 index 0000000..1e7a4e6 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/mapper/ScBodyScoreMapper.java @@ -0,0 +1,61 @@ +package com.zhyc.module.produce.bodyManage.mapper; + +import java.util.List; +import com.zhyc.module.produce.bodyManage.domain.ScBodyScore; + +/** + * 体况评分Mapper接口 + * + * @author ruoyi + * @date 2025-07-27 + */ +public interface ScBodyScoreMapper +{ + /** + * 查询体况评分 + * + * @param id 体况评分主键 + * @return 体况评分 + */ + public ScBodyScore selectScBodyScoreById(Long id); + + /** + * 查询体况评分列表 + * + * @param scBodyScore 体况评分 + * @return 体况评分集合 + */ + public List selectScBodyScoreList(ScBodyScore scBodyScore); + + /** + * 新增体况评分 + * + * @param scBodyScore 体况评分 + * @return 结果 + */ + public int insertScBodyScore(ScBodyScore scBodyScore); + + /** + * 修改体况评分 + * + * @param scBodyScore 体况评分 + * @return 结果 + */ + public int updateScBodyScore(ScBodyScore scBodyScore); + + /** + * 删除体况评分 + * + * @param id 体况评分主键 + * @return 结果 + */ + public int deleteScBodyScoreById(Long id); + + /** + * 批量删除体况评分 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteScBodyScoreByIds(Long[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/mapper/ScBreastRatingMapper.java b/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/mapper/ScBreastRatingMapper.java new file mode 100644 index 0000000..485043a --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/mapper/ScBreastRatingMapper.java @@ -0,0 +1,61 @@ +package com.zhyc.module.produce.bodyManage.mapper; + +import java.util.List; +import com.zhyc.module.produce.bodyManage.domain.ScBreastRating; + +/** + * 乳房评分Mapper接口 + * + * @author ruoyi + * @date 2025-07-27 + */ +public interface ScBreastRatingMapper +{ + /** + * 查询乳房评分 + * + * @param id 乳房评分主键 + * @return 乳房评分 + */ + public ScBreastRating selectScBreastRatingById(Long id); + + /** + * 查询乳房评分列表 + * + * @param scBreastRating 乳房评分 + * @return 乳房评分集合 + */ + public List selectScBreastRatingList(ScBreastRating scBreastRating); + + /** + * 新增乳房评分 + * + * @param scBreastRating 乳房评分 + * @return 结果 + */ + public int insertScBreastRating(ScBreastRating scBreastRating); + + /** + * 修改乳房评分 + * + * @param scBreastRating 乳房评分 + * @return 结果 + */ + public int updateScBreastRating(ScBreastRating scBreastRating); + + /** + * 删除乳房评分 + * + * @param id 乳房评分主键 + * @return 结果 + */ + public int deleteScBreastRatingById(Long id); + + /** + * 批量删除乳房评分 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteScBreastRatingByIds(Long[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/service/IScBodyMeasureService.java b/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/service/IScBodyMeasureService.java new file mode 100644 index 0000000..f86848f --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/service/IScBodyMeasureService.java @@ -0,0 +1,61 @@ +package com.zhyc.module.produce.bodyManage.service; + +import java.util.List; +import com.zhyc.module.produce.bodyManage.domain.ScBodyMeasure; + +/** + * 体尺测量Service接口 + * + * @author ruoyi + * @date 2025-07-27 + */ +public interface IScBodyMeasureService +{ + /** + * 查询体尺测量 + * + * @param id 体尺测量主键 + * @return 体尺测量 + */ + public ScBodyMeasure selectScBodyMeasureById(Long id); + + /** + * 查询体尺测量列表 + * + * @param scBodyMeasure 体尺测量 + * @return 体尺测量集合 + */ + public List selectScBodyMeasureList(ScBodyMeasure scBodyMeasure); + + /** + * 新增体尺测量 + * + * @param scBodyMeasure 体尺测量 + * @return 结果 + */ + public int insertScBodyMeasure(ScBodyMeasure scBodyMeasure); + + /** + * 修改体尺测量 + * + * @param scBodyMeasure 体尺测量 + * @return 结果 + */ + public int updateScBodyMeasure(ScBodyMeasure scBodyMeasure); + + /** + * 批量删除体尺测量 + * + * @param ids 需要删除的体尺测量主键集合 + * @return 结果 + */ + public int deleteScBodyMeasureByIds(Long[] ids); + + /** + * 删除体尺测量信息 + * + * @param id 体尺测量主键 + * @return 结果 + */ + public int deleteScBodyMeasureById(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/service/IScBodyScoreService.java b/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/service/IScBodyScoreService.java new file mode 100644 index 0000000..78ac57d --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/service/IScBodyScoreService.java @@ -0,0 +1,61 @@ +package com.zhyc.module.produce.bodyManage.service; + +import java.util.List; +import com.zhyc.module.produce.bodyManage.domain.ScBodyScore; + +/** + * 体况评分Service接口 + * + * @author ruoyi + * @date 2025-07-27 + */ +public interface IScBodyScoreService +{ + /** + * 查询体况评分 + * + * @param id 体况评分主键 + * @return 体况评分 + */ + public ScBodyScore selectScBodyScoreById(Long id); + + /** + * 查询体况评分列表 + * + * @param scBodyScore 体况评分 + * @return 体况评分集合 + */ + public List selectScBodyScoreList(ScBodyScore scBodyScore); + + /** + * 新增体况评分 + * + * @param scBodyScore 体况评分 + * @return 结果 + */ + public int insertScBodyScore(ScBodyScore scBodyScore); + + /** + * 修改体况评分 + * + * @param scBodyScore 体况评分 + * @return 结果 + */ + public int updateScBodyScore(ScBodyScore scBodyScore); + + /** + * 批量删除体况评分 + * + * @param ids 需要删除的体况评分主键集合 + * @return 结果 + */ + public int deleteScBodyScoreByIds(Long[] ids); + + /** + * 删除体况评分信息 + * + * @param id 体况评分主键 + * @return 结果 + */ + public int deleteScBodyScoreById(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/service/IScBreastRatingService.java b/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/service/IScBreastRatingService.java new file mode 100644 index 0000000..81b408f --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/service/IScBreastRatingService.java @@ -0,0 +1,61 @@ +package com.zhyc.module.produce.bodyManage.service; + +import java.util.List; +import com.zhyc.module.produce.bodyManage.domain.ScBreastRating; + +/** + * 乳房评分Service接口 + * + * @author ruoyi + * @date 2025-07-27 + */ +public interface IScBreastRatingService +{ + /** + * 查询乳房评分 + * + * @param id 乳房评分主键 + * @return 乳房评分 + */ + public ScBreastRating selectScBreastRatingById(Long id); + + /** + * 查询乳房评分列表 + * + * @param scBreastRating 乳房评分 + * @return 乳房评分集合 + */ + public List selectScBreastRatingList(ScBreastRating scBreastRating); + + /** + * 新增乳房评分 + * + * @param scBreastRating 乳房评分 + * @return 结果 + */ + public int insertScBreastRating(ScBreastRating scBreastRating); + + /** + * 修改乳房评分 + * + * @param scBreastRating 乳房评分 + * @return 结果 + */ + public int updateScBreastRating(ScBreastRating scBreastRating); + + /** + * 批量删除乳房评分 + * + * @param ids 需要删除的乳房评分主键集合 + * @return 结果 + */ + public int deleteScBreastRatingByIds(Long[] ids); + + /** + * 删除乳房评分信息 + * + * @param id 乳房评分主键 + * @return 结果 + */ + public int deleteScBreastRatingById(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/service/impl/ScBodyMeasureServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/service/impl/ScBodyMeasureServiceImpl.java new file mode 100644 index 0000000..985960e --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/service/impl/ScBodyMeasureServiceImpl.java @@ -0,0 +1,117 @@ +package com.zhyc.module.produce.bodyManage.service.impl; + +import java.util.List; +import com.zhyc.common.utils.DateUtils; +import com.zhyc.common.utils.SecurityUtils; +import com.zhyc.common.utils.StringUtils; +import com.zhyc.module.base.domain.BasSheep; +import com.zhyc.module.base.service.IBasSheepService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.zhyc.module.produce.bodyManage.mapper.ScBodyMeasureMapper; +import com.zhyc.module.produce.bodyManage.domain.ScBodyMeasure; +import com.zhyc.module.produce.bodyManage.service.IScBodyMeasureService; + +/** + * 体尺测量Service业务层处理 + * + * @author ruoyi + * @date 2025-07-27 + */ +@Service +public class ScBodyMeasureServiceImpl implements IScBodyMeasureService +{ + @Autowired + private ScBodyMeasureMapper scBodyMeasureMapper; + @Autowired + private IBasSheepService basSheepService; + /** + * 查询体尺测量 + * + * @param id 体尺测量主键 + * @return 体尺测量 + */ + @Override + public ScBodyMeasure selectScBodyMeasureById(Long id) + { + return scBodyMeasureMapper.selectScBodyMeasureById(id); + } + + /** + * 查询体尺测量列表 + * + * @param scBodyMeasure 体尺测量 + * @return 体尺测量 + */ + @Override + public List selectScBodyMeasureList(ScBodyMeasure scBodyMeasure) + { + return scBodyMeasureMapper.selectScBodyMeasureList(scBodyMeasure); + } + + /** + * 新增体尺测量 + * + * @param scBodyMeasure 体尺测量 + * @return 结果 + */ + @Override + public int insertScBodyMeasure(ScBodyMeasure scBodyMeasure) + { + String manageTags = scBodyMeasure.getManageTags(); + if (StringUtils.isNotBlank(manageTags)) { + BasSheep sheep = basSheepService.selectBasSheepByManageTags(manageTags); + if (sheep == null) { + throw new RuntimeException("耳号不存在,请检查输入"); + } + scBodyMeasure.setSheepId(sheep.getId()); + } + scBodyMeasure.setCreateTime(DateUtils.getNowDate()); + scBodyMeasure.setCreateBy(SecurityUtils.getUsername()); + return scBodyMeasureMapper.insertScBodyMeasure(scBodyMeasure); + } + + /** + * 修改体尺测量 + * + * @param scBodyMeasure 体尺测量 + * @return 结果 + */ + @Override + public int updateScBodyMeasure(ScBodyMeasure scBodyMeasure) + { + String manageTags = scBodyMeasure.getManageTags(); + if (StringUtils.isNotBlank(manageTags)) { + BasSheep sheep = basSheepService.selectBasSheepByManageTags(manageTags); + if (sheep == null) { + throw new RuntimeException("耳号不存在,请检查输入"); + } + scBodyMeasure.setSheepId(sheep.getId()); + } + return scBodyMeasureMapper.updateScBodyMeasure(scBodyMeasure); + } + + /** + * 批量删除体尺测量 + * + * @param ids 需要删除的体尺测量主键 + * @return 结果 + */ + @Override + public int deleteScBodyMeasureByIds(Long[] ids) + { + return scBodyMeasureMapper.deleteScBodyMeasureByIds(ids); + } + + /** + * 删除体尺测量信息 + * + * @param id 体尺测量主键 + * @return 结果 + */ + @Override + public int deleteScBodyMeasureById(Long id) + { + return scBodyMeasureMapper.deleteScBodyMeasureById(id); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/service/impl/ScBodyScoreServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/service/impl/ScBodyScoreServiceImpl.java new file mode 100644 index 0000000..1a55d69 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/service/impl/ScBodyScoreServiceImpl.java @@ -0,0 +1,127 @@ +package com.zhyc.module.produce.bodyManage.service.impl; + +import java.util.List; + +import com.zhyc.common.utils.DateUtils; +import com.zhyc.common.utils.SecurityUtils; +import com.zhyc.common.utils.StringUtils; +import com.zhyc.module.base.domain.BasSheep; +import com.zhyc.module.base.mapper.BasSheepMapper; +import com.zhyc.module.base.service.IBasSheepService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.zhyc.module.produce.bodyManage.mapper.ScBodyScoreMapper; +import com.zhyc.module.produce.bodyManage.domain.ScBodyScore; +import com.zhyc.module.produce.bodyManage.service.IScBodyScoreService; +import org.springframework.transaction.annotation.Transactional; + +/** + * 体况评分Service业务层处理 + * + * @author ruoyi + * @date 2025-07-27 + */ +@Service +public class ScBodyScoreServiceImpl implements IScBodyScoreService { + @Autowired + private ScBodyScoreMapper scBodyScoreMapper; + @Autowired + private IBasSheepService basSheepService; + @Autowired + private BasSheepMapper basSheepMapper; + + /** + * 查询体况评分 + * + * @param id 体况评分主键 + * @return 体况评分 + */ + @Override + public ScBodyScore selectScBodyScoreById(Long id) { + return scBodyScoreMapper.selectScBodyScoreById(id); + } + + /** + * 查询体况评分列表 + * + * @param scBodyScore 体况评分 + * @return 体况评分 + */ + @Override + public List selectScBodyScoreList(ScBodyScore scBodyScore) { + return scBodyScoreMapper.selectScBodyScoreList(scBodyScore); + } + + /** + * 新增体况评分 + * + * @param scBodyScore 体况评分 + * @return 结果 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int insertScBodyScore(ScBodyScore scBodyScore) { + String manageTags = scBodyScore.getManageTags(); + if (StringUtils.isNotBlank(manageTags)) { + BasSheep sheep = basSheepService.selectBasSheepByManageTags(manageTags); + if (sheep == null) { + throw new RuntimeException("耳号不存在,请检查输入"); + } + scBodyScore.setSheepId(sheep.getId().toString()); + } + scBodyScore.setCreateTime(DateUtils.getNowDate()); + scBodyScore.setCreateBy(SecurityUtils.getUsername()); + + int insertResult = scBodyScoreMapper.insertScBodyScore(scBodyScore); + + if (insertResult > 0 && scBodyScore.getSheepId() != null) { + BasSheep updateSheep = new BasSheep(); + updateSheep.setId(Long.parseLong(scBodyScore.getSheepId())); + updateSheep.setBody(scBodyScore.getScore()); + basSheepMapper.updateBasSheep(updateSheep); + } + + return insertResult; + } + + /** + * 修改体况评分 + * + * @param scBodyScore 体况评分 + * @return 结果 + */ + @Override + public int updateScBodyScore(ScBodyScore scBodyScore) { + String manageTags = scBodyScore.getManageTags(); + if (StringUtils.isNotBlank(manageTags)) { + BasSheep sheep = basSheepService.selectBasSheepByManageTags(manageTags); + if (sheep == null) { + throw new RuntimeException("耳号不存在,请检查输入"); + } + scBodyScore.setSheepId(sheep.getId().toString()); + } + return scBodyScoreMapper.updateScBodyScore(scBodyScore); + } + + /** + * 批量删除体况评分 + * + * @param ids 需要删除的体况评分主键 + * @return 结果 + */ + @Override + public int deleteScBodyScoreByIds(Long[] ids) { + return scBodyScoreMapper.deleteScBodyScoreByIds(ids); + } + + /** + * 删除体况评分信息 + * + * @param id 体况评分主键 + * @return 结果 + */ + @Override + public int deleteScBodyScoreById(Long id) { + return scBodyScoreMapper.deleteScBodyScoreById(id); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/service/impl/ScBreastRatingServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/service/impl/ScBreastRatingServiceImpl.java new file mode 100644 index 0000000..e813d43 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/bodyManage/service/impl/ScBreastRatingServiceImpl.java @@ -0,0 +1,131 @@ +package com.zhyc.module.produce.bodyManage.service.impl; + +import java.util.List; + +import com.zhyc.common.utils.DateUtils; +import com.zhyc.common.utils.SecurityUtils; +import com.zhyc.common.utils.StringUtils; +import com.zhyc.module.base.domain.BasSheep; +import com.zhyc.module.base.mapper.BasSheepMapper; +import com.zhyc.module.base.service.IBasSheepService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.zhyc.module.produce.bodyManage.mapper.ScBreastRatingMapper; +import com.zhyc.module.produce.bodyManage.domain.ScBreastRating; +import com.zhyc.module.produce.bodyManage.service.IScBreastRatingService; +import org.springframework.transaction.annotation.Transactional; + +/** + * 乳房评分Service业务层处理 + * + * @author ruoyi + * @date 2025-07-27 + */ +@Service +public class ScBreastRatingServiceImpl implements IScBreastRatingService { + @Autowired + private ScBreastRatingMapper scBreastRatingMapper; + + @Autowired + private IBasSheepService basSheepService; + + @Autowired + private BasSheepMapper basSheepMapper; + + /** + * 查询乳房评分 + * + * @param id 乳房评分主键 + * @return 乳房评分 + */ + @Override + public ScBreastRating selectScBreastRatingById(Long id) { + return scBreastRatingMapper.selectScBreastRatingById(id); + } + + /** + * 查询乳房评分列表 + * + * @param scBreastRating 乳房评分 + * @return 乳房评分 + */ + @Override + public List selectScBreastRatingList(ScBreastRating scBreastRating) { + return scBreastRatingMapper.selectScBreastRatingList(scBreastRating); + } + + /** + * 新增乳房评分 + * + * @param scBreastRating 乳房评分 + * @return 结果 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int insertScBreastRating(ScBreastRating scBreastRating) { + String manageTags = scBreastRating.getManageTags(); + if (StringUtils.isNotBlank(manageTags)) { + BasSheep sheep = basSheepService.selectBasSheepByManageTags(manageTags); + if (sheep == null) { + throw new RuntimeException("耳号不存在,请检查输入"); + } + scBreastRating.setSheepId(sheep.getId().toString()); + } + scBreastRating.setCreateTime(DateUtils.getNowDate()); + scBreastRating.setCreateBy(SecurityUtils.getUsername()); + int rows = scBreastRatingMapper.insertScBreastRating(scBreastRating); + + if (rows > 0 && scBreastRating.getSheepId() != null) { + Long sheepId = Long.parseLong(scBreastRating.getSheepId()); + Long score = scBreastRating.getScore().longValue(); + + BasSheep updateSheep = new BasSheep(); + updateSheep.setId(sheepId); + updateSheep.setBreast(score); + + basSheepMapper.updateBasSheep(updateSheep); + } + return rows; + } + + /** + * 修改乳房评分 + * + * @param scBreastRating 乳房评分 + * @return 结果 + */ + @Override + public int updateScBreastRating(ScBreastRating scBreastRating) { + String manageTags = scBreastRating.getManageTags(); + if (StringUtils.isNotBlank(manageTags)) { + BasSheep sheep = basSheepService.selectBasSheepByManageTags(manageTags); + if (sheep == null) { + throw new RuntimeException("耳号不存在,请检查输入"); + } + scBreastRating.setSheepId(sheep.getId().toString()); + } + return scBreastRatingMapper.updateScBreastRating(scBreastRating); + } + + /** + * 批量删除乳房评分 + * + * @param ids 需要删除的乳房评分主键 + * @return 结果 + */ + @Override + public int deleteScBreastRatingByIds(Long[] ids) { + return scBreastRatingMapper.deleteScBreastRatingByIds(ids); + } + + /** + * 删除乳房评分信息 + * + * @param id 乳房评分主键 + * @return 结果 + */ + @Override + public int deleteScBreastRatingById(Long id) { + return scBreastRatingMapper.deleteScBreastRatingById(id); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/controller/RawSpermRecordController.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/controller/RawSpermRecordController.java new file mode 100644 index 0000000..17e4ee4 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/controller/RawSpermRecordController.java @@ -0,0 +1,137 @@ +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.common.utils.StringUtils; +import com.zhyc.module.produce.breed.domain.RawSpermRecord; +import com.zhyc.module.produce.breed.service.IRawSpermRecordService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 采精记录Controller + * + * @author ruoyi + * @date 2025-07-23 + */ +@RestController +@RequestMapping("/Sperm/Sperm") +public class RawSpermRecordController extends BaseController +{ + @Autowired + private IRawSpermRecordService rawSpermRecordService; + + /** + * 查询采精记录列表 + */ + @PreAuthorize("@ss.hasPermi('Sperm:Sperm:list')") + @GetMapping("/list") + public TableDataInfo list(RawSpermRecord rawSpermRecord) + { + startPage(); + List list = rawSpermRecordService.selectRawSpermRecordList(rawSpermRecord); + return getDataTable(list); + } + + /** + * 导出采精记录列表 + */ + @PreAuthorize("@ss.hasPermi('Sperm:Sperm:export')") + @Log(title = "采精记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, RawSpermRecord rawSpermRecord) + { + List list = rawSpermRecordService.selectRawSpermRecordList(rawSpermRecord); + ExcelUtil util = new ExcelUtil(RawSpermRecord.class); + util.exportExcel(response, list, "采精记录数据"); + } + + /** + * 获取采精记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('Sperm:Sperm:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(rawSpermRecordService.selectRawSpermRecordById(id)); + } + + /** + * 新增采精记录 + */ + @PreAuthorize("@ss.hasPermi('Sperm:Sperm:add')") + @Log(title = "采精记录", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody RawSpermRecord rawSpermRecord) + { + // 如果传入的是耳号,需要先根据耳号查询羊只ID + if (StringUtils.isNotEmpty(rawSpermRecord.getManageTags()) && rawSpermRecord.getSheepId() == null) { + Long sheepId = rawSpermRecordService.getSheepIdByManageTags(rawSpermRecord.getManageTags()); + if (sheepId == null) { + return error("未找到对应耳号的羊只信息"); + } + rawSpermRecord.setSheepId(sheepId); + } + + return toAjax(rawSpermRecordService.insertRawSpermRecord(rawSpermRecord)); + } + + /** + * 修改采精记录 + */ + @PreAuthorize("@ss.hasPermi('Sperm:Sperm:edit')") + @Log(title = "采精记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody RawSpermRecord rawSpermRecord) + { + // 如果传入的是耳号,需要先根据耳号查询羊只ID + if (StringUtils.isNotEmpty(rawSpermRecord.getManageTags()) && rawSpermRecord.getSheepId() == null) { + Long sheepId = rawSpermRecordService.getSheepIdByManageTags(rawSpermRecord.getManageTags()); + if (sheepId == null) { + return error("未找到对应耳号的羊只信息"); + } + rawSpermRecord.setSheepId(sheepId); + } + + return toAjax(rawSpermRecordService.updateRawSpermRecord(rawSpermRecord)); + } + + /** + * 删除采精记录 + */ + @PreAuthorize("@ss.hasPermi('Sperm:Sperm:remove')") + @Log(title = "采精记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(rawSpermRecordService.deleteRawSpermRecordByIds(ids)); + } + + /** + * 根据耳号查询羊只信息 + */ + @GetMapping("/getSheepByManageTags/{manageTags}") + public AjaxResult getSheepByManageTags(@PathVariable("manageTags") String manageTags) + { + Long sheepId = rawSpermRecordService.getSheepIdByManageTags(manageTags); + if (sheepId != null) { + return success(sheepId); + } else { + return error("未找到对应耳号的羊只信息"); + } + } +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/controller/ScBreedPlanController.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/controller/ScBreedPlanController.java new file mode 100644 index 0000000..7b6b947 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/controller/ScBreedPlanController.java @@ -0,0 +1,105 @@ +package com.zhyc.module.produce.breed.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.zhyc.module.produce.breed.domain.ScBreedPlan; +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.service.IScBreedPlanService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 配种计划Controller + * + * @author ruoyi + * @date 2025-07-16 + */ +@RestController +@RequestMapping("/mating_plan/mating_plan") +public class ScBreedPlanController extends BaseController +{ + @Autowired + private IScBreedPlanService scBreedPlanService; + + /** + * 查询配种计划列表 + */ + @PreAuthorize("@ss.hasPermi('mating_plan:mating_plan:list')") + @GetMapping("/list") + public TableDataInfo list(ScBreedPlan scBreedPlan) + { + startPage(); + List list = scBreedPlanService.selectScBreedPlanList(scBreedPlan); + return getDataTable(list); + } + + /** + * 导出配种计划列表 + */ + @PreAuthorize("@ss.hasPermi('mating_plan:mating_plan:export')") + @Log(title = "配种计划", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, ScBreedPlan scBreedPlan) + { + List list = scBreedPlanService.selectScBreedPlanList(scBreedPlan); + ExcelUtil util = new ExcelUtil(ScBreedPlan.class); + util.exportExcel(response, list, "配种计划数据"); + } + + /** + * 获取配种计划详细信息 + */ + @PreAuthorize("@ss.hasPermi('mating_plan:mating_plan:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(scBreedPlanService.selectScBreedPlanById(id)); + } + + /** + * 新增配种计划 + */ + @PreAuthorize("@ss.hasPermi('mating_plan:mating_plan:add')") + @Log(title = "配种计划", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ScBreedPlan scBreedPlan) + { + return toAjax(scBreedPlanService.insertScBreedPlan(scBreedPlan)); + } + + /** + * 修改配种计划 + */ + @PreAuthorize("@ss.hasPermi('mating_plan:mating_plan:edit')") + @Log(title = "配种计划", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ScBreedPlan scBreedPlan) + { + return toAjax(scBreedPlanService.updateScBreedPlan(scBreedPlan)); + } + + /** + * 删除配种计划 + */ + @PreAuthorize("@ss.hasPermi('mating_plan:mating_plan:remove')") + @Log(title = "配种计划", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(scBreedPlanService.deleteScBreedPlanByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/controller/ScBreedPlanGenerateController.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/controller/ScBreedPlanGenerateController.java new file mode 100644 index 0000000..c872868 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/controller/ScBreedPlanGenerateController.java @@ -0,0 +1,185 @@ +package com.zhyc.module.produce.breed.controller; + +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import com.zhyc.module.produce.breed.domain.ScBreedPlanGenerate; +import com.zhyc.module.produce.breed.service.IScBreedPlanGenerateService; +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.core.page.TableDataInfo; + +/** + * 配种计划生成Controller + * + * @author ruoyi + * @date 2025-07-16 + */ +@RestController +@RequestMapping("/mating_plan/generate") +public class ScBreedPlanGenerateController extends BaseController +{ + @Autowired + private IScBreedPlanGenerateService scBreedPlanGenerateService; + + /** + * 查询配种计划生成列表 + */ + @PreAuthorize("@ss.hasPermi('mating_plan:generate:list')") + @GetMapping("/list") + public TableDataInfo list(ScBreedPlanGenerate scBreedPlanGenerate) + { + startPage(); + List list = scBreedPlanGenerateService.selectScBreedPlanGenerateList(scBreedPlanGenerate); + return getDataTable(list); + } + + /** + * 筛选符合条件的母羊 + */ + @PreAuthorize("@ss.hasPermi('mating_plan:generate:selectEwe')") + @GetMapping("/selectEwe") + public AjaxResult selectEligibleEwe() + { + List> eligibleEwe = scBreedPlanGenerateService.selectEligibleEwe(); + return success(eligibleEwe); + } + + /** + * 筛选符合条件的公羊 + */ + @PreAuthorize("@ss.hasPermi('mating_plan:generate:selectRam')") + @GetMapping("/selectRam") + public AjaxResult selectEligibleRam() + { + List> eligibleRam = scBreedPlanGenerateService.selectEligibleRam(); + return success(eligibleRam); + } + + /** + * 自动生成配种计划 + */ + @PreAuthorize("@ss.hasPermi('mating_plan:generate:auto')") + @PostMapping("/auto") + @Log(title = "自动生成配种计划", businessType = BusinessType.INSERT) + public AjaxResult autoGenerateBreedPlan(@RequestBody Map params) + { + try { + // 安全的类型转换 + List eweIdsRaw = (List) params.get("eweIds"); + List ramIdsRaw = (List) params.get("ramIds"); + + if (eweIdsRaw == null || ramIdsRaw == null) { + return error("参数不能为空"); + } + + List eweIds = eweIdsRaw.stream() + .map(obj -> { + if (obj instanceof Integer) { + return ((Integer) obj).longValue(); + } else if (obj instanceof Long) { + return (Long) obj; + } else { + return Long.valueOf(obj.toString()); + } + }) + .collect(Collectors.toList()); + + List ramIds = ramIdsRaw.stream() + .map(obj -> { + if (obj instanceof Integer) { + return ((Integer) obj).longValue(); + } else if (obj instanceof Long) { + return (Long) obj; + } else { + return Long.valueOf(obj.toString()); + } + }) + .collect(Collectors.toList()); + + ScBreedPlanGenerate planGenerate = scBreedPlanGenerateService.autoGenerateBreedPlan(eweIds, ramIds); + return success(planGenerate); + } catch (Exception e) { + logger.error("自动生成配种计划失败", e); + return error("自动生成配种计划失败:" + e.getMessage()); + } + } + + /** + * 获取配种计划生成详细信息 + */ + @PreAuthorize("@ss.hasPermi('mating_plan:generate:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(scBreedPlanGenerateService.selectScBreedPlanGenerateById(id)); + } + + /** + * 保存配种计划生成 + */ + @PreAuthorize("@ss.hasPermi('mating_plan:generate:add')") + @Log(title = "配种计划生成", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ScBreedPlanGenerate scBreedPlanGenerate) + { + return toAjax(scBreedPlanGenerateService.insertScBreedPlanGenerate(scBreedPlanGenerate)); + } + + /** + * 修改配种计划生成 + */ + @PreAuthorize("@ss.hasPermi('mating_plan:generate:edit')") + @Log(title = "配种计划生成", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ScBreedPlanGenerate scBreedPlanGenerate) + { + return toAjax(scBreedPlanGenerateService.updateScBreedPlanGenerate(scBreedPlanGenerate)); + } + + /** + * 审批配种计划 + */ + @PreAuthorize("@ss.hasPermi('mating_plan:generate:approve')") + @Log(title = "审批配种计划", businessType = BusinessType.UPDATE) + @PutMapping("/approve/{id}") + public AjaxResult approve(@PathVariable Long id) + { + return toAjax(scBreedPlanGenerateService.approveBreedPlan(id)); + } + + /** + * 获取配种计划详情 + */ + @PreAuthorize("@ss.hasPermi('mating_plan:generate:view')") + @GetMapping("/view/{id}") + public AjaxResult viewBreedPlan(@PathVariable Long id) + { + Map planDetails = scBreedPlanGenerateService.getBreedPlanDetails(id); + return success(planDetails); + } + + /** + * 删除配种计划生成 + */ + @PreAuthorize("@ss.hasPermi('mating_plan:generate:remove')") + @Log(title = "配种计划生成", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(scBreedPlanGenerateService.deleteScBreedPlanGenerateByIds(ids)); + } +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/controller/ScBreedRecordController.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/controller/ScBreedRecordController.java new file mode 100644 index 0000000..c80c7ae --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/controller/ScBreedRecordController.java @@ -0,0 +1,158 @@ +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.ScBreedRecord; +import com.zhyc.module.produce.breed.service.IScBreedRecordService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 配种记录Controller + * + * @author ruoyi + * @date 2025-07-23 + */ +@RestController +@RequestMapping("/Breeding_records/Breeding_records") +public class ScBreedRecordController extends BaseController +{ + @Autowired + private IScBreedRecordService scBreedRecordService; + + /** + * 查询配种记录列表 + */ + @PreAuthorize("@ss.hasPermi('Breeding_records:Breeding_records:list')") + @GetMapping("/list") + public TableDataInfo list(ScBreedRecord scBreedRecord) + { + startPage(); + List list = scBreedRecordService.selectScBreedRecordList(scBreedRecord); + return getDataTable(list); + } + + /** + * 导出配种记录列表 + */ + @PreAuthorize("@ss.hasPermi('Breeding_records:Breeding_records:export')") + @Log(title = "配种记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, ScBreedRecord scBreedRecord) + { + List list = scBreedRecordService.selectScBreedRecordList(scBreedRecord); + ExcelUtil util = new ExcelUtil(ScBreedRecord.class); + util.exportExcel(response, list, "配种记录数据"); + } + + /** + * 获取配种记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('Breeding_records:Breeding_records:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(scBreedRecordService.selectScBreedRecordById(id)); + } + + /** + * 根据耳号查询羊只信息 + */ + @PreAuthorize("@ss.hasPermi('Breeding_records:Breeding_records:query')") + @GetMapping(value = "/getSheepByTags/{manageTags}") + public AjaxResult getSheepInfoByTags(@PathVariable("manageTags") String manageTags) + { + return success(scBreedRecordService.getSheepInfoByTags(manageTags)); + } + + /** + * 根据母羊耳号获取配种计划信息 + */ + @PreAuthorize("@ss.hasPermi('Breeding_records:Breeding_records:query')") + @GetMapping(value = "/getBreedPlan/{manageTags}") + public AjaxResult getBreedPlanByEweTags(@PathVariable("manageTags") String manageTags) + { + return success(scBreedRecordService.getBreedPlanByEweTags(manageTags)); + } + + /** + * 新增配种记录 + */ + @PreAuthorize("@ss.hasPermi('Breeding_records:Breeding_records:add')") + @Log(title = "配种记录", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ScBreedRecord scBreedRecord) + { + // 如果传入的是耳号,需要转换为羊只ID + if (scBreedRecord.getEweManageTags() != null && !scBreedRecord.getEweManageTags().isEmpty()) { + Long eweId = scBreedRecordService.getSheepIdByTags(scBreedRecord.getEweManageTags()); + if (eweId == null) { + return error("未找到母羊耳号对应的羊只信息"); + } + scBreedRecord.setEweId(eweId.toString()); + } + + if (scBreedRecord.getRamManageTags() != null && !scBreedRecord.getRamManageTags().isEmpty()) { + Long ramId = scBreedRecordService.getRamIdByTags(scBreedRecord.getRamManageTags()); + if (ramId == null) { + return error("未找到公羊耳号对应的羊只信息"); + } + scBreedRecord.setRamId(ramId.toString()); + } + + return toAjax(scBreedRecordService.insertScBreedRecord(scBreedRecord)); + } + + /** + * 修改配种记录 + */ + @PreAuthorize("@ss.hasPermi('Breeding_records:Breeding_records:edit')") + @Log(title = "配种记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ScBreedRecord scBreedRecord) + { + // 如果传入的是耳号,需要转换为羊只ID + if (scBreedRecord.getEweManageTags() != null && !scBreedRecord.getEweManageTags().isEmpty()) { + Long eweId = scBreedRecordService.getSheepIdByTags(scBreedRecord.getEweManageTags()); + if (eweId == null) { + return error("未找到母羊耳号对应的羊只信息"); + } + scBreedRecord.setEweId(eweId.toString()); + } + + if (scBreedRecord.getRamManageTags() != null && !scBreedRecord.getRamManageTags().isEmpty()) { + Long ramId = scBreedRecordService.getRamIdByTags(scBreedRecord.getRamManageTags()); + if (ramId == null) { + return error("未找到公羊耳号对应的羊只信息"); + } + scBreedRecord.setRamId(ramId.toString()); + } + + return toAjax(scBreedRecordService.updateScBreedRecord(scBreedRecord)); + } + + /** + * 删除配种记录 + */ + @PreAuthorize("@ss.hasPermi('Breeding_records:Breeding_records:remove')") + @Log(title = "配种记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(scBreedRecordService.deleteScBreedRecordByIds(ids)); + } +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/controller/ScDryMilkController.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/controller/ScDryMilkController.java new file mode 100644 index 0000000..4013c1d --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/controller/ScDryMilkController.java @@ -0,0 +1,115 @@ +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.ScDryMilk; +import com.zhyc.module.produce.breed.service.IScDryMilkService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 干奶记录Controller + * + * @author ruoyi + * @date 2025-07-15 + */ +@RestController +@RequestMapping("/drymilk/drymilk") +public class ScDryMilkController extends BaseController +{ + @Autowired + private IScDryMilkService scDryMilkService; + + /** + * 查询干奶记录列表 + */ + @PreAuthorize("@ss.hasPermi('drymilk:drymilk:list')") + @GetMapping("/list") + public TableDataInfo list(ScDryMilk scDryMilk) + { + startPage(); + List list = scDryMilkService.selectScDryMilkList(scDryMilk); + return getDataTable(list); + } + + /** + * 导出干奶记录列表 + */ + @PreAuthorize("@ss.hasPermi('drymilk:drymilk:export')") + @Log(title = "干奶记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, ScDryMilk scDryMilk) + { + List list = scDryMilkService.selectScDryMilkList(scDryMilk); + ExcelUtil util = new ExcelUtil(ScDryMilk.class); + util.exportExcel(response, list, "干奶记录数据"); + } + + /** + * 获取干奶记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('drymilk:drymilk:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(scDryMilkService.selectScDryMilkById(id)); + } + + /** + * 根据耳号查询羊只ID + */ + @PreAuthorize("@ss.hasPermi('drymilk:drymilk:query')") + @GetMapping(value = "/sheep/{manageTags}") + public AjaxResult getSheepIdByManageTags(@PathVariable("manageTags") String manageTags) + { + Long sheepId = scDryMilkService.selectSheepIdByManageTags(manageTags); + return success(sheepId); + } + + /** + * 新增干奶记录 + */ + @PreAuthorize("@ss.hasPermi('drymilk:drymilk:add')") + @Log(title = "干奶记录", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ScDryMilk scDryMilk) + { + return toAjax(scDryMilkService.insertScDryMilk(scDryMilk)); + } + + /** + * 修改干奶记录 + */ + @PreAuthorize("@ss.hasPermi('drymilk:drymilk:edit')") + @Log(title = "干奶记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ScDryMilk scDryMilk) + { + return toAjax(scDryMilkService.updateScDryMilk(scDryMilk)); + } + + /** + * 删除干奶记录 + */ + @PreAuthorize("@ss.hasPermi('drymilk:drymilk:remove')") + @Log(title = "干奶记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(scDryMilkService.deleteScDryMilkByIds(ids)); + } +} \ No newline at end of file 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/controller/ScPregnancyRecordController.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/controller/ScPregnancyRecordController.java new file mode 100644 index 0000000..08d5cc1 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/controller/ScPregnancyRecordController.java @@ -0,0 +1,116 @@ +package com.zhyc.module.produce.breed.controller; + +import java.util.List; +import java.util.Map; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +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.ScPregnancyRecord; +import com.zhyc.module.produce.breed.service.IScPregnancyRecordService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 孕检记录Controller + * + * @author zhyc + * @date 2025-01-21 + */ +@RestController +@RequestMapping("/Pregnancy_Test/Pregnancy_Test") +public class ScPregnancyRecordController extends BaseController +{ + @Autowired + private IScPregnancyRecordService scPregnancyRecordService; + + /** + * 查询孕检记录列表 + */ + @PreAuthorize("@ss.hasPermi('Pregnancy_Test:Pregnancy_Test:list')") + @GetMapping("/list") + public TableDataInfo list(ScPregnancyRecord scPregnancyRecord) + { + startPage(); + List list = scPregnancyRecordService.selectScPregnancyRecordList(scPregnancyRecord); + return getDataTable(list); + } + + /** + * 导出孕检记录列表 + */ + @PreAuthorize("@ss.hasPermi('Pregnancy_Test:Pregnancy_Test:export')") + @Log(title = "孕检记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, ScPregnancyRecord scPregnancyRecord) + { + List list = scPregnancyRecordService.selectScPregnancyRecordList(scPregnancyRecord); + ExcelUtil util = new ExcelUtil(ScPregnancyRecord.class); + util.exportExcel(response, list, "孕检记录数据"); + } + + /** + * 获取孕检记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('Pregnancy_Test:Pregnancy_Test:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(scPregnancyRecordService.selectScPregnancyRecordById(id)); + } + + /** + * 新增孕检记录 + */ + @PreAuthorize("@ss.hasPermi('Pregnancy_Test:Pregnancy_Test:add')") + @Log(title = "孕检记录", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ScPregnancyRecord scPregnancyRecord) + { + return toAjax(scPregnancyRecordService.insertScPregnancyRecord(scPregnancyRecord)); + } + + /** + * 修改孕检记录 + */ + @PreAuthorize("@ss.hasPermi('Pregnancy_Test:Pregnancy_Test:edit')") + @Log(title = "孕检记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ScPregnancyRecord scPregnancyRecord) + { + return toAjax(scPregnancyRecordService.updateScPregnancyRecord(scPregnancyRecord)); + } + + /** + * 删除孕检记录 + */ + @PreAuthorize("@ss.hasPermi('Pregnancy_Test:Pregnancy_Test:remove')") + @Log(title = "孕检记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(scPregnancyRecordService.deleteScPregnancyRecordByIds(ids)); + } + + /** + * 根据耳号获取羊只信息 + */ + @GetMapping("/getSheepByManageTags") + public AjaxResult getSheepByManageTags(@RequestParam("manageTags") String manageTags) + { + Map sheepInfo = scPregnancyRecordService.getSheepByManageTags(manageTags); + return success(sheepInfo); + } +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/controller/ScSheepDeathController.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/controller/ScSheepDeathController.java new file mode 100644 index 0000000..cbd1964 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/controller/ScSheepDeathController.java @@ -0,0 +1,120 @@ +package com.zhyc.module.produce.breed.controller; + +import java.util.List; +import java.util.Map; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.zhyc.common.annotation.Log; +import com.zhyc.common.core.controller.BaseController; +import com.zhyc.common.core.domain.AjaxResult; +import com.zhyc.common.enums.BusinessType; +import com.zhyc.module.produce.breed.domain.ScSheepDeath; +import com.zhyc.module.produce.breed.service.IScSheepDeathService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 羊只死淘记录Controller + * + * @author ruoyi + * @date 2025-08-06 + */ +@RestController +@RequestMapping("/sheep_death/death") +public class ScSheepDeathController extends BaseController +{ + @Autowired + private IScSheepDeathService scSheepDeathService; + + /** + * 查询羊只死淘记录列表 + */ + @PreAuthorize("@ss.hasPermi('sheep_death:death:list')") + @GetMapping("/list") + public TableDataInfo list(ScSheepDeath scSheepDeath) + { + startPage(); + List list = scSheepDeathService.selectScSheepDeathList(scSheepDeath); + return getDataTable(list); + } + + /** + * 根据管理耳号查询羊只信息 + */ + @PreAuthorize("@ss.hasPermi('sheep_death:death:query')") + @GetMapping("/sheepInfo/{manageTags}") + public AjaxResult getSheepInfo(@PathVariable("manageTags") String manageTags) + { + Map sheepInfo = scSheepDeathService.selectSheepFileByManageTags(manageTags); + if (sheepInfo != null) { + return success(sheepInfo); + } else { + return error("未找到该耳号对应的羊只信息"); + } + } + + /** + * 导出羊只死淘记录列表 + */ + @PreAuthorize("@ss.hasPermi('sheep_death:death:export')") + @Log(title = "羊只死淘记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, ScSheepDeath scSheepDeath) + { + List list = scSheepDeathService.selectScSheepDeathList(scSheepDeath); + ExcelUtil util = new ExcelUtil(ScSheepDeath.class); + util.exportExcel(response, list, "羊只死淘记录数据"); + } + + /** + * 获取羊只死淘记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('sheep_death:death:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(scSheepDeathService.selectScSheepDeathById(id)); + } + + /** + * 新增羊只死淘记录 + */ + @PreAuthorize("@ss.hasPermi('sheep_death:death:add')") + @Log(title = "羊只死淘记录", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ScSheepDeath scSheepDeath) + { + return toAjax(scSheepDeathService.insertScSheepDeath(scSheepDeath)); + } + + /** + * 修改羊只死淘记录 + */ + @PreAuthorize("@ss.hasPermi('sheep_death:death:edit')") + @Log(title = "羊只死淘记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ScSheepDeath scSheepDeath) + { + return toAjax(scSheepDeathService.updateScSheepDeath(scSheepDeath)); + } + + /** + * 删除羊只死淘记录 + */ + @PreAuthorize("@ss.hasPermi('sheep_death:death:remove')") + @Log(title = "羊只死淘记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(scSheepDeathService.deleteScSheepDeathByIds(ids)); + } +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/controller/ScWeanRecordController.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/controller/ScWeanRecordController.java new file mode 100644 index 0000000..d454abf --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/controller/ScWeanRecordController.java @@ -0,0 +1,162 @@ +package com.zhyc.module.produce.breed.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.zhyc.module.produce.breed.domain.ScWeanRecord; +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.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/breed/domain/RawSpermRecord.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/RawSpermRecord.java new file mode 100644 index 0000000..2f1c625 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/RawSpermRecord.java @@ -0,0 +1,83 @@ +package com.zhyc.module.produce.breed.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 采精记录对象 raw_sperm_record + * + * @author ruoyi + * @date 2025-07-23 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class RawSpermRecord extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键ID */ + private Long id; + + /** 羊只ID */ + @Excel(name = "羊只ID") + private Long sheepId; + + /** 耳号 */ + @Excel(name = "耳号") + private String manageTags; + + /** 电子耳号 */ + @Excel(name = "电子耳号") + private String electronicTags; + + /** 月龄 */ + @Excel(name = "月龄") + private Long monthAge; + + /** 采精日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "采精日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date pickDate; + + /** 采精量 */ + @Excel(name = "采精量") + private Long amount; + + /** 精液密度 */ + @Excel(name = "精液密度") + private String density; + + /** 精液活力 */ + @Excel(name = "精液活力") + private String vitallity; + + /** 是否性控(0否1是) */ + @Excel(name = "是否性控", readConverterExp = "0=否,1=是") + private Long controlled; + + /** 性欲情况 */ + @Excel(name = "性欲情况") + private String sexualStatus; + + /** 诊疗信息 */ + @Excel(name = "诊疗信息") + private String info; + + /** 技术员 */ + @Excel(name = "技术员") + private String technician; + + /** 采集备注 */ + @Excel(name = "采集备注") + private String comment; + + +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/ScBreedPlan.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/ScBreedPlan.java new file mode 100644 index 0000000..1989341 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/ScBreedPlan.java @@ -0,0 +1,39 @@ +package com.zhyc.module.produce.breed.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 配种计划对象 sc_breed_plan + * + * @author ruoyi + * @date 2025-07-16 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class ScBreedPlan extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + /** 公羊id */ + @Excel(name = "公羊id") + private String ramId; + + /** 母羊id */ + @Excel(name = "母羊id") + private String eweId; + + /** 配种类型 */ + @Excel(name = "配种类型") + private Long breedType; + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/ScBreedPlanGenerate.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/ScBreedPlanGenerate.java new file mode 100644 index 0000000..db6f059 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/ScBreedPlanGenerate.java @@ -0,0 +1,70 @@ +package com.zhyc.module.produce.breed.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 配种计划生成对象 sc_breed_plan_generate + * + * @author ruoyi + * @date 2025-07-16 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class ScBreedPlanGenerate extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键ID */ + private Long id; + + /** 计划名称 */ + @Excel(name = "计划名称") + private String planName; + + /** 计划类型:1-同期发情配种计划 */ + @Excel(name = "计划类型") + private Integer planType; + + /** 计划日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "计划日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date planDate; + + /** 总母羊数 */ + @Excel(name = "总母羊数") + private Integer totalEweCount; + + /** 总公羊数 */ + @Excel(name = "总公羊数") + private Integer totalRamCount; + + /** 配种比例 */ + @Excel(name = "配种比例") + private String breedRatio; + + /** 状态:0-待审批,1-已审批,2-已拒绝 */ + @Excel(name = "状态") + private Integer status; + + /** 审批人 */ + @Excel(name = "审批人") + private String approver; + + /** 审批时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "审批时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date approveTime; + + /** 审批意见 */ + private String approveRemark; + +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/ScBreedPlanTemp.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/ScBreedPlanTemp.java new file mode 100644 index 0000000..4380caf --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/ScBreedPlanTemp.java @@ -0,0 +1,73 @@ +package com.zhyc.module.produce.breed.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 配种计划详情对象 sc_breed_plan_temp + * + * @author ruoyi + * @date 2025-07-16 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class ScBreedPlanTemp extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键ID */ + private Long id; + + /** 配种计划生成ID */ + private Long planGenerateId; + + /** 公羊ID */ + @Excel(name = "公羊ID") + private String ramId; + + /** 母羊ID */ + @Excel(name = "母羊ID") + private String eweId; + + /** 配种类型 */ + @Excel(name = "配种类型") + private Long breedType; + + /** 公羊管理耳号 */ + @Excel(name = "公羊管理耳号") + private String ramManageTags; + + /** 公羊品种 */ + @Excel(name = "公羊品种") + private String ramVariety; + + /** 母羊管理耳号 */ + @Excel(name = "母羊管理耳号") + private String eweManageTags; + + /** 母羊品种 */ + @Excel(name = "母羊品种") + private String eweVariety; + + /** 母羊体重 */ + @Excel(name = "母羊体重") + private Double eweWeight; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/ScBreedRecord.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/ScBreedRecord.java new file mode 100644 index 0000000..c5f548d --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/ScBreedRecord.java @@ -0,0 +1,116 @@ +package com.zhyc.module.produce.breed.domain; + +import java.math.BigDecimal; +import java.util.Date; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 配种记录对象 sc_breed_record + * + * @author ruoyi + * @date 2025-07-23 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class ScBreedRecord extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键ID */ + private Long id; + + /** 羊只id */ + @Excel(name = "羊只id") + private Long sheepId; + + /** 配种公羊id */ + @Excel(name = "配种公羊id") + private String ramId; + + /** 配种母羊id */ + @Excel(name = "配种母羊id") + private String eweId; + + /** 技术员 */ + @Excel(name = "技术员") + private String technician; + + /** 繁殖用药/耗精量 */ + @Excel(name = "耗精量") + private String breedDrugs; + + // ============ 显示字段 ============ + + /** 母羊耳号 */ + @Excel(name = "耳号") + private String eweManageTags; + + /** 母羊品种 */ + @Excel(name = "品种") + private String eweVariety; + + /** 公羊耳号 */ + @Excel(name = "配种公羊") + private String ramManageTags; + + /** 公羊品种 */ + @Excel(name = "配种公羊品种") + private String ramVariety; + + /** 胎次 */ + @Excel(name = "胎次") + private Integer eweParity; + + /** 月龄 */ + @Excel(name = "月龄") + private Integer eweMonthAge; + + /** 羊舍名称 */ + @Excel(name = "当前羊舍") + private String eweSheepfoldName; + + /** 繁育状态 */ + @Excel(name = "繁育状态") + private String eweBreedStatus; + + /** 是否性控 */ + @Excel(name = "是否性控", readConverterExp = "0=否,1=是") + private Integer eweControlled; + + /** 羊只备注 */ + @Excel(name = "羊只备注") + private String eweComment; + + /** 牧场名称 */ + @Excel(name = "所在牧场") + private String ranchName; + + /** 配种方式 */ + @Excel(name = "配种方式") + private String matingType; + + /** 羊只类别 */ + @Excel(name = "配种时羊只类别") + private String sheepType; + + /** 配次 */ + @Excel(name = "配次") + private Integer matingCount; + + /** 发情后配种时间 */ + @Excel(name = "发情后配种时间(小时)") + private Long timeSincePlanning; + + /** 牧场ID */ + private Long ranchId; + + +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/ScDryMilk.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/ScDryMilk.java new file mode 100644 index 0000000..07f0fb8 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/ScDryMilk.java @@ -0,0 +1,73 @@ +package com.zhyc.module.produce.breed.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 干奶记录对象 sc_dry_milk + * + * @author ruoyi + * @date 2025-07-15 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class ScDryMilk extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键id */ + private Long id; + + /** 羊只id */ + @Excel(name = "羊只id") + private String sheepId; + + /** 干奶日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "干奶日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date datetime; + + /** 是否使用乳头封闭剂 */ + @Excel(name = "是否使用乳头封闭剂") + private Long status; + + /** 转入羊舍id */ + @Excel(name = "转入羊舍id") + private Long sheepfold; + + /** 技术员 */ + @Excel(name = "技术员") + private String tecahnician; + + /** 备注 */ + @Excel(name = "备注") + private String comment; + + // 以下为联表查询字段,不存储在sc_dry_milk表中 + + /** 管理耳号 */ + @Excel(name = "耳号") + private String manageTags; + + /** 品种 */ + @Excel(name = "品种") + private String variety; + + /** 羊舍名称 */ + @Excel(name = "转入羊舍") + private String sheepfoldName; + + /** 事件类型 */ + @Excel(name = "事件类型") + private String eventType; + + +} \ 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..69044e4 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/ScLambDetail.java @@ -0,0 +1,94 @@ +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 lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 羔羊详情对象 sc_lamb_detail + * + * @author ruoyi + * @date 2025-07-11 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +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; + } + + +} \ 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..bfb27a0 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/ScLambingRecord.java @@ -0,0 +1,387 @@ +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(); + } +} + diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/ScPregnancyRecord.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/ScPregnancyRecord.java new file mode 100644 index 0000000..f02d38f --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/ScPregnancyRecord.java @@ -0,0 +1,122 @@ +package com.zhyc.module.produce.breed.domain; + +import java.math.BigDecimal; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 孕检记录对象 sc_pregnancy_record + * + * @author zhyc + * @date 2025-01-21 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class ScPregnancyRecord extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键ID */ + private Long id; + + /** 羊只ID */ + @Excel(name = "羊只ID") + private Long sheepId; + + /** 耳号 */ + @Excel(name = "耳号") + private String manageTags; + + /** 孕检日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "孕检日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date datetime; + + /** 孕检结果 */ + @Excel(name = "孕检结果") + private String result; + + /** 胎儿数量 */ + @Excel(name = "胎儿数量") + private Integer fetusCount; + + /** 技术员 */ + @Excel(name = "技术员") + private String technician; + + /** 孕检方式 */ + @Excel(name = "孕检方式") + private String way; + + /** 备注 */ + @Excel(name = "备注") + private String remark; + + /** 是否删除 */ + private Integer isDelete; + + // 关联查询字段 + /** 品种 */ + @Excel(name = "品种") + private String variety; + + /** 月龄 */ + @Excel(name = "月龄") + private Long monthAge; + + /** 胎次 */ + @Excel(name = "胎次") + private Integer parity; + + /** 配次 */ + @Excel(name = "配次") + private Integer matingCounts; + + /** 当前羊舍 */ + @Excel(name = "当前羊舍") + private String sheepfoldName; + + /** 繁育状态 */ + @Excel(name = "繁育状态") + private String breedStatus; + + /** 配种公羊耳号 */ + @Excel(name = "配种公羊") + private String fatherManageTags; + + /** 配种公羊品种 */ + @Excel(name = "配种公羊品种") + private String fatherVariety; + + /** 配种类型 */ + @Excel(name = "配种类型") + private String matingTypeName; + + /** 配种日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "配种日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date matingDate; + + /** 预产日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "预产日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date expectedDate; + + /** 上次事件日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "上次事件日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date lastEventDate; + + /** 所在牧场 */ + @Excel(name = "所在牧场") + private String ranchName; + +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/ScSheepDeath.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/ScSheepDeath.java new file mode 100644 index 0000000..52f04dd --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/ScSheepDeath.java @@ -0,0 +1,356 @@ +package com.zhyc.module.produce.breed.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 羊只死淘记录对象 sc_sheep_death + * + * @author ruoyi + * @date 2025-08-06 + */ +public class ScSheepDeath extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键ID */ + private Long id; + + /** 羊只ID */ + @Excel(name = "羊只ID") + private Long sheepId; + + /** 管理耳号 */ + @Excel(name = "管理耳号") + private String manageTags; + + /** 事件类型 */ + @Excel(name = "事件类型") + private String eventType; + + /** 死亡日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "死亡日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date deathDate; + + /** 疾病类型ID */ + @Excel(name = "疾病类型ID") + private Long diseaseTypeId; + + /** 疾病子类型ID */ + @Excel(name = "疾病子类型ID") + private Long diseaseSubtypeId; + + /** 死淘去向 */ + @Excel(name = "死淘去向") + private String disposalDirection; + + /** 技术员 */ + @Excel(name = "技术员") + private String technician; + + /** 处理人 */ + @Excel(name = "处理人") + private String handler; + + /** 班组 */ + @Excel(name = "班组") + private String workGroup; + + /** 备注 */ + @Excel(name = "备注") + private String comment; + + /** 是否删除(0:未删除 1:已删除) */ + @Excel(name = "是否删除(0:未删除 1:已删除)") + private Long isDelete; + + // 以下字段仅用于前端显示,不存储到数据库 + /** 品种 */ + private String variety; + + /** 死亡时羊只类别 */ + private String sheepType; + + /** 性别 */ + private Integer gender; + + /** 日龄 */ + private Long dayAge; + + /** 胎次 */ + private Integer parity; + + /** 羊舍 */ + private String sheepfoldName; + + /** 繁育状态 */ + private String breedStatus; + + /** 死亡时产后天数 */ + private Integer postLambingDay; + + /** 死亡时泌乳天数 */ + private Integer lactationDay; + + /** 死亡时怀孕天数 */ + private Integer gestationDay; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public void setSheepId(Long sheepId) + { + this.sheepId = sheepId; + } + + public Long getSheepId() + { + return sheepId; + } + + public void setManageTags(String manageTags) + { + this.manageTags = manageTags; + } + + public String getManageTags() + { + return manageTags; + } + + public void setEventType(String eventType) + { + this.eventType = eventType; + } + + public String getEventType() + { + return eventType; + } + + public void setDeathDate(Date deathDate) + { + this.deathDate = deathDate; + } + + public Date getDeathDate() + { + return deathDate; + } + + public void setDiseaseTypeId(Long diseaseTypeId) + { + this.diseaseTypeId = diseaseTypeId; + } + + public Long getDiseaseTypeId() + { + return diseaseTypeId; + } + + public void setDiseaseSubtypeId(Long diseaseSubtypeId) + { + this.diseaseSubtypeId = diseaseSubtypeId; + } + + public Long getDiseaseSubtypeId() + { + return diseaseSubtypeId; + } + + public void setDisposalDirection(String disposalDirection) + { + this.disposalDirection = disposalDirection; + } + + public String getDisposalDirection() + { + return disposalDirection; + } + + public void setTechnician(String technician) + { + this.technician = technician; + } + + public String getTechnician() + { + return technician; + } + + public void setHandler(String handler) + { + this.handler = handler; + } + + public String getHandler() + { + return handler; + } + + public void setWorkGroup(String workGroup) + { + this.workGroup = workGroup; + } + + public String getWorkGroup() + { + return workGroup; + } + + public void setComment(String comment) + { + this.comment = comment; + } + + public String getComment() + { + return comment; + } + + public void setIsDelete(Long isDelete) + { + this.isDelete = isDelete; + } + + public Long getIsDelete() + { + return isDelete; + } + + // 以下为仅用于显示的字段的getter/setter + public void setVariety(String variety) + { + this.variety = variety; + } + + public String getVariety() + { + return variety; + } + + public void setSheepType(String sheepType) + { + this.sheepType = sheepType; + } + + public String getSheepType() + { + return sheepType; + } + + public void setGender(Integer gender) + { + this.gender = gender; + } + + public Integer getGender() + { + return gender; + } + + public void setDayAge(Long dayAge) + { + this.dayAge = dayAge; + } + + public Long getDayAge() + { + return dayAge; + } + + public void setParity(Integer parity) + { + this.parity = parity; + } + + public Integer getParity() + { + return parity; + } + + public void setSheepfoldName(String sheepfoldName) + { + this.sheepfoldName = sheepfoldName; + } + + public String getSheepfoldName() + { + return sheepfoldName; + } + + public void setBreedStatus(String breedStatus) + { + this.breedStatus = breedStatus; + } + + public String getBreedStatus() + { + return breedStatus; + } + + public void setPostLambingDay(Integer postLambingDay) + { + this.postLambingDay = postLambingDay; + } + + public Integer getPostLambingDay() + { + return postLambingDay; + } + + public void setLactationDay(Integer lactationDay) + { + this.lactationDay = lactationDay; + } + + public Integer getLactationDay() + { + return lactationDay; + } + + public void setGestationDay(Integer gestationDay) + { + this.gestationDay = gestationDay; + } + + public Integer getGestationDay() + { + return gestationDay; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("sheepId", getSheepId()) + .append("manageTags", getManageTags()) + .append("eventType", getEventType()) + .append("deathDate", getDeathDate()) + .append("diseaseTypeId", getDiseaseTypeId()) + .append("diseaseSubtypeId", getDiseaseSubtypeId()) + .append("disposalDirection", getDisposalDirection()) + .append("technician", getTechnician()) + .append("handler", getHandler()) + .append("workGroup", getWorkGroup()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("comment", getComment()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("isDelete", getIsDelete()) + .toString(); + } +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/ScWeanRecord.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/ScWeanRecord.java new file mode 100644 index 0000000..79c70ce --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/ScWeanRecord.java @@ -0,0 +1,100 @@ +package com.zhyc.module.produce.breed.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 lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 断奶记录对象 sc_wean_record + * + * @author zhyc + * @date 2024-01-01 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +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; + + +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/SheepLambInfo.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/SheepLambInfo.java new file mode 100644 index 0000000..e8b79f7 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/domain/SheepLambInfo.java @@ -0,0 +1,25 @@ +package com.zhyc.module.produce.breed.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 羊只羔羊信息对象(用于产羔详情显示) + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +class SheepLambInfo { + private String lambEarNumber; // 羔羊耳号 + private String lambBreed; // 羔羊品种 + private Integer gender; // 性别 + private Double birthWeight; // 出生重量 + private Boolean isRetained; // 是否留养 + private String lineage; // 家系 + private Date birthday; // 生日 + + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/mapper/RawSpermRecordMapper.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/mapper/RawSpermRecordMapper.java new file mode 100644 index 0000000..a3b9ef8 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/mapper/RawSpermRecordMapper.java @@ -0,0 +1,69 @@ +package com.zhyc.module.produce.breed.mapper; + +import java.util.List; +import com.zhyc.module.produce.breed.domain.RawSpermRecord; + +/** + * 采精记录Mapper接口 + * + * @author ruoyi + * @date 2025-07-23 + */ +public interface RawSpermRecordMapper +{ + /** + * 查询采精记录 + * + * @param id 采精记录主键 + * @return 采精记录 + */ + public RawSpermRecord selectRawSpermRecordById(Long id); + + /** + * 查询采精记录列表 + * + * @param rawSpermRecord 采精记录 + * @return 采精记录集合 + */ + public List selectRawSpermRecordList(RawSpermRecord rawSpermRecord); + + /** + * 新增采精记录 + * + * @param rawSpermRecord 采精记录 + * @return 结果 + */ + public int insertRawSpermRecord(RawSpermRecord rawSpermRecord); + + /** + * 修改采精记录 + * + * @param rawSpermRecord 采精记录 + * @return 结果 + */ + public int updateRawSpermRecord(RawSpermRecord rawSpermRecord); + + /** + * 删除采精记录 + * + * @param id 采精记录主键 + * @return 结果 + */ + public int deleteRawSpermRecordById(Long id); + + /** + * 批量删除采精记录 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteRawSpermRecordByIds(Long[] ids); + + /** + * 根据耳号查询羊只ID + * + * @param manageTags 耳号 + * @return 羊只ID + */ + public Long selectSheepIdByManageTags(String manageTags); +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/mapper/ScBreedPlanGenerateMapper.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/mapper/ScBreedPlanGenerateMapper.java new file mode 100644 index 0000000..00eaf16 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/mapper/ScBreedPlanGenerateMapper.java @@ -0,0 +1,107 @@ +package com.zhyc.module.produce.breed.mapper; + +import java.util.List; +import java.util.Map; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import com.zhyc.module.produce.breed.domain.ScBreedPlanGenerate; +import com.zhyc.module.produce.breed.domain.ScBreedPlan; + +/** + * 配种计划生成Mapper接口 + * + * @author ruoyi + * @date 2025-07-16 + */ +@Mapper +public interface ScBreedPlanGenerateMapper +{ + /** + * 查询配种计划生成 + * + * @param id 配种计划生成主键 + * @return 配种计划生成 + */ + public ScBreedPlanGenerate selectScBreedPlanGenerateById(Long id); + + /** + * 查询配种计划生成列表 + * + * @param scBreedPlanGenerate 配种计划生成 + * @return 配种计划生成集合 + */ + public List selectScBreedPlanGenerateList(ScBreedPlanGenerate scBreedPlanGenerate); + + /** + * 筛选符合条件的母羊 + * + * @return 符合条件的母羊列表 + */ + public List> selectEligibleEwe(); + + /** + * 筛选符合条件的公羊 + * + * @return 符合条件的公羊列表 + */ + public List> selectEligibleRam(); + + /** + * 新增配种计划生成 + * + * @param scBreedPlanGenerate 配种计划生成 + * @return 结果 + */ + public int insertScBreedPlanGenerate(ScBreedPlanGenerate scBreedPlanGenerate); + + /** + * 插入临时配种计划 + * + * @param planGenerateId 配种计划生成ID + * @param breedPlan 配种计划 + * @return 结果 + */ + public int insertTempBreedPlan(@Param("planGenerateId") Long planGenerateId, + @Param("breedPlan") ScBreedPlan breedPlan); + + /** + * 修改配种计划生成 + * + * @param scBreedPlanGenerate 配种计划生成 + * @return 结果 + */ + public int updateScBreedPlanGenerate(ScBreedPlanGenerate scBreedPlanGenerate); + + /** + * 将临时配种计划转为正式配种计划 + * + * @param planGenerateId 配种计划生成ID + * @return 结果 + */ + public int transferTempToFormal(Long planGenerateId); + + /** + * 获取配种计划详情 + * + * @param planGenerateId 配种计划生成ID + * @return 配种计划详情列表 + */ + public List> selectBreedPlanDetails(Long planGenerateId); + + /** + * 删除配种计划生成 + * + * @param id 配种计划生成主键 + * @return 结果 + */ + public int deleteScBreedPlanGenerateById(Long id); + + /** + * 批量删除配种计划生成 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteScBreedPlanGenerateByIds(Long[] ids); +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/mapper/ScBreedPlanMapper.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/mapper/ScBreedPlanMapper.java new file mode 100644 index 0000000..9699efb --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/mapper/ScBreedPlanMapper.java @@ -0,0 +1,63 @@ +package com.zhyc.module.produce.breed.mapper; + +import java.util.List; +import com.zhyc.module.produce.breed.domain.ScBreedPlan; +import org.apache.ibatis.annotations.Mapper; + +/** + * 配种计划Mapper接口 + * + * @author ruoyi + * @date 2025-07-16 + */ +@Mapper +public interface ScBreedPlanMapper +{ + /** + * 查询配种计划 + * + * @param id 配种计划主键 + * @return 配种计划 + */ + public ScBreedPlan selectScBreedPlanById(Long id); + + /** + * 查询配种计划列表 + * + * @param scBreedPlan 配种计划 + * @return 配种计划集合 + */ + public List selectScBreedPlanList(ScBreedPlan scBreedPlan); + + /** + * 新增配种计划 + * + * @param scBreedPlan 配种计划 + * @return 结果 + */ + public int insertScBreedPlan(ScBreedPlan scBreedPlan); + + /** + * 修改配种计划 + * + * @param scBreedPlan 配种计划 + * @return 结果 + */ + public int updateScBreedPlan(ScBreedPlan scBreedPlan); + + /** + * 删除配种计划 + * + * @param id 配种计划主键 + * @return 结果 + */ + public int deleteScBreedPlanById(Long id); + + /** + * 批量删除配种计划 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteScBreedPlanByIds(Long[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/mapper/ScBreedRecordMapper.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/mapper/ScBreedRecordMapper.java new file mode 100644 index 0000000..ee67b34 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/mapper/ScBreedRecordMapper.java @@ -0,0 +1,94 @@ +package com.zhyc.module.produce.breed.mapper; + +import java.util.List; +import java.util.Map; +import com.zhyc.module.produce.breed.domain.ScBreedRecord; + +/** + * 配种记录Mapper接口 + * + * @author ruoyi + * @date 2025-07-23 + */ +public interface ScBreedRecordMapper +{ + /** + * 查询配种记录 + * + * @param id 配种记录主键 + * @return 配种记录 + */ + public ScBreedRecord selectScBreedRecordById(Long id); + + /** + * 查询配种记录列表 + * + * @param scBreedRecord 配种记录 + * @return 配种记录集合 + */ + public List selectScBreedRecordList(ScBreedRecord scBreedRecord); + + /** + * 新增配种记录 + * + * @param scBreedRecord 配种记录 + * @return 结果 + */ + public int insertScBreedRecord(ScBreedRecord scBreedRecord); + + /** + * 修改配种记录 + * + * @param scBreedRecord 配种记录 + * @return 结果 + */ + public int updateScBreedRecord(ScBreedRecord scBreedRecord); + + /** + * 删除配种记录 + * + * @param id 配种记录主键 + * @return 结果 + */ + public int deleteScBreedRecordById(Long id); + + /** + * 批量删除配种记录 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteScBreedRecordByIds(Long[] ids); + + /** + * 根据耳号查询羊只ID + * + * @param manageTags 管理耳号 + * @return 羊只ID + */ + public Long getSheepIdByManageTags(String manageTags); + + /** + * 根据公羊耳号查询羊只ID + * + * @param manageTags 管理耳号 + * @return 羊只ID + */ + public Long getRamIdByManageTags(String manageTags); + + /** + * 根据耳号查询羊只详细信息 + * + * @param manageTags 管理耳号 + * @return 羊只信息 + */ + public Map getSheepInfoByTags(String manageTags); + + /** + * 根据母羊耳号获取配种计划信息 + * + * @param manageTags 母羊管理耳号 + * @return 配种计划信息 + */ + public Map getBreedPlanByEweTags(String manageTags); +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/mapper/ScDryMilkMapper.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/mapper/ScDryMilkMapper.java new file mode 100644 index 0000000..742dbe7 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/mapper/ScDryMilkMapper.java @@ -0,0 +1,71 @@ +package com.zhyc.module.produce.breed.mapper; + +import java.util.List; +import com.zhyc.module.produce.breed.domain.ScDryMilk; +import org.apache.ibatis.annotations.Mapper; + +/** + * 干奶记录Mapper接口 + * + * @author ruoyi + * @date 2025-07-15 + */ +@Mapper +public interface ScDryMilkMapper +{ + /** + * 查询干奶记录 + * + * @param id 干奶记录主键 + * @return 干奶记录 + */ + public ScDryMilk selectScDryMilkById(Long id); + + /** + * 查询干奶记录列表 + * + * @param scDryMilk 干奶记录 + * @return 干奶记录集合 + */ + public List selectScDryMilkList(ScDryMilk scDryMilk); + + /** + * 根据耳号查询羊只ID + * + * @param manageTags 管理耳号 + * @return 羊只ID + */ + public Long selectSheepIdByManageTags(String manageTags); + + /** + * 新增干奶记录 + * + * @param scDryMilk 干奶记录 + * @return 结果 + */ + public int insertScDryMilk(ScDryMilk scDryMilk); + + /** + * 修改干奶记录 + * + * @param scDryMilk 干奶记录 + * @return 结果 + */ + public int updateScDryMilk(ScDryMilk scDryMilk); + + /** + * 删除干奶记录 + * + * @param id 干奶记录主键 + * @return 结果 + */ + public int deleteScDryMilkById(Long id); + + /** + * 批量删除干奶记录 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteScDryMilkByIds(Long[] ids); +} \ 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..85edef3 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/mapper/ScLambingRecordMapper.java @@ -0,0 +1,72 @@ +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; +import org.apache.ibatis.annotations.Mapper; + +/** + * 产羔记录Mapper接口 + * + * @author ruoyi + * @date 2025-07-11 + */ +@Mapper +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/mapper/ScPregnancyRecordMapper.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/mapper/ScPregnancyRecordMapper.java new file mode 100644 index 0000000..4962992 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/mapper/ScPregnancyRecordMapper.java @@ -0,0 +1,78 @@ +package com.zhyc.module.produce.breed.mapper; + +import java.util.List; +import java.util.Map; +import com.zhyc.module.produce.breed.domain.ScPregnancyRecord; + +/** + * 孕检记录Mapper接口 + * + * @author zhyc + * @date 2025-01-21 + */ +public interface ScPregnancyRecordMapper +{ + /** + * 查询孕检记录 + * + * @param id 孕检记录主键 + * @return 孕检记录 + */ + public ScPregnancyRecord selectScPregnancyRecordById(Long id); + + /** + * 查询孕检记录列表 + * + * @param scPregnancyRecord 孕检记录 + * @return 孕检记录集合 + */ + public List selectScPregnancyRecordList(ScPregnancyRecord scPregnancyRecord); + + /** + * 新增孕检记录 + * + * @param scPregnancyRecord 孕检记录 + * @return 结果 + */ + public int insertScPregnancyRecord(ScPregnancyRecord scPregnancyRecord); + + /** + * 修改孕检记录 + * + * @param scPregnancyRecord 孕检记录 + * @return 结果 + */ + public int updateScPregnancyRecord(ScPregnancyRecord scPregnancyRecord); + + /** + * 删除孕检记录 + * + * @param id 孕检记录主键 + * @return 结果 + */ + public int deleteScPregnancyRecordById(Long id); + + /** + * 批量删除孕检记录 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteScPregnancyRecordByIds(Long[] ids); + + /** + * 根据耳号查询羊只信息 + * + * @param manageTags 耳号 + * @return 羊只信息 + */ + public Map selectSheepByManageTags(String manageTags); + + /** + * 更新羊只基础表中的孕检相关字段 + * + * @param params 更新参数 + * @return 结果 + */ + public int updateSheepPregnancyInfo(Map params); +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/mapper/ScSheepDeathMapper.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/mapper/ScSheepDeathMapper.java new file mode 100644 index 0000000..980d20d --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/mapper/ScSheepDeathMapper.java @@ -0,0 +1,70 @@ +package com.zhyc.module.produce.breed.mapper; + +import java.util.List; +import java.util.Map; +import com.zhyc.module.produce.breed.domain.ScSheepDeath; + +/** + * 羊只死淘记录Mapper接口 + * + * @author ruoyi + * @date 2025-08-06 + */ +public interface ScSheepDeathMapper +{ + /** + * 查询羊只死淘记录 + * + * @param id 羊只死淘记录主键 + * @return 羊只死淘记录 + */ + public ScSheepDeath selectScSheepDeathById(Long id); + + /** + * 查询羊只死淘记录列表 + * + * @param scSheepDeath 羊只死淘记录 + * @return 羊只死淘记录集合 + */ + public List selectScSheepDeathList(ScSheepDeath scSheepDeath); + + /** + * 根据管理耳号查询sheep_file视图信息 + * + * @param manageTags 管理耳号 + * @return 羊只信息 + */ + public Map selectSheepFileByManageTags(String manageTags); + + /** + * 新增羊只死淘记录 + * + * @param scSheepDeath 羊只死淘记录 + * @return 结果 + */ + public int insertScSheepDeath(ScSheepDeath scSheepDeath); + + /** + * 修改羊只死淘记录 + * + * @param scSheepDeath 羊只死淘记录 + * @return 结果 + */ + public int updateScSheepDeath(ScSheepDeath scSheepDeath); + + /** + * 删除羊只死淘记录 + * + * @param id 羊只死淘记录主键 + * @return 结果 + */ + public int deleteScSheepDeathById(Long id); + + /** + * 批量删除羊只死淘记录 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteScSheepDeathByIds(Long[] ids); +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/mapper/ScWeanRecordMapper.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/mapper/ScWeanRecordMapper.java new file mode 100644 index 0000000..cb74588 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/mapper/ScWeanRecordMapper.java @@ -0,0 +1,78 @@ +package com.zhyc.module.produce.breed.mapper; + +import java.util.List; +import com.zhyc.module.produce.breed.domain.ScWeanRecord; +import org.apache.ibatis.annotations.Mapper; + +/** + * 断奶记录Mapper接口 + * + * @author zhyc + * @date 2024-01-01 + */ +@Mapper +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); + + /** + * 根据耳号更新bas_sheep表中的断奶信息 + * + * @param scWeanRecord 断奶记录 + * @return 结果 + */ + public int updateBasSheepWeaningInfo(ScWeanRecord scWeanRecord); +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/IRawSpermRecordService.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/IRawSpermRecordService.java new file mode 100644 index 0000000..a9b29f2 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/IRawSpermRecordService.java @@ -0,0 +1,69 @@ +package com.zhyc.module.produce.breed.service; + +import java.util.List; +import com.zhyc.module.produce.breed.domain.RawSpermRecord; + +/** + * 采精记录Service接口 + * + * @author ruoyi + * @date 2025-07-23 + */ +public interface IRawSpermRecordService +{ + /** + * 查询采精记录 + * + * @param id 采精记录主键 + * @return 采精记录 + */ + public RawSpermRecord selectRawSpermRecordById(Long id); + + /** + * 查询采精记录列表 + * + * @param rawSpermRecord 采精记录 + * @return 采精记录集合 + */ + public List selectRawSpermRecordList(RawSpermRecord rawSpermRecord); + + /** + * 新增采精记录 + * + * @param rawSpermRecord 采精记录 + * @return 结果 + */ + public int insertRawSpermRecord(RawSpermRecord rawSpermRecord); + + /** + * 修改采精记录 + * + * @param rawSpermRecord 采精记录 + * @return 结果 + */ + public int updateRawSpermRecord(RawSpermRecord rawSpermRecord); + + /** + * 批量删除采精记录 + * + * @param ids 需要删除的采精记录主键集合 + * @return 结果 + */ + public int deleteRawSpermRecordByIds(Long[] ids); + + /** + * 删除采精记录信息 + * + * @param id 采精记录主键 + * @return 结果 + */ + public int deleteRawSpermRecordById(Long id); + + /** + * 根据耳号查询羊只ID + * + * @param manageTags 耳号 + * @return 羊只ID + */ + public Long getSheepIdByManageTags(String manageTags); +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/IScBreedPlanGenerateService.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/IScBreedPlanGenerateService.java new file mode 100644 index 0000000..4580492 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/IScBreedPlanGenerateService.java @@ -0,0 +1,101 @@ +package com.zhyc.module.produce.breed.service; + +import java.util.List; +import java.util.Map; +import com.zhyc.module.produce.breed.domain.ScBreedPlanGenerate; + +/** + * 配种计划生成Service接口 + * + * @author ruoyi + * @date 2025-07-16 + */ +public interface IScBreedPlanGenerateService +{ + /** + * 查询配种计划生成 + * + * @param id 配种计划生成主键 + * @return 配种计划生成 + */ + public ScBreedPlanGenerate selectScBreedPlanGenerateById(Long id); + + /** + * 查询配种计划生成列表 + * + * @param scBreedPlanGenerate 配种计划生成 + * @return 配种计划生成集合 + */ + public List selectScBreedPlanGenerateList(ScBreedPlanGenerate scBreedPlanGenerate); + + /** + * 筛选符合条件的母羊 + * + * @return 符合条件的母羊列表 + */ + public List> selectEligibleEwe(); + + /** + * 筛选符合条件的公羊 + * + * @return 符合条件的公羊列表 + */ + public List> selectEligibleRam(); + + /** + * 自动生成配种计划 + * + * @param eweIds 母羊ID列表 + * @param ramIds 公羊ID列表 + * @return 生成的配种计划 + */ + public ScBreedPlanGenerate autoGenerateBreedPlan(List eweIds, List ramIds); + + /** + * 新增配种计划生成 + * + * @param scBreedPlanGenerate 配种计划生成 + * @return 结果 + */ + public int insertScBreedPlanGenerate(ScBreedPlanGenerate scBreedPlanGenerate); + + /** + * 修改配种计划生成 + * + * @param scBreedPlanGenerate 配种计划生成 + * @return 结果 + */ + public int updateScBreedPlanGenerate(ScBreedPlanGenerate scBreedPlanGenerate); + + /** + * 审批配种计划 + * + * @param id 配种计划ID + * @return 结果 + */ + public int approveBreedPlan(Long id); + + /** + * 获取配种计划详情 + * + * @param id 配种计划ID + * @return 配种计划详情 + */ + public Map getBreedPlanDetails(Long id); + + /** + * 批量删除配种计划生成 + * + * @param ids 需要删除的配种计划生成主键集合 + * @return 结果 + */ + public int deleteScBreedPlanGenerateByIds(Long[] ids); + + /** + * 删除配种计划生成信息 + * + * @param id 配种计划生成主键 + * @return 结果 + */ + public int deleteScBreedPlanGenerateById(Long id); +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/IScBreedPlanService.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/IScBreedPlanService.java new file mode 100644 index 0000000..256778e --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/IScBreedPlanService.java @@ -0,0 +1,62 @@ +package com.zhyc.module.produce.breed.service; + +import java.util.List; + +import com.zhyc.module.produce.breed.domain.ScBreedPlan; + +/** + * 配种计划Service接口 + * + * @author ruoyi + * @date 2025-07-16 + */ +public interface IScBreedPlanService +{ + /** + * 查询配种计划 + * + * @param id 配种计划主键 + * @return 配种计划 + */ + public ScBreedPlan selectScBreedPlanById(Long id); + + /** + * 查询配种计划列表 + * + * @param scBreedPlan 配种计划 + * @return 配种计划集合 + */ + public List selectScBreedPlanList(ScBreedPlan scBreedPlan); + + /** + * 新增配种计划 + * + * @param scBreedPlan 配种计划 + * @return 结果 + */ + public int insertScBreedPlan(ScBreedPlan scBreedPlan); + + /** + * 修改配种计划 + * + * @param scBreedPlan 配种计划 + * @return 结果 + */ + public int updateScBreedPlan(ScBreedPlan scBreedPlan); + + /** + * 批量删除配种计划 + * + * @param ids 需要删除的配种计划主键集合 + * @return 结果 + */ + public int deleteScBreedPlanByIds(Long[] ids); + + /** + * 删除配种计划信息 + * + * @param id 配种计划主键 + * @return 结果 + */ + public int deleteScBreedPlanById(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/IScBreedRecordService.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/IScBreedRecordService.java new file mode 100644 index 0000000..7f71704 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/IScBreedRecordService.java @@ -0,0 +1,94 @@ +package com.zhyc.module.produce.breed.service; + +import java.util.List; +import java.util.Map; +import com.zhyc.module.produce.breed.domain.ScBreedRecord; + +/** + * 配种记录Service接口 + * + * @author ruoyi + * @date 2025-07-23 + */ +public interface IScBreedRecordService +{ + /** + * 查询配种记录 + * + * @param id 配种记录主键 + * @return 配种记录 + */ + public ScBreedRecord selectScBreedRecordById(Long id); + + /** + * 查询配种记录列表 + * + * @param scBreedRecord 配种记录 + * @return 配种记录集合 + */ + public List selectScBreedRecordList(ScBreedRecord scBreedRecord); + + /** + * 新增配种记录 + * + * @param scBreedRecord 配种记录 + * @return 结果 + */ + public int insertScBreedRecord(ScBreedRecord scBreedRecord); + + /** + * 修改配种记录 + * + * @param scBreedRecord 配种记录 + * @return 结果 + */ + public int updateScBreedRecord(ScBreedRecord scBreedRecord); + + /** + * 批量删除配种记录 + * + * @param ids 需要删除的配种记录主键集合 + * @return 结果 + */ + public int deleteScBreedRecordByIds(Long[] ids); + + /** + * 删除配种记录信息 + * + * @param id 配种记录主键 + * @return 结果 + */ + public int deleteScBreedRecordById(Long id); + + /** + * 根据耳号查询羊只ID + * + * @param manageTags 管理耳号 + * @return 羊只ID + */ + public Long getSheepIdByTags(String manageTags); + + /** + * 根据公羊耳号查询羊只ID + * + * @param manageTags 管理耳号 + * @return 羊只ID + */ + public Long getRamIdByTags(String manageTags); + + /** + * 根据耳号查询羊只详细信息 + * + * @param manageTags 管理耳号 + * @return 羊只信息 + */ + public Map getSheepInfoByTags(String manageTags); + + /** + * 根据母羊耳号获取配种计划信息 + * + * @param manageTags 母羊管理耳号 + * @return 配种计划信息 + */ + public Map getBreedPlanByEweTags(String manageTags); +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/IScDryMilkService.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/IScDryMilkService.java new file mode 100644 index 0000000..ad90b57 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/IScDryMilkService.java @@ -0,0 +1,63 @@ +package com.zhyc.module.produce.breed.service; + +import java.util.List; +import com.zhyc.module.produce.breed.domain.ScDryMilk; + +/** + * 干奶记录Service接口 + * + * @author ruoyi + * @date 2025-07-15 + */ +public interface IScDryMilkService +{ + /** + * 查询干奶记录 + * + * @param id 干奶记录主键 + * @return 干奶记录 + */ + public ScDryMilk selectScDryMilkById(Long id); + + /** + * 查询干奶记录列表 + * + * @param scDryMilk 干奶记录 + * @return 干奶记录集合 + */ + public List selectScDryMilkList(ScDryMilk scDryMilk); + + Long selectSheepIdByManageTags(String manageTags); + + /** + * 新增干奶记录 + * + * @param scDryMilk 干奶记录 + * @return 结果 + */ + public int insertScDryMilk(ScDryMilk scDryMilk); + + /** + * 修改干奶记录 + * + * @param scDryMilk 干奶记录 + * @return 结果 + */ + public int updateScDryMilk(ScDryMilk scDryMilk); + + /** + * 批量删除干奶记录 + * + * @param ids 需要删除的干奶记录主键集合 + * @return 结果 + */ + public int deleteScDryMilkByIds(Long[] ids); + + /** + * 删除干奶记录信息 + * + * @param id 干奶记录主键 + * @return 结果 + */ + public int deleteScDryMilkById(Long id); +} 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/IScPregnancyRecordService.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/IScPregnancyRecordService.java new file mode 100644 index 0000000..bc0d2e4 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/IScPregnancyRecordService.java @@ -0,0 +1,70 @@ +package com.zhyc.module.produce.breed.service; + +import java.util.List; +import java.util.Map; +import com.zhyc.module.produce.breed.domain.ScPregnancyRecord; + +/** + * 孕检记录Service接口 + * + * @author zhyc + * @date 2025-01-21 + */ +public interface IScPregnancyRecordService +{ + /** + * 查询孕检记录 + * + * @param id 孕检记录主键 + * @return 孕检记录 + */ + public ScPregnancyRecord selectScPregnancyRecordById(Long id); + + /** + * 查询孕检记录列表 + * + * @param scPregnancyRecord 孕检记录 + * @return 孕检记录集合 + */ + public List selectScPregnancyRecordList(ScPregnancyRecord scPregnancyRecord); + + /** + * 新增孕检记录 + * + * @param scPregnancyRecord 孕检记录 + * @return 结果 + */ + public int insertScPregnancyRecord(ScPregnancyRecord scPregnancyRecord); + + /** + * 修改孕检记录 + * + * @param scPregnancyRecord 孕检记录 + * @return 结果 + */ + public int updateScPregnancyRecord(ScPregnancyRecord scPregnancyRecord); + + /** + * 批量删除孕检记录 + * + * @param ids 需要删除的孕检记录主键集合 + * @return 结果 + */ + public int deleteScPregnancyRecordByIds(Long[] ids); + + /** + * 删除孕检记录信息 + * + * @param id 孕检记录主键 + * @return 结果 + */ + public int deleteScPregnancyRecordById(Long id); + + /** + * 根据耳号查询羊只信息 + * + * @param manageTags 耳号 + * @return 羊只信息 + */ + public Map getSheepByManageTags(String manageTags); +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/IScSheepDeathService.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/IScSheepDeathService.java new file mode 100644 index 0000000..e1100d5 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/IScSheepDeathService.java @@ -0,0 +1,70 @@ +package com.zhyc.module.produce.breed.service; + +import java.util.List; +import java.util.Map; +import com.zhyc.module.produce.breed.domain.ScSheepDeath; + +/** + * 羊只死淘记录Service接口 + * + * @author ruoyi + * @date 2025-08-06 + */ +public interface IScSheepDeathService +{ + /** + * 查询羊只死淘记录 + * + * @param id 羊只死淘记录主键 + * @return 羊只死淘记录 + */ + public ScSheepDeath selectScSheepDeathById(Long id); + + /** + * 查询羊只死淘记录列表 + * + * @param scSheepDeath 羊只死淘记录 + * @return 羊只死淘记录集合 + */ + public List selectScSheepDeathList(ScSheepDeath scSheepDeath); + + /** + * 根据管理耳号查询sheep_file视图信息 + * + * @param manageTags 管理耳号 + * @return 羊只信息 + */ + public Map selectSheepFileByManageTags(String manageTags); + + /** + * 新增羊只死淘记录 + * + * @param scSheepDeath 羊只死淘记录 + * @return 结果 + */ + public int insertScSheepDeath(ScSheepDeath scSheepDeath); + + /** + * 修改羊只死淘记录 + * + * @param scSheepDeath 羊只死淘记录 + * @return 结果 + */ + public int updateScSheepDeath(ScSheepDeath scSheepDeath); + + /** + * 批量删除羊只死淘记录 + * + * @param ids 需要删除的羊只死淘记录主键集合 + * @return 结果 + */ + public int deleteScSheepDeathByIds(Long[] ids); + + /** + * 删除羊只死淘记录信息 + * + * @param id 羊只死淘记录主键 + * @return 结果 + */ + public int deleteScSheepDeathById(Long id); +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/IScWeanRecordService.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/IScWeanRecordService.java new file mode 100644 index 0000000..9f49b44 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/IScWeanRecordService.java @@ -0,0 +1,69 @@ +package com.zhyc.module.produce.breed.service; + +import java.util.List; + +import com.zhyc.module.produce.breed.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/breed/service/impl/RawSpermRecordServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/impl/RawSpermRecordServiceImpl.java new file mode 100644 index 0000000..f925b77 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/impl/RawSpermRecordServiceImpl.java @@ -0,0 +1,120 @@ +package com.zhyc.module.produce.breed.service.impl; + +import java.util.List; +import com.zhyc.common.utils.DateUtils; +import com.zhyc.common.utils.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.zhyc.module.produce.breed.mapper.RawSpermRecordMapper; +import com.zhyc.module.produce.breed.domain.RawSpermRecord; +import com.zhyc.module.produce.breed.service.IRawSpermRecordService; + +/** + * 采精记录Service业务层处理 + * + * @author ruoyi + * @date 2025-07-23 + */ +@Service +public class RawSpermRecordServiceImpl implements IRawSpermRecordService +{ + @Autowired + private RawSpermRecordMapper rawSpermRecordMapper; + + /** + * 查询采精记录 + * + * @param id 采精记录主键 + * @return 采精记录 + */ + @Override + public RawSpermRecord selectRawSpermRecordById(Long id) + { + return rawSpermRecordMapper.selectRawSpermRecordById(id); + } + + /** + * 查询采精记录列表 + * + * @param rawSpermRecord 采精记录 + * @return 采精记录 + */ + @Override + public List selectRawSpermRecordList(RawSpermRecord rawSpermRecord) + { + return rawSpermRecordMapper.selectRawSpermRecordList(rawSpermRecord); + } + + /** + * 新增采精记录 + * + * @param rawSpermRecord 采精记录 + * @return 结果 + */ + @Override + public int insertRawSpermRecord(RawSpermRecord rawSpermRecord) + { + // 如果传入的是耳号,需要先根据耳号查询羊只ID + if (StringUtils.isNotEmpty(rawSpermRecord.getManageTags()) && rawSpermRecord.getSheepId() == null) { + Long sheepId = getSheepIdByManageTags(rawSpermRecord.getManageTags()); + rawSpermRecord.setSheepId(sheepId); + } + + rawSpermRecord.setCreateTime(DateUtils.getNowDate()); + return rawSpermRecordMapper.insertRawSpermRecord(rawSpermRecord); + } + + /** + * 修改采精记录 + * + * @param rawSpermRecord 采精记录 + * @return 结果 + */ + @Override + public int updateRawSpermRecord(RawSpermRecord rawSpermRecord) + { + // 如果传入的是耳号,需要先根据耳号查询羊只ID + if (StringUtils.isNotEmpty(rawSpermRecord.getManageTags()) && rawSpermRecord.getSheepId() == null) { + Long sheepId = getSheepIdByManageTags(rawSpermRecord.getManageTags()); + rawSpermRecord.setSheepId(sheepId); + } + + return rawSpermRecordMapper.updateRawSpermRecord(rawSpermRecord); + } + + /** + * 批量删除采精记录 + * + * @param ids 需要删除的采精记录主键 + * @return 结果 + */ + @Override + public int deleteRawSpermRecordByIds(Long[] ids) + { + return rawSpermRecordMapper.deleteRawSpermRecordByIds(ids); + } + + /** + * 删除采精记录信息 + * + * @param id 采精记录主键 + * @return 结果 + */ + @Override + public int deleteRawSpermRecordById(Long id) + { + return rawSpermRecordMapper.deleteRawSpermRecordById(id); + } + + /** + * 根据耳号查询羊只ID + * + * @param manageTags 耳号 + * @return 羊只ID + */ + @Override + public Long getSheepIdByManageTags(String manageTags) + { + return rawSpermRecordMapper.selectSheepIdByManageTags(manageTags); + } +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/impl/ScBreedPlanGenerateServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/impl/ScBreedPlanGenerateServiceImpl.java new file mode 100644 index 0000000..3e88f7c --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/impl/ScBreedPlanGenerateServiceImpl.java @@ -0,0 +1,240 @@ +package com.zhyc.module.produce.breed.service.impl; + +import java.util.List; +import java.util.Map; +import java.util.HashMap; +import java.util.Date; +import java.text.SimpleDateFormat; + +import com.zhyc.module.produce.breed.domain.ScBreedPlan; +import com.zhyc.module.produce.breed.domain.ScBreedPlanGenerate; +import com.zhyc.module.produce.breed.mapper.ScBreedPlanGenerateMapper; +import com.zhyc.module.produce.breed.mapper.ScBreedPlanMapper; +import com.zhyc.module.produce.breed.service.IScBreedPlanGenerateService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import com.zhyc.common.utils.SecurityUtils; + +/** + * 配种计划生成Service业务层处理 + * + * @author ruoyi + * @date 2025-07-16 + */ +@Service +public class ScBreedPlanGenerateServiceImpl implements IScBreedPlanGenerateService +{ + @Autowired + private ScBreedPlanGenerateMapper scBreedPlanGenerateMapper; + + @Autowired + private ScBreedPlanMapper scBreedPlanMapper; + + /** + * 查询配种计划生成 + * + * @param id 配种计划生成主键 + * @return 配种计划生成 + */ + @Override + public ScBreedPlanGenerate selectScBreedPlanGenerateById(Long id) + { + return scBreedPlanGenerateMapper.selectScBreedPlanGenerateById(id); + } + + /** + * 查询配种计划生成列表 + * + * @param scBreedPlanGenerate 配种计划生成 + * @return 配种计划生成 + */ + @Override + public List selectScBreedPlanGenerateList(ScBreedPlanGenerate scBreedPlanGenerate) + { + return scBreedPlanGenerateMapper.selectScBreedPlanGenerateList(scBreedPlanGenerate); + } + + /** + * 筛选符合条件的母羊 + * + * @return 符合条件的母羊列表 + */ + @Override + public List> selectEligibleEwe() + { + return scBreedPlanGenerateMapper.selectEligibleEwe(); + } + + /** + * 筛选符合条件的公羊 + * + * @return 符合条件的公羊列表 + */ + @Override + public List> selectEligibleRam() + { + return scBreedPlanGenerateMapper.selectEligibleRam(); + } + + /** + * 自动生成配种计划 + * + * @param eweIds 母羊ID列表 + * @param ramIds 公羊ID列表 + * @return 生成的配种计划 + */ + @Override + @Transactional + public ScBreedPlanGenerate autoGenerateBreedPlan(List eweIds, List ramIds) + { + // 创建配种计划生成记录 + ScBreedPlanGenerate planGenerate = new ScBreedPlanGenerate(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + String dateStr = sdf.format(new Date()); + planGenerate.setPlanName(dateStr + "同期发情配种计划"); + planGenerate.setPlanType(1); + planGenerate.setPlanDate(new Date()); + planGenerate.setTotalEweCount(eweIds.size()); + planGenerate.setTotalRamCount(ramIds.size()); + + // 计算配种比例 + double ratio = (double) eweIds.size() / ramIds.size(); + planGenerate.setBreedRatio(String.format("%.1f:1", ratio)); + planGenerate.setStatus(0); // 待审批 + planGenerate.setCreateBy(SecurityUtils.getUsername()); + planGenerate.setCreateTime(new Date()); + + // 保存配种计划生成记录 + scBreedPlanGenerateMapper.insertScBreedPlanGenerate(planGenerate); + + // 生成具体的配种计划 + generateBreedPlanDetails(planGenerate.getId(), eweIds, ramIds); + + return planGenerate; + } + + /** + * 生成具体的配种计划详情 + */ + private void generateBreedPlanDetails(Long planGenerateId, List eweIds, List ramIds) + { + int ramIndex = 0; + int ewesPerRam = (int) Math.ceil((double) eweIds.size() / ramIds.size()); + + for (int i = 0; i < eweIds.size(); i++) { + ScBreedPlan breedPlan = new ScBreedPlan(); + breedPlan.setRamId(ramIds.get(ramIndex).toString()); + breedPlan.setEweId(eweIds.get(i).toString()); + breedPlan.setBreedType(1L); // 默认配种类型 + + // 插入临时配种计划,关联到生成记录 + scBreedPlanGenerateMapper.insertTempBreedPlan(planGenerateId, breedPlan); + + // 每个公羊配种指定数量的母羊后,切换到下一个公羊 + if ((i + 1) % ewesPerRam == 0 && ramIndex < ramIds.size() - 1) { + ramIndex++; + } + } + } + + /** + * 新增配种计划生成 + * + * @param scBreedPlanGenerate 配种计划生成 + * @return 结果 + */ + @Override + public int insertScBreedPlanGenerate(ScBreedPlanGenerate scBreedPlanGenerate) + { + scBreedPlanGenerate.setCreateTime(new Date()); + return scBreedPlanGenerateMapper.insertScBreedPlanGenerate(scBreedPlanGenerate); + } + + /** + * 修改配种计划生成 + * + * @param scBreedPlanGenerate 配种计划生成 + * @return 结果 + */ + @Override + public int updateScBreedPlanGenerate(ScBreedPlanGenerate scBreedPlanGenerate) + { + scBreedPlanGenerate.setUpdateTime(new Date()); + return scBreedPlanGenerateMapper.updateScBreedPlanGenerate(scBreedPlanGenerate); + } + + /** + * 审批配种计划 + * + * @param id 配种计划ID + * @return 结果 + */ + @Override + @Transactional + public int approveBreedPlan(Long id) + { + // 更新审批状态 + ScBreedPlanGenerate planGenerate = new ScBreedPlanGenerate(); + planGenerate.setId(id); + planGenerate.setStatus(1); // 已审批 + planGenerate.setApprover(SecurityUtils.getUsername()); + planGenerate.setApproveTime(new Date()); + planGenerate.setUpdateTime(new Date()); + + int result = scBreedPlanGenerateMapper.updateScBreedPlanGenerate(planGenerate); + + // 将临时配种计划转为正式配种计划 + if (result > 0) { + scBreedPlanGenerateMapper.transferTempToFormal(id); + } + + return result; + } + + /** + * 获取配种计划详情 + * + * @param id 配种计划ID + * @return 配种计划详情 + */ + @Override + public Map getBreedPlanDetails(Long id) + { + Map result = new HashMap<>(); + + // 获取配种计划基本信息 + ScBreedPlanGenerate planGenerate = scBreedPlanGenerateMapper.selectScBreedPlanGenerateById(id); + result.put("planInfo", planGenerate); + + // 获取配种计划详情列表 + List> planDetails = scBreedPlanGenerateMapper.selectBreedPlanDetails(id); + result.put("planDetails", planDetails); + + return result; + } + + /** + * 批量删除配种计划生成 + * + * @param ids 需要删除的配种计划生成主键 + * @return 结果 + */ + @Override + public int deleteScBreedPlanGenerateByIds(Long[] ids) + { + return scBreedPlanGenerateMapper.deleteScBreedPlanGenerateByIds(ids); + } + + /** + * 删除配种计划生成信息 + * + * @param id 配种计划生成主键 + * @return 结果 + */ + @Override + public int deleteScBreedPlanGenerateById(Long id) + { + return scBreedPlanGenerateMapper.deleteScBreedPlanGenerateById(id); + } +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/impl/ScBreedPlanServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/impl/ScBreedPlanServiceImpl.java new file mode 100644 index 0000000..f6ae9b0 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/impl/ScBreedPlanServiceImpl.java @@ -0,0 +1,94 @@ +package com.zhyc.module.produce.breed.service.impl; + +import java.util.List; + +import com.zhyc.module.produce.breed.domain.ScBreedPlan; +import com.zhyc.module.produce.breed.mapper.ScBreedPlanMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.zhyc.module.produce.breed.service.IScBreedPlanService; + +/** + * 配种计划Service业务层处理 + * + * @author ruoyi + * @date 2025-07-16 + */ +@Service +public class ScBreedPlanServiceImpl implements IScBreedPlanService +{ + @Autowired + private ScBreedPlanMapper scBreedPlanMapper; + + /** + * 查询配种计划 + * + * @param id 配种计划主键 + * @return 配种计划 + */ + @Override + public ScBreedPlan selectScBreedPlanById(Long id) + { + return scBreedPlanMapper.selectScBreedPlanById(id); + } + + /** + * 查询配种计划列表 + * + * @param scBreedPlan 配种计划 + * @return 配种计划 + */ + @Override + public List selectScBreedPlanList(ScBreedPlan scBreedPlan) + { + return scBreedPlanMapper.selectScBreedPlanList(scBreedPlan); + } + + /** + * 新增配种计划 + * + * @param scBreedPlan 配种计划 + * @return 结果 + */ + @Override + public int insertScBreedPlan(ScBreedPlan scBreedPlan) + { + return scBreedPlanMapper.insertScBreedPlan(scBreedPlan); + } + + /** + * 修改配种计划 + * + * @param scBreedPlan 配种计划 + * @return 结果 + */ + @Override + public int updateScBreedPlan(ScBreedPlan scBreedPlan) + { + return scBreedPlanMapper.updateScBreedPlan(scBreedPlan); + } + + /** + * 批量删除配种计划 + * + * @param ids 需要删除的配种计划主键 + * @return 结果 + */ + @Override + public int deleteScBreedPlanByIds(Long[] ids) + { + return scBreedPlanMapper.deleteScBreedPlanByIds(ids); + } + + /** + * 删除配种计划信息 + * + * @param id 配种计划主键 + * @return 结果 + */ + @Override + public int deleteScBreedPlanById(Long id) + { + return scBreedPlanMapper.deleteScBreedPlanById(id); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/impl/ScBreedRecordServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/impl/ScBreedRecordServiceImpl.java new file mode 100644 index 0000000..61ab012 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/impl/ScBreedRecordServiceImpl.java @@ -0,0 +1,164 @@ +package com.zhyc.module.produce.breed.service.impl; + +import java.util.List; +import java.util.Map; +import com.zhyc.common.utils.DateUtils; +import com.zhyc.common.utils.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.zhyc.module.produce.breed.mapper.ScBreedRecordMapper; +import com.zhyc.module.produce.breed.domain.ScBreedRecord; +import com.zhyc.module.produce.breed.service.IScBreedRecordService; + +/** + * 配种记录Service业务层处理 + * + * @author ruoyi + * @date 2025-07-23 + */ +@Service +public class ScBreedRecordServiceImpl implements IScBreedRecordService +{ + @Autowired + private ScBreedRecordMapper scBreedRecordMapper; + + /** + * 查询配种记录 + * + * @param id 配种记录主键 + * @return 配种记录 + */ + @Override + public ScBreedRecord selectScBreedRecordById(Long id) + { + return scBreedRecordMapper.selectScBreedRecordById(id); + } + + /** + * 查询配种记录列表 + * + * @param scBreedRecord 配种记录 + * @return 配种记录 + */ + @Override + public List selectScBreedRecordList(ScBreedRecord scBreedRecord) + { + // 如果查询条件中有耳号,需要先转换为ID + if (StringUtils.isNotEmpty(scBreedRecord.getEweManageTags())) + { + Long eweId = scBreedRecordMapper.getSheepIdByManageTags(scBreedRecord.getEweManageTags()); + if (eweId != null) + { + scBreedRecord.setEweId(eweId.toString()); + } + } + + if (StringUtils.isNotEmpty(scBreedRecord.getRamManageTags())) + { + Long ramId = scBreedRecordMapper.getRamIdByManageTags(scBreedRecord.getRamManageTags()); + if (ramId != null) + { + scBreedRecord.setRamId(ramId.toString()); + } + } + + return scBreedRecordMapper.selectScBreedRecordList(scBreedRecord); + } + + /** + * 新增配种记录 + * + * @param scBreedRecord 配种记录 + * @return 结果 + */ + @Override + public int insertScBreedRecord(ScBreedRecord scBreedRecord) + { + scBreedRecord.setCreateTime(DateUtils.getNowDate()); + return scBreedRecordMapper.insertScBreedRecord(scBreedRecord); + } + + /** + * 修改配种记录 + * + * @param scBreedRecord 配种记录 + * @return 结果 + */ + @Override + public int updateScBreedRecord(ScBreedRecord scBreedRecord) + { + return scBreedRecordMapper.updateScBreedRecord(scBreedRecord); + } + + /** + * 批量删除配种记录 + * + * @param ids 需要删除的配种记录主键 + * @return 结果 + */ + @Override + public int deleteScBreedRecordByIds(Long[] ids) + { + return scBreedRecordMapper.deleteScBreedRecordByIds(ids); + } + + /** + * 删除配种记录信息 + * + * @param id 配种记录主键 + * @return 结果 + */ + @Override + public int deleteScBreedRecordById(Long id) + { + return scBreedRecordMapper.deleteScBreedRecordById(id); + } + + /** + * 根据耳号查询羊只ID + * + * @param manageTags 管理耳号 + * @return 羊只ID + */ + @Override + public Long getSheepIdByTags(String manageTags) + { + return scBreedRecordMapper.getSheepIdByManageTags(manageTags); + } + + /** + * 根据公羊耳号查询羊只ID + * + * @param manageTags 管理耳号 + * @return 羊只ID + */ + @Override + public Long getRamIdByTags(String manageTags) + { + return scBreedRecordMapper.getRamIdByManageTags(manageTags); + } + + /** + * 根据耳号查询羊只详细信息 + * + * @param manageTags 管理耳号 + * @return 羊只信息 + */ + @Override + public Map getSheepInfoByTags(String manageTags) + { + return scBreedRecordMapper.getSheepInfoByTags(manageTags); + } + + /** + * 根据母羊耳号获取配种计划信息 + * + * @param manageTags 母羊管理耳号 + * @return 配种计划信息 + */ + @Override + public Map getBreedPlanByEweTags(String manageTags) + { + return scBreedRecordMapper.getBreedPlanByEweTags(manageTags); + } +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/impl/ScDryMilkServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/impl/ScDryMilkServiceImpl.java new file mode 100644 index 0000000..dd87f80 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/impl/ScDryMilkServiceImpl.java @@ -0,0 +1,127 @@ +package com.zhyc.module.produce.breed.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.zhyc.module.produce.breed.mapper.ScDryMilkMapper; +import com.zhyc.module.produce.breed.domain.ScDryMilk; +import com.zhyc.module.produce.breed.service.IScDryMilkService; +import com.zhyc.common.utils.StringUtils; +import com.zhyc.common.exception.ServiceException; + +/** + * 干奶记录Service业务层处理 + * + * @author ruoyi + * @date 2025-07-15 + */ +@Service +public class ScDryMilkServiceImpl implements IScDryMilkService +{ + @Autowired + private ScDryMilkMapper scDryMilkMapper; + + /** + * 查询干奶记录 + * + * @param id 干奶记录主键 + * @return 干奶记录 + */ + @Override + public ScDryMilk selectScDryMilkById(Long id) + { + return scDryMilkMapper.selectScDryMilkById(id); + } + + /** + * 查询干奶记录列表 + * + * @param scDryMilk 干奶记录 + * @return 干奶记录 + */ + @Override + public List selectScDryMilkList(ScDryMilk scDryMilk) + { + return scDryMilkMapper.selectScDryMilkList(scDryMilk); + } + + /** + * 根据耳号查询羊只ID + * + * @param manageTags 管理耳号 + * @return 羊只ID + */ + @Override + public Long selectSheepIdByManageTags(String manageTags) + { + return scDryMilkMapper.selectSheepIdByManageTags(manageTags); + } + + /** + * 新增干奶记录 + * + * @param scDryMilk 干奶记录 + * @return 结果 + */ + @Override + public int insertScDryMilk(ScDryMilk scDryMilk) + { + // 如果传入的是耳号,需要转换为羊只ID + if (StringUtils.isNotEmpty(scDryMilk.getManageTags()) && StringUtils.isEmpty(scDryMilk.getSheepId())) + { + Long sheepId = scDryMilkMapper.selectSheepIdByManageTags(scDryMilk.getManageTags()); + if (sheepId == null) + { + throw new ServiceException("未找到对应耳号的羊只信息"); + } + scDryMilk.setSheepId(String.valueOf(sheepId)); + } + return scDryMilkMapper.insertScDryMilk(scDryMilk); + } + + /** + * 修改干奶记录 + * + * @param scDryMilk 干奶记录 + * @return 结果 + */ + @Override + public int updateScDryMilk(ScDryMilk scDryMilk) + { + // 如果传入的是耳号,需要转换为羊只ID + if (StringUtils.isNotEmpty(scDryMilk.getManageTags()) && StringUtils.isEmpty(scDryMilk.getSheepId())) + { + Long sheepId = scDryMilkMapper.selectSheepIdByManageTags(scDryMilk.getManageTags()); + if (sheepId == null) + { + throw new ServiceException("未找到对应耳号的羊只信息"); + } + scDryMilk.setSheepId(String.valueOf(sheepId)); + } + return scDryMilkMapper.updateScDryMilk(scDryMilk); + } + + /** + * 批量删除干奶记录 + * + * @param ids 需要删除的干奶记录主键 + * @return 结果 + */ + @Override + public int deleteScDryMilkByIds(Long[] ids) + { + return scDryMilkMapper.deleteScDryMilkByIds(ids); + } + + /** + * 删除干奶记录信息 + * + * @param id 干奶记录主键 + * @return 结果 + */ + @Override + public int deleteScDryMilkById(Long id) + { + return scDryMilkMapper.deleteScDryMilkById(id); + } +} \ 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/breed/service/impl/ScPregnancyRecordServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/impl/ScPregnancyRecordServiceImpl.java new file mode 100644 index 0000000..dde2c3d --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/impl/ScPregnancyRecordServiceImpl.java @@ -0,0 +1,179 @@ +package com.zhyc.module.produce.breed.service.impl; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Date; +import java.util.Calendar; + +import com.zhyc.common.utils.DateUtils; +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.ScPregnancyRecordMapper; +import com.zhyc.module.produce.breed.domain.ScPregnancyRecord; +import com.zhyc.module.produce.breed.service.IScPregnancyRecordService; + +/** + * 孕检记录Service业务层处理 + * + * @author zhyc + * @date 2025-01-21 + */ +@Service +public class ScPregnancyRecordServiceImpl implements IScPregnancyRecordService +{ + @Autowired + private ScPregnancyRecordMapper scPregnancyRecordMapper; + + /** + * 查询孕检记录 + * + * @param id 孕检记录主键 + * @return 孕检记录 + */ + @Override + public ScPregnancyRecord selectScPregnancyRecordById(Long id) + { + return scPregnancyRecordMapper.selectScPregnancyRecordById(id); + } + + /** + * 查询孕检记录列表 + * + * @param scPregnancyRecord 孕检记录 + * @return 孕检记录 + */ + @Override + public List selectScPregnancyRecordList(ScPregnancyRecord scPregnancyRecord) + { + return scPregnancyRecordMapper.selectScPregnancyRecordList(scPregnancyRecord); + } + + /** + * 新增孕检记录 + * + * @param scPregnancyRecord 孕检记录 + * @return 结果 + */ + @Override + @Transactional + public int insertScPregnancyRecord(ScPregnancyRecord scPregnancyRecord) + { + scPregnancyRecord.setCreateTime(DateUtils.getNowDate()); + scPregnancyRecord.setIsDelete(0); + + // 根据耳号获取羊只ID + if (scPregnancyRecord.getManageTags() != null) { + Map sheepInfo = scPregnancyRecordMapper.selectSheepByManageTags(scPregnancyRecord.getManageTags()); + if (sheepInfo != null && sheepInfo.get("id") != null) { + scPregnancyRecord.setSheepId(Long.valueOf(sheepInfo.get("id").toString())); + } + } + + int result = scPregnancyRecordMapper.insertScPregnancyRecord(scPregnancyRecord); + + // 如果孕检结果为怀孕,更新羊只基础表相关字段 + if ("怀孕".equals(scPregnancyRecord.getResult()) && scPregnancyRecord.getSheepId() != null) { + updateSheepPregnancyStatus(scPregnancyRecord); + } + + return result; + } + + /** + * 修改孕检记录 + * + * @param scPregnancyRecord 孕检记录 + * @return 结果 + */ + @Override + @Transactional + public int updateScPregnancyRecord(ScPregnancyRecord scPregnancyRecord) + { + scPregnancyRecord.setUpdateTime(DateUtils.getNowDate()); + + // 根据耳号获取羊只ID + if (scPregnancyRecord.getManageTags() != null) { + Map sheepInfo = scPregnancyRecordMapper.selectSheepByManageTags(scPregnancyRecord.getManageTags()); + if (sheepInfo != null && sheepInfo.get("id") != null) { + scPregnancyRecord.setSheepId(Long.valueOf(sheepInfo.get("id").toString())); + } + } + + int result = scPregnancyRecordMapper.updateScPregnancyRecord(scPregnancyRecord); + + // 如果孕检结果为怀孕,更新羊只基础表相关字段 + if ("怀孕".equals(scPregnancyRecord.getResult()) && scPregnancyRecord.getSheepId() != null) { + updateSheepPregnancyStatus(scPregnancyRecord); + } + + return result; + } + + /** + * 批量删除孕检记录 + * + * @param ids 需要删除的孕检记录主键 + * @return 结果 + */ + @Override + public int deleteScPregnancyRecordByIds(Long[] ids) + { + return scPregnancyRecordMapper.deleteScPregnancyRecordByIds(ids); + } + + /** + * 删除孕检记录信息 + * + * @param id 孕检记录主键 + * @return 结果 + */ + @Override + public int deleteScPregnancyRecordById(Long id) + { + return scPregnancyRecordMapper.deleteScPregnancyRecordById(id); + } + + /** + * 根据耳号查询羊只信息 + * + * @param manageTags 耳号 + * @return 羊只信息 + */ + @Override + public Map getSheepByManageTags(String manageTags) + { + return scPregnancyRecordMapper.selectSheepByManageTags(manageTags); + } + + /** + * 更新羊只怀孕状态 + * + * @param scPregnancyRecord 孕检记录 + */ + private void updateSheepPregnancyStatus(ScPregnancyRecord scPregnancyRecord) { + Map params = new HashMap<>(); + params.put("sheepId", scPregnancyRecord.getSheepId()); + params.put("pregDate", scPregnancyRecord.getDatetime()); + + // 设置繁育状态为怀孕状态(假设怀孕状态ID为2) + params.put("breedStatusId", 2); + + // 计算预产日期(羊的妊娠期大约150天) + if (scPregnancyRecord.getDatetime() != null) { + Calendar cal = Calendar.getInstance(); + cal.setTime(scPregnancyRecord.getDatetime()); + cal.add(Calendar.DAY_OF_YEAR, 150); + params.put("expectedDate", cal.getTime()); + } + + // 计算怀孕天数 + if (scPregnancyRecord.getDatetime() != null) { + long days = (System.currentTimeMillis() - scPregnancyRecord.getDatetime().getTime()) / (1000 * 60 * 60 * 24); + params.put("gestationDay", (int) days); + } + + scPregnancyRecordMapper.updateSheepPregnancyInfo(params); + } +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/impl/ScSheepDeathServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/impl/ScSheepDeathServiceImpl.java new file mode 100644 index 0000000..12e7afd --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/impl/ScSheepDeathServiceImpl.java @@ -0,0 +1,166 @@ +package com.zhyc.module.produce.breed.service.impl; + +import java.util.List; +import java.util.Map; +import com.zhyc.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.zhyc.module.produce.breed.mapper.ScSheepDeathMapper; +import com.zhyc.module.produce.breed.domain.ScSheepDeath; +import com.zhyc.module.produce.breed.service.IScSheepDeathService; + +/** + * 羊只死淘记录Service业务层处理 + * + * @author ruoyi + * @date 2025-08-06 + */ +@Service +public class ScSheepDeathServiceImpl implements IScSheepDeathService +{ + @Autowired + private ScSheepDeathMapper scSheepDeathMapper; + + /** + * 查询羊只死淘记录 + * + * @param id 羊只死淘记录主键 + * @return 羊只死淘记录 + */ + @Override + public ScSheepDeath selectScSheepDeathById(Long id) + { + ScSheepDeath scSheepDeath = scSheepDeathMapper.selectScSheepDeathById(id); + // 查询时也需要填充显示字段 + if (scSheepDeath != null && scSheepDeath.getManageTags() != null) { + Map sheepInfo = selectSheepFileByManageTags(scSheepDeath.getManageTags()); + if (sheepInfo != null) { + scSheepDeath.setVariety(sheepInfo.get("variety") != null ? sheepInfo.get("variety").toString() : null); + scSheepDeath.setSheepType(sheepInfo.get("sheepType") != null ? sheepInfo.get("sheepType").toString() : null); + scSheepDeath.setGender(sheepInfo.get("gender") != null ? Integer.valueOf(sheepInfo.get("gender").toString()) : null); + scSheepDeath.setDayAge(sheepInfo.get("dayAge") != null ? Long.valueOf(sheepInfo.get("dayAge").toString()) : null); + scSheepDeath.setParity(sheepInfo.get("parity") != null ? Integer.valueOf(sheepInfo.get("parity").toString()) : null); + scSheepDeath.setSheepfoldName(sheepInfo.get("sheepfoldName") != null ? sheepInfo.get("sheepfoldName").toString() : null); + scSheepDeath.setBreedStatus(sheepInfo.get("breedStatus") != null ? sheepInfo.get("breedStatus").toString() : null); + scSheepDeath.setPostLambingDay(sheepInfo.get("postLambingDay") != null ? Integer.valueOf(sheepInfo.get("postLambingDay").toString()) : null); + scSheepDeath.setLactationDay(sheepInfo.get("lactationDay") != null ? Integer.valueOf(sheepInfo.get("lactationDay").toString()) : null); + scSheepDeath.setGestationDay(sheepInfo.get("gestationDay") != null ? Integer.valueOf(sheepInfo.get("gestationDay").toString()) : null); + } + } + return scSheepDeath; + } + + /** + * 查询羊只死淘记录列表 + * + * @param scSheepDeath 羊只死淘记录 + * @return 羊只死淘记录 + */ + @Override + public List selectScSheepDeathList(ScSheepDeath scSheepDeath) + { + List list = scSheepDeathMapper.selectScSheepDeathList(scSheepDeath); + // 为列表中的每条记录填充显示字段 + for (ScSheepDeath death : list) { + if (death.getManageTags() != null) { + Map sheepInfo = selectSheepFileByManageTags(death.getManageTags()); + if (sheepInfo != null) { + death.setVariety(sheepInfo.get("variety") != null ? sheepInfo.get("variety").toString() : null); + death.setSheepType(sheepInfo.get("sheepType") != null ? sheepInfo.get("sheepType").toString() : null); + death.setGender(sheepInfo.get("gender") != null ? Integer.valueOf(sheepInfo.get("gender").toString()) : null); + death.setDayAge(sheepInfo.get("dayAge") != null ? Long.valueOf(sheepInfo.get("dayAge").toString()) : null); + death.setParity(sheepInfo.get("parity") != null ? Integer.valueOf(sheepInfo.get("parity").toString()) : null); + death.setSheepfoldName(sheepInfo.get("sheepfoldName") != null ? sheepInfo.get("sheepfoldName").toString() : null); + death.setBreedStatus(sheepInfo.get("breedStatus") != null ? sheepInfo.get("breedStatus").toString() : null); + death.setPostLambingDay(sheepInfo.get("postLambingDay") != null ? Integer.valueOf(sheepInfo.get("postLambingDay").toString()) : null); + death.setLactationDay(sheepInfo.get("lactationDay") != null ? Integer.valueOf(sheepInfo.get("lactationDay").toString()) : null); + death.setGestationDay(sheepInfo.get("gestationDay") != null ? Integer.valueOf(sheepInfo.get("gestationDay").toString()) : null); + } + } + } + return list; + } + + /** + * 根据管理耳号查询sheep_file视图信息 + * + * @param manageTags 管理耳号 + * @return 羊只信息 + */ + @Override + public Map selectSheepFileByManageTags(String manageTags) + { + return scSheepDeathMapper.selectSheepFileByManageTags(manageTags); + } + + /** + * 新增羊只死淘记录 + * + * @param scSheepDeath 羊只死淘记录 + * @return 结果 + */ + @Override + public int insertScSheepDeath(ScSheepDeath scSheepDeath) + { + // 设置事件类型默认为"死亡" + if (scSheepDeath.getEventType() == null || scSheepDeath.getEventType().isEmpty()) { + scSheepDeath.setEventType("死亡"); + } + + // 如果有管理耳号,查询并设置羊只ID + if (scSheepDeath.getManageTags() != null && !scSheepDeath.getManageTags().isEmpty()) { + Map sheepInfo = selectSheepFileByManageTags(scSheepDeath.getManageTags()); + if (sheepInfo != null) { + scSheepDeath.setSheepId(sheepInfo.get("sheepId") != null ? Long.valueOf(sheepInfo.get("sheepId").toString()) : null); + } + } + + scSheepDeath.setCreateTime(DateUtils.getNowDate()); + return scSheepDeathMapper.insertScSheepDeath(scSheepDeath); + } + + /** + * 修改羊只死淘记录 + * + * @param scSheepDeath 羊只死淘记录 + * @return 结果 + */ + @Override + public int updateScSheepDeath(ScSheepDeath scSheepDeath) + { + // 如果管理耳号发生变化,重新查询并设置羊只ID + if (scSheepDeath.getManageTags() != null && !scSheepDeath.getManageTags().isEmpty()) { + Map sheepInfo = selectSheepFileByManageTags(scSheepDeath.getManageTags()); + if (sheepInfo != null) { + scSheepDeath.setSheepId(sheepInfo.get("sheepId") != null ? Long.valueOf(sheepInfo.get("sheepId").toString()) : null); + } + } + + scSheepDeath.setUpdateTime(DateUtils.getNowDate()); + return scSheepDeathMapper.updateScSheepDeath(scSheepDeath); + } + + /** + * 批量删除羊只死淘记录 + * + * @param ids 需要删除的羊只死淘记录主键 + * @return 结果 + */ + @Override + public int deleteScSheepDeathByIds(Long[] ids) + { + return scSheepDeathMapper.deleteScSheepDeathByIds(ids); + } + + /** + * 删除羊只死淘记录信息 + * + * @param id 羊只死淘记录主键 + * @return 结果 + */ + @Override + public int deleteScSheepDeathById(Long id) + { + return scSheepDeathMapper.deleteScSheepDeathById(id); + } +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/impl/ScWeanRecordServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/impl/ScWeanRecordServiceImpl.java new file mode 100644 index 0000000..9efcaff --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/breed/service/impl/ScWeanRecordServiceImpl.java @@ -0,0 +1,134 @@ +package com.zhyc.module.produce.breed.service.impl; + +import java.util.List; +import com.zhyc.common.utils.DateUtils; +import com.zhyc.module.produce.breed.domain.ScWeanRecord; +import com.zhyc.module.produce.breed.mapper.ScWeanRecordMapper; +import com.zhyc.module.produce.breed.service.IScWeanRecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * 断奶记录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 + @Transactional + 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()); + + // 插入断奶记录 + int result = scWeanRecordMapper.insertScWeanRecord(scWeanRecord); + + // 同步更新bas_sheep表中的断奶信息 + if (result > 0 && scWeanRecord.getEarNumber() != null) { + scWeanRecordMapper.updateBasSheepWeaningInfo(scWeanRecord); + } + + return result; + } + + /** + * 修改断奶记录 + * + * @param scWeanRecord 断奶记录 + * @return 结果 + */ + @Override + @Transactional + 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); + } + } + + // 更新断奶记录 + int result = scWeanRecordMapper.updateScWeanRecord(scWeanRecord); + + // 同步更新bas_sheep表中的断奶信息 + if (result > 0 && scWeanRecord.getEarNumber() != null) { + scWeanRecordMapper.updateBasSheepWeaningInfo(scWeanRecord); + } + + return result; + } + + /** + * 批量删除断奶记录 + * + * @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/java/com/zhyc/module/produce/manage_sheep/controller/ScAddSheepController.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/controller/ScAddSheepController.java new file mode 100644 index 0000000..6d2f7f9 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/controller/ScAddSheepController.java @@ -0,0 +1,118 @@ +package com.zhyc.module.produce.manage_sheep.controller; + +import com.zhyc.common.annotation.Log; +import com.zhyc.common.core.domain.AjaxResult; +import com.zhyc.common.enums.BusinessType; +import com.zhyc.common.exception.ServiceException; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.module.base.domain.BasSheepVariety; +import com.zhyc.module.base.service.IBasSheepVarietyService; +import com.zhyc.module.produce.manage_sheep.domain.ScAddSheep; +import com.zhyc.module.produce.manage_sheep.service.IScAddSheepService; +import com.zhyc.module.base.domain.DaSheepfold; +import com.zhyc.module.base.service.IDaSheepfoldService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import static com.zhyc.common.core.domain.AjaxResult.success; +import static com.zhyc.common.utils.SecurityUtils.getUsername; + +@RestController +@RequestMapping("produce/manage_sheep/add_sheep") +public class ScAddSheepController { + @Autowired + private IScAddSheepService scAddSheepService; + @Autowired + private IDaSheepfoldService daSheepfoldMapper; + @Autowired + private IBasSheepVarietyService basSheepVarietyMapper; + //新增羊只验证 + @PreAuthorize("@ss.hasPermi('produce:add_sheep:add')") + @Log(title = "新增", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult addSheep(@RequestBody ScAddSheep scAddSheep) { + if (scAddSheep.getEarNumber() == null || scAddSheep.getEarNumber().isEmpty()) { + return AjaxResult.error("耳号不能为空"); + } + if (scAddSheep.getSheepfold() == null || scAddSheep.getSheepfold() == 0) { + return AjaxResult.error("羊舍不能为空"); + } + if (scAddSheep.getBornWeight() == null) { + return AjaxResult.error("出生体重不能为空"); + } + if (scAddSheep.getBirthday() == null) { + return AjaxResult.error("出生日期不能为空"); + } + if (scAddSheep.getGender() == null) { + return AjaxResult.error("性别不能为空"); + } + if (scAddSheep.getVarietyId() == null) { + return AjaxResult.error("品种不能为空"); + } + + try { + boolean success = scAddSheepService.insertScAddSheep(scAddSheep); + if (success) { + return success("新增成功"); + } else { + return AjaxResult.error("新增失败"); + } + } catch (ServiceException e) { + return AjaxResult.error(e.getMessage()); + } + } + + + //导出 + @Log(title = "羊只信息", businessType = BusinessType.EXPORT) + @PostMapping("/exportForm") + public void exportForm(HttpServletResponse response, @RequestBody ScAddSheep scAddSheep) throws IOException { + ExcelUtil util = new ExcelUtil<>(ScAddSheep.class); + List list = new ArrayList<>(); + + // 处理羊舍名称(原有逻辑) + if (scAddSheep.getSheepfold() != null) { + DaSheepfold fold = daSheepfoldMapper.selectDaSheepfoldById(scAddSheep.getSheepfold().longValue()); + if (fold != null) { + scAddSheep.setSheepfoldNameExcel(fold.getSheepfoldName()); + } + } + + if (scAddSheep.getVarietyId() != null) { + BasSheepVariety variety = basSheepVarietyMapper.selectBasSheepVarietyById(scAddSheep.getVarietyId().longValue()); + if (variety != null) { + scAddSheep.setVarietyName(variety.getVariety()); + } + } + + list.add(scAddSheep); + util.exportExcel(response, list, "羊只信息"); + } + //导入 + @PostMapping("/importData") + @PreAuthorize("@ss.hasPermi('produce:add_sheep:import')") + @Log(title = "羊只信息", businessType = BusinessType.IMPORT) + public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception { + ExcelUtil util = new ExcelUtil<>(ScAddSheep.class); + List list = util.importExcel(file.getInputStream()); + String message = scAddSheepService.importSheep(list, updateSupport, getUsername()); + return success(message); + } + + @PostMapping("/importTemplate") + @PreAuthorize("@ss.hasPermi('produce:add_sheep:import')") + public void importTemplate(HttpServletResponse response) { + ExcelUtil util = new ExcelUtil<>(ScAddSheep.class); + util.importTemplateExcel(response, "羊只信息模板"); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/controller/ScChangeCommentController.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/controller/ScChangeCommentController.java new file mode 100644 index 0000000..756e4a5 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/controller/ScChangeCommentController.java @@ -0,0 +1,104 @@ +package com.zhyc.module.produce.manage_sheep.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.manage_sheep.domain.ScChangeComment; +import com.zhyc.module.produce.manage_sheep.service.IScChangeCommentService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 改备注Controller + * + * @author ruoyi + * @date 2025-07-24 + */ +@RestController +@RequestMapping("/changeComment/changeComment") +public class ScChangeCommentController extends BaseController +{ + @Autowired + private IScChangeCommentService scChangeCommentService; + + /** + * 查询改备注列表 + */ + @PreAuthorize("@ss.hasPermi('changeComment:changeComment:list')") + @GetMapping("/list") + public TableDataInfo list(ScChangeComment scChangeComment) + { + startPage(); + List list = scChangeCommentService.selectScChangeCommentList(scChangeComment); + return getDataTable(list); + } + + /** + * 导出改备注列表 + */ + @PreAuthorize("@ss.hasPermi('changeComment:changeComment:export')") + @Log(title = "改备注", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, ScChangeComment scChangeComment) + { + List list = scChangeCommentService.selectScChangeCommentList(scChangeComment); + ExcelUtil util = new ExcelUtil(ScChangeComment.class); + util.exportExcel(response, list, "改备注数据"); + } + + /** + * 获取改备注详细信息 + */ + @PreAuthorize("@ss.hasPermi('changeComment:changeComment:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(scChangeCommentService.selectScChangeCommentById(id)); + } + + /** + * 新增改备注 + */ + @PreAuthorize("@ss.hasPermi('changeComment:changeComment:add')") + @Log(title = "改备注", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ScChangeComment scChangeComment) + { + return toAjax(scChangeCommentService.insertScChangeComment(scChangeComment)); + } + + /** + * 修改改备注 + */ + @PreAuthorize("@ss.hasPermi('changeComment:changeComment:edit')") + @Log(title = "改备注", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ScChangeComment scChangeComment) + { + return toAjax(scChangeCommentService.updateScChangeComment(scChangeComment)); + } + + /** + * 删除改备注 + */ + @PreAuthorize("@ss.hasPermi('changeComment:changeComment:remove')") + @Log(title = "改备注", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(scChangeCommentService.deleteScChangeCommentByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/controller/ScChangeEarController.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/controller/ScChangeEarController.java new file mode 100644 index 0000000..cd6b28b --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/controller/ScChangeEarController.java @@ -0,0 +1,119 @@ +package com.zhyc.module.produce.manage_sheep.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.zhyc.module.base.domain.BasSheep; +import com.zhyc.module.base.service.IBasSheepService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +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.manage_sheep.domain.ScChangeEar; +import com.zhyc.module.produce.manage_sheep.service.IScChangeEarService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 修改电子耳号记录Controller + * + * @author ruoyi + * @date 2025-07-24 + */ +@RestController +@RequestMapping("/changeEar/changeEar") +public class ScChangeEarController extends BaseController +{ + @Autowired + private IScChangeEarService scChangeEarService; + + @Autowired + private IBasSheepService basSheepService; + /** + * 查询修改电子耳号记录列表 + */ + @PreAuthorize("@ss.hasPermi('changeEar:changeEar:list')") + @GetMapping("/list") + public TableDataInfo list(ScChangeEar scChangeEar) + { + startPage(); + List list = scChangeEarService.selectScChangeEarList(scChangeEar); + return getDataTable(list); + } + + /** + * 导出修改电子耳号记录列表 + */ + @PreAuthorize("@ss.hasPermi('changeEar:changeEar:export')") + @Log(title = "修改电子耳号记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, ScChangeEar scChangeEar) + { + List list = scChangeEarService.selectScChangeEarList(scChangeEar); + ExcelUtil util = new ExcelUtil(ScChangeEar.class); + util.exportExcel(response, list, "修改电子耳号记录数据"); + } + + /** + * 获取修改电子耳号记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('changeEar:changeEar:query')") + @GetMapping("/{id}") + public AjaxResult getInfo(@PathVariable("id") Integer id) { + ScChangeEar changeEar = scChangeEarService.selectScChangeEarById(id); + // 关联查询羊只表,获取旧耳号 + BasSheep sheep = basSheepService.selectBasSheepById(changeEar.getSheepId()); + if (sheep != null) { + // 根据耳号类型,设置旧耳号 + if (changeEar.getEarType() == 0) { + changeEar.setOldTag(sheep.getElectronicTags()); + } else { + changeEar.setOldTag(sheep.getManageTags()); + } + } + return success(changeEar); + } + + /** + * 新增修改电子耳号记录 + */ + @PreAuthorize("@ss.hasPermi('changeEar:changeEar:add')") + @Log(title = "修改电子耳号记录", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ScChangeEar scChangeEar) + { + return toAjax(scChangeEarService.insertScChangeEar(scChangeEar)); + } + + /** + * 修改修改电子耳号记录 + */ + @PreAuthorize("@ss.hasPermi('changeEar:changeEar:edit')") + @Log(title = "修改电子耳号记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ScChangeEar scChangeEar) + { + return toAjax(scChangeEarService.updateScChangeEar(scChangeEar)); + } + + /** + * 删除修改电子耳号记录 + */ + @PreAuthorize("@ss.hasPermi('changeEar:changeEar:remove')") + @Log(title = "修改电子耳号记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Integer[] ids) + { + return toAjax(scChangeEarService.deleteScChangeEarByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/controller/ScChangeVarietyController.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/controller/ScChangeVarietyController.java new file mode 100644 index 0000000..fd5b092 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/controller/ScChangeVarietyController.java @@ -0,0 +1,104 @@ +package com.zhyc.module.produce.manage_sheep.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.manage_sheep.domain.ScChangeVariety; +import com.zhyc.module.produce.manage_sheep.service.IScChangeVarietyService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 改品种记录Controller + * + * @author ruoyi + * @date 2025-07-24 + */ +@RestController +@RequestMapping("/changeVariety/changeVariety") +public class ScChangeVarietyController extends BaseController +{ + @Autowired + private IScChangeVarietyService scChangeVarietyService; + + /** + * 查询改品种记录列表 + */ + @PreAuthorize("@ss.hasPermi('changeVariety:changeVariety:list')") + @GetMapping("/list") + public TableDataInfo list(ScChangeVariety scChangeVariety) + { + startPage(); + List list = scChangeVarietyService.selectScChangeVarietyList(scChangeVariety); + return getDataTable(list); + } + + /** + * 导出改品种记录列表 + */ + @PreAuthorize("@ss.hasPermi('changeVariety:changeVariety:export')") + @Log(title = "改品种记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, ScChangeVariety scChangeVariety) + { + List list = scChangeVarietyService.selectScChangeVarietyList(scChangeVariety); + ExcelUtil util = new ExcelUtil(ScChangeVariety.class); + util.exportExcel(response, list, "改品种记录数据"); + } + + /** + * 获取改品种记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('changeVariety:changeVariety:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Integer id) + { + return success(scChangeVarietyService.selectScChangeVarietyById(id)); + } + + /** + * 新增改品种记录 + */ + @PreAuthorize("@ss.hasPermi('changeVariety:changeVariety:add')") + @Log(title = "改品种记录", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ScChangeVariety scChangeVariety) + { + return toAjax(scChangeVarietyService.insertScChangeVariety(scChangeVariety)); + } + + /** + * 修改改品种记录 + */ + @PreAuthorize("@ss.hasPermi('changeVariety:changeVariety:edit')") + @Log(title = "改品种记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ScChangeVariety scChangeVariety) + { + return toAjax(scChangeVarietyService.updateScChangeVariety(scChangeVariety)); + } + + /** + * 删除改品种记录 + */ + @PreAuthorize("@ss.hasPermi('changeVariety:changeVariety:remove')") + @Log(title = "改品种记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Integer[] ids) + { + return toAjax(scChangeVarietyService.deleteScChangeVarietyByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/controller/ScTransGroupController.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/controller/ScTransGroupController.java new file mode 100644 index 0000000..9fe5a2f --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/controller/ScTransGroupController.java @@ -0,0 +1,108 @@ +package com.zhyc.module.produce.manage_sheep.controller; + +import java.io.IOException; +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.zhyc.module.produce.manage_sheep.domain.ScTransGroup; +import com.zhyc.module.produce.manage_sheep.service.IScTransGroupService; +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-10 + */ +@RestController +@RequestMapping("produce/manage_sheep/trans_group") +public class ScTransGroupController extends BaseController { + @Autowired + private IScTransGroupService scTransGroupService; + + /** + * 查询转群记录列表 + */ + @PreAuthorize("@ss.hasPermi('produce:trans_group:list')") + @GetMapping("/list") + public TableDataInfo list(ScTransGroup scTransGroup) { + startPage(); + List list = scTransGroupService.selectScTransGroupList(scTransGroup); + return getDataTable(list); + } + + /** + * 导出转群记录列表 + */ + @PreAuthorize("@ss.hasPermi('produce:trans_group:export')") + @Log(title = "转群记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, ScTransGroup scTransGroup) throws IOException { + List list = scTransGroupService.selectScTransGroupList(scTransGroup); + ExcelUtil util = new ExcelUtil<>(ScTransGroup.class); + util.exportExcel(response, list, "转群记录数据"); + } + + /** + * 获取转群记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('produce:trans_group:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Integer id) { + return success(scTransGroupService.selectScTransGroupById(id)); + } + + /** + * 新增转群记录 + */ + @PreAuthorize("@ss.hasPermi('produce:trans_group:add')") + @Log(title = "转群记录", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ScTransGroup scTransGroup) { + return toAjax(scTransGroupService.insertScTransGroup(scTransGroup)); + } + + /** + * 修改转群记录 + */ + @PreAuthorize("@ss.hasPermi('produce:trans_group:edit')") + @Log(title = "转群记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ScTransGroup scTransGroup) { + return toAjax(scTransGroupService.updateScTransGroup(scTransGroup)); + } + + /** + * 删除转群记录 + */ + @PreAuthorize("@ss.hasPermi('produce:trans_group:remove')") + @Log(title = "转群记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Integer[] ids) { + return toAjax(scTransGroupService.deleteScTransGroupByIds(ids)); + } + + + /** + * 审批转群记录 + */ + @PutMapping("/approve") + public AjaxResult approve(@RequestBody ScTransGroup scTransGroup) { + return toAjax(scTransGroupService.approveScTransGroup(scTransGroup)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/controller/ScTransitionInfoController.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/controller/ScTransitionInfoController.java new file mode 100644 index 0000000..f41c044 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/controller/ScTransitionInfoController.java @@ -0,0 +1,116 @@ +package com.zhyc.module.produce.manage_sheep.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.manage_sheep.domain.ScTransitionInfo; +import com.zhyc.module.produce.manage_sheep.service.IScTransitionInfoService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 转场Controller + * + * @author ruoyi + * @date 2025-07-10 + */ +@RestController +@RequestMapping("produce/manage_sheep/transition_info") +public class ScTransitionInfoController extends BaseController { + @Autowired + private IScTransitionInfoService scTransitionInfoService; + + /** + * 查询转场列表 + */ + @PreAuthorize("@ss.hasPermi('produce:transition_info:list')") + @GetMapping("/list") + public TableDataInfo list(ScTransitionInfo scTransitionInfo) { + startPage(); + List list = scTransitionInfoService.selectScTransitionInfoList(scTransitionInfo); + return getDataTable(list); + } + + /** + * 导出转场列表 + */ + @PreAuthorize("@ss.hasPermi('produce:transition_info:export')") + @Log(title = "转场", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, ScTransitionInfo scTransitionInfo) { + List list = scTransitionInfoService.selectScTransitionInfoList(scTransitionInfo); + for (ScTransitionInfo item : list) { + item.setStatusText(scTransitionInfoService.convertStatus(item.getStatus())); + item.setTransTypeText(scTransitionInfoService.convertTransType(item.getTransType())); + } + ExcelUtil util = new ExcelUtil<>(ScTransitionInfo.class); + util.exportExcel(response, list, "转场数据"); + } + + /** + * 获取转场详细信息 + */ + @PreAuthorize("@ss.hasPermi('produce:transition_info:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Integer id) { + ScTransitionInfo transitionInfo = scTransitionInfoService.selectScTransitionInfoById(id); + transitionInfo.setTransTypeText(scTransitionInfoService.convertTransType(transitionInfo.getTransType())); + return success(transitionInfo); + } + + /** + * 新增转场 + */ + @PreAuthorize("@ss.hasPermi('produce:transition_info:add')") + @Log(title = "转场", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ScTransitionInfo scTransitionInfo) { + return toAjax(scTransitionInfoService.insertScTransitionInfo(scTransitionInfo)); + } + + //批量添加 + @PostMapping("/batch") + public AjaxResult addBatch(@RequestBody List transitionInfoList) { + return toAjax(scTransitionInfoService.insertScTransitionInfoBatch(transitionInfoList)); + } + + /** + * 修改转场 + */ + @PreAuthorize("@ss.hasPermi('produce:transition_info:edit')") + @Log(title = "转场", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ScTransitionInfo scTransitionInfo) { + return toAjax(scTransitionInfoService.updateScTransitionInfo(scTransitionInfo)); + } + + /** + * 删除转场 + */ + @PreAuthorize("@ss.hasPermi('produce:transition_info:remove')") + @Log(title = "转场", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Integer[] ids) { + return toAjax(scTransitionInfoService.deleteScTransitionInfoByIds(ids)); + } + + @PutMapping("/approve") + public AjaxResult approveScTransitionInfo(@RequestBody ScTransitionInfo scTransitionInfo) { + int rows = scTransitionInfoService.approveScTransitionInfo(scTransitionInfo); + return toAjax(rows); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/domain/ScAddSheep.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/domain/ScAddSheep.java new file mode 100644 index 0000000..7bdf7ad --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/domain/ScAddSheep.java @@ -0,0 +1,90 @@ +package com.zhyc.module.produce.manage_sheep.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.math.BigDecimal; +import java.util.Date; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class ScAddSheep extends BaseEntity { + /** + * 羊只 + * + * @author ruoyi + * @date 2025-07-10 + */ + private static final long serialVersionUID = 1L; + @Excel(name = "主键") + private Integer id; + /** 羊只耳号 */ + @Excel(name = "耳号") + private String earNumber; + + /** 羊舍编号 */ + private Integer sheepfold; + + private String sheepfoldName; + + // 导出时生成“羊舍名称”列 ,仅 Excel 用,不映射到数据库 + @Excel(name = "羊舍名称") + private String sheepfoldNameExcel; + + /** 父号 */ + @Excel(name = "父号") + private String father; + + /** 母号 */ + @Excel(name = "母号") + private String mother; + + /** 出生体重 */ + @Excel(name = "出生体重") + private BigDecimal bornWeight; + + /** 出生日期 */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @Excel(name = "出生日期", dateFormat = "yyyy-MM-dd") + private Date birthday; + + /** 性别 1母 2公 3阉羊 */ + @Excel(name = "性别", readConverterExp = "1=母,2=公,3=阉羊") + private Integer gender; + + /** 胎次 */ + @Excel(name = "胎次") + private Integer parity; + + /** 品种id */ + private Integer varietyId; + + /** 品种名称(联表查询返回,非数据库字段) */ + @Excel(name = "品种") + private String varietyName; + + /** 入群日期 */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @Excel(name = "入群日期", dateFormat = "yyyy-MM-dd") + private Date joinDate; + + /** 备注 */ + @Excel(name = "备注") + private String comment; + + /** 技术员 */ + @Excel(name = "技术员") + private String technician; + + + private String createBy; + private Date createTime; + + +} + diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/domain/ScChangeComment.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/domain/ScChangeComment.java new file mode 100644 index 0000000..2243411 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/domain/ScChangeComment.java @@ -0,0 +1,47 @@ +package com.zhyc.module.produce.manage_sheep.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 改备注对象 sc_change_comment + * + * @author ruoyi + * @date 2025-07-24 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class ScChangeComment extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * $column.columnComment + */ + private Long id; + + /** + * 羊只id + */ + private String sheepId; + @Excel(name = "管理耳号") + private String manageTags; + /** + * 新备注 + */ + @Excel(name = "新备注") + private String newComment; + + /** + * 原备注 + */ + @Excel(name = "原备注") + private String oldComment; + + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/domain/ScChangeEar.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/domain/ScChangeEar.java new file mode 100644 index 0000000..f2ef13f --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/domain/ScChangeEar.java @@ -0,0 +1,50 @@ +package com.zhyc.module.produce.manage_sheep.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 修改电子耳号记录对象 sc_change_ear + * + * @author ruoyi + * @date 2025-07-24 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class ScChangeEar extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** id */ + private Integer id; + + /** 羊只id */ + private Long sheepId; + + @Excel(name = "管理耳号") + private String manageTags; + + /** 选择更改耳号类型(0电子耳号1管理耳号) */ + @Excel(name = "耳号类型", readConverterExp = "0=电子耳号,1=管理耳号") + private Integer earType; + + /** 新耳号/电子耳号 */ + @Excel(name = "新耳号/电子耳号") + private String newTag; + + /** 旧耳号/电子耳号 */ + @Excel(name = "旧耳号/电子耳号") + private String oldTag; + + /** 备注 */ + @Excel(name = "备注") + private String comment; + + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/domain/ScChangeVariety.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/domain/ScChangeVariety.java new file mode 100644 index 0000000..5f5e8ee --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/domain/ScChangeVariety.java @@ -0,0 +1,52 @@ +package com.zhyc.module.produce.manage_sheep.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 改品种记录对象 sc_change_variety + * + * @author ruoyi + * @date 2025-07-24 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class ScChangeVariety extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Integer id; + + /** 羊只id */ + private Integer sheepId; + @Excel(name = "耳号") + private String manageTags; + + /** 原品种 */ + @Excel(name = "原品种") + private String varietyOld; + + /** 新品种 */ + @Excel(name = "新品种") + private String varietyNew; + + /** 备注 */ + @Excel(name = "备注") + private String comment; + + /** 创建日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date createTime; + + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/domain/ScTransGroup.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/domain/ScTransGroup.java new file mode 100644 index 0000000..ba62557 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/domain/ScTransGroup.java @@ -0,0 +1,107 @@ +package com.zhyc.module.produce.manage_sheep.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; +import org.springframework.beans.factory.annotation.Autowired; + +/** + * 转群记录对象 sc_trans_group + * + * @author ruoyi + * @date 2025-07-10 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class ScTransGroup extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * $column.columnComment + */ + private Integer id; + + /** + * 羊只id + */ + private Integer sheepId; + + @Excel(name = "耳号") + private String manageTags; + /** + * 转入羊舍 + */ + private String foldTo; + + /** + * 转出羊舍 + */ + private String foldFrom; + + /** + * 转出羊舍名称 + */ + @Excel(name = "转出羊舍") + private String foldFromName; + + /** + * 羊只类型ID + */ + private Integer sheepTypeId; + // 羊只类型名称 + private String sheepTypeName; + /** + * 转入羊舍名称 + */ + @Excel(name = "转入羊舍") + private String foldToName; + + /** + * 品种id + */ + private Long varietyId; + + /** + * 品种名称(联表查询返回,非数据库字段) + */ + @Excel(name = "品种") + private String varietyName; + + + private Integer reason; + /** + * 转群原因描述 用于导出 + */ + @Excel(name = "转群原因") + private String reasonText; + + /** + * 技术员 + */ + @Excel(name = "技术员") + private String technician; + + /** + * 状态 + */ + + private Integer status; + /** + * 状态描述 用于导出 + */ + @Excel(name = "状态") + private String statusText; + + /** + * 备注 + */ + @Excel(name = "备注") + private String comment; + + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/domain/ScTransitionInfo.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/domain/ScTransitionInfo.java new file mode 100644 index 0000000..554bf4d --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/domain/ScTransitionInfo.java @@ -0,0 +1,88 @@ +package com.zhyc.module.produce.manage_sheep.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 转场对象 sc_transition_info + * + * @author ruoyi + * @date 2025-07-10 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class ScTransitionInfo extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + *主键 + */ + private Integer id; + + /** + * 羊只id + */ + private Integer sheepId; + + @Excel(name = "耳号") + private String manageTags; + /** + * 品种id + */ + private Long varietyId; + + /** + * 品种名称(联表返回,非数据库字段) + */ + @Excel(name = "品种") + private String varietyName; + + /** + * 转入牧场 + */ + @Excel(name = "转入牧场") + private String transTo; + + /** + * 当前牧场 + */ + @Excel(name = "当前牧场") + private String transFrom; + + /** + * 转场类型 + */ + private Integer transType; + + /** + * 转场类型名称 只用于导出 + */ + @Excel(name = "转场类型") + private String transTypeText; + + /** + * 技术员 + */ + @Excel(name = "技术员") + private String technician; + + /** + * 状态 + */ + private Integer status; + @Excel(name = "状态") + private String statusText; + /** + * 备注 + */ + @Excel(name = "备注") + private String comment; + + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/mapper/ScAddSheepMapper.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/mapper/ScAddSheepMapper.java new file mode 100644 index 0000000..8231d04 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/mapper/ScAddSheepMapper.java @@ -0,0 +1,25 @@ +package com.zhyc.module.produce.manage_sheep.mapper; + +import com.zhyc.module.produce.manage_sheep.domain.ScAddSheep; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +@Mapper +public interface ScAddSheepMapper { + //新增羊只 + int insert(ScAddSheep scAddSheep); + + //查询新增羊只列表 + List selectScAddSheepList(ScAddSheep scAddSheep); + + //修改羊只 + int updateScAddSheep(ScAddSheep scAddSheep); + + //删除羊只(支持批量) + int deleteScAddSheepByIds(Integer[] ids); + + //根据耳号查询羊只 + ScAddSheep selectByEarNumber(String earNumber); +} + diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/mapper/ScChangeCommentMapper.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/mapper/ScChangeCommentMapper.java new file mode 100644 index 0000000..cd71536 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/mapper/ScChangeCommentMapper.java @@ -0,0 +1,61 @@ +package com.zhyc.module.produce.manage_sheep.mapper; + +import java.util.List; +import com.zhyc.module.produce.manage_sheep.domain.ScChangeComment; + +/** + * 改备注Mapper接口 + * + * @author ruoyi + * @date 2025-07-24 + */ +public interface ScChangeCommentMapper +{ + /** + * 查询改备注 + * + * @param id 改备注主键 + * @return 改备注 + */ + public ScChangeComment selectScChangeCommentById(Long id); + + /** + * 查询改备注列表 + * + * @param scChangeComment 改备注 + * @return 改备注集合 + */ + public List selectScChangeCommentList(ScChangeComment scChangeComment); + + /** + * 新增改备注 + * + * @param scChangeComment 改备注 + * @return 结果 + */ + public int insertScChangeComment(ScChangeComment scChangeComment); + + /** + * 修改改备注 + * + * @param scChangeComment 改备注 + * @return 结果 + */ + public int updateScChangeComment(ScChangeComment scChangeComment); + + /** + * 删除改备注 + * + * @param id 改备注主键 + * @return 结果 + */ + public int deleteScChangeCommentById(Long id); + + /** + * 批量删除改备注 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteScChangeCommentByIds(Long[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/mapper/ScChangeEarMapper.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/mapper/ScChangeEarMapper.java new file mode 100644 index 0000000..5699a46 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/mapper/ScChangeEarMapper.java @@ -0,0 +1,61 @@ +package com.zhyc.module.produce.manage_sheep.mapper; + +import java.util.List; +import com.zhyc.module.produce.manage_sheep.domain.ScChangeEar; + +/** + * 修改电子耳号记录Mapper接口 + * + * @author ruoyi + * @date 2025-07-24 + */ +public interface ScChangeEarMapper +{ + /** + * 查询修改电子耳号记录 + * + * @param id 修改电子耳号记录主键 + * @return 修改电子耳号记录 + */ + public ScChangeEar selectScChangeEarById(Integer id); + + /** + * 查询修改电子耳号记录列表 + * + * @param scChangeEar 修改电子耳号记录 + * @return 修改电子耳号记录集合 + */ + public List selectScChangeEarList(ScChangeEar scChangeEar); + + /** + * 新增修改电子耳号记录 + * + * @param scChangeEar 修改电子耳号记录 + * @return 结果 + */ + public int insertScChangeEar(ScChangeEar scChangeEar); + + /** + * 修改修改电子耳号记录 + * + * @param scChangeEar 修改电子耳号记录 + * @return 结果 + */ + public int updateScChangeEar(ScChangeEar scChangeEar); + + /** + * 删除修改电子耳号记录 + * + * @param id 修改电子耳号记录主键 + * @return 结果 + */ + public int deleteScChangeEarById(Integer id); + + /** + * 批量删除修改电子耳号记录 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteScChangeEarByIds(Integer[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/mapper/ScChangeVarietyMapper.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/mapper/ScChangeVarietyMapper.java new file mode 100644 index 0000000..12d9075 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/mapper/ScChangeVarietyMapper.java @@ -0,0 +1,61 @@ +package com.zhyc.module.produce.manage_sheep.mapper; + +import java.util.List; +import com.zhyc.module.produce.manage_sheep.domain.ScChangeVariety; + +/** + * 改品种记录Mapper接口 + * + * @author ruoyi + * @date 2025-07-24 + */ +public interface ScChangeVarietyMapper +{ + /** + * 查询改品种记录 + * + * @param id 改品种记录主键 + * @return 改品种记录 + */ + public ScChangeVariety selectScChangeVarietyById(Integer id); + + /** + * 查询改品种记录列表 + * + * @param scChangeVariety 改品种记录 + * @return 改品种记录集合 + */ + public List selectScChangeVarietyList(ScChangeVariety scChangeVariety); + + /** + * 新增改品种记录 + * + * @param scChangeVariety 改品种记录 + * @return 结果 + */ + public int insertScChangeVariety(ScChangeVariety scChangeVariety); + + /** + * 修改改品种记录 + * + * @param scChangeVariety 改品种记录 + * @return 结果 + */ + public int updateScChangeVariety(ScChangeVariety scChangeVariety); + + /** + * 删除改品种记录 + * + * @param id 改品种记录主键 + * @return 结果 + */ + public int deleteScChangeVarietyById(Integer id); + + /** + * 批量删除改品种记录 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteScChangeVarietyByIds(Integer[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/mapper/ScTransGroupMapper.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/mapper/ScTransGroupMapper.java new file mode 100644 index 0000000..5746adc --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/mapper/ScTransGroupMapper.java @@ -0,0 +1,63 @@ +package com.zhyc.module.produce.manage_sheep.mapper; + +import java.util.List; + +import com.zhyc.module.produce.manage_sheep.domain.ScTransGroup; +import org.apache.ibatis.annotations.Mapper; + +/** + * 转群记录Mapper接口 + * + * @author ruoyi + * @date 2025-07-10 + */ +@Mapper +public interface ScTransGroupMapper { + /** + * 查询转群记录 + * + * @param id 转群记录主键 + * @return 转群记录 + */ + public ScTransGroup selectScTransGroupById(Integer id); + + /** + * 查询转群记录列表 + * + * @param scTransGroup 转群记录 + * @return 转群记录集合 + */ + public List selectScTransGroupList(ScTransGroup scTransGroup); + + /** + * 新增转群记录 + * + * @param scTransGroup 转群记录 + * @return 结果 + */ + public int insertScTransGroup(ScTransGroup scTransGroup); + + /** + * 修改转群记录 + * + * @param scTransGroup 转群记录 + * @return 结果 + */ + public int updateScTransGroup(ScTransGroup scTransGroup); + + /** + * 删除转群记录 + * + * @param id 转群记录主键 + * @return 结果 + */ + public int deleteScTransGroupById(Integer id); + + /** + * 批量删除转群记录 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteScTransGroupByIds(Integer[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/mapper/ScTransitionInfoMapper.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/mapper/ScTransitionInfoMapper.java new file mode 100644 index 0000000..a095246 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/mapper/ScTransitionInfoMapper.java @@ -0,0 +1,66 @@ +package com.zhyc.module.produce.manage_sheep.mapper; + +import java.util.List; + +import com.zhyc.module.produce.manage_sheep.domain.ScTransitionInfo; +import org.apache.ibatis.annotations.Param; + +/** + * 转场Mapper接口 + * + * @author ruoyi + * @date 2025-07-10 + */ +public interface ScTransitionInfoMapper +{ + /** + * 查询转场 + * + * @param id 转场主键 + * @return 转场 + */ + public ScTransitionInfo selectScTransitionInfoById(Integer id); + + /** + * 查询转场列表 + * + * @param scTransitionInfo 转场 + * @return 转场集合 + */ + public List selectScTransitionInfoList(ScTransitionInfo scTransitionInfo); + + /** + * 新增转场 + * + * @param scTransitionInfo 转场 + * @return 结果 + */ + public int insertScTransitionInfo(ScTransitionInfo scTransitionInfo); + + /** + * 修改转场 + * + * @param scTransitionInfo 转场 + * @return 结果 + */ + public int updateScTransitionInfo(ScTransitionInfo scTransitionInfo); + + /** + * 删除转场 + * + * @param id 转场主键 + * @return 结果 + */ + public int deleteScTransitionInfoById(Integer id); + + /** + * 批量删除转场 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteScTransitionInfoByIds(Integer[] ids); + + //批量转场 + int insertScTransitionInfoBatch(@Param("list") List transitionInfoList); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/service/IScAddSheepService.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/service/IScAddSheepService.java new file mode 100644 index 0000000..e39b7c9 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/service/IScAddSheepService.java @@ -0,0 +1,27 @@ +package com.zhyc.module.produce.manage_sheep.service; + +import com.zhyc.module.produce.manage_sheep.domain.ScAddSheep; + +import java.util.List; + + +public interface IScAddSheepService { + + //新增 + boolean insertScAddSheep(ScAddSheep scAddSheep); + + //查询 + List selectScAddSheepList(ScAddSheep scAddSheep); + + //修改 + boolean updateScAddSheep(ScAddSheep scAddSheep); + + //删除 + boolean deleteScAddSheepByIds(Integer[] ids); + + //导入 + String importSheep(List list, boolean updateSupport, String operName); + + +} + diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/service/IScChangeCommentService.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/service/IScChangeCommentService.java new file mode 100644 index 0000000..cd11f0c --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/service/IScChangeCommentService.java @@ -0,0 +1,61 @@ +package com.zhyc.module.produce.manage_sheep.service; + +import java.util.List; +import com.zhyc.module.produce.manage_sheep.domain.ScChangeComment; + +/** + * 改备注Service接口 + * + * @author ruoyi + * @date 2025-07-24 + */ +public interface IScChangeCommentService +{ + /** + * 查询改备注 + * + * @param id 改备注主键 + * @return 改备注 + */ + public ScChangeComment selectScChangeCommentById(Long id); + + /** + * 查询改备注列表 + * + * @param scChangeComment 改备注 + * @return 改备注集合 + */ + public List selectScChangeCommentList(ScChangeComment scChangeComment); + + /** + * 新增改备注 + * + * @param scChangeComment 改备注 + * @return 结果 + */ + public int insertScChangeComment(ScChangeComment scChangeComment); + + /** + * 修改改备注 + * + * @param scChangeComment 改备注 + * @return 结果 + */ + public int updateScChangeComment(ScChangeComment scChangeComment); + + /** + * 批量删除改备注 + * + * @param ids 需要删除的改备注主键集合 + * @return 结果 + */ + public int deleteScChangeCommentByIds(Long[] ids); + + /** + * 删除改备注信息 + * + * @param id 改备注主键 + * @return 结果 + */ + public int deleteScChangeCommentById(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/service/IScChangeEarService.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/service/IScChangeEarService.java new file mode 100644 index 0000000..93133ea --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/service/IScChangeEarService.java @@ -0,0 +1,61 @@ +package com.zhyc.module.produce.manage_sheep.service; + +import java.util.List; +import com.zhyc.module.produce.manage_sheep.domain.ScChangeEar; + +/** + * 修改电子耳号记录Service接口 + * + * @author ruoyi + * @date 2025-07-24 + */ +public interface IScChangeEarService +{ + /** + * 查询修改电子耳号记录 + * + * @param id 修改电子耳号记录主键 + * @return 修改电子耳号记录 + */ + public ScChangeEar selectScChangeEarById(Integer id); + + /** + * 查询修改电子耳号记录列表 + * + * @param scChangeEar 修改电子耳号记录 + * @return 修改电子耳号记录集合 + */ + public List selectScChangeEarList(ScChangeEar scChangeEar); + + /** + * 新增修改电子耳号记录 + * + * @param scChangeEar 修改电子耳号记录 + * @return 结果 + */ + public int insertScChangeEar(ScChangeEar scChangeEar); + + /** + * 修改修改电子耳号记录 + * + * @param scChangeEar 修改电子耳号记录 + * @return 结果 + */ + public int updateScChangeEar(ScChangeEar scChangeEar); + + /** + * 批量删除修改电子耳号记录 + * + * @param ids 需要删除的修改电子耳号记录主键集合 + * @return 结果 + */ + public int deleteScChangeEarByIds(Integer[] ids); + + /** + * 删除修改电子耳号记录信息 + * + * @param id 修改电子耳号记录主键 + * @return 结果 + */ + public int deleteScChangeEarById(Integer id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/service/IScChangeVarietyService.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/service/IScChangeVarietyService.java new file mode 100644 index 0000000..7de8f59 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/service/IScChangeVarietyService.java @@ -0,0 +1,61 @@ +package com.zhyc.module.produce.manage_sheep.service; + +import java.util.List; +import com.zhyc.module.produce.manage_sheep.domain.ScChangeVariety; + +/** + * 改品种记录Service接口 + * + * @author ruoyi + * @date 2025-07-24 + */ +public interface IScChangeVarietyService +{ + /** + * 查询改品种记录 + * + * @param id 改品种记录主键 + * @return 改品种记录 + */ + public ScChangeVariety selectScChangeVarietyById(Integer id); + + /** + * 查询改品种记录列表 + * + * @param scChangeVariety 改品种记录 + * @return 改品种记录集合 + */ + public List selectScChangeVarietyList(ScChangeVariety scChangeVariety); + + /** + * 新增改品种记录 + * + * @param scChangeVariety 改品种记录 + * @return 结果 + */ + public int insertScChangeVariety(ScChangeVariety scChangeVariety); + + /** + * 修改改品种记录 + * + * @param scChangeVariety 改品种记录 + * @return 结果 + */ + public int updateScChangeVariety(ScChangeVariety scChangeVariety); + + /** + * 批量删除改品种记录 + * + * @param ids 需要删除的改品种记录主键集合 + * @return 结果 + */ + public int deleteScChangeVarietyByIds(Integer[] ids); + + /** + * 删除改品种记录信息 + * + * @param id 改品种记录主键 + * @return 结果 + */ + public int deleteScChangeVarietyById(Integer id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/service/IScTransGroupService.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/service/IScTransGroupService.java new file mode 100644 index 0000000..6430d38 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/service/IScTransGroupService.java @@ -0,0 +1,67 @@ +package com.zhyc.module.produce.manage_sheep.service; + +import java.util.List; + +import com.zhyc.module.produce.manage_sheep.domain.ScTransGroup; + +/** + * 转群记录Service接口 + * + * @author ruoyi + * @date 2025-07-10 + */ +public interface IScTransGroupService { + /** + * 查询转群记录 + * + * @param id 转群记录主键 + * @return 转群记录 + */ + public ScTransGroup selectScTransGroupById(Integer id); + + /** + * 查询转群记录列表 + * + * @param scTransGroup 转群记录 + * @return 转群记录集合 + */ + public List selectScTransGroupList(ScTransGroup scTransGroup); + + /** + * 新增转群记录 + * + * @param scTransGroup 转群记录 + * @return 结果 + */ + public int insertScTransGroup(ScTransGroup scTransGroup); + + /** + * 修改转群记录 + * + * @param scTransGroup 转群记录 + * @return 结果 + */ + public int updateScTransGroup(ScTransGroup scTransGroup); + + /** + * 批量删除转群记录 + * + * @param ids 需要删除的转群记录主键集合 + * @return 结果 + */ + public int deleteScTransGroupByIds(Integer[] ids); + + /** + * 删除转群记录信息 + * + * @param id 转群记录主键 + * @return 结果 + */ + public int deleteScTransGroupById(Integer id); + + + /** + * 审批转群记录 + */ + int approveScTransGroup(ScTransGroup scTransGroup); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/service/IScTransitionInfoService.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/service/IScTransitionInfoService.java new file mode 100644 index 0000000..b578491 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/service/IScTransitionInfoService.java @@ -0,0 +1,73 @@ +package com.zhyc.module.produce.manage_sheep.service; + +import java.util.List; + +import com.zhyc.module.produce.manage_sheep.domain.ScTransitionInfo; + +/** + * 转场Service接口 + * + * @author ruoyi + * @date 2025-07-10 + */ +public interface IScTransitionInfoService { + /** + * 查询转场 + * + * @param id 转场主键 + * @return 转场 + */ + public ScTransitionInfo selectScTransitionInfoById(Integer id); + + /** + * 查询转场列表 + * + * @param scTransitionInfo 转场 + * @return 转场集合 + */ + public List selectScTransitionInfoList(ScTransitionInfo scTransitionInfo); + + /** + * 新增转场 + * + * @param scTransitionInfo 转场 + * @return 结果 + */ + public int insertScTransitionInfo(ScTransitionInfo scTransitionInfo); + + /** + * 修改转场 + * + * @param scTransitionInfo 转场 + * @return 结果 + */ + public int updateScTransitionInfo(ScTransitionInfo scTransitionInfo); + + /** + * 批量删除转场 + * + * @param ids 需要删除的转场主键集合 + * @return 结果 + */ + public int deleteScTransitionInfoByIds(Integer[] ids); + + /** + * 删除转场信息 + * + * @param id 转场主键 + * @return 结果 + */ + public int deleteScTransitionInfoById(Integer id); + + //批量转场 + public int insertScTransitionInfoBatch(List transitionInfoList); + + //状态 + public String convertStatus(Integer status); + + //转场类型 + public String convertTransType(Integer transType); + + //审批转场 + public int approveScTransitionInfo(ScTransitionInfo scTransitionInfo); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/service/impl/ScAddSheepServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/service/impl/ScAddSheepServiceImpl.java new file mode 100644 index 0000000..b6ed6b4 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/service/impl/ScAddSheepServiceImpl.java @@ -0,0 +1,189 @@ +package com.zhyc.module.produce.manage_sheep.service.impl; + +import com.zhyc.common.exception.ServiceException; +import com.zhyc.common.utils.StringUtils; +import com.zhyc.module.base.mapper.BasSheepVarietyMapper; +import com.zhyc.module.produce.manage_sheep.domain.ScAddSheep; +import com.zhyc.module.produce.manage_sheep.mapper.ScAddSheepMapper; +import com.zhyc.module.produce.manage_sheep.service.IScAddSheepService; +import com.zhyc.module.base.domain.BasSheep; +import com.zhyc.module.base.service.IBasSheepService; +import com.zhyc.module.base.domain.DaSheepfold; +import com.zhyc.module.base.mapper.DaSheepfoldMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Date; +import java.util.List; + +@Service +public class ScAddSheepServiceImpl implements IScAddSheepService { + + @Autowired + private ScAddSheepMapper scAddSheepMapper; + + @Autowired + private DaSheepfoldMapper daSheepfoldMapper; + + @Autowired + private IBasSheepService basSheepService; + + @Autowired + private BasSheepVarietyMapper basSheepVarietyMapper; + + //新增 + @Override + @Transactional(rollbackFor = Exception.class) + public boolean insertScAddSheep(ScAddSheep scAddSheep) { + BasSheep existSheep =basSheepService.selectBasSheepByManageTags(scAddSheep.getEarNumber().trim()); + if (existSheep != null) { + throw new ServiceException("添加失败,耳号已存在"); + } + + boolean ok = scAddSheepMapper.insert(scAddSheep) > 0; + if (!ok) return false; + + BasSheep bs = new BasSheep(); + bs.setManageTags(scAddSheep.getEarNumber()); +// bs.setElectronicTags(scAddSheep.getEarNumber()); + bs.setSheepfoldId(scAddSheep.getSheepfold().longValue()); + bs.setFatherId(null); + bs.setMotherId(null); + bs.setBirthWeight(scAddSheep.getBornWeight().longValue()); + bs.setSource(String.valueOf(2)); + bs.setBirthday(scAddSheep.getBirthday()); + bs.setGender(scAddSheep.getGender().longValue()); + if (scAddSheep.getParity() != null) { + bs.setParity(scAddSheep.getParity().longValue()); + } else { + bs.setParity(null); + } + bs.setVarietyId(scAddSheep.getVarietyId().longValue()); + bs.setSourceDate(scAddSheep.getJoinDate()); + bs.setComment(scAddSheep.getComment()); + bs.setCreateBy(scAddSheep.getCreateBy()); + bs.setCreateTime(new Date()); + + basSheepService.insertBasSheep(bs); + return true; + } + + //查询 + @Override + public List selectScAddSheepList(ScAddSheep scAddSheep) { + return scAddSheepMapper.selectScAddSheepList(scAddSheep); + } + + //修改 + @Override + public boolean updateScAddSheep(ScAddSheep scAddSheep) { + return scAddSheepMapper.updateScAddSheep(scAddSheep) > 0; + } + + //删除 + @Override + public boolean deleteScAddSheepByIds(Integer[] ids) { + return scAddSheepMapper.deleteScAddSheepByIds(ids) > 0; + } + + //导入羊只 + @Override + @Transactional(rollbackFor = Exception.class) + public String importSheep(List list, boolean updateSupport, String operName) { + if (list == null || list.isEmpty()) { + throw new ServiceException("导入数据不能为空!"); + } + + int success = 0, failure = 0; + StringBuilder failureMsg = new StringBuilder(); + + for (int i = 0; i < list.size(); i++) { + ScAddSheep sheep = list.get(i); + try { + // 处理品种名称转换为品种ID + if (StringUtils.isNotBlank(sheep.getVarietyName())) { + Long varietyId = basSheepVarietyMapper.selectIdByName(sheep.getVarietyName()); + if (varietyId == null) { + failure++; + failureMsg.append("
第") + .append(i + 1) + .append("行:品种名称不存在【") + .append(sheep.getVarietyName()) + .append("】"); + continue; + } + sheep.setVarietyId(varietyId.intValue()); + } else { + failure++; + failureMsg.append("
第") + .append(i + 1) + .append("行:品种不能为空"); + continue; + } + + // 处理羊舍名称转换为羊舍ID + if (StringUtils.isNotBlank(sheep.getSheepfoldNameExcel())) { + DaSheepfold param = new DaSheepfold(); + param.setSheepfoldName(sheep.getSheepfoldNameExcel()); + List foldList = daSheepfoldMapper.selectDaSheepfoldList(param); + if (foldList == null || foldList.isEmpty()) { + failure++; + failureMsg.append("
第") + .append(i + 1) + .append("行:羊舍名称不存在【") + .append(sheep.getSheepfoldNameExcel()) + .append("】"); + continue; + } + sheep.setSheepfold(foldList.get(0).getId().intValue()); + } + + // 校验耳号是否为空 + if (StringUtils.isBlank(sheep.getEarNumber())) { + failure++; + failureMsg.append("
第") + .append(i + 1) + .append("行:耳号不能为空"); + continue; + } + + // 核心校验:判断羊只基本信息表中是否存在未删除的同名耳号 + BasSheep existSheep = basSheepService.selectBasSheepByManageTags(sheep.getEarNumber().trim()); + if (existSheep != null) { + failure++; + failureMsg.append("
第") + .append(i + 1) + .append("行:耳号已存在且未删除【") + .append(sheep.getEarNumber()) + .append("】"); + continue; + } + + // 执行导入(新增或更新) + if (updateSupport && sheep.getId() != null) { + sheep.setUpdateBy(operName); + updateScAddSheep(sheep); + } else { + sheep.setCreateBy(operName); + insertScAddSheep(sheep); + } + success++; + + } catch (Exception e) { + failure++; + failureMsg.append("
第") + .append(i + 1) + .append("行:") + .append(e.getMessage()); + } + } + + if (failure > 0) { + throw new ServiceException("导入失败!共 " + failure + " 条:" + failureMsg); + } + return "导入成功!共 " + success + " 条"; + } + + +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/service/impl/ScChangeCommentServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/service/impl/ScChangeCommentServiceImpl.java new file mode 100644 index 0000000..f45aa59 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/service/impl/ScChangeCommentServiceImpl.java @@ -0,0 +1,120 @@ +package com.zhyc.module.produce.manage_sheep.service.impl; + +import java.util.Date; +import java.util.List; +import com.zhyc.common.utils.DateUtils; +import com.zhyc.common.utils.SecurityUtils; +import com.zhyc.module.base.domain.BasSheep; +import com.zhyc.module.base.service.IBasSheepService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.zhyc.module.produce.manage_sheep.mapper.ScChangeCommentMapper; +import com.zhyc.module.produce.manage_sheep.domain.ScChangeComment; +import com.zhyc.module.produce.manage_sheep.service.IScChangeCommentService; +import org.springframework.transaction.annotation.Transactional; + +/** + * 改备注Service业务层处理 + * + * @author ruoyi + * @date 2025-07-24 + */ +@Service +public class ScChangeCommentServiceImpl implements IScChangeCommentService +{ + @Autowired + private ScChangeCommentMapper scChangeCommentMapper; + + @Autowired + private IBasSheepService basSheepService; + /** + * 查询改备注 + * + * @param id 改备注主键 + * @return 改备注 + */ + @Override + public ScChangeComment selectScChangeCommentById(Long id) + { + return scChangeCommentMapper.selectScChangeCommentById(id); + } + + /** + * 查询改备注列表 + * + * @param scChangeComment 改备注 + * @return 改备注 + */ + @Override + public List selectScChangeCommentList(ScChangeComment scChangeComment) + { + return scChangeCommentMapper.selectScChangeCommentList(scChangeComment); + } + + /** + * 新增改备注 + * + * @param scChangeComment 改备注 + * @return 结果 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int insertScChangeComment(ScChangeComment scChangeComment) + { + scChangeComment.setCreateTime(new Date()); + scChangeComment.setCreateBy(SecurityUtils.getUsername()); + int rows = scChangeCommentMapper.insertScChangeComment(scChangeComment); + if (rows <= 0) { + return rows; + } + + String manageTags = scChangeComment.getManageTags(); + BasSheep sheep = basSheepService.selectBasSheepByManageTags(manageTags); + if (sheep == null) { + throw new RuntimeException("未找到耳号为【" + manageTags + "】的羊只,无法更新备注"); + } + + sheep.setComment(scChangeComment.getNewComment()); + basSheepService.updateBasSheep(sheep); + + return rows; + } + + /** + * 修改改备注 + * + * @param scChangeComment 改备注 + * @return 结果 + */ + @Override + public int updateScChangeComment(ScChangeComment scChangeComment) + { + return scChangeCommentMapper.updateScChangeComment(scChangeComment); + } + + /** + * 批量删除改备注 + * + * @param ids 需要删除的改备注主键 + * @return 结果 + */ + @Override + public int deleteScChangeCommentByIds(Long[] ids) + { + return scChangeCommentMapper.deleteScChangeCommentByIds(ids); + } + + /** + * 删除改备注信息 + * + * @param id 改备注主键 + * @return 结果 + */ + @Override + public int deleteScChangeCommentById(Long id) + { + return scChangeCommentMapper.deleteScChangeCommentById(id); + } + + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/service/impl/ScChangeEarServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/service/impl/ScChangeEarServiceImpl.java new file mode 100644 index 0000000..8f78e50 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/service/impl/ScChangeEarServiceImpl.java @@ -0,0 +1,156 @@ +package com.zhyc.module.produce.manage_sheep.service.impl; + +import java.util.List; +import com.zhyc.common.utils.DateUtils; +import com.zhyc.common.utils.SecurityUtils; +import com.zhyc.module.base.domain.BasSheep; +import com.zhyc.module.base.service.IBasSheepService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.zhyc.module.produce.manage_sheep.mapper.ScChangeEarMapper; +import com.zhyc.module.produce.manage_sheep.domain.ScChangeEar; +import com.zhyc.module.produce.manage_sheep.service.IScChangeEarService; +import org.springframework.transaction.annotation.Transactional; + +/** + * 修改电子耳号记录Service业务层处理 + * + * @author ruoyi + * @date 2025-07-24 + */ +@Service +public class ScChangeEarServiceImpl implements IScChangeEarService +{ + @Autowired + private ScChangeEarMapper scChangeEarMapper; + + @Autowired + private IBasSheepService basSheepService; + /** + * 查询修改电子耳号记录 + * + * @param id 修改电子耳号记录主键 + * @return 修改电子耳号记录 + */ + @Override + public ScChangeEar selectScChangeEarById(Integer id) { + ScChangeEar changeEar = scChangeEarMapper.selectScChangeEarById(id); + if (changeEar != null && changeEar.getSheepId() != null) { + System.out.println("当前要查询羊只信息的sheepId: " + changeEar.getSheepId()); + BasSheep sheep = basSheepService.selectBasSheepById(changeEar.getSheepId()); + System.out.println("查询到的羊只信息: " + sheep); + if (sheep != null) { + if (changeEar.getEarType() != null) { + if (changeEar.getEarType() == 0) { + changeEar.setOldTag(sheep.getElectronicTags()); + } else { + changeEar.setOldTag(sheep.getManageTags()); + } + } + changeEar.setManageTags(sheep.getManageTags()); + } else { + System.out.println("根据sheepId: " + changeEar.getSheepId() + " 未查询到对应的羊只信息"); + } + } else { + System.out.println("changeEar为null或者sheepId为null"); + } + System.out.println("设置旧耳号: " + changeEar.getOldTag()); + return changeEar; + } + + /** + * 查询修改电子耳号记录列表 + * + * @param scChangeEar 修改电子耳号记录 + * @return 修改电子耳号记录 + */ + @Override + public List selectScChangeEarList(ScChangeEar scChangeEar) { + List list = scChangeEarMapper.selectScChangeEarList(scChangeEar); + return list; + } + + /** + * 新增修改电子耳号记录 + * + * @param scChangeEar 修改电子耳号记录 + * @return 结果 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int insertScChangeEar(ScChangeEar scChangeEar) { + scChangeEar.setCreateTime(DateUtils.getNowDate()); + scChangeEar.setCreateBy(SecurityUtils.getUsername()); + + // 在新增时,确保旧耳号被正确设置为原始耳号的值 + if (scChangeEar.getSheepId() == null) { + throw new RuntimeException("未找到对应的羊只ID"); + } + + BasSheep sheep = basSheepService.selectBasSheepById(scChangeEar.getSheepId()); + if (sheep == null) { + throw new RuntimeException("未找到ID为【" + scChangeEar.getSheepId() + "】的羊只"); + } + + // 设置旧耳号为原始耳号的值 + if (scChangeEar.getEarType() == 0) { + scChangeEar.setOldTag(sheep.getElectronicTags()); + } else if (scChangeEar.getEarType() == 1) { + scChangeEar.setOldTag(sheep.getManageTags()); + } else { + throw new RuntimeException("无效的耳号类型:" + scChangeEar.getEarType()); + } + + int rows = scChangeEarMapper.insertScChangeEar(scChangeEar); + System.out.println(scChangeEar); + if (rows <= 0) { + return rows; + } + + // 更新羊只基本信息表中的管理耳号或电子耳号 + if (scChangeEar.getEarType() == 0) { + sheep.setElectronicTags(scChangeEar.getNewTag()); + } else if (scChangeEar.getEarType() == 1) { + sheep.setManageTags(scChangeEar.getNewTag()); + } + basSheepService.updateBasSheep(sheep); + + return rows; + } + + /** + * 修改修改电子耳号记录 + * + * @param scChangeEar 修改电子耳号记录 + * @return 结果 + */ + @Override + public int updateScChangeEar(ScChangeEar scChangeEar) + { + return scChangeEarMapper.updateScChangeEar(scChangeEar); + } + + /** + * 批量删除修改电子耳号记录 + * + * @param ids 需要删除的修改电子耳号记录主键 + * @return 结果 + */ + @Override + public int deleteScChangeEarByIds(Integer[] ids) + { + return scChangeEarMapper.deleteScChangeEarByIds(ids); + } + + /** + * 删除修改电子耳号记录信息 + * + * @param id 修改电子耳号记录主键 + * @return 结果 + */ + @Override + public int deleteScChangeEarById(Integer id) + { + return scChangeEarMapper.deleteScChangeEarById(id); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/service/impl/ScChangeVarietyServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/service/impl/ScChangeVarietyServiceImpl.java new file mode 100644 index 0000000..9551a56 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/service/impl/ScChangeVarietyServiceImpl.java @@ -0,0 +1,127 @@ +package com.zhyc.module.produce.manage_sheep.service.impl; + +import java.util.Date; +import java.util.List; + +import com.zhyc.common.utils.SecurityUtils; +import com.zhyc.module.base.domain.BasSheep; +import com.zhyc.module.base.domain.BasSheepVariety; +import com.zhyc.module.base.service.IBasSheepService; +import com.zhyc.module.base.service.IBasSheepVarietyService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.zhyc.module.produce.manage_sheep.mapper.ScChangeVarietyMapper; +import com.zhyc.module.produce.manage_sheep.domain.ScChangeVariety; +import com.zhyc.module.produce.manage_sheep.service.IScChangeVarietyService; +import org.springframework.transaction.annotation.Transactional; + +/** + * 改品种记录Service业务层处理 + * + * @author ruoyi + * @date 2025-07-24 + */ +@Service +public class ScChangeVarietyServiceImpl implements IScChangeVarietyService +{ + @Autowired + private ScChangeVarietyMapper scChangeVarietyMapper; + @Autowired + private IBasSheepService basSheepService; + @Autowired + private IBasSheepVarietyService varietyService; + /** + * 查询改品种记录 + * + * @param id 改品种记录主键 + * @return 改品种记录 + */ + @Override + public ScChangeVariety selectScChangeVarietyById(Integer id) + { + return scChangeVarietyMapper.selectScChangeVarietyById(id); + } + + /** + * 查询改品种记录列表 + * + * @param scChangeVariety 改品种记录 + * @return 改品种记录 + */ + @Override + public List selectScChangeVarietyList(ScChangeVariety scChangeVariety) + { + return scChangeVarietyMapper.selectScChangeVarietyList(scChangeVariety); + } + + /** + * 新增改品种记录 + * + * @param scChangeVariety 改品种记录 + * @return 结果 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int insertScChangeVariety(ScChangeVariety scChangeVariety) + { + scChangeVariety.setCreateTime(new Date()); + scChangeVariety.setCreateBy(SecurityUtils.getUsername()); + int rows = scChangeVarietyMapper.insertScChangeVariety(scChangeVariety); + if (rows <= 0) { + return rows; + } + + String manageTags = scChangeVariety.getManageTags(); + BasSheep sheep = basSheepService.selectBasSheepByManageTags(manageTags); + if (sheep == null) { + throw new RuntimeException("未找到耳号为【" + manageTags + "】的羊只,无法更新品种"); + } + + String newVarietyName = scChangeVariety.getVarietyNew(); + BasSheepVariety newVariety = varietyService.selectByVarietyName(newVarietyName); + if (newVariety == null) { + throw new RuntimeException("未找到品种【" + newVarietyName + "】的信息,请检查品种名称"); + } + + sheep.setVarietyId(newVariety.getId()); + basSheepService.updateBasSheep(sheep); + + return rows; + } + + /** + * 修改改品种记录 + * + * @param scChangeVariety 改品种记录 + * @return 结果 + */ + @Override + public int updateScChangeVariety(ScChangeVariety scChangeVariety) + { + return scChangeVarietyMapper.updateScChangeVariety(scChangeVariety); + } + + /** + * 批量删除改品种记录 + * + * @param ids 需要删除的改品种记录主键 + * @return 结果 + */ + @Override + public int deleteScChangeVarietyByIds(Integer[] ids) + { + return scChangeVarietyMapper.deleteScChangeVarietyByIds(ids); + } + + /** + * 删除改品种记录信息 + * + * @param id 改品种记录主键 + * @return 结果 + */ + @Override + public int deleteScChangeVarietyById(Integer id) + { + return scChangeVarietyMapper.deleteScChangeVarietyById(id); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/service/impl/ScTransGroupServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/service/impl/ScTransGroupServiceImpl.java new file mode 100644 index 0000000..3604f92 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/service/impl/ScTransGroupServiceImpl.java @@ -0,0 +1,180 @@ +package com.zhyc.module.produce.manage_sheep.service.impl; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.zhyc.common.utils.DateUtils; +import com.zhyc.common.utils.SecurityUtils; +import com.zhyc.module.base.domain.BasSheep; +import com.zhyc.module.base.mapper.BasSheepMapper; +import com.zhyc.module.base.service.IBasSheepService; +import com.zhyc.module.produce.manage_sheep.mapper.ScTransGroupMapper; +import com.zhyc.module.produce.manage_sheep.service.IScTransGroupService; +import com.zhyc.module.produce.manage_sheep.domain.ScTransGroup; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * 转群记录Service业务层处理 + * + * @author ruoyi + * @date 2025-07-10 + */ +@Service +public class ScTransGroupServiceImpl implements IScTransGroupService { + @Autowired + private ScTransGroupMapper scTransGroupMapper; + @Autowired + private BasSheepMapper basSheepMapper; + @Autowired + private IBasSheepService basSheepService; + /** + * 查询转群记录 + * + * @param id 转群记录主键 + * @return 转群记录 + */ + @Override + public ScTransGroup selectScTransGroupById(Integer id) { + ScTransGroup group = scTransGroupMapper.selectScTransGroupById(id); + group.setReasonText(convertReason(group.getReason())); + group.setStatusText(convertStatus(group.getStatus())); + return group; + } + + + /** + * 查询转群记录列表 + * + * @param scTransGroup 转群记录 + * @return 转群记录 + */ + @Override + public List selectScTransGroupList(ScTransGroup scTransGroup) { + List list = scTransGroupMapper.selectScTransGroupList(scTransGroup); + list.forEach(group -> { + group.setReasonText(convertReason(group.getReason())); + group.setStatusText(convertStatus(group.getStatus())); + }); + return list; + } + + /** + * 新增转群记录 + * + * @param scTransGroup 转群记录 + * @return 结果 + */ + + @Override + public int insertScTransGroup(ScTransGroup scTransGroup) { + scTransGroup.setStatus(0); + scTransGroup.setCreateTime(DateUtils.getNowDate()); + scTransGroup.setCreateBy(SecurityUtils.getUsername()); + return scTransGroupMapper.insertScTransGroup(scTransGroup); + } + + /** + * 修改转群记录 + * + * @param scTransGroup 转群记录 + * @return 结果 + */ + @Override + public int updateScTransGroup(ScTransGroup scTransGroup) { + return scTransGroupMapper.updateScTransGroup(scTransGroup); + } + + /** + * 批量删除转群记录 + * + * @param ids 需要删除的转群记录主键 + * @return 结果 + */ + @Override + public int deleteScTransGroupByIds(Integer[] ids) { + return scTransGroupMapper.deleteScTransGroupByIds(ids); + } + + /** + * 删除转群记录信息 + * + * @param id 转群记录主键 + * @return 结果 + */ + @Override + public int deleteScTransGroupById(Integer id) { + return scTransGroupMapper.deleteScTransGroupById(id); + } + + + /** + * 审批转群记录 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int approveScTransGroup(ScTransGroup scTransGroup) { + int rows = scTransGroupMapper.updateScTransGroup(scTransGroup); + + if (rows > 0 && scTransGroup.getStatus() == 1) { + updateSheepFold(scTransGroup); + } + + return rows; + } + + /** + * 更新羊只所在羊舍 + */ + private void updateSheepFold(ScTransGroup transGroup) { + Long foldTo = Long.valueOf(transGroup.getFoldTo()); + if (foldTo == null) { + throw new RuntimeException("转入羊舍不能为空"); + } + + String manageTags = transGroup.getManageTags(); + if (manageTags == null || manageTags.isEmpty()) { + throw new RuntimeException("耳号不能为空"); + } + + List tagList = Arrays.asList(manageTags.split(",")); + + for (String tag : tagList) { + BasSheep sheep = basSheepService.selectBasSheepByManageTags(tag.trim()); + if (sheep != null) { + BasSheep updateSheep = new BasSheep(); + updateSheep.setId(sheep.getId()); + updateSheep.setSheepfoldId(foldTo); + basSheepMapper.updateBasSheep(updateSheep); + } else { + throw new RuntimeException("耳号 [" + tag + "] 不存在"); + } + } + } + + /** + * 转换转群原因 + */ + private String convertReason(Integer reasonCode) { + Map reasonMap = new HashMap<>(); + reasonMap.put(0, "新产羊过抗转群"); + reasonMap.put(1, "治愈转群"); + reasonMap.put(2, "病羊过抗转群"); + return reasonMap.getOrDefault(reasonCode, "未知原因"); + } + + /** + * 转换状态 + */ + private String convertStatus(Integer statusCode) { + Map statusMap = new HashMap<>(); + statusMap.put(0, "待批准"); + statusMap.put(1, "通过"); + statusMap.put(2, "驳回"); + return statusMap.getOrDefault(statusCode, "未知状态"); + } + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/service/impl/ScTransitionInfoServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/service/impl/ScTransitionInfoServiceImpl.java new file mode 100644 index 0000000..cd8a96b --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/service/impl/ScTransitionInfoServiceImpl.java @@ -0,0 +1,201 @@ +package com.zhyc.module.produce.manage_sheep.service.impl; + +import java.util.*; + +import com.zhyc.common.utils.DateUtils; +import com.zhyc.common.utils.SecurityUtils; +import com.zhyc.common.utils.StringUtils; +import com.zhyc.module.base.domain.BasSheep; +import com.zhyc.module.base.domain.DaRanch; +import com.zhyc.module.base.mapper.BasSheepMapper; +import com.zhyc.module.base.mapper.DaRanchMapper; +import com.zhyc.module.base.service.IBasSheepService; +import com.zhyc.module.base.service.IDaRanchService; +import com.zhyc.module.produce.manage_sheep.mapper.ScTransitionInfoMapper; +import com.zhyc.module.produce.manage_sheep.domain.ScTransitionInfo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.zhyc.module.produce.manage_sheep.service.IScTransitionInfoService; +import org.springframework.transaction.annotation.Transactional; + +/** + * 转场Service业务层处理 + * + * @author ruoyi + * @date 2025-07-10 + */ +@Service +public class ScTransitionInfoServiceImpl implements IScTransitionInfoService +{ + @Autowired + private ScTransitionInfoMapper scTransitionInfoMapper; + @Autowired + private BasSheepMapper basSheepMapper; + @Autowired + private IDaRanchService daRanchService; + @Autowired + private IBasSheepService basSheepService; + /** + * 查询转场 + * + * @param id 转场主键 + * @return 转场 + */ + @Override + public ScTransitionInfo selectScTransitionInfoById(Integer id) + { + return scTransitionInfoMapper.selectScTransitionInfoById(id); + } + + /** + * 查询转场列表 + * + * @param scTransitionInfo 转场 + * @return 转场 + */ + @Override + public List selectScTransitionInfoList(ScTransitionInfo scTransitionInfo) + { + return scTransitionInfoMapper.selectScTransitionInfoList(scTransitionInfo); + } + + /** + * 新增转场 + * + * @param scTransitionInfo 转场 + * @return 结果 + */ + @Override + public int insertScTransitionInfo(ScTransitionInfo scTransitionInfo) + { + scTransitionInfo.setStatus(0); + scTransitionInfo.setCreateTime(DateUtils.getNowDate()); + return scTransitionInfoMapper.insertScTransitionInfo(scTransitionInfo); + } + + /** + * 修改转场 + * + * @param scTransitionInfo 转场 + * @return 结果 + */ + @Override + public int updateScTransitionInfo(ScTransitionInfo scTransitionInfo) + { + return scTransitionInfoMapper.updateScTransitionInfo(scTransitionInfo); + } + + /** + * 批量删除转场 + * + * @param ids 需要删除的转场主键 + * @return 结果 + */ + @Override + public int deleteScTransitionInfoByIds(Integer[] ids) + { + return scTransitionInfoMapper.deleteScTransitionInfoByIds(ids); + } + + /** + * 删除转场信息 + * + * @param id 转场主键 + * @return 结果 + */ + @Override + public int deleteScTransitionInfoById(Integer id) + { + return scTransitionInfoMapper.deleteScTransitionInfoById(id); + } + + @Override + public int insertScTransitionInfoBatch(List transitionInfoList) { + String username = SecurityUtils.getUsername(); + Date now = DateUtils.getNowDate(); + + for (ScTransitionInfo info : transitionInfoList) { + info.setCreateBy(username); // 设置创建人 + info.setCreateTime(now); // 设置创建时间 + info.setStatus(0); // 设置默认状态 + } + return scTransitionInfoMapper.insertScTransitionInfoBatch(transitionInfoList); + } + + /** + * 审批转场记录(通过时更新羊只所在牧场) + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int approveScTransitionInfo(ScTransitionInfo scTransitionInfo) { + int rows = scTransitionInfoMapper.updateScTransitionInfo(scTransitionInfo); + + if (rows > 0 && scTransitionInfo.getStatus() == 1) { + updateSheepRanch(scTransitionInfo); + } + return rows; + } + + /** + * 更新羊只的所在牧场(基于现有牧场列表接口) + */ + private void updateSheepRanch(ScTransitionInfo transitionInfo) { + String transTo = transitionInfo.getTransTo(); + if (StringUtils.isBlank(transTo)) { + throw new RuntimeException("转入牧场不能为空"); + } + + DaRanch query = new DaRanch(); + query.setRanch(transTo); + List ranchList = daRanchService.selectDaRanchList(query); + + Optional matchedRanch = ranchList.stream() + .filter(ranch -> transTo.equals(ranch.getRanch())) + .findFirst(); + + if (!matchedRanch.isPresent()) { + throw new RuntimeException("转入牧场 [" + transTo + "] 不存在"); + } + Long targetRanchId = matchedRanch.get().getId(); + + String manageTags = transitionInfo.getManageTags(); + if (StringUtils.isBlank(manageTags)) { + throw new RuntimeException("耳号不能为空"); + } + List tagList = Arrays.asList(manageTags.split(",")); + + for (String tag : tagList) { + BasSheep sheep = basSheepService.selectBasSheepByManageTags(tag.trim()); + if (sheep == null) { + throw new RuntimeException("耳号 [" + tag + "] 不存在"); + } + + BasSheep updateSheep = new BasSheep(); + updateSheep.setId(sheep.getId()); + updateSheep.setRanchId(targetRanchId); + basSheepMapper.updateBasSheep(updateSheep); + } + } + + /** + * 状态 + */ + public String convertStatus(Integer statusCode) { + Map statusMap = new HashMap<>(); + statusMap.put(0, "待批准"); + statusMap.put(1, "通过"); + statusMap.put(2, "驳回"); + return statusMap.getOrDefault(statusCode, "未知状态"); + } + + /** + * 转场类型 + */ + public String convertTransType(Integer transTypeCode) { + Map transTypeMap = new HashMap<>(); + transTypeMap.put(0, "内部调拨"); + transTypeMap.put(1, "内部销售"); + transTypeMap.put(2, "育肥调拨"); + return transTypeMap.getOrDefault(transTypeCode, "未知类型"); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/other/controller/ScCastrateController.java b/zhyc-module/src/main/java/com/zhyc/module/produce/other/controller/ScCastrateController.java new file mode 100644 index 0000000..914a781 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/other/controller/ScCastrateController.java @@ -0,0 +1,105 @@ +package com.zhyc.module.produce.other.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.zhyc.module.produce.other.domain.ScCastrate; +import com.zhyc.module.produce.other.service.IScCastrateService; +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-09 + */ +@RestController +@RequestMapping("/produce/other/castrate") +public class ScCastrateController extends BaseController +{ + @Autowired + private IScCastrateService scCastrateService; + + /** + * 查询去势列表 + */ + @PreAuthorize("@ss.hasPermi('produce:castrate:list')") + @GetMapping("/list") + public TableDataInfo list(ScCastrate scCastrate) + { + startPage(); + List list = scCastrateService.selectScCastrateList(scCastrate); + return getDataTable(list); + } + + /** + * 导出去势列表 + */ + @PreAuthorize("@ss.hasPermi('produce:castrate:export')") + @Log(title = "去势", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, ScCastrate scCastrate) + { + List list = scCastrateService.selectScCastrateList(scCastrate); + ExcelUtil util = new ExcelUtil(ScCastrate.class); + util.exportExcel(response, list, "去势数据"); + } + + /** + * 获取去势详细信息 + */ + @PreAuthorize("@ss.hasPermi('produce:castrate:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(scCastrateService.selectScCastrateById(id)); + } + + /** + * 新增去势 + */ + @PreAuthorize("@ss.hasPermi('produce:castrate:add')") + @Log(title = "去势", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ScCastrate scCastrate) + { + return toAjax(scCastrateService.insertScCastrate(scCastrate)); + } + + /** + * 修改去势 + */ + @PreAuthorize("@ss.hasPermi('produce:castrate:edit')") + @Log(title = "去势", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ScCastrate scCastrate) + { + return toAjax(scCastrateService.updateScCastrate(scCastrate)); + } + + /** + * 删除去势 + */ + @PreAuthorize("@ss.hasPermi('produce:castrate:remove')") + @Log(title = "去势", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(scCastrateService.deleteScCastrateByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/other/controller/ScFixHoofController.java b/zhyc-module/src/main/java/com/zhyc/module/produce/other/controller/ScFixHoofController.java new file mode 100644 index 0000000..9f97e71 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/other/controller/ScFixHoofController.java @@ -0,0 +1,113 @@ +package com.zhyc.module.produce.other.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.zhyc.common.utils.StringUtils; +import com.zhyc.module.produce.other.domain.ScFixHoof; +import com.zhyc.module.produce.other.service.IScFixHoofService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +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-10 + */ +@RestController +@RequestMapping("/produce/other/fixHoof") +public class ScFixHoofController extends BaseController +{ + @Autowired + private IScFixHoofService scFixHoofService; + + /** + * 查询修蹄列表 + */ + @PreAuthorize("@ss.hasPermi('produce:fixHoof:list')") + @GetMapping("/list") + public TableDataInfo list(ScFixHoof scFixHoof) + { + startPage(); + List list = scFixHoofService.selectScFixHoofList(scFixHoof); + return getDataTable(list); + + } + + /** + * 导出修蹄列表 + */ + @PreAuthorize("@ss.hasPermi('produce:fixHoof:export')") + @Log(title = "修蹄", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, ScFixHoof scFixHoof) + { + List list = scFixHoofService.selectScFixHoofList(scFixHoof); + ExcelUtil util = new ExcelUtil(ScFixHoof.class); + util.exportExcel(response, list, "修蹄数据"); + } + + /** + * 获取修蹄详细信息 + */ + @PreAuthorize("@ss.hasPermi('produce:fixHoof:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Integer id) + { + return success(scFixHoofService.selectScFixHoofById(id)); + } + + /** + * 新增修蹄记录(支持批量) + * @return 结果 + */ + @PreAuthorize("@ss.hasPermi('produce:fixHoof:add')") + @Log(title = "修蹄", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody List dtos) { + for (ScFixHoof dto : dtos) { + if (dto.getSheepId() == null && StringUtils.isNotBlank(dto.getManageTags())) { + Long sheepId = scFixHoofService.findIdByManageTags(dto.getManageTags()); + dto.setSheepId(sheepId.intValue()); + } + + // 保存修蹄记录 + scFixHoofService.insertScFixHoof(dto); + } + return toAjax(dtos.size()); + } + + /** + * 修改修蹄 + */ + @PreAuthorize("@ss.hasPermi('produce:fixHoof:edit')") + @Log(title = "修蹄", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ScFixHoof dto){ + dto.setSheepId(scFixHoofService.findIdByManageTags(dto.getManageTags()).intValue()); + return toAjax(scFixHoofService.updateScFixHoof(dto)); + } + + /** + * 删除修蹄 + */ + @PreAuthorize("@ss.hasPermi('produce:fixHoof:remove')") + @Log(title = "修蹄", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Integer[] ids) + { + return toAjax(scFixHoofService.deleteScFixHoofByIds(ids)); + } + + + +} + diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/other/domain/ScCastrate.java b/zhyc-module/src/main/java/com/zhyc/module/produce/other/domain/ScCastrate.java new file mode 100644 index 0000000..1ebab6d --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/other/domain/ScCastrate.java @@ -0,0 +1,66 @@ +package com.zhyc.module.produce.other.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 去势对象 sc_castrate + * + * @author ruoyi + * @date 2025-07-09 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class ScCastrate extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * $column.columnComment + */ + private Long id; + + /** + * 羊只id + */ + private String sheepId; + + @Excel(name = "耳号") + private String manageTags; + + /** + * 羊舍id + */ + private Long sheepfold; + + @Excel(name = "羊舍名称") + private String sheepfoldName; + + /** 品种id */ + private Long varietyId; + + /** 品种名称(联表查询返回,非数据库字段) */ + @Excel(name = "品种") + private String varietyName; + + /** + * 备注 + */ + @Excel(name = "备注") + private String comment; + + /** + * 技术员 + */ + @Excel(name = "技术员") + private String technician; + + + + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/other/domain/ScFixHoof.java b/zhyc-module/src/main/java/com/zhyc/module/produce/other/domain/ScFixHoof.java new file mode 100644 index 0000000..60a92a8 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/other/domain/ScFixHoof.java @@ -0,0 +1,55 @@ +package com.zhyc.module.produce.other.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 修蹄对象 sc_fix_hoof + * + * @author ruoyi + * @date 2025-07-10 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class ScFixHoof extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Integer id; + + /** 羊只id */ + private Integer sheepId; + /** 管理耳号(仅用于接收参数/返回视图) */ + @Excel(name = "管理耳号") + private String manageTags; + + /** 羊舍id */ + private Integer sheepfold; + + /** 羊舍名称 */ + @Excel(name = "羊舍名称") + private String sheepfoldName; + + /** 品种id */ + private Long varietyId; + + /** 品种名称(联表查询返回,非数据库字段) */ + @Excel(name = "品种") + private String varietyName; + + /** 备注 */ + @Excel(name = "备注") + private String comment; + + /** 技术员 */ + @Excel(name = "技术员") + private String technician; + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/other/mapper/ScCastrateMapper.java b/zhyc-module/src/main/java/com/zhyc/module/produce/other/mapper/ScCastrateMapper.java new file mode 100644 index 0000000..8b09e94 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/other/mapper/ScCastrateMapper.java @@ -0,0 +1,64 @@ +package com.zhyc.module.produce.other.mapper; + +import java.util.List; + +import com.zhyc.module.produce.other.domain.ScCastrate; +import org.apache.ibatis.annotations.Mapper; + +/** + * 去势Mapper接口 + * + * @author ruoyi + * @date 2025-07-09 + */ +@Mapper +public interface ScCastrateMapper +{ + /** + * 查询去势 + * + * @param id 去势主键 + * @return 去势 + */ + public ScCastrate selectScCastrateById(Long id); + + /** + * 查询去势列表 + * + * @param scCastrate 去势 + * @return 去势集合 + */ + public List selectScCastrateList(ScCastrate scCastrate); + + /** + * 新增去势 + * + * @param scCastrate 去势 + * @return 结果 + */ + public int insertScCastrate(ScCastrate scCastrate); + + /** + * 修改去势 + * + * @param scCastrate 去势 + * @return 结果 + */ + public int updateScCastrate(ScCastrate scCastrate); + + /** + * 删除去势 + * + * @param id 去势主键 + * @return 结果 + */ + public int deleteScCastrateById(Long id); + + /** + * 批量删除去势 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteScCastrateByIds(Long[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/other/mapper/ScFixHoofMapper.java b/zhyc-module/src/main/java/com/zhyc/module/produce/other/mapper/ScFixHoofMapper.java new file mode 100644 index 0000000..490ddc4 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/other/mapper/ScFixHoofMapper.java @@ -0,0 +1,65 @@ +package com.zhyc.module.produce.other.mapper; + +import java.util.List; + +import com.zhyc.module.produce.other.domain.ScFixHoof; +import org.apache.ibatis.annotations.Mapper; + +/** + * 修蹄Mapper接口 + * + * @author ruoyi + * @date 2025-07-10 + */ +@Mapper +public interface ScFixHoofMapper { + /** + * 查询修蹄 + * + * @param id 修蹄主键 + * @return 修蹄 + */ + public ScFixHoof selectScFixHoofById(Integer id); + + /** + * 查询修蹄列表 + * + * @param scFixHoof 修蹄 + * @return 修蹄集合 + */ + public List selectScFixHoofList(ScFixHoof scFixHoof); + + /** + * 新增修蹄 + * + * @param scFixHoof 修蹄 + * @return 结果 + */ + public int insertScFixHoof(ScFixHoof scFixHoof); + + /** + * 修改修蹄 + * + * @param scFixHoof 修蹄 + * @return 结果 + */ + public int updateScFixHoof(ScFixHoof scFixHoof); + + /** + * 删除修蹄 + * + * @param id 修蹄主键 + * @return 结果 + */ + public int deleteScFixHoofById(Integer id); + + /** + * 批量删除修蹄 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteScFixHoofByIds(Integer[] ids); + + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/other/service/IScCastrateService.java b/zhyc-module/src/main/java/com/zhyc/module/produce/other/service/IScCastrateService.java new file mode 100644 index 0000000..293a6bf --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/other/service/IScCastrateService.java @@ -0,0 +1,63 @@ +package com.zhyc.module.produce.other.service; + +import java.util.List; + +import com.zhyc.module.produce.other.domain.ScCastrate; + +/** + * 去势Service接口 + * + * @author ruoyi + * @date 2025-07-09 + */ +public interface IScCastrateService { + /** + * 查询去势 + * + * @param id 去势主键 + * @return 去势 + */ + public ScCastrate selectScCastrateById(Long id); + + /** + * 查询去势列表 + * + * @param scCastrate 去势 + * @return 去势集合 + */ + public List selectScCastrateList(ScCastrate scCastrate); + + /** + * 新增去势 + * + * @param scCastrate 去势 + * @return 结果 + */ + public int insertScCastrate(ScCastrate scCastrate); + + /** + * 修改去势 + * + * @param scCastrate 去势 + * @return 结果 + */ + public int updateScCastrate(ScCastrate scCastrate); + + /** + * 批量删除去势 + * + * @param ids 需要删除的去势主键集合 + * @return 结果 + */ + public int deleteScCastrateByIds(Long[] ids); + + /** + * 删除去势信息 + * + * @param id 去势主键 + * @return 结果 + */ + public int deleteScCastrateById(Long id); + + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/other/service/IScFixHoofService.java b/zhyc-module/src/main/java/com/zhyc/module/produce/other/service/IScFixHoofService.java new file mode 100644 index 0000000..32d9263 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/other/service/IScFixHoofService.java @@ -0,0 +1,71 @@ +package com.zhyc.module.produce.other.service; + +import java.util.List; + +import com.zhyc.module.produce.other.domain.ScFixHoof; + +/** + * 修蹄Service接口 + * + * @author ruoyi + * @date 2025-07-10 + */ +public interface IScFixHoofService { + /** + * 查询修蹄 + * + * @param id 修蹄主键 + * @return 修蹄 + */ + public ScFixHoof selectScFixHoofById(Integer id); + + /** + * 查询修蹄列表 + * + * @param scFixHoof 修蹄 + * @return 修蹄集合 + */ + public List selectScFixHoofList(ScFixHoof scFixHoof); + + /** + * 新增修蹄 + * + * @param scFixHoof 修蹄 + * @return 结果 + */ + public int insertScFixHoof(ScFixHoof scFixHoof); + + /** + * 修改修蹄 + * + * @param scFixHoof 修蹄 + * @return 结果 + */ + public int updateScFixHoof(ScFixHoof scFixHoof); + + /** + * 批量删除修蹄 + * + * @param ids 需要删除的修蹄主键集合 + * @return 结果 + */ + public int deleteScFixHoofByIds(Integer[] ids); + + /** + * 删除修蹄信息 + * + * @param id 修蹄主键 + * @return 结果 + */ + public int deleteScFixHoofById(Integer id); + + /** + * 根据管理耳号查询 + * + * @param manageTags + * @return + */ + Long findIdByManageTags(String manageTags); + + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/other/service/impl/ScCastrateServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/produce/other/service/impl/ScCastrateServiceImpl.java new file mode 100644 index 0000000..74f80eb --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/other/service/impl/ScCastrateServiceImpl.java @@ -0,0 +1,108 @@ +package com.zhyc.module.produce.other.service.impl; + +import java.util.List; + +import com.zhyc.common.utils.DateUtils; +import com.zhyc.common.utils.SecurityUtils; +import com.zhyc.module.base.domain.BasSheep; +import com.zhyc.module.base.service.IBasSheepService; +import com.zhyc.module.produce.other.domain.ScCastrate; +import com.zhyc.module.produce.other.mapper.ScCastrateMapper; +import com.zhyc.module.produce.other.service.IScCastrateService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * 去势Service业务层处理 + * + * @author ruoyi + * @date 2025-07-09 + */ +@Service +public class ScCastrateServiceImpl implements IScCastrateService { + @Autowired + private ScCastrateMapper scCastrateMapper; + @Autowired + private IBasSheepService basSheepService; + + /** + * 查询去势 + * + * @param id 去势主键 + * @return 去势 + */ + @Override + public ScCastrate selectScCastrateById(Long id) { + return scCastrateMapper.selectScCastrateById(id); + } + + /** + * 查询去势列表 + * + * @param scCastrate 去势 + * @return 去势 + */ + @Override + public List selectScCastrateList(ScCastrate scCastrate) { + return scCastrateMapper.selectScCastrateList(scCastrate); + } + + /** + * 新增去势 + * + * @param scCastrate 去势 + * @return 结果 + */ + @Override + public int insertScCastrate(ScCastrate scCastrate) { + scCastrate.setCreateTime(DateUtils.getNowDate()); + scCastrate.setCreateBy(SecurityUtils.getUsername()); + int result = scCastrateMapper.insertScCastrate(scCastrate); + + if (result > 0 && scCastrate.getSheepId() != null) { + try { + BasSheep sheep = new BasSheep(); + sheep.setId(Long.parseLong(scCastrate.getSheepId())); + sheep.setGender(3L); + basSheepService.updateBasSheep(sheep); + } catch (Exception e) { + throw new RuntimeException("去势成功,但更新羊只性别失败,请重试"); + } + } + + return result; + } + + /** + * 修改去势 + * + * @param scCastrate 去势 + * @return 结果 + */ + @Override + public int updateScCastrate(ScCastrate scCastrate) { + return scCastrateMapper.updateScCastrate(scCastrate); + } + + /** + * 批量删除去势 + * + * @param ids 需要删除的去势主键 + * @return 结果 + */ + @Override + public int deleteScCastrateByIds(Long[] ids) { + return scCastrateMapper.deleteScCastrateByIds(ids); + } + + /** + * 删除去势信息 + * + * @param id 去势主键 + * @return 结果 + */ + @Override + public int deleteScCastrateById(Long id) { + return scCastrateMapper.deleteScCastrateById(id); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/other/service/impl/ScFixHoofServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/produce/other/service/impl/ScFixHoofServiceImpl.java new file mode 100644 index 0000000..fde7034 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/other/service/impl/ScFixHoofServiceImpl.java @@ -0,0 +1,123 @@ +package com.zhyc.module.produce.other.service.impl; + +import java.util.List; + +import com.zhyc.common.exception.ServiceException; +import com.zhyc.common.utils.DateUtils; +import com.zhyc.common.utils.SecurityUtils; +import com.zhyc.common.utils.StringUtils; +import com.zhyc.module.base.domain.BasSheep; +import com.zhyc.module.base.mapper.BasSheepMapper; +import com.zhyc.module.base.service.IDaSheepfoldService; +import com.zhyc.module.produce.other.domain.ScFixHoof; +import com.zhyc.module.produce.other.mapper.ScFixHoofMapper; +import com.zhyc.module.produce.other.service.IScFixHoofService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * 修蹄Service业务层处理 + * + * @author ruoyi + * @date 2025-07-10 + */ +@Service +public class ScFixHoofServiceImpl implements IScFixHoofService { + @Autowired + private ScFixHoofMapper scFixHoofMapper; + + @Autowired + private BasSheepMapper basSheepMapper; + + @Autowired + private IDaSheepfoldService daSheepfoldService; + + /** + * 查询修蹄 + * + * @param id 修蹄主键 + * @return 修蹄 + */ + @Override + public ScFixHoof selectScFixHoofById(Integer id) { + return scFixHoofMapper.selectScFixHoofById(id); + } + + /** + * 查询修蹄列表 + * + * @param scFixHoof 修蹄 + * @return 修蹄 + */ + @Override + public List selectScFixHoofList(ScFixHoof scFixHoof) { + return scFixHoofMapper.selectScFixHoofList(scFixHoof); + } + + /** + * 新增修蹄 + * + * @param scFixHoof 修蹄 + * @return 结果 + */ + @Override + public int insertScFixHoof(ScFixHoof scFixHoof) { + BasSheep sheep = basSheepMapper.selectBasSheepById(scFixHoof.getSheepId().longValue()); + if (sheep == null) { + throw new ServiceException("该羊只ID不存在,请检查后再添加"); + } + scFixHoof.setCreateTime(DateUtils.getNowDate()); + scFixHoof.setCreateBy(SecurityUtils.getUsername()); + return scFixHoofMapper.insertScFixHoof(scFixHoof); + } + + /** + * 修改修蹄 + * + * @param scFixHoof 修蹄 + * @return 结果 + */ + @Override + public int updateScFixHoof(ScFixHoof scFixHoof) { + return scFixHoofMapper.updateScFixHoof(scFixHoof); + } + + /** + * 批量删除修蹄 + * + * @param ids 需要删除的修蹄主键 + * @return 结果 + */ + @Override + public int deleteScFixHoofByIds(Integer[] ids) { + return scFixHoofMapper.deleteScFixHoofByIds(ids); + } + + /** + * 删除修蹄信息 + * + * @param id 修蹄主键 + * @return 结果 + */ + @Override + public int deleteScFixHoofById(Integer id) { + return scFixHoofMapper.deleteScFixHoofById(id); + } + + + /** + * 根据管理耳号查询 + */ + @Override + public Long findIdByManageTags(String manageTags) { + if (StringUtils.isBlank(manageTags)) + throw new ServiceException("管理耳号不能为空"); + BasSheep sheep = basSheepMapper.selectBasSheepByManageTags(manageTags.trim()); + if (sheep == null) + throw new ServiceException("管理耳号不存在:" + manageTags); + return sheep.getId(); + } + + +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/stock/controller/WzMaterialsManagementController.java b/zhyc-module/src/main/java/com/zhyc/module/stock/controller/WzMaterialsManagementController.java new file mode 100644 index 0000000..e1b567e --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/stock/controller/WzMaterialsManagementController.java @@ -0,0 +1,116 @@ +package com.zhyc.module.stock.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.zhyc.common.annotation.Log; +import com.zhyc.common.core.controller.BaseController; +import com.zhyc.common.core.domain.AjaxResult; +import com.zhyc.common.enums.BusinessType; +import com.zhyc.module.stock.domain.WzMaterialsManagement; +import com.zhyc.module.stock.service.IWzMaterialsManagementService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; +import org.springframework.web.multipart.MultipartFile; + +/** + * 物资管理Controller + * + * @author HashMap + * @date 2025-08-05 + */ +@RestController +@RequestMapping("/stock/management") +public class WzMaterialsManagementController extends BaseController { + private final IWzMaterialsManagementService wzMaterialsManagementService; + + public WzMaterialsManagementController(IWzMaterialsManagementService wzMaterialsManagementService) { + this.wzMaterialsManagementService = wzMaterialsManagementService; + } + + /** + * 查询物资管理列表 + */ + @PreAuthorize("@ss.hasPermi('stock:management:list')") + @GetMapping("/list") + public TableDataInfo list(WzMaterialsManagement wzMaterialsManagement) { + startPage(); + List list = wzMaterialsManagementService.selectWzMaterialsManagementList(wzMaterialsManagement); + return getDataTable(list); + } + + /** + * 导出物资管理列表 + */ + @PreAuthorize("@ss.hasPermi('stock:management:export')") + @Log(title = "物资管理", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, WzMaterialsManagement wzMaterialsManagement) { + List list = wzMaterialsManagementService.selectWzMaterialsManagementList(wzMaterialsManagement); + ExcelUtil util = new ExcelUtil<>(WzMaterialsManagement.class); + util.exportExcel(response, list, "物资管理数据"); + } + + /** + * 获取物资管理详细信息 + */ + @PreAuthorize("@ss.hasPermi('stock:management:query')") + @GetMapping(value = "/{materialManagementCode}") + public AjaxResult getInfo(@PathVariable("materialManagementCode") Long materialManagementCode) { + return success(wzMaterialsManagementService.selectWzMaterialsManagementByMaterialManagementCode(materialManagementCode)); + } + + /** + * 新增物资管理 + */ + @PreAuthorize("@ss.hasPermi('stock:management:add')") + @Log(title = "物资管理", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody WzMaterialsManagement wzMaterialsManagement) { + return toAjax(wzMaterialsManagementService.insertWzMaterialsManagement(wzMaterialsManagement)); + } + + /** + * 修改物资管理 + */ + @PreAuthorize("@ss.hasPermi('stock:management:edit')") + @Log(title = "物资管理", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody WzMaterialsManagement wzMaterialsManagement) { + return toAjax(wzMaterialsManagementService.updateWzMaterialsManagement(wzMaterialsManagement)); + } + + /** + * 删除物资管理 + */ + @PreAuthorize("@ss.hasPermi('stock:management:remove')") + @Log(title = "物资管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{materialManagementCodes}") + public AjaxResult remove(@PathVariable Long[] materialManagementCodes) { + return toAjax(wzMaterialsManagementService.deleteWzMaterialsManagementByMaterialManagementCodes(materialManagementCodes)); + } + + @Log(title = "物资管理", businessType = BusinessType.IMPORT) + @PreAuthorize("@ss.hasPermi('stock:management:import')") + @PostMapping("/importData") + public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception { + ExcelUtil util = new ExcelUtil<>(WzMaterialsManagement.class); + List stockInList = util.importExcel(file.getInputStream()); + for (WzMaterialsManagement wzMaterialsManagement : stockInList) { + System.out.println(wzMaterialsManagement); + } + String operName = getUsername(); + String message = wzMaterialsManagementService.importUser(stockInList, updateSupport, operName); + // String message = "OK We are testing"; + return success(message); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/stock/controller/WzStockInController.java b/zhyc-module/src/main/java/com/zhyc/module/stock/controller/WzStockInController.java new file mode 100644 index 0000000..6705202 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/stock/controller/WzStockInController.java @@ -0,0 +1,122 @@ +package com.zhyc.module.stock.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.zhyc.common.annotation.Log; +import com.zhyc.common.core.controller.BaseController; +import com.zhyc.common.core.domain.AjaxResult; +import com.zhyc.common.enums.BusinessType; +import com.zhyc.module.stock.domain.WzStockIn; +import com.zhyc.module.stock.service.IWzStockInService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; +import org.springframework.web.multipart.MultipartFile; + +/** + * 入库记录Controller + * + * @author HashMap + * @date 2025-08-05 + */ +@RestController +@RequestMapping("/stock/in") +public class WzStockInController extends BaseController +{ + private final IWzStockInService wzStockInService; + + public WzStockInController(IWzStockInService wzStockInService) { + this.wzStockInService = wzStockInService; + } + + /** + * 查询入库记录列表 + */ + @PreAuthorize("@ss.hasPermi('stock:in:list')") + @GetMapping("/list") + public TableDataInfo list(WzStockIn wzStockIn) + { + startPage(); + List list = wzStockInService.selectWzStockInList(wzStockIn); + return getDataTable(list); + } + + /** + * 导出入库记录列表 + */ + @PreAuthorize("@ss.hasPermi('stock:in:export')") + @Log(title = "入库记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, WzStockIn wzStockIn) + { + List list = wzStockInService.selectWzStockInList(wzStockIn); + ExcelUtil util = new ExcelUtil<>(WzStockIn.class); + util.exportExcel(response, list, "入库记录数据"); + } + + /** + * 获取入库记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('stock:in:query')") + @GetMapping(value = "/{stockInCode}") + public AjaxResult getInfo(@PathVariable("stockInCode") Long stockInCode) + { + return success(wzStockInService.selectWzStockInByStockInCode(stockInCode)); + } + + /** + * 新增入库记录 + */ + @PreAuthorize("@ss.hasPermi('stock:in:add')") + @Log(title = "入库记录", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody WzStockIn wzStockIn) + { + return toAjax(wzStockInService.insertWzStockIn(wzStockIn)); + } + + /** + * 修改入库记录 + */ + @PreAuthorize("@ss.hasPermi('stock:in:edit')") + @Log(title = "入库记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody WzStockIn wzStockIn) + { + return toAjax(wzStockInService.updateWzStockIn(wzStockIn)); + } + + /** + * 删除入库记录 + */ + @PreAuthorize("@ss.hasPermi('stock:in:remove')") + @Log(title = "入库记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{stockInCodes}") + public AjaxResult remove(@PathVariable Long[] stockInCodes) + { + return toAjax(wzStockInService.deleteWzStockInByStockInCodes(stockInCodes)); + } + + @Log(title = "用户管理", businessType = BusinessType.IMPORT) + @PreAuthorize("@ss.hasPermi('stock:in:import')") + @PostMapping("/importData") + public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception + { + ExcelUtil util = new ExcelUtil<>(WzStockIn.class); + List stockInList = util.importExcel(file.getInputStream()); + stockInList.removeIf(wzStockIn -> wzStockIn.getDocDate() == null); + String operName = getUsername(); + String message = wzStockInService.importUser(stockInList, updateSupport, operName); +// String message = "OK We are testing"; + return success(message); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/stock/controller/WzStockOutController.java b/zhyc-module/src/main/java/com/zhyc/module/stock/controller/WzStockOutController.java new file mode 100644 index 0000000..cb80a44 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/stock/controller/WzStockOutController.java @@ -0,0 +1,130 @@ +package com.zhyc.module.stock.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.zhyc.common.annotation.Log; +import com.zhyc.common.core.controller.BaseController; +import com.zhyc.common.core.domain.AjaxResult; +import com.zhyc.common.enums.BusinessType; +import com.zhyc.module.stock.domain.WzStockOut; +import com.zhyc.module.stock.service.IWzStockOutService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; +import org.springframework.web.multipart.MultipartFile; + +/** + * 出库记录Controller + * + * @author HashMap + * @date 2025-08-05 + */ +@RestController +@RequestMapping("/stock/out") +public class WzStockOutController extends BaseController +{ + private final IWzStockOutService wzStockOutService; + + public WzStockOutController(IWzStockOutService wzStockOutService) { + this.wzStockOutService = wzStockOutService; + } + + /** + * 查询出库记录列表 + */ + @PreAuthorize("@ss.hasPermi('stock:out:list')") + @GetMapping("/list") + public TableDataInfo list(WzStockOut wzStockOut) + { + startPage(); + List list = wzStockOutService.selectWzStockOutList(wzStockOut); + return getDataTable(list); + } + + /** + * 导出出库记录列表 + */ + @PreAuthorize("@ss.hasPermi('stock:out:export')") + @Log(title = "出库记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, WzStockOut wzStockOut) + { + List list = wzStockOutService.selectWzStockOutList(wzStockOut); + ExcelUtil util = new ExcelUtil<>(WzStockOut.class); + util.exportExcel(response, list, "出库记录数据"); + } + + /** + * 获取出库记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('stock:out:query')") + @GetMapping(value = "/{stockOutCode}") + public AjaxResult getInfo(@PathVariable("stockOutCode") Long stockOutCode) + { + return success(wzStockOutService.selectWzStockOutByStockOutCode(stockOutCode)); + } + + /** + * 新增出库记录 + */ + @PreAuthorize("@ss.hasPermi('stock:out:add')") + @Log(title = "出库记录", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody WzStockOut wzStockOut) + { + return toAjax(wzStockOutService.insertWzStockOut(wzStockOut)); + } + + /** + * 修改出库记录 + */ + @PreAuthorize("@ss.hasPermi('stock:out:edit')") + @Log(title = "出库记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody WzStockOut wzStockOut) + { + return toAjax(wzStockOutService.updateWzStockOut(wzStockOut)); + } + + /** + * 删除出库记录 + */ + @PreAuthorize("@ss.hasPermi('stock:out:remove')") + @Log(title = "出库记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{stockOutCodes}") + public AjaxResult remove(@PathVariable Long[] stockOutCodes) + { + return toAjax(wzStockOutService.deleteWzStockOutByStockOutCodes(stockOutCodes)); + } + + /** + * 导入出库记录 + */ + @Log(title = "出库记录", businessType = BusinessType.IMPORT) + @PreAuthorize("@ss.hasPermi('stock:out:import')") + @PostMapping("/importData") + public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception + { + ExcelUtil util = new ExcelUtil<>(WzStockOut.class); + List WzStockOutList = util.importExcel(file.getInputStream()); + WzStockOutList.removeIf(wzStockOut -> wzStockOut.getDocId() == null); + String operName = getUsername(); + String message; + try { + message = wzStockOutService.importUser(WzStockOutList, updateSupport, operName); + }catch (Exception e) { + message = e.getMessage(); + logger.error(e.getMessage()); + } + // String message = "OK We are testing"; + return success(message); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/stock/domain/WzMaterialsManagement.java b/zhyc-module/src/main/java/com/zhyc/module/stock/domain/WzMaterialsManagement.java new file mode 100644 index 0000000..88d3a53 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/stock/domain/WzMaterialsManagement.java @@ -0,0 +1,87 @@ +package com.zhyc.module.stock.domain; + +import java.math.BigDecimal; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 物资管理对象 wz_materials_management + * + * @author HashMap + * @date 2025-08-05 + */ +@Setter +@Getter +public class WzMaterialsManagement extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 序号 */ + @Excel(name = "序号") + private Long materialManagementCode; + + /** 存货编码 */ + @Excel(name = "存货编码") + private String materialId; + + /** 存货 */ + @Excel(name = "存货") + private String materialName; + + /** 批号 */ + @Excel(name = "批号") + private String batchId; + + /** 规格型号 */ + @Excel(name = "规格型号") + private String materialSpecification; + + /** 主计量 */ + @Excel(name = "主计量") + private String materialUnit; + + /** 现存量(主) */ + @Excel(name = "现存量(主)") + private BigDecimal currentStock; + + /** 库存预警 */ + @Excel(name = "库存预警") + private String stockAlarm; + + /** 生产日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date productionDate; + + /** 失效日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "失效日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date expirationDate; + + /** 失效预警 */ + @Excel(name = "失效预警") + private String expirationAlarm; + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("materialManagementCode", getMaterialManagementCode()) + .append("materialId", getMaterialId()) + .append("materialName", getMaterialName()) + .append("batchId", getBatchId()) + .append("materialSpecification", getMaterialSpecification()) + .append("materialUnit", getMaterialUnit()) + .append("currentStock", getCurrentStock()) + .append("stockAlarm", getStockAlarm()) + .append("productionDate", getProductionDate()) + .append("expirationDate", getExpirationDate()) + .append("expirationAlarm", getExpirationAlarm()) + .toString(); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/stock/domain/WzStockIn.java b/zhyc-module/src/main/java/com/zhyc/module/stock/domain/WzStockIn.java new file mode 100644 index 0000000..cda8b08 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/stock/domain/WzStockIn.java @@ -0,0 +1,142 @@ +package com.zhyc.module.stock.domain; + +import java.math.BigDecimal; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 入库记录对象 wz_stock_in + * + * @author HashMap + * @date 2025-08-05 + */ +@Setter +@Getter +public class WzStockIn extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 序号 */ + private Long stockInCode; + + /** 单据日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "单据日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date docDate; + + /** 创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date createDate; + + /** 单据编号 */ + @Excel(name = "单据编号") + private String docId; + + /** 业务类型 */ + @Excel(name = "业务类型") + private String businessType; + + /** 仓库编码 */ + @Excel(name = "仓库编码") + private String repositoryId; + + /** 仓库 */ + @Excel(name = "仓库") + private String repositoryName; + + /** 入库类别 */ + @Excel(name = "入库类别") + private String stockInType; + + /** 供应商编码 */ + @Excel(name = "供应商编码") + private String supplierId; + + /** 供应商 */ + @Excel(name = "供应商") + private String supplierName; + + /** 部门编码 */ + @Excel(name = "部门编码") + private String departmentId; + + /** 部门 */ + @Excel(name = "部门") + private String departmentName; + + /** 经手人编码 */ + @Excel(name = "经手人编码") + private String operatorId; + + /** 经手人 */ + @Excel(name = "经手人") + private String operatorName; + + /** 制单人 */ + @Excel(name = "制单人") + private String single; + + /** 审核人 */ + @Excel(name = "审核人") + private String reviewer; + + /** 存货编码 */ + @Excel(name = "存货编码") + private String materialId; + + /** 存货 */ + @Excel(name = "存货") + private String materialName; + + /** 规格型号 */ + @Excel(name = "规格型号") + private String materialSpecification; + + /** 计量单位 */ + @Excel(name = "计量单位") + private String materialUnit; + + /** 实收数量 */ + @Excel(name = "实收数量") + private BigDecimal count; + + /** 入库调整 */ + @Excel(name = "入库调整") + private String stockInAdjustRemark; + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("stockInCode", getStockInCode()) + .append("docDate", getDocDate()) + .append("createDate", getCreateDate()) + .append("docId", getDocId()) + .append("businessType", getBusinessType()) + .append("repositoryId", getRepositoryId()) + .append("repositoryName", getRepositoryName()) + .append("stockInType", getStockInType()) + .append("supplierId", getSupplierId()) + .append("supplierName", getSupplierName()) + .append("departmentId", getDepartmentId()) + .append("departmentName", getDepartmentName()) + .append("operatorId", getOperatorId()) + .append("operatorName", getOperatorName()) + .append("remark", getRemark()) + .append("single", getSingle()) + .append("reviewer", getReviewer()) + .append("materialId", getMaterialId()) + .append("materialName", getMaterialName()) + .append("materialSpecification", getMaterialSpecification()) + .append("materialUnit", getMaterialUnit()) + .append("count", getCount()) + .append("stockInAdjustRemark", getStockInAdjustRemark()) + .toString(); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/stock/domain/WzStockOut.java b/zhyc-module/src/main/java/com/zhyc/module/stock/domain/WzStockOut.java new file mode 100644 index 0000000..c0a84a9 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/stock/domain/WzStockOut.java @@ -0,0 +1,251 @@ +package com.zhyc.module.stock.domain; + +import java.math.BigDecimal; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 出库记录对象 wz_stock_out + * + * @author HashMap + * @date 2025-08-05 + */ +@Getter +@Setter +public class WzStockOut extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 序号 + */ + private Long stockOutCode; + + /** + * 单据日期 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "单据日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date docDate; + + /** + * 创建时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date createDate; + + /** + * 单据编号 + */ + @Excel(name = "单据编号") + private String docId; + + /** + * 业务类型 + */ + @Excel(name = "业务类型") + private String businessType; + + /** + * 仓库编码 + */ + @Excel(name = "仓库编码") + private String repositoryId; + + /** + * 仓库名称 + */ + @Excel(name = "仓库") + private String repositoryName; + + /** + * 项目分类 + */ + @Excel(name = "项目分类") + private String projectClassification; + + /** + * 项目编码 + */ + @Excel(name = "项目编码") + private String projectId; + + /** + * 项目 + */ + @Excel(name = "项目") + private String projectName; + + /** + * 生产车间编码 + */ + @Excel(name = "生产车间编码") + private String departmentId; + + /** + * 生产车间 + */ + @Excel(name = "生产车间") + private String departmentName; + + /** + * 领用人编码 + */ + @Excel(name = "领用人编码") + private String receiverId; + + /** + * 领用人 + */ + @Excel(name = "领用人") + private String receiver; + + /** + * 制单人 + */ + @Excel(name = "制单人") + private String single; + + /** + * 审核人 + */ + @Excel(name = "审核人") + private String reviewer; + + /** + * 审核时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "审核时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date reviewDate; + + /** + * 修改人 + */ + @Excel(name = "修改人") + private String modifier; + + /** + * 材料分类编码 + */ + @Excel(name = "材料分类编码") + private String materialClassId; + + /** + * 材料分类 + */ + @Excel(name = "材料分类") + private String materialClassName; + + /** + * 材料编码 + */ + @Excel(name = "材料编码") + private String materialId; + + /** + * 材料名称 + */ + @Excel(name = "材料名称") + private String materialName; + + /** + * 材料规格 + */ + @Excel(name = "材料规格") + private String materialSpecification; + + /** + * 计量单位 + */ + @Excel(name = "计量单位") + private String materialUnit; + + /** + * 数量 + */ + @Excel(name = "数量") + private BigDecimal count; + + /** + * 批号 + */ + @Excel(name = "批号") + private Long batchId; + + /** + * 生产日期 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date productionDate; + + /** + * 保质期 + */ + @Excel(name = "保质期") + private Long shelfLife; + + /** + * 保质期单位 + */ + @Excel(name = "保质期单位") + private String shelfLifeUnit; + + /** + * 失效日期 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "失效日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date expirationDate; + + /** + * 代理人 + */ + @Excel(name = "代理人") + private String agent; + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("stockOutCode", getStockOutCode()) + .append("docDate", getDocDate()) + .append("createDate", getCreateDate()) + .append("docId", getDocId()) + .append("businessType", getBusinessType()) + .append("repositoryId", getRepositoryId()) + .append("repositoryName", getRepositoryName()) + .append("projectClassification", getProjectClassification()) + .append("projectId", getProjectId()) + .append("projectName", getProjectName()) + .append("departmentId", getDepartmentId()) + .append("departmentName", getDepartmentName()) + .append("receiverId", getReceiverId()) + .append("receiver", getReceiver()) + .append("single", getSingle()) + .append("reviewer", getReviewer()) + .append("reviewDate", getReviewDate()) + .append("modifier", getModifier()) + .append("materialClassId", getMaterialClassId()) + .append("materialClassName", getMaterialClassName()) + .append("materialId", getMaterialId()) + .append("materialName", getMaterialName()) + .append("materialSpecification", getMaterialSpecification()) + .append("materialUnit", getMaterialUnit()) + .append("count", getCount()) + .append("batchId", getBatchId()) + .append("productionDate", getProductionDate()) + .append("shelfLife", getShelfLife()) + .append("shelfLifeUnit", getShelfLifeUnit()) + .append("expirationDate", getExpirationDate()) + .append("agent", getAgent()) + .toString(); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/stock/mapper/WzMaterialsManagementMapper.java b/zhyc-module/src/main/java/com/zhyc/module/stock/mapper/WzMaterialsManagementMapper.java new file mode 100644 index 0000000..a1c75a9 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/stock/mapper/WzMaterialsManagementMapper.java @@ -0,0 +1,71 @@ +package com.zhyc.module.stock.mapper; + +import java.util.List; +import com.zhyc.module.stock.domain.WzMaterialsManagement; +import org.apache.ibatis.annotations.Mapper; + +/** + * 物资管理Mapper接口 + * + * @author HashMap + * @date 2025-08-05 + */ +@Mapper +public interface WzMaterialsManagementMapper +{ + /** + * 查询物资管理 + * + * @param materialManagementCode 物资管理主键 + * @return 物资管理 + */ + WzMaterialsManagement selectWzMaterialsManagementByMaterialManagementCode(Long materialManagementCode); + + /** + * 查询物资管理列表 + * + * @param wzMaterialsManagement 物资管理 + * @return 物资管理集合 + */ + List selectWzMaterialsManagementList(WzMaterialsManagement wzMaterialsManagement); + + /** + * 新增物资管理 + * + * @param wzMaterialsManagement 物资管理 + * @return 结果 + */ + int insertWzMaterialsManagement(WzMaterialsManagement wzMaterialsManagement); + + /** + * 修改物资管理 + * + * @param wzMaterialsManagement 物资管理 + * @return 结果 + */ + int updateWzMaterialsManagement(WzMaterialsManagement wzMaterialsManagement); + + /** + * 删除物资管理 + * + * @param materialManagementCode 物资管理主键 + * @return 结果 + */ + int deleteWzMaterialsManagementByMaterialManagementCode(Long materialManagementCode); + + /** + * 批量删除物资管理 + * + * @param materialManagementCodes 需要删除的数据主键集合 + * @return 结果 + */ + int deleteWzMaterialsManagementByMaterialManagementCodes(Long[] materialManagementCodes); + + /** + * 以物资编码获取记录 + * + * @param materialID 物资编码 + * @return 结果 + */ + WzMaterialsManagement selectWzMaterialsManagementByMaterialID(String materialID); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/stock/mapper/WzStockInMapper.java b/zhyc-module/src/main/java/com/zhyc/module/stock/mapper/WzStockInMapper.java new file mode 100644 index 0000000..ed2fda8 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/stock/mapper/WzStockInMapper.java @@ -0,0 +1,70 @@ +package com.zhyc.module.stock.mapper; + +import java.util.List; +import com.zhyc.module.stock.domain.WzStockIn; +import org.apache.ibatis.annotations.Mapper; + +/** + * 入库记录Mapper接口 + * + * @author HashMap + * @date 2025-08-05 + */ +@Mapper +public interface WzStockInMapper +{ + /** + * 查询入库记录 + * + * @param stockInCode 入库记录主键 + * @return 入库记录 + */ + WzStockIn selectWzStockInByStockInCode(Long stockInCode); + + /** + * 查询入库记录列表 + * + * @param wzStockIn 入库记录 + * @return 入库记录集合 + */ + List selectWzStockInList(WzStockIn wzStockIn); + + /** + * 新增入库记录 + * + * @param wzStockIn 入库记录 + * @return 结果 + */ + int insertWzStockIn(WzStockIn wzStockIn); + + /** + * 修改入库记录 + * + * @param wzStockIn 入库记录 + * @return 结果 + */ + int updateWzStockIn(WzStockIn wzStockIn); + + /** + * 删除入库记录 + * + * @param stockInCode 入库记录主键 + * @return 结果 + */ + int deleteWzStockInByStockInCode(Long stockInCode); + + /** + * 批量删除入库记录 + * + * @param stockInCodes 需要删除的数据主键集合 + * @return 结果 + */ + int deleteWzStockInByStockInCodes(Long[] stockInCodes); + + /** + * 查询最近的入库记录 + * + * @return 数据库中最近的入库记录 + */ + WzStockIn getEarliestStockIn(); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/stock/mapper/WzStockOutMapper.java b/zhyc-module/src/main/java/com/zhyc/module/stock/mapper/WzStockOutMapper.java new file mode 100644 index 0000000..a9ae9ce --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/stock/mapper/WzStockOutMapper.java @@ -0,0 +1,70 @@ +package com.zhyc.module.stock.mapper; + +import java.util.List; +import com.zhyc.module.stock.domain.WzStockOut; +import org.apache.ibatis.annotations.Mapper; + +/** + * 出库记录Mapper接口 + * + * @author HashMap + * @date 2025-08-05 + */ +@Mapper +public interface WzStockOutMapper +{ + /** + * 查询出库记录 + * + * @param stockOutCode 出库记录主键 + * @return 出库记录 + */ + WzStockOut selectWzStockOutByStockOutCode(Long stockOutCode); + + /** + * 查询出库记录列表 + * + * @param wzStockOut 出库记录 + * @return 出库记录集合 + */ + List selectWzStockOutList(WzStockOut wzStockOut); + + /** + * 新增出库记录 + * + * @param wzStockOut 出库记录 + * @return 结果 + */ + int insertWzStockOut(WzStockOut wzStockOut); + + /** + * 修改出库记录 + * + * @param wzStockOut 出库记录 + * @return 结果 + */ + int updateWzStockOut(WzStockOut wzStockOut); + + /** + * 删除出库记录 + * + * @param stockOutCode 出库记录主键 + * @return 结果 + */ + int deleteWzStockOutByStockOutCode(Long stockOutCode); + + /** + * 批量删除出库记录 + * + * @param stockOutCodes 需要删除的数据主键集合 + * @return 结果 + */ + int deleteWzStockOutByStockOutCodes(Long[] stockOutCodes); + + /** + * 查询最近的记录 + * + * @return 结果 + */ + WzStockOut getEarliestStockOut(); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/stock/service/IWzMaterialsManagementService.java b/zhyc-module/src/main/java/com/zhyc/module/stock/service/IWzMaterialsManagementService.java new file mode 100644 index 0000000..46e71dc --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/stock/service/IWzMaterialsManagementService.java @@ -0,0 +1,71 @@ +package com.zhyc.module.stock.service; + +import java.util.List; +import com.zhyc.module.stock.domain.WzMaterialsManagement; + +/** + * 物资管理Service接口 + * + * @author HashMap + * @date 2025-08-05 + */ +public interface IWzMaterialsManagementService +{ + /** + * 查询物资管理 + * + * @param materialManagementCode 物资管理主键 + * @return 物资管理 + */ + WzMaterialsManagement selectWzMaterialsManagementByMaterialManagementCode(Long materialManagementCode); + + /** + * 查询物资管理列表 + * + * @param wzMaterialsManagement 物资管理 + * @return 物资管理集合 + */ + List selectWzMaterialsManagementList(WzMaterialsManagement wzMaterialsManagement); + + /** + * 新增物资管理 + * + * @param wzMaterialsManagement 物资管理 + * @return 结果 + */ + int insertWzMaterialsManagement(WzMaterialsManagement wzMaterialsManagement); + + /** + * 修改物资管理 + * + * @param wzMaterialsManagement 物资管理 + * @return 结果 + */ + int updateWzMaterialsManagement(WzMaterialsManagement wzMaterialsManagement); + + /** + * 批量删除物资管理 + * + * @param materialManagementCodes 需要删除的物资管理主键集合 + * @return 结果 + */ + int deleteWzMaterialsManagementByMaterialManagementCodes(Long[] materialManagementCodes); + + /** + * 删除物资管理信息 + * + * @param materialManagementCode 物资管理主键 + * @return 结果 + */ + int deleteWzMaterialsManagementByMaterialManagementCode(Long materialManagementCode); + + /** + * 导入入库数据 + * + * @param MaterialsManagementList 物资数据列表 + * @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据 + * @param operName 操作用户 + * @return 结果 + */ + String importUser(List MaterialsManagementList, Boolean isUpdateSupport, String operName); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/stock/service/IWzStockInService.java b/zhyc-module/src/main/java/com/zhyc/module/stock/service/IWzStockInService.java new file mode 100644 index 0000000..8d986a0 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/stock/service/IWzStockInService.java @@ -0,0 +1,72 @@ +package com.zhyc.module.stock.service; + +import java.util.List; + +import com.zhyc.module.stock.domain.WzStockIn; + +/** + * 入库记录Service接口 + * + * @author HashMap + * @date 2025-08-05 + */ +public interface IWzStockInService +{ + /** + * 查询入库记录 + * + * @param stockInCode 入库记录主键 + * @return 入库记录 + */ + WzStockIn selectWzStockInByStockInCode(Long stockInCode); + + /** + * 查询入库记录列表 + * + * @param wzStockIn 入库记录 + * @return 入库记录集合 + */ + List selectWzStockInList(WzStockIn wzStockIn); + + /** + * 新增入库记录 + * + * @param wzStockIn 入库记录 + * @return 结果 + */ + int insertWzStockIn(WzStockIn wzStockIn); + + /** + * 修改入库记录 + * + * @param wzStockIn 入库记录 + * @return 结果 + */ + int updateWzStockIn(WzStockIn wzStockIn); + + /** + * 批量删除入库记录 + * + * @param stockInCodes 需要删除的入库记录主键集合 + * @return 结果 + */ + int deleteWzStockInByStockInCodes(Long[] stockInCodes); + + /** + * 删除入库记录信息 + * + * @param stockInCode 入库记录主键 + * @return 结果 + */ + int deleteWzStockInByStockInCode(Long stockInCode); + + /** + * 导入入库数据 + * + * @param StockInList 入库数据列表 + * @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据 + * @param operName 操作用户 + * @return 结果 + */ + String importUser(List StockInList, Boolean isUpdateSupport, String operName); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/stock/service/IWzStockOutService.java b/zhyc-module/src/main/java/com/zhyc/module/stock/service/IWzStockOutService.java new file mode 100644 index 0000000..6e4c75b --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/stock/service/IWzStockOutService.java @@ -0,0 +1,72 @@ +package com.zhyc.module.stock.service; + +import java.util.List; + +import com.zhyc.module.stock.domain.WzStockOut; + +/** + * 出库记录Service接口 + * + * @author HashMap + * @date 2025-08-05 + */ +public interface IWzStockOutService +{ + /** + * 查询出库记录 + * + * @param stockOutCode 出库记录主键 + * @return 出库记录 + */ + WzStockOut selectWzStockOutByStockOutCode(Long stockOutCode); + + /** + * 查询出库记录列表 + * + * @param wzStockOut 出库记录 + * @return 出库记录集合 + */ + List selectWzStockOutList(WzStockOut wzStockOut); + + /** + * 新增出库记录 + * + * @param wzStockOut 出库记录 + * @return 结果 + */ + int insertWzStockOut(WzStockOut wzStockOut); + + /** + * 修改出库记录 + * + * @param wzStockOut 出库记录 + * @return 结果 + */ + int updateWzStockOut(WzStockOut wzStockOut); + + /** + * 批量删除出库记录 + * + * @param stockOutCodes 需要删除的出库记录主键集合 + * @return 结果 + */ + int deleteWzStockOutByStockOutCodes(Long[] stockOutCodes); + + /** + * 删除出库记录信息 + * + * @param stockOutCode 出库记录主键 + * @return 结果 + */ + int deleteWzStockOutByStockOutCode(Long stockOutCode); + + /** + * 导入入库数据 + * + * @param WzStockOutList 入库数据列表 + * @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据 + * @param operName 操作用户 + * @return 结果 + */ + String importUser(List WzStockOutList, Boolean isUpdateSupport, String operName) throws Exception; +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/stock/service/impl/WzMaterialsManagementServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/stock/service/impl/WzMaterialsManagementServiceImpl.java new file mode 100644 index 0000000..ab6d272 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/stock/service/impl/WzMaterialsManagementServiceImpl.java @@ -0,0 +1,132 @@ +package com.zhyc.module.stock.service.impl; + +import java.util.List; + +import com.zhyc.common.exception.ServiceException; +import com.zhyc.common.utils.StringUtils; +import org.springframework.stereotype.Service; +import com.zhyc.module.stock.mapper.WzMaterialsManagementMapper; +import com.zhyc.module.stock.domain.WzMaterialsManagement; +import com.zhyc.module.stock.service.IWzMaterialsManagementService; +import org.springframework.transaction.annotation.Transactional; + +/** + * 物资管理Service业务层处理 + * + * @author HashMap + * @date 2025-08-05 + */ +@Service +public class WzMaterialsManagementServiceImpl implements IWzMaterialsManagementService { + private final WzMaterialsManagementMapper wzMaterialsManagementMapper; + + public WzMaterialsManagementServiceImpl(WzMaterialsManagementMapper wzMaterialsManagementMapper) { + this.wzMaterialsManagementMapper = wzMaterialsManagementMapper; + } + + /** + * 查询物资管理 + * + * @param materialManagementCode 物资管理主键 + * @return 物资管理 + */ + @Override + public WzMaterialsManagement selectWzMaterialsManagementByMaterialManagementCode(Long materialManagementCode) { + return wzMaterialsManagementMapper.selectWzMaterialsManagementByMaterialManagementCode(materialManagementCode); + } + + /** + * 查询物资管理列表 + * + * @param wzMaterialsManagement 物资管理 + * @return 物资管理 + */ + @Override + public List selectWzMaterialsManagementList(WzMaterialsManagement wzMaterialsManagement) { + return wzMaterialsManagementMapper.selectWzMaterialsManagementList(wzMaterialsManagement); + } + + /** + * 新增物资管理 + * + * @param wzMaterialsManagement 物资管理 + * @return 结果 + */ + @Override + public int insertWzMaterialsManagement(WzMaterialsManagement wzMaterialsManagement) { + return wzMaterialsManagementMapper.insertWzMaterialsManagement(wzMaterialsManagement); + } + + /** + * 修改物资管理 + * + * @param wzMaterialsManagement 物资管理 + * @return 结果 + */ + @Override + public int updateWzMaterialsManagement(WzMaterialsManagement wzMaterialsManagement) { + return wzMaterialsManagementMapper.updateWzMaterialsManagement(wzMaterialsManagement); + } + + /** + * 批量删除物资管理 + * + * @param materialManagementCodes 需要删除的物资管理主键 + * @return 结果 + */ + @Override + public int deleteWzMaterialsManagementByMaterialManagementCodes(Long[] materialManagementCodes) { + return wzMaterialsManagementMapper.deleteWzMaterialsManagementByMaterialManagementCodes(materialManagementCodes); + } + + /** + * 删除物资管理信息 + * + * @param materialManagementCode 物资管理主键 + * @return 结果 + */ + @Override + public int deleteWzMaterialsManagementByMaterialManagementCode(Long materialManagementCode) { + return wzMaterialsManagementMapper.deleteWzMaterialsManagementByMaterialManagementCode(materialManagementCode); + } + + /** + * 导入用户数据 + * + * @param MaterialsManagementList 物资数据列表 + * @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据 + * @param operName 操作用户 + * @return 结果 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public String importUser(List MaterialsManagementList, Boolean isUpdateSupport, String operName) { + if (StringUtils.isNull(MaterialsManagementList) || MaterialsManagementList.isEmpty()) { + throw new ServiceException("导入用户数据不能为空!"); + } + int successNum = 0; + int sameNum = 0; + StringBuilder successMsg = new StringBuilder(); + StringBuilder failureMsg = new StringBuilder(); + try { + for (WzMaterialsManagement wzMaterialsManagement : MaterialsManagementList) { + if (wzMaterialsManagement.getMaterialId() != null) { + WzMaterialsManagement isExist = wzMaterialsManagementMapper.selectWzMaterialsManagementByMaterialID(wzMaterialsManagement.getMaterialId()); + // 存在则更新 + if (isExist != null) { + sameNum++; + wzMaterialsManagementMapper.updateWzMaterialsManagement(wzMaterialsManagement); + continue; + } + } + int result = wzMaterialsManagementMapper.insertWzMaterialsManagement(wzMaterialsManagement); + if (result > 0) successNum++; + } + } catch (Exception e) { + return failureMsg.append("导入出错:").append(e.getMessage()).toString(); + } + successMsg.append("导入完成 : 导入 ").append(successNum).append(" 条\n更新 ").append(sameNum).append(" 条(已存在记录)"); + return successMsg.toString(); + } + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/stock/service/impl/WzStockInServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/stock/service/impl/WzStockInServiceImpl.java new file mode 100644 index 0000000..7632654 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/stock/service/impl/WzStockInServiceImpl.java @@ -0,0 +1,137 @@ +package com.zhyc.module.stock.service.impl; + +import java.util.List; + +import com.zhyc.common.exception.ServiceException; +import com.zhyc.common.utils.StringUtils; +import org.springframework.stereotype.Service; +import com.zhyc.module.stock.mapper.WzStockInMapper; +import com.zhyc.module.stock.domain.WzStockIn; +import com.zhyc.module.stock.service.IWzStockInService; +import org.springframework.transaction.annotation.Transactional; + +/** + * 入库记录Service业务层处理 + * + * @author HashMap + * @date 2025-08-05 + */ +@Service +public class WzStockInServiceImpl implements IWzStockInService { + private final WzStockInMapper wzStockInMapper; + + public WzStockInServiceImpl(WzStockInMapper wzStockInMapper) { + this.wzStockInMapper = wzStockInMapper; + } + + /** + * 查询入库记录 + * + * @param stockInCode 入库记录主键 + * @return 入库记录 + */ + @Override + public WzStockIn selectWzStockInByStockInCode(Long stockInCode) { + return wzStockInMapper.selectWzStockInByStockInCode(stockInCode); + } + + /** + * 查询入库记录列表 + * + * @param wzStockIn 入库记录 + * @return 入库记录 + */ + @Override + public List selectWzStockInList(WzStockIn wzStockIn) { + return wzStockInMapper.selectWzStockInList(wzStockIn); + } + + /** + * 新增入库记录 + * + * @param wzStockIn 入库记录 + * @return 结果 + */ + @Override + public int insertWzStockIn(WzStockIn wzStockIn) { + return wzStockInMapper.insertWzStockIn(wzStockIn); + } + + /** + * 修改入库记录 + * + * @param wzStockIn 入库记录 + * @return 结果 + */ + @Override + public int updateWzStockIn(WzStockIn wzStockIn) { + return wzStockInMapper.updateWzStockIn(wzStockIn); + } + + /** + * 批量删除入库记录 + * + * @param stockInCodes 需要删除的入库记录主键 + * @return 结果 + */ + @Override + public int deleteWzStockInByStockInCodes(Long[] stockInCodes) { + return wzStockInMapper.deleteWzStockInByStockInCodes(stockInCodes); + } + + /** + * 删除入库记录信息 + * + * @param stockInCode 入库记录主键 + * @return 结果 + */ + @Override + public int deleteWzStockInByStockInCode(Long stockInCode) { + return wzStockInMapper.deleteWzStockInByStockInCode(stockInCode); + } + + /** + * 导入用户数据 + * + * @param StockInList 用户数据列表 + * @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据 + * @param operName 操作用户 + * @return 结果 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public String importUser(List StockInList, Boolean isUpdateSupport, String operName) { + if (StringUtils.isNull(StockInList) || StockInList.isEmpty()) { + throw new ServiceException("导入用户数据不能为空!"); + } + int successNum = 0; + int failureNum = 0; + int sameNum = 0; + StringBuilder successMsg = new StringBuilder(); + StringBuilder failureMsg = new StringBuilder(); + try { + WzStockIn earliestStockIn = wzStockInMapper.getEarliestStockIn(); + System.out.println(earliestStockIn); + for (WzStockIn wzStockIn : StockInList) { + if (earliestStockIn.getDocDate().getTime() >= wzStockIn.getDocDate().getTime()) { + sameNum++; + continue; + } + int result = wzStockInMapper.insertWzStockIn(wzStockIn); + if (result == 0) { + failureNum++; + failureMsg.append("失败的项:").append(wzStockIn.getDocId()).append("\n"); + } + else successNum++; + } + + } catch (Exception e) { + failureNum++; + } + if (failureNum > 0) { + return failureMsg.toString(); + } + successMsg.append("导入完成 : 导入 ").append(successNum).append(" 条\n跳过 ").append(sameNum).append(" 条(重复记录)"); + return successMsg.toString(); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/stock/service/impl/WzStockOutServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/stock/service/impl/WzStockOutServiceImpl.java new file mode 100644 index 0000000..5fb6c36 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/stock/service/impl/WzStockOutServiceImpl.java @@ -0,0 +1,136 @@ +package com.zhyc.module.stock.service.impl; + +import java.util.Date; +import java.util.List; + +import com.zhyc.common.exception.ServiceException; +import com.zhyc.common.utils.StringUtils; +import org.springframework.stereotype.Service; +import com.zhyc.module.stock.mapper.WzStockOutMapper; +import com.zhyc.module.stock.domain.WzStockOut; +import com.zhyc.module.stock.service.IWzStockOutService; +import org.springframework.transaction.annotation.Transactional; + +/** + * 出库记录Service业务层处理 + * + * @author HashMap + * @date 2025-08-05 + */ +@Service +public class WzStockOutServiceImpl implements IWzStockOutService { + private final WzStockOutMapper wzStockOutMapper; + + public WzStockOutServiceImpl(WzStockOutMapper wzStockOutMapper) { + this.wzStockOutMapper = wzStockOutMapper; + } + + /** + * 查询出库记录 + * + * @param stockOutCode 出库记录主键 + * @return 出库记录 + */ + @Override + public WzStockOut selectWzStockOutByStockOutCode(Long stockOutCode) { + return wzStockOutMapper.selectWzStockOutByStockOutCode(stockOutCode); + } + + /** + * 查询出库记录列表 + * + * @param wzStockOut 出库记录 + * @return 出库记录 + */ + @Override + public List selectWzStockOutList(WzStockOut wzStockOut) { + return wzStockOutMapper.selectWzStockOutList(wzStockOut); + } + + /** + * 新增出库记录 + * + * @param wzStockOut 出库记录 + * @return 结果 + */ + @Override + public int insertWzStockOut(WzStockOut wzStockOut) { + return wzStockOutMapper.insertWzStockOut(wzStockOut); + } + + /** + * 修改出库记录 + * + * @param wzStockOut 出库记录 + * @return 结果 + */ + @Override + public int updateWzStockOut(WzStockOut wzStockOut) { + return wzStockOutMapper.updateWzStockOut(wzStockOut); + } + + /** + * 批量删除出库记录 + * + * @param stockOutCodes 需要删除的出库记录主键 + * @return 结果 + */ + @Override + public int deleteWzStockOutByStockOutCodes(Long[] stockOutCodes) { + return wzStockOutMapper.deleteWzStockOutByStockOutCodes(stockOutCodes); + } + + /** + * 删除出库记录信息 + * + * @param stockOutCode 出库记录主键 + * @return 结果 + */ + @Override + public int deleteWzStockOutByStockOutCode(Long stockOutCode) { + return wzStockOutMapper.deleteWzStockOutByStockOutCode(stockOutCode); + } + + /** + * 导入用户数据 + * + * @param WzStockOutList 入库数据列表 + * @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据 + * @param operName 操作用户 + * @return 结果 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public String importUser(List WzStockOutList, Boolean isUpdateSupport, String operName) throws Exception { + if (StringUtils.isNull(WzStockOutList) || WzStockOutList.isEmpty()) { + throw new ServiceException("导入入库数据不能为空!"); + } + int successNum = 0; + int sameNum = 0; + StringBuilder successMsg = new StringBuilder(); + WzStockOut earliestStockOut = wzStockOutMapper.getEarliestStockOut(); + // 确保最近记录有值 + if (null == earliestStockOut || earliestStockOut.getCreateDate() == null) { + if (earliestStockOut != null) { + earliestStockOut.setCreateDate(new Date(0)); + } else { + earliestStockOut = new WzStockOut(); + earliestStockOut.setCreateDate(new Date(0)); + } + } + for (WzStockOut wzStockOut : WzStockOutList) { + if (null != wzStockOut && null != wzStockOut.getCreateDate()) { + if (earliestStockOut.getCreateDate().getTime() >= wzStockOut.getCreateDate().getTime()) { + sameNum++; + continue; + } + } else { + continue; + } + int result = wzStockOutMapper.insertWzStockOut(wzStockOut); + if (result > 0) successNum++; + } + successMsg.append("导入完成 : 导入 ").append(successNum).append(" 条\n跳过 ").append(sameNum).append(" 条(重复记录)"); + return successMsg.toString(); + } +}