diff --git a/chenhai-admin/src/main/java/com/chenhai/web/controller/muhu/MuhuVacController.java b/chenhai-admin/src/main/java/com/chenhai/web/controller/muhu/MuhuVacController.java new file mode 100644 index 0000000..7593aa1 --- /dev/null +++ b/chenhai-admin/src/main/java/com/chenhai/web/controller/muhu/MuhuVacController.java @@ -0,0 +1,121 @@ +package com.chenhai.web.controller.muhu; + +import com.chenhai.common.annotation.Log; +import com.chenhai.common.core.controller.BaseController; +import com.chenhai.common.core.domain.AjaxResult; +import com.chenhai.common.core.page.TableDataInfo; +import com.chenhai.common.enums.BusinessType; +import com.chenhai.common.utils.DateUtils; +import com.chenhai.common.utils.poi.ExcelUtil; +import com.chenhai.system.domain.SysVacCategory; +import com.chenhai.system.domain.SysVacInfo; +import com.chenhai.system.domain.SysVacRegistration; +import com.chenhai.system.service.ISysVacCategoryService; +import com.chenhai.system.service.ISysVacInfoService; +import com.chenhai.system.service.ISysVacRegistrationService; +import jakarta.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 疫苗预约Controller + * + * @author ruoyi + * @date 2026-01-28 + */ +@RestController +@RequestMapping("/muhu/VacRegistration") +public class MuhuVacController extends BaseController +{ + @Autowired + private ISysVacRegistrationService sysVacRegistrationService; + + @Autowired + private ISysVacInfoService sysVacInfoService; + + @Autowired + private ISysVacCategoryService sysVacCategoryService; + + /** + * 查询疫苗信息列表 + */ + @PreAuthorize("@ss.hasRole('muhu')") + @GetMapping("/getVacInfoList") + public TableDataInfo getVacInfoList(SysVacInfo sysVacInfo) + { + startPage(); + List list = sysVacInfoService.selectSysVacInfoList(sysVacInfo); + return getDataTable(list); + } + + /** + * 获取疫苗信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:vacInfo:query')") + @GetMapping(value = "/getVacInfo/{id}") + public AjaxResult getVacInfo(@PathVariable("id") Long id) + { + return success(sysVacInfoService.selectSysVacInfoById(id)); + } + + /** + * 获取疫苗类别列表 + */ + @PreAuthorize("@ss.hasRole('muhu')") + @GetMapping("/getVacCategoryList") + public TableDataInfo getVacCategoryList(SysVacCategory sysVacCategory) + { + startPage(); + List list = sysVacCategoryService.selectSysVacCategoryList(sysVacCategory); + return getDataTable(list); + } + + /** + * 查询疫苗预约列表 + */ + @PreAuthorize("@ss.hasRole('muhu')") + @GetMapping("/getVacRegistrationList") + public TableDataInfo getVacRegistrationList(SysVacRegistration sysVacRegistration) + { + startPage(); + List list = sysVacRegistrationService.selectSysVacRegistrationList(sysVacRegistration); + return getDataTable(list); + } + + /** + * 获取疫苗预约详细信息 + */ + @PreAuthorize("@ss.hasRole('muhu')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(sysVacRegistrationService.selectSysVacRegistrationById(id)); + } + + /** + * 新增疫苗预约 + */ + @PreAuthorize("@ss.hasRole('muhu')") + @Log(title = "新增疫苗预约", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult addVacRegistration(@RequestBody SysVacRegistration sysVacRegistration) + { + sysVacRegistration.setUserId(getUserId()); + sysVacRegistration.setRegistrationTime(DateUtils.getNowDate()); + return toAjax(sysVacRegistrationService.insertSysVacRegistration(sysVacRegistration)); + } + + /** + * 修改疫苗预约 + */ + @PreAuthorize("@ss.hasPermi('system:VacRegistration:edit')") + @Log(title = "疫苗预约", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody SysVacRegistration sysVacRegistration) + { + return toAjax(sysVacRegistrationService.updateSysVacRegistration(sysVacRegistration)); + } +} diff --git a/chenhai-admin/src/main/java/com/chenhai/web/controller/system/SensitiveWordApiTest.java b/chenhai-admin/src/main/java/com/chenhai/web/controller/system/SensitiveWordApiTest.java new file mode 100644 index 0000000..09e8a52 --- /dev/null +++ b/chenhai-admin/src/main/java/com/chenhai/web/controller/system/SensitiveWordApiTest.java @@ -0,0 +1,73 @@ +package com.chenhai.web.controller.system; + +import com.github.houbb.sensitive.word.api.IWordReplace; +import com.github.houbb.sensitive.word.core.SensitiveWordHelper; +import org.junit.jupiter.api.Test; + +/** + * @author : mazhongxu + * @date : 2026-02-04 18:28 + * @modyified By : + */ +public class SensitiveWordApiTest { + /** + * 判断是否包含敏感词 + */ + @Test + public void testContains() { + final String text = "五星红旗迎风飘扬,毛主席的画像屹立在天安门前"; + + System.out.println(SensitiveWordHelper.contains(text)); + } + + /** + * 返回第一个敏感词 + */ + @Test + public void testFindFirst() { + final String text = "五星红旗迎风飘扬,毛主席的画像屹立在天安门前"; + + System.out.println(SensitiveWordHelper.findFirst(text)); + } + + /** + * 返回所有敏感词 + */ + @Test + public void testFindAll() { + final String text = "五星红旗迎风飘扬,毛主席的画像屹立在天安门前"; + + System.out.println(SensitiveWordHelper.findAll(text)); + } + + /** + * 默认的替换策略 + */ + @Test + public void testReplaceDefault() { + final String text = "五星红旗迎风飘扬,毛主席的画像屹立在天安门前"; + + System.out.println(SensitiveWordHelper.replace(text)); + } + + /** + * 指定替换敏感词所用的字符 + */ + @Test + public void testReplace() { + final String text = "五星红旗迎风飘扬,毛主席的画像屹立在天安门前"; + + System.out.println(SensitiveWordHelper.replace(text, '0')); + } + +// /** +// * 自定义替换策略(自定义替换策略类需要实现 IWordReplace 接口 ) +// */ +// @Test +// public void defineReplaceTest() { +// final String text = "五星红旗迎风飘扬,毛主席的画像屹立在天安门前"; +// +// IWordReplace customWordReplace = new CustomWordReplace(); +// System.out.println(SensitiveWordHelper.replace(text, customWordReplace)); +// } +} diff --git a/chenhai-admin/src/main/java/com/chenhai/web/controller/system/SysSlaughterInfoController.java b/chenhai-admin/src/main/java/com/chenhai/web/controller/system/SysSlaughterInfoController.java new file mode 100644 index 0000000..4f53728 --- /dev/null +++ b/chenhai-admin/src/main/java/com/chenhai/web/controller/system/SysSlaughterInfoController.java @@ -0,0 +1,104 @@ +package com.chenhai.web.controller.system; + +import java.util.List; +import jakarta.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.chenhai.common.annotation.Log; +import com.chenhai.common.core.controller.BaseController; +import com.chenhai.common.core.domain.AjaxResult; +import com.chenhai.common.enums.BusinessType; +import com.chenhai.system.domain.SysSlaughterInfo; +import com.chenhai.system.service.ISysSlaughterInfoService; +import com.chenhai.common.utils.poi.ExcelUtil; +import com.chenhai.common.core.page.TableDataInfo; + +/** + * 屠宰信息Controller + * + * @author ruoyi + * @date 2026-02-03 + */ +@RestController +@RequestMapping("/system/slaughterInfo") +public class SysSlaughterInfoController extends BaseController +{ + @Autowired + private ISysSlaughterInfoService sysSlaughterInfoService; + + /** + * 查询屠宰信息列表 + */ + @PreAuthorize("@ss.hasPermi('system:slaughterInfo:list')") + @GetMapping("/list") + public TableDataInfo list(SysSlaughterInfo sysSlaughterInfo) + { + startPage(); + List list = sysSlaughterInfoService.selectSysSlaughterInfoList(sysSlaughterInfo); + return getDataTable(list); + } + + /** + * 导出屠宰信息列表 + */ + @PreAuthorize("@ss.hasPermi('system:slaughterInfo:export')") + @Log(title = "屠宰信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, SysSlaughterInfo sysSlaughterInfo) + { + List list = sysSlaughterInfoService.selectSysSlaughterInfoList(sysSlaughterInfo); + ExcelUtil util = new ExcelUtil(SysSlaughterInfo.class); + util.exportExcel(response, list, "屠宰信息数据"); + } + + /** + * 获取屠宰信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:slaughterInfo:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(sysSlaughterInfoService.selectSysSlaughterInfoById(id)); + } + + /** + * 新增屠宰信息 + */ + @PreAuthorize("@ss.hasPermi('system:slaughterInfo:add')") + @Log(title = "屠宰信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody SysSlaughterInfo sysSlaughterInfo) + { + return toAjax(sysSlaughterInfoService.insertSysSlaughterInfo(sysSlaughterInfo)); + } + + /** + * 修改屠宰信息 + */ + @PreAuthorize("@ss.hasPermi('system:slaughterInfo:edit')") + @Log(title = "屠宰信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody SysSlaughterInfo sysSlaughterInfo) + { + return toAjax(sysSlaughterInfoService.updateSysSlaughterInfo(sysSlaughterInfo)); + } + + /** + * 删除屠宰信息 + */ + @PreAuthorize("@ss.hasPermi('system:slaughterInfo:remove')") + @Log(title = "屠宰信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(sysSlaughterInfoService.deleteSysSlaughterInfoByIds(ids)); + } +} diff --git a/chenhai-admin/src/main/java/com/chenhai/web/controller/system/SysVacRegistrationController.java b/chenhai-admin/src/main/java/com/chenhai/web/controller/system/SysVacRegistrationController.java index be54b45..54982f7 100644 --- a/chenhai-admin/src/main/java/com/chenhai/web/controller/system/SysVacRegistrationController.java +++ b/chenhai-admin/src/main/java/com/chenhai/web/controller/system/SysVacRegistrationController.java @@ -101,4 +101,37 @@ public class SysVacRegistrationController extends BaseController { return toAjax(sysVacRegistrationService.deleteSysVacRegistrationByIds(ids)); } + + /** + * 确认预约 + */ + @PreAuthorize("@ss.hasPermi('system:VacRegistration:confirm')") + @Log(title = "疫苗预约", businessType = BusinessType.UPDATE) + @PutMapping("/confirm/{id}") + public AjaxResult confirm(@PathVariable Long id) + { + return toAjax(sysVacRegistrationService.confirmRegistration(id)); + } + + /** + * 完成预约 + */ + @PreAuthorize("@ss.hasPermi('system:VacRegistration:complete')") + @Log(title = "疫苗预约", businessType = BusinessType.UPDATE) + @PutMapping("/complete/{id}") + public AjaxResult complete(@PathVariable Long id) + { + return toAjax(sysVacRegistrationService.completeRegistration(id)); + } + + /** + * 取消预约 + */ + @PreAuthorize("@ss.hasPermi('system:VacRegistration:cancel')") + @Log(title = "疫苗预约", businessType = BusinessType.UPDATE) + @PutMapping("/cancel/{id}") + public AjaxResult cancel(@PathVariable Long id) + { + return toAjax(sysVacRegistrationService.cancelRegistration(id)); + } } diff --git a/chenhai-common/pom.xml b/chenhai-common/pom.xml index 6ae30cf..98ad375 100644 --- a/chenhai-common/pom.xml +++ b/chenhai-common/pom.xml @@ -113,6 +113,16 @@ jakarta.servlet-api + + com.github.houbb + sensitive-word + + + + org.junit.jupiter + junit-jupiter-engine + + \ No newline at end of file diff --git a/chenhai-system/src/main/java/com/chenhai/system/domain/SysSlaughterInfo.java b/chenhai-system/src/main/java/com/chenhai/system/domain/SysSlaughterInfo.java new file mode 100644 index 0000000..495d0ee --- /dev/null +++ b/chenhai-system/src/main/java/com/chenhai/system/domain/SysSlaughterInfo.java @@ -0,0 +1,161 @@ +package com.chenhai.system.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.chenhai.common.annotation.Excel; +import com.chenhai.common.core.domain.BaseEntity; + +/** + * 屠宰信息对象 sys_slaughter_info + * + * @author ruoyi + * @date 2026-02-03 + */ +public class SysSlaughterInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键ID */ + private Long id; + + /** 标题 */ + @Excel(name = "标题") + private String title; + + /** 内容详情 */ + @Excel(name = "内容详情") + private String content; + + /** 联系人 */ + @Excel(name = "联系人") + private String contactPerson; + + /** 联系电话 */ + @Excel(name = "联系电话") + private String contactPhone; + + /** 详细地址 */ + @Excel(name = "详细地址") + private String address; + + /** 服务时间 */ + @Excel(name = "服务时间") + private String serviceTime; + + /** 状态(0正常 1停用) */ + @Excel(name = "状态", readConverterExp = "0=正常,1=停用") + private String status; + + /** 删除标志(0代表存在 2代表删除) */ + private String delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public void setTitle(String title) + { + this.title = title; + } + + public String getTitle() + { + return title; + } + + public void setContent(String content) + { + this.content = content; + } + + public String getContent() + { + return content; + } + + public void setContactPerson(String contactPerson) + { + this.contactPerson = contactPerson; + } + + public String getContactPerson() + { + return contactPerson; + } + + public void setContactPhone(String contactPhone) + { + this.contactPhone = contactPhone; + } + + public String getContactPhone() + { + return contactPhone; + } + + public void setAddress(String address) + { + this.address = address; + } + + public String getAddress() + { + return address; + } + + public void setServiceTime(String serviceTime) + { + this.serviceTime = serviceTime; + } + + public String getServiceTime() + { + return serviceTime; + } + + public void setStatus(String status) + { + this.status = status; + } + + public String getStatus() + { + return status; + } + + public void setDelFlag(String delFlag) + { + this.delFlag = delFlag; + } + + public String getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("title", getTitle()) + .append("content", getContent()) + .append("contactPerson", getContactPerson()) + .append("contactPhone", getContactPhone()) + .append("address", getAddress()) + .append("serviceTime", getServiceTime()) + .append("status", getStatus()) + .append("delFlag", getDelFlag()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/chenhai-system/src/main/java/com/chenhai/system/mapper/SysSlaughterInfoMapper.java b/chenhai-system/src/main/java/com/chenhai/system/mapper/SysSlaughterInfoMapper.java new file mode 100644 index 0000000..1f4adfb --- /dev/null +++ b/chenhai-system/src/main/java/com/chenhai/system/mapper/SysSlaughterInfoMapper.java @@ -0,0 +1,61 @@ +package com.chenhai.system.mapper; + +import java.util.List; +import com.chenhai.system.domain.SysSlaughterInfo; + +/** + * 屠宰信息Mapper接口 + * + * @author ruoyi + * @date 2026-02-03 + */ +public interface SysSlaughterInfoMapper +{ + /** + * 查询屠宰信息 + * + * @param id 屠宰信息主键 + * @return 屠宰信息 + */ + public SysSlaughterInfo selectSysSlaughterInfoById(Long id); + + /** + * 查询屠宰信息列表 + * + * @param sysSlaughterInfo 屠宰信息 + * @return 屠宰信息集合 + */ + public List selectSysSlaughterInfoList(SysSlaughterInfo sysSlaughterInfo); + + /** + * 新增屠宰信息 + * + * @param sysSlaughterInfo 屠宰信息 + * @return 结果 + */ + public int insertSysSlaughterInfo(SysSlaughterInfo sysSlaughterInfo); + + /** + * 修改屠宰信息 + * + * @param sysSlaughterInfo 屠宰信息 + * @return 结果 + */ + public int updateSysSlaughterInfo(SysSlaughterInfo sysSlaughterInfo); + + /** + * 删除屠宰信息 + * + * @param id 屠宰信息主键 + * @return 结果 + */ + public int deleteSysSlaughterInfoById(Long id); + + /** + * 批量删除屠宰信息 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteSysSlaughterInfoByIds(Long[] ids); +} diff --git a/chenhai-system/src/main/java/com/chenhai/system/mapper/SysVacRegistrationMapper.java b/chenhai-system/src/main/java/com/chenhai/system/mapper/SysVacRegistrationMapper.java index d154b4c..19b90e1 100644 --- a/chenhai-system/src/main/java/com/chenhai/system/mapper/SysVacRegistrationMapper.java +++ b/chenhai-system/src/main/java/com/chenhai/system/mapper/SysVacRegistrationMapper.java @@ -58,4 +58,6 @@ public interface SysVacRegistrationMapper * @return 结果 */ public int deleteSysVacRegistrationByIds(Long[] ids); + + } diff --git a/chenhai-system/src/main/java/com/chenhai/system/service/ISysSlaughterInfoService.java b/chenhai-system/src/main/java/com/chenhai/system/service/ISysSlaughterInfoService.java new file mode 100644 index 0000000..5d5db57 --- /dev/null +++ b/chenhai-system/src/main/java/com/chenhai/system/service/ISysSlaughterInfoService.java @@ -0,0 +1,61 @@ +package com.chenhai.system.service; + +import java.util.List; +import com.chenhai.system.domain.SysSlaughterInfo; + +/** + * 屠宰信息Service接口 + * + * @author ruoyi + * @date 2026-02-03 + */ +public interface ISysSlaughterInfoService +{ + /** + * 查询屠宰信息 + * + * @param id 屠宰信息主键 + * @return 屠宰信息 + */ + public SysSlaughterInfo selectSysSlaughterInfoById(Long id); + + /** + * 查询屠宰信息列表 + * + * @param sysSlaughterInfo 屠宰信息 + * @return 屠宰信息集合 + */ + public List selectSysSlaughterInfoList(SysSlaughterInfo sysSlaughterInfo); + + /** + * 新增屠宰信息 + * + * @param sysSlaughterInfo 屠宰信息 + * @return 结果 + */ + public int insertSysSlaughterInfo(SysSlaughterInfo sysSlaughterInfo); + + /** + * 修改屠宰信息 + * + * @param sysSlaughterInfo 屠宰信息 + * @return 结果 + */ + public int updateSysSlaughterInfo(SysSlaughterInfo sysSlaughterInfo); + + /** + * 批量删除屠宰信息 + * + * @param ids 需要删除的屠宰信息主键集合 + * @return 结果 + */ + public int deleteSysSlaughterInfoByIds(Long[] ids); + + /** + * 删除屠宰信息信息 + * + * @param id 屠宰信息主键 + * @return 结果 + */ + public int deleteSysSlaughterInfoById(Long id); +} diff --git a/chenhai-system/src/main/java/com/chenhai/system/service/ISysVacRegistrationService.java b/chenhai-system/src/main/java/com/chenhai/system/service/ISysVacRegistrationService.java index 411b6ec..d9bc192 100644 --- a/chenhai-system/src/main/java/com/chenhai/system/service/ISysVacRegistrationService.java +++ b/chenhai-system/src/main/java/com/chenhai/system/service/ISysVacRegistrationService.java @@ -58,4 +58,30 @@ public interface ISysVacRegistrationService * @return 结果 */ public int deleteSysVacRegistrationById(Long id); + + + + /** + * 确认预约 + * + * @param id 预约ID + * @return 结果 + */ + int confirmRegistration(Long id); + + /** + * 完成预约 + * + * @param id 预约ID + * @return 结果 + */ + int completeRegistration(Long id); + + /** + * 取消预约 + * + * @param id 预约ID + * @return 结果 + */ + int cancelRegistration(Long id); } diff --git a/chenhai-system/src/main/java/com/chenhai/system/service/impl/SysSlaughterInfoServiceImpl.java b/chenhai-system/src/main/java/com/chenhai/system/service/impl/SysSlaughterInfoServiceImpl.java new file mode 100644 index 0000000..73bce06 --- /dev/null +++ b/chenhai-system/src/main/java/com/chenhai/system/service/impl/SysSlaughterInfoServiceImpl.java @@ -0,0 +1,96 @@ +package com.chenhai.system.service.impl; + +import java.util.List; +import com.chenhai.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.chenhai.system.mapper.SysSlaughterInfoMapper; +import com.chenhai.system.domain.SysSlaughterInfo; +import com.chenhai.system.service.ISysSlaughterInfoService; + +/** + * 屠宰信息Service业务层处理 + * + * @author ruoyi + * @date 2026-02-03 + */ +@Service +public class SysSlaughterInfoServiceImpl implements ISysSlaughterInfoService +{ + @Autowired + private SysSlaughterInfoMapper sysSlaughterInfoMapper; + + /** + * 查询屠宰信息 + * + * @param id 屠宰信息主键 + * @return 屠宰信息 + */ + @Override + public SysSlaughterInfo selectSysSlaughterInfoById(Long id) + { + return sysSlaughterInfoMapper.selectSysSlaughterInfoById(id); + } + + /** + * 查询屠宰信息列表 + * + * @param sysSlaughterInfo 屠宰信息 + * @return 屠宰信息 + */ + @Override + public List selectSysSlaughterInfoList(SysSlaughterInfo sysSlaughterInfo) + { + return sysSlaughterInfoMapper.selectSysSlaughterInfoList(sysSlaughterInfo); + } + + /** + * 新增屠宰信息 + * + * @param sysSlaughterInfo 屠宰信息 + * @return 结果 + */ + @Override + public int insertSysSlaughterInfo(SysSlaughterInfo sysSlaughterInfo) + { + sysSlaughterInfo.setCreateTime(DateUtils.getNowDate()); + return sysSlaughterInfoMapper.insertSysSlaughterInfo(sysSlaughterInfo); + } + + /** + * 修改屠宰信息 + * + * @param sysSlaughterInfo 屠宰信息 + * @return 结果 + */ + @Override + public int updateSysSlaughterInfo(SysSlaughterInfo sysSlaughterInfo) + { + sysSlaughterInfo.setUpdateTime(DateUtils.getNowDate()); + return sysSlaughterInfoMapper.updateSysSlaughterInfo(sysSlaughterInfo); + } + + /** + * 批量删除屠宰信息 + * + * @param ids 需要删除的屠宰信息主键 + * @return 结果 + */ + @Override + public int deleteSysSlaughterInfoByIds(Long[] ids) + { + return sysSlaughterInfoMapper.deleteSysSlaughterInfoByIds(ids); + } + + /** + * 删除屠宰信息信息 + * + * @param id 屠宰信息主键 + * @return 结果 + */ + @Override + public int deleteSysSlaughterInfoById(Long id) + { + return sysSlaughterInfoMapper.deleteSysSlaughterInfoById(id); + } +} diff --git a/chenhai-system/src/main/java/com/chenhai/system/service/impl/SysVacRegistrationServiceImpl.java b/chenhai-system/src/main/java/com/chenhai/system/service/impl/SysVacRegistrationServiceImpl.java index 04aff7f..e436d71 100644 --- a/chenhai-system/src/main/java/com/chenhai/system/service/impl/SysVacRegistrationServiceImpl.java +++ b/chenhai-system/src/main/java/com/chenhai/system/service/impl/SysVacRegistrationServiceImpl.java @@ -93,4 +93,73 @@ public class SysVacRegistrationServiceImpl implements ISysVacRegistrationService { return sysVacRegistrationMapper.deleteSysVacRegistrationById(id); } + + /** + * 确认预约 + * + * @param id 预约ID + * @return 结果 + */ + @Override + public int confirmRegistration(Long id) + { + SysVacRegistration registration = sysVacRegistrationMapper.selectSysVacRegistrationById(id); + if (registration == null) { + return 0; + } + // 只能确认待确认状态的预约 + if (registration.getStatus() != 1) { + return 0; + } + registration.setStatus(2); // 已确认 + registration.setConfirmedTime(DateUtils.getNowDate()); // 设置确认时间 + registration.setUpdateTime(DateUtils.getNowDate()); + return sysVacRegistrationMapper.updateSysVacRegistration(registration); + } + + /** + * 完成预约 + * + * @param id 预约ID + * @return 结果 + */ + @Override + public int completeRegistration(Long id) + { + SysVacRegistration registration = sysVacRegistrationMapper.selectSysVacRegistrationById(id); + if (registration == null) { + return 0; + } + // 只能完成已确认状态的预约 + if (registration.getStatus() != 2) { + return 0; + } + registration.setStatus(3); // 已完成 + registration.setCompletedTime(DateUtils.getNowDate()); // 设置完成时间 + registration.setUpdateTime(DateUtils.getNowDate()); + return sysVacRegistrationMapper.updateSysVacRegistration(registration); + } + + /** + * 取消预约 + * + * @param id 预约ID + * @return 结果 + */ + @Override + public int cancelRegistration(Long id) + { + SysVacRegistration registration = sysVacRegistrationMapper.selectSysVacRegistrationById(id); + if (registration == null) { + return 0; + } + // 只能取消待确认或已确认状态的预约 + if (registration.getStatus() != 1 && registration.getStatus() != 2) { + return 0; + } + registration.setStatus(4); // 已取消 + registration.setCancelTime(DateUtils.getNowDate()); // 设置取消时间 + registration.setUpdateTime(DateUtils.getNowDate()); + return sysVacRegistrationMapper.updateSysVacRegistration(registration); + } } diff --git a/chenhai-system/src/main/resources/mapper/system/SysSlaughterInfoMapper.xml b/chenhai-system/src/main/resources/mapper/system/SysSlaughterInfoMapper.xml new file mode 100644 index 0000000..781d6ce --- /dev/null +++ b/chenhai-system/src/main/resources/mapper/system/SysSlaughterInfoMapper.xml @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + select id, title, content, contact_person, contact_phone, address, service_time, status, del_flag, create_by, create_time, update_by, update_time, remark from sys_slaughter_info + + + + + + + + insert into sys_slaughter_info + + title, + content, + contact_person, + contact_phone, + address, + service_time, + status, + del_flag, + create_by, + create_time, + update_by, + update_time, + remark, + + + #{title}, + #{content}, + #{contactPerson}, + #{contactPhone}, + #{address}, + #{serviceTime}, + #{status}, + #{delFlag}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{remark}, + + + + + update sys_slaughter_info + + title = #{title}, + content = #{content}, + contact_person = #{contactPerson}, + contact_phone = #{contactPhone}, + address = #{address}, + service_time = #{serviceTime}, + status = #{status}, + del_flag = #{delFlag}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + + where id = #{id} + + + + delete from sys_slaughter_info where id = #{id} + + + + delete from sys_slaughter_info where id in + + #{id} + + + \ No newline at end of file diff --git a/chenhai-ui/src/api/system/VacRegistration.js b/chenhai-ui/src/api/system/VacRegistration.js index 491cde3..b4c7e95 100644 --- a/chenhai-ui/src/api/system/VacRegistration.js +++ b/chenhai-ui/src/api/system/VacRegistration.js @@ -42,3 +42,27 @@ export function delVacRegistration(id) { method: 'delete' }) } + +// 确认预约 +export function confirmRegistration(id) { + return request({ + url: '/system/VacRegistration/confirm/' + id, + method: 'put' + }) +} + +// 完成预约 +export function completeRegistration(id) { + return request({ + url: '/system/VacRegistration/complete/' + id, + method: 'put' + }) +} + +// 取消预约 +export function cancelRegistration(id) { + return request({ + url: '/system/VacRegistration/cancel/' + id, + method: 'put' + }) +} diff --git a/chenhai-ui/src/api/system/slaughterInfo.js b/chenhai-ui/src/api/system/slaughterInfo.js new file mode 100644 index 0000000..3346260 --- /dev/null +++ b/chenhai-ui/src/api/system/slaughterInfo.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询屠宰信息列表 +export function listSlaughterInfo(query) { + return request({ + url: '/system/slaughterInfo/list', + method: 'get', + params: query + }) +} + +// 查询屠宰信息详细 +export function getSlaughterInfo(id) { + return request({ + url: '/system/slaughterInfo/' + id, + method: 'get' + }) +} + +// 新增屠宰信息 +export function addSlaughterInfo(data) { + return request({ + url: '/system/slaughterInfo', + method: 'post', + data: data + }) +} + +// 修改屠宰信息 +export function updateSlaughterInfo(data) { + return request({ + url: '/system/slaughterInfo', + method: 'put', + data: data + }) +} + +// 删除屠宰信息 +export function delSlaughterInfo(id) { + return request({ + url: '/system/slaughterInfo/' + id, + method: 'delete' + }) +} diff --git a/chenhai-ui/src/assets/icons/svg/slaughter.svg b/chenhai-ui/src/assets/icons/svg/slaughter.svg new file mode 100644 index 0000000..f8f49a7 --- /dev/null +++ b/chenhai-ui/src/assets/icons/svg/slaughter.svg @@ -0,0 +1 @@ + diff --git a/chenhai-ui/src/views/system/VacRegistration/index.vue b/chenhai-ui/src/views/system/VacRegistration/index.vue index 266696a..288405f 100644 --- a/chenhai-ui/src/views/system/VacRegistration/index.vue +++ b/chenhai-ui/src/views/system/VacRegistration/index.vue @@ -1,22 +1,22 @@ + + diff --git a/pom.xml b/pom.xml index 44c102e..6789cd5 100644 --- a/pom.xml +++ b/pom.xml @@ -35,6 +35,8 @@ 2.3.1 6.0.0 2.8.14 + 0.23.0 + 5.12.2 @@ -193,6 +195,19 @@ ${chenhai.version} + + com.github.houbb + sensitive-word + ${sensitive-word.version} + + + + org.junit.jupiter + junit-jupiter-engine + ${jupiter.version} + + +