diff --git a/pom.xml b/pom.xml index 070d49f..b4f8e0f 100644 --- a/pom.xml +++ b/pom.xml @@ -175,8 +175,6 @@ jjwt ${jwt.version} - - pro.fessional diff --git a/zhyc-module/pom.xml b/zhyc-module/pom.xml index a7beefd..a0b435f 100644 --- a/zhyc-module/pom.xml +++ b/zhyc-module/pom.xml @@ -17,6 +17,10 @@ zhyc zhyc-common + + org.projectlombok + lombok + \ No newline at end of file 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..fef0f3f --- /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") Long 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/domain/SwMedicType.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwMedicType.java new file mode 100644 index 0000000..7bfcc56 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwMedicType.java @@ -0,0 +1,52 @@ +package com.zhyc.module.biosafety.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 药品类型对象 sw_medic_type + * + * @author ruoyi + * @date 2025-07-11 + */ +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..8536c1b --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwMedicine.java @@ -0,0 +1,45 @@ +package com.zhyc.module.biosafety.domain; + +import lombok.Data; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 药品对象 sw_medicine + * + * @author ruoyi + * @date 2025-07-11 + */ + +@Data +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..bc442d0 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwMedicineUsage.java @@ -0,0 +1,86 @@ +package com.zhyc.module.biosafety.domain; + +import java.util.List; +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 + */ +public class SwMedicineUsage extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** id */ + private Long id; + + /** 使用名称 */ + @Excel(name = "使用名称") + private String name; + + /** 使用类型 */ + @Excel(name = "使用类型") + private String useType; + + /** 药品使用记录详情信息 */ + private List swMedicineUsageDetailsList; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + + public void setUseType(String useType) + { + this.useType = useType; + } + + public String getUseType() + { + return useType; + } + + public List getSwMedicineUsageDetailsList() + { + return swMedicineUsageDetailsList; + } + + public void setSwMedicineUsageDetailsList(List swMedicineUsageDetailsList) + { + this.swMedicineUsageDetailsList = swMedicineUsageDetailsList; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("name", getName()) + .append("useType", getUseType()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("swMedicineUsageDetailsList", getSwMedicineUsageDetailsList()) + .toString(); + } +} 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..b3e24c6 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwMedicineUsageDetails.java @@ -0,0 +1,55 @@ +package com.zhyc.module.biosafety.domain; + +import lombok.Data; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 药品使用记录详情对象 sw_medicine_usage_details + * + * @author ruoyi + * @date 2025-07-12 + */ +@Data +public class SwMedicineUsageDetails extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** id */ + private Long id; + + /** 药品使用记录id */ + @Excel(name = "药品使用记录id") + private Long 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..ba52c9e --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwPresDetail.java @@ -0,0 +1,107 @@ +package com.zhyc.module.biosafety.domain; + +import java.math.BigDecimal; +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 + */ +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..9afe41d --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwPrescription.java @@ -0,0 +1,131 @@ +package com.zhyc.module.biosafety.domain; + +import java.util.List; +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 + */ +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..2942b49 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwUnit.java @@ -0,0 +1,29 @@ +package com.zhyc.module.biosafety.domain; + +import lombok.Data; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 药品单位对象 sw_unit + * + * @author ruoyi + * @date 2025-07-11 + */ +@Data +public class SwUnit extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 编号 */ + private Long 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..91c065f --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwUsage.java @@ -0,0 +1,37 @@ +package com.zhyc.module.biosafety.domain; + +import lombok.Data; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 药品使用方法对象 sw_usage + * + * @author ruoyi + * @date 2025-07-11 + */ +@Data +public class SwUsage 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; + } + +} 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..764c735 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/SwMedicTypeMapper.java @@ -0,0 +1,62 @@ +package com.zhyc.module.biosafety.mapper; + +import java.util.List; + +import com.zhyc.module.biosafety.domain.SwMedicType; + +/** + * 药品类型Mapper接口 + * + * @author ruoyi + * @date 2025-07-11 + */ +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..fc44d44 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/SwMedicineMapper.java @@ -0,0 +1,61 @@ +package com.zhyc.module.biosafety.mapper; + +import java.util.List; +import com.zhyc.module.biosafety.domain.SwMedicine; + +/** + * 药品Mapper接口 + * + * @author ruoyi + * @date 2025-07-11 + */ +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..a58cdb8 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/SwMedicineUsageMapper.java @@ -0,0 +1,88 @@ +package com.zhyc.module.biosafety.mapper; + +import java.util.List; + +import com.zhyc.module.biosafety.domain.SwMedicineUsage; +import com.zhyc.module.biosafety.domain.SwMedicineUsageDetails; + +/** + * 药品使用记录Mapper接口 + * + * @author ruoyi + * @date 2025-07-12 + */ +public interface SwMedicineUsageMapper +{ + /** + * 查询药品使用记录 + * + * @param id 药品使用记录主键 + * @return 药品使用记录 + */ + public SwMedicineUsage selectSwMedicineUsageById(Long 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(Long 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(Long 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..ee1c462 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/SwPrescriptionMapper.java @@ -0,0 +1,87 @@ +package com.zhyc.module.biosafety.mapper; + +import java.util.List; +import com.zhyc.module.biosafety.domain.SwPrescription; +import com.zhyc.module.biosafety.domain.SwPresDetail; + +/** + * 处方Mapper接口 + * + * @author ruoyi + * @date 2025-07-11 + */ +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..2d3cf64 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/SwUnitMapper.java @@ -0,0 +1,62 @@ +package com.zhyc.module.biosafety.mapper; + +import com.zhyc.module.biosafety.domain.SwUnit; + +import java.util.List; + +/** + * 药品单位Mapper接口 + * + * @author ruoyi + * @date 2025-07-11 + */ +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..cb0706d --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/SwUsageMapper.java @@ -0,0 +1,61 @@ +package com.zhyc.module.biosafety.mapper; + +import java.util.List; +import com.zhyc.module.biosafety.domain.SwUsage; + +/** + * 药品使用方法Mapper接口 + * + * @author ruoyi + * @date 2025-07-11 + */ +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/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..d10ee3a --- /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(Long 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(Long 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/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..684454e --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/SwMedicineUsageServiceImpl.java @@ -0,0 +1,134 @@ +package com.zhyc.module.biosafety.service.impl; + +import java.util.List; +import com.zhyc.common.utils.DateUtils; +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(Long 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) + { + swMedicineUsage.setCreateTime(DateUtils.getNowDate()); + int rows = swMedicineUsageMapper.insertSwMedicineUsage(swMedicineUsage); + insertSwMedicineUsageDetails(swMedicineUsage); + return rows; + } + + /** + * 修改药品使用记录 + * + * @param swMedicineUsage 药品使用记录 + * @return 结果 + */ + @Transactional + @Override + public int updateSwMedicineUsage(SwMedicineUsage swMedicineUsage) + { + 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(Long id) + { + swMedicineUsageMapper.deleteSwMedicineUsageDetailsByMediUsage(id); + return swMedicineUsageMapper.deleteSwMedicineUsageById(id); + } + + /** + * 新增药品使用记录详情信息 + * + * @param swMedicineUsage 药品使用记录对象 + */ + public void insertSwMedicineUsageDetails(SwMedicineUsage swMedicineUsage) + { + List swMedicineUsageDetailsList = swMedicineUsage.getSwMedicineUsageDetailsList(); + Long 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..62058e8 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/SwPrescriptionServiceImpl.java @@ -0,0 +1,134 @@ +package com.zhyc.module.biosafety.service.impl; + +import java.util.List; +import com.zhyc.common.utils.DateUtils; +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) + { + swPrescription.setCreateTime(DateUtils.getNowDate()); + int rows = swPrescriptionMapper.insertSwPrescription(swPrescription); + insertSwPresDetail(swPrescription); + return rows; + } + + /** + * 修改处方 + * + * @param swPrescription 处方 + * @return 结果 + */ + @Transactional + @Override + public int updateSwPrescription(SwPrescription swPrescription) + { + 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/dryMatterCorrection/controller/XzDryMatterCorrectionController.java b/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/controller/XzDryMatterCorrectionController.java new file mode 100644 index 0000000..fdb90f6 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/controller/XzDryMatterCorrectionController.java @@ -0,0 +1,88 @@ +package com.zhyc.module.dryMatterCorrection.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.dryMatterCorrection.domain.XzDryMatterCorrection; +import com.zhyc.module.dryMatterCorrection.service.IXzDryMatterCorrectionService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +@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) + { + // 只保留年月查询条件,清空其他查询条件 + XzDryMatterCorrection query = new XzDryMatterCorrection(); + query.setDatetime(xzDryMatterCorrection.getDatetime()); + + startPage(); + List list = xzDryMatterCorrectionService.selectXzDryMatterCorrectionList(query); + return getDataTable(list); + } + + @PreAuthorize("@ss.hasPermi('dryMatterCorrection:dryMatterCorrection:export')") + @Log(title = "干物质校正", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, XzDryMatterCorrection xzDryMatterCorrection) + { + // 只保留年月查询条件,清空其他查询条件 + XzDryMatterCorrection query = new XzDryMatterCorrection(); + query.setDatetime(xzDryMatterCorrection.getDatetime()); + + List list = xzDryMatterCorrectionService.selectXzDryMatterCorrectionList(query); + 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)); + } +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/domain/XzDryMatterCorrection.java b/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/domain/XzDryMatterCorrection.java new file mode 100644 index 0000000..15045a8 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/domain/XzDryMatterCorrection.java @@ -0,0 +1,100 @@ +package com.zhyc.module.dryMatterCorrection.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 干物质校正对象 xz_dry_matter_correction + */ +public class XzDryMatterCorrection extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** 主键ID */ + private Long id; + + /** 年月 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "年月", width = 30, dateFormat = "yyyy-MM-dd") + private Date datetime; + + /** 厂区 */ + @Excel(name = "厂区") + private String factory; + + /** 干物质含量 */ + @Excel(name = "干物质含量") + private String content; + + /** 干物质标准 */ + @Excel(name = "干物质标准") + private String standard; + + /** 干物质系数 */ + @Excel(name = "干物质系数") // 移除了numFormat + private Double coefficient; + + // Getter和Setter + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Date getDatetime() { + return datetime; + } + + public void setDatetime(Date datetime) { + this.datetime = datetime; + } + + public String getFactory() { + return factory; + } + + public void setFactory(String factory) { + this.factory = factory; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getStandard() { + return standard; + } + + public void setStandard(String standard) { + this.standard = standard; + } + + public Double getCoefficient() { + return coefficient; + } + + public void setCoefficient(Double coefficient) { + this.coefficient = coefficient; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", id) + .append("datetime", datetime) + .append("factory", factory) + .append("content", content) + .append("standard", standard) + .append("coefficient", coefficient) + .toString(); + } +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/mapper/XzDryMatterCorrectionMapper.java b/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/mapper/XzDryMatterCorrectionMapper.java new file mode 100644 index 0000000..912eaab --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/mapper/XzDryMatterCorrectionMapper.java @@ -0,0 +1,61 @@ +package com.zhyc.module.dryMatterCorrection.mapper; + +import java.util.List; +import com.zhyc.module.dryMatterCorrection.domain.XzDryMatterCorrection; + +/** + * 干物质校正Mapper接口 + * + * @author ruoyi + * @date 2025-07-11 + */ +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/dryMatterCorrection/service/IXzDryMatterCorrectionService.java b/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/service/IXzDryMatterCorrectionService.java new file mode 100644 index 0000000..90721f6 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/service/IXzDryMatterCorrectionService.java @@ -0,0 +1,61 @@ +package com.zhyc.module.dryMatterCorrection.service; + +import java.util.List; +import com.zhyc.module.dryMatterCorrection.domain.XzDryMatterCorrection; + +/** + * 干物质校正Service接口 + * + * @author ruoyi + * @date 2025-07-11 + */ +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/dryMatterCorrection/service/impl/XzDryMatterCorrectionServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/service/impl/XzDryMatterCorrectionServiceImpl.java new file mode 100644 index 0000000..cb52506 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/service/impl/XzDryMatterCorrectionServiceImpl.java @@ -0,0 +1,74 @@ +package com.zhyc.module.dryMatterCorrection.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.zhyc.module.dryMatterCorrection.mapper.XzDryMatterCorrectionMapper; +import com.zhyc.module.dryMatterCorrection.domain.XzDryMatterCorrection; +import com.zhyc.module.dryMatterCorrection.service.IXzDryMatterCorrectionService; + +@Service +public class XzDryMatterCorrectionServiceImpl implements IXzDryMatterCorrectionService { + + @Autowired + private XzDryMatterCorrectionMapper xzDryMatterCorrectionMapper; + + @Override + public XzDryMatterCorrection selectXzDryMatterCorrectionById(Long id) { + return xzDryMatterCorrectionMapper.selectXzDryMatterCorrectionById(id); + } + + @Override + public List selectXzDryMatterCorrectionList(XzDryMatterCorrection xzDryMatterCorrection) { + return xzDryMatterCorrectionMapper.selectXzDryMatterCorrectionList(xzDryMatterCorrection); + } + + @Override + public int insertXzDryMatterCorrection(XzDryMatterCorrection xzDryMatterCorrection) { + calculateCoefficient(xzDryMatterCorrection); + return xzDryMatterCorrectionMapper.insertXzDryMatterCorrection(xzDryMatterCorrection); + } + + @Override + public int updateXzDryMatterCorrection(XzDryMatterCorrection xzDryMatterCorrection) { + calculateCoefficient(xzDryMatterCorrection); + return xzDryMatterCorrectionMapper.updateXzDryMatterCorrection(xzDryMatterCorrection); + } + + @Override + public int deleteXzDryMatterCorrectionByIds(Long[] ids) { + return xzDryMatterCorrectionMapper.deleteXzDryMatterCorrectionByIds(ids); + } + + @Override + public int deleteXzDryMatterCorrectionById(Long id) { + return xzDryMatterCorrectionMapper.deleteXzDryMatterCorrectionById(id); + } + + /** + * 计算干物质系数(含格式控制) + */ + private void calculateCoefficient(XzDryMatterCorrection xzDryMatterCorrection) { + if (xzDryMatterCorrection.getContent() != null && + xzDryMatterCorrection.getStandard() != null) { + try { + double content = Double.parseDouble(xzDryMatterCorrection.getContent()); + double standard = Double.parseDouble(xzDryMatterCorrection.getStandard()); + + if (standard != 0) { + double coefficient = content / standard; + // 手动控制4位小数(替代numFormat功能) + xzDryMatterCorrection.setCoefficient( + Double.parseDouble(String.format("%.4f", coefficient)) + ); + } else { + xzDryMatterCorrection.setCoefficient(null); + } + } catch (NumberFormatException e) { + xzDryMatterCorrection.setCoefficient(null); + } + } else { + xzDryMatterCorrection.setCoefficient(null); + } + } +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/add_sheep/controller/ScAddSheepController.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/add_sheep/controller/ScAddSheepController.java new file mode 100644 index 0000000..d205ae0 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/add_sheep/controller/ScAddSheepController.java @@ -0,0 +1,90 @@ +package com.zhyc.module.produce.manage_sheep.add_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.utils.poi.ExcelUtil; +import com.zhyc.module.produce.manage_sheep.add_sheep.domain.ScAddSheep; +import com.zhyc.module.produce.manage_sheep.add_sheep.service.IScAddSheepService; +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; + + //新增羊只验证 + @PreAuthorize("@ss.hasPermi('produce:add_sheep:add')") + @Log(title = "新增", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult addSheep(@RequestBody ScAddSheep scAddSheep) { + if (scAddSheep.getSheepId() == null || scAddSheep.getSheepId().isEmpty()) { + return AjaxResult.error("羊只id不能为空"); + } + 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("品种不能为空"); + } + + boolean success = scAddSheepService.insertScAddSheep(scAddSheep); + if (success) { + return success("新增成功"); + } else { + return AjaxResult.error("新增失败"); + } + } + + //导出表单 + @PostMapping("/exportForm") + @Log(title = "羊只信息", businessType = BusinessType.EXPORT) + public void exportForm(HttpServletResponse response, @RequestBody ScAddSheep scAddSheep) throws IOException { + ExcelUtil util = new ExcelUtil<>(ScAddSheep.class); + List list = new ArrayList<>(); + 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/add_sheep/domain/ScAddSheep.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/add_sheep/domain/ScAddSheep.java new file mode 100644 index 0000000..dd3f662 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/add_sheep/domain/ScAddSheep.java @@ -0,0 +1,192 @@ +package com.zhyc.module.produce.manage_sheep.add_sheep.domain; + +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +import java.math.BigDecimal; +import java.util.Date; + +public class ScAddSheep extends BaseEntity { + /** + * 羊只 + * + * @author ruoyi + * @date 2025-07-10 + */ + private static final long serialVersionUID = 1L; + @Excel(name = "主键") + private Long id; // 如果数据库主键叫 id,就加这一行 + /** 羊只ID */ + @Excel(name = "羊只ID") + private String sheepId; + + /** 羊舍编号 */ + @Excel(name = "羊舍") + private Integer sheepfold; + + /** 父号 */ + @Excel(name = "父号") + private String father; + + /** 母号 */ + @Excel(name = "母号") + private String mother; + + /** 出生体重 */ + @Excel(name = "出生体重") + private BigDecimal bornWeight; + + /** 出生日期 */ + @Excel(name = "出生日期", dateFormat = "yyyy-MM-dd") + private Date birthday; + + /** 性别 1公 0母 */ + @Excel(name = "性别", readConverterExp = "1=公,0=母") + private Integer gender; + + /** 胎次 */ + @Excel(name = "胎次") + private Integer parity; + + /** 品种编号 */ + @Excel(name = "品种编号") + private Integer varietyId; + + /** 入群日期 */ + @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; + + // Getters and Setters + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getSheepId() { + return sheepId; + } + + public void setSheepId(String sheepId) { + this.sheepId = sheepId; + } + + public Integer getSheepfold() { + return sheepfold; + } + + public void setSheepfold(Integer sheepfold) { + this.sheepfold = sheepfold; + } + + public String getFather() { + return father; + } + + public void setFather(String father) { + this.father = father; + } + + public String getMother() { + return mother; + } + + public void setMother(String mother) { + this.mother = mother; + } + + public BigDecimal getBornWeight() { + return bornWeight; + } + + public void setBornWeight(BigDecimal bornWeight) { + this.bornWeight = bornWeight; + } + + public Date getBirthday() { + return birthday; + } + + public void setBirthday(Date birthday) { + this.birthday = birthday; + } + + public Integer getGender() { + return gender; + } + + public void setGender(Integer gender) { + this.gender = gender; + } + + public Integer getParity() { + return parity; + } + + public void setParity(Integer parity) { + this.parity = parity; + } + + public Integer getVarietyId() { + return varietyId; + } + + public void setVarietyId(Integer varietyId) { + this.varietyId = varietyId; + } + + public Date getJoinDate() { + return joinDate; + } + + public void setJoinDate(Date joinDate) { + this.joinDate = joinDate; + } + + public String getComment() { + return comment; + } + + public void setComment(String comment) { + this.comment = comment; + } + + public String getTechnician() { + return technician; + } + + public void setTechnician(String technician) { + this.technician = technician; + } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } +} + diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/add_sheep/mapper/ScAddSheepMapper.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/add_sheep/mapper/ScAddSheepMapper.java new file mode 100644 index 0000000..877b8eb --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/add_sheep/mapper/ScAddSheepMapper.java @@ -0,0 +1,15 @@ +package com.zhyc.module.produce.manage_sheep.add_sheep.mapper; + +import com.zhyc.module.produce.manage_sheep.add_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(Long[] ids); +} + diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/add_sheep/service/IScAddSheepService.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/add_sheep/service/IScAddSheepService.java new file mode 100644 index 0000000..8381335 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/add_sheep/service/IScAddSheepService.java @@ -0,0 +1,17 @@ +package com.zhyc.module.produce.manage_sheep.add_sheep.service; + +import com.zhyc.common.core.domain.AjaxResult; +import com.zhyc.module.produce.manage_sheep.add_sheep.domain.ScAddSheep; + +import java.util.List; + + +public interface IScAddSheepService { + boolean insertScAddSheep(ScAddSheep scAddSheep); + + List selectScAddSheepList(ScAddSheep scAddSheep); + boolean updateScAddSheep(ScAddSheep scAddSheep); + boolean deleteScAddSheepByIds(Long[] ids); + String importSheep(List list, boolean updateSupport, String operName); +} + diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/add_sheep/service/impl/ScAddSheepServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/add_sheep/service/impl/ScAddSheepServiceImpl.java new file mode 100644 index 0000000..6829169 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/add_sheep/service/impl/ScAddSheepServiceImpl.java @@ -0,0 +1,67 @@ +package com.zhyc.module.produce.manage_sheep.add_sheep.service.impl; + +import com.zhyc.common.exception.ServiceException; +import com.zhyc.common.utils.StringUtils; +import com.zhyc.module.produce.manage_sheep.add_sheep.domain.ScAddSheep; +import com.zhyc.module.produce.manage_sheep.add_sheep.mapper.ScAddSheepMapper; +import com.zhyc.module.produce.manage_sheep.add_sheep.service.IScAddSheepService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class ScAddSheepServiceImpl implements IScAddSheepService { + @Autowired + private ScAddSheepMapper scAddSheepMapper; + + @Override + public boolean insertScAddSheep(ScAddSheep scAddSheep) { + return scAddSheepMapper.insert(scAddSheep) > 0; + } + + + @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(Long[] ids) { + return scAddSheepMapper.deleteScAddSheepByIds(ids) > 0; + } + + @Override + 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 (ScAddSheep sheep : list) { + try { + if (StringUtils.isBlank(sheep.getSheepId())) { + failure++; failureMsg.append("
第").append(success + failure + 1).append("行:羊只ID不能为空"); 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(success + failure + 1).append("行:").append(e.getMessage()); + } + } + if (failure > 0) throw new ServiceException("导入失败!共 " + failure + " 条:" + failureMsg); + return "导入成功!共 " + success + " 条"; + } +} + diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/trans_group/controller/ScTransGroupController.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/trans_group/controller/ScTransGroupController.java new file mode 100644 index 0000000..fd89b5b --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/trans_group/controller/ScTransGroupController.java @@ -0,0 +1,105 @@ +package com.zhyc.module.produce.manage_sheep.trans_group.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.zhyc.module.produce.manage_sheep.trans_group.domain.ScTransGroup; +import com.zhyc.module.produce.manage_sheep.trans_group.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) + { + 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)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/trans_group/domain/ScTransGroup.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/trans_group/domain/ScTransGroup.java new file mode 100644 index 0000000..e25278a --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/trans_group/domain/ScTransGroup.java @@ -0,0 +1,144 @@ +package com.zhyc.module.produce.manage_sheep.trans_group.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 转群记录对象 sc_trans_group + * + * @author ruoyi + * @date 2025-07-10 + */ +public class ScTransGroup extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Integer id; + + /** 羊只id */ + @Excel(name = "羊只id") + private Integer sheepId; + + /** 转入羊舍 */ + @Excel(name = "转入羊舍") + private String foldTo; + + /** 转出羊舍 */ + @Excel(name = "转出羊舍") + private String foldFrom; + + /** 转群原因 */ + @Excel(name = "转群原因") + private String reason; + + /** 技术员 */ + @Excel(name = "技术员") + private String technician; + + /** 状态 */ + @Excel(name = "状态") + private Integer status; + + /** 备注 */ + @Excel(name = "备注") + private String comment; + + public void setId(Integer id) + { + this.id = id; + } + + public Integer getId() + { + return id; + } + + public void setSheepId(Integer sheepId) + { + this.sheepId = sheepId; + } + + public Integer getSheepId() + { + return sheepId; + } + + public void setFoldTo(String foldTo) + { + this.foldTo = foldTo; + } + + public String getFoldTo() + { + return foldTo; + } + + public void setFoldFrom(String foldFrom) + { + this.foldFrom = foldFrom; + } + + public String getFoldFrom() + { + return foldFrom; + } + + public void setReason(String reason) + { + this.reason = reason; + } + + public String getReason() + { + return reason; + } + + public void setTechnician(String technician) + { + this.technician = technician; + } + + public String getTechnician() + { + return technician; + } + + public void setStatus(Integer status) + { + this.status = status; + } + + public Integer getStatus() + { + return status; + } + + public void setComment(String comment) + { + this.comment = comment; + } + + public String getComment() + { + return comment; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("sheepId", getSheepId()) + .append("foldTo", getFoldTo()) + .append("foldFrom", getFoldFrom()) + .append("reason", getReason()) + .append("technician", getTechnician()) + .append("status", getStatus()) + .append("comment", getComment()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .toString(); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/trans_group/mapper/ScTransGroupMapper.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/trans_group/mapper/ScTransGroupMapper.java new file mode 100644 index 0000000..288f672 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/trans_group/mapper/ScTransGroupMapper.java @@ -0,0 +1,61 @@ +package com.zhyc.module.produce.manage_sheep.trans_group.mapper; + +import java.util.List; +import com.zhyc.module.produce.manage_sheep.trans_group.domain.ScTransGroup; + +/** + * 转群记录Mapper接口 + * + * @author ruoyi + * @date 2025-07-10 + */ +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/trans_group/service/IScTransGroupService.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/trans_group/service/IScTransGroupService.java new file mode 100644 index 0000000..2e249f5 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/trans_group/service/IScTransGroupService.java @@ -0,0 +1,61 @@ +package com.zhyc.module.produce.manage_sheep.trans_group.service; + +import java.util.List; +import com.zhyc.module.produce.manage_sheep.trans_group.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); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/trans_group/service/impl/ScTransGroupServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/trans_group/service/impl/ScTransGroupServiceImpl.java new file mode 100644 index 0000000..f38d30c --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/trans_group/service/impl/ScTransGroupServiceImpl.java @@ -0,0 +1,96 @@ +package com.zhyc.module.produce.manage_sheep.trans_group.service.impl; + +import java.util.List; +import com.zhyc.common.utils.DateUtils; +import com.zhyc.module.produce.manage_sheep.trans_group.domain.ScTransGroup; +import com.zhyc.module.produce.manage_sheep.trans_group.mapper.ScTransGroupMapper; +import com.zhyc.module.produce.manage_sheep.trans_group.service.IScTransGroupService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * 转群记录Service业务层处理 + * + * @author ruoyi + * @date 2025-07-10 + */ +@Service +public class ScTransGroupServiceImpl implements IScTransGroupService +{ + @Autowired + private ScTransGroupMapper scTransGroupMapper; + + /** + * 查询转群记录 + * + * @param id 转群记录主键 + * @return 转群记录 + */ + @Override + public ScTransGroup selectScTransGroupById(Integer id) + { + return scTransGroupMapper.selectScTransGroupById(id); + } + + /** + * 查询转群记录列表 + * + * @param scTransGroup 转群记录 + * @return 转群记录 + */ + @Override + public List selectScTransGroupList(ScTransGroup scTransGroup) + { + return scTransGroupMapper.selectScTransGroupList(scTransGroup); + } + + /** + * 新增转群记录 + * + * @param scTransGroup 转群记录 + * @return 结果 + */ + @Override + public int insertScTransGroup(ScTransGroup scTransGroup) + { + scTransGroup.setStatus(0); + scTransGroup.setCreateTime(DateUtils.getNowDate()); + 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); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/transition_info/controller/ScTransitionInfoController.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/transition_info/controller/ScTransitionInfoController.java new file mode 100644 index 0000000..0b438fd --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/transition_info/controller/ScTransitionInfoController.java @@ -0,0 +1,104 @@ +package com.zhyc.module.produce.manage_sheep.transition_info.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.transition_info.domain.ScTransitionInfo; +import com.zhyc.module.produce.manage_sheep.transition_info.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); + 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) + { + return success(scTransitionInfoService.selectScTransitionInfoById(id)); + } + + /** + * 新增转场 + */ + @PreAuthorize("@ss.hasPermi('produce:transition_info:add')") + @Log(title = "转场", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ScTransitionInfo scTransitionInfo) + { + return toAjax(scTransitionInfoService.insertScTransitionInfo(scTransitionInfo)); + } + + /** + * 修改转场 + */ + @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)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/transition_info/domain/ScTransitionInfo.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/transition_info/domain/ScTransitionInfo.java new file mode 100644 index 0000000..1636a5f --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/transition_info/domain/ScTransitionInfo.java @@ -0,0 +1,144 @@ +package com.zhyc.module.produce.manage_sheep.transition_info.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 转场对象 sc_transition_info + * + * @author ruoyi + * @date 2025-07-10 + */ +public class ScTransitionInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** */ + private Integer id; + + /** 羊只id */ + @Excel(name = "羊只id") + private Integer sheepId; + + /** 转入牧场 */ + @Excel(name = "转入牧场") + private String transTo; + + /** 当前牧场 */ + @Excel(name = "当前牧场") + private String transFrom; + + /** 转场类型 */ + @Excel(name = "转场类型") + private Long transType; + + /** 技术员 */ + @Excel(name = "技术员") + private String technician; + + /** 状态 */ + @Excel(name = "状态") + private Integer status; + + /** 备注 */ + @Excel(name = "备注") + private String comment; + + public void setId(Integer id) + { + this.id = id; + } + + public Integer getId() + { + return id; + } + + public void setSheepId(Integer sheepId) + { + this.sheepId = sheepId; + } + + public Integer getSheepId() + { + return sheepId; + } + + public void setTransTo(String transTo) + { + this.transTo = transTo; + } + + public String getTransTo() + { + return transTo; + } + + public void setTransFrom(String transFrom) + { + this.transFrom = transFrom; + } + + public String getTransFrom() + { + return transFrom; + } + + public void setTransType(Long transType) + { + this.transType = transType; + } + + public Long getTransType() + { + return transType; + } + + public void setTechnician(String technician) + { + this.technician = technician; + } + + public String getTechnician() + { + return technician; + } + + public void setStatus(Integer status) + { + this.status = status; + } + + public Integer getStatus() + { + return status; + } + + public void setComment(String comment) + { + this.comment = comment; + } + + public String getComment() + { + return comment; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("sheepId", getSheepId()) + .append("transTo", getTransTo()) + .append("transFrom", getTransFrom()) + .append("transType", getTransType()) + .append("technician", getTechnician()) + .append("status", getStatus()) + .append("comment", getComment()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .toString(); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/transition_info/mapper/ScTransitionInfoMapper.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/transition_info/mapper/ScTransitionInfoMapper.java new file mode 100644 index 0000000..3e0c734 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/transition_info/mapper/ScTransitionInfoMapper.java @@ -0,0 +1,62 @@ +package com.zhyc.module.produce.manage_sheep.transition_info.mapper; + +import java.util.List; + +import com.zhyc.module.produce.manage_sheep.transition_info.domain.ScTransitionInfo; + +/** + * 转场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); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/transition_info/service/IScTransitionInfoService.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/transition_info/service/IScTransitionInfoService.java new file mode 100644 index 0000000..8c1dfd8 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/transition_info/service/IScTransitionInfoService.java @@ -0,0 +1,62 @@ +package com.zhyc.module.produce.manage_sheep.transition_info.service; + +import java.util.List; + +import com.zhyc.module.produce.manage_sheep.transition_info.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); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/transition_info/service/impl/ScTransitionInfoServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/transition_info/service/impl/ScTransitionInfoServiceImpl.java new file mode 100644 index 0000000..25ed41d --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/transition_info/service/impl/ScTransitionInfoServiceImpl.java @@ -0,0 +1,96 @@ +package com.zhyc.module.produce.manage_sheep.transition_info.service.impl; + +import java.util.List; +import com.zhyc.common.utils.DateUtils; +import com.zhyc.module.produce.manage_sheep.transition_info.domain.ScTransitionInfo; +import com.zhyc.module.produce.manage_sheep.transition_info.mapper.ScTransitionInfoMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.zhyc.module.produce.manage_sheep.transition_info.service.IScTransitionInfoService; + +/** + * 转场Service业务层处理 + * + * @author ruoyi + * @date 2025-07-10 + */ +@Service +public class ScTransitionInfoServiceImpl implements IScTransitionInfoService +{ + @Autowired + private ScTransitionInfoMapper scTransitionInfoMapper; + + /** + * 查询转场 + * + * @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); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/controller/ScCastrateController.java b/zhyc-module/src/main/java/com/zhyc/module/produce/other/castrate/controller/ScCastrateController.java similarity index 93% rename from zhyc-module/src/main/java/com/zhyc/module/produce/controller/ScCastrateController.java rename to zhyc-module/src/main/java/com/zhyc/module/produce/other/castrate/controller/ScCastrateController.java index d14f446..7c4c28a 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/produce/controller/ScCastrateController.java +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/other/castrate/controller/ScCastrateController.java @@ -1,10 +1,10 @@ -package com.zhyc.module.produce.controller; +package com.zhyc.module.produce.other.castrate.controller; import java.util.List; import javax.servlet.http.HttpServletResponse; -import com.zhyc.module.produce.domain.ScCastrate; -import com.zhyc.module.produce.service.IScCastrateService; +import com.zhyc.module.produce.other.castrate.domain.ScCastrate; +import com.zhyc.module.produce.other.castrate.service.IScCastrateService; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -29,7 +29,7 @@ import com.zhyc.common.core.page.TableDataInfo; * @date 2025-07-09 */ @RestController -@RequestMapping("/produce/castrate") +@RequestMapping("/produce/other/castrate") public class ScCastrateController extends BaseController { @Autowired diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/other/castrate/domain/ScCastrate.java b/zhyc-module/src/main/java/com/zhyc/module/produce/other/castrate/domain/ScCastrate.java new file mode 100644 index 0000000..280a1e3 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/other/castrate/domain/ScCastrate.java @@ -0,0 +1,112 @@ +package com.zhyc.module.produce.other.castrate.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 去势对象 sc_castrate + * + * @author ruoyi + * @date 2025-07-09 + */ +public class ScCastrate extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * $column.columnComment + */ + private Long id; + + /** + * 羊只id + */ + @Excel(name = "羊只id") + private String sheepId; + + /** + * 羊舍id + */ + private Long sheepfold; + + /** + * 用于通过羊舍id获取羊舍名称 + */ + @Excel(name = "羊舍名称") + private String sheepfoldName; + + /** + * 备注 + */ + @Excel(name = "备注") + private String comment; + + /** + * 技术员 + */ + @Excel(name = "技术员") + private String technician; + + + + 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 setSheepfold(Long sheepfold) { + this.sheepfold = sheepfold; + } + + public Long getSheepfold() { + return sheepfold; + } + + public void setComment(String comment) { + this.comment = comment; + } + + public String getComment() { + return comment; + } + + public void setTechnician(String technician) { + this.technician = technician; + } + + public String getTechnician() { + return technician; + } + + public String getSheepfoldName() { + return sheepfoldName; + } + public void setSheepfoldName(String sheepfoldName) { + this.sheepfoldName = sheepfoldName; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("sheepId", getSheepId()) + .append("sheepfold", getSheepfold()) + .append("comment", getComment()) + .append("technician", getTechnician()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .toString(); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/mapper/ScCastrateMapper.java b/zhyc-module/src/main/java/com/zhyc/module/produce/other/castrate/mapper/ScCastrateMapper.java similarity index 90% rename from zhyc-module/src/main/java/com/zhyc/module/produce/mapper/ScCastrateMapper.java rename to zhyc-module/src/main/java/com/zhyc/module/produce/other/castrate/mapper/ScCastrateMapper.java index 16a27e7..057bafd 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/produce/mapper/ScCastrateMapper.java +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/other/castrate/mapper/ScCastrateMapper.java @@ -1,7 +1,8 @@ -package com.zhyc.module.produce.mapper; +package com.zhyc.module.produce.other.castrate.mapper; import java.util.List; -import com.zhyc.module.produce.domain.ScCastrate; + +import com.zhyc.module.produce.other.castrate.domain.ScCastrate; /** * 去势Mapper接口 diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/service/IScCastrateService.java b/zhyc-module/src/main/java/com/zhyc/module/produce/other/castrate/service/IScCastrateService.java similarity index 90% rename from zhyc-module/src/main/java/com/zhyc/module/produce/service/IScCastrateService.java rename to zhyc-module/src/main/java/com/zhyc/module/produce/other/castrate/service/IScCastrateService.java index 7abd510..e19f312 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/produce/service/IScCastrateService.java +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/other/castrate/service/IScCastrateService.java @@ -1,7 +1,8 @@ -package com.zhyc.module.produce.service; +package com.zhyc.module.produce.other.castrate.service; import java.util.List; -import com.zhyc.module.produce.domain.ScCastrate; + +import com.zhyc.module.produce.other.castrate.domain.ScCastrate; /** * 去势Service接口 diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/service/impl/ScCastrateServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/produce/other/castrate/service/impl/ScCastrateServiceImpl.java similarity index 87% rename from zhyc-module/src/main/java/com/zhyc/module/produce/service/impl/ScCastrateServiceImpl.java rename to zhyc-module/src/main/java/com/zhyc/module/produce/other/castrate/service/impl/ScCastrateServiceImpl.java index 5279d7d..bde1c4d 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/produce/service/impl/ScCastrateServiceImpl.java +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/other/castrate/service/impl/ScCastrateServiceImpl.java @@ -1,10 +1,10 @@ -package com.zhyc.module.produce.service.impl; +package com.zhyc.module.produce.other.castrate.service.impl; import java.util.List; import com.zhyc.common.utils.DateUtils; -import com.zhyc.module.produce.domain.ScCastrate; -import com.zhyc.module.produce.mapper.ScCastrateMapper; -import com.zhyc.module.produce.service.IScCastrateService; +import com.zhyc.module.produce.other.castrate.domain.ScCastrate; +import com.zhyc.module.produce.other.castrate.mapper.ScCastrateMapper; +import com.zhyc.module.produce.other.castrate.service.IScCastrateService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/other/fixHoof/controller/ScFixHoofController.java b/zhyc-module/src/main/java/com/zhyc/module/produce/other/fixHoof/controller/ScFixHoofController.java new file mode 100644 index 0000000..3e9a227 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/other/fixHoof/controller/ScFixHoofController.java @@ -0,0 +1,108 @@ +package com.zhyc.module.produce.other.fixHoof.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.zhyc.module.produce.other.fixHoof.domain.ScFixHoof; +import com.zhyc.module.produce.other.fixHoof.service.IScFixHoofService; +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/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") Long id) + { + return success(scFixHoofService.selectScFixHoofById(id)); + } + + /** + * 新增修蹄 + */ + @PreAuthorize("@ss.hasPermi('produce:fixHoof:add')") + @Log(title = "修蹄", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ScFixHoof scFixHoof) + { + return toAjax(scFixHoofService.insertScFixHoof(scFixHoof)); + } + + /** + * 修改修蹄 + */ + @PreAuthorize("@ss.hasPermi('produce:fixHoof:edit')") + @Log(title = "修蹄", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ScFixHoof scFixHoof) + { + return toAjax(scFixHoofService.updateScFixHoof(scFixHoof)); + } + + /** + * 删除修蹄 + */ + @PreAuthorize("@ss.hasPermi('produce:fixHoof:remove')") + @Log(title = "修蹄", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(scFixHoofService.deleteScFixHoofByIds(ids)); + } + + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/domain/ScCastrate.java b/zhyc-module/src/main/java/com/zhyc/module/produce/other/fixHoof/domain/ScFixHoof.java similarity index 88% rename from zhyc-module/src/main/java/com/zhyc/module/produce/domain/ScCastrate.java rename to zhyc-module/src/main/java/com/zhyc/module/produce/other/fixHoof/domain/ScFixHoof.java index fae976c..a1d445c 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/produce/domain/ScCastrate.java +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/other/fixHoof/domain/ScFixHoof.java @@ -1,4 +1,4 @@ -package com.zhyc.module.produce.domain; +package com.zhyc.module.produce.other.fixHoof.domain; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; @@ -6,12 +6,12 @@ import com.zhyc.common.annotation.Excel; import com.zhyc.common.core.domain.BaseEntity; /** - * 去势对象 sc_castrate + * 修蹄对象 sc_fix_hoof * * @author ruoyi - * @date 2025-07-09 + * @date 2025-07-10 */ -public class ScCastrate extends BaseEntity +public class ScFixHoof extends BaseEntity { private static final long serialVersionUID = 1L; @@ -20,7 +20,7 @@ public class ScCastrate extends BaseEntity /** 羊只id */ @Excel(name = "羊只id") - private String sheepId; + private Long sheepId; /** 羊舍id */ @Excel(name = "羊舍id") @@ -44,12 +44,12 @@ public class ScCastrate extends BaseEntity return id; } - public void setSheepId(String sheepId) + public void setSheepId(Long sheepId) { this.sheepId = sheepId; } - public String getSheepId() + public Long getSheepId() { return sheepId; } diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/other/fixHoof/mapper/ScFixHoofMapper.java b/zhyc-module/src/main/java/com/zhyc/module/produce/other/fixHoof/mapper/ScFixHoofMapper.java new file mode 100644 index 0000000..75e27ee --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/other/fixHoof/mapper/ScFixHoofMapper.java @@ -0,0 +1,61 @@ +package com.zhyc.module.produce.other.fixHoof.mapper; + +import java.util.List; +import com.zhyc.module.produce.other.fixHoof.domain.ScFixHoof; + +/** + * 修蹄Mapper接口 + * + * @author ruoyi + * @date 2025-07-10 + */ +public interface ScFixHoofMapper +{ + /** + * 查询修蹄 + * + * @param id 修蹄主键 + * @return 修蹄 + */ + public ScFixHoof selectScFixHoofById(Long 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(Long id); + + /** + * 批量删除修蹄 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteScFixHoofByIds(Long[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/other/fixHoof/service/IScFixHoofService.java b/zhyc-module/src/main/java/com/zhyc/module/produce/other/fixHoof/service/IScFixHoofService.java new file mode 100644 index 0000000..8092f8f --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/other/fixHoof/service/IScFixHoofService.java @@ -0,0 +1,61 @@ +package com.zhyc.module.produce.other.fixHoof.service; + +import java.util.List; +import com.zhyc.module.produce.other.fixHoof.domain.ScFixHoof; + +/** + * 修蹄Service接口 + * + * @author ruoyi + * @date 2025-07-10 + */ +public interface IScFixHoofService +{ + /** + * 查询修蹄 + * + * @param id 修蹄主键 + * @return 修蹄 + */ + public ScFixHoof selectScFixHoofById(Long 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(Long[] ids); + + /** + * 删除修蹄信息 + * + * @param id 修蹄主键 + * @return 结果 + */ + public int deleteScFixHoofById(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/other/fixHoof/service/impl/ScFixHoofServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/produce/other/fixHoof/service/impl/ScFixHoofServiceImpl.java new file mode 100644 index 0000000..68a68ff --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/other/fixHoof/service/impl/ScFixHoofServiceImpl.java @@ -0,0 +1,95 @@ +package com.zhyc.module.produce.other.fixHoof.service.impl; + +import java.util.List; +import com.zhyc.common.utils.DateUtils; +import com.zhyc.module.produce.other.fixHoof.domain.ScFixHoof; +import com.zhyc.module.produce.other.fixHoof.mapper.ScFixHoofMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.zhyc.module.produce.other.fixHoof.service.IScFixHoofService; + +/** + * 修蹄Service业务层处理 + * + * @author ruoyi + * @date 2025-07-10 + */ +@Service +public class ScFixHoofServiceImpl implements IScFixHoofService +{ + @Autowired + private ScFixHoofMapper scFixHoofMapper; + + /** + * 查询修蹄 + * + * @param id 修蹄主键 + * @return 修蹄 + */ + @Override + public ScFixHoof selectScFixHoofById(Long 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) + { + scFixHoof.setCreateTime(DateUtils.getNowDate()); + return scFixHoofMapper.insertScFixHoof(scFixHoof); + } + + /** + * 修改修蹄 + * + * @param scFixHoof 修蹄 + * @return 结果 + */ + @Override + public int updateScFixHoof(ScFixHoof scFixHoof) + { + return scFixHoofMapper.updateScFixHoof(scFixHoof); + } + + /** + * 批量删除修蹄 + * + * @param ids 需要删除的修蹄主键 + * @return 结果 + */ + @Override + public int deleteScFixHoofByIds(Long[] ids) + { + return scFixHoofMapper.deleteScFixHoofByIds(ids); + } + + /** + * 删除修蹄信息 + * + * @param id 修蹄主键 + * @return 结果 + */ + @Override + public int deleteScFixHoofById(Long id) + { + return scFixHoofMapper.deleteScFixHoofById(id); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/sheepfold_management/mapper/DaSheepfoldMapper.java b/zhyc-module/src/main/java/com/zhyc/module/sheepfold_management/mapper/DaSheepfoldMapper.java index f89504a..0a82b50 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/sheepfold_management/mapper/DaSheepfoldMapper.java +++ b/zhyc-module/src/main/java/com/zhyc/module/sheepfold_management/mapper/DaSheepfoldMapper.java @@ -58,4 +58,5 @@ public interface DaSheepfoldMapper * @return 结果 */ public int deleteDaSheepfoldByIds(Long[] ids); + } diff --git a/zhyc-module/src/main/resources/mapper/disease/SwDiseaseMapper.xml b/zhyc-module/src/main/resources/mapper/biosafety/SwDiseaseMapper.xml similarity index 100% rename from zhyc-module/src/main/resources/mapper/disease/SwDiseaseMapper.xml rename to zhyc-module/src/main/resources/mapper/biosafety/SwDiseaseMapper.xml diff --git a/zhyc-module/src/main/resources/mapper/biosafety/SwMedicTypeMapper.xml b/zhyc-module/src/main/resources/mapper/biosafety/SwMedicTypeMapper.xml new file mode 100644 index 0000000..11d29ac --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/biosafety/SwMedicTypeMapper.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + select id, name from sw_medic_type + + + + + + + + insert into sw_medic_type + + name, + + + #{name}, + + + + + update sw_medic_type + + name = #{name}, + + where id = #{id} + + + + delete from sw_medic_type where id = #{id} + + + + delete from sw_medic_type where id in + + #{id} + + + \ No newline at end of file diff --git a/zhyc-module/src/main/resources/mapper/biosafety/SwMedicineMapper.xml b/zhyc-module/src/main/resources/mapper/biosafety/SwMedicineMapper.xml new file mode 100644 index 0000000..663ff94 --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/biosafety/SwMedicineMapper.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + select id, medica, name, medic_type, usage_id, comment from sw_medicine + + + + + + + + insert into sw_medicine + + medica, + name, + medic_type, + usage_id, + comment, + + + #{medica}, + #{name}, + #{medicType}, + #{usageId}, + #{comment}, + + + + + update sw_medicine + + medica = #{medica}, + name = #{name}, + medic_type = #{medicType}, + usage_id = #{usageId}, + comment = #{comment}, + + where id = #{id} + + + + delete from sw_medicine where id = #{id} + + + + delete from sw_medicine where id in + + #{id} + + + \ No newline at end of file diff --git a/zhyc-module/src/main/resources/mapper/biosafety/SwMedicineUsageMapper.xml b/zhyc-module/src/main/resources/mapper/biosafety/SwMedicineUsageMapper.xml new file mode 100644 index 0000000..20ce9f6 --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/biosafety/SwMedicineUsageMapper.xml @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, name, use_type, update_by, update_time, create_by, create_time from sw_medicine_usage + + + + + + + + + + insert into sw_medicine_usage + + name, + use_type, + update_by, + update_time, + create_by, + create_time, + + + #{name}, + #{useType}, + #{updateBy}, + #{updateTime}, + #{createBy}, + #{createTime}, + + + + + update sw_medicine_usage + + name = #{name}, + use_type = #{useType}, + update_by = #{updateBy}, + update_time = #{updateTime}, + create_by = #{createBy}, + create_time = #{createTime}, + + where id = #{id} + + + + delete from sw_medicine_usage where id = #{id} + + + + delete from sw_medicine_usage where id in + + #{id} + + + + + delete from sw_medicine_usage_details where medi_usage in + + #{mediUsage} + + + + + delete from sw_medicine_usage_details where medi_usage = #{mediUsage} + + + + insert into sw_medicine_usage_details( id, medi_usage, medi_id, dosage, unit, usageId, manufacturer, batch_number) values + + ( #{item.id}, #{item.mediUsage}, #{item.mediId}, #{item.dosage}, #{item.unit}, #{item.usageId}, #{item.manufacturer}, #{item.batchNumber}) + + + \ No newline at end of file diff --git a/zhyc-module/src/main/resources/mapper/biosafety/SwPrescriptionMapper.xml b/zhyc-module/src/main/resources/mapper/biosafety/SwPrescriptionMapper.xml new file mode 100644 index 0000000..1bc45df --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/biosafety/SwPrescriptionMapper.xml @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, no, name, pers_type, comment, status, update_by, update_time, create_by, create_time from sw_prescription + + + + + + + + + + insert into sw_prescription + + no, + name, + pers_type, + comment, + status, + update_by, + update_time, + create_by, + create_time, + + + #{no}, + #{name}, + #{persType}, + #{comment}, + #{status}, + #{updateBy}, + #{updateTime}, + #{createBy}, + #{createTime}, + + + + + update sw_prescription + + no = #{no}, + name = #{name}, + pers_type = #{persType}, + comment = #{comment}, + status = #{status}, + update_by = #{updateBy}, + update_time = #{updateTime}, + create_by = #{createBy}, + create_time = #{createTime}, + + where id = #{id} + + + + delete from sw_prescription where id = #{id} + + + + delete from sw_prescription where id in + + #{id} + + + + + delete from sw_pres_detail where pers_id in + + #{persId} + + + + + delete from sw_pres_detail where pers_id = #{persId} + + + + insert into sw_pres_detail( id, pers_id, medi_id, dosage, unit_id, usage_id) values + + ( #{item.id}, #{item.persId}, #{item.mediId}, #{item.dosage}, #{item.unitId}, #{item.usageId}) + + + \ No newline at end of file diff --git a/zhyc-module/src/main/resources/mapper/biosafety/SwUnitMapper.xml b/zhyc-module/src/main/resources/mapper/biosafety/SwUnitMapper.xml new file mode 100644 index 0000000..6943c33 --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/biosafety/SwUnitMapper.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + select id, name,unit from sw_unit + + + + + + + + insert into sw_unit + + name, + unit, + + + #{name}, + #{unit}, + + + + + update sw_unit + + name = #{name}, + unit = #{unit}, + + where id = #{id} + + + + delete from sw_unit where id = #{id} + + + + delete from sw_unit where id in + + #{id} + + + \ No newline at end of file diff --git a/zhyc-module/src/main/resources/mapper/biosafety/SwUsageMapper.xml b/zhyc-module/src/main/resources/mapper/biosafety/SwUsageMapper.xml new file mode 100644 index 0000000..ed4c37a --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/biosafety/SwUsageMapper.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + select id, name from sw_usage + + + + + + + + insert into sw_usage + + name, + + + #{name}, + + + + + update sw_usage + + name = #{name}, + + where id = #{id} + + + + delete from sw_usage where id = #{id} + + + + delete from sw_usage where id in + + #{id} + + + \ No newline at end of file diff --git a/zhyc-module/src/main/resources/mapper/dryMatterCorrection/XzDryMatterCorrectionMapper.xml b/zhyc-module/src/main/resources/mapper/dryMatterCorrection/XzDryMatterCorrectionMapper.xml new file mode 100644 index 0000000..6d36991 --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/dryMatterCorrection/XzDryMatterCorrectionMapper.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + select id, datetime, factory, content, standard, coefficient from xz_dry_matter_correction + + + + + + + + insert into xz_dry_matter_correction + + datetime, + factory, + content, + standard, + coefficient, + + + #{datetime}, + #{factory}, + #{content}, + #{standard}, + #{coefficient}, + + + + + update xz_dry_matter_correction + + datetime = #{datetime}, + factory = #{factory}, + content = #{content}, + standard = #{standard}, + coefficient = #{coefficient}, + + where id = #{id} + + + + delete from xz_dry_matter_correction where id = #{id} + + + + delete from xz_dry_matter_correction where id in + + #{id} + + + \ No newline at end of file diff --git a/zhyc-module/src/main/resources/mapper/produce/manage_sheep/add_sheep/ScAddSheepMapper.xml b/zhyc-module/src/main/resources/mapper/produce/manage_sheep/add_sheep/ScAddSheepMapper.xml new file mode 100644 index 0000000..d234d5c --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/produce/manage_sheep/add_sheep/ScAddSheepMapper.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO sc_add_sheep + (sheep_id, sheepfold, father, mother, born_weight, birthday, gender, parity, + variety_id, join_date, comment, technician, create_by, create_time) + VALUES + (#{sheepId}, #{sheepfold}, #{father}, #{mother}, #{bornWeight}, #{birthday}, + #{gender}, #{parity}, #{varietyId}, #{joinDate}, #{comment}, #{technician}, + #{createBy}, #{createTime}) + + + + + + UPDATE sc_add_sheep + + sheep_id = #{sheepId}, + sheepfold = #{sheepfold}, + father = #{father}, + mother = #{mother}, + born_weight = #{bornWeight}, + birthday = #{birthday}, + gender = #{gender}, + parity = #{parity}, + variety_id = #{varietyId}, + join_date = #{joinDate}, + comment = #{comment}, + technician = #{technician}, + update_by = #{updateBy}, + update_time = NOW() + + WHERE id = #{id} + + + + DELETE FROM sc_add_sheep WHERE id IN + + #{id} + + + + \ No newline at end of file diff --git a/zhyc-module/src/main/resources/mapper/produce/manage_sheep/trans_group/ScTransGroupMapper.xml b/zhyc-module/src/main/resources/mapper/produce/manage_sheep/trans_group/ScTransGroupMapper.xml new file mode 100644 index 0000000..20046c2 --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/produce/manage_sheep/trans_group/ScTransGroupMapper.xml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + select id, sheep_id, fold_to, fold_from, reason, technician, status, comment, create_by, create_time from sc_trans_group + + + + + + + + insert into sc_trans_group + + sheep_id, + fold_to, + fold_from, + reason, + technician, + status, + comment, + create_by, + create_time, + + + #{sheepId}, + #{foldTo}, + #{foldFrom}, + #{reason}, + #{technician}, + #{status}, + #{comment}, + #{createBy}, + #{createTime}, + + + + + update sc_trans_group + + sheep_id = #{sheepId}, + fold_to = #{foldTo}, + fold_from = #{foldFrom}, + reason = #{reason}, + technician = #{technician}, + status = #{status}, + comment = #{comment}, + create_by = #{createBy}, + create_time = #{createTime}, + + where id = #{id} + + + + delete from sc_trans_group where id = #{id} + + + + delete from sc_trans_group where id in + + #{id} + + + \ No newline at end of file diff --git a/zhyc-module/src/main/resources/mapper/produce/manage_sheep/transition_info/ScTransitionInfoMapper.xml b/zhyc-module/src/main/resources/mapper/produce/manage_sheep/transition_info/ScTransitionInfoMapper.xml new file mode 100644 index 0000000..dc1c5c5 --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/produce/manage_sheep/transition_info/ScTransitionInfoMapper.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + select id, sheep_id, trans_to, trans_from, trans_type, technician, status, comment, create_by, create_time from sc_transition_info + + + + + + + + insert into sc_transition_info + + sheep_id, + trans_to, + trans_from, + trans_type, + technician, + status, + comment, + create_by, + create_time, + + + #{sheepId}, + #{transTo}, + #{transFrom}, + #{transType}, + #{technician}, + #{status}, + #{comment}, + #{createBy}, + #{createTime}, + + + + + update sc_transition_info + + sheep_id = #{sheepId}, + trans_to = #{transTo}, + trans_from = #{transFrom}, + trans_type = #{transType}, + technician = #{technician}, + status = #{status}, + comment = #{comment}, + create_by = #{createBy}, + create_time = #{createTime}, + + where id = #{id} + + + + delete from sc_transition_info where id = #{id} + + + + delete from sc_transition_info where id in + + #{id} + + + \ No newline at end of file diff --git a/zhyc-module/src/main/resources/mapper/produce/ScCastrateMapper.xml b/zhyc-module/src/main/resources/mapper/produce/other/castrate/ScCastrateMapper.xml similarity index 63% rename from zhyc-module/src/main/resources/mapper/produce/ScCastrateMapper.xml rename to zhyc-module/src/main/resources/mapper/produce/other/castrate/ScCastrateMapper.xml index ff35dfa..dcbaba7 100644 --- a/zhyc-module/src/main/resources/mapper/produce/ScCastrateMapper.xml +++ b/zhyc-module/src/main/resources/mapper/produce/other/castrate/ScCastrateMapper.xml @@ -1,36 +1,47 @@ - - + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + + - - - - - - - + + + + + + + - select id, sheep_id, sheepfold, comment, technician, create_by, create_time from sc_castrate + select sc.id, + sc.sheep_id, + sc.sheepfold, + sf.sheepfold_name as sheepfoldName, + sc.comment, + sc.technician, + sc.create_by, + sc.create_time + from sc_castrate sc + left join da_sheepfold sf on sc.sheepfold = sf.id - + @@ -42,7 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" technician, create_by, create_time, - + #{sheepId}, #{sheepfold}, @@ -50,7 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{technician}, #{createBy}, #{createTime}, - + @@ -67,11 +78,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from sc_castrate where id = #{id} + delete + from sc_castrate + where id = #{id} - delete from sc_castrate where id in + delete from sc_castrate where id in #{id} diff --git a/zhyc-module/src/main/resources/mapper/produce/other/fixHoof/ScFixHoofMapper.xml b/zhyc-module/src/main/resources/mapper/produce/other/fixHoof/ScFixHoofMapper.xml new file mode 100644 index 0000000..78eb85c --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/produce/other/fixHoof/ScFixHoofMapper.xml @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + select id, sheep_id, sheepfold, comment, technician, create_by, create_time from sc_fix_hoof + + + + + + + + insert into sc_fix_hoof + + sheep_id, + sheepfold, + comment, + technician, + create_by, + create_time, + + + #{sheepId}, + #{sheepfold}, + #{comment}, + #{technician}, + #{createBy}, + #{createTime}, + + + + + update sc_fix_hoof + + sheep_id = #{sheepId}, + sheepfold = #{sheepfold}, + comment = #{comment}, + technician = #{technician}, + create_by = #{createBy}, + create_time = #{createTime}, + + where id = #{id} + + + + delete from sc_fix_hoof where id = #{id} + + + + delete from sc_fix_hoof where id in + + #{id} + + + \ No newline at end of file diff --git a/zhyc-system/src/main/resources/mapper/system/SysLogininforMapper.xml b/zhyc-system/src/main/resources/mapper/system/ScAddSheepMapper.xml similarity index 100% rename from zhyc-system/src/main/resources/mapper/system/SysLogininforMapper.xml rename to zhyc-system/src/main/resources/mapper/system/ScAddSheepMapper.xml