Browse Source

兽医信息管理功能

master
ChaiNingQi 1 day ago
parent
commit
2dc63e7cf7
  1. 123
      chenhai-admin/src/main/java/com/chenhai/web/controller/vet/VetPersonalInfoController.java
  2. 3
      chenhai-admin/src/main/resources/application.yml
  3. 30
      chenhai-system/src/main/java/com/chenhai/vet/domain/VetPersonalInfo.java
  4. 1
      chenhai-system/src/main/java/com/chenhai/vet/mapper/VetPersonalInfoMapper.java
  5. 12
      chenhai-system/src/main/java/com/chenhai/vet/service/IVetPersonalInfoService.java
  6. 97
      chenhai-system/src/main/java/com/chenhai/vet/service/impl/VetPersonalInfoServiceImpl.java
  7. 2
      chenhai-system/src/main/resources/mapper/vet/VetCertificateMapper.xml
  8. 54
      chenhai-system/src/main/resources/mapper/vet/VetPersonalInfoMapper.xml
  9. 2
      chenhai-system/src/main/resources/mapper/vet/VetQualificationMapper.xml
  10. 44
      chenhai-ui/src/api/vet/certificate.js
  11. 44
      chenhai-ui/src/api/vet/info.js
  12. 393
      chenhai-ui/src/views/vet/certificate/index.vue
  13. 371
      chenhai-ui/src/views/vet/info/index.vue

123
chenhai-admin/src/main/java/com/chenhai/web/controller/vet/VetPersonalInfoController.java

@ -7,6 +7,7 @@ import com.chenhai.common.core.page.TableDataInfo;
import com.chenhai.common.enums.BusinessType; import com.chenhai.common.enums.BusinessType;
import com.chenhai.common.utils.poi.ExcelUtil; import com.chenhai.common.utils.poi.ExcelUtil;
import com.chenhai.vet.domain.VetPersonalInfo; import com.chenhai.vet.domain.VetPersonalInfo;
import com.chenhai.vet.mapper.VetPersonalInfoMapper;
import com.chenhai.vet.service.IVetPersonalInfoService; import com.chenhai.vet.service.IVetPersonalInfoService;
import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -14,6 +15,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 兽医个人信息Controller * 兽医个人信息Controller
@ -40,6 +42,126 @@ public class VetPersonalInfoController extends BaseController
return getDataTable(list); return getDataTable(list);
} }
/**
* 查询兽医个人信息列表包含证书信息
*/
@PreAuthorize("@ss.hasPermi('vet:info:list')")
@GetMapping("/listWithCertificates")
public TableDataInfo listWithCertificates(VetPersonalInfo vetPersonalInfo) {
startPage();
List<VetPersonalInfo> list = vetPersonalInfoService.selectVetPersonalInfoWithCertificates(vetPersonalInfo);
return getDataTable(list);
}
/**
* 导出兽医个人信息列表包含证书信息
*/
@PreAuthorize("@ss.hasPermi('vet:info:export')")
@Log(title = "兽医个人信息(含证书)", businessType = BusinessType.EXPORT)
@PostMapping("/exportWithCertificates")
public void exportWithCertificates(HttpServletResponse response, VetPersonalInfo vetPersonalInfo) {
List<VetPersonalInfo> list = vetPersonalInfoService.selectVetPersonalInfoWithCertificates(vetPersonalInfo);
ExcelUtil<VetPersonalInfo> util = new ExcelUtil<VetPersonalInfo>(VetPersonalInfo.class);
util.exportExcel(response, list, "兽医个人信息及证书数据");
}
/**
* 获取兽医完整信息包含证书详情
*/
@PreAuthorize("@ss.hasPermi('vet:info:query')")
@GetMapping("/full/{id}")
public AjaxResult getFullInfo(@PathVariable("id") Long id)
{
Map<String, Object> fullInfo = vetPersonalInfoService.getVetFullInfo(id);
if (fullInfo == null || fullInfo.isEmpty()) {
return error("兽医信息不存在");
}
return success(fullInfo);
}
/**
* 根据用户ID获取兽医完整信息
*/
@PreAuthorize("@ss.hasPermi('vet:info:query')")
@GetMapping("/full/byUserId/{userId}")
public AjaxResult getFullInfoByUserId(@PathVariable("userId") Long userId)
{
Map<String, Object> fullInfo = vetPersonalInfoService.getVetFullInfoByUserId(userId);
return success(fullInfo);
}
/**
* 获取当前登录用户的兽医完整信息
*/
@PreAuthorize("@ss.hasPermi('vet:info:query')")
@GetMapping("/full/current")
public AjaxResult getCurrentFullInfo()
{
// 获取当前登录用户的ID需要根据您的权限系统实现
Long userId = getCurrentUserId();
if (userId == null) {
return error("用户未登录");
}
Map<String, Object> fullInfo = vetPersonalInfoService.getVetFullInfoByUserId(userId);
return success(fullInfo);
}
/**
* 更新当前登录用户的兽医信息
*/
@PreAuthorize("@ss.hasPermi('vet:info:edit')")
@Log(title = "兽医个人信息", businessType = BusinessType.UPDATE)
@PutMapping("/current")
public AjaxResult updateCurrent(@RequestBody VetPersonalInfo vetPersonalInfo)
{
// 获取当前登录用户ID
Long userId = getCurrentUserId();
if (userId == null) {
return error("用户未登录");
}
// 设置当前用户ID
vetPersonalInfo.setUserId(userId);
// 检查是否已存在记录
VetPersonalInfo existing = getVetInfoByUserId(userId);
if (existing == null) {
// 不存在则新增
return toAjax(vetPersonalInfoService.insertVetPersonalInfo(vetPersonalInfo));
} else {
// 存在则更新
vetPersonalInfo.setId(existing.getId());
return toAjax(vetPersonalInfoService.updateVetPersonalInfo(vetPersonalInfo));
}
}
/**
* 根据用户ID获取兽医信息的辅助方法
*/
private VetPersonalInfo getVetInfoByUserId(Long userId) {
VetPersonalInfo query = new VetPersonalInfo();
query.setUserId(userId);
List<VetPersonalInfo> list = vetPersonalInfoService.selectVetPersonalInfoList(query);
return list != null && !list.isEmpty() ? list.get(0) : null;
}
/**
* 获取当前登录用户ID的辅助方法
*/
private Long getCurrentUserId() {
// 这里需要根据您的权限系统获取当前登录用户的ID
// 示例实现具体实现取决于您的权限框架
/*
Object principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal();
if (principal instanceof UserDetails) {
// 根据您的用户信息获取userId
return ((UserDetails) principal).getUserId();
}
*/
return 1L; // 临时返回1用于测试
}
/** /**
* 导出兽医个人信息列表 * 导出兽医个人信息列表
*/ */
@ -48,6 +170,7 @@ public class VetPersonalInfoController extends BaseController
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, VetPersonalInfo vetPersonalInfo) public void export(HttpServletResponse response, VetPersonalInfo vetPersonalInfo)
{ {
List<VetPersonalInfo> list = vetPersonalInfoService.selectVetPersonalInfoList(vetPersonalInfo); List<VetPersonalInfo> list = vetPersonalInfoService.selectVetPersonalInfoList(vetPersonalInfo);
ExcelUtil<VetPersonalInfo> util = new ExcelUtil<VetPersonalInfo>(VetPersonalInfo.class); ExcelUtil<VetPersonalInfo> util = new ExcelUtil<VetPersonalInfo>(VetPersonalInfo.class);
util.exportExcel(response, list, "兽医个人信息数据"); util.exportExcel(response, list, "兽医个人信息数据");

3
chenhai-admin/src/main/resources/application.yml

@ -88,6 +88,9 @@ spring:
max-active: 8 max-active: 8
# #连接池最大阻塞等待时间(使用负值表示没有限制) # #连接池最大阻塞等待时间(使用负值表示没有限制)
max-wait: -1ms max-wait: -1ms
web:
resources:
add-mappings: false
# token配置 # token配置
token: token:

30
chenhai-system/src/main/java/com/chenhai/vet/domain/VetPersonalInfo.java

@ -48,7 +48,7 @@ public class VetPersonalInfo extends BaseEntity
/** 工作经验(年) */ /** 工作经验(年) */
@Excel(name = "工作经验", readConverterExp = "年=") @Excel(name = "工作经验", readConverterExp = "年=")
private Long workExperience;
private String workExperience;
/** 所属医院 */ /** 所属医院 */
@Excel(name = "所属医院") @Excel(name = "所属医院")
@ -62,6 +62,30 @@ public class VetPersonalInfo extends BaseEntity
@Excel(name = "个人简介") @Excel(name = "个人简介")
private String introduction; private String introduction;
@Excel(name = "证书数量")
private Integer certCount;
/** 证书名称列表(逗号分隔,用于关联查询) */
@Excel(name = "证书名称列表")
private String certNames;
// 添加getter和setter
public Integer getCertCount() {
return certCount;
}
public void setCertCount(Integer certCount) {
this.certCount = certCount;
}
public String getCertNames() {
return certNames;
}
public void setCertNames(String certNames) {
this.certNames = certNames;
}
public void setId(Long id) public void setId(Long id)
{ {
this.id = id; this.id = id;
@ -132,12 +156,12 @@ public class VetPersonalInfo extends BaseEntity
return specialty; return specialty;
} }
public void setWorkExperience(Long workExperience)
public void setWorkExperience(String workExperience)
{ {
this.workExperience = workExperience; this.workExperience = workExperience;
} }
public Long getWorkExperience()
public String getWorkExperience()
{ {
return workExperience; return workExperience;
} }

1
chenhai-system/src/main/java/com/chenhai/vet/mapper/VetPersonalInfoMapper.java

@ -59,4 +59,5 @@ public interface VetPersonalInfoMapper
* @return 结果 * @return 结果
*/ */
public int deleteVetPersonalInfoByIds(Long[] ids); public int deleteVetPersonalInfoByIds(Long[] ids);
public List<VetPersonalInfo> selectWithCertificates(VetPersonalInfo vetPersonalInfo);
} }

12
chenhai-system/src/main/java/com/chenhai/vet/service/IVetPersonalInfoService.java

@ -3,6 +3,7 @@ package com.chenhai.vet.service;
import com.chenhai.vet.domain.VetPersonalInfo; import com.chenhai.vet.domain.VetPersonalInfo;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 兽医个人信息Service接口 * 兽医个人信息Service接口
@ -59,6 +60,17 @@ public interface IVetPersonalInfoService
* @return 结果 * @return 结果
*/ */
public int deleteVetPersonalInfoById(Long id); public int deleteVetPersonalInfoById(Long id);
List<VetPersonalInfo> selectVetPersonalInfoWithCertificates(VetPersonalInfo vetPersonalInfo);
/**
* 获取兽医的完整信息包含证书详情
*/
Map<String, Object> getVetFullInfo(Long vetId);
/**
* 根据用户ID获取兽医信息包含证书
*/
Map<String, Object> getVetFullInfoByUserId(Long userId);
} }

97
chenhai-system/src/main/java/com/chenhai/vet/service/impl/VetPersonalInfoServiceImpl.java

@ -1,13 +1,18 @@
package com.chenhai.vet.service.impl; package com.chenhai.vet.service.impl;
import com.chenhai.common.utils.DateUtils; import com.chenhai.common.utils.DateUtils;
import com.chenhai.vet.domain.VetCertificate;
import com.chenhai.vet.domain.VetPersonalInfo; import com.chenhai.vet.domain.VetPersonalInfo;
import com.chenhai.vet.mapper.VetPersonalInfoMapper; import com.chenhai.vet.mapper.VetPersonalInfoMapper;
import com.chenhai.vet.mapper.VetCertificateMapper;
import com.chenhai.vet.service.IVetPersonalInfoService; import com.chenhai.vet.service.IVetPersonalInfoService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/** /**
* 兽医个人信息Service业务层处理 * 兽医个人信息Service业务层处理
@ -20,6 +25,8 @@ public class VetPersonalInfoServiceImpl implements IVetPersonalInfoService
{ {
@Autowired @Autowired
private VetPersonalInfoMapper vetPersonalInfoMapper; private VetPersonalInfoMapper vetPersonalInfoMapper;
@Autowired
private VetCertificateMapper vetCertificateMapper;
/** /**
* 查询兽医个人信息 * 查询兽医个人信息
@ -95,5 +102,95 @@ public class VetPersonalInfoServiceImpl implements IVetPersonalInfoService
return vetPersonalInfoMapper.deleteVetPersonalInfoById(id); return vetPersonalInfoMapper.deleteVetPersonalInfoById(id);
} }
@Override
public List<VetPersonalInfo> selectVetPersonalInfoWithCertificates(VetPersonalInfo vetPersonalInfo) {
return vetPersonalInfoMapper.selectWithCertificates(vetPersonalInfo);
}
/**
* 获取兽医的完整信息包含证书详情
*/
@Override
public Map<String, Object> getVetFullInfo(Long vetId) {
Map<String, Object> result = new HashMap<>();
// 1. 获取兽医个人信息
VetPersonalInfo personalInfo = vetPersonalInfoMapper.selectVetPersonalInfoById(vetId);
if (personalInfo == null) {
return result;
}
result.put("personalInfo", personalInfo);
// 2. 获取证书列表
VetCertificate certificateQuery = new VetCertificate();
certificateQuery.setUserId(personalInfo.getUserId());
List<VetCertificate> certificates = vetCertificateMapper.selectVetCertificateList(certificateQuery);
result.put("certificates", certificates);
// 3. 证书统计信息
if (certificates != null && !certificates.isEmpty()) {
result.put("certificateCount", certificates.size());
result.put("certificateNames", certificates.stream()
.map(VetCertificate::getCertName)
.collect(Collectors.joining(", ")));
// 按状态统计
long validCount = certificates.stream().filter(cert -> "0".equals(cert.getStatus())).count();
long expiringCount = certificates.stream().filter(cert -> "1".equals(cert.getStatus())).count();
long expiredCount = certificates.stream().filter(cert -> "2".equals(cert.getStatus())).count();
Map<String, Long> statusStats = new HashMap<>();
statusStats.put("valid", validCount);
statusStats.put("expiring", expiringCount);
statusStats.put("expired", expiredCount);
result.put("statusStats", statusStats);
} else {
result.put("certificateCount", 0);
result.put("certificateNames", "");
}
return result;
}
/**
* 根据用户ID获取兽医信息包含证书
*/
@Override
public Map<String, Object> getVetFullInfoByUserId(Long userId) {
Map<String, Object> result = new HashMap<>();
// 根据user_id查询兽医信息
VetPersonalInfo query = new VetPersonalInfo();
query.setUserId(userId);
List<VetPersonalInfo> personalInfos = vetPersonalInfoMapper.selectVetPersonalInfoList(query);
if (personalInfos == null || personalInfos.isEmpty()) {
return result;
}
VetPersonalInfo personalInfo = personalInfos.get(0);
result.put("personalInfo", personalInfo);
// 获取证书列表
VetCertificate certificateQuery = new VetCertificate();
certificateQuery.setUserId(userId);
List<VetCertificate> certificates = vetCertificateMapper.selectVetCertificateList(certificateQuery);
result.put("certificates", certificates);
// 证书统计信息
if (certificates != null && !certificates.isEmpty()) {
result.put("certificateCount", certificates.size());
result.put("certificateNames", certificates.stream()
.map(VetCertificate::getCertName)
.collect(Collectors.joining(", ")));
} else {
result.put("certificateCount", 0);
result.put("certificateNames", "");
}
return result;
}
} }

2
chenhai-system/src/main/resources/mapper/vet/VetCertificateMapper.xml

@ -2,7 +2,7 @@
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.chenhai.system.mapper.VetCertificateMapper">
<mapper namespace="com.chenhai.vet.mapper.VetCertificateMapper">
<resultMap type="VetCertificate" id="VetCertificateResult"> <resultMap type="VetCertificate" id="VetCertificateResult">
<result property="id" column="id" /> <result property="id" column="id" />

54
chenhai-system/src/main/resources/mapper/vet/VetPersonalInfoMapper.xml

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.chenhai.system.vet.mapper.VetPersonalInfoMapper">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.chenhai.vet.mapper.VetPersonalInfoMapper">
<resultMap type="VetPersonalInfo" id="VetPersonalInfoResult"> <resultMap type="VetPersonalInfo" id="VetPersonalInfoResult">
<result property="id" column="id" /> <result property="id" column="id" />
@ -20,22 +20,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="certCount" column="certCount" />
<result property="certNames" column="certNames" />
</resultMap> </resultMap>
<sql id="selectVetPersonalInfoVo"> <sql id="selectVetPersonalInfoVo">
select id, user_id, real_name, gender, birthday, id_card, specialty, work_experience, hospital, address, introduction, create_by, create_time, update_by, update_time from vet_personal_info
select id, user_id, real_name, gender, birthday, id_card, specialty, work_experience, hospital, address, introduction, create_by, create_time, update_by, update_time
from vet_personal_info
</sql> </sql>
<select id="selectVetPersonalInfoList" parameterType="VetPersonalInfo" resultMap="VetPersonalInfoResult"> <select id="selectVetPersonalInfoList" parameterType="VetPersonalInfo" resultMap="VetPersonalInfoResult">
<include refid="selectVetPersonalInfoVo"/> <include refid="selectVetPersonalInfoVo"/>
<where> <where>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="userId != null"> and user_id = #{userId}</if>
<if test="realName != null and realName != ''"> and real_name like concat('%', #{realName}, '%')</if> <if test="realName != null and realName != ''"> and real_name like concat('%', #{realName}, '%')</if>
<if test="gender != null and gender != ''"> and gender = #{gender}</if> <if test="gender != null and gender != ''"> and gender = #{gender}</if>
<if test="birthday != null "> and birthday = #{birthday}</if>
<if test="idCard != null and idCard != ''"> and id_card = #{idCard}</if> <if test="idCard != null and idCard != ''"> and id_card = #{idCard}</if>
<if test="specialty != null and specialty != ''"> and specialty = #{specialty}</if> <if test="specialty != null and specialty != ''"> and specialty = #{specialty}</if>
<if test="workExperience != null "> and work_experience = #{workExperience}</if>
<if test="workExperience != null"> and work_experience = #{workExperience}</if>
<if test="hospital != null and hospital != ''"> and hospital = #{hospital}</if> <if test="hospital != null and hospital != ''"> and hospital = #{hospital}</if>
<if test="address != null and address != ''"> and address = #{address}</if> <if test="address != null and address != ''"> and address = #{address}</if>
<if test="introduction != null and introduction != ''"> and introduction = #{introduction}</if> <if test="introduction != null and introduction != ''"> and introduction = #{introduction}</if>
@ -47,6 +49,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id} where id = #{id}
</select> </select>
<!-- 注意:这里有两个selectWithCertificates,删除重复的那个 -->
<select id="selectWithCertificates" parameterType="VetPersonalInfo" resultMap="VetPersonalInfoResult">
SELECT
vpi.id,
vpi.user_id,
vpi.real_name,
vpi.gender,
vpi.birthday,
vpi.id_card,
vpi.specialty,
vpi.work_experience,
vpi.hospital,
vpi.address,
vpi.introduction,
vpi.create_by,
vpi.create_time,
vpi.update_by,
vpi.update_time,
COUNT(vc.id) as certCount,
GROUP_CONCAT(vc.cert_name) as certNames
FROM vet_personal_info vpi
LEFT JOIN vet_certificate vc ON vpi.user_id = vc.user_id
<where>
<if test="userId != null">AND vpi.user_id = #{userId}</if>
<if test="realName != null and realName != ''">AND vpi.real_name like concat('%', #{realName}, '%')</if>
<if test="gender != null and gender != ''">AND vpi.gender = #{gender}</if>
<if test="idCard != null and idCard != ''">AND vpi.id_card like concat('%', #{idCard}, '%')</if>
<if test="specialty != null and specialty != ''">AND vpi.specialty like concat('%', #{specialty}, '%')</if>
<if test="hospital != null and hospital != ''">AND vpi.hospital like concat('%', #{hospital}, '%')</if>
<if test="address != null and address != ''">AND vpi.address like concat('%', #{address}, '%')</if>
</where>
GROUP BY vpi.id
</select>
<insert id="insertVetPersonalInfo" parameterType="VetPersonalInfo" useGeneratedKeys="true" keyProperty="id"> <insert id="insertVetPersonalInfo" parameterType="VetPersonalInfo" useGeneratedKeys="true" keyProperty="id">
insert into vet_personal_info insert into vet_personal_info
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
@ -96,8 +132,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="hospital != null">hospital = #{hospital},</if> <if test="hospital != null">hospital = #{hospital},</if>
<if test="address != null">address = #{address},</if> <if test="address != null">address = #{address},</if>
<if test="introduction != null">introduction = #{introduction},</if> <if test="introduction != null">introduction = #{introduction},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
</trim> </trim>
@ -108,7 +142,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
delete from vet_personal_info where id = #{id} delete from vet_personal_info where id = #{id}
</delete> </delete>
<delete id="deleteVetPersonalInfoByIds" parameterType="String">
<delete id="deleteVetPersonalInfoByIds" parameterType="Long">
delete from vet_personal_info where id in delete from vet_personal_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}

2
chenhai-system/src/main/resources/mapper/vet/VetQualificationMapper.xml

@ -2,7 +2,7 @@
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.chenhai.system.mapper.VetQualificationMapper">
<mapper namespace="com.chenhai.vet.mapper.VetQualificationMapper">
<resultMap type="VetQualification" id="VetQualificationResult"> <resultMap type="VetQualification" id="VetQualificationResult">
<result property="qualificationId" column="qualification_id" /> <result property="qualificationId" column="qualification_id" />

44
chenhai-ui/src/api/vet/certificate.js

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询兽医执业证书列表
export function listCertificate(query) {
return request({
url: '/vet/certificate/list',
method: 'get',
params: query
})
}
// 查询兽医执业证书详细
export function getCertificate(id) {
return request({
url: '/vet/certificate/' + id,
method: 'get'
})
}
// 新增兽医执业证书
export function addCertificate(data) {
return request({
url: '/vet/certificate',
method: 'post',
data: data
})
}
// 修改兽医执业证书
export function updateCertificate(data) {
return request({
url: '/vet/certificate',
method: 'put',
data: data
})
}
// 删除兽医执业证书
export function delCertificate(id) {
return request({
url: '/vet/certificate/' + id,
method: 'delete'
})
}

44
chenhai-ui/src/api/vet/info.js

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询兽医个人信息列表
export function listInfo(query) {
return request({
url: '/vet/info/list',
method: 'get',
params: query
})
}
// 查询兽医个人信息详细
export function getInfo(id) {
return request({
url: '/vet/info/' + id,
method: 'get'
})
}
// 新增兽医个人信息
export function addInfo(data) {
return request({
url: '/vet/info',
method: 'post',
data: data
})
}
// 修改兽医个人信息
export function updateInfo(data) {
return request({
url: '/vet/info',
method: 'put',
data: data
})
}
// 删除兽医个人信息
export function delInfo(id) {
return request({
url: '/vet/info/' + id,
method: 'delete'
})
}

393
chenhai-ui/src/views/vet/certificate/index.vue

@ -0,0 +1,393 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="用户ID" prop="userId">
<el-input
v-model="queryParams.userId"
placeholder="请输入用户ID"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="证书名称" prop="certName">
<el-input
v-model="queryParams.certName"
placeholder="请输入证书名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="证书编号" prop="certNumber">
<el-input
v-model="queryParams.certNumber"
placeholder="请输入证书编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="发证机构" prop="issueOrg">
<el-input
v-model="queryParams.issueOrg"
placeholder="请输入发证机构"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="发证日期" prop="issueDate">
<el-date-picker clearable
v-model="queryParams.issueDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择发证日期">
</el-date-picker>
</el-form-item>
<el-form-item label="到期日期" prop="expireDate">
<el-date-picker clearable
v-model="queryParams.expireDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择到期日期">
</el-date-picker>
</el-form-item>
<el-form-item label="提前提醒天数" prop="remindDays">
<el-input
v-model="queryParams.remindDays"
placeholder="请输入提前提醒天数"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="上次提醒时间" prop="lastRemindTime">
<el-date-picker clearable
v-model="queryParams.lastRemindTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择上次提醒时间">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:certificate:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:certificate:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:certificate:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:certificate:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="certificateList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键ID" align="center" prop="id" />
<el-table-column label="用户ID" align="center" prop="userId" />
<el-table-column label="证书名称" align="center" prop="certName" />
<el-table-column label="证书编号" align="center" prop="certNumber" />
<el-table-column label="证书类型" align="center" prop="certType" />
<el-table-column label="发证机构" align="center" prop="issueOrg" />
<el-table-column label="发证日期" align="center" prop="issueDate" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.issueDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="到期日期" align="center" prop="expireDate" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.expireDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="证书图片" align="center" prop="certImage" width="100">
<template slot-scope="scope">
<image-preview :src="scope.row.certImage" :width="50" :height="50"/>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status" />
<el-table-column label="提前提醒天数" align="center" prop="remindDays" />
<el-table-column label="上次提醒时间" align="center" prop="lastRemindTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.lastRemindTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:certificate:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:certificate:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改兽医执业证书对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="用户ID" prop="userId">
<el-input v-model="form.userId" placeholder="请输入用户ID" />
</el-form-item>
<el-form-item label="证书名称" prop="certName">
<el-input v-model="form.certName" placeholder="请输入证书名称" />
</el-form-item>
<el-form-item label="证书编号" prop="certNumber">
<el-input v-model="form.certNumber" placeholder="请输入证书编号" />
</el-form-item>
<el-form-item label="发证机构" prop="issueOrg">
<el-input v-model="form.issueOrg" placeholder="请输入发证机构" />
</el-form-item>
<el-form-item label="发证日期" prop="issueDate">
<el-date-picker clearable
v-model="form.issueDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择发证日期">
</el-date-picker>
</el-form-item>
<el-form-item label="到期日期" prop="expireDate">
<el-date-picker clearable
v-model="form.expireDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择到期日期">
</el-date-picker>
</el-form-item>
<el-form-item label="证书图片" prop="certImage">
<image-upload v-model="form.certImage"/>
</el-form-item>
<el-form-item label="提前提醒天数" prop="remindDays">
<el-input v-model="form.remindDays" placeholder="请输入提前提醒天数" />
</el-form-item>
<el-form-item label="上次提醒时间" prop="lastRemindTime">
<el-date-picker clearable
v-model="form.lastRemindTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择上次提醒时间">
</el-date-picker>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listCertificate, getCertificate, delCertificate, addCertificate, updateCertificate } from "@/api/system/certificate"
export default {
name: "Certificate",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
certificateList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
userId: null,
certName: null,
certNumber: null,
certType: null,
issueOrg: null,
issueDate: null,
expireDate: null,
certImage: null,
status: null,
remindDays: null,
lastRemindTime: null,
},
//
form: {},
//
rules: {
userId: [
{ required: true, message: "用户ID不能为空", trigger: "blur" }
],
}
}
},
created() {
this.getList()
},
methods: {
/** 查询兽医执业证书列表 */
getList() {
this.loading = true
listCertificate(this.queryParams).then(response => {
this.certificateList = response.rows
this.total = response.total
this.loading = false
})
},
//
cancel() {
this.open = false
this.reset()
},
//
reset() {
this.form = {
id: null,
userId: null,
certName: null,
certNumber: null,
certType: null,
issueOrg: null,
issueDate: null,
expireDate: null,
certImage: null,
status: null,
remindDays: null,
lastRemindTime: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
}
this.resetForm("form")
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm")
this.handleQuery()
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.open = true
this.title = "添加兽医执业证书"
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const id = row.id || this.ids
getCertificate(id).then(response => {
this.form = response.data
this.open = true
this.title = "修改兽医执业证书"
})
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateCertificate(this.form).then(response => {
this.$modal.msgSuccess("修改成功")
this.open = false
this.getList()
})
} else {
addCertificate(this.form).then(response => {
this.$modal.msgSuccess("新增成功")
this.open = false
this.getList()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids
this.$modal.confirm('是否确认删除兽医执业证书编号为"' + ids + '"的数据项?').then(function() {
return delCertificate(ids)
}).then(() => {
this.getList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
this.download('system/certificate/export', {
...this.queryParams
}, `certificate_${new Date().getTime()}.xlsx`)
}
}
}
</script>

371
chenhai-ui/src/views/vet/info/index.vue

@ -0,0 +1,371 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="用户ID" prop="userId">
<el-input
v-model="queryParams.userId"
placeholder="请输入用户ID"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="真实姓名" prop="realName">
<el-input
v-model="queryParams.realName"
placeholder="请输入真实姓名"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="性别" prop="gender">
<el-input
v-model="queryParams.gender"
placeholder="请输入性别"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="出生日期" prop="birthday">
<el-date-picker clearable
v-model="queryParams.birthday"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择出生日期">
</el-date-picker>
</el-form-item>
<el-form-item label="身份证号" prop="idCard">
<el-input
v-model="queryParams.idCard"
placeholder="请输入身份证号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="工作经验" prop="workExperience">
<el-input
v-model="queryParams.workExperience"
placeholder="请输入工作经验"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="所属医院" prop="hospital">
<el-input
v-model="queryParams.hospital"
placeholder="请输入所属医院"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="联系地址" prop="address">
<el-input
v-model="queryParams.address"
placeholder="请输入联系地址"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:info:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:info:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:info:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:info:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键ID" align="center" prop="id" />
<el-table-column label="用户ID" align="center" prop="userId" />
<el-table-column label="真实姓名" align="center" prop="realName" />
<el-table-column label="性别" align="center" prop="gender" />
<el-table-column label="出生日期" align="center" prop="birthday" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.birthday, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="身份证号" align="center" prop="idCard" />
<el-table-column label="擅长领域" align="center" prop="specialty" />
<el-table-column label="工作经验" align="center" prop="workExperience" />
<el-table-column label="所属医院" align="center" prop="hospital" />
<el-table-column label="联系地址" align="center" prop="address" />
<el-table-column label="个人简介" align="center" prop="introduction" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:info:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:info:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改兽医个人信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="用户ID" prop="userId">
<el-input v-model="form.userId" placeholder="请输入用户ID" />
</el-form-item>
<el-form-item label="真实姓名" prop="realName">
<el-input v-model="form.realName" placeholder="请输入真实姓名" />
</el-form-item>
<el-form-item label="性别" prop="gender">
<el-input v-model="form.gender" placeholder="请输入性别" />
</el-form-item>
<el-form-item label="出生日期" prop="birthday">
<el-date-picker clearable
v-model="form.birthday"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择出生日期">
</el-date-picker>
</el-form-item>
<el-form-item label="身份证号" prop="idCard">
<el-input v-model="form.idCard" placeholder="请输入身份证号" />
</el-form-item>
<el-form-item label="擅长领域" prop="specialty">
<el-input v-model="form.specialty" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="工作经验" prop="workExperience">
<el-input v-model="form.workExperience" placeholder="请输入工作经验" />
</el-form-item>
<el-form-item label="所属医院" prop="hospital">
<el-input v-model="form.hospital" placeholder="请输入所属医院" />
</el-form-item>
<el-form-item label="联系地址" prop="address">
<el-input v-model="form.address" placeholder="请输入联系地址" />
</el-form-item>
<el-form-item label="个人简介" prop="introduction">
<el-input v-model="form.introduction" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listInfo, getInfo, delInfo, addInfo, updateInfo } from "@/api/vet/info"
export default {
name: "Info",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
infoList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
userId: null,
realName: null,
gender: null,
birthday: null,
idCard: null,
specialty: null,
workExperience: null,
hospital: null,
address: null,
introduction: null,
},
//
form: {},
//
rules: {
userId: [
{ required: true, message: "用户ID不能为空", trigger: "blur" }
],
}
}
},
created() {
this.getList()
},
methods: {
/** 查询兽医个人信息列表 */
getList() {
this.loading = true
listInfo(this.queryParams).then(response => {
this.infoList = response.rows
this.total = response.total
this.loading = false
})
},
//
cancel() {
this.open = false
this.reset()
},
//
reset() {
this.form = {
id: null,
userId: null,
realName: null,
gender: null,
birthday: null,
idCard: null,
specialty: null,
workExperience: null,
hospital: null,
address: null,
introduction: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
}
this.resetForm("form")
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm")
this.handleQuery()
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.open = true
this.title = "添加兽医个人信息"
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const id = row.id || this.ids
getInfo(id).then(response => {
this.form = response.data
this.open = true
this.title = "修改兽医个人信息"
})
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateInfo(this.form).then(response => {
this.$modal.msgSuccess("修改成功")
this.open = false
this.getList()
})
} else {
addInfo(this.form).then(response => {
this.$modal.msgSuccess("新增成功")
this.open = false
this.getList()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids
this.$modal.confirm('是否确认删除兽医个人信息编号为"' + ids + '"的数据项?').then(function() {
return delInfo(ids)
}).then(() => {
this.getList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
this.download('system/info/export', {
...this.queryParams
}, `info_${new Date().getTime()}.xlsx`)
}
}
}
</script>
Loading…
Cancel
Save