36 changed files with 3392 additions and 2100 deletions
-
318chenhai-admin/src/main/java/com/chenhai/web/controller/vet/VetCertificateController.java
-
231chenhai-admin/src/main/java/com/chenhai/web/controller/vet/VetExperienceArticleController.java
-
3chenhai-admin/src/main/java/com/chenhai/web/controller/vet/VetPersonalInfoController.java
-
104chenhai-admin/src/main/java/com/chenhai/web/controller/vet/VetProductController.java
-
177chenhai-admin/src/main/java/com/chenhai/web/controller/vet/VetQualificationController.java
-
100chenhai-system/src/main/java/com/chenhai/vet/CertificateRemindTask.java
-
212chenhai-system/src/main/java/com/chenhai/vet/domain/VetCertificate.java
-
447chenhai-system/src/main/java/com/chenhai/vet/domain/VetProduct.java
-
263chenhai-system/src/main/java/com/chenhai/vet/domain/VetQualification.java
-
62chenhai-system/src/main/java/com/chenhai/vet/mapper/VetCertificateMapper.java
-
61chenhai-system/src/main/java/com/chenhai/vet/mapper/VetProductMapper.java
-
7chenhai-system/src/main/java/com/chenhai/vet/mapper/VetQualificationMapper.java
-
72chenhai-system/src/main/java/com/chenhai/vet/service/IVetCertificateService.java
-
4chenhai-system/src/main/java/com/chenhai/vet/service/IVetExperienceArticleService.java
-
6chenhai-system/src/main/java/com/chenhai/vet/service/IVetPersonalInfoService.java
-
61chenhai-system/src/main/java/com/chenhai/vet/service/IVetProductService.java
-
30chenhai-system/src/main/java/com/chenhai/vet/service/IVetQualificationService.java
-
6chenhai-system/src/main/java/com/chenhai/vet/service/VetNotificationService.java
-
349chenhai-system/src/main/java/com/chenhai/vet/service/impl/VetCertificateServiceImpl.java
-
25chenhai-system/src/main/java/com/chenhai/vet/service/impl/VetExperienceArticleServiceImpl.java
-
90chenhai-system/src/main/java/com/chenhai/vet/service/impl/VetNotificationServiceImpl.java
-
154chenhai-system/src/main/java/com/chenhai/vet/service/impl/VetPersonalInfoServiceImpl.java
-
93chenhai-system/src/main/java/com/chenhai/vet/service/impl/VetProductServiceImpl.java
-
256chenhai-system/src/main/java/com/chenhai/vet/service/impl/VetQualificationServiceImpl.java
-
122chenhai-system/src/main/resources/mapper/vet/VetCertificateMapper.xml
-
9chenhai-system/src/main/resources/mapper/vet/VetExperienceArticleMapper.xml
-
186chenhai-system/src/main/resources/mapper/vet/VetProductMapper.xml
-
100chenhai-system/src/main/resources/mapper/vet/VetQualificationMapper.xml
-
54chenhai-ui/src/api/vet/certificate.js
-
44chenhai-ui/src/api/vet/product.js
-
10chenhai-ui/src/api/vet/qualification.js
-
427chenhai-ui/src/views/vet/certificate/index.vue
-
27chenhai-ui/src/views/vet/comments/index.vue
-
222chenhai-ui/src/views/vet/info/index.vue
-
552chenhai-ui/src/views/vet/product/index.vue
-
484chenhai-ui/src/views/vet/qualification/index.vue
@ -1,318 +0,0 @@ |
|||
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.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.VetCertificate; |
|||
import com.chenhai.vet.service.IVetCertificateService; |
|||
import jakarta.servlet.http.HttpServletResponse; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.beans.propertyeditors.CustomNumberEditor; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.web.bind.WebDataBinder; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 兽医执业证书Controller |
|||
* |
|||
* @author ruoyi |
|||
* @date 2025-12-29 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/vet/certificate") |
|||
public class VetCertificateController extends BaseController |
|||
{ |
|||
@Autowired |
|||
private IVetCertificateService vetCertificateService; |
|||
|
|||
/** |
|||
* 初始化数据绑定,处理空字符串转换问题 |
|||
* 防止前端传递空字符串导致Long类型绑定失败 |
|||
*/ |
|||
@InitBinder |
|||
public void initBinder(WebDataBinder binder) { |
|||
// 处理Long类型字段的空字符串问题 |
|||
binder.registerCustomEditor(Long.class, new CustomNumberEditor(Long.class, true) { |
|||
@Override |
|||
public void setAsText(String text) throws IllegalArgumentException { |
|||
if (text == null || text.trim().isEmpty()) { |
|||
setValue(null); // 将空字符串转换为null |
|||
} else { |
|||
try { |
|||
setValue(Long.parseLong(text.trim())); |
|||
} catch (NumberFormatException e) { |
|||
setValue(null); // 转换失败也设为null |
|||
} |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public String getAsText() { |
|||
Object value = getValue(); |
|||
return (value != null ? value.toString() : ""); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* 获取当前用户ID |
|||
*/ |
|||
private Long getCurrentUserId() { |
|||
return SecurityUtils.getUserId(); |
|||
} |
|||
|
|||
/** |
|||
* 检查是否为管理员 |
|||
*/ |
|||
private boolean isAdmin() { |
|||
return SecurityUtils.isAdmin(getCurrentUserId()); |
|||
} |
|||
|
|||
/** |
|||
* 检查用户是否有权限访问该证书 |
|||
*/ |
|||
private boolean canAccessCertificate(Long certificateId) { |
|||
if (isAdmin()) { |
|||
return true; |
|||
} |
|||
|
|||
Long currentUserId = getCurrentUserId(); |
|||
if (currentUserId == null) { |
|||
return false; |
|||
} |
|||
|
|||
VetCertificate certificate = vetCertificateService.selectVetCertificateById(certificateId); |
|||
return certificate != null && currentUserId.equals(certificate.getUserId()); |
|||
} |
|||
|
|||
/** |
|||
* 查询兽医执业证书列表(证书管理页面使用) |
|||
* 管理员:查看所有证书 |
|||
* 普通用户:查看自己的证书 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('vet:certificate:list')") |
|||
@GetMapping("/list") |
|||
public TableDataInfo list(VetCertificate vetCertificate) |
|||
{ |
|||
startPage(); |
|||
Long currentUserId = getCurrentUserId(); |
|||
|
|||
if (currentUserId == null) { |
|||
return getDataTable(List.of()); |
|||
} |
|||
|
|||
// 管理员可以查看所有,普通用户只能查看自己的 |
|||
if (!isAdmin()) { |
|||
vetCertificate.setUserId(currentUserId); |
|||
} |
|||
// 管理员不设置userId,查看所有 |
|||
|
|||
List<VetCertificate> list = vetCertificateService.selectVetCertificateList(vetCertificate); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
/** |
|||
* 用户详情页查询证书(专用于用户详情页) |
|||
* 查看指定用户的证书列表 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('vet:certificate:list')") |
|||
@GetMapping("/listForDetail") |
|||
public TableDataInfo listForDetail(@RequestParam(value = "userId", required = false) Long userId) |
|||
{ |
|||
startPage(); |
|||
Long currentUserId = getCurrentUserId(); |
|||
|
|||
if (currentUserId == null) { |
|||
return getDataTable(List.of()); |
|||
} |
|||
|
|||
// 如果没有传userId,返回空 |
|||
if (userId == null) { |
|||
return getDataTable(List.of()); |
|||
} |
|||
|
|||
// 权限检查:管理员或查看自己 |
|||
if (!isAdmin() && !userId.equals(currentUserId)) { |
|||
return getDataTable(List.of()); |
|||
} |
|||
|
|||
VetCertificate query = new VetCertificate(); |
|||
query.setUserId(userId); |
|||
List<VetCertificate> list = vetCertificateService.selectVetCertificateList(query); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
/** |
|||
* 导出兽医执业证书列表 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('vet:certificate:export')") |
|||
@Log(title = "兽医执业证书", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(HttpServletResponse response, VetCertificate vetCertificate) |
|||
{ |
|||
List<VetCertificate> list = vetCertificateService.selectVetCertificateList(vetCertificate); |
|||
ExcelUtil<VetCertificate> util = new ExcelUtil<VetCertificate>(VetCertificate.class); |
|||
util.exportExcel(response, list, "兽医执业证书数据"); |
|||
} |
|||
|
|||
/** |
|||
* 获取兽医执业证书详细信息 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('vet:certificate:query')") |
|||
@GetMapping(value = "/{id}") |
|||
public AjaxResult getInfo(@PathVariable("id") Long id) |
|||
{ |
|||
// 权限检查 |
|||
if (!canAccessCertificate(id)) { |
|||
return error("没有权限查看此证书"); |
|||
} |
|||
return success(vetCertificateService.selectVetCertificateById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增兽医执业证书 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('vet:certificate:add')") |
|||
@Log(title = "兽医执业证书", businessType = BusinessType.INSERT) |
|||
@PostMapping |
|||
public AjaxResult add(@RequestBody VetCertificate vetCertificate) |
|||
{ |
|||
// 自动设置当前用户ID |
|||
Long currentUserId = getCurrentUserId(); |
|||
if (currentUserId == null) { |
|||
return error("用户未登录"); |
|||
} |
|||
|
|||
// 权限检查:普通用户只能给自己添加证书 |
|||
if (!isAdmin() && vetCertificate.getUserId() != null && |
|||
!vetCertificate.getUserId().equals(currentUserId)) { |
|||
return error("没有权限为其他用户添加证书"); |
|||
} |
|||
|
|||
// 设置用户ID和创建人 |
|||
vetCertificate.setUserId(currentUserId); |
|||
vetCertificate.setCreateBy(SecurityUtils.getUsername()); |
|||
|
|||
return toAjax(vetCertificateService.insertVetCertificate(vetCertificate)); |
|||
} |
|||
|
|||
/** |
|||
* 修改兽医执业证书 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('vet:certificate:edit')") |
|||
@Log(title = "兽医执业证书", businessType = BusinessType.UPDATE) |
|||
@PutMapping |
|||
public AjaxResult edit(@RequestBody VetCertificate vetCertificate) |
|||
{ |
|||
// 权限检查 |
|||
if (!canAccessCertificate(vetCertificate.getId())) { |
|||
return error("没有权限修改此证书"); |
|||
} |
|||
|
|||
// 如果是普通用户,确保不能修改用户ID |
|||
if (!isAdmin()) { |
|||
Long currentUserId = getCurrentUserId(); |
|||
if (currentUserId != null && vetCertificate.getUserId() != null && |
|||
!vetCertificate.getUserId().equals(currentUserId)) { |
|||
return error("不能修改证书所属用户"); |
|||
} |
|||
} |
|||
|
|||
return toAjax(vetCertificateService.updateVetCertificate(vetCertificate)); |
|||
} |
|||
|
|||
/** |
|||
* 删除兽医执业证书 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('vet:certificate:remove')") |
|||
@Log(title = "兽医执业证书", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public AjaxResult remove(@PathVariable Long[] ids) |
|||
{ |
|||
// 权限检查:检查是否所有证书都可以删除 |
|||
if (!isAdmin()) { |
|||
for (Long id : ids) { |
|||
if (!canAccessCertificate(id)) { |
|||
return error("没有权限删除证书ID: " + id); |
|||
} |
|||
} |
|||
} |
|||
|
|||
return toAjax(vetCertificateService.deleteVetCertificateByIds(ids)); |
|||
} |
|||
|
|||
/** |
|||
* 根据用户ID获取证书列表(兼容旧版本,建议前端迁移到listForDetail) |
|||
*/ |
|||
@GetMapping("/user/{userId}") |
|||
public AjaxResult getByUserId(@PathVariable Long userId) |
|||
{ |
|||
Long currentUserId = getCurrentUserId(); |
|||
|
|||
// 权限检查 |
|||
if (!isAdmin() && !userId.equals(currentUserId)) { |
|||
return error("没有权限查看其他用户的证书"); |
|||
} |
|||
|
|||
List<VetCertificate> list = vetCertificateService.selectCertificatesByUserId(userId); |
|||
return success(list); |
|||
} |
|||
|
|||
/** |
|||
* 获取即将过期的证书 |
|||
*/ |
|||
@GetMapping("/expiring/{userId}") |
|||
public AjaxResult getExpiringCertificates(@PathVariable Long userId) |
|||
{ |
|||
Long currentUserId = getCurrentUserId(); |
|||
|
|||
// 权限检查 |
|||
if (!isAdmin() && !userId.equals(currentUserId)) { |
|||
return error("没有权限查看其他用户的证书"); |
|||
} |
|||
|
|||
List<VetCertificate> list = vetCertificateService.selectExpiringCertificates(userId); |
|||
return success(list); |
|||
} |
|||
|
|||
/** |
|||
* 获取证书统计信息 |
|||
*/ |
|||
@GetMapping("/statistics/{userId}") |
|||
public AjaxResult getStatistics(@PathVariable Long userId) |
|||
{ |
|||
Long currentUserId = getCurrentUserId(); |
|||
|
|||
// 权限检查 |
|||
if (!isAdmin() && !userId.equals(currentUserId)) { |
|||
return error("没有权限查看其他用户的统计信息"); |
|||
} |
|||
|
|||
Map<String, Object> statistics = vetCertificateService.getCertificateStatistics(userId); |
|||
return success(statistics); |
|||
} |
|||
|
|||
/** |
|||
* 手动触发证书检查 |
|||
*/ |
|||
@PostMapping("/manual-check/{userId}") |
|||
public AjaxResult manualCheck(@PathVariable Long userId) |
|||
{ |
|||
Long currentUserId = getCurrentUserId(); |
|||
|
|||
// 权限检查 |
|||
if (!isAdmin() && !userId.equals(currentUserId)) { |
|||
return error("没有权限为其他用户检查证书"); |
|||
} |
|||
|
|||
vetCertificateService.manualCheckCertificates(userId); |
|||
return success("证书检查完成"); |
|||
} |
|||
} |
|||
@ -0,0 +1,104 @@ |
|||
package com.chenhai.web.controller.vet; |
|||
|
|||
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.vet.domain.VetProduct; |
|||
import com.chenhai.vet.service.IVetProductService; |
|||
import com.chenhai.common.utils.poi.ExcelUtil; |
|||
import com.chenhai.common.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 兽医产品信息Controller |
|||
* |
|||
* @author ruoyi |
|||
* @date 2026-01-15 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/vet/product") |
|||
public class VetProductController extends BaseController |
|||
{ |
|||
@Autowired |
|||
private IVetProductService vetProductService; |
|||
|
|||
/** |
|||
* 查询兽医产品信息列表 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('vet:product:list')") |
|||
@GetMapping("/list") |
|||
public TableDataInfo list(VetProduct vetProduct) |
|||
{ |
|||
startPage(); |
|||
List<VetProduct> list = vetProductService.selectVetProductList(vetProduct); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
/** |
|||
* 导出兽医产品信息列表 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('vet:product:export')") |
|||
@Log(title = "兽医产品信息", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(HttpServletResponse response, VetProduct vetProduct) |
|||
{ |
|||
List<VetProduct> list = vetProductService.selectVetProductList(vetProduct); |
|||
ExcelUtil<VetProduct> util = new ExcelUtil<VetProduct>(VetProduct.class); |
|||
util.exportExcel(response, list, "兽医产品信息数据"); |
|||
} |
|||
|
|||
/** |
|||
* 获取兽医产品信息详细信息 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('vet:product:query')") |
|||
@GetMapping(value = "/{id}") |
|||
public AjaxResult getInfo(@PathVariable("id") Long id) |
|||
{ |
|||
return success(vetProductService.selectVetProductById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增兽医产品信息 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('vet:product:add')") |
|||
@Log(title = "兽医产品信息", businessType = BusinessType.INSERT) |
|||
@PostMapping |
|||
public AjaxResult add(@RequestBody VetProduct vetProduct) |
|||
{ |
|||
return toAjax(vetProductService.insertVetProduct(vetProduct)); |
|||
} |
|||
|
|||
/** |
|||
* 修改兽医产品信息 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('vet:product:edit')") |
|||
@Log(title = "兽医产品信息", businessType = BusinessType.UPDATE) |
|||
@PutMapping |
|||
public AjaxResult edit(@RequestBody VetProduct vetProduct) |
|||
{ |
|||
return toAjax(vetProductService.updateVetProduct(vetProduct)); |
|||
} |
|||
|
|||
/** |
|||
* 删除兽医产品信息 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('vet:product:remove')") |
|||
@Log(title = "兽医产品信息", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public AjaxResult remove(@PathVariable Long[] ids) |
|||
{ |
|||
return toAjax(vetProductService.deleteVetProductByIds(ids)); |
|||
} |
|||
} |
|||
@ -1,212 +0,0 @@ |
|||
package com.chenhai.vet.domain; |
|||
|
|||
import com.chenhai.common.annotation.Excel; |
|||
import com.chenhai.common.core.domain.BaseEntity; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import org.apache.commons.lang3.builder.ToStringBuilder; |
|||
import org.apache.commons.lang3.builder.ToStringStyle; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 兽医执业证书对象 vet_certificate |
|||
* |
|||
* @author ruoyi |
|||
* @date 2025-12-29 |
|||
*/ |
|||
public class VetCertificate extends BaseEntity |
|||
{ |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** 主键ID */ |
|||
private Long id; |
|||
|
|||
/** 用户ID */ |
|||
@Excel(name = "用户ID") |
|||
private Long userId; |
|||
|
|||
/** 证书名称 */ |
|||
@Excel(name = "证书名称") |
|||
private String certName; |
|||
|
|||
/** 证书编号 */ |
|||
@Excel(name = "证书编号") |
|||
private String certNumber; |
|||
|
|||
/** 证书类型 */ |
|||
@Excel(name = "证书类型") |
|||
private String certType; |
|||
|
|||
/** 发证机构 */ |
|||
@Excel(name = "发证机构") |
|||
private String issueOrg; |
|||
|
|||
/** 发证日期 */ |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
@Excel(name = "发证日期", width = 30, dateFormat = "yyyy-MM-dd") |
|||
private Date issueDate; |
|||
|
|||
/** 到期日期 */ |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
@Excel(name = "到期日期", width = 30, dateFormat = "yyyy-MM-dd") |
|||
private Date expireDate; |
|||
|
|||
/** 证书图片 */ |
|||
@Excel(name = "证书图片") |
|||
private String certImage; |
|||
|
|||
/** 状态(0正常 1即将过期 2已过期) */ |
|||
@Excel(name = "状态", dictType = "certificate_status") |
|||
private String status; |
|||
|
|||
/** 提前提醒天数 */ |
|||
@Excel(name = "提前提醒天数") |
|||
private Integer remindDays; |
|||
|
|||
/** 上次提醒时间 */ |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
@Excel(name = "上次提醒时间", width = 30, dateFormat = "yyyy-MM-dd") |
|||
private Date lastRemindTime; |
|||
|
|||
public void setId(Long id) |
|||
{ |
|||
this.id = id; |
|||
} |
|||
|
|||
public Long getId() |
|||
{ |
|||
return id; |
|||
} |
|||
|
|||
public void setUserId(Long userId) |
|||
{ |
|||
this.userId = userId; |
|||
} |
|||
|
|||
public Long getUserId() |
|||
{ |
|||
return userId; |
|||
} |
|||
|
|||
public void setCertName(String certName) |
|||
{ |
|||
this.certName = certName; |
|||
} |
|||
|
|||
public String getCertName() |
|||
{ |
|||
return certName; |
|||
} |
|||
|
|||
public void setCertNumber(String certNumber) |
|||
{ |
|||
this.certNumber = certNumber; |
|||
} |
|||
|
|||
public String getCertNumber() |
|||
{ |
|||
return certNumber; |
|||
} |
|||
|
|||
public void setCertType(String certType) |
|||
{ |
|||
this.certType = certType; |
|||
} |
|||
|
|||
public String getCertType() |
|||
{ |
|||
return certType; |
|||
} |
|||
|
|||
public void setIssueOrg(String issueOrg) |
|||
{ |
|||
this.issueOrg = issueOrg; |
|||
} |
|||
|
|||
public String getIssueOrg() |
|||
{ |
|||
return issueOrg; |
|||
} |
|||
|
|||
public void setIssueDate(Date issueDate) |
|||
{ |
|||
this.issueDate = issueDate; |
|||
} |
|||
|
|||
public Date getIssueDate() |
|||
{ |
|||
return issueDate; |
|||
} |
|||
|
|||
public void setExpireDate(Date expireDate) |
|||
{ |
|||
this.expireDate = expireDate; |
|||
} |
|||
|
|||
public Date getExpireDate() |
|||
{ |
|||
return expireDate; |
|||
} |
|||
|
|||
public void setCertImage(String certImage) |
|||
{ |
|||
this.certImage = certImage; |
|||
} |
|||
|
|||
public String getCertImage() |
|||
{ |
|||
return certImage; |
|||
} |
|||
|
|||
public void setStatus(String status) |
|||
{ |
|||
this.status = status; |
|||
} |
|||
|
|||
public String getStatus() |
|||
{ |
|||
return status; |
|||
} |
|||
|
|||
public void setRemindDays(Integer remindDays) |
|||
{ |
|||
this.remindDays = remindDays; |
|||
} |
|||
|
|||
public Integer getRemindDays() |
|||
{ |
|||
return remindDays; |
|||
} |
|||
|
|||
public void setLastRemindTime(Date lastRemindTime) |
|||
{ |
|||
this.lastRemindTime = lastRemindTime; |
|||
} |
|||
|
|||
public Date getLastRemindTime() |
|||
{ |
|||
return lastRemindTime; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
|||
.append("id", getId()) |
|||
.append("userId", getUserId()) |
|||
.append("certName", getCertName()) |
|||
.append("certNumber", getCertNumber()) |
|||
.append("certType", getCertType()) |
|||
.append("issueOrg", getIssueOrg()) |
|||
.append("issueDate", getIssueDate()) |
|||
.append("expireDate", getExpireDate()) |
|||
.append("certImage", getCertImage()) |
|||
.append("status", getStatus()) |
|||
.append("remindDays", getRemindDays()) |
|||
.append("lastRemindTime", getLastRemindTime()) |
|||
.append("createBy", getCreateBy()) |
|||
.append("createTime", getCreateTime()) |
|||
.append("updateBy", getUpdateBy()) |
|||
.append("updateTime", getUpdateTime()) |
|||
.toString(); |
|||
} |
|||
} |
|||
@ -0,0 +1,447 @@ |
|||
package com.chenhai.vet.domain; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import org.apache.commons.lang3.builder.ToStringBuilder; |
|||
import org.apache.commons.lang3.builder.ToStringStyle; |
|||
import com.chenhai.common.annotation.Excel; |
|||
import com.chenhai.common.core.domain.BaseEntity; |
|||
|
|||
/** |
|||
* 兽医产品信息对象 vet_product |
|||
* |
|||
* @author ruoyi |
|||
* @date 2026-01-15 |
|||
*/ |
|||
public class VetProduct extends BaseEntity |
|||
{ |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** 主键ID */ |
|||
private Long id; |
|||
|
|||
/** 产品名称 */ |
|||
@Excel(name = "产品名称") |
|||
private String name; |
|||
|
|||
/** 产品类型:medicine-兽药/vaccine-疫苗/supplement-保健品 */ |
|||
@Excel(name = "产品类型:medicine-兽药/vaccine-疫苗/supplement-保健品") |
|||
private String type; |
|||
|
|||
/** 产品分类 */ |
|||
@Excel(name = "产品分类") |
|||
private String category; |
|||
|
|||
/** 规格 */ |
|||
@Excel(name = "规格") |
|||
private String specification; |
|||
|
|||
/** 单位 */ |
|||
@Excel(name = "单位") |
|||
private String unit; |
|||
|
|||
/** 生产厂家 */ |
|||
@Excel(name = "生产厂家") |
|||
private String manufacturer; |
|||
|
|||
/** 批准文号 */ |
|||
@Excel(name = "批准文号") |
|||
private String approvalNumber; |
|||
|
|||
/** 主要成分 */ |
|||
@Excel(name = "主要成分") |
|||
private String ingredients; |
|||
|
|||
/** 适应症 */ |
|||
@Excel(name = "适应症") |
|||
private String indications; |
|||
|
|||
/** 用法用量 */ |
|||
@Excel(name = "用法用量") |
|||
private String usageDosage; |
|||
|
|||
/** 销售价格 */ |
|||
@Excel(name = "销售价格") |
|||
private BigDecimal price; |
|||
|
|||
/** 成本价 */ |
|||
@Excel(name = "成本价") |
|||
private BigDecimal costPrice; |
|||
|
|||
/** 库存数量 */ |
|||
@Excel(name = "库存数量") |
|||
private Long stock; |
|||
|
|||
/** 最低库存预警 */ |
|||
@Excel(name = "最低库存预警") |
|||
private Long minStock; |
|||
|
|||
/** 主图URL */ |
|||
@Excel(name = "主图URL") |
|||
private String mainImage; |
|||
|
|||
/** 多张图片URL,JSON格式 */ |
|||
@Excel(name = "多张图片URL,JSON格式") |
|||
private String images; |
|||
|
|||
/** 适用动物:如犬、猫、猪等 */ |
|||
@Excel(name = "适用动物:如犬、猫、猪等") |
|||
private String treatAnimals; |
|||
|
|||
/** 治疗疾病 */ |
|||
@Excel(name = "治疗疾病") |
|||
private String treatDiseases; |
|||
|
|||
/** 治疗方案/内容 */ |
|||
@Excel(name = "治疗方案/内容") |
|||
private String treatmentContent; |
|||
|
|||
/** 治疗周期 */ |
|||
@Excel(name = "治疗周期") |
|||
private String treatmentDuration; |
|||
|
|||
/** 注意事项 */ |
|||
@Excel(name = "注意事项") |
|||
private String precautions; |
|||
|
|||
/** 状态:0-草稿/1-上架/2-下架 */ |
|||
@Excel(name = "状态:0-草稿/1-上架/2-下架") |
|||
private String status; |
|||
|
|||
/** 删除标识:0-正常/1-删除 */ |
|||
@Excel(name = "删除标识:0-正常/1-删除") |
|||
private Integer isDeleted; |
|||
|
|||
/** 诊所ID */ |
|||
@Excel(name = "诊所ID") |
|||
private Long clinicId; |
|||
|
|||
/** 兽医ID */ |
|||
@Excel(name = "兽医ID") |
|||
private Long userId; |
|||
|
|||
/** 创建时间 */ |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd") |
|||
private Date createdAt; |
|||
|
|||
/** 更新时间 */ |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd") |
|||
private Date updatedAt; |
|||
|
|||
public void setId(Long id) |
|||
{ |
|||
this.id = id; |
|||
} |
|||
|
|||
public Long getId() |
|||
{ |
|||
return id; |
|||
} |
|||
|
|||
public void setName(String name) |
|||
{ |
|||
this.name = name; |
|||
} |
|||
|
|||
public String getName() |
|||
{ |
|||
return name; |
|||
} |
|||
|
|||
public void setType(String type) |
|||
{ |
|||
this.type = type; |
|||
} |
|||
|
|||
public String getType() |
|||
{ |
|||
return type; |
|||
} |
|||
|
|||
public void setCategory(String category) |
|||
{ |
|||
this.category = category; |
|||
} |
|||
|
|||
public String getCategory() |
|||
{ |
|||
return category; |
|||
} |
|||
|
|||
public void setSpecification(String specification) |
|||
{ |
|||
this.specification = specification; |
|||
} |
|||
|
|||
public String getSpecification() |
|||
{ |
|||
return specification; |
|||
} |
|||
|
|||
public void setUnit(String unit) |
|||
{ |
|||
this.unit = unit; |
|||
} |
|||
|
|||
public String getUnit() |
|||
{ |
|||
return unit; |
|||
} |
|||
|
|||
public void setManufacturer(String manufacturer) |
|||
{ |
|||
this.manufacturer = manufacturer; |
|||
} |
|||
|
|||
public String getManufacturer() |
|||
{ |
|||
return manufacturer; |
|||
} |
|||
|
|||
public void setApprovalNumber(String approvalNumber) |
|||
{ |
|||
this.approvalNumber = approvalNumber; |
|||
} |
|||
|
|||
public String getApprovalNumber() |
|||
{ |
|||
return approvalNumber; |
|||
} |
|||
|
|||
public void setIngredients(String ingredients) |
|||
{ |
|||
this.ingredients = ingredients; |
|||
} |
|||
|
|||
public String getIngredients() |
|||
{ |
|||
return ingredients; |
|||
} |
|||
|
|||
public void setIndications(String indications) |
|||
{ |
|||
this.indications = indications; |
|||
} |
|||
|
|||
public String getIndications() |
|||
{ |
|||
return indications; |
|||
} |
|||
|
|||
public void setUsageDosage(String usageDosage) |
|||
{ |
|||
this.usageDosage = usageDosage; |
|||
} |
|||
|
|||
public String getUsageDosage() |
|||
{ |
|||
return usageDosage; |
|||
} |
|||
|
|||
public void setPrice(BigDecimal price) |
|||
{ |
|||
this.price = price; |
|||
} |
|||
|
|||
public BigDecimal getPrice() |
|||
{ |
|||
return price; |
|||
} |
|||
|
|||
public void setCostPrice(BigDecimal costPrice) |
|||
{ |
|||
this.costPrice = costPrice; |
|||
} |
|||
|
|||
public BigDecimal getCostPrice() |
|||
{ |
|||
return costPrice; |
|||
} |
|||
|
|||
public void setStock(Long stock) |
|||
{ |
|||
this.stock = stock; |
|||
} |
|||
|
|||
public Long getStock() |
|||
{ |
|||
return stock; |
|||
} |
|||
|
|||
public void setMinStock(Long minStock) |
|||
{ |
|||
this.minStock = minStock; |
|||
} |
|||
|
|||
public Long getMinStock() |
|||
{ |
|||
return minStock; |
|||
} |
|||
|
|||
public void setMainImage(String mainImage) |
|||
{ |
|||
this.mainImage = mainImage; |
|||
} |
|||
|
|||
public String getMainImage() |
|||
{ |
|||
return mainImage; |
|||
} |
|||
|
|||
public void setImages(String images) |
|||
{ |
|||
this.images = images; |
|||
} |
|||
|
|||
public String getImages() |
|||
{ |
|||
return images; |
|||
} |
|||
|
|||
public void setTreatAnimals(String treatAnimals) |
|||
{ |
|||
this.treatAnimals = treatAnimals; |
|||
} |
|||
|
|||
public String getTreatAnimals() |
|||
{ |
|||
return treatAnimals; |
|||
} |
|||
|
|||
public void setTreatDiseases(String treatDiseases) |
|||
{ |
|||
this.treatDiseases = treatDiseases; |
|||
} |
|||
|
|||
public String getTreatDiseases() |
|||
{ |
|||
return treatDiseases; |
|||
} |
|||
|
|||
public void setTreatmentContent(String treatmentContent) |
|||
{ |
|||
this.treatmentContent = treatmentContent; |
|||
} |
|||
|
|||
public String getTreatmentContent() |
|||
{ |
|||
return treatmentContent; |
|||
} |
|||
|
|||
public void setTreatmentDuration(String treatmentDuration) |
|||
{ |
|||
this.treatmentDuration = treatmentDuration; |
|||
} |
|||
|
|||
public String getTreatmentDuration() |
|||
{ |
|||
return treatmentDuration; |
|||
} |
|||
|
|||
public void setPrecautions(String precautions) |
|||
{ |
|||
this.precautions = precautions; |
|||
} |
|||
|
|||
public String getPrecautions() |
|||
{ |
|||
return precautions; |
|||
} |
|||
|
|||
public void setStatus(String status) |
|||
{ |
|||
this.status = status; |
|||
} |
|||
|
|||
public String getStatus() |
|||
{ |
|||
return status; |
|||
} |
|||
|
|||
public void setIsDeleted(Integer isDeleted) |
|||
{ |
|||
this.isDeleted = isDeleted; |
|||
} |
|||
|
|||
public Integer getIsDeleted() |
|||
{ |
|||
return isDeleted; |
|||
} |
|||
|
|||
public void setClinicId(Long clinicId) |
|||
{ |
|||
this.clinicId = clinicId; |
|||
} |
|||
|
|||
public Long getClinicId() |
|||
{ |
|||
return clinicId; |
|||
} |
|||
|
|||
public void setUserId(Long userId) |
|||
{ |
|||
this.userId = userId; |
|||
} |
|||
|
|||
public Long getUserId() |
|||
{ |
|||
return userId; |
|||
} |
|||
|
|||
public void setCreatedAt(Date createdAt) |
|||
{ |
|||
this.createdAt = createdAt; |
|||
} |
|||
|
|||
public Date getCreatedAt() |
|||
{ |
|||
return createdAt; |
|||
} |
|||
|
|||
public void setUpdatedAt(Date updatedAt) |
|||
{ |
|||
this.updatedAt = updatedAt; |
|||
} |
|||
|
|||
public Date getUpdatedAt() |
|||
{ |
|||
return updatedAt; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
|||
.append("id", getId()) |
|||
.append("name", getName()) |
|||
.append("type", getType()) |
|||
.append("category", getCategory()) |
|||
.append("specification", getSpecification()) |
|||
.append("unit", getUnit()) |
|||
.append("manufacturer", getManufacturer()) |
|||
.append("approvalNumber", getApprovalNumber()) |
|||
.append("ingredients", getIngredients()) |
|||
.append("indications", getIndications()) |
|||
.append("usageDosage", getUsageDosage()) |
|||
.append("price", getPrice()) |
|||
.append("costPrice", getCostPrice()) |
|||
.append("stock", getStock()) |
|||
.append("minStock", getMinStock()) |
|||
.append("mainImage", getMainImage()) |
|||
.append("images", getImages()) |
|||
.append("treatAnimals", getTreatAnimals()) |
|||
.append("treatDiseases", getTreatDiseases()) |
|||
.append("treatmentContent", getTreatmentContent()) |
|||
.append("treatmentDuration", getTreatmentDuration()) |
|||
.append("precautions", getPrecautions()) |
|||
.append("status", getStatus()) |
|||
.append("isDeleted", getIsDeleted()) |
|||
.append("clinicId", getClinicId()) |
|||
.append("userId", getUserId()) |
|||
.append("createdAt", getCreatedAt()) |
|||
.append("updatedAt", getUpdatedAt()) |
|||
.toString(); |
|||
} |
|||
} |
|||
@ -1,62 +0,0 @@ |
|||
package com.chenhai.vet.mapper; |
|||
|
|||
import com.chenhai.vet.domain.VetCertificate; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 兽医执业证书Mapper接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2025-12-29 |
|||
*/ |
|||
public interface VetCertificateMapper |
|||
{ |
|||
/** |
|||
* 查询兽医执业证书 |
|||
* |
|||
* @param id 兽医执业证书主键 |
|||
* @return 兽医执业证书 |
|||
*/ |
|||
public VetCertificate selectVetCertificateById(Long id); |
|||
|
|||
/** |
|||
* 查询兽医执业证书列表 |
|||
* |
|||
* @param vetCertificate 兽医执业证书 |
|||
* @return 兽医执业证书集合 |
|||
*/ |
|||
public List<VetCertificate> selectVetCertificateList(VetCertificate vetCertificate); |
|||
|
|||
/** |
|||
* 新增兽医执业证书 |
|||
* |
|||
* @param vetCertificate 兽医执业证书 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertVetCertificate(VetCertificate vetCertificate); |
|||
|
|||
/** |
|||
* 修改兽医执业证书 |
|||
* |
|||
* @param vetCertificate 兽医执业证书 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateVetCertificate(VetCertificate vetCertificate); |
|||
|
|||
/** |
|||
* 删除兽医执业证书 |
|||
* |
|||
* @param id 兽医执业证书主键 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteVetCertificateById(Long id); |
|||
|
|||
/** |
|||
* 批量删除兽医执业证书 |
|||
* |
|||
* @param ids 需要删除的数据主键集合 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteVetCertificateByIds(Long[] ids); |
|||
} |
|||
@ -0,0 +1,61 @@ |
|||
package com.chenhai.vet.mapper; |
|||
|
|||
import java.util.List; |
|||
import com.chenhai.vet.domain.VetProduct; |
|||
|
|||
/** |
|||
* 兽医产品信息Mapper接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2026-01-15 |
|||
*/ |
|||
public interface VetProductMapper |
|||
{ |
|||
/** |
|||
* 查询兽医产品信息 |
|||
* |
|||
* @param id 兽医产品信息主键 |
|||
* @return 兽医产品信息 |
|||
*/ |
|||
public VetProduct selectVetProductById(Long id); |
|||
|
|||
/** |
|||
* 查询兽医产品信息列表 |
|||
* |
|||
* @param vetProduct 兽医产品信息 |
|||
* @return 兽医产品信息集合 |
|||
*/ |
|||
public List<VetProduct> selectVetProductList(VetProduct vetProduct); |
|||
|
|||
/** |
|||
* 新增兽医产品信息 |
|||
* |
|||
* @param vetProduct 兽医产品信息 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertVetProduct(VetProduct vetProduct); |
|||
|
|||
/** |
|||
* 修改兽医产品信息 |
|||
* |
|||
* @param vetProduct 兽医产品信息 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateVetProduct(VetProduct vetProduct); |
|||
|
|||
/** |
|||
* 删除兽医产品信息 |
|||
* |
|||
* @param id 兽医产品信息主键 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteVetProductById(Long id); |
|||
|
|||
/** |
|||
* 批量删除兽医产品信息 |
|||
* |
|||
* @param ids 需要删除的数据主键集合 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteVetProductByIds(Long[] ids); |
|||
} |
|||
@ -1,72 +0,0 @@ |
|||
package com.chenhai.vet.service; |
|||
|
|||
import com.chenhai.vet.domain.VetCertificate; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 兽医执业证书Service接口 |
|||
*/ |
|||
public interface IVetCertificateService |
|||
{ |
|||
/** |
|||
* 查询兽医执业证书 |
|||
*/ |
|||
VetCertificate selectVetCertificateById(Long id); |
|||
|
|||
/** |
|||
* 查询兽医执业证书列表 |
|||
*/ |
|||
List<VetCertificate> selectVetCertificateList(VetCertificate vetCertificate); |
|||
|
|||
/** |
|||
* 新增兽医执业证书 |
|||
*/ |
|||
int insertVetCertificate(VetCertificate vetCertificate); |
|||
|
|||
/** |
|||
* 修改兽医执业证书 |
|||
*/ |
|||
int updateVetCertificate(VetCertificate vetCertificate); |
|||
|
|||
/** |
|||
* 批量删除兽医执业证书 |
|||
*/ |
|||
int deleteVetCertificateByIds(Long[] ids); |
|||
|
|||
/** |
|||
* 删除兽医执业证书信息 |
|||
*/ |
|||
int deleteVetCertificateById(Long id); |
|||
|
|||
/** |
|||
* 根据用户ID查询证书列表 |
|||
*/ |
|||
List<VetCertificate> selectCertificatesByUserId(Long userId); |
|||
|
|||
/** |
|||
* 获取即将过期的证书(30天内) |
|||
*/ |
|||
List<VetCertificate> selectExpiringCertificates(Long userId); |
|||
|
|||
/** |
|||
* 检查并发送证书过期提醒 |
|||
*/ |
|||
void checkAndSendCertificateReminders(); |
|||
|
|||
/** |
|||
* 手动触发证书检查 |
|||
*/ |
|||
void manualCheckCertificates(Long userId); |
|||
|
|||
/** |
|||
* 获取证书统计信息 |
|||
*/ |
|||
Map<String, Object> getCertificateStatistics(Long userId); |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,61 @@ |
|||
package com.chenhai.vet.service; |
|||
|
|||
import java.util.List; |
|||
import com.chenhai.vet.domain.VetProduct; |
|||
|
|||
/** |
|||
* 兽医产品信息Service接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2026-01-15 |
|||
*/ |
|||
public interface IVetProductService |
|||
{ |
|||
/** |
|||
* 查询兽医产品信息 |
|||
* |
|||
* @param id 兽医产品信息主键 |
|||
* @return 兽医产品信息 |
|||
*/ |
|||
public VetProduct selectVetProductById(Long id); |
|||
|
|||
/** |
|||
* 查询兽医产品信息列表 |
|||
* |
|||
* @param vetProduct 兽医产品信息 |
|||
* @return 兽医产品信息集合 |
|||
*/ |
|||
public List<VetProduct> selectVetProductList(VetProduct vetProduct); |
|||
|
|||
/** |
|||
* 新增兽医产品信息 |
|||
* |
|||
* @param vetProduct 兽医产品信息 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertVetProduct(VetProduct vetProduct); |
|||
|
|||
/** |
|||
* 修改兽医产品信息 |
|||
* |
|||
* @param vetProduct 兽医产品信息 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateVetProduct(VetProduct vetProduct); |
|||
|
|||
/** |
|||
* 批量删除兽医产品信息 |
|||
* |
|||
* @param ids 需要删除的兽医产品信息主键集合 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteVetProductByIds(Long[] ids); |
|||
|
|||
/** |
|||
* 删除兽医产品信息信息 |
|||
* |
|||
* @param id 兽医产品信息主键 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteVetProductById(Long id); |
|||
} |
|||
@ -1,349 +0,0 @@ |
|||
package com.chenhai.vet.service.impl; |
|||
|
|||
import com.chenhai.common.utils.DateUtils; |
|||
import com.chenhai.vet.domain.VetCertificate; |
|||
import com.chenhai.vet.mapper.VetCertificateMapper; |
|||
import com.chenhai.vet.service.IVetCertificateService; |
|||
import com.chenhai.vet.service.VetNotificationService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.Calendar; |
|||
import java.util.Date; |
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 兽医执业证书Service业务层处理 |
|||
*/ |
|||
@Service |
|||
public class VetCertificateServiceImpl implements IVetCertificateService |
|||
{ |
|||
@Autowired |
|||
private VetCertificateMapper vetCertificateMapper; |
|||
@Autowired |
|||
private VetNotificationService vetNotificationService; |
|||
|
|||
@Override |
|||
public VetCertificate selectVetCertificateById(Long id) |
|||
{ |
|||
return vetCertificateMapper.selectVetCertificateById(id); |
|||
} |
|||
|
|||
@Override |
|||
public List<VetCertificate> selectVetCertificateList(VetCertificate vetCertificate) |
|||
{ |
|||
return vetCertificateMapper.selectVetCertificateList(vetCertificate); |
|||
} |
|||
|
|||
@Override |
|||
public int insertVetCertificate(VetCertificate vetCertificate) |
|||
{ |
|||
vetCertificate.setCreateTime(DateUtils.getNowDate()); |
|||
|
|||
// 验证并设置证书状态 |
|||
updateCertificateStatus(vetCertificate); |
|||
|
|||
// 设置默认提醒天数 |
|||
if (vetCertificate.getRemindDays() == null) { |
|||
vetCertificate.setRemindDays(30); |
|||
} |
|||
|
|||
return vetCertificateMapper.insertVetCertificate(vetCertificate); |
|||
} |
|||
|
|||
@Override |
|||
public int updateVetCertificate(VetCertificate vetCertificate) |
|||
{ |
|||
vetCertificate.setUpdateTime(DateUtils.getNowDate()); |
|||
|
|||
// 验证并更新证书状态 |
|||
updateCertificateStatus(vetCertificate); |
|||
|
|||
return vetCertificateMapper.updateVetCertificate(vetCertificate); |
|||
} |
|||
|
|||
@Override |
|||
public int deleteVetCertificateByIds(Long[] ids) |
|||
{ |
|||
return vetCertificateMapper.deleteVetCertificateByIds(ids); |
|||
} |
|||
|
|||
@Override |
|||
public int deleteVetCertificateById(Long id) |
|||
{ |
|||
return vetCertificateMapper.deleteVetCertificateById(id); |
|||
} |
|||
|
|||
@Override |
|||
public List<VetCertificate> selectCertificatesByUserId(Long userId) |
|||
{ |
|||
VetCertificate query = new VetCertificate(); |
|||
query.setUserId(userId); |
|||
return vetCertificateMapper.selectVetCertificateList(query); |
|||
} |
|||
|
|||
@Override |
|||
public List<VetCertificate> selectExpiringCertificates(Long userId) |
|||
{ |
|||
Date today = new Date(); |
|||
Calendar calendar = Calendar.getInstance(); |
|||
calendar.setTime(today); |
|||
calendar.add(Calendar.DAY_OF_YEAR, 30); |
|||
Date thirtyDaysLater = calendar.getTime(); |
|||
|
|||
// 先获取用户所有证书 |
|||
List<VetCertificate> allCertificates = selectCertificatesByUserId(userId); |
|||
|
|||
// 过滤出即将过期的证书 |
|||
return allCertificates.stream() |
|||
.filter(cert -> cert.getExpireDate() != null && |
|||
!cert.getExpireDate().before(today) && |
|||
!cert.getExpireDate().after(thirtyDaysLater)) |
|||
.toList(); |
|||
} |
|||
|
|||
@Override |
|||
public void checkAndSendCertificateReminders() |
|||
{ |
|||
Date today = new Date(); |
|||
|
|||
Calendar calendar = Calendar.getInstance(); |
|||
calendar.setTime(today); |
|||
calendar.add(Calendar.DAY_OF_YEAR, 30); |
|||
Date thresholdDate = calendar.getTime(); // 30天后过期 |
|||
|
|||
calendar.setTime(today); |
|||
calendar.add(Calendar.DAY_OF_YEAR, -7); |
|||
Date remindDate = calendar.getTime(); // 7天前提醒过的不再提醒 |
|||
|
|||
// 查询所有证书 |
|||
VetCertificate query = new VetCertificate(); |
|||
List<VetCertificate> allCertificates = vetCertificateMapper.selectVetCertificateList(query); |
|||
|
|||
int successCount = 0; |
|||
int failCount = 0; |
|||
|
|||
for (VetCertificate certificate : allCertificates) { |
|||
try { |
|||
// 检查证书是否需要提醒 |
|||
if (shouldSendRemind(certificate, today, thresholdDate, remindDate)) { |
|||
// ✅ 调用通知服务发送站内信 |
|||
vetNotificationService.sendCertificateExpireRemind(certificate); |
|||
|
|||
// 更新最后提醒时间 |
|||
certificate.setLastRemindTime(new Date()); |
|||
vetCertificateMapper.updateVetCertificate(certificate); |
|||
|
|||
successCount++; |
|||
// 保留原来的日志输出 |
|||
/* System.out.println("发送证书提醒:证书ID=" + certificate.getId() + |
|||
", 证书名称=" + certificate.getCertName());*/ |
|||
} |
|||
} catch (Exception e) { |
|||
failCount++; |
|||
e.printStackTrace(); |
|||
} |
|||
} |
|||
|
|||
/*// 添加统计日志 |
|||
System.out.println("证书提醒任务完成:成功 " + successCount + " 条,失败 " + failCount + " 条");*/ |
|||
} |
|||
|
|||
/** |
|||
* 判断是否需要发送提醒 |
|||
*/ |
|||
private boolean shouldSendRemind(VetCertificate certificate, Date today, |
|||
Date thresholdDate, Date remindDate) { |
|||
if (certificate.getExpireDate() == null) { |
|||
return false; |
|||
} |
|||
|
|||
// 检查是否即将过期(30天内) |
|||
if (certificate.getExpireDate().after(thresholdDate)) { |
|||
return false; |
|||
} |
|||
|
|||
// 检查是否已提醒过(7天内) |
|||
if (certificate.getLastRemindTime() != null) { |
|||
Calendar cal = Calendar.getInstance(); |
|||
cal.setTime(certificate.getLastRemindTime()); |
|||
cal.set(Calendar.HOUR_OF_DAY, 0); |
|||
cal.set(Calendar.MINUTE, 0); |
|||
cal.set(Calendar.SECOND, 0); |
|||
cal.set(Calendar.MILLISECOND, 0); |
|||
Date lastRemindDateOnly = cal.getTime(); |
|||
|
|||
if (!lastRemindDateOnly.before(remindDate)) { |
|||
return false; |
|||
} |
|||
} |
|||
|
|||
return true; |
|||
} |
|||
|
|||
/** |
|||
* 发送证书过期提醒 |
|||
*//* |
|||
private void sendCertificateExpireRemind(VetCertificate certificate) { |
|||
Date today = new Date(); |
|||
long daysBetween = calculateDayDifference(today, certificate.getExpireDate()); |
|||
|
|||
String title; |
|||
String content; |
|||
int remindLevel; |
|||
|
|||
if (daysBetween <= 0) { |
|||
title = "证书已过期"; |
|||
content = String.format("您的《%s》证书已于%s过期!请立即更新证书。", |
|||
certificate.getCertName(), formatDate(certificate.getExpireDate())); |
|||
remindLevel = 3; |
|||
} else if (daysBetween <= 7) { |
|||
title = "证书即将过期(7天内)"; |
|||
content = String.format("您的《%s》证书将在%d天后过期,请尽快更新!", |
|||
certificate.getCertName(), daysBetween); |
|||
remindLevel = 3; |
|||
} else { |
|||
title = "证书即将过期(30天内)"; |
|||
content = String.format("您的《%s》证书将在%d天后过期,请及时更新。", |
|||
certificate.getCertName(), daysBetween); |
|||
remindLevel = 2; |
|||
} |
|||
|
|||
System.out.println("发送证书提醒:" + title + " - " + content); |
|||
} |
|||
*/ |
|||
/** |
|||
* 计算两个日期之间的天数差(自己实现,不依赖DateUtils) |
|||
*/ |
|||
private long calculateDayDifference(Date startDate, Date endDate) { |
|||
if (startDate == null || endDate == null) { |
|||
return 0L; |
|||
} |
|||
|
|||
// 清除时间部分,只比较日期 |
|||
Calendar startCal = Calendar.getInstance(); |
|||
startCal.setTime(startDate); |
|||
startCal.set(Calendar.HOUR_OF_DAY, 0); |
|||
startCal.set(Calendar.MINUTE, 0); |
|||
startCal.set(Calendar.SECOND, 0); |
|||
startCal.set(Calendar.MILLISECOND, 0); |
|||
|
|||
Calendar endCal = Calendar.getInstance(); |
|||
endCal.setTime(endDate); |
|||
endCal.set(Calendar.HOUR_OF_DAY, 0); |
|||
endCal.set(Calendar.MINUTE, 0); |
|||
endCal.set(Calendar.SECOND, 0); |
|||
endCal.set(Calendar.MILLISECOND, 0); |
|||
|
|||
long diff = endCal.getTimeInMillis() - startCal.getTimeInMillis(); |
|||
return diff / (1000 * 60 * 60 * 24); |
|||
} |
|||
|
|||
/** |
|||
* 格式化日期为字符串 |
|||
*/ |
|||
private String formatDate(Date date) { |
|||
if (date == null) { |
|||
return ""; |
|||
} |
|||
Calendar calendar = Calendar.getInstance(); |
|||
calendar.setTime(date); |
|||
int year = calendar.get(Calendar.YEAR); |
|||
int month = calendar.get(Calendar.MONTH) + 1; // 月份从0开始 |
|||
int day = calendar.get(Calendar.DAY_OF_MONTH); |
|||
return String.format("%d-%02d-%02d", year, month, day); |
|||
} |
|||
|
|||
/** |
|||
* 更新证书状态 |
|||
*/ |
|||
private void updateCertificateStatus(VetCertificate certificate) { |
|||
if (certificate.getExpireDate() == null) { |
|||
certificate.setStatus("0"); // 默认正常 |
|||
return;} |
|||
|
|||
Date today = new Date(); |
|||
Calendar calendar = Calendar.getInstance(); |
|||
calendar.setTime(today); |
|||
calendar.add(Calendar.DAY_OF_YEAR, 30); |
|||
Date thirtyDaysLater = calendar.getTime(); |
|||
|
|||
if (certificate.getExpireDate().before(today)) { |
|||
certificate.setStatus("2"); // 已过期 |
|||
} else if (certificate.getExpireDate().before(thirtyDaysLater)) { |
|||
certificate.setStatus("1"); // 即将过期 |
|||
} else { |
|||
certificate.setStatus("0"); // 正常 |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public void manualCheckCertificates(Long userId) { |
|||
List<VetCertificate> certificates = selectCertificatesByUserId(userId); |
|||
for (VetCertificate certificate : certificates) { |
|||
updateCertificateStatus(certificate); |
|||
vetCertificateMapper.updateVetCertificate(certificate); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public Map<String, Object> getCertificateStatistics(Long userId) { |
|||
Map<String, Object> statistics = new HashMap<>(); |
|||
|
|||
List<VetCertificate> certificates = selectCertificatesByUserId(userId); |
|||
Date today = new Date(); |
|||
|
|||
long total = certificates.size(); |
|||
long expiring = 0; // 30天内过期 |
|||
long expired = 0; // 已过期 |
|||
int expiringSoon = 0; // 7天内过期 |
|||
|
|||
Calendar calendar = Calendar.getInstance(); |
|||
calendar.setTime(today); |
|||
calendar.add(Calendar.DAY_OF_YEAR, 30); |
|||
Date thirtyDaysLater = calendar.getTime(); |
|||
|
|||
calendar.setTime(today); |
|||
calendar.add(Calendar.DAY_OF_YEAR, 7); |
|||
Date sevenDaysLater = calendar.getTime(); |
|||
|
|||
for (VetCertificate cert : certificates) { |
|||
if (cert.getExpireDate() != null) { |
|||
if (cert.getExpireDate().before(today)) { |
|||
expired++; |
|||
} else if (cert.getExpireDate().before(thirtyDaysLater)) { |
|||
expiring++; |
|||
|
|||
// 7天内过期 |
|||
if (cert.getExpireDate().before(sevenDaysLater)) { |
|||
expiringSoon++; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
long normal = total - expiring - expired; |
|||
|
|||
statistics.put("total", total); |
|||
statistics.put("normal", normal); |
|||
statistics.put("expiring", expiring); |
|||
statistics.put("expired", expired); |
|||
statistics.put("expiringSoon", expiringSoon); |
|||
|
|||
// 设置警告级别 |
|||
if (expired > 0) { |
|||
statistics.put("warningLevel", "DANGER"); |
|||
} else if (expiring > 0 || expiringSoon > 0) { |
|||
statistics.put("warningLevel", "WARNING"); |
|||
} else { |
|||
statistics.put("warningLevel", "NORMAL"); |
|||
} |
|||
|
|||
return statistics; |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,93 @@ |
|||
package com.chenhai.vet.service.impl; |
|||
|
|||
import java.util.List; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import com.chenhai.vet.mapper.VetProductMapper; |
|||
import com.chenhai.vet.domain.VetProduct; |
|||
import com.chenhai.vet.service.IVetProductService; |
|||
|
|||
/** |
|||
* 兽医产品信息Service业务层处理 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2026-01-15 |
|||
*/ |
|||
@Service |
|||
public class VetProductServiceImpl implements IVetProductService |
|||
{ |
|||
@Autowired |
|||
private VetProductMapper vetProductMapper; |
|||
|
|||
/** |
|||
* 查询兽医产品信息 |
|||
* |
|||
* @param id 兽医产品信息主键 |
|||
* @return 兽医产品信息 |
|||
*/ |
|||
@Override |
|||
public VetProduct selectVetProductById(Long id) |
|||
{ |
|||
return vetProductMapper.selectVetProductById(id); |
|||
} |
|||
|
|||
/** |
|||
* 查询兽医产品信息列表 |
|||
* |
|||
* @param vetProduct 兽医产品信息 |
|||
* @return 兽医产品信息 |
|||
*/ |
|||
@Override |
|||
public List<VetProduct> selectVetProductList(VetProduct vetProduct) |
|||
{ |
|||
return vetProductMapper.selectVetProductList(vetProduct); |
|||
} |
|||
|
|||
/** |
|||
* 新增兽医产品信息 |
|||
* |
|||
* @param vetProduct 兽医产品信息 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int insertVetProduct(VetProduct vetProduct) |
|||
{ |
|||
return vetProductMapper.insertVetProduct(vetProduct); |
|||
} |
|||
|
|||
/** |
|||
* 修改兽医产品信息 |
|||
* |
|||
* @param vetProduct 兽医产品信息 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int updateVetProduct(VetProduct vetProduct) |
|||
{ |
|||
return vetProductMapper.updateVetProduct(vetProduct); |
|||
} |
|||
|
|||
/** |
|||
* 批量删除兽医产品信息 |
|||
* |
|||
* @param ids 需要删除的兽医产品信息主键 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteVetProductByIds(Long[] ids) |
|||
{ |
|||
return vetProductMapper.deleteVetProductByIds(ids); |
|||
} |
|||
|
|||
/** |
|||
* 删除兽医产品信息信息 |
|||
* |
|||
* @param id 兽医产品信息主键 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteVetProductById(Long id) |
|||
{ |
|||
return vetProductMapper.deleteVetProductById(id); |
|||
} |
|||
} |
|||
@ -1,122 +0,0 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<!DOCTYPE mapper |
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="com.chenhai.vet.mapper.VetCertificateMapper"> |
|||
|
|||
<resultMap type="VetCertificate" id="VetCertificateResult"> |
|||
<result property="id" column="id" /> |
|||
<result property="userId" column="user_id" /> |
|||
<result property="certName" column="cert_name" /> |
|||
<result property="certNumber" column="cert_number" /> |
|||
<result property="certType" column="cert_type" /> |
|||
<result property="issueOrg" column="issue_org" /> |
|||
<result property="issueDate" column="issue_date" /> |
|||
<result property="expireDate" column="expire_date" /> |
|||
<result property="certImage" column="cert_image" /> |
|||
<result property="status" column="status" /> |
|||
<result property="remindDays" column="remind_days" /> |
|||
<result property="lastRemindTime" column="last_remind_time" /> |
|||
<result property="createBy" column="create_by" /> |
|||
<result property="createTime" column="create_time" /> |
|||
<result property="updateBy" column="update_by" /> |
|||
<result property="updateTime" column="update_time" /> |
|||
</resultMap> |
|||
|
|||
<sql id="selectVetCertificateVo"> |
|||
select id, user_id, cert_name, cert_number, cert_type, issue_org, issue_date, expire_date, cert_image, status, remind_days, last_remind_time, create_by, create_time, update_by, update_time from vet_certificate |
|||
</sql> |
|||
|
|||
<select id="selectVetCertificateList" parameterType="VetCertificate" resultMap="VetCertificateResult"> |
|||
<include refid="selectVetCertificateVo"/> |
|||
<where> |
|||
<if test="userId != null "> and user_id = #{userId}</if> |
|||
<if test="certName != null and certName != ''"> and cert_name like concat('%', #{certName}, '%')</if> |
|||
<if test="certNumber != null and certNumber != ''"> and cert_number = #{certNumber}</if> |
|||
<if test="certType != null and certType != ''"> and cert_type = #{certType}</if> |
|||
<if test="issueOrg != null and issueOrg != ''"> and issue_org = #{issueOrg}</if> |
|||
<if test="issueDate != null "> and issue_date = #{issueDate}</if> |
|||
<if test="expireDate != null "> and expire_date = #{expireDate}</if> |
|||
<if test="certImage != null and certImage != ''"> and cert_image = #{certImage}</if> |
|||
<if test="status != null and status != ''"> and status = #{status}</if> |
|||
<if test="remindDays != null "> and remind_days = #{remindDays}</if> |
|||
<if test="lastRemindTime != null "> and last_remind_time = #{lastRemindTime}</if> |
|||
</where> |
|||
</select> |
|||
|
|||
<select id="selectVetCertificateById" parameterType="Long" resultMap="VetCertificateResult"> |
|||
<include refid="selectVetCertificateVo"/> |
|||
where id = #{id} |
|||
</select> |
|||
|
|||
<insert id="insertVetCertificate" parameterType="VetCertificate" useGeneratedKeys="true" keyProperty="id"> |
|||
insert into vet_certificate |
|||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|||
<if test="userId != null">user_id,</if> |
|||
<if test="certName != null">cert_name,</if> |
|||
<if test="certNumber != null">cert_number,</if> |
|||
<if test="certType != null">cert_type,</if> |
|||
<if test="issueOrg != null">issue_org,</if> |
|||
<if test="issueDate != null">issue_date,</if> |
|||
<if test="expireDate != null">expire_date,</if> |
|||
<if test="certImage != null">cert_image,</if> |
|||
<if test="status != null">status,</if> |
|||
<if test="remindDays != null">remind_days,</if> |
|||
<if test="lastRemindTime != null">last_remind_time,</if> |
|||
<if test="createBy != null">create_by,</if> |
|||
<if test="createTime != null">create_time,</if> |
|||
<if test="updateBy != null">update_by,</if> |
|||
<if test="updateTime != null">update_time,</if> |
|||
</trim> |
|||
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|||
<if test="userId != null">#{userId},</if> |
|||
<if test="certName != null">#{certName},</if> |
|||
<if test="certNumber != null">#{certNumber},</if> |
|||
<if test="certType != null">#{certType},</if> |
|||
<if test="issueOrg != null">#{issueOrg},</if> |
|||
<if test="issueDate != null">#{issueDate},</if> |
|||
<if test="expireDate != null">#{expireDate},</if> |
|||
<if test="certImage != null">#{certImage},</if> |
|||
<if test="status != null">#{status},</if> |
|||
<if test="remindDays != null">#{remindDays},</if> |
|||
<if test="lastRemindTime != null">#{lastRemindTime},</if> |
|||
<if test="createBy != null">#{createBy},</if> |
|||
<if test="createTime != null">#{createTime},</if> |
|||
<if test="updateBy != null">#{updateBy},</if> |
|||
<if test="updateTime != null">#{updateTime},</if> |
|||
</trim> |
|||
</insert> |
|||
|
|||
<update id="updateVetCertificate" parameterType="VetCertificate"> |
|||
update vet_certificate |
|||
<trim prefix="SET" suffixOverrides=","> |
|||
<if test="userId != null">user_id = #{userId},</if> |
|||
<if test="certName != null">cert_name = #{certName},</if> |
|||
<if test="certNumber != null">cert_number = #{certNumber},</if> |
|||
<if test="certType != null">cert_type = #{certType},</if> |
|||
<if test="issueOrg != null">issue_org = #{issueOrg},</if> |
|||
<if test="issueDate != null">issue_date = #{issueDate},</if> |
|||
<if test="expireDate != null">expire_date = #{expireDate},</if> |
|||
<if test="certImage != null">cert_image = #{certImage},</if> |
|||
<if test="status != null">status = #{status},</if> |
|||
<if test="remindDays != null">remind_days = #{remindDays},</if> |
|||
<if test="lastRemindTime != null">last_remind_time = #{lastRemindTime},</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="updateTime != null">update_time = #{updateTime},</if> |
|||
</trim> |
|||
where id = #{id} |
|||
</update> |
|||
|
|||
<delete id="deleteVetCertificateById" parameterType="Long"> |
|||
delete from vet_certificate where id = #{id} |
|||
</delete> |
|||
|
|||
<delete id="deleteVetCertificateByIds" parameterType="String"> |
|||
delete from vet_certificate where id in |
|||
<foreach item="id" collection="array" open="(" separator="," close=")"> |
|||
#{id} |
|||
</foreach> |
|||
</delete> |
|||
</mapper> |
|||
@ -0,0 +1,186 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<!DOCTYPE mapper |
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="com.chenhai.vet.mapper.VetProductMapper"> |
|||
|
|||
<resultMap type="VetProduct" id="VetProductResult"> |
|||
<result property="id" column="id" /> |
|||
<result property="name" column="name" /> |
|||
<result property="type" column="type" /> |
|||
<result property="category" column="category" /> |
|||
<result property="specification" column="specification" /> |
|||
<result property="unit" column="unit" /> |
|||
<result property="manufacturer" column="manufacturer" /> |
|||
<result property="approvalNumber" column="approval_number" /> |
|||
<result property="ingredients" column="ingredients" /> |
|||
<result property="indications" column="indications" /> |
|||
<result property="usageDosage" column="usage_dosage" /> |
|||
<result property="price" column="price" /> |
|||
<result property="costPrice" column="cost_price" /> |
|||
<result property="stock" column="stock" /> |
|||
<result property="minStock" column="min_stock" /> |
|||
<result property="mainImage" column="main_image" /> |
|||
<result property="images" column="images" /> |
|||
<result property="treatAnimals" column="treat_animals" /> |
|||
<result property="treatDiseases" column="treat_diseases" /> |
|||
<result property="treatmentContent" column="treatment_content" /> |
|||
<result property="treatmentDuration" column="treatment_duration" /> |
|||
<result property="precautions" column="precautions" /> |
|||
<result property="status" column="status" /> |
|||
<result property="isDeleted" column="is_deleted" /> |
|||
<result property="clinicId" column="clinic_id" /> |
|||
<result property="userId" column="user_id" /> |
|||
<result property="createdAt" column="created_at" /> |
|||
<result property="updatedAt" column="updated_at" /> |
|||
</resultMap> |
|||
|
|||
<sql id="selectVetProductVo"> |
|||
select id, name, type, category, specification, unit, manufacturer, approval_number, ingredients, indications, usage_dosage, price, cost_price, stock, min_stock, main_image, images, treat_animals, treat_diseases, treatment_content, treatment_duration, precautions, status, is_deleted, clinic_id, vet_id, created_at, updated_at from vet_product |
|||
</sql> |
|||
|
|||
<select id="selectVetProductList" parameterType="VetProduct" resultMap="VetProductResult"> |
|||
<include refid="selectVetProductVo"/> |
|||
<where> |
|||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if> |
|||
<if test="type != null and type != ''"> and type = #{type}</if> |
|||
<if test="category != null and category != ''"> and category = #{category}</if> |
|||
<if test="specification != null and specification != ''"> and specification = #{specification}</if> |
|||
<if test="unit != null and unit != ''"> and unit = #{unit}</if> |
|||
<if test="manufacturer != null and manufacturer != ''"> and manufacturer = #{manufacturer}</if> |
|||
<if test="approvalNumber != null and approvalNumber != ''"> and approval_number = #{approvalNumber}</if> |
|||
<if test="ingredients != null and ingredients != ''"> and ingredients = #{ingredients}</if> |
|||
<if test="indications != null and indications != ''"> and indications = #{indications}</if> |
|||
<if test="usageDosage != null and usageDosage != ''"> and usage_dosage = #{usageDosage}</if> |
|||
<if test="price != null "> and price = #{price}</if> |
|||
<if test="costPrice != null "> and cost_price = #{costPrice}</if> |
|||
<if test="stock != null "> and stock = #{stock}</if> |
|||
<if test="minStock != null "> and min_stock = #{minStock}</if> |
|||
<if test="mainImage != null and mainImage != ''"> and main_image = #{mainImage}</if> |
|||
<if test="images != null and images != ''"> and images = #{images}</if> |
|||
<if test="treatAnimals != null and treatAnimals != ''"> and treat_animals = #{treatAnimals}</if> |
|||
<if test="treatDiseases != null and treatDiseases != ''"> and treat_diseases = #{treatDiseases}</if> |
|||
<if test="treatmentContent != null and treatmentContent != ''"> and treatment_content = #{treatmentContent}</if> |
|||
<if test="treatmentDuration != null and treatmentDuration != ''"> and treatment_duration = #{treatmentDuration}</if> |
|||
<if test="precautions != null and precautions != ''"> and precautions = #{precautions}</if> |
|||
<if test="status != null and status != ''"> and status = #{status}</if> |
|||
<if test="isDeleted != null "> and is_deleted = #{isDeleted}</if> |
|||
<if test="clinicId != null "> and clinic_id = #{clinicId}</if> |
|||
<if test="userId != null "> and user_id = #{userId}</if> |
|||
<if test="createdAt != null "> and created_at = #{createdAt}</if> |
|||
<if test="updatedAt != null "> and updated_at = #{updatedAt}</if> |
|||
</where> |
|||
</select> |
|||
|
|||
<select id="selectVetProductById" parameterType="Long" resultMap="VetProductResult"> |
|||
<include refid="selectVetProductVo"/> |
|||
where id = #{id} |
|||
</select> |
|||
|
|||
<insert id="insertVetProduct" parameterType="VetProduct" useGeneratedKeys="true" keyProperty="id"> |
|||
insert into vet_product |
|||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|||
<if test="name != null and name != ''">name,</if> |
|||
<if test="type != null and type != ''">type,</if> |
|||
<if test="category != null">category,</if> |
|||
<if test="specification != null">specification,</if> |
|||
<if test="unit != null">unit,</if> |
|||
<if test="manufacturer != null">manufacturer,</if> |
|||
<if test="approvalNumber != null">approval_number,</if> |
|||
<if test="ingredients != null">ingredients,</if> |
|||
<if test="indications != null">indications,</if> |
|||
<if test="usageDosage != null">usage_dosage,</if> |
|||
<if test="price != null">price,</if> |
|||
<if test="costPrice != null">cost_price,</if> |
|||
<if test="stock != null">stock,</if> |
|||
<if test="minStock != null">min_stock,</if> |
|||
<if test="mainImage != null">main_image,</if> |
|||
<if test="images != null">images,</if> |
|||
<if test="treatAnimals != null">treat_animals,</if> |
|||
<if test="treatDiseases != null">treat_diseases,</if> |
|||
<if test="treatmentContent != null">treatment_content,</if> |
|||
<if test="treatmentDuration != null">treatment_duration,</if> |
|||
<if test="precautions != null">precautions,</if> |
|||
<if test="status != null">status,</if> |
|||
<if test="isDeleted != null">is_deleted,</if> |
|||
<if test="clinicId != null">clinic_id,</if> |
|||
<if test="userId != null">user_id,</if> |
|||
<if test="createdAt != null">created_at,</if> |
|||
<if test="updatedAt != null">updated_at,</if> |
|||
</trim> |
|||
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|||
<if test="name != null and name != ''">#{name},</if> |
|||
<if test="type != null and type != ''">#{type},</if> |
|||
<if test="category != null">#{category},</if> |
|||
<if test="specification != null">#{specification},</if> |
|||
<if test="unit != null">#{unit},</if> |
|||
<if test="manufacturer != null">#{manufacturer},</if> |
|||
<if test="approvalNumber != null">#{approvalNumber},</if> |
|||
<if test="ingredients != null">#{ingredients},</if> |
|||
<if test="indications != null">#{indications},</if> |
|||
<if test="usageDosage != null">#{usageDosage},</if> |
|||
<if test="price != null">#{price},</if> |
|||
<if test="costPrice != null">#{costPrice},</if> |
|||
<if test="stock != null">#{stock},</if> |
|||
<if test="minStock != null">#{minStock},</if> |
|||
<if test="mainImage != null">#{mainImage},</if> |
|||
<if test="images != null">#{images},</if> |
|||
<if test="treatAnimals != null">#{treatAnimals},</if> |
|||
<if test="treatDiseases != null">#{treatDiseases},</if> |
|||
<if test="treatmentContent != null">#{treatmentContent},</if> |
|||
<if test="treatmentDuration != null">#{treatmentDuration},</if> |
|||
<if test="precautions != null">#{precautions},</if> |
|||
<if test="status != null">#{status},</if> |
|||
<if test="isDeleted != null">#{isDeleted},</if> |
|||
<if test="clinicId != null">#{clinicId},</if> |
|||
<if test="userId != null">#{userId},</if> |
|||
<if test="createdAt != null">#{createdAt},</if> |
|||
<if test="updatedAt != null">#{updatedAt},</if> |
|||
</trim> |
|||
</insert> |
|||
|
|||
<update id="updateVetProduct" parameterType="VetProduct"> |
|||
update vet_product |
|||
<trim prefix="SET" suffixOverrides=","> |
|||
<if test="name != null and name != ''">name = #{name},</if> |
|||
<if test="type != null and type != ''">type = #{type},</if> |
|||
<if test="category != null">category = #{category},</if> |
|||
<if test="specification != null">specification = #{specification},</if> |
|||
<if test="unit != null">unit = #{unit},</if> |
|||
<if test="manufacturer != null">manufacturer = #{manufacturer},</if> |
|||
<if test="approvalNumber != null">approval_number = #{approvalNumber},</if> |
|||
<if test="ingredients != null">ingredients = #{ingredients},</if> |
|||
<if test="indications != null">indications = #{indications},</if> |
|||
<if test="usageDosage != null">usage_dosage = #{usageDosage},</if> |
|||
<if test="price != null">price = #{price},</if> |
|||
<if test="costPrice != null">cost_price = #{costPrice},</if> |
|||
<if test="stock != null">stock = #{stock},</if> |
|||
<if test="minStock != null">min_stock = #{minStock},</if> |
|||
<if test="mainImage != null">main_image = #{mainImage},</if> |
|||
<if test="images != null">images = #{images},</if> |
|||
<if test="treatAnimals != null">treat_animals = #{treatAnimals},</if> |
|||
<if test="treatDiseases != null">treat_diseases = #{treatDiseases},</if> |
|||
<if test="treatmentContent != null">treatment_content = #{treatmentContent},</if> |
|||
<if test="treatmentDuration != null">treatment_duration = #{treatmentDuration},</if> |
|||
<if test="precautions != null">precautions = #{precautions},</if> |
|||
<if test="status != null">status = #{status},</if> |
|||
<if test="isDeleted != null">is_deleted = #{isDeleted},</if> |
|||
<if test="clinicId != null">clinic_id = #{clinicId},</if> |
|||
<if test="userId != null">user_id = #{userId},</if> |
|||
<if test="createdAt != null">created_at = #{createdAt},</if> |
|||
<if test="updatedAt != null">updated_at = #{updatedAt},</if> |
|||
</trim> |
|||
where id = #{id} |
|||
</update> |
|||
|
|||
<delete id="deleteVetProductById" parameterType="Long"> |
|||
delete from vet_product where id = #{id} |
|||
</delete> |
|||
|
|||
<delete id="deleteVetProductByIds" parameterType="String"> |
|||
delete from vet_product where id in |
|||
<foreach item="id" collection="array" open="(" separator="," close=")"> |
|||
#{id} |
|||
</foreach> |
|||
</delete> |
|||
</mapper> |
|||
@ -1,54 +0,0 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
// 查询兽医执业证书列表
|
|||
export function listCertificate(query) { |
|||
return request({ |
|||
url: '/vet/certificate/list', |
|||
method: 'get', |
|||
params: query |
|||
}) |
|||
} |
|||
|
|||
// 查询证书
|
|||
export function listForDetail(userId) { |
|||
return request({ |
|||
url: '/vet/certificate/listForDetail', |
|||
method: 'get', |
|||
params: { userId: userId } |
|||
}) |
|||
} |
|||
|
|||
|
|||
// 查询兽医执业证书详细
|
|||
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' |
|||
}) |
|||
} |
|||
@ -0,0 +1,44 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
// 查询兽医产品信息列表
|
|||
export function listProduct(query) { |
|||
return request({ |
|||
url: '/vet/product/list', |
|||
method: 'get', |
|||
params: query |
|||
}) |
|||
} |
|||
|
|||
// 查询兽医产品信息详细
|
|||
export function getProduct(id) { |
|||
return request({ |
|||
url: '/vet/product/' + id, |
|||
method: 'get' |
|||
}) |
|||
} |
|||
|
|||
// 新增兽医产品信息
|
|||
export function addProduct(data) { |
|||
return request({ |
|||
url: '/vet/product', |
|||
method: 'post', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 修改兽医产品信息
|
|||
export function updateProduct(data) { |
|||
return request({ |
|||
url: '/vet/product', |
|||
method: 'put', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 删除兽医产品信息
|
|||
export function delProduct(id) { |
|||
return request({ |
|||
url: '/vet/product/' + id, |
|||
method: 'delete' |
|||
}) |
|||
} |
|||
@ -1,427 +0,0 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<!-- 搜索部分 --> |
|||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px"> |
|||
<!-- <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="['vet: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="['vet: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="['vet: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" fixed="right" width="180"> |
|||
<template slot-scope="scope"> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-edit" |
|||
style="color: #42B983" |
|||
class = "certificate-btn alter-btn" |
|||
@click="handleUpdate(scope.row)" |
|||
v-hasPermi="['vet:certificate:edit']" |
|||
>修改</el-button> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-delete" |
|||
style="color: #f28888" |
|||
class = "certificate-btn delete-btn" |
|||
@click="handleDelete(scope.row)" |
|||
v-hasPermi="['vet: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, listForDetail } from "@/api/vet/certificate" |
|||
|
|||
export default { |
|||
name: "Certificate", |
|||
props: { |
|||
formList: Object, |
|||
certificateList: Array |
|||
}, |
|||
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 = false |
|||
listForDetail(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> |
|||
|
|||
|
|||
<style scoped lang="scss"> |
|||
/* 操作按钮样式 */ |
|||
.certificate-btn { |
|||
padding: 6px 10px; |
|||
border-radius: 4px; |
|||
margin: 0 10px; |
|||
transition: all 0.3s ease; |
|||
|
|||
} |
|||
|
|||
.alter-btn:hover{ |
|||
background-color: rgb(230, 255, 238); |
|||
transform: translateY(-1px); |
|||
} |
|||
|
|||
.delete-btn:hover { |
|||
background-color: rgba(245, 108, 108, 0.1); |
|||
transform: translateY(-1px); |
|||
} |
|||
</style> |
|||
@ -0,0 +1,552 @@ |
|||
<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="产品名称" prop="name"> |
|||
<el-input |
|||
v-model="queryParams.name" |
|||
placeholder="请输入产品名称" |
|||
clearable |
|||
@keyup.enter.native="handleQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="产品分类" prop="category"> |
|||
<el-input |
|||
v-model="queryParams.category" |
|||
placeholder="请输入产品分类" |
|||
clearable |
|||
@keyup.enter.native="handleQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="规格" prop="specification"> |
|||
<el-input |
|||
v-model="queryParams.specification" |
|||
placeholder="请输入规格" |
|||
clearable |
|||
@keyup.enter.native="handleQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="单位" prop="unit"> |
|||
<el-input |
|||
v-model="queryParams.unit" |
|||
placeholder="请输入单位" |
|||
clearable |
|||
@keyup.enter.native="handleQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="生产厂家" prop="manufacturer"> |
|||
<el-input |
|||
v-model="queryParams.manufacturer" |
|||
placeholder="请输入生产厂家" |
|||
clearable |
|||
@keyup.enter.native="handleQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="批准文号" prop="approvalNumber"> |
|||
<el-input |
|||
v-model="queryParams.approvalNumber" |
|||
placeholder="请输入批准文号" |
|||
clearable |
|||
@keyup.enter.native="handleQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="销售价格" prop="price"> |
|||
<el-input |
|||
v-model="queryParams.price" |
|||
placeholder="请输入销售价格" |
|||
clearable |
|||
@keyup.enter.native="handleQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="成本价" prop="costPrice"> |
|||
<el-input |
|||
v-model="queryParams.costPrice" |
|||
placeholder="请输入成本价" |
|||
clearable |
|||
@keyup.enter.native="handleQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="库存数量" prop="stock"> |
|||
<el-input |
|||
v-model="queryParams.stock" |
|||
placeholder="请输入库存数量" |
|||
clearable |
|||
@keyup.enter.native="handleQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="最低库存预警" prop="minStock"> |
|||
<el-input |
|||
v-model="queryParams.minStock" |
|||
placeholder="请输入最低库存预警" |
|||
clearable |
|||
@keyup.enter.native="handleQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="治疗周期" prop="treatmentDuration"> |
|||
<el-input |
|||
v-model="queryParams.treatmentDuration" |
|||
placeholder="请输入治疗周期" |
|||
clearable |
|||
@keyup.enter.native="handleQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="删除标识:0-正常/1-删除" prop="isDeleted"> |
|||
<el-input |
|||
v-model="queryParams.isDeleted" |
|||
placeholder="请输入删除标识:0-正常/1-删除" |
|||
clearable |
|||
@keyup.enter.native="handleQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="诊所ID" prop="clinicId"> |
|||
<el-input |
|||
v-model="queryParams.clinicId" |
|||
placeholder="请输入诊所ID" |
|||
clearable |
|||
@keyup.enter.native="handleQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="兽医ID" prop="vetId"> |
|||
<el-input |
|||
v-model="queryParams.vetId" |
|||
placeholder="请输入兽医ID" |
|||
clearable |
|||
@keyup.enter.native="handleQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="创建时间" prop="createdAt"> |
|||
<el-date-picker clearable |
|||
v-model="queryParams.createdAt" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="请选择创建时间"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label="更新时间" prop="updatedAt"> |
|||
<el-date-picker clearable |
|||
v-model="queryParams.updatedAt" |
|||
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="['vet:product: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="['vet:product: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="['vet:product: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="['vet:product:export']" |
|||
>导出</el-button> |
|||
</el-col> |
|||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
|||
</el-row> |
|||
|
|||
<el-table v-loading="loading" :data="productList" @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="产品名称" align="center" prop="name" /> |
|||
<el-table-column label="产品类型:medicine-兽药/vaccine-疫苗/supplement-保健品" align="center" prop="type" /> |
|||
<el-table-column label="产品分类" align="center" prop="category" /> |
|||
<el-table-column label="规格" align="center" prop="specification" /> |
|||
<el-table-column label="单位" align="center" prop="unit" /> |
|||
<el-table-column label="生产厂家" align="center" prop="manufacturer" /> |
|||
<el-table-column label="批准文号" align="center" prop="approvalNumber" /> |
|||
<el-table-column label="主要成分" align="center" prop="ingredients" /> |
|||
<el-table-column label="适应症" align="center" prop="indications" /> |
|||
<el-table-column label="用法用量" align="center" prop="usageDosage" /> |
|||
<el-table-column label="销售价格" align="center" prop="price" /> |
|||
<el-table-column label="成本价" align="center" prop="costPrice" /> |
|||
<el-table-column label="库存数量" align="center" prop="stock" /> |
|||
<el-table-column label="最低库存预警" align="center" prop="minStock" /> |
|||
<el-table-column label="主图URL" align="center" prop="mainImage" width="100"> |
|||
<template slot-scope="scope"> |
|||
<image-preview :src="scope.row.mainImage" :width="50" :height="50"/> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="多张图片URL,JSON格式" align="center" prop="images" /> |
|||
<el-table-column label="适用动物:如犬、猫、猪等" align="center" prop="treatAnimals" /> |
|||
<el-table-column label="治疗疾病" align="center" prop="treatDiseases" /> |
|||
<el-table-column label="治疗方案/内容" align="center" prop="treatmentContent" /> |
|||
<el-table-column label="治疗周期" align="center" prop="treatmentDuration" /> |
|||
<el-table-column label="注意事项" align="center" prop="precautions" /> |
|||
<el-table-column label="状态:0-草稿/1-上架/2-下架" align="center" prop="status" /> |
|||
<el-table-column label="删除标识:0-正常/1-删除" align="center" prop="isDeleted" /> |
|||
<el-table-column label="诊所ID" align="center" prop="clinicId" /> |
|||
<el-table-column label="兽医ID" align="center" prop="vetId" /> |
|||
<el-table-column label="创建时间" align="center" prop="createdAt" width="180"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ parseTime(scope.row.createdAt, '{y}-{m}-{d}') }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="更新时间" align="center" prop="updatedAt" width="180"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ parseTime(scope.row.updatedAt, '{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="['vet:product:edit']" |
|||
>修改</el-button> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-delete" |
|||
@click="handleDelete(scope.row)" |
|||
v-hasPermi="['vet:product: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="产品名称" prop="name"> |
|||
<el-input v-model="form.name" placeholder="请输入产品名称" /> |
|||
</el-form-item> |
|||
<el-form-item label="产品分类" prop="category"> |
|||
<el-input v-model="form.category" placeholder="请输入产品分类" /> |
|||
</el-form-item> |
|||
<el-form-item label="规格" prop="specification"> |
|||
<el-input v-model="form.specification" placeholder="请输入规格" /> |
|||
</el-form-item> |
|||
<el-form-item label="单位" prop="unit"> |
|||
<el-input v-model="form.unit" placeholder="请输入单位" /> |
|||
</el-form-item> |
|||
<el-form-item label="生产厂家" prop="manufacturer"> |
|||
<el-input v-model="form.manufacturer" placeholder="请输入生产厂家" /> |
|||
</el-form-item> |
|||
<el-form-item label="批准文号" prop="approvalNumber"> |
|||
<el-input v-model="form.approvalNumber" placeholder="请输入批准文号" /> |
|||
</el-form-item> |
|||
<el-form-item label="主要成分" prop="ingredients"> |
|||
<el-input v-model="form.ingredients" type="textarea" placeholder="请输入内容" /> |
|||
</el-form-item> |
|||
<el-form-item label="适应症" prop="indications"> |
|||
<el-input v-model="form.indications" type="textarea" placeholder="请输入内容" /> |
|||
</el-form-item> |
|||
<el-form-item label="用法用量" prop="usageDosage"> |
|||
<el-input v-model="form.usageDosage" type="textarea" placeholder="请输入内容" /> |
|||
</el-form-item> |
|||
<el-form-item label="销售价格" prop="price"> |
|||
<el-input v-model="form.price" placeholder="请输入销售价格" /> |
|||
</el-form-item> |
|||
<el-form-item label="成本价" prop="costPrice"> |
|||
<el-input v-model="form.costPrice" placeholder="请输入成本价" /> |
|||
</el-form-item> |
|||
<el-form-item label="库存数量" prop="stock"> |
|||
<el-input v-model="form.stock" placeholder="请输入库存数量" /> |
|||
</el-form-item> |
|||
<el-form-item label="最低库存预警" prop="minStock"> |
|||
<el-input v-model="form.minStock" placeholder="请输入最低库存预警" /> |
|||
</el-form-item> |
|||
<el-form-item label="主图URL" prop="mainImage"> |
|||
<image-upload v-model="form.mainImage"/> |
|||
</el-form-item> |
|||
<el-form-item label="多张图片URL,JSON格式" prop="images"> |
|||
<el-input v-model="form.images" type="textarea" placeholder="请输入内容" /> |
|||
</el-form-item> |
|||
<el-form-item label="适用动物:如犬、猫、猪等" prop="treatAnimals"> |
|||
<el-input v-model="form.treatAnimals" type="textarea" placeholder="请输入内容" /> |
|||
</el-form-item> |
|||
<el-form-item label="治疗疾病" prop="treatDiseases"> |
|||
<el-input v-model="form.treatDiseases" type="textarea" placeholder="请输入内容" /> |
|||
</el-form-item> |
|||
<el-form-item label="治疗方案/内容"> |
|||
<editor v-model="form.treatmentContent" :min-height="192"/> |
|||
</el-form-item> |
|||
<el-form-item label="治疗周期" prop="treatmentDuration"> |
|||
<el-input v-model="form.treatmentDuration" placeholder="请输入治疗周期" /> |
|||
</el-form-item> |
|||
<el-form-item label="注意事项" prop="precautions"> |
|||
<el-input v-model="form.precautions" type="textarea" placeholder="请输入内容" /> |
|||
</el-form-item> |
|||
<el-form-item label="删除标识:0-正常/1-删除" prop="isDeleted"> |
|||
<el-input v-model="form.isDeleted" placeholder="请输入删除标识:0-正常/1-删除" /> |
|||
</el-form-item> |
|||
<el-form-item label="诊所ID" prop="clinicId"> |
|||
<el-input v-model="form.clinicId" placeholder="请输入诊所ID" /> |
|||
</el-form-item> |
|||
<el-form-item label="兽医ID" prop="vetId"> |
|||
<el-input v-model="form.vetId" placeholder="请输入兽医ID" /> |
|||
</el-form-item> |
|||
<el-form-item label="创建时间" prop="createdAt"> |
|||
<el-date-picker clearable |
|||
v-model="form.createdAt" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="请选择创建时间"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label="更新时间" prop="updatedAt"> |
|||
<el-date-picker clearable |
|||
v-model="form.updatedAt" |
|||
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 { listProduct, getProduct, delProduct, addProduct, updateProduct } from "@/api/vet/product" |
|||
|
|||
export default { |
|||
name: "Product", |
|||
data() { |
|||
return { |
|||
// 遮罩层 |
|||
loading: true, |
|||
// 选中数组 |
|||
ids: [], |
|||
// 非单个禁用 |
|||
single: true, |
|||
// 非多个禁用 |
|||
multiple: true, |
|||
// 显示搜索条件 |
|||
showSearch: true, |
|||
// 总条数 |
|||
total: 0, |
|||
// 兽医产品信息表格数据 |
|||
productList: [], |
|||
// 弹出层标题 |
|||
title: "", |
|||
// 是否显示弹出层 |
|||
open: false, |
|||
// 查询参数 |
|||
queryParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
name: null, |
|||
type: null, |
|||
category: null, |
|||
specification: null, |
|||
unit: null, |
|||
manufacturer: null, |
|||
approvalNumber: null, |
|||
ingredients: null, |
|||
indications: null, |
|||
usageDosage: null, |
|||
price: null, |
|||
costPrice: null, |
|||
stock: null, |
|||
minStock: null, |
|||
mainImage: null, |
|||
images: null, |
|||
treatAnimals: null, |
|||
treatDiseases: null, |
|||
treatmentContent: null, |
|||
treatmentDuration: null, |
|||
precautions: null, |
|||
status: null, |
|||
isDeleted: null, |
|||
clinicId: null, |
|||
vetId: null, |
|||
createdAt: null, |
|||
updatedAt: null |
|||
}, |
|||
// 表单参数 |
|||
form: {}, |
|||
// 表单校验 |
|||
rules: { |
|||
name: [ |
|||
{ required: true, message: "产品名称不能为空", trigger: "blur" } |
|||
], |
|||
type: [ |
|||
{ required: true, message: "产品类型:medicine-兽药/vaccine-疫苗/supplement-保健品不能为空", trigger: "change" } |
|||
], |
|||
price: [ |
|||
{ required: true, message: "销售价格不能为空", trigger: "blur" } |
|||
], |
|||
clinicId: [ |
|||
{ required: true, message: "诊所ID不能为空", trigger: "blur" } |
|||
], |
|||
vetId: [ |
|||
{ required: true, message: "兽医ID不能为空", trigger: "blur" } |
|||
], |
|||
} |
|||
} |
|||
}, |
|||
created() { |
|||
this.getList() |
|||
}, |
|||
methods: { |
|||
/** 查询兽医产品信息列表 */ |
|||
getList() { |
|||
this.loading = true |
|||
listProduct(this.queryParams).then(response => { |
|||
this.productList = response.rows |
|||
this.total = response.total |
|||
this.loading = false |
|||
}) |
|||
}, |
|||
// 取消按钮 |
|||
cancel() { |
|||
this.open = false |
|||
this.reset() |
|||
}, |
|||
// 表单重置 |
|||
reset() { |
|||
this.form = { |
|||
id: null, |
|||
name: null, |
|||
type: null, |
|||
category: null, |
|||
specification: null, |
|||
unit: null, |
|||
manufacturer: null, |
|||
approvalNumber: null, |
|||
ingredients: null, |
|||
indications: null, |
|||
usageDosage: null, |
|||
price: null, |
|||
costPrice: null, |
|||
stock: null, |
|||
minStock: null, |
|||
mainImage: null, |
|||
images: null, |
|||
treatAnimals: null, |
|||
treatDiseases: null, |
|||
treatmentContent: null, |
|||
treatmentDuration: null, |
|||
precautions: null, |
|||
status: null, |
|||
isDeleted: null, |
|||
clinicId: null, |
|||
vetId: null, |
|||
createdAt: null, |
|||
updatedAt: 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 |
|||
getProduct(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) { |
|||
updateProduct(this.form).then(response => { |
|||
this.$modal.msgSuccess("修改成功") |
|||
this.open = false |
|||
this.getList() |
|||
}) |
|||
} else { |
|||
addProduct(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 delProduct(ids) |
|||
}).then(() => { |
|||
this.getList() |
|||
this.$modal.msgSuccess("删除成功") |
|||
}).catch(() => {}) |
|||
}, |
|||
/** 导出按钮操作 */ |
|||
handleExport() { |
|||
this.download('vet/product/export', { |
|||
...this.queryParams |
|||
}, `product_${new Date().getTime()}.xlsx`) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue