12 changed files with 2875 additions and 461 deletions
-
31chenhai-admin/src/main/java/com/chenhai/web/controller/muhu/MuhuUserController.java
-
510chenhai-admin/src/main/java/com/chenhai/web/controller/vet/VetUnifiedInfoController.java
-
184chenhai-system/src/main/java/com/chenhai/system/service/impl/SysMuhuUserServiceImpl.java
-
673chenhai-system/src/main/java/com/chenhai/vet/domain/dto/VetUnifiedInfoDTO.java
-
1chenhai-system/src/main/java/com/chenhai/vet/mapper/VetQualificationMapper.java
-
52chenhai-system/src/main/java/com/chenhai/vet/service/IVetUnifiedInfoService.java
-
1179chenhai-system/src/main/java/com/chenhai/vet/service/impl/VetUnifiedInfoServiceImpl.java
-
8chenhai-ui/src/api/system/user.js
-
52chenhai-ui/src/views/syd.vue
-
638chenhai-ui/src/views/vet/qualification/index.vue
@ -0,0 +1,510 @@ |
|||
package com.chenhai.web.controller.vet; |
|||
|
|||
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.domain.entity.SysRole; |
|||
import com.chenhai.common.core.domain.model.LoginUser; |
|||
import com.chenhai.common.core.page.TableDataInfo; |
|||
import com.chenhai.common.enums.BusinessType; |
|||
import com.chenhai.common.utils.SecurityUtils; |
|||
import com.chenhai.common.utils.StringUtils; |
|||
import com.chenhai.vet.domain.VetPersonalInfo; |
|||
import com.chenhai.vet.domain.dto.VetUnifiedInfoDTO; |
|||
import com.chenhai.vet.service.IVetPersonalInfoService; |
|||
import com.chenhai.vet.service.IVetUnifiedInfoService; |
|||
import org.slf4j.Logger; |
|||
import org.slf4j.LoggerFactory; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.Set; |
|||
|
|||
/** |
|||
* 兽医统一信息Controller |
|||
* 整合PC端和小程序的所有接口 |
|||
* 遵循RESTful API设计规范 |
|||
* |
|||
* RESTful接口列表: |
|||
* 1. GET /vet/unified/info - 获取当前用户完整信息 |
|||
* 2. GET /vet/unified/{userId} - 获取指定用户信息 |
|||
* 3. POST /vet/unified - 新增兽医信息 |
|||
* 4. PUT /vet/unified - 全量更新兽医信息 |
|||
* 5. PATCH /vet/unified/{userId} - 部分更新兽医信息 |
|||
* 6. POST /vet/unified/submitAudit - 提交审核 |
|||
* 7. GET /vet/unified/statistics - 获取统计信息 |
|||
* 8. GET /vet/unified/checkNeed - 检查是否需要填写 |
|||
* 9. GET /vet/unified/list - 分页查询列表(管理员) |
|||
* 10. POST /vet/unified/audit - 审核兽医信息(管理员) |
|||
* |
|||
* 已废弃接口(保留向后兼容): |
|||
* - GET /vet/unified/info/{userId} - 请使用 GET /vet/unified/{userId} |
|||
* - POST /vet/unified/save - 请根据情况使用 POST /vet/unified 或 PUT /vet/unified/{userId} |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/vet/unified") |
|||
public class VetUnifiedInfoController extends BaseController { |
|||
|
|||
private static final Logger log = LoggerFactory.getLogger(VetUnifiedInfoController.class); |
|||
|
|||
@Autowired |
|||
private IVetUnifiedInfoService vetUnifiedInfoService; |
|||
|
|||
@Autowired |
|||
private IVetPersonalInfoService vetPersonalInfoService; |
|||
|
|||
// ==================== 新RESTful接口 ==================== |
|||
|
|||
/** |
|||
* 获取当前登录用户的完整信息 |
|||
* GET /vet/unified/info |
|||
* |
|||
* 替代:/muhu/user/getUserInfo 和 /vet/info/current |
|||
*/ |
|||
@PreAuthorize("@ss.hasRole('muhu') or @ss.hasRole('vet')") |
|||
@GetMapping("/info") |
|||
public AjaxResult getCurrentUserInfo() { |
|||
try { |
|||
Long userId = SecurityUtils.getUserId(); |
|||
if (userId == null) { |
|||
return error("用户未登录"); |
|||
} |
|||
|
|||
VetUnifiedInfoDTO unifiedInfo = vetUnifiedInfoService.getCurrentUserInfo(); |
|||
return success(unifiedInfo); |
|||
|
|||
} catch (Exception e) { |
|||
log.error("获取用户信息失败", e); |
|||
return error("获取用户信息失败: " + e.getMessage()); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 根据用户ID获取信息(RESTful风格) |
|||
* GET /vet/unified/{userId} |
|||
* |
|||
* 替代:/sys/vet/audit/full/{id} 和 /vet/info/full/{id} |
|||
*/ |
|||
@GetMapping("/{userId}") |
|||
@PreAuthorize("@ss.hasPermi('sys:vetAudit:view') or @ss.hasRole('muhu') or @ss.hasRole('vet') or @ss.hasRole('vetnotshenhe')") |
|||
public AjaxResult getUserInfo(@PathVariable Long userId) { |
|||
try { |
|||
// 权限验证:非管理员只能查看自己的信息 |
|||
Long currentUserId = SecurityUtils.getUserId(); |
|||
if (!SecurityUtils.isAdmin(currentUserId) && !currentUserId.equals(userId)) { |
|||
return error("无权查看他人信息"); |
|||
} |
|||
|
|||
VetUnifiedInfoDTO unifiedInfo = vetUnifiedInfoService.getUserInfoByUserId(userId); |
|||
if (unifiedInfo == null) { |
|||
return error("用户信息不存在"); |
|||
} |
|||
return success(unifiedInfo); |
|||
} catch (Exception e) { |
|||
log.error("获取用户信息失败", e); |
|||
return error("获取用户信息失败: " + e.getMessage()); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 新增兽医信息 |
|||
* POST /vet/unified |
|||
* |
|||
* 替代:/vet/qualification/submit (新增部分) 和 /vet/info/add |
|||
*/ |
|||
@PreAuthorize("@ss.hasRole('muhu') or @ss.hasRole('vet') or @ss.hasRole('vetnotshenhe')") |
|||
@PostMapping |
|||
@Log(title = "兽医信息", businessType = BusinessType.INSERT) |
|||
public AjaxResult createVetInfo(@RequestBody VetUnifiedInfoDTO vetInfo) { |
|||
try { |
|||
Long userId = SecurityUtils.getUserId(); |
|||
if (userId == null) { |
|||
return error("用户未登录"); |
|||
} |
|||
|
|||
// 检查是否已存在 |
|||
VetPersonalInfo existing = vetPersonalInfoService.selectVetPersonalInfoByUserId(userId); |
|||
if (existing != null) { |
|||
return error("兽医信息已存在,请使用更新接口"); |
|||
} |
|||
|
|||
// 设置用户ID |
|||
vetInfo.setUserId(userId); |
|||
|
|||
// 转换为Map调用service |
|||
Map<String, Object> requestData = convertDtoToMap(vetInfo); |
|||
|
|||
VetUnifiedInfoDTO result = vetUnifiedInfoService.saveVetInfo(requestData); |
|||
return AjaxResult.success("创建成功", result); |
|||
|
|||
} catch (Exception e) { |
|||
log.error("创建兽医信息失败", e); |
|||
return error("创建失败: " + e.getMessage()); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 全量更新兽医信息 |
|||
* PUT /vet/unified/{userId} |
|||
* |
|||
* 替代:/vet/qualification/submit (修改部分) 和 /vet/info/edit |
|||
*/ |
|||
@PutMapping |
|||
@PreAuthorize("@ss.hasRole('muhu') or @ss.hasRole('vet') or @ss.hasRole('vetnotshenhe')") |
|||
@Log(title = "兽医信息", businessType = BusinessType.UPDATE) |
|||
public AjaxResult updateCurrentUserVetInfo(@RequestBody VetUnifiedInfoDTO vetInfo) { |
|||
try { |
|||
Long currentUserId = SecurityUtils.getUserId(); |
|||
if (currentUserId == null) { |
|||
return error("用户未登录"); |
|||
} |
|||
|
|||
log.info("更新兽医信息 - userId: {}, data: {}", currentUserId, vetInfo); |
|||
|
|||
// 检查记录是否存在 |
|||
VetPersonalInfo existing = vetPersonalInfoService.selectVetPersonalInfoByUserId(currentUserId); |
|||
if (existing == null) { |
|||
return error("兽医信息不存在,请先创建"); |
|||
} |
|||
|
|||
// 设置用户ID |
|||
vetInfo.setUserId(currentUserId); |
|||
vetInfo.setPersonalInfoId(existing.getId()); |
|||
|
|||
// 转换为Map调用service |
|||
Map<String, Object> requestData = convertDtoToMap(vetInfo); |
|||
requestData.put("personalInfoId", existing.getId()); |
|||
requestData.put("id", existing.getId()); |
|||
|
|||
// 调用保存方法 |
|||
vetUnifiedInfoService.saveVetInfo(requestData); |
|||
|
|||
// 重新查询最新数据 |
|||
VetUnifiedInfoDTO result = vetUnifiedInfoService.getCurrentUserInfo(); |
|||
|
|||
log.info("更新成功 - userId: {}, result: {}", currentUserId, result); |
|||
return AjaxResult.success("更新成功", result); |
|||
|
|||
} catch (Exception e) { |
|||
log.error("更新兽医信息失败", e); |
|||
return error("更新失败: " + e.getMessage()); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 部分更新兽医信息 |
|||
* PATCH /vet/unified/{userId} |
|||
* 支持只提交需要修改的字段 |
|||
*/ |
|||
@PatchMapping("/{userId}") |
|||
@PreAuthorize("@ss.hasRole('muhu') or @ss.hasRole('vet') or @ss.hasRole('vetnotshenhe')") |
|||
@Log(title = "兽医信息", businessType = BusinessType.UPDATE) |
|||
public AjaxResult partialUpdateVetInfo(@PathVariable Long userId, @RequestBody Map<String, Object> updates) { |
|||
try { |
|||
Long currentUserId = SecurityUtils.getUserId(); |
|||
if (currentUserId == null) { |
|||
return error("用户未登录"); |
|||
} |
|||
|
|||
// 权限验证:只能修改自己的信息 |
|||
if (!currentUserId.equals(userId)) { |
|||
return error("无权修改他人信息"); |
|||
} |
|||
|
|||
// 检查记录是否存在 |
|||
VetPersonalInfo existing = vetPersonalInfoService.selectVetPersonalInfoByUserId(userId); |
|||
if (existing == null) { |
|||
return error("兽医信息不存在,请先创建"); |
|||
} |
|||
|
|||
// 添加必要的ID信息 |
|||
updates.put("userId", userId); |
|||
updates.put("personalInfoId", existing.getId()); |
|||
|
|||
VetUnifiedInfoDTO result = vetUnifiedInfoService.saveVetInfo(updates); |
|||
return AjaxResult.success("更新成功", result); |
|||
|
|||
} catch (Exception e) { |
|||
log.error("更新兽医信息失败", e); |
|||
return error("更新失败: " + e.getMessage()); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 提交审核 |
|||
* POST /vet/unified/submitAudit |
|||
* |
|||
* 替代:/vet/qualification/submit 中的审核提交部分 |
|||
*/ |
|||
@PreAuthorize("@ss.hasRole('muhu') or @ss.hasRole('vet') or @ss.hasRole('vetnotshenhe')") |
|||
@PostMapping("/submitAudit") |
|||
@Log(title = "兽医资质", businessType = BusinessType.OTHER) |
|||
public AjaxResult submitForAudit(@RequestBody(required = false) Map<String, Object> requestData) { |
|||
try { |
|||
Long userId = SecurityUtils.getUserId(); |
|||
if (userId == null) { |
|||
return error("用户未登录"); |
|||
} |
|||
|
|||
log.info("保存并提交审核 - userId: {}", userId); |
|||
|
|||
// 如果有数据,先保存 |
|||
if (requestData != null && !requestData.isEmpty()) { |
|||
// 检查是否需要添加personalInfoId |
|||
if (!requestData.containsKey("personalInfoId") && !requestData.containsKey("id")) { |
|||
VetPersonalInfo existing = vetPersonalInfoService.selectVetPersonalInfoByUserId(userId); |
|||
if (existing != null) { |
|||
requestData.put("personalInfoId", existing.getId()); |
|||
} |
|||
} |
|||
vetUnifiedInfoService.saveVetInfo(requestData); |
|||
} |
|||
|
|||
// 调用提交审核接口 |
|||
boolean submitSuccess = vetUnifiedInfoService.submitForAudit(userId); |
|||
|
|||
if (submitSuccess) { |
|||
return AjaxResult.success("提交审核成功"); |
|||
} else { |
|||
return AjaxResult.warn("提交审核失败,请稍后重试"); |
|||
} |
|||
|
|||
} catch (Exception e) { |
|||
log.error("提交审核失败", e); |
|||
return error("操作失败: " + e.getMessage()); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 获取信息统计 |
|||
* GET /vet/unified/statistics |
|||
* |
|||
* 替代:/vet/qualification/statistics/{userId} |
|||
*/ |
|||
@PreAuthorize("@ss.hasRole('muhu') or @ss.hasRole('vet')") |
|||
@GetMapping("/statistics") |
|||
public AjaxResult getStatistics() { |
|||
try { |
|||
Long userId = SecurityUtils.getUserId(); |
|||
if (userId == null) { |
|||
return error("用户未登录"); |
|||
} |
|||
|
|||
Map<String, Object> statistics = vetUnifiedInfoService.getStatistics(userId); |
|||
return success(statistics); |
|||
|
|||
} catch (Exception e) { |
|||
log.error("获取统计信息失败", e); |
|||
return error("获取失败: " + e.getMessage()); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 检查是否需要填写资质(登录后调用) |
|||
* GET /vet/unified/checkNeed |
|||
* |
|||
* 替代:/vet/qualification/checkNeedQualification |
|||
*/ |
|||
@PreAuthorize("@ss.hasRole('muhu') or @ss.hasRole('vet') or @ss.hasRole('vetnotshenhe')") |
|||
@GetMapping("/checkNeed") |
|||
public AjaxResult checkNeedQualification() { |
|||
try { |
|||
Long userId = SecurityUtils.getUserId(); |
|||
if (userId == null) { |
|||
return error("用户未登录"); |
|||
} |
|||
|
|||
Map<String, Object> result = vetUnifiedInfoService.checkNeedQualification(userId); |
|||
return success(result); |
|||
|
|||
} catch (Exception e) { |
|||
log.error("检查资质需求失败", e); |
|||
return error("检查失败: " + e.getMessage()); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 分页查询兽医信息列表(管理员用) |
|||
* GET /vet/unified/list |
|||
* |
|||
* 替代:/sys/vet/audit/list 和 /vet/info/list |
|||
*/ |
|||
@GetMapping("/list") |
|||
@PreAuthorize("@ss.hasPermi('sys:vetAudit:list') or @ss.hasRole('muhu') or @ss.hasRole('manger') or @ss.hasRole('vet') or @ss.hasRole('vetnotshenhe')") |
|||
public TableDataInfo list(VetUnifiedInfoDTO query) { |
|||
startPage(); |
|||
|
|||
// 获取当前登录用户 |
|||
LoginUser loginUser = SecurityUtils.getLoginUser(); |
|||
|
|||
// 判断是否是管理员(muhu 或 manger) |
|||
boolean isAdmin = false; |
|||
if (loginUser != null && loginUser.getUser() != null) { |
|||
List<SysRole> roles = loginUser.getUser().getRoles(); |
|||
for (SysRole role : roles) { |
|||
String roleKey = role.getRoleKey(); |
|||
if ("muhu".equals(roleKey) || "manger".equals(roleKey)) { |
|||
isAdmin = true; |
|||
break; |
|||
} |
|||
} |
|||
} |
|||
|
|||
// 如果不是管理员,只能看自己的数据 |
|||
if (!isAdmin) { |
|||
if (query == null) { |
|||
query = new VetUnifiedInfoDTO(); |
|||
} |
|||
query.setUserId(SecurityUtils.getUserId()); |
|||
log.debug("普通用户查询自己的信息 - userId: {}", SecurityUtils.getUserId()); |
|||
} else { |
|||
log.debug("管理员查询所有信息"); |
|||
} |
|||
|
|||
List<VetUnifiedInfoDTO> list = vetUnifiedInfoService.listVetInfo(query); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
/** |
|||
* 审核兽医信息(管理员用) |
|||
* POST /vet/unified/audit |
|||
* |
|||
* 替代:/sys/vet/audit/qualificationAudit |
|||
*/ |
|||
@PostMapping("/audit") |
|||
@PreAuthorize("@ss.hasPermi('sys:vetAudit:audit') or @ss.hasRole('muhu')") |
|||
@Log(title = "兽医审核", businessType = BusinessType.UPDATE) |
|||
public AjaxResult auditVetInfo(@RequestBody Map<String, Object> auditData) { |
|||
try { |
|||
Long userId = getAuditUserId(auditData); |
|||
String auditStatus = (String) auditData.get("auditStatus"); |
|||
String auditOpinion = (String) auditData.get("auditOpinion"); |
|||
Long auditorId = SecurityUtils.getUserId(); |
|||
|
|||
if (userId == null || StringUtils.isEmpty(auditStatus)) { |
|||
return error("用户ID和审核状态不能为空"); |
|||
} |
|||
|
|||
boolean success = vetUnifiedInfoService.auditVetInfo(userId, auditStatus, auditOpinion, auditorId); |
|||
if (success) { |
|||
return success("审核成功"); |
|||
} else { |
|||
return error("审核失败"); |
|||
} |
|||
|
|||
} catch (Exception e) { |
|||
log.error("审核失败", e); |
|||
return error("审核失败: " + e.getMessage()); |
|||
} |
|||
} |
|||
|
|||
// ==================== 已废弃接口(保留向后兼容) ==================== |
|||
|
|||
// /** |
|||
// * 已废弃:根据用户ID获取信息 |
|||
// * 请使用 GET /vet/unified/{userId} |
|||
// */ |
|||
// @Deprecated |
|||
// @GetMapping("/info/{userId}") |
|||
// @PreAuthorize("@ss.hasPermi('sys:vetAudit:view') or @ss.hasRole('muhu') or @ss.hasRole('vet')") |
|||
// public AjaxResult getUserInfoByUserId(@PathVariable Long userId) { |
|||
// log.warn("调用已废弃接口 /vet/unified/info/{},请改用 /vet/unified/{}", userId, userId); |
|||
// return getUserInfo(userId); // 调用新接口 |
|||
// } |
|||
|
|||
// /** |
|||
// * 已废弃:保存/更新兽医信息 |
|||
// * 请根据情况使用 POST /vet/unified 或 PUT /vet/unified/{userId} |
|||
// */ |
|||
// @Deprecated |
|||
// @PostMapping("/save") |
|||
// @PreAuthorize("@ss.hasRole('muhu') or @ss.hasRole('vet') or @ss.hasRole('vetnotshenhe')") |
|||
// @Log(title = "兽医信息", businessType = BusinessType.UPDATE) |
|||
// public AjaxResult saveVetInfo(@RequestBody Map<String, Object> requestData) { |
|||
// log.warn("调用已废弃接口 /vet/unified/save,请根据情况使用 POST /vet/unified 或 PUT /vet/unified/{userId}"); |
|||
// |
|||
// try { |
|||
// Long userId = SecurityUtils.getUserId(); |
|||
// if (userId == null) { |
|||
// return error("用户未登录"); |
|||
// } |
|||
// |
|||
// log.info("保存兽医信息 - userId: {}, data: {}", userId, requestData); |
|||
// |
|||
// // 从请求中获取 id(如果有) |
|||
// Long targetId = null; |
|||
// if (requestData.containsKey("id")) { |
|||
// Object idObj = requestData.get("id"); |
|||
// if (idObj instanceof Number) { |
|||
// targetId = ((Number) idObj).longValue(); |
|||
// } else if (idObj instanceof String) { |
|||
// try { |
|||
// targetId = Long.parseLong((String) idObj); |
|||
// } catch (NumberFormatException e) { |
|||
// return error("ID格式不正确"); |
|||
// } |
|||
// } |
|||
// } |
|||
// |
|||
// // 如果传了ID,验证该记录是否属于当前用户 |
|||
// if (targetId != null && targetId > 0) { |
|||
// VetPersonalInfo existingInfo = vetPersonalInfoService.selectVetPersonalInfoById(targetId); |
|||
// if (existingInfo == null) { |
|||
// return error("记录不存在"); |
|||
// } |
|||
// // 验证所有权:只能修改自己的信息 |
|||
// if (!existingInfo.getUserId().equals(userId)) { |
|||
// return error("无权修改他人的信息"); |
|||
// } |
|||
// // 将ID放入requestData,确保service层能获取到 |
|||
// requestData.put("personalInfoId", targetId); |
|||
// } |
|||
// |
|||
// VetUnifiedInfoDTO result = vetUnifiedInfoService.saveVetInfo(requestData); |
|||
// return AjaxResult.success("保存成功", result); |
|||
// |
|||
// } catch (Exception e) { |
|||
// log.error("保存兽医信息失败", e); |
|||
// return error("保存失败: " + e.getMessage()); |
|||
// } |
|||
// } |
|||
|
|||
// ==================== 私有辅助方法 ==================== |
|||
|
|||
/** |
|||
* 从请求数据中获取用户ID |
|||
*/ |
|||
private Long getAuditUserId(Map<String, Object> auditData) { |
|||
Object userIdObj = auditData.get("userId"); |
|||
if (userIdObj == null) { |
|||
userIdObj = auditData.get("id"); |
|||
} |
|||
if (userIdObj == null) { |
|||
userIdObj = auditData.get("personalInfoId"); |
|||
} |
|||
|
|||
if (userIdObj instanceof Number) { |
|||
return ((Number) userIdObj).longValue(); |
|||
} else if (userIdObj instanceof String) { |
|||
try { |
|||
return Long.parseLong((String) userIdObj); |
|||
} catch (NumberFormatException e) { |
|||
return null; |
|||
} |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
/** |
|||
* 将DTO对象转换为Map |
|||
*/ |
|||
private Map<String, Object> convertDtoToMap(VetUnifiedInfoDTO dto) { |
|||
// 这里可以使用ObjectMapper,或者手动转换 |
|||
// 简单起见,这里假设service层能直接处理DTO |
|||
// 实际项目中可以使用JSON工具转换 |
|||
return (Map<String, Object>) com.alibaba.fastjson.JSON.toJSON(dto); |
|||
} |
|||
} |
|||
@ -0,0 +1,673 @@ |
|||
package com.chenhai.vet.domain.dto; |
|||
|
|||
import com.chenhai.common.annotation.Excel; |
|||
import com.chenhai.vet.domain.VetQualification; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 兽医统一信息DTO |
|||
* 整合 VetPersonalInfo 和 VetQualification 的所有字段 |
|||
*/ |
|||
public class VetUnifiedInfoDTO { |
|||
|
|||
// ========== 用户基本信息 (来自SysUser) ========== |
|||
private Long userId; |
|||
private String userName; |
|||
private String nickName; |
|||
private String phonenumber; |
|||
private String email; |
|||
private String avatar; |
|||
private String userType; |
|||
private String areaCode; |
|||
private String status; |
|||
private Date loginDate; |
|||
|
|||
// ========== 兽医个人信息 (来自VetPersonalInfo) ========== |
|||
private Long personalInfoId; // 对应 VetPersonalInfo.id |
|||
private String realName; // 真实姓名 |
|||
private String gender; // 性别(0男 1女) |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
private Date birthday; // 出生日期 |
|||
private String idCard; // 身份证号 |
|||
private String specialty; // 擅长领域 |
|||
private String workExperience; // 工作经验 |
|||
private String hospital; // 所属医院 |
|||
private String address; // 联系地址 |
|||
private String iphone; // 联系方式 |
|||
private String introduction; // 个人简介 |
|||
private String title; // 职称 |
|||
private String phone; // 手机号 |
|||
private String expertType; // 专家类型 |
|||
private String personalEmail; // 电子邮件地址(兽医表) |
|||
private String personalNickName; // 用户昵称(兽医表) |
|||
|
|||
// ========== 兽医资质信息 (来自VetQualification) ========== |
|||
private Long qualificationId; // 资质ID |
|||
private String qualificationType; // 资质类型 |
|||
private String qualificationTypeLabel; // 资质类型名称 |
|||
private String scopeIds; // 经营范围IDs |
|||
private String scopeNames; // 经营范围名称 |
|||
private List<VetQualification.CertificateInfo> certificates; // 证书列表 |
|||
private Integer remindDays; // 提醒天数 |
|||
|
|||
// 主证书信息(兼容旧版) |
|||
private String certName; // 证书名称 |
|||
private String certificateNo; // 证书编号 |
|||
private String issueOrg; // 发证机构 |
|||
private String certificateFiles; // 证书文件 |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
private Date issueDate; // 发证日期 |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
private Date expireDate; // 到期日期 |
|||
private String certStatus; // 证书状态 |
|||
private String certStatusLabel; // 证书状态名称 |
|||
private Long certId; // 证书ID |
|||
private String certificatesJson; // 证书JSON字符串 |
|||
|
|||
// ========== 审核状态 ========== |
|||
private String auditStatus; // 审核状态(0待审核 1通过 2驳回) |
|||
private String auditStatusLabel; // 审核状态名称 |
|||
private String auditOpinion; // 审核意见 |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
private Date applyTime; // 申请时间 |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
private Date auditTime; // 审核时间 |
|||
private Long auditorId; // 审核人ID |
|||
private String auditor; // 审核人 |
|||
|
|||
// ========== 认证状态 (来自SysMuhuUser) ========== |
|||
private String authStatus; // 认证状态 |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
private Date authTime; // 认证时间 |
|||
private String maskedIdCard; // 脱敏身份证 |
|||
|
|||
// ========== 统计信息 ========== |
|||
private Integer totalCertificates; // 证书总数 |
|||
private Integer expiringCount; // 即将过期(30天内) |
|||
private Integer expiredCount; // 已过期 |
|||
private Integer normalCount; // 正常 |
|||
private Integer completeness; // 信息完整度(%) |
|||
private Boolean canSubmitAudit; // 是否可以提交审核 |
|||
private Map<String, Object> statistics; // 详细统计 |
|||
|
|||
// ========== 辅助字段 ========== |
|||
private Boolean hasPersonalInfo; // 是否有个人信息 |
|||
private Boolean hasQualification; // 是否有资质信息 |
|||
private Boolean hasCertificates; // 是否有证书 |
|||
private String warningLevel; // 警告级别 NORMAL/WARNING/DANGER |
|||
private Map<String, Object> extra; // 扩展字段 |
|||
|
|||
// ========== 基础字段 ========== |
|||
private String createBy; |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
private Date createTime; |
|||
private String updateBy; |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
private Date updateTime; |
|||
private String remark; |
|||
|
|||
// ==================== Getter and Setter ==================== |
|||
|
|||
public Long getUserId() { |
|||
return userId; |
|||
} |
|||
|
|||
public void setUserId(Long userId) { |
|||
this.userId = userId; |
|||
} |
|||
|
|||
public String getUserName() { |
|||
return userName; |
|||
} |
|||
|
|||
public void setUserName(String userName) { |
|||
this.userName = userName; |
|||
} |
|||
|
|||
public String getNickName() { |
|||
return nickName; |
|||
} |
|||
|
|||
public void setNickName(String nickName) { |
|||
this.nickName = nickName; |
|||
} |
|||
|
|||
public String getPhonenumber() { |
|||
return phonenumber; |
|||
} |
|||
|
|||
public void setPhonenumber(String phonenumber) { |
|||
this.phonenumber = phonenumber; |
|||
} |
|||
|
|||
public String getEmail() { |
|||
return email; |
|||
} |
|||
|
|||
public void setEmail(String email) { |
|||
this.email = email; |
|||
} |
|||
|
|||
public String getAvatar() { |
|||
return avatar; |
|||
} |
|||
|
|||
public void setAvatar(String avatar) { |
|||
this.avatar = avatar; |
|||
} |
|||
|
|||
public String getUserType() { |
|||
return userType; |
|||
} |
|||
|
|||
public void setUserType(String userType) { |
|||
this.userType = userType; |
|||
} |
|||
|
|||
public String getAreaCode() { |
|||
return areaCode; |
|||
} |
|||
|
|||
public void setAreaCode(String areaCode) { |
|||
this.areaCode = areaCode; |
|||
} |
|||
|
|||
public String getStatus() { |
|||
return status; |
|||
} |
|||
|
|||
public void setStatus(String status) { |
|||
this.status = status; |
|||
} |
|||
|
|||
public Date getLoginDate() { |
|||
return loginDate; |
|||
} |
|||
|
|||
public void setLoginDate(Date loginDate) { |
|||
this.loginDate = loginDate; |
|||
} |
|||
|
|||
public Long getPersonalInfoId() { |
|||
return personalInfoId; |
|||
} |
|||
|
|||
public void setPersonalInfoId(Long personalInfoId) { |
|||
this.personalInfoId = personalInfoId; |
|||
} |
|||
|
|||
public String getRealName() { |
|||
return realName; |
|||
} |
|||
|
|||
public void setRealName(String realName) { |
|||
this.realName = realName; |
|||
} |
|||
|
|||
public String getGender() { |
|||
return gender; |
|||
} |
|||
|
|||
public void setGender(String gender) { |
|||
this.gender = gender; |
|||
} |
|||
|
|||
public Date getBirthday() { |
|||
return birthday; |
|||
} |
|||
|
|||
public void setBirthday(Date birthday) { |
|||
this.birthday = birthday; |
|||
} |
|||
|
|||
public String getIdCard() { |
|||
return idCard; |
|||
} |
|||
|
|||
public void setIdCard(String idCard) { |
|||
this.idCard = idCard; |
|||
} |
|||
|
|||
public String getSpecialty() { |
|||
return specialty; |
|||
} |
|||
|
|||
public void setSpecialty(String specialty) { |
|||
this.specialty = specialty; |
|||
} |
|||
|
|||
public String getWorkExperience() { |
|||
return workExperience; |
|||
} |
|||
|
|||
public void setWorkExperience(String workExperience) { |
|||
this.workExperience = workExperience; |
|||
} |
|||
|
|||
public String getHospital() { |
|||
return hospital; |
|||
} |
|||
|
|||
public void setHospital(String hospital) { |
|||
this.hospital = hospital; |
|||
} |
|||
|
|||
public String getAddress() { |
|||
return address; |
|||
} |
|||
|
|||
public void setAddress(String address) { |
|||
this.address = address; |
|||
} |
|||
|
|||
public String getIphone() { |
|||
return iphone; |
|||
} |
|||
|
|||
public void setIphone(String iphone) { |
|||
this.iphone = iphone; |
|||
} |
|||
|
|||
public String getIntroduction() { |
|||
return introduction; |
|||
} |
|||
|
|||
public void setIntroduction(String introduction) { |
|||
this.introduction = introduction; |
|||
} |
|||
|
|||
public String getTitle() { |
|||
return title; |
|||
} |
|||
|
|||
public void setTitle(String title) { |
|||
this.title = title; |
|||
} |
|||
|
|||
public String getPhone() { |
|||
return phone; |
|||
} |
|||
|
|||
public void setPhone(String phone) { |
|||
this.phone = phone; |
|||
} |
|||
|
|||
public String getExpertType() { |
|||
return expertType; |
|||
} |
|||
|
|||
public void setExpertType(String expertType) { |
|||
this.expertType = expertType; |
|||
} |
|||
|
|||
public String getPersonalEmail() { |
|||
return personalEmail; |
|||
} |
|||
|
|||
public void setPersonalEmail(String personalEmail) { |
|||
this.personalEmail = personalEmail; |
|||
} |
|||
|
|||
public String getPersonalNickName() { |
|||
return personalNickName; |
|||
} |
|||
|
|||
public void setPersonalNickName(String personalNickName) { |
|||
this.personalNickName = personalNickName; |
|||
} |
|||
|
|||
public Long getQualificationId() { |
|||
return qualificationId; |
|||
} |
|||
|
|||
public void setQualificationId(Long qualificationId) { |
|||
this.qualificationId = qualificationId; |
|||
} |
|||
|
|||
public String getQualificationType() { |
|||
return qualificationType; |
|||
} |
|||
|
|||
public void setQualificationType(String qualificationType) { |
|||
this.qualificationType = qualificationType; |
|||
} |
|||
|
|||
public String getQualificationTypeLabel() { |
|||
return qualificationTypeLabel; |
|||
} |
|||
|
|||
public void setQualificationTypeLabel(String qualificationTypeLabel) { |
|||
this.qualificationTypeLabel = qualificationTypeLabel; |
|||
} |
|||
|
|||
public String getScopeIds() { |
|||
return scopeIds; |
|||
} |
|||
|
|||
public void setScopeIds(String scopeIds) { |
|||
this.scopeIds = scopeIds; |
|||
} |
|||
|
|||
public String getScopeNames() { |
|||
return scopeNames; |
|||
} |
|||
|
|||
public void setScopeNames(String scopeNames) { |
|||
this.scopeNames = scopeNames; |
|||
} |
|||
|
|||
public List<VetQualification.CertificateInfo> getCertificates() { |
|||
return certificates; |
|||
} |
|||
|
|||
public void setCertificates(List<VetQualification.CertificateInfo> certificates) { |
|||
this.certificates = certificates; |
|||
} |
|||
|
|||
public Integer getRemindDays() { |
|||
return remindDays; |
|||
} |
|||
|
|||
public void setRemindDays(Integer remindDays) { |
|||
this.remindDays = remindDays; |
|||
} |
|||
|
|||
public String getCertName() { |
|||
return certName; |
|||
} |
|||
|
|||
public void setCertName(String certName) { |
|||
this.certName = certName; |
|||
} |
|||
|
|||
public String getCertificateNo() { |
|||
return certificateNo; |
|||
} |
|||
|
|||
public void setCertificateNo(String certificateNo) { |
|||
this.certificateNo = certificateNo; |
|||
} |
|||
|
|||
public String getIssueOrg() { |
|||
return issueOrg; |
|||
} |
|||
|
|||
public void setIssueOrg(String issueOrg) { |
|||
this.issueOrg = issueOrg; |
|||
} |
|||
|
|||
public String getCertificateFiles() { |
|||
return certificateFiles; |
|||
} |
|||
|
|||
public void setCertificateFiles(String certificateFiles) { |
|||
this.certificateFiles = certificateFiles; |
|||
} |
|||
|
|||
public Date getIssueDate() { |
|||
return issueDate; |
|||
} |
|||
|
|||
public void setIssueDate(Date issueDate) { |
|||
this.issueDate = issueDate; |
|||
} |
|||
|
|||
public Date getExpireDate() { |
|||
return expireDate; |
|||
} |
|||
|
|||
public void setExpireDate(Date expireDate) { |
|||
this.expireDate = expireDate; |
|||
} |
|||
|
|||
public String getCertStatus() { |
|||
return certStatus; |
|||
} |
|||
|
|||
public void setCertStatus(String certStatus) { |
|||
this.certStatus = certStatus; |
|||
} |
|||
|
|||
public String getCertStatusLabel() { |
|||
return certStatusLabel; |
|||
} |
|||
|
|||
public void setCertStatusLabel(String certStatusLabel) { |
|||
this.certStatusLabel = certStatusLabel; |
|||
} |
|||
|
|||
public Long getCertId() { |
|||
return certId; |
|||
} |
|||
|
|||
public void setCertId(Long certId) { |
|||
this.certId = certId; |
|||
} |
|||
|
|||
public String getCertificatesJson() { |
|||
return certificatesJson; |
|||
} |
|||
|
|||
public void setCertificatesJson(String certificatesJson) { |
|||
this.certificatesJson = certificatesJson; |
|||
} |
|||
|
|||
public String getAuditStatus() { |
|||
return auditStatus; |
|||
} |
|||
|
|||
public void setAuditStatus(String auditStatus) { |
|||
this.auditStatus = auditStatus; |
|||
} |
|||
|
|||
public String getAuditStatusLabel() { |
|||
return auditStatusLabel; |
|||
} |
|||
|
|||
public void setAuditStatusLabel(String auditStatusLabel) { |
|||
this.auditStatusLabel = auditStatusLabel; |
|||
} |
|||
|
|||
public String getAuditOpinion() { |
|||
return auditOpinion; |
|||
} |
|||
|
|||
public void setAuditOpinion(String auditOpinion) { |
|||
this.auditOpinion = auditOpinion; |
|||
} |
|||
|
|||
public Date getApplyTime() { |
|||
return applyTime; |
|||
} |
|||
|
|||
public void setApplyTime(Date applyTime) { |
|||
this.applyTime = applyTime; |
|||
} |
|||
|
|||
public Date getAuditTime() { |
|||
return auditTime; |
|||
} |
|||
|
|||
public void setAuditTime(Date auditTime) { |
|||
this.auditTime = auditTime; |
|||
} |
|||
|
|||
public Long getAuditorId() { |
|||
return auditorId; |
|||
} |
|||
|
|||
public void setAuditorId(Long auditorId) { |
|||
this.auditorId = auditorId; |
|||
} |
|||
|
|||
public String getAuditor() { |
|||
return auditor; |
|||
} |
|||
|
|||
public void setAuditor(String auditor) { |
|||
this.auditor = auditor; |
|||
} |
|||
|
|||
public String getAuthStatus() { |
|||
return authStatus; |
|||
} |
|||
|
|||
public void setAuthStatus(String authStatus) { |
|||
this.authStatus = authStatus; |
|||
} |
|||
|
|||
public Date getAuthTime() { |
|||
return authTime; |
|||
} |
|||
|
|||
public void setAuthTime(Date authTime) { |
|||
this.authTime = authTime; |
|||
} |
|||
|
|||
public String getMaskedIdCard() { |
|||
return maskedIdCard; |
|||
} |
|||
|
|||
public void setMaskedIdCard(String maskedIdCard) { |
|||
this.maskedIdCard = maskedIdCard; |
|||
} |
|||
|
|||
public Integer getTotalCertificates() { |
|||
return totalCertificates; |
|||
} |
|||
|
|||
public void setTotalCertificates(Integer totalCertificates) { |
|||
this.totalCertificates = totalCertificates; |
|||
} |
|||
|
|||
public Integer getExpiringCount() { |
|||
return expiringCount; |
|||
} |
|||
|
|||
public void setExpiringCount(Integer expiringCount) { |
|||
this.expiringCount = expiringCount; |
|||
} |
|||
|
|||
public Integer getExpiredCount() { |
|||
return expiredCount; |
|||
} |
|||
|
|||
public void setExpiredCount(Integer expiredCount) { |
|||
this.expiredCount = expiredCount; |
|||
} |
|||
|
|||
public Integer getNormalCount() { |
|||
return normalCount; |
|||
} |
|||
|
|||
public void setNormalCount(Integer normalCount) { |
|||
this.normalCount = normalCount; |
|||
} |
|||
|
|||
public Integer getCompleteness() { |
|||
return completeness; |
|||
} |
|||
|
|||
public void setCompleteness(Integer completeness) { |
|||
this.completeness = completeness; |
|||
} |
|||
|
|||
public Boolean getCanSubmitAudit() { |
|||
return canSubmitAudit; |
|||
} |
|||
|
|||
public void setCanSubmitAudit(Boolean canSubmitAudit) { |
|||
this.canSubmitAudit = canSubmitAudit; |
|||
} |
|||
|
|||
public Map<String, Object> getStatistics() { |
|||
return statistics; |
|||
} |
|||
|
|||
public void setStatistics(Map<String, Object> statistics) { |
|||
this.statistics = statistics; |
|||
} |
|||
|
|||
public Boolean getHasPersonalInfo() { |
|||
return hasPersonalInfo; |
|||
} |
|||
|
|||
public void setHasPersonalInfo(Boolean hasPersonalInfo) { |
|||
this.hasPersonalInfo = hasPersonalInfo; |
|||
} |
|||
|
|||
public Boolean getHasQualification() { |
|||
return hasQualification; |
|||
} |
|||
|
|||
public void setHasQualification(Boolean hasQualification) { |
|||
this.hasQualification = hasQualification; |
|||
} |
|||
|
|||
public Boolean getHasCertificates() { |
|||
return hasCertificates; |
|||
} |
|||
|
|||
public void setHasCertificates(Boolean hasCertificates) { |
|||
this.hasCertificates = hasCertificates; |
|||
} |
|||
|
|||
public String getWarningLevel() { |
|||
return warningLevel; |
|||
} |
|||
|
|||
public void setWarningLevel(String warningLevel) { |
|||
this.warningLevel = warningLevel; |
|||
} |
|||
|
|||
public Map<String, Object> getExtra() { |
|||
return extra; |
|||
} |
|||
|
|||
public void setExtra(Map<String, Object> extra) { |
|||
this.extra = extra; |
|||
} |
|||
|
|||
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; |
|||
} |
|||
|
|||
public String getUpdateBy() { |
|||
return updateBy; |
|||
} |
|||
|
|||
public void setUpdateBy(String updateBy) { |
|||
this.updateBy = updateBy; |
|||
} |
|||
|
|||
public Date getUpdateTime() { |
|||
return updateTime; |
|||
} |
|||
|
|||
public void setUpdateTime(Date updateTime) { |
|||
this.updateTime = updateTime; |
|||
} |
|||
|
|||
public String getRemark() { |
|||
return remark; |
|||
} |
|||
|
|||
public void setRemark(String remark) { |
|||
this.remark = remark; |
|||
} |
|||
} |
|||
@ -0,0 +1,52 @@ |
|||
package com.chenhai.vet.service; |
|||
|
|||
import com.chenhai.vet.domain.dto.VetUnifiedInfoDTO; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 兽医统一信息Service接口 |
|||
*/ |
|||
public interface IVetUnifiedInfoService { |
|||
|
|||
/** |
|||
* 获取当前登录用户的完整信息 |
|||
*/ |
|||
VetUnifiedInfoDTO getCurrentUserInfo(); |
|||
|
|||
/** |
|||
* 根据用户ID获取完整信息 |
|||
*/ |
|||
VetUnifiedInfoDTO getUserInfoByUserId(Long userId); |
|||
|
|||
/** |
|||
* 保存/更新兽医信息 |
|||
*/ |
|||
VetUnifiedInfoDTO saveVetInfo(Map<String, Object> requestData); |
|||
|
|||
/** |
|||
* 提交审核 |
|||
*/ |
|||
boolean submitForAudit(Long userId); |
|||
|
|||
/** |
|||
* 获取统计信息 |
|||
*/ |
|||
Map<String, Object> getStatistics(Long userId); |
|||
|
|||
/** |
|||
* 检查是否需要填写资质 |
|||
*/ |
|||
Map<String, Object> checkNeedQualification(Long userId); |
|||
|
|||
/** |
|||
* 分页查询兽医信息列表(管理员用) |
|||
* 分页参数由 MyBatis 分页插件自动处理 |
|||
*/ |
|||
List<VetUnifiedInfoDTO> listVetInfo(VetUnifiedInfoDTO query); |
|||
|
|||
/** |
|||
* 审核兽医信息 |
|||
*/ |
|||
boolean auditVetInfo(Long userId, String auditStatus, String auditOpinion, Long auditorId); |
|||
} |
|||
1179
chenhai-system/src/main/java/com/chenhai/vet/service/impl/VetUnifiedInfoServiceImpl.java
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
Write
Preview
Loading…
Cancel
Save
Reference in new issue