diff --git a/chenhai-admin/src/main/java/com/chenhai/web/controller/system/SysVetAuditController.java b/chenhai-admin/src/main/java/com/chenhai/web/controller/system/SysVetAuditController.java new file mode 100644 index 0000000..8de05e2 --- /dev/null +++ b/chenhai-admin/src/main/java/com/chenhai/web/controller/system/SysVetAuditController.java @@ -0,0 +1,113 @@ +package com.chenhai.web.controller.system; + +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.SecurityUtils; +import com.chenhai.common.utils.poi.ExcelUtil; +import com.chenhai.vet.domain.VetPersonalInfo; +import com.chenhai.vet.domain.VetQualification; +import com.chenhai.vet.service.IVetPersonalInfoService; +import com.chenhai.vet.service.IVetQualificationService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import jakarta.servlet.http.HttpServletResponse; + +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 兽医信息审核管理Controller + * 专门用于管理后台的兽医信息审核功能 + */ +@RestController +@RequestMapping("/sys/vet/audit") +public class SysVetAuditController extends BaseController +{ + @Autowired + private IVetPersonalInfoService vetPersonalInfoService; + + @Autowired + private IVetQualificationService vetQualificationService; + + /** + * 查询兽医信息列表(审核管理专用) + */ + @PreAuthorize("@ss.hasPermi('sys:vetAudit:list')") + @GetMapping("/list") + public TableDataInfo list(VetPersonalInfo vetPersonalInfo) + { + startPage(); + List list = vetPersonalInfoService.selectVetPersonalInfoList(vetPersonalInfo); + return getDataTable(list); + } + + /** + * 获取兽医完整审核信息(包含证书详情) + */ + @PreAuthorize("@ss.hasPermi('sys:vetAudit:view')") + @GetMapping("/full/{id}") + public AjaxResult getAuditFullInfo(@PathVariable("id") Long id) + { + Map fullInfo = vetPersonalInfoService.getVetFullInfoWithQualifications(id); + if (fullInfo == null || fullInfo.isEmpty()) { + return AjaxResult.error("兽医信息不存在"); + } + return AjaxResult.success(fullInfo); + } + + /** + * 获取兽医个人信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('sys:vetAudit:userInfo')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(vetPersonalInfoService.selectVetPersonalInfoById(id)); + } + + /** + * 兽医个人信息审核 + */ + @Log(title = "兽医信息审核", businessType = BusinessType.UPDATE) + @PreAuthorize("@ss.hasPermi('sys:vetAudit:auditVetPersonalInfo')") + @PostMapping("/auditVetPersonalInfo") + public AjaxResult auditVetPersonalInfo(@RequestBody VetPersonalInfo vetPersonalInfo) + { + return toAjax(vetPersonalInfoService.auditVetPersonalInfo(vetPersonalInfo)); + } + + /** + * 查询兽医资质列表(含证书信息) + */ + @PreAuthorize("@ss.hasPermi('vet:qualification:list')") + @GetMapping("/listQualification") + public TableDataInfo listQualification(VetQualification vetQualification) + { + startPage(); + Long userId = SecurityUtils.getUserId(); + if (!SecurityUtils.isAdmin(userId)) { + vetQualification.setUserId(userId); + } + List list = vetQualificationService.selectVetQualificationList(vetQualification); + return getDataTable(list); + } + + /** + * 资质证书审核接口 + */ + @Log(title = "兽医资质证书审核", businessType = BusinessType.UPDATE) + @PreAuthorize("@ss.hasPermi('sys:vetAudit:qualificationAudit')") + @PostMapping("/qualificationAudit") + public AjaxResult qualificationAudit(@RequestBody VetQualification vetQualification) { + vetQualification.setAuditTime(new Date()); + return toAjax(vetQualificationService.updateVetQualification(vetQualification)); + } + +} \ No newline at end of file diff --git a/chenhai-system/src/main/java/com/chenhai/vet/domain/VetPersonalInfo.java b/chenhai-system/src/main/java/com/chenhai/vet/domain/VetPersonalInfo.java index 0e34191..0b6f76e 100644 --- a/chenhai-system/src/main/java/com/chenhai/vet/domain/VetPersonalInfo.java +++ b/chenhai-system/src/main/java/com/chenhai/vet/domain/VetPersonalInfo.java @@ -90,6 +90,23 @@ public class VetPersonalInfo extends BaseEntity @Excel(name = "用户昵称") private String nickName; + /** 审核状态 */ + @Excel(name = "审核状态") + private String auditStatus; + + /** 审核人 */ + @Excel(name = "审核人") + private String auditor; + + /** 审核时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "审核时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date auditTime; + + /** 审核描述 */ + @Excel(name = "审核描述") + private String auditDesc; + // 添加getter和setter public void setId(Long id) { @@ -269,6 +286,38 @@ public class VetPersonalInfo extends BaseEntity this.user = user; } + public String getAuditStatus() { + return auditStatus; + } + + public void setAuditStatus(String auditStatus) { + this.auditStatus = auditStatus; + } + + public String getAuditor() { + return auditor; + } + + public void setAuditor(String auditor) { + this.auditor = auditor; + } + + public Date getAuditTime() { + return auditTime; + } + + public void setAuditTime(Date auditTime) { + this.auditTime = auditTime; + } + + public String getAuditDesc() { + return auditDesc; + } + + public void setAuditDesc(String auditDesc) { + this.auditDesc = auditDesc; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/chenhai-system/src/main/java/com/chenhai/vet/mapper/VetPersonalInfoMapper.java b/chenhai-system/src/main/java/com/chenhai/vet/mapper/VetPersonalInfoMapper.java index 56e4b66..010d3bc 100644 --- a/chenhai-system/src/main/java/com/chenhai/vet/mapper/VetPersonalInfoMapper.java +++ b/chenhai-system/src/main/java/com/chenhai/vet/mapper/VetPersonalInfoMapper.java @@ -43,6 +43,14 @@ public interface VetPersonalInfoMapper */ public int updateVetPersonalInfo(VetPersonalInfo vetPersonalInfo); + /** + * 审核兽医个人信息 + * + * @param vetPersonalInfo 兽医个人信息 + * @return 结果 + */ + public int auditVetPersonalInfo(VetPersonalInfo vetPersonalInfo); + /** * 删除兽医个人信息 * diff --git a/chenhai-system/src/main/java/com/chenhai/vet/service/IVetPersonalInfoService.java b/chenhai-system/src/main/java/com/chenhai/vet/service/IVetPersonalInfoService.java index f480397..648af95 100644 --- a/chenhai-system/src/main/java/com/chenhai/vet/service/IVetPersonalInfoService.java +++ b/chenhai-system/src/main/java/com/chenhai/vet/service/IVetPersonalInfoService.java @@ -45,6 +45,8 @@ public interface IVetPersonalInfoService */ public int updateVetPersonalInfo(VetPersonalInfo vetPersonalInfo); + public int auditVetPersonalInfo(VetPersonalInfo vetPersonalInfo); + /** * 批量删除兽医个人信息 * @@ -79,8 +81,4 @@ public interface IVetPersonalInfoService Map getVetFullInfoWithQualifications(Long id); Map getVetFullInfoWithQualificationsByUserId(Long userId); - - - - } diff --git a/chenhai-system/src/main/java/com/chenhai/vet/service/impl/VetPersonalInfoServiceImpl.java b/chenhai-system/src/main/java/com/chenhai/vet/service/impl/VetPersonalInfoServiceImpl.java index 67a1e31..224a5a3 100644 --- a/chenhai-system/src/main/java/com/chenhai/vet/service/impl/VetPersonalInfoServiceImpl.java +++ b/chenhai-system/src/main/java/com/chenhai/vet/service/impl/VetPersonalInfoServiceImpl.java @@ -198,6 +198,11 @@ public class VetPersonalInfoServiceImpl implements IVetPersonalInfoService { } } + @Override + public int auditVetPersonalInfo(VetPersonalInfo vetPersonalInfo) { + return vetPersonalInfoMapper.auditVetPersonalInfo(vetPersonalInfo); + } + /** * 根据用户ID查询兽医个人信息 */ diff --git a/chenhai-system/src/main/resources/mapper/vet/VetPersonalInfoMapper.xml b/chenhai-system/src/main/resources/mapper/vet/VetPersonalInfoMapper.xml index 0560802..db373c2 100644 --- a/chenhai-system/src/main/resources/mapper/vet/VetPersonalInfoMapper.xml +++ b/chenhai-system/src/main/resources/mapper/vet/VetPersonalInfoMapper.xml @@ -27,6 +27,10 @@ + + + + @@ -50,6 +54,7 @@ v.id, v.user_id, v.real_name, v.gender, v.birthday, v.id_card, v.specialty, v.work_experience, v.hospital, v.address, v.iphone, v.introduction, v.title, v.phone, v.expert_type, v.email, v.nick_name, v.create_by, v.create_time, v.update_by, v.update_time, + v.audit_status, v.audit_time, v.auditor, v.audit_desc, u.user_id as u_user_id, u.nick_name as u_nick_name, u.email as u_email @@ -183,6 +188,18 @@ where id = #{id} + + UPDATE vet_personal_info + + audit_status = #{auditStatus}, + auditor = #{auditor}, + audit_time = #{auditTime}, + audit_desc = #{auditDesc}, + update_time = sysdate() + + WHERE id = #{id} + + delete from vet_personal_info where id = #{id} diff --git a/chenhai-ui/src/api/system/vetAduit.js b/chenhai-ui/src/api/system/vetAduit.js new file mode 100644 index 0000000..5bcd36d --- /dev/null +++ b/chenhai-ui/src/api/system/vetAduit.js @@ -0,0 +1,53 @@ +import request from '@/utils/request' + +// 查询兽医个人信息列表 +export function listInfo(query) { + return request({ + url: '/sys/vet/audit/list', + method: 'get', + params: query + }) +} + +// 查询兽医个人信息详细 +export function getInfo(id) { + return request({ + url: '/sys/vet/audit/' + id, + method: 'get' + }) +} + +// 兽医个人信息详情 +export function getfull(id) { + return request({ + url: '/sys/vet/audit/full/' + id, + method: 'get' + }) +} + +// 基本信息审核 +export function auditBasicInfo(data) { + return request({ + url: '/sys/vet/audit/auditVetPersonalInfo', + method: 'post', + data: data + }) +} + +// 查询兽医资质证书列表 +export function listQualification(query) { + return request({ + url: '/sys/vet/audit/listQualification', + method: 'get', + params: query + }) +} + +// 资质证书审核 +export function auditCertificate(data) { + return request({ + url: '/sys/vet/audit/qualificationAudit', + method: 'post', + data: data + }) +} diff --git a/chenhai-ui/src/views/system/vet/aduit/index.vue b/chenhai-ui/src/views/system/vet/aduit/index.vue new file mode 100644 index 0000000..fb56f14 --- /dev/null +++ b/chenhai-ui/src/views/system/vet/aduit/index.vue @@ -0,0 +1,1441 @@ + + + + +