40 changed files with 6075 additions and 386 deletions
-
104chenhai-admin/src/main/java/com/chenhai/web/controller/muhu/MuhuConsultationFormsController.java
-
104chenhai-admin/src/main/java/com/chenhai/web/controller/system/SysExpertConsultationController.java
-
104chenhai-admin/src/main/java/com/chenhai/web/controller/vet/VetCommentsController.java
-
104chenhai-admin/src/main/java/com/chenhai/web/controller/vet/VetExpertsController.java
-
194chenhai-admin/src/main/java/com/chenhai/web/controller/vet/VetPersonalInfoController.java
-
268chenhai-system/src/main/java/com/chenhai/muhu/domain/MuhuConsultationForms.java
-
61chenhai-system/src/main/java/com/chenhai/muhu/mapper/MuhuConsultationFormsMapper.java
-
61chenhai-system/src/main/java/com/chenhai/muhu/service/IMuhuConsultationFormsService.java
-
237chenhai-system/src/main/java/com/chenhai/muhu/service/impl/MuhuConsultationFormsServiceImpl.java
-
299chenhai-system/src/main/java/com/chenhai/system/domain/SysExpertConsultation.java
-
61chenhai-system/src/main/java/com/chenhai/system/mapper/SysExpertConsultationMapper.java
-
61chenhai-system/src/main/java/com/chenhai/system/service/ISysExpertConsultationService.java
-
93chenhai-system/src/main/java/com/chenhai/system/service/impl/SysExpertConsultationServiceImpl.java
-
1chenhai-system/src/main/java/com/chenhai/system/service/impl/SysUserServiceImpl.java
-
230chenhai-system/src/main/java/com/chenhai/vet/domain/VetComments.java
-
279chenhai-system/src/main/java/com/chenhai/vet/domain/VetExperts.java
-
103chenhai-system/src/main/java/com/chenhai/vet/domain/VetPersonalInfo.java
-
70chenhai-system/src/main/java/com/chenhai/vet/mapper/VetCommentsMapper.java
-
62chenhai-system/src/main/java/com/chenhai/vet/mapper/VetExpertsMapper.java
-
61chenhai-system/src/main/java/com/chenhai/vet/service/IVetCommentsService.java
-
61chenhai-system/src/main/java/com/chenhai/vet/service/IVetExpertsService.java
-
450chenhai-system/src/main/java/com/chenhai/vet/service/impl/VetCommentsServiceImpl.java
-
458chenhai-system/src/main/java/com/chenhai/vet/service/impl/VetExpertsServiceImpl.java
-
293chenhai-system/src/main/java/com/chenhai/vet/service/impl/VetPersonalInfoServiceImpl.java
-
134chenhai-system/src/main/resources/mapper/muhu/MuhuConsultationFormsMapper.xml
-
136chenhai-system/src/main/resources/mapper/system/SysExpertConsultationMapper.xml
-
24chenhai-system/src/main/resources/mapper/system/SysUserMapper.xml
-
143chenhai-system/src/main/resources/mapper/vet/VetCommentsMapper.xml
-
132chenhai-system/src/main/resources/mapper/vet/VetExpertsMapper.xml
-
218chenhai-system/src/main/resources/mapper/vet/VetPersonalInfoMapper.xml
-
44chenhai-ui/src/api/muhu/consultation.js
-
44chenhai-ui/src/api/system/consultation.js
-
8chenhai-ui/src/api/vet/comments.js
-
44chenhai-ui/src/api/vet/experts.js
-
367chenhai-ui/src/views/muhu/consultation/index.vue
-
460chenhai-ui/src/views/system/consultation/index.vue
-
12chenhai-ui/src/views/system/user/profile/userInfo.vue
-
285chenhai-ui/src/views/vet/comments/index.vue
-
317chenhai-ui/src/views/vet/experts/index.vue
-
38chenhai-ui/src/views/vet/info/index.vue
@ -0,0 +1,104 @@ |
|||
package com.chenhai.web.controller.muhu; |
|||
|
|||
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.muhu.domain.MuhuConsultationForms; |
|||
import com.chenhai.muhu.service.IMuhuConsultationFormsService; |
|||
import com.chenhai.common.utils.poi.ExcelUtil; |
|||
import com.chenhai.common.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 问诊单Controller |
|||
* |
|||
* @author ruoyi |
|||
* @date 2026-01-07 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/muhu/consultation") |
|||
public class MuhuConsultationFormsController extends BaseController |
|||
{ |
|||
@Autowired |
|||
private IMuhuConsultationFormsService muhuConsultationFormsService; |
|||
|
|||
/** |
|||
* 查询问诊单列表 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('muhu:consultation:list') or @ss.hasRole('muhu')") |
|||
@GetMapping("/list") |
|||
public TableDataInfo list(MuhuConsultationForms muhuConsultationForms) |
|||
{ |
|||
startPage(); |
|||
List<MuhuConsultationForms> list = muhuConsultationFormsService.selectMuhuConsultationFormsList(muhuConsultationForms); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
/** |
|||
* 导出问诊单列表 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('muhu:consultation:export') or @ss.hasRole('muhu')") |
|||
@Log(title = "问诊单", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(HttpServletResponse response, MuhuConsultationForms muhuConsultationForms) |
|||
{ |
|||
List<MuhuConsultationForms> list = muhuConsultationFormsService.selectMuhuConsultationFormsList(muhuConsultationForms); |
|||
ExcelUtil<MuhuConsultationForms> util = new ExcelUtil<MuhuConsultationForms>(MuhuConsultationForms.class); |
|||
util.exportExcel(response, list, "问诊单数据"); |
|||
} |
|||
|
|||
/** |
|||
* 获取问诊单详细信息 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('muhu:consultation:query') or @ss.hasRole('muhu')") |
|||
@GetMapping(value = "/{formId}") |
|||
public AjaxResult getInfo(@PathVariable("formId") Long formId) |
|||
{ |
|||
return success(muhuConsultationFormsService.selectMuhuConsultationFormsByFormId(formId)); |
|||
} |
|||
|
|||
/** |
|||
* 新增问诊单 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('muhu:consultation:add') or @ss.hasRole('muhu')") |
|||
@Log(title = "问诊单", businessType = BusinessType.INSERT) |
|||
@PostMapping |
|||
public AjaxResult add(@RequestBody MuhuConsultationForms muhuConsultationForms) |
|||
{ |
|||
return toAjax(muhuConsultationFormsService.insertMuhuConsultationForms(muhuConsultationForms)); |
|||
} |
|||
|
|||
/** |
|||
* 修改问诊单 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('muhu:consultation:edit') or @ss.hasRole('muhu')") |
|||
@Log(title = "问诊单", businessType = BusinessType.UPDATE) |
|||
@PutMapping |
|||
public AjaxResult edit(@RequestBody MuhuConsultationForms muhuConsultationForms) |
|||
{ |
|||
return toAjax(muhuConsultationFormsService.updateMuhuConsultationForms(muhuConsultationForms)); |
|||
} |
|||
|
|||
/** |
|||
* 删除问诊单 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('muhu:consultation:remove') or @ss.hasRole('muhu')") |
|||
@Log(title = "问诊单", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{formIds}") |
|||
public AjaxResult remove(@PathVariable Long[] formIds) |
|||
{ |
|||
return toAjax(muhuConsultationFormsService.deleteMuhuConsultationFormsByFormIds(formIds)); |
|||
} |
|||
} |
|||
@ -0,0 +1,104 @@ |
|||
package com.chenhai.web.controller.system; |
|||
|
|||
import java.util.List; |
|||
import jakarta.servlet.http.HttpServletResponse; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.PutMapping; |
|||
import org.springframework.web.bind.annotation.DeleteMapping; |
|||
import org.springframework.web.bind.annotation.PathVariable; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
import com.chenhai.common.annotation.Log; |
|||
import com.chenhai.common.core.controller.BaseController; |
|||
import com.chenhai.common.core.domain.AjaxResult; |
|||
import com.chenhai.common.enums.BusinessType; |
|||
import com.chenhai.system.domain.SysExpertConsultation; |
|||
import com.chenhai.system.service.ISysExpertConsultationService; |
|||
import com.chenhai.common.utils.poi.ExcelUtil; |
|||
import com.chenhai.common.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 专家咨询Controller |
|||
* |
|||
* @author ruoyi |
|||
* @date 2026-01-12 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/system/consultation") |
|||
public class SysExpertConsultationController extends BaseController |
|||
{ |
|||
@Autowired |
|||
private ISysExpertConsultationService sysExpertConsultationService; |
|||
|
|||
/** |
|||
* 查询专家咨询列表 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:consultation:list')") |
|||
@GetMapping("/list") |
|||
public TableDataInfo list(SysExpertConsultation sysExpertConsultation) |
|||
{ |
|||
startPage(); |
|||
List<SysExpertConsultation> list = sysExpertConsultationService.selectSysExpertConsultationList(sysExpertConsultation); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
/** |
|||
* 导出专家咨询列表 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:consultation:export')") |
|||
@Log(title = "专家咨询", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(HttpServletResponse response, SysExpertConsultation sysExpertConsultation) |
|||
{ |
|||
List<SysExpertConsultation> list = sysExpertConsultationService.selectSysExpertConsultationList(sysExpertConsultation); |
|||
ExcelUtil<SysExpertConsultation> util = new ExcelUtil<SysExpertConsultation>(SysExpertConsultation.class); |
|||
util.exportExcel(response, list, "专家咨询数据"); |
|||
} |
|||
|
|||
/** |
|||
* 获取专家咨询详细信息 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:consultation:query')") |
|||
@GetMapping(value = "/{consultationId}") |
|||
public AjaxResult getInfo(@PathVariable("consultationId") Long consultationId) |
|||
{ |
|||
return success(sysExpertConsultationService.selectSysExpertConsultationByConsultationId(consultationId)); |
|||
} |
|||
|
|||
/** |
|||
* 新增专家咨询 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:consultation:add')") |
|||
@Log(title = "专家咨询", businessType = BusinessType.INSERT) |
|||
@PostMapping |
|||
public AjaxResult add(@RequestBody SysExpertConsultation sysExpertConsultation) |
|||
{ |
|||
return toAjax(sysExpertConsultationService.insertSysExpertConsultation(sysExpertConsultation)); |
|||
} |
|||
|
|||
/** |
|||
* 修改专家咨询 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:consultation:edit')") |
|||
@Log(title = "专家咨询", businessType = BusinessType.UPDATE) |
|||
@PutMapping |
|||
public AjaxResult edit(@RequestBody SysExpertConsultation sysExpertConsultation) |
|||
{ |
|||
return toAjax(sysExpertConsultationService.updateSysExpertConsultation(sysExpertConsultation)); |
|||
} |
|||
|
|||
/** |
|||
* 删除专家咨询 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:consultation:remove')") |
|||
@Log(title = "专家咨询", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{consultationIds}") |
|||
public AjaxResult remove(@PathVariable Long[] consultationIds) |
|||
{ |
|||
return toAjax(sysExpertConsultationService.deleteSysExpertConsultationByConsultationIds(consultationIds)); |
|||
} |
|||
} |
|||
@ -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.VetComments; |
|||
import com.chenhai.vet.service.IVetCommentsService; |
|||
import com.chenhai.common.utils.poi.ExcelUtil; |
|||
import com.chenhai.common.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 兽医回复Controller |
|||
* |
|||
* @author ruoyi |
|||
* @date 2026-01-07 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/vet/comments") |
|||
public class VetCommentsController extends BaseController |
|||
{ |
|||
@Autowired |
|||
private IVetCommentsService vetCommentsService; |
|||
|
|||
/** |
|||
* 查询兽医回复列表 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('vet:comments:list') or @ss.hasRole('vetnotshenhe')") |
|||
@GetMapping("/list") |
|||
public TableDataInfo list(VetComments vetComments) |
|||
{ |
|||
startPage(); |
|||
List<VetComments> list = vetCommentsService.selectVetCommentsList(vetComments); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
/** |
|||
* 导出兽医回复列表 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('vet:comments:export') or @ss.hasRole('vetnotshenhe')") |
|||
@Log(title = "兽医回复", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(HttpServletResponse response, VetComments vetComments) |
|||
{ |
|||
List<VetComments> list = vetCommentsService.selectVetCommentsList(vetComments); |
|||
ExcelUtil<VetComments> util = new ExcelUtil<VetComments>(VetComments.class); |
|||
util.exportExcel(response, list, "兽医回复数据"); |
|||
} |
|||
|
|||
/** |
|||
* 获取兽医回复详细信息 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('vet:comments:query') or @ss.hasRole('vetnotshenhe')") |
|||
@GetMapping(value = "/{id}") |
|||
public AjaxResult getInfo(@PathVariable("id") Long id) |
|||
{ |
|||
return success(vetCommentsService.selectVetCommentsById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增兽医回复 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('vet:comments:add') or @ss.hasRole('vetnotshenhe')") |
|||
@Log(title = "兽医回复", businessType = BusinessType.INSERT) |
|||
@PostMapping |
|||
public AjaxResult add(@RequestBody VetComments vetComments) |
|||
{ |
|||
return toAjax(vetCommentsService.insertVetComments(vetComments)); |
|||
} |
|||
|
|||
/** |
|||
* 修改兽医回复 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('vet:comments:edit') or @ss.hasRole('vetnotshenhe')") |
|||
@Log(title = "兽医回复", businessType = BusinessType.UPDATE) |
|||
@PutMapping |
|||
public AjaxResult edit(@RequestBody VetComments vetComments) |
|||
{ |
|||
return toAjax(vetCommentsService.updateVetComments(vetComments)); |
|||
} |
|||
|
|||
/** |
|||
* 删除兽医回复 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('vet:comments:remove') or @ss.hasRole('vetnotshenhe')") |
|||
@Log(title = "兽医回复", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public AjaxResult remove(@PathVariable Long[] ids) |
|||
{ |
|||
return toAjax(vetCommentsService.deleteVetCommentsByIds(ids)); |
|||
} |
|||
} |
|||
@ -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.VetExperts; |
|||
import com.chenhai.vet.service.IVetExpertsService; |
|||
import com.chenhai.common.utils.poi.ExcelUtil; |
|||
import com.chenhai.common.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 专家信息Controller |
|||
* |
|||
* @author ruoyi |
|||
* @date 2026-01-08 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/vet/experts") |
|||
public class VetExpertsController extends BaseController |
|||
{ |
|||
@Autowired |
|||
private IVetExpertsService vetExpertsService; |
|||
|
|||
/** |
|||
* 查询专家信息列表 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('vet:experts:list') or @ss.hasRole('muhu')") |
|||
@GetMapping("/list") |
|||
public TableDataInfo list(VetExperts vetExperts) |
|||
{ |
|||
startPage(); |
|||
List<VetExperts> list = vetExpertsService.selectVetExpertsList(vetExperts); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
/** |
|||
* 导出专家信息列表 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('vet:experts:export') or @ss.hasRole('muhu')") |
|||
@Log(title = "专家信息", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(HttpServletResponse response, VetExperts vetExperts) |
|||
{ |
|||
List<VetExperts> list = vetExpertsService.selectVetExpertsList(vetExperts); |
|||
ExcelUtil<VetExperts> util = new ExcelUtil<VetExperts>(VetExperts.class); |
|||
util.exportExcel(response, list, "专家信息数据"); |
|||
} |
|||
|
|||
/** |
|||
* 获取专家信息详细信息 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('vet:experts:query') or @ss.hasRole('muhu')") |
|||
@GetMapping(value = "/{expertId}") |
|||
public AjaxResult getInfo(@PathVariable("expertId") Long expertId) |
|||
{ |
|||
return success(vetExpertsService.selectVetExpertsByExpertId(expertId)); |
|||
} |
|||
|
|||
/** |
|||
* 新增专家信息 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('vet:experts:add') or @ss.hasRole('muhu')") |
|||
@Log(title = "专家信息", businessType = BusinessType.INSERT) |
|||
@PostMapping |
|||
public AjaxResult add(@RequestBody VetExperts vetExperts) |
|||
{ |
|||
return toAjax(vetExpertsService.insertVetExperts(vetExperts)); |
|||
} |
|||
|
|||
/** |
|||
* 修改专家信息 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('vet:experts:edit') or @ss.hasRole('muhu')") |
|||
@Log(title = "专家信息", businessType = BusinessType.UPDATE) |
|||
@PutMapping |
|||
public AjaxResult edit(@RequestBody VetExperts vetExperts) |
|||
{ |
|||
return toAjax(vetExpertsService.updateVetExperts(vetExperts)); |
|||
} |
|||
|
|||
/** |
|||
* 删除专家信息 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('vet:experts:remove') or @ss.hasRole('muhu')") |
|||
@Log(title = "专家信息", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{expertIds}") |
|||
public AjaxResult remove(@PathVariable Long[] expertIds) |
|||
{ |
|||
return toAjax(vetExpertsService.deleteVetExpertsByExpertIds(expertIds)); |
|||
} |
|||
} |
|||
@ -0,0 +1,268 @@ |
|||
package com.chenhai.muhu.domain; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; |
|||
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; |
|||
|
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 问诊单对象 muhu_consultation_forms |
|||
* |
|||
* @author ruoyi |
|||
* @date 2026-01-07 |
|||
*/ |
|||
public class MuhuConsultationForms extends BaseEntity |
|||
{ |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** $column.columnComment */ |
|||
private Long formId; |
|||
|
|||
/** 发布者 */ |
|||
@Excel(name = "发布者") |
|||
private String farmerName; |
|||
|
|||
/** 用户ID */ |
|||
private Long userId; |
|||
|
|||
/** 问诊标题 */ |
|||
@Excel(name = "问诊标题") |
|||
private String title; |
|||
|
|||
/** 病情描述 */ |
|||
@Excel(name = "病情描述") |
|||
private String description; |
|||
|
|||
/** 牲畜种类 */ |
|||
@Excel(name = "牲畜种类") |
|||
private String animalType; |
|||
|
|||
/** 牲畜年龄 */ |
|||
@Excel(name = "牲畜年龄") |
|||
private String animalAge; |
|||
|
|||
/** 牲畜性别 */ |
|||
@Excel(name = "牲畜性别") |
|||
private String animalGender; |
|||
|
|||
/** 症状照片或视频 */ |
|||
@Excel(name = "症状照片或视频") |
|||
private String images; |
|||
|
|||
/** 回复状态 */ |
|||
@Excel(name = "回复状态") |
|||
private String status; |
|||
|
|||
/** 是否含敏感词 */ |
|||
@Excel(name = "是否含敏感词") |
|||
private Integer isSensitive; |
|||
|
|||
/** 检测到的敏感词列表 */ |
|||
@Excel(name = "检测到的敏感词列表") |
|||
private String sensitiveWords; |
|||
|
|||
/** 查看次数 */ |
|||
@Excel(name = "查看次数") |
|||
private Long viewCount; |
|||
|
|||
/** 回复数量 */ |
|||
@Excel(name = "回复数量") |
|||
private Long replyCount; |
|||
|
|||
/** 问诊时间 */ |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
@Excel(name = "问诊时间") |
|||
private Date createdTime; |
|||
|
|||
/** 头像 */ |
|||
@Excel(name = "头像") |
|||
private String avatar; |
|||
|
|||
public void setFormId(Long formId) |
|||
{ |
|||
this.formId = formId; |
|||
} |
|||
|
|||
public Long getFormId() |
|||
{ |
|||
return formId; |
|||
} |
|||
|
|||
public void setFarmerName(String farmerName) |
|||
{ |
|||
this.farmerName = farmerName; |
|||
} |
|||
|
|||
public String getFarmerName() |
|||
{ |
|||
return farmerName; |
|||
} |
|||
|
|||
public void setUserId(Long userId) |
|||
{ |
|||
this.userId = userId; |
|||
} |
|||
|
|||
public Long getUserId() |
|||
{ |
|||
return userId; |
|||
} |
|||
|
|||
public void setTitle(String title) |
|||
{ |
|||
this.title = title; |
|||
} |
|||
|
|||
public String getTitle() |
|||
{ |
|||
return title; |
|||
} |
|||
|
|||
public void setDescription(String description) |
|||
{ |
|||
this.description = description; |
|||
} |
|||
|
|||
public String getDescription() |
|||
{ |
|||
return description; |
|||
} |
|||
|
|||
public void setAnimalType(String animalType) |
|||
{ |
|||
this.animalType = animalType; |
|||
} |
|||
|
|||
public String getAnimalType() |
|||
{ |
|||
return animalType; |
|||
} |
|||
|
|||
public void setAnimalAge(String animalAge) |
|||
{ |
|||
this.animalAge = animalAge; |
|||
} |
|||
|
|||
public String getAnimalAge() |
|||
{ |
|||
return animalAge; |
|||
} |
|||
|
|||
public void setAnimalGender(String animalGender) |
|||
{ |
|||
this.animalGender = animalGender; |
|||
} |
|||
|
|||
public String getAnimalGender() |
|||
{ |
|||
return animalGender; |
|||
} |
|||
|
|||
public void setImages(String images) |
|||
{ |
|||
this.images = images; |
|||
} |
|||
|
|||
public String getImages() |
|||
{ |
|||
return images; |
|||
} |
|||
|
|||
public void setStatus(String status) |
|||
{ |
|||
this.status = status; |
|||
} |
|||
|
|||
public String getStatus() |
|||
{ |
|||
return status; |
|||
} |
|||
|
|||
public void setIsSensitive(Integer isSensitive) |
|||
{ |
|||
this.isSensitive = isSensitive; |
|||
} |
|||
|
|||
public Integer getIsSensitive() |
|||
{ |
|||
return isSensitive; |
|||
} |
|||
|
|||
public void setSensitiveWords(String sensitiveWords) |
|||
{ |
|||
this.sensitiveWords = sensitiveWords; |
|||
} |
|||
|
|||
public String getSensitiveWords() |
|||
{ |
|||
return sensitiveWords; |
|||
} |
|||
|
|||
public void setViewCount(Long viewCount) |
|||
{ |
|||
this.viewCount = viewCount; |
|||
} |
|||
|
|||
public Long getViewCount() |
|||
{ |
|||
return viewCount; |
|||
} |
|||
|
|||
public void setReplyCount(Long replyCount) |
|||
{ |
|||
this.replyCount = replyCount; |
|||
} |
|||
|
|||
public Long getReplyCount() |
|||
{ |
|||
return replyCount; |
|||
} |
|||
|
|||
public void setCreatedTime(Date createdTime) |
|||
{ |
|||
this.createdTime = createdTime; |
|||
} |
|||
|
|||
public Date getCreatedTime() |
|||
{ |
|||
return createdTime; |
|||
} |
|||
|
|||
public void setAvatar(String avatar) |
|||
{ |
|||
this.avatar = avatar; |
|||
} |
|||
|
|||
public String getAvatar() |
|||
{ |
|||
return avatar; |
|||
} |
|||
|
|||
|
|||
@Override |
|||
public String toString() { |
|||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
|||
.append("formId", getFormId()) |
|||
.append("farmerName", getFarmerName()) |
|||
.append("userId", getUserId()) |
|||
.append("title", getTitle()) |
|||
.append("description", getDescription()) |
|||
.append("animalType", getAnimalType()) |
|||
.append("animalAge", getAnimalAge()) |
|||
.append("animalGender", getAnimalGender()) |
|||
.append("images", getImages()) |
|||
.append("status", getStatus()) |
|||
.append("isSensitive", getIsSensitive()) |
|||
.append("sensitiveWords", getSensitiveWords()) |
|||
.append("viewCount", getViewCount()) |
|||
.append("replyCount", getReplyCount()) |
|||
.append("createdTime", getCreatedTime()) |
|||
.append("avatar", getAvatar()) |
|||
.toString(); |
|||
} |
|||
} |
|||
@ -0,0 +1,61 @@ |
|||
package com.chenhai.muhu.mapper; |
|||
|
|||
import java.util.List; |
|||
import com.chenhai.muhu.domain.MuhuConsultationForms; |
|||
|
|||
/** |
|||
* 问诊单Mapper接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2026-01-07 |
|||
*/ |
|||
public interface MuhuConsultationFormsMapper |
|||
{ |
|||
/** |
|||
* 查询问诊单 |
|||
* |
|||
* @param formId 问诊单主键 |
|||
* @return 问诊单 |
|||
*/ |
|||
public MuhuConsultationForms selectMuhuConsultationFormsByFormId(Long formId); |
|||
|
|||
/** |
|||
* 查询问诊单列表 |
|||
* |
|||
* @param muhuConsultationForms 问诊单 |
|||
* @return 问诊单集合 |
|||
*/ |
|||
public List<MuhuConsultationForms> selectMuhuConsultationFormsList(MuhuConsultationForms muhuConsultationForms); |
|||
|
|||
/** |
|||
* 新增问诊单 |
|||
* |
|||
* @param muhuConsultationForms 问诊单 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertMuhuConsultationForms(MuhuConsultationForms muhuConsultationForms); |
|||
|
|||
/** |
|||
* 修改问诊单 |
|||
* |
|||
* @param muhuConsultationForms 问诊单 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateMuhuConsultationForms(MuhuConsultationForms muhuConsultationForms); |
|||
|
|||
/** |
|||
* 删除问诊单 |
|||
* |
|||
* @param formId 问诊单主键 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteMuhuConsultationFormsByFormId(Long formId); |
|||
|
|||
/** |
|||
* 批量删除问诊单 |
|||
* |
|||
* @param formIds 需要删除的数据主键集合 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteMuhuConsultationFormsByFormIds(Long[] formIds); |
|||
} |
|||
@ -0,0 +1,61 @@ |
|||
package com.chenhai.muhu.service; |
|||
|
|||
import java.util.List; |
|||
import com.chenhai.muhu.domain.MuhuConsultationForms; |
|||
|
|||
/** |
|||
* 问诊单Service接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2026-01-07 |
|||
*/ |
|||
public interface IMuhuConsultationFormsService |
|||
{ |
|||
/** |
|||
* 查询问诊单 |
|||
* |
|||
* @param formId 问诊单主键 |
|||
* @return 问诊单 |
|||
*/ |
|||
public MuhuConsultationForms selectMuhuConsultationFormsByFormId(Long formId); |
|||
|
|||
/** |
|||
* 查询问诊单列表 |
|||
* |
|||
* @param muhuConsultationForms 问诊单 |
|||
* @return 问诊单集合 |
|||
*/ |
|||
public List<MuhuConsultationForms> selectMuhuConsultationFormsList(MuhuConsultationForms muhuConsultationForms); |
|||
|
|||
/** |
|||
* 新增问诊单 |
|||
* |
|||
* @param muhuConsultationForms 问诊单 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertMuhuConsultationForms(MuhuConsultationForms muhuConsultationForms); |
|||
|
|||
/** |
|||
* 修改问诊单 |
|||
* |
|||
* @param muhuConsultationForms 问诊单 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateMuhuConsultationForms(MuhuConsultationForms muhuConsultationForms); |
|||
|
|||
/** |
|||
* 批量删除问诊单 |
|||
* |
|||
* @param formIds 需要删除的问诊单主键集合 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteMuhuConsultationFormsByFormIds(Long[] formIds); |
|||
|
|||
/** |
|||
* 删除问诊单信息 |
|||
* |
|||
* @param formId 问诊单主键 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteMuhuConsultationFormsByFormId(Long formId); |
|||
} |
|||
@ -0,0 +1,237 @@ |
|||
package com.chenhai.muhu.service.impl; |
|||
|
|||
import java.util.List; |
|||
|
|||
import com.chenhai.common.core.domain.model.LoginUser; |
|||
import com.chenhai.common.utils.SecurityUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import com.chenhai.muhu.mapper.MuhuConsultationFormsMapper; |
|||
import com.chenhai.muhu.domain.MuhuConsultationForms; |
|||
import com.chenhai.muhu.service.IMuhuConsultationFormsService; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
/** |
|||
* 问诊单Service业务层处理 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2026-01-07 |
|||
*/ |
|||
@Service |
|||
public class MuhuConsultationFormsServiceImpl implements IMuhuConsultationFormsService |
|||
{ |
|||
@Autowired |
|||
private MuhuConsultationFormsMapper muhuConsultationFormsMapper; |
|||
|
|||
@Autowired |
|||
private com.chenhai.vet.mapper.VetCommentsMapper vetCommentsMapper; |
|||
|
|||
/** |
|||
* 查询问诊单 |
|||
* |
|||
* @param formId 问诊单主键 |
|||
* @return 问诊单 |
|||
*/ |
|||
@Override |
|||
public MuhuConsultationForms selectMuhuConsultationFormsByFormId(Long formId) { |
|||
MuhuConsultationForms form = muhuConsultationFormsMapper.selectMuhuConsultationFormsByFormId(formId); |
|||
if (form != null) { |
|||
// 修复回复数量 |
|||
fixReplyCountAndStatus(form); |
|||
} |
|||
return form; |
|||
} |
|||
|
|||
/** |
|||
* 查询问诊单列表 |
|||
* |
|||
* @param muhuConsultationForms 问诊单 |
|||
* @return 问诊单 |
|||
*/ |
|||
@Override |
|||
public List<MuhuConsultationForms> selectMuhuConsultationFormsList(MuhuConsultationForms muhuConsultationForms) |
|||
{ |
|||
// 检查是否有admin权限 |
|||
boolean isAdmin = SecurityUtils.hasRole("admin") || SecurityUtils.hasPermi("*:*:*"); |
|||
|
|||
if (SecurityUtils.hasRole("muhu") && !isAdmin && SecurityUtils.hasRole("vetnotshenhe")) { |
|||
LoginUser loginUser = SecurityUtils.getLoginUser(); |
|||
if (loginUser != null) { |
|||
// 如果是muhu用户且不是admin,只能查看自己的问诊单 |
|||
muhuConsultationForms.setUserId(loginUser.getUserId()); |
|||
} |
|||
} |
|||
|
|||
List<MuhuConsultationForms> list = muhuConsultationFormsMapper.selectMuhuConsultationFormsList(muhuConsultationForms); |
|||
|
|||
// 修复每个问诊单的回复数量和状态 |
|||
for (MuhuConsultationForms form : list) { |
|||
fixReplyCountAndStatus(form); |
|||
} |
|||
|
|||
return list; |
|||
} |
|||
|
|||
/** |
|||
* 新增问诊单 |
|||
* |
|||
* @param muhuConsultationForms 问诊单 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
@Transactional |
|||
public int insertMuhuConsultationForms(MuhuConsultationForms muhuConsultationForms) |
|||
{ |
|||
// 获取当前登录用户信息 |
|||
LoginUser loginUser = SecurityUtils.getLoginUser(); |
|||
if (loginUser != null) { |
|||
// 设置用户ID |
|||
muhuConsultationForms.setUserId(loginUser.getUserId()); |
|||
// 设置发布者名称为用户昵称 |
|||
if (muhuConsultationForms.getFarmerName() == null || muhuConsultationForms.getFarmerName().isEmpty()) { |
|||
muhuConsultationForms.setFarmerName(loginUser.getUser().getNickName()); |
|||
} |
|||
// 设置用户头像 |
|||
if (muhuConsultationForms.getAvatar() == null || muhuConsultationForms.getAvatar().isEmpty()) { |
|||
muhuConsultationForms.setAvatar(loginUser.getUser().getAvatar()); |
|||
} |
|||
} |
|||
|
|||
// 设置默认状态为待回复 |
|||
if (muhuConsultationForms.getStatus() == null) { |
|||
muhuConsultationForms.setStatus("未回复"); |
|||
} |
|||
|
|||
return muhuConsultationFormsMapper.insertMuhuConsultationForms(muhuConsultationForms); |
|||
} |
|||
|
|||
/** |
|||
* 修改问诊单 |
|||
* |
|||
* @param muhuConsultationForms 问诊单 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int updateMuhuConsultationForms(MuhuConsultationForms muhuConsultationForms) |
|||
{ |
|||
boolean isAdmin = SecurityUtils.hasRole("admin") || SecurityUtils.hasPermi("*:*:*"); |
|||
// muhu用户只能修改自己的问诊单 |
|||
if (SecurityUtils.hasRole("muhu") && !isAdmin) { |
|||
LoginUser loginUser = SecurityUtils.getLoginUser(); |
|||
if (loginUser != null) { |
|||
// 先查询原始数据 |
|||
MuhuConsultationForms originalForm = muhuConsultationFormsMapper.selectMuhuConsultationFormsByFormId(muhuConsultationForms.getFormId()); |
|||
if (originalForm != null && !originalForm.getUserId().equals(loginUser.getUserId())) { |
|||
throw new RuntimeException("只能修改自己的问诊单"); |
|||
} |
|||
} |
|||
} |
|||
|
|||
return muhuConsultationFormsMapper.updateMuhuConsultationForms(muhuConsultationForms); |
|||
} |
|||
|
|||
/** |
|||
* 批量删除问诊单 |
|||
* |
|||
* @param formIds 需要删除的问诊单主键 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
@Transactional |
|||
public int deleteMuhuConsultationFormsByFormIds(Long[] formIds) |
|||
{ |
|||
boolean isAdmin = SecurityUtils.hasRole("admin") || SecurityUtils.hasPermi("*:*:*"); |
|||
// muhu用户只能删除自己的问诊单 |
|||
if (SecurityUtils.hasRole("muhu") && !isAdmin) { |
|||
LoginUser loginUser = SecurityUtils.getLoginUser(); |
|||
if (loginUser != null) { |
|||
for (Long formId : formIds) { |
|||
MuhuConsultationForms form = muhuConsultationFormsMapper.selectMuhuConsultationFormsByFormId(formId); |
|||
if (form != null && !form.getUserId().equals(loginUser.getUserId())) { |
|||
throw new RuntimeException("只能删除自己的问诊单"); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
return muhuConsultationFormsMapper.deleteMuhuConsultationFormsByFormIds(formIds); |
|||
} |
|||
|
|||
/** |
|||
* 删除问诊单信息 |
|||
* |
|||
* @param formId 问诊单主键 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteMuhuConsultationFormsByFormId(Long formId) |
|||
{ |
|||
boolean isAdmin = SecurityUtils.hasRole("admin") || SecurityUtils.hasPermi("*:*:*"); |
|||
// muhu用户只能删除自己的问诊单 |
|||
if (SecurityUtils.hasRole("muhu") && !isAdmin) { |
|||
LoginUser loginUser = SecurityUtils.getLoginUser(); |
|||
if (loginUser != null) { |
|||
MuhuConsultationForms form = muhuConsultationFormsMapper.selectMuhuConsultationFormsByFormId(formId); |
|||
if (form != null && !form.getUserId().equals(loginUser.getUserId())) { |
|||
throw new RuntimeException("只能删除自己的问诊单"); |
|||
} |
|||
} |
|||
} |
|||
|
|||
return muhuConsultationFormsMapper.deleteMuhuConsultationFormsByFormId(formId); |
|||
} |
|||
|
|||
/** |
|||
* 修复回复数量和状态(核心修复方法) |
|||
* 确保问诊单的回复数量和状态一致 |
|||
*/ |
|||
private void fixReplyCountAndStatus(MuhuConsultationForms form) { |
|||
if (form == null) { |
|||
return; |
|||
} |
|||
|
|||
try { |
|||
// 查询实际的回复数量 |
|||
Long actualReplyCount = getActualReplyCount(form.getFormId()); |
|||
|
|||
// 如果数据库中的回复数和实际不符,修复它 |
|||
if (actualReplyCount != null && !actualReplyCount.equals(form.getReplyCount())) { |
|||
form.setReplyCount(actualReplyCount); |
|||
} |
|||
|
|||
// 修复状态:有回复就应该是"已回复" |
|||
if (actualReplyCount != null && actualReplyCount > 0 && !"已回复".equals(form.getStatus())) { |
|||
form.setStatus("已回复"); |
|||
} |
|||
// 如果实际没有回复但状态是"已回复",修复为"未回复" |
|||
else if ((actualReplyCount == null || actualReplyCount == 0) && "已回复".equals(form.getStatus())) { |
|||
form.setStatus("未回复"); |
|||
} |
|||
} catch (Exception e) { |
|||
// 忽略异常,不影响主流程 |
|||
e.printStackTrace(); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 获取实际回复数量 |
|||
* @param formId 问诊单ID |
|||
* @return 回复数量 |
|||
*/ |
|||
private Long getActualReplyCount(Long formId) { |
|||
try { |
|||
// 创建查询条件 |
|||
com.chenhai.vet.domain.VetComments query = new com.chenhai.vet.domain.VetComments(); |
|||
query.setConsultationId(formId); |
|||
|
|||
// 查询回复列表 |
|||
List<com.chenhai.vet.domain.VetComments> replies = vetCommentsMapper.selectVetCommentsList(query); |
|||
|
|||
// 返回数量 |
|||
return replies != null ? (long) replies.size() : 0L; |
|||
} catch (Exception e) { |
|||
e.printStackTrace(); |
|||
return 0L; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,299 @@ |
|||
package com.chenhai.system.domain; |
|||
|
|||
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; |
|||
|
|||
/** |
|||
* 专家咨询对象 sys_expert_consultation |
|||
* |
|||
* @author ruoyi |
|||
* @date 2026-01-12 |
|||
*/ |
|||
public class SysExpertConsultation extends BaseEntity |
|||
{ |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** 咨询ID */ |
|||
private Long consultationId; |
|||
|
|||
/** 用户ID */ |
|||
@Excel(name = "用户ID") |
|||
private Long userId; |
|||
|
|||
/** 专家ID */ |
|||
@Excel(name = "专家ID") |
|||
private Long expertId; |
|||
|
|||
/** 关联问诊单ID */ |
|||
@Excel(name = "关联问诊单ID") |
|||
private Long formId; |
|||
|
|||
/** 咨询类型: 1-图文咨询, 2-电话咨询, 3-视频咨询 */ |
|||
@Excel(name = "咨询类型: 1-图文咨询, 2-电话咨询, 3-视频咨询") |
|||
private String consultationType; |
|||
|
|||
/** 咨询状态: 0-待接诊, 1-进行中, 2-已完成, 3-已取消 */ |
|||
@Excel(name = "咨询状态: 0-待接诊, 1-进行中, 2-已完成, 3-已取消") |
|||
private String consultationStatus; |
|||
|
|||
/** 咨询标题 */ |
|||
@Excel(name = "咨询标题") |
|||
private String consultationTitle; |
|||
|
|||
/** 用户初始咨询内容 */ |
|||
@Excel(name = "用户初始咨询内容") |
|||
private String initialContent; |
|||
|
|||
/** 用户初始附件(JSON数组) */ |
|||
@Excel(name = "用户初始附件(JSON数组)") |
|||
private String initialAttachments; |
|||
|
|||
/** 对话消息(JSON格式) */ |
|||
@Excel(name = "对话消息(JSON格式)") |
|||
private String messages; |
|||
|
|||
/** 用户评分(1-5分) */ |
|||
@Excel(name = "用户评分(1-5分)") |
|||
private Integer rating; |
|||
|
|||
/** 用户评价内容 */ |
|||
@Excel(name = "用户评价内容") |
|||
private String evaluation; |
|||
|
|||
/** 评价标签(JSON数组) */ |
|||
@Excel(name = "评价标签(JSON数组)") |
|||
private String evaluationTags; |
|||
|
|||
/** 评价时间 */ |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
@Excel(name = "评价时间", width = 30, dateFormat = "yyyy-MM-dd") |
|||
private Date evaluationTime; |
|||
|
|||
/** 咨询开始时间 */ |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
@Excel(name = "咨询开始时间", width = 30, dateFormat = "yyyy-MM-dd") |
|||
private Date startTime; |
|||
|
|||
/** 咨询结束时间 */ |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
@Excel(name = "咨询结束时间", width = 30, dateFormat = "yyyy-MM-dd") |
|||
private Date endTime; |
|||
|
|||
/** 创建时间 */ |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd") |
|||
private Date createdTime; |
|||
|
|||
/** 更新时间 */ |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd") |
|||
private Date updatedTime; |
|||
|
|||
public void setConsultationId(Long consultationId) |
|||
{ |
|||
this.consultationId = consultationId; |
|||
} |
|||
|
|||
public Long getConsultationId() |
|||
{ |
|||
return consultationId; |
|||
} |
|||
|
|||
public void setUserId(Long userId) |
|||
{ |
|||
this.userId = userId; |
|||
} |
|||
|
|||
public Long getUserId() |
|||
{ |
|||
return userId; |
|||
} |
|||
|
|||
public void setExpertId(Long expertId) |
|||
{ |
|||
this.expertId = expertId; |
|||
} |
|||
|
|||
public Long getExpertId() |
|||
{ |
|||
return expertId; |
|||
} |
|||
|
|||
public void setFormId(Long formId) |
|||
{ |
|||
this.formId = formId; |
|||
} |
|||
|
|||
public Long getFormId() |
|||
{ |
|||
return formId; |
|||
} |
|||
|
|||
public void setConsultationType(String consultationType) |
|||
{ |
|||
this.consultationType = consultationType; |
|||
} |
|||
|
|||
public String getConsultationType() |
|||
{ |
|||
return consultationType; |
|||
} |
|||
|
|||
public void setConsultationStatus(String consultationStatus) |
|||
{ |
|||
this.consultationStatus = consultationStatus; |
|||
} |
|||
|
|||
public String getConsultationStatus() |
|||
{ |
|||
return consultationStatus; |
|||
} |
|||
|
|||
public void setConsultationTitle(String consultationTitle) |
|||
{ |
|||
this.consultationTitle = consultationTitle; |
|||
} |
|||
|
|||
public String getConsultationTitle() |
|||
{ |
|||
return consultationTitle; |
|||
} |
|||
|
|||
public void setInitialContent(String initialContent) |
|||
{ |
|||
this.initialContent = initialContent; |
|||
} |
|||
|
|||
public String getInitialContent() |
|||
{ |
|||
return initialContent; |
|||
} |
|||
|
|||
public void setInitialAttachments(String initialAttachments) |
|||
{ |
|||
this.initialAttachments = initialAttachments; |
|||
} |
|||
|
|||
public String getInitialAttachments() |
|||
{ |
|||
return initialAttachments; |
|||
} |
|||
|
|||
public void setMessages(String messages) |
|||
{ |
|||
this.messages = messages; |
|||
} |
|||
|
|||
public String getMessages() |
|||
{ |
|||
return messages; |
|||
} |
|||
|
|||
public void setRating(Integer rating) |
|||
{ |
|||
this.rating = rating; |
|||
} |
|||
|
|||
public Integer getRating() |
|||
{ |
|||
return rating; |
|||
} |
|||
|
|||
public void setEvaluation(String evaluation) |
|||
{ |
|||
this.evaluation = evaluation; |
|||
} |
|||
|
|||
public String getEvaluation() |
|||
{ |
|||
return evaluation; |
|||
} |
|||
|
|||
public void setEvaluationTags(String evaluationTags) |
|||
{ |
|||
this.evaluationTags = evaluationTags; |
|||
} |
|||
|
|||
public String getEvaluationTags() |
|||
{ |
|||
return evaluationTags; |
|||
} |
|||
|
|||
public void setEvaluationTime(Date evaluationTime) |
|||
{ |
|||
this.evaluationTime = evaluationTime; |
|||
} |
|||
|
|||
public Date getEvaluationTime() |
|||
{ |
|||
return evaluationTime; |
|||
} |
|||
|
|||
public void setStartTime(Date startTime) |
|||
{ |
|||
this.startTime = startTime; |
|||
} |
|||
|
|||
public Date getStartTime() |
|||
{ |
|||
return startTime; |
|||
} |
|||
|
|||
public void setEndTime(Date endTime) |
|||
{ |
|||
this.endTime = endTime; |
|||
} |
|||
|
|||
public Date getEndTime() |
|||
{ |
|||
return endTime; |
|||
} |
|||
|
|||
public void setCreatedTime(Date createdTime) |
|||
{ |
|||
this.createdTime = createdTime; |
|||
} |
|||
|
|||
public Date getCreatedTime() |
|||
{ |
|||
return createdTime; |
|||
} |
|||
|
|||
public void setUpdatedTime(Date updatedTime) |
|||
{ |
|||
this.updatedTime = updatedTime; |
|||
} |
|||
|
|||
public Date getUpdatedTime() |
|||
{ |
|||
return updatedTime; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
|||
.append("consultationId", getConsultationId()) |
|||
.append("userId", getUserId()) |
|||
.append("expertId", getExpertId()) |
|||
.append("formId", getFormId()) |
|||
.append("consultationType", getConsultationType()) |
|||
.append("consultationStatus", getConsultationStatus()) |
|||
.append("consultationTitle", getConsultationTitle()) |
|||
.append("initialContent", getInitialContent()) |
|||
.append("initialAttachments", getInitialAttachments()) |
|||
.append("messages", getMessages()) |
|||
.append("rating", getRating()) |
|||
.append("evaluation", getEvaluation()) |
|||
.append("evaluationTags", getEvaluationTags()) |
|||
.append("evaluationTime", getEvaluationTime()) |
|||
.append("startTime", getStartTime()) |
|||
.append("endTime", getEndTime()) |
|||
.append("createdTime", getCreatedTime()) |
|||
.append("updatedTime", getUpdatedTime()) |
|||
.toString(); |
|||
} |
|||
} |
|||
@ -0,0 +1,61 @@ |
|||
package com.chenhai.system.mapper; |
|||
|
|||
import java.util.List; |
|||
import com.chenhai.system.domain.SysExpertConsultation; |
|||
|
|||
/** |
|||
* 专家咨询Mapper接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2026-01-12 |
|||
*/ |
|||
public interface SysExpertConsultationMapper |
|||
{ |
|||
/** |
|||
* 查询专家咨询 |
|||
* |
|||
* @param consultationId 专家咨询主键 |
|||
* @return 专家咨询 |
|||
*/ |
|||
public SysExpertConsultation selectSysExpertConsultationByConsultationId(Long consultationId); |
|||
|
|||
/** |
|||
* 查询专家咨询列表 |
|||
* |
|||
* @param sysExpertConsultation 专家咨询 |
|||
* @return 专家咨询集合 |
|||
*/ |
|||
public List<SysExpertConsultation> selectSysExpertConsultationList(SysExpertConsultation sysExpertConsultation); |
|||
|
|||
/** |
|||
* 新增专家咨询 |
|||
* |
|||
* @param sysExpertConsultation 专家咨询 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertSysExpertConsultation(SysExpertConsultation sysExpertConsultation); |
|||
|
|||
/** |
|||
* 修改专家咨询 |
|||
* |
|||
* @param sysExpertConsultation 专家咨询 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateSysExpertConsultation(SysExpertConsultation sysExpertConsultation); |
|||
|
|||
/** |
|||
* 删除专家咨询 |
|||
* |
|||
* @param consultationId 专家咨询主键 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteSysExpertConsultationByConsultationId(Long consultationId); |
|||
|
|||
/** |
|||
* 批量删除专家咨询 |
|||
* |
|||
* @param consultationIds 需要删除的数据主键集合 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteSysExpertConsultationByConsultationIds(Long[] consultationIds); |
|||
} |
|||
@ -0,0 +1,61 @@ |
|||
package com.chenhai.system.service; |
|||
|
|||
import java.util.List; |
|||
import com.chenhai.system.domain.SysExpertConsultation; |
|||
|
|||
/** |
|||
* 专家咨询Service接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2026-01-12 |
|||
*/ |
|||
public interface ISysExpertConsultationService |
|||
{ |
|||
/** |
|||
* 查询专家咨询 |
|||
* |
|||
* @param consultationId 专家咨询主键 |
|||
* @return 专家咨询 |
|||
*/ |
|||
public SysExpertConsultation selectSysExpertConsultationByConsultationId(Long consultationId); |
|||
|
|||
/** |
|||
* 查询专家咨询列表 |
|||
* |
|||
* @param sysExpertConsultation 专家咨询 |
|||
* @return 专家咨询集合 |
|||
*/ |
|||
public List<SysExpertConsultation> selectSysExpertConsultationList(SysExpertConsultation sysExpertConsultation); |
|||
|
|||
/** |
|||
* 新增专家咨询 |
|||
* |
|||
* @param sysExpertConsultation 专家咨询 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertSysExpertConsultation(SysExpertConsultation sysExpertConsultation); |
|||
|
|||
/** |
|||
* 修改专家咨询 |
|||
* |
|||
* @param sysExpertConsultation 专家咨询 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateSysExpertConsultation(SysExpertConsultation sysExpertConsultation); |
|||
|
|||
/** |
|||
* 批量删除专家咨询 |
|||
* |
|||
* @param consultationIds 需要删除的专家咨询主键集合 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteSysExpertConsultationByConsultationIds(Long[] consultationIds); |
|||
|
|||
/** |
|||
* 删除专家咨询信息 |
|||
* |
|||
* @param consultationId 专家咨询主键 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteSysExpertConsultationByConsultationId(Long consultationId); |
|||
} |
|||
@ -0,0 +1,93 @@ |
|||
package com.chenhai.system.service.impl; |
|||
|
|||
import java.util.List; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import com.chenhai.system.mapper.SysExpertConsultationMapper; |
|||
import com.chenhai.system.domain.SysExpertConsultation; |
|||
import com.chenhai.system.service.ISysExpertConsultationService; |
|||
|
|||
/** |
|||
* 专家咨询Service业务层处理 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2026-01-12 |
|||
*/ |
|||
@Service |
|||
public class SysExpertConsultationServiceImpl implements ISysExpertConsultationService |
|||
{ |
|||
@Autowired |
|||
private SysExpertConsultationMapper sysExpertConsultationMapper; |
|||
|
|||
/** |
|||
* 查询专家咨询 |
|||
* |
|||
* @param consultationId 专家咨询主键 |
|||
* @return 专家咨询 |
|||
*/ |
|||
@Override |
|||
public SysExpertConsultation selectSysExpertConsultationByConsultationId(Long consultationId) |
|||
{ |
|||
return sysExpertConsultationMapper.selectSysExpertConsultationByConsultationId(consultationId); |
|||
} |
|||
|
|||
/** |
|||
* 查询专家咨询列表 |
|||
* |
|||
* @param sysExpertConsultation 专家咨询 |
|||
* @return 专家咨询 |
|||
*/ |
|||
@Override |
|||
public List<SysExpertConsultation> selectSysExpertConsultationList(SysExpertConsultation sysExpertConsultation) |
|||
{ |
|||
return sysExpertConsultationMapper.selectSysExpertConsultationList(sysExpertConsultation); |
|||
} |
|||
|
|||
/** |
|||
* 新增专家咨询 |
|||
* |
|||
* @param sysExpertConsultation 专家咨询 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int insertSysExpertConsultation(SysExpertConsultation sysExpertConsultation) |
|||
{ |
|||
return sysExpertConsultationMapper.insertSysExpertConsultation(sysExpertConsultation); |
|||
} |
|||
|
|||
/** |
|||
* 修改专家咨询 |
|||
* |
|||
* @param sysExpertConsultation 专家咨询 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int updateSysExpertConsultation(SysExpertConsultation sysExpertConsultation) |
|||
{ |
|||
return sysExpertConsultationMapper.updateSysExpertConsultation(sysExpertConsultation); |
|||
} |
|||
|
|||
/** |
|||
* 批量删除专家咨询 |
|||
* |
|||
* @param consultationIds 需要删除的专家咨询主键 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteSysExpertConsultationByConsultationIds(Long[] consultationIds) |
|||
{ |
|||
return sysExpertConsultationMapper.deleteSysExpertConsultationByConsultationIds(consultationIds); |
|||
} |
|||
|
|||
/** |
|||
* 删除专家咨询信息 |
|||
* |
|||
* @param consultationId 专家咨询主键 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteSysExpertConsultationByConsultationId(Long consultationId) |
|||
{ |
|||
return sysExpertConsultationMapper.deleteSysExpertConsultationByConsultationId(consultationId); |
|||
} |
|||
} |
|||
@ -0,0 +1,230 @@ |
|||
package com.chenhai.vet.domain; |
|||
|
|||
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_comments |
|||
* |
|||
* @author ruoyi |
|||
* @date 2026-01-07 |
|||
*/ |
|||
public class VetComments extends BaseEntity |
|||
{ |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** 主键ID */ |
|||
private Long id; |
|||
|
|||
/** 问诊单ID */ |
|||
@Excel(name = "问诊单ID") |
|||
private Long consultationId; |
|||
|
|||
/** 回复者 */ |
|||
@Excel(name = "回复者") |
|||
private String replyName; |
|||
|
|||
/** 回复内容 */ |
|||
@Excel(name = "回复内容") |
|||
private String content; |
|||
|
|||
/** 评论图片 */ |
|||
@Excel(name = "评论图片") |
|||
private String images; |
|||
|
|||
/** 是否含敏感词 */ |
|||
@Excel(name = "是否含敏感词") |
|||
private Integer isSensitive; |
|||
|
|||
/** 敏感词列表 */ |
|||
@Excel(name = "敏感词列表") |
|||
private String sensitiveWords; |
|||
|
|||
/** 评论时间 */ |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@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; |
|||
|
|||
/** 用户ID */ |
|||
@Excel(name = "用户ID") |
|||
private Long userId; |
|||
|
|||
/** 职称(从用户表关联) */ |
|||
@Excel(name = "职称") |
|||
private String title; |
|||
|
|||
/** 医院(从用户表关联) */ |
|||
@Excel(name = "医院") |
|||
private String hospital; |
|||
|
|||
/** 经验(从用户表关联) */ |
|||
@Excel(name = "经验") |
|||
private String experience; |
|||
|
|||
/** 头像 */ |
|||
@Excel(name = "头像") |
|||
private String avatar; |
|||
|
|||
public String getTitle() { |
|||
return title; |
|||
} |
|||
|
|||
public void setTitle(String title) { |
|||
this.title = title; |
|||
} |
|||
|
|||
public String getHospital() { |
|||
return hospital; |
|||
} |
|||
|
|||
public void setHospital(String hospital) { |
|||
this.hospital = hospital; |
|||
} |
|||
|
|||
public String getExperience() { |
|||
return experience; |
|||
} |
|||
|
|||
public void setExperience(String experience) { |
|||
this.experience = experience; |
|||
} |
|||
|
|||
public void setId(Long id) |
|||
{ |
|||
this.id = id; |
|||
} |
|||
|
|||
public Long getId() |
|||
{ |
|||
return id; |
|||
} |
|||
|
|||
public void setConsultationId(Long consultationId) |
|||
{ |
|||
this.consultationId = consultationId; |
|||
} |
|||
|
|||
public Long getConsultationId() |
|||
{ |
|||
return consultationId; |
|||
} |
|||
|
|||
public void setReplyName(String replyName) |
|||
{ |
|||
this.replyName = replyName; |
|||
} |
|||
|
|||
public String getReplyName() |
|||
{ |
|||
return replyName; |
|||
} |
|||
|
|||
public void setContent(String content) |
|||
{ |
|||
this.content = content; |
|||
} |
|||
|
|||
public String getContent() |
|||
{ |
|||
return content; |
|||
} |
|||
|
|||
public void setImages(String images) |
|||
{ |
|||
this.images = images; |
|||
} |
|||
|
|||
public String getImages() |
|||
{ |
|||
return images; |
|||
} |
|||
|
|||
public void setIsSensitive(Integer isSensitive) |
|||
{ |
|||
this.isSensitive = isSensitive; |
|||
} |
|||
|
|||
public Integer getIsSensitive() |
|||
{ |
|||
return isSensitive; |
|||
} |
|||
|
|||
public void setSensitiveWords(String sensitiveWords) |
|||
{ |
|||
this.sensitiveWords = sensitiveWords; |
|||
} |
|||
|
|||
public String getSensitiveWords() |
|||
{ |
|||
return sensitiveWords; |
|||
} |
|||
|
|||
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; |
|||
} |
|||
|
|||
public void setUserId(Long userId) |
|||
{ |
|||
this.userId = userId; |
|||
} |
|||
|
|||
public Long getUserId() |
|||
{ |
|||
return userId; |
|||
} |
|||
|
|||
public void setAvatar(String avatar) |
|||
{ |
|||
this.avatar = avatar; |
|||
} |
|||
|
|||
public String getAvatar() |
|||
{ |
|||
return avatar; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
|||
.append("id", getId()) |
|||
.append("consultationId", getConsultationId()) |
|||
.append("replyName", getReplyName()) |
|||
.append("content", getContent()) |
|||
.append("images", getImages()) |
|||
.append("isSensitive", getIsSensitive()) |
|||
.append("sensitiveWords", getSensitiveWords()) |
|||
.append("createdAt", getCreatedAt()) |
|||
.append("updatedAt", getUpdatedAt()) |
|||
.append("userId", getUserId()) |
|||
.append("title", getTitle()) |
|||
.append("hospital", getHospital()) |
|||
.append("experience", getExperience()) |
|||
.append("avatar", getAvatar()) |
|||
.toString(); |
|||
} |
|||
} |
|||
@ -0,0 +1,279 @@ |
|||
package com.chenhai.vet.domain; |
|||
|
|||
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_experts |
|||
* |
|||
* @author ruoyi |
|||
* @date 2026-01-08 |
|||
*/ |
|||
public class VetExperts extends BaseEntity |
|||
{ |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** 专家ID */ |
|||
private Long expertId; |
|||
|
|||
/** 关联用户ID */ |
|||
@Excel(name = "关联用户ID") |
|||
private Long userId; |
|||
|
|||
/** 头像 */ |
|||
@Excel(name = "头像") |
|||
private String avatar; |
|||
|
|||
/** 真实姓名 */ |
|||
@Excel(name = "真实姓名") |
|||
private String realName; |
|||
|
|||
/** 专业方向 */ |
|||
@Excel(name = "职称") |
|||
private String title; |
|||
|
|||
/** 手机号 */ |
|||
@Excel(name = "手机号") |
|||
private String iphone; |
|||
|
|||
/** 邮箱 */ |
|||
@Excel(name = "邮箱") |
|||
private String email; |
|||
|
|||
/** 地址 */ |
|||
@Excel(name = "地址") |
|||
private String address; |
|||
|
|||
/** 擅长领域 */ |
|||
@Excel(name = "擅长领域") |
|||
private String expertiseArea; |
|||
|
|||
/** 在线状态:0-离线 1-在线 */ |
|||
@Excel(name = "在线状态:0-离线 1-在线") |
|||
private String isOnline; |
|||
|
|||
/** 备注 */ |
|||
@Excel(name = "备注") |
|||
private String remark; |
|||
|
|||
/** 排序 */ |
|||
@Excel(name = "排序") |
|||
private Long sortOrder; |
|||
|
|||
/** 状态:0-正常 1-停用 */ |
|||
@Excel(name = "状态:0-正常 1-停用") |
|||
private String status; |
|||
|
|||
/** 专家类型 */ |
|||
@Excel(name = "专家类型") |
|||
private String expert; |
|||
|
|||
/** 从业经验 */ |
|||
@Excel(name = "从业经验") |
|||
private String workExperience; |
|||
|
|||
/** $column.columnComment */ |
|||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") |
|||
private Date createdAt; |
|||
|
|||
/** $column.columnComment */ |
|||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") |
|||
private Date updatedAt; |
|||
|
|||
public void setExpertId(Long expertId) |
|||
{ |
|||
this.expertId = expertId; |
|||
} |
|||
|
|||
public Long getExpertId() |
|||
{ |
|||
return expertId; |
|||
} |
|||
|
|||
public void setUserId(Long userId) |
|||
{ |
|||
this.userId = userId; |
|||
} |
|||
|
|||
public Long getUserId() |
|||
{ |
|||
return userId; |
|||
} |
|||
|
|||
public void setAvatar(String avatar) |
|||
{ |
|||
this.avatar = avatar; |
|||
} |
|||
|
|||
public String getAvatar() |
|||
{ |
|||
return avatar; |
|||
} |
|||
|
|||
public void setRealName(String realName) |
|||
{ |
|||
this.realName = realName; |
|||
} |
|||
|
|||
public String getRealName() |
|||
{ |
|||
return realName; |
|||
} |
|||
|
|||
public void setTitle(String title) |
|||
{ |
|||
this.title = title; |
|||
} |
|||
|
|||
public String getTitle() |
|||
{ |
|||
return title; |
|||
} |
|||
|
|||
public void setIphone(String iphone) |
|||
{ |
|||
this.iphone = iphone; |
|||
} |
|||
|
|||
public String getIphone() |
|||
{ |
|||
return iphone; |
|||
} |
|||
|
|||
public void setEmail(String email) |
|||
{ |
|||
this.email = email; |
|||
} |
|||
|
|||
public String getEmail() |
|||
{ |
|||
return email; |
|||
} |
|||
|
|||
public void setAddress(String address) |
|||
{ |
|||
this.address = address; |
|||
} |
|||
|
|||
public String getAddress() |
|||
{ |
|||
return address; |
|||
} |
|||
|
|||
public void setExpertiseArea(String expertiseArea) |
|||
{ |
|||
this.expertiseArea = expertiseArea; |
|||
} |
|||
|
|||
public String getExpertiseArea() |
|||
{ |
|||
return expertiseArea; |
|||
} |
|||
|
|||
public void setIsOnline(String isOnline) |
|||
{ |
|||
this.isOnline = isOnline; |
|||
} |
|||
|
|||
public String getIsOnline() |
|||
{ |
|||
return isOnline; |
|||
} |
|||
|
|||
public void setRemark(String remark) |
|||
{ |
|||
this.remark = remark; |
|||
} |
|||
|
|||
public String getRemark() |
|||
{ |
|||
return remark; |
|||
} |
|||
|
|||
public void setSortOrder(Long sortOrder) |
|||
{ |
|||
this.sortOrder = sortOrder; |
|||
} |
|||
|
|||
public Long getSortOrder() |
|||
{ |
|||
return sortOrder; |
|||
} |
|||
|
|||
public void setStatus(String status) |
|||
{ |
|||
this.status = status; |
|||
} |
|||
|
|||
public String getStatus() |
|||
{ |
|||
return status; |
|||
} |
|||
|
|||
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; |
|||
} |
|||
|
|||
public void setExpert(String expert) |
|||
{ |
|||
this.expert = expert; |
|||
} |
|||
|
|||
public String getExpert() |
|||
{ |
|||
return expert; |
|||
} |
|||
|
|||
public void setWorkExperience(String workExperience) |
|||
{ |
|||
this.workExperience = workExperience; |
|||
} |
|||
|
|||
public String getWorkExperience() |
|||
{ |
|||
return workExperience; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
|||
.append("expertId", getExpertId()) |
|||
.append("userId", getUserId()) |
|||
.append("avatar", getAvatar()) |
|||
.append("realName", getRealName()) |
|||
.append("title", getTitle()) |
|||
.append("iphone", getIphone()) |
|||
.append("email", getEmail()) |
|||
.append("address", getAddress()) |
|||
.append("expertiseArea", getExpertiseArea()) |
|||
.append("isOnline", getIsOnline()) |
|||
.append("remark", getRemark()) |
|||
.append("sortOrder", getSortOrder()) |
|||
.append("status", getStatus()) |
|||
.append("createdAt", getCreatedAt()) |
|||
.append("updatedAt", getUpdatedAt()) |
|||
.append("expert", getExpert()) |
|||
.append("workExperience", getWorkExperience()) |
|||
.toString(); |
|||
} |
|||
} |
|||
@ -0,0 +1,70 @@ |
|||
package com.chenhai.vet.mapper; |
|||
|
|||
import java.util.List; |
|||
import com.chenhai.vet.domain.VetComments; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
/** |
|||
* 兽医回复Mapper接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2026-01-07 |
|||
*/ |
|||
public interface VetCommentsMapper |
|||
{ |
|||
/** |
|||
* 查询兽医回复 |
|||
* |
|||
* @param id 兽医回复主键 |
|||
* @return 兽医回复 |
|||
*/ |
|||
public VetComments selectVetCommentsById(Long id); |
|||
|
|||
/** |
|||
* 查询兽医回复列表 |
|||
* |
|||
* @param vetComments 兽医回复 |
|||
* @return 兽医回复集合 |
|||
*/ |
|||
public List<VetComments> selectVetCommentsList(VetComments vetComments); |
|||
|
|||
/** |
|||
* 新增兽医回复 |
|||
* |
|||
* @param vetComments 兽医回复 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertVetComments(VetComments vetComments); |
|||
|
|||
/** |
|||
* 修改兽医回复 |
|||
* |
|||
* @param vetComments 兽医回复 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateVetComments(VetComments vetComments); |
|||
|
|||
/** |
|||
* 删除兽医回复 |
|||
* |
|||
* @param id 兽医回复主键 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteVetCommentsById(Long id); |
|||
|
|||
/** |
|||
* 批量删除兽医回复 |
|||
* |
|||
* @param ids 需要删除的数据主键集合 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteVetCommentsByIds(Long[] ids); |
|||
|
|||
/** |
|||
* 更新用户专业信息 |
|||
*/ |
|||
public int updateUserProfessionalInfo(@Param("userId") Long userId, |
|||
@Param("title") String title, |
|||
@Param("hospital") String hospital, |
|||
@Param("experience") String experience); |
|||
} |
|||
@ -0,0 +1,62 @@ |
|||
package com.chenhai.vet.mapper; |
|||
|
|||
import java.util.List; |
|||
import com.chenhai.vet.domain.VetExperts; |
|||
|
|||
/** |
|||
* 专家信息Mapper接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2026-01-08 |
|||
*/ |
|||
public interface VetExpertsMapper |
|||
{ |
|||
/** |
|||
* 查询专家信息 |
|||
* |
|||
* @param expertId 专家信息主键 |
|||
* @return 专家信息 |
|||
*/ |
|||
public VetExperts selectVetExpertsByExpertId(Long expertId); |
|||
|
|||
/** |
|||
* 查询专家信息列表 |
|||
* |
|||
* @param vetExperts 专家信息 |
|||
* @return 专家信息集合 |
|||
*/ |
|||
public List<VetExperts> selectVetExpertsList(VetExperts vetExperts); |
|||
|
|||
/** |
|||
* 新增专家信息 |
|||
* |
|||
* @param vetExperts 专家信息 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertVetExperts(VetExperts vetExperts); |
|||
|
|||
/** |
|||
* 修改专家信息 |
|||
* |
|||
* @param vetExperts 专家信息 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateVetExperts(VetExperts vetExperts); |
|||
|
|||
/** |
|||
* 删除专家信息 |
|||
* |
|||
* @param expertId 专家信息主键 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteVetExpertsByExpertId(Long expertId); |
|||
|
|||
/** |
|||
* 批量删除专家信息 |
|||
* |
|||
* @param expertIds 需要删除的数据主键集合 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteVetExpertsByExpertIds(Long[] expertIds); |
|||
|
|||
} |
|||
@ -0,0 +1,61 @@ |
|||
package com.chenhai.vet.service; |
|||
|
|||
import java.util.List; |
|||
import com.chenhai.vet.domain.VetComments; |
|||
|
|||
/** |
|||
* 兽医回复Service接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2026-01-07 |
|||
*/ |
|||
public interface IVetCommentsService |
|||
{ |
|||
/** |
|||
* 查询兽医回复 |
|||
* |
|||
* @param id 兽医回复主键 |
|||
* @return 兽医回复 |
|||
*/ |
|||
public VetComments selectVetCommentsById(Long id); |
|||
|
|||
/** |
|||
* 查询兽医回复列表 |
|||
* |
|||
* @param vetComments 兽医回复 |
|||
* @return 兽医回复集合 |
|||
*/ |
|||
public List<VetComments> selectVetCommentsList(VetComments vetComments); |
|||
|
|||
/** |
|||
* 新增兽医回复 |
|||
* |
|||
* @param vetComments 兽医回复 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertVetComments(VetComments vetComments); |
|||
|
|||
/** |
|||
* 修改兽医回复 |
|||
* |
|||
* @param vetComments 兽医回复 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateVetComments(VetComments vetComments); |
|||
|
|||
/** |
|||
* 批量删除兽医回复 |
|||
* |
|||
* @param ids 需要删除的兽医回复主键集合 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteVetCommentsByIds(Long[] ids); |
|||
|
|||
/** |
|||
* 删除兽医回复信息 |
|||
* |
|||
* @param id 兽医回复主键 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteVetCommentsById(Long id); |
|||
} |
|||
@ -0,0 +1,61 @@ |
|||
package com.chenhai.vet.service; |
|||
|
|||
import java.util.List; |
|||
import com.chenhai.vet.domain.VetExperts; |
|||
|
|||
/** |
|||
* 专家信息Service接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2026-01-08 |
|||
*/ |
|||
public interface IVetExpertsService |
|||
{ |
|||
/** |
|||
* 查询专家信息 |
|||
* |
|||
* @param expertId 专家信息主键 |
|||
* @return 专家信息 |
|||
*/ |
|||
public VetExperts selectVetExpertsByExpertId(Long expertId); |
|||
|
|||
/** |
|||
* 查询专家信息列表 |
|||
* |
|||
* @param vetExperts 专家信息 |
|||
* @return 专家信息集合 |
|||
*/ |
|||
public List<VetExperts> selectVetExpertsList(VetExperts vetExperts); |
|||
|
|||
/** |
|||
* 新增专家信息 |
|||
* |
|||
* @param vetExperts 专家信息 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertVetExperts(VetExperts vetExperts); |
|||
|
|||
/** |
|||
* 修改专家信息 |
|||
* |
|||
* @param vetExperts 专家信息 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateVetExperts(VetExperts vetExperts); |
|||
|
|||
/** |
|||
* 批量删除专家信息 |
|||
* |
|||
* @param expertIds 需要删除的专家信息主键集合 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteVetExpertsByExpertIds(Long[] expertIds); |
|||
|
|||
/** |
|||
* 删除专家信息信息 |
|||
* |
|||
* @param expertId 专家信息主键 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteVetExpertsByExpertId(Long expertId); |
|||
} |
|||
@ -0,0 +1,450 @@ |
|||
package com.chenhai.vet.service.impl; |
|||
|
|||
import java.util.List; |
|||
|
|||
import com.chenhai.common.core.domain.entity.SysUser; |
|||
import com.chenhai.common.core.domain.model.LoginUser; |
|||
import com.chenhai.common.utils.SecurityUtils; |
|||
import com.chenhai.common.utils.StringUtils; |
|||
import com.chenhai.muhu.domain.MuhuConsultationForms; |
|||
import com.chenhai.muhu.service.IMuhuConsultationFormsService; |
|||
import com.chenhai.vet.domain.VetPersonalInfo; |
|||
import com.chenhai.vet.service.IVetPersonalInfoService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import com.chenhai.vet.mapper.VetCommentsMapper; |
|||
import com.chenhai.vet.domain.VetComments; |
|||
import com.chenhai.vet.service.IVetCommentsService; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
import org.slf4j.Logger; |
|||
import org.slf4j.LoggerFactory; |
|||
|
|||
/** |
|||
* 兽医回复Service业务层处理 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2026-01-07 |
|||
*/ |
|||
@Service |
|||
public class VetCommentsServiceImpl implements IVetCommentsService |
|||
{ |
|||
private static final Logger log = LoggerFactory.getLogger(VetCommentsServiceImpl.class); |
|||
|
|||
@Autowired |
|||
private VetCommentsMapper vetCommentsMapper; |
|||
|
|||
@Autowired |
|||
private IMuhuConsultationFormsService consultationFormsService; |
|||
|
|||
@Autowired |
|||
private IVetPersonalInfoService vetPersonalInfoService; |
|||
|
|||
|
|||
/** |
|||
* 查询兽医回复 |
|||
* |
|||
* @param id 兽医回复主键 |
|||
* @return 兽医回复 |
|||
*/ |
|||
@Override |
|||
public VetComments selectVetCommentsById(Long id) |
|||
{ |
|||
VetComments comment = vetCommentsMapper.selectVetCommentsById(id); |
|||
// 如果查询时字段为空,尝试填充兽医信息 |
|||
if (comment != null && (StringUtils.isEmpty(comment.getTitle()) || |
|||
StringUtils.isEmpty(comment.getHospital()) || |
|||
StringUtils.isEmpty(comment.getExperience()))) { |
|||
fillVetInfoToComment(comment); |
|||
} |
|||
return comment; |
|||
} |
|||
|
|||
/** |
|||
* 查询兽医回复列表 |
|||
* |
|||
* @param vetComments 兽医回复 |
|||
* @return 兽医回复 |
|||
*/ |
|||
@Override |
|||
public List<VetComments> selectVetCommentsList(VetComments vetComments) |
|||
{ |
|||
List<VetComments> list = vetCommentsMapper.selectVetCommentsList(vetComments); |
|||
// 为每个记录填充兽医信息 |
|||
if (list != null) { |
|||
list.forEach(this::fillVetInfoToComment); |
|||
} |
|||
return list; |
|||
} |
|||
|
|||
/** |
|||
* 新增兽医回复 |
|||
* |
|||
* @param vetComments 兽医回复 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
@Transactional |
|||
public int insertVetComments(VetComments vetComments) |
|||
{ |
|||
// 获取当前登录用户信息 |
|||
LoginUser loginUser = SecurityUtils.getLoginUser(); |
|||
SysUser currentUser = null; |
|||
|
|||
if (loginUser != null) { |
|||
currentUser = loginUser.getUser(); |
|||
|
|||
// 设置用户ID |
|||
vetComments.setUserId(loginUser.getUserId()); |
|||
|
|||
// 设置回复者为用户昵称 |
|||
if (vetComments.getReplyName() == null || vetComments.getReplyName().isEmpty()) { |
|||
vetComments.setReplyName(currentUser.getNickName()); |
|||
} |
|||
|
|||
// 设置用户头像 |
|||
if (vetComments.getAvatar() == null || vetComments.getAvatar().isEmpty()) { |
|||
vetComments.setAvatar(loginUser.getUser().getAvatar()); |
|||
} |
|||
|
|||
// 自动填充兽医职称、医院和经验信息到数据库字段中 |
|||
vetComments = autoFillVetInfoToFields(vetComments, loginUser.getUserId()); |
|||
|
|||
} |
|||
|
|||
// 设置默认值 |
|||
if (vetComments.getIsSensitive() == null) { |
|||
vetComments.setIsSensitive(0); |
|||
} |
|||
|
|||
int result = vetCommentsMapper.insertVetComments(vetComments); |
|||
|
|||
// 更新问诊单的回复数量和状态 |
|||
try { |
|||
MuhuConsultationForms consultation = |
|||
consultationFormsService.selectMuhuConsultationFormsByFormId(vetComments.getConsultationId()); |
|||
if (consultation != null) { |
|||
consultation.setStatus("已回复"); |
|||
consultationFormsService.updateMuhuConsultationForms(consultation); |
|||
|
|||
// 如果是首次回复,可以记录回复兽医信息(如果有相应字段) |
|||
// 注意:这里需要根据实际问诊单结构来调整 |
|||
recordVetInfoToConsultation(consultation, vetComments); |
|||
} |
|||
} catch (Exception e) { |
|||
log.error("更新问诊单状态失败", e); |
|||
} |
|||
|
|||
return result; |
|||
} |
|||
|
|||
/** |
|||
* 记录兽医信息到问诊单(可选) |
|||
*/ |
|||
private void recordVetInfoToConsultation(MuhuConsultationForms consultation, VetComments vetComments) { |
|||
try { |
|||
// 方式1:使用反射检查字段是否存在 |
|||
try { |
|||
// 尝试检查是否有 vetUserId 字段 |
|||
java.lang.reflect.Method getVetUserId = consultation.getClass().getMethod("getVetUserId"); |
|||
java.lang.reflect.Method setVetUserId = consultation.getClass().getMethod("setVetUserId", Long.class); |
|||
java.lang.reflect.Method setVetName = consultation.getClass().getMethod("setVetName", String.class); |
|||
|
|||
// 如果方法存在且当前值为空,则设置 |
|||
Object vetUserIdValue = getVetUserId.invoke(consultation); |
|||
if (vetUserIdValue == null) { |
|||
setVetUserId.invoke(consultation, vetComments.getUserId()); |
|||
setVetName.invoke(consultation, vetComments.getReplyName()); |
|||
consultationFormsService.updateMuhuConsultationForms(consultation); |
|||
log.info("已记录兽医信息到问诊单,兽医ID:{},兽医姓名:{}", |
|||
vetComments.getUserId(), vetComments.getReplyName()); |
|||
} |
|||
} catch (NoSuchMethodException e) { |
|||
// 如果没有这些字段,忽略 |
|||
log.debug("问诊单没有兽医相关字段,跳过记录"); |
|||
} |
|||
|
|||
} catch (Exception e) { |
|||
log.warn("记录兽医信息到问诊单失败:{}", e.getMessage()); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 自动填充兽医职称、医院和经验信息到数据库字段 |
|||
* 这是主要方法,将信息填充到实体的 title、hospital、experience 字段中 |
|||
* |
|||
* @param vetComments 兽医回复对象 |
|||
* @param userId 兽医用户ID |
|||
* @return 填充后的兽医回复对象 |
|||
*/ |
|||
private VetComments autoFillVetInfoToFields(VetComments vetComments, Long userId) { |
|||
try { |
|||
// 获取兽医个人信息 |
|||
VetPersonalInfo vetInfo = vetPersonalInfoService.selectVetPersonalInfoByUserId(userId); |
|||
|
|||
if (vetInfo != null) { |
|||
// 直接设置到实体字段中 |
|||
if (StringUtils.isNotEmpty(vetInfo.getTitle())) { |
|||
vetComments.setTitle(vetInfo.getTitle()); |
|||
} |
|||
|
|||
if (StringUtils.isNotEmpty(vetInfo.getHospital())) { |
|||
vetComments.setHospital(vetInfo.getHospital()); |
|||
} |
|||
|
|||
if (StringUtils.isNotEmpty(vetInfo.getWorkExperience())) { |
|||
vetComments.setExperience(vetInfo.getWorkExperience()); |
|||
} |
|||
|
|||
log.info("已自动填充兽医信息到字段:职称={}, 医院={}, 经验={}", |
|||
vetInfo.getTitle(), vetInfo.getHospital(), vetInfo.getWorkExperience()); |
|||
|
|||
// 可选:同时在内容中追加兽医信息 |
|||
vetComments = appendVetInfoToContent(vetComments, vetInfo); |
|||
|
|||
} else { |
|||
log.warn("用户ID:{} 未找到兽医个人信息", userId); |
|||
} |
|||
|
|||
} catch (Exception e) { |
|||
log.error("自动填充兽医信息失败,用户ID:{}", userId, e); |
|||
} |
|||
|
|||
return vetComments; |
|||
} |
|||
|
|||
/** |
|||
* 可选方法:将兽医信息追加到回复内容末尾(如果需要) |
|||
*/ |
|||
private VetComments appendVetInfoToContent(VetComments vetComments, VetPersonalInfo vetInfo) { |
|||
// 是否需要在内容中显示兽医信息的配置 |
|||
boolean showVetInfoInContent = true; // 可以从配置读取 |
|||
|
|||
if (showVetInfoInContent) { |
|||
StringBuilder vetSignature = new StringBuilder(); |
|||
|
|||
// 构建兽医信息签名 |
|||
if (StringUtils.isNotEmpty(vetInfo.getTitle())) { |
|||
vetSignature.append(vetInfo.getTitle()); |
|||
} |
|||
|
|||
if (StringUtils.isNotEmpty(vetInfo.getHospital())) { |
|||
if (vetSignature.length() > 0) { |
|||
vetSignature.append(" · "); |
|||
} |
|||
vetSignature.append(vetInfo.getHospital()); |
|||
} |
|||
|
|||
if (StringUtils.isNotEmpty(vetInfo.getWorkExperience())) { |
|||
if (vetSignature.length() > 0) { |
|||
vetSignature.append(" · "); |
|||
} |
|||
vetSignature.append("执业经验:").append(vetInfo.getWorkExperience()); |
|||
} |
|||
|
|||
// 如果有兽医信息,则添加到回复内容中 |
|||
if (vetSignature.length() > 0) { |
|||
String originalContent = vetComments.getContent(); |
|||
String vetInfoStr = "\n\n---\n" + vetSignature.toString(); |
|||
|
|||
// 检查是否已经包含兽医信息,避免重复添加 |
|||
if (originalContent != null && !originalContent.contains("---\n")) { |
|||
vetComments.setContent(originalContent + vetInfoStr); |
|||
log.info("已在回复内容中追加兽医信息:{}", vetSignature.toString()); |
|||
} else if (originalContent == null) { |
|||
vetComments.setContent(vetInfoStr.substring(2)); // 去掉开头的换行符 |
|||
} |
|||
} |
|||
} |
|||
|
|||
return vetComments; |
|||
} |
|||
|
|||
/** |
|||
* 为已有的评论记录填充兽医信息 |
|||
* 用于查询时,如果发现字段为空,从兽医表补充信息 |
|||
*/ |
|||
private void fillVetInfoToComment(VetComments comment) { |
|||
if (comment == null || comment.getUserId() == null) { |
|||
return; |
|||
} |
|||
|
|||
try { |
|||
// 如果字段已经存在,跳过 |
|||
if (StringUtils.isNotEmpty(comment.getTitle()) && |
|||
StringUtils.isNotEmpty(comment.getHospital()) && |
|||
StringUtils.isNotEmpty(comment.getExperience())) { |
|||
return; |
|||
} |
|||
|
|||
// 获取兽医个人信息 |
|||
VetPersonalInfo vetInfo = vetPersonalInfoService.selectVetPersonalInfoByUserId(comment.getUserId()); |
|||
|
|||
if (vetInfo != null) { |
|||
boolean needUpdate = false; |
|||
|
|||
// 检查并填充缺失的字段 |
|||
if (StringUtils.isEmpty(comment.getTitle()) && StringUtils.isNotEmpty(vetInfo.getTitle())) { |
|||
comment.setTitle(vetInfo.getTitle()); |
|||
needUpdate = true; |
|||
} |
|||
|
|||
if (StringUtils.isEmpty(comment.getHospital()) && StringUtils.isNotEmpty(vetInfo.getHospital())) { |
|||
comment.setHospital(vetInfo.getHospital()); |
|||
needUpdate = true; |
|||
} |
|||
|
|||
if (StringUtils.isEmpty(comment.getExperience()) && StringUtils.isNotEmpty(vetInfo.getWorkExperience())) { |
|||
comment.setExperience(vetInfo.getWorkExperience()); |
|||
needUpdate = true; |
|||
} |
|||
|
|||
// 如果补充了信息,更新数据库 |
|||
if (needUpdate) { |
|||
VetComments updateData = new VetComments(); |
|||
updateData.setId(comment.getId()); |
|||
updateData.setTitle(comment.getTitle()); |
|||
updateData.setHospital(comment.getHospital()); |
|||
updateData.setExperience(comment.getExperience()); |
|||
|
|||
vetCommentsMapper.updateVetComments(updateData); |
|||
log.info("已为历史回复记录补充兽医信息,评论ID:{}", comment.getId()); |
|||
} |
|||
} |
|||
|
|||
} catch (Exception e) { |
|||
log.error("填充兽医信息到评论失败,评论ID:{},用户ID:{}", comment.getId(), comment.getUserId(), e); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 获取兽医信息标签(用于前端显示) |
|||
*/ |
|||
public String getVetInfoTags(Long userId) { |
|||
try { |
|||
VetPersonalInfo vetInfo = vetPersonalInfoService.selectVetPersonalInfoByUserId(userId); |
|||
|
|||
if (vetInfo != null) { |
|||
StringBuilder tags = new StringBuilder(); |
|||
|
|||
if (StringUtils.isNotEmpty(vetInfo.getTitle())) { |
|||
tags.append("<span class='vet-tag vet-title'>").append(vetInfo.getTitle()).append("</span>"); |
|||
} |
|||
|
|||
if (StringUtils.isNotEmpty(vetInfo.getHospital())) { |
|||
tags.append("<span class='vet-tag vet-hospital'>").append(vetInfo.getHospital()).append("</span>"); |
|||
} |
|||
|
|||
if (StringUtils.isNotEmpty(vetInfo.getWorkExperience())) { |
|||
tags.append("<span class='vet-tag vet-experience'>执业").append(vetInfo.getWorkExperience()).append("</span>"); |
|||
} |
|||
|
|||
return tags.toString(); |
|||
} |
|||
} catch (Exception e) { |
|||
log.error("获取兽医信息标签失败,用户ID:{}", userId, e); |
|||
} |
|||
|
|||
return ""; |
|||
} |
|||
|
|||
/** |
|||
* 根据问诊单ID获取回复列表(包含兽医信息) |
|||
*/ |
|||
public List<VetComments> getCommentsByConsultationId(Long consultationId) { |
|||
VetComments query = new VetComments(); |
|||
query.setConsultationId(consultationId); |
|||
return selectVetCommentsList(query); |
|||
} |
|||
|
|||
/** |
|||
* 检查用户是否为兽医 |
|||
*/ |
|||
public boolean isUserVet(Long userId) { |
|||
if (userId == null) { |
|||
return false; |
|||
} |
|||
|
|||
try { |
|||
VetPersonalInfo vetInfo = vetPersonalInfoService.selectVetPersonalInfoByUserId(userId); |
|||
return vetInfo != null; |
|||
} catch (Exception e) { |
|||
log.error("检查用户是否为兽医失败,用户ID:{}", userId, e); |
|||
return false; |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 修改兽医回复 |
|||
* |
|||
* @param vetComments 兽医回复 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int updateVetComments(VetComments vetComments) |
|||
{ |
|||
boolean isAdmin = SecurityUtils.hasRole("admin") || SecurityUtils.hasPermi("*:*:*"); |
|||
|
|||
if (SecurityUtils.hasRole("vetnotshenhe") && !isAdmin) { |
|||
LoginUser loginUser = SecurityUtils.getLoginUser(); |
|||
if (loginUser != null) { |
|||
// 先查询原始数据 |
|||
VetComments originalForm = vetCommentsMapper.selectVetCommentsById(vetComments.getId()); |
|||
if (originalForm != null && !originalForm.getUserId().equals(loginUser.getUserId())) { |
|||
throw new RuntimeException("只能修改自己的回复"); |
|||
} |
|||
} |
|||
} |
|||
|
|||
return vetCommentsMapper.updateVetComments(vetComments); |
|||
} |
|||
|
|||
/** |
|||
* 批量删除兽医回复 |
|||
* |
|||
* @param ids 需要删除的兽医回复主键 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteVetCommentsByIds(Long[] ids) |
|||
{ |
|||
boolean isAdmin = SecurityUtils.hasRole("admin") || SecurityUtils.hasPermi("*:*:*"); |
|||
|
|||
if (SecurityUtils.hasRole("vetnotshenhe") && !isAdmin) { |
|||
LoginUser loginUser = SecurityUtils.getLoginUser(); |
|||
if (loginUser != null) { |
|||
for (Long Id : ids) { |
|||
VetComments form = vetCommentsMapper.selectVetCommentsById(Id); |
|||
if (form != null && !form.getUserId().equals(loginUser.getUserId())) { |
|||
throw new RuntimeException("只能删除自己的回复"); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
return vetCommentsMapper.deleteVetCommentsByIds(ids); |
|||
} |
|||
|
|||
/** |
|||
* 删除兽医回复信息 |
|||
* |
|||
* @param id 兽医回复主键 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteVetCommentsById(Long id) |
|||
{ |
|||
boolean isAdmin = SecurityUtils.hasRole("admin") || SecurityUtils.hasPermi("*:*:*"); |
|||
|
|||
if (SecurityUtils.hasRole("vetnotshenhe") && !isAdmin) { |
|||
LoginUser loginUser = SecurityUtils.getLoginUser(); |
|||
if (loginUser != null) { |
|||
VetComments form = vetCommentsMapper.selectVetCommentsById(id); |
|||
if (form != null && !form.getUserId().equals(loginUser.getUserId())) { |
|||
throw new RuntimeException("只能删除自己的回复"); |
|||
} |
|||
} |
|||
} |
|||
|
|||
return vetCommentsMapper.deleteVetCommentsById(id); |
|||
} |
|||
} |
|||
@ -0,0 +1,458 @@ |
|||
package com.chenhai.vet.service.impl; |
|||
|
|||
import java.util.Date; |
|||
import java.util.List; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import com.chenhai.common.core.domain.model.LoginUser; |
|||
import com.chenhai.common.utils.SecurityUtils; |
|||
import com.chenhai.system.service.ISysUserService; |
|||
import com.chenhai.vet.mapper.VetExpertsMapper; |
|||
import com.chenhai.vet.mapper.VetPersonalInfoMapper; |
|||
import com.chenhai.vet.domain.VetExperts; |
|||
import com.chenhai.vet.domain.VetPersonalInfo; |
|||
import com.chenhai.vet.service.IVetExpertsService; |
|||
|
|||
/** |
|||
* 专家信息Service业务层处理 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2026-01-08 |
|||
*/ |
|||
@Service |
|||
public class VetExpertsServiceImpl implements IVetExpertsService |
|||
{ |
|||
@Autowired |
|||
private VetExpertsMapper vetExpertsMapper; |
|||
|
|||
@Autowired |
|||
private VetPersonalInfoMapper vetPersonalInfoMapper; |
|||
|
|||
@Autowired |
|||
private ISysUserService sysUserService; |
|||
|
|||
/** |
|||
* 查询专家信息 |
|||
* |
|||
* @param expertId 专家信息主键 |
|||
* @return 专家信息 |
|||
*/ |
|||
@Override |
|||
public VetExperts selectVetExpertsByExpertId(Long expertId) |
|||
{ |
|||
VetExperts expert = vetExpertsMapper.selectVetExpertsByExpertId(expertId); |
|||
if (expert != null) { |
|||
// 更新在线状态 |
|||
updateOnlineStatus(expert); |
|||
// 如果userId不为空,尝试从兽医表获取数据 |
|||
if (expert.getUserId() != null) { |
|||
autoFillFromVetInfo(expert); |
|||
} |
|||
// 确保显示默认值 |
|||
setDefaultValues(expert); |
|||
} |
|||
return expert; |
|||
} |
|||
|
|||
/** |
|||
* 查询专家信息列表(在线状态在前) |
|||
* |
|||
* @param vetExperts 专家信息 |
|||
* @return 专家信息 |
|||
*/ |
|||
@Override |
|||
public List<VetExperts> selectVetExpertsList(VetExperts vetExperts) |
|||
{ |
|||
|
|||
List<VetExperts> list = vetExpertsMapper.selectVetExpertsList(vetExperts); |
|||
if (list != null) { |
|||
for (VetExperts expert : list) { |
|||
// 更新在线状态 |
|||
updateOnlineStatus(expert); |
|||
// 如果userId不为空,尝试从兽医表获取数据 |
|||
if (expert.getUserId() != null) { |
|||
autoFillFromVetInfo(expert); |
|||
} |
|||
// 确保显示默认值 |
|||
setDefaultValues(expert); |
|||
} |
|||
} |
|||
return list; |
|||
} |
|||
|
|||
/** |
|||
* 新增专家信息 |
|||
* |
|||
* @param vetExperts 专家信息 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
@Transactional |
|||
public int insertVetExperts(VetExperts vetExperts) |
|||
{ |
|||
// 1. 确保设置userId(优先使用传入的,其次使用当前登录用户) |
|||
ensureUserId(vetExperts); |
|||
|
|||
// 2. 设置在线状态(新增时默认为在线) |
|||
vetExperts.setIsOnline("在线"); // 改为汉字"在线" |
|||
|
|||
// 3. 设置排序值(在线排在前面) |
|||
vetExperts.setSortOrder(1L); // 在线专家排序值较高 |
|||
|
|||
// 4. 自动填充默认值(包含从兽医信息表获取数据) |
|||
autoFillDefaultValues(vetExperts); |
|||
|
|||
// 5. 设置默认值(如果从兽医表获取后仍然为空) |
|||
setDefaultValues(vetExperts); |
|||
|
|||
// 6. 设置创建时间和更新时间 |
|||
Date now = new Date(); |
|||
vetExperts.setCreatedAt(now); |
|||
vetExperts.setUpdatedAt(now); |
|||
|
|||
// 7. 设置操作人 |
|||
setAuditInfo(vetExperts); |
|||
|
|||
return vetExpertsMapper.insertVetExperts(vetExperts); |
|||
} |
|||
|
|||
/** |
|||
* 修改专家信息 |
|||
* |
|||
* @param vetExperts 专家信息 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
@Transactional |
|||
public int updateVetExperts(VetExperts vetExperts) |
|||
{ |
|||
// 1. 确保userId不为空 |
|||
ensureUserId(vetExperts); |
|||
|
|||
// 2. 更新在线状态 |
|||
updateOnlineStatus(vetExperts); |
|||
|
|||
// 3. 自动填充默认值 |
|||
autoFillDefaultValues(vetExperts); |
|||
|
|||
// 4. 设置默认值(如果从兽医表获取后仍然为空) |
|||
setDefaultValues(vetExperts); |
|||
|
|||
// 5. 设置更新时间 |
|||
vetExperts.setUpdatedAt(new Date()); |
|||
|
|||
// 6. 设置更新人 |
|||
setUpdateAuditInfo(vetExperts); |
|||
|
|||
return vetExpertsMapper.updateVetExperts(vetExperts); |
|||
} |
|||
|
|||
/** |
|||
* 更新在线状态(如果当前登录用户是该专家,则设置为在线) |
|||
*/ |
|||
private void updateOnlineStatus(VetExperts vetExperts) { |
|||
if (vetExperts == null || vetExperts.getUserId() == null) { |
|||
return; |
|||
} |
|||
|
|||
LoginUser loginUser = SecurityUtils.getLoginUser(); |
|||
if (loginUser != null) { |
|||
// 如果当前登录用户就是该专家,设置为在线 |
|||
if (loginUser.getUserId().equals(vetExperts.getUserId())) { |
|||
vetExperts.setIsOnline("在线"); |
|||
vetExperts.setSortOrder(1L); // 在线状态排序值高 |
|||
} else { |
|||
vetExperts.setIsOnline("离线"); |
|||
vetExperts.setSortOrder(0L); // 离线状态排序值低 |
|||
} |
|||
} else { |
|||
// 没有登录用户,设置为离线 |
|||
vetExperts.setIsOnline("离线"); |
|||
vetExperts.setSortOrder(0L); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 确保设置userId |
|||
*/ |
|||
private void ensureUserId(VetExperts vetExperts) { |
|||
if (vetExperts.getUserId() == null) { |
|||
// 尝试获取当前登录用户ID |
|||
LoginUser loginUser = SecurityUtils.getLoginUser(); |
|||
if (loginUser != null) { |
|||
vetExperts.setUserId(loginUser.getUserId()); |
|||
} |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 设置审计信息 |
|||
*/ |
|||
private void setAuditInfo(VetExperts vetExperts) { |
|||
LoginUser loginUser = SecurityUtils.getLoginUser(); |
|||
if (loginUser != null) { |
|||
vetExperts.setCreateBy(loginUser.getUsername()); |
|||
vetExperts.setUpdateBy(loginUser.getUsername()); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 设置更新审计信息 |
|||
*/ |
|||
private void setUpdateAuditInfo(VetExperts vetExperts) { |
|||
LoginUser loginUser = SecurityUtils.getLoginUser(); |
|||
if (loginUser != null) { |
|||
vetExperts.setUpdateBy(loginUser.getUsername()); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 自动填充默认值(智能填充) |
|||
*/ |
|||
private void autoFillDefaultValues(VetExperts vetExperts) { |
|||
// 先尝试从兽医信息表获取数据 |
|||
if (vetExperts.getUserId() != null) { |
|||
fillFromVetPersonalInfo(vetExperts); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 从兽医个人信息表获取数据 |
|||
*/ |
|||
private void fillFromVetPersonalInfo(VetExperts vetExperts) { |
|||
if (vetExperts.getUserId() == null) { |
|||
return; |
|||
} |
|||
|
|||
VetPersonalInfo vetInfo = vetPersonalInfoMapper.selectVetPersonalInfoByUserId(vetExperts.getUserId()); |
|||
if (vetInfo == null) { |
|||
return; |
|||
} |
|||
|
|||
// 1. 真实姓名 |
|||
if (isFieldEmpty(vetExperts.getRealName()) && !isFieldEmpty(vetInfo.getRealName())) { |
|||
vetExperts.setRealName(vetInfo.getRealName()); |
|||
} |
|||
|
|||
// 2. 联系电话 |
|||
if (isFieldEmpty(vetExperts.getIphone())) { |
|||
if (!isFieldEmpty(vetInfo.getIphone())) { |
|||
vetExperts.setIphone(vetInfo.getIphone()); |
|||
} else if (!isFieldEmpty(vetInfo.getPhone())) { |
|||
vetExperts.setIphone(vetInfo.getPhone()); |
|||
} |
|||
} |
|||
|
|||
// 3. 电子邮箱 |
|||
if (isFieldEmpty(vetExperts.getEmail()) && !isFieldEmpty(vetInfo.getEmail())) { |
|||
vetExperts.setEmail(vetInfo.getEmail()); |
|||
} |
|||
|
|||
// 4. 职称 |
|||
if (isFieldEmpty(vetExperts.getTitle()) && !isFieldEmpty(vetInfo.getTitle())) { |
|||
vetExperts.setTitle(vetInfo.getTitle()); |
|||
} |
|||
|
|||
// 5. 从业经验 |
|||
if (isFieldEmpty(vetExperts.getWorkExperience()) && !isFieldEmpty(vetInfo.getWorkExperience())) { |
|||
vetExperts.setWorkExperience(vetInfo.getWorkExperience()); |
|||
} |
|||
|
|||
// 6. 专家类型 |
|||
if (isFieldEmpty(vetExperts.getExpert()) && !isFieldEmpty(vetInfo.getExpertType())) { |
|||
vetExperts.setExpert(vetInfo.getExpertType()); |
|||
} |
|||
|
|||
// 7. 擅长领域 |
|||
if (isFieldEmpty(vetExperts.getExpertiseArea()) && !isFieldEmpty(vetInfo.getSpecialty())) { |
|||
vetExperts.setExpertiseArea(vetInfo.getSpecialty()); |
|||
} |
|||
|
|||
// 8. 工作单位 |
|||
if (isFieldEmpty(vetExperts.getAddress())) { |
|||
if (!isFieldEmpty(vetInfo.getHospital())) { |
|||
vetExperts.setAddress(vetInfo.getHospital()); |
|||
} else if (!isFieldEmpty(vetInfo.getAddress())) { |
|||
vetExperts.setAddress(vetInfo.getAddress()); |
|||
} |
|||
} |
|||
|
|||
// 9. 头像(如果有的话) |
|||
if (isFieldEmpty(vetExperts.getAvatar()) && vetInfo.getUser() != null |
|||
&& !isFieldEmpty(vetInfo.getUser().getAvatar())) { |
|||
vetExperts.setAvatar(vetInfo.getUser().getAvatar()); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 从兽医信息补充数据(查询时使用) |
|||
*/ |
|||
private void autoFillFromVetInfo(VetExperts expert) { |
|||
if (expert.getUserId() == null) { |
|||
return; |
|||
} |
|||
|
|||
// 如果专家信息中某些字段是默认值,尝试从兽医表获取 |
|||
VetPersonalInfo vetInfo = vetPersonalInfoMapper.selectVetPersonalInfoByUserId(expert.getUserId()); |
|||
if (vetInfo == null) { |
|||
return; |
|||
} |
|||
|
|||
// 真实姓名 |
|||
if ("未填写".equals(expert.getRealName()) && !isFieldEmpty(vetInfo.getRealName())) { |
|||
expert.setRealName(vetInfo.getRealName()); |
|||
} |
|||
|
|||
// 联系电话 |
|||
if ("未填写".equals(expert.getIphone())) { |
|||
if (!isFieldEmpty(vetInfo.getIphone())) { |
|||
expert.setIphone(vetInfo.getIphone()); |
|||
} else if (!isFieldEmpty(vetInfo.getPhone())) { |
|||
expert.setIphone(vetInfo.getPhone()); |
|||
} |
|||
} |
|||
|
|||
// 电子邮箱 |
|||
if ("未填写".equals(expert.getEmail()) && !isFieldEmpty(vetInfo.getEmail())) { |
|||
expert.setEmail(vetInfo.getEmail()); |
|||
} |
|||
|
|||
// 职称 |
|||
if ("未设置".equals(expert.getTitle()) && !isFieldEmpty(vetInfo.getTitle())) { |
|||
expert.setTitle(vetInfo.getTitle()); |
|||
} |
|||
|
|||
// 从业经验 |
|||
if ("暂无".equals(expert.getWorkExperience()) && !isFieldEmpty(vetInfo.getWorkExperience())) { |
|||
expert.setWorkExperience(vetInfo.getWorkExperience()); |
|||
} |
|||
|
|||
// 专家类型 |
|||
if ("普通专家".equals(expert.getExpert()) && !isFieldEmpty(vetInfo.getExpertType())) { |
|||
expert.setExpert(vetInfo.getExpertType()); |
|||
} |
|||
|
|||
// 擅长领域 |
|||
if ("待补充".equals(expert.getExpertiseArea()) && !isFieldEmpty(vetInfo.getSpecialty())) { |
|||
expert.setExpertiseArea(vetInfo.getSpecialty()); |
|||
} |
|||
|
|||
// 工作单位 |
|||
if ("待补充".equals(expert.getAddress())) { |
|||
if (!isFieldEmpty(vetInfo.getHospital())) { |
|||
expert.setAddress(vetInfo.getHospital()); |
|||
} else if (!isFieldEmpty(vetInfo.getAddress())) { |
|||
expert.setAddress(vetInfo.getAddress()); |
|||
} |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 设置默认值(修改了在线状态和排序的默认值) |
|||
*/ |
|||
private void setDefaultValues(VetExperts vetExperts) { |
|||
// 1. 如果真实姓名为空 |
|||
if (isFieldEmpty(vetExperts.getRealName())) { |
|||
vetExperts.setRealName("未填写"); |
|||
} |
|||
|
|||
// 2. 如果联系电话为空 |
|||
if (isFieldEmpty(vetExperts.getIphone())) { |
|||
vetExperts.setIphone("未填写"); |
|||
} |
|||
|
|||
// 3. 如果电子邮箱为空 |
|||
if (isFieldEmpty(vetExperts.getEmail())) { |
|||
vetExperts.setEmail("未填写"); |
|||
} |
|||
|
|||
// 4. 如果职称为空 |
|||
if (isFieldEmpty(vetExperts.getTitle())) { |
|||
vetExperts.setTitle("未设置"); |
|||
} |
|||
|
|||
// 5. 如果从业经验为空 |
|||
if (isFieldEmpty(vetExperts.getWorkExperience())) { |
|||
vetExperts.setWorkExperience("暂无"); |
|||
} |
|||
|
|||
// 6. 如果专家类型为空 |
|||
if (isFieldEmpty(vetExperts.getExpert())) { |
|||
vetExperts.setExpert("普通专家"); |
|||
} |
|||
|
|||
// 7. 如果擅长领域为空 |
|||
if (isFieldEmpty(vetExperts.getExpertiseArea())) { |
|||
vetExperts.setExpertiseArea("待补充"); |
|||
} |
|||
|
|||
// 8. 如果工作单位为空 |
|||
if (isFieldEmpty(vetExperts.getAddress())) { |
|||
vetExperts.setAddress("待补充"); |
|||
} |
|||
|
|||
// 9. 如果头像为空,设置默认头像 |
|||
if (isFieldEmpty(vetExperts.getAvatar())) { |
|||
vetExperts.setAvatar("/profile/avatar/default.jpg"); |
|||
} |
|||
|
|||
// 10. 如果在线状态为空,需要根据登录状态设置 |
|||
if (isFieldEmpty(vetExperts.getIsOnline())) { |
|||
// 检查当前登录用户是否是该专家 |
|||
LoginUser loginUser = SecurityUtils.getLoginUser(); |
|||
if (loginUser != null && vetExperts.getUserId() != null |
|||
&& loginUser.getUserId().equals(vetExperts.getUserId())) { |
|||
vetExperts.setIsOnline("在线"); // 当前登录用户是在线 |
|||
} else { |
|||
vetExperts.setIsOnline("离线"); // 离线 |
|||
} |
|||
} |
|||
|
|||
// 11. 如果状态为空,设置默认正常 |
|||
if (isFieldEmpty(vetExperts.getStatus())) { |
|||
vetExperts.setStatus("0"); |
|||
} |
|||
|
|||
// 12. 如果排序为空,根据在线状态设置排序值 |
|||
if (vetExperts.getSortOrder() == null) { |
|||
if ("在线".equals(vetExperts.getIsOnline())) { |
|||
vetExperts.setSortOrder(1L); // 在线排在前面 |
|||
} else { |
|||
vetExperts.setSortOrder(0L); // 离线排在后面 |
|||
} |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 检查字段是否为空 |
|||
*/ |
|||
private boolean isFieldEmpty(String field) { |
|||
return field == null || field.trim().isEmpty(); |
|||
} |
|||
|
|||
/** |
|||
* 批量删除专家信息 |
|||
* |
|||
* @param expertIds 需要删除的专家信息主键 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteVetExpertsByExpertIds(Long[] expertIds) |
|||
{ |
|||
return vetExpertsMapper.deleteVetExpertsByExpertIds(expertIds); |
|||
} |
|||
|
|||
/** |
|||
* 删除专家信息信息 |
|||
* |
|||
* @param expertId 专家信息主键 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteVetExpertsByExpertId(Long expertId) |
|||
{ |
|||
return vetExpertsMapper.deleteVetExpertsByExpertId(expertId); |
|||
} |
|||
} |
|||
@ -0,0 +1,134 @@ |
|||
<?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.muhu.mapper.MuhuConsultationFormsMapper"> |
|||
|
|||
<resultMap type="MuhuConsultationForms" id="MuhuConsultationFormsResult"> |
|||
<result property="formId" column="form_id" /> |
|||
<result property="farmerName" column="farmer_name" /> |
|||
<result property="userId" column="user_id" /> |
|||
<result property="title" column="title" /> |
|||
<result property="description" column="description" /> |
|||
<result property="animalType" column="animal_type" /> |
|||
<result property="animalAge" column="animal_age" /> |
|||
<result property="animalGender" column="animal_gender" /> |
|||
<result property="status" column="status" /> |
|||
<result property="isSensitive" column="is_sensitive" /> |
|||
<result property="sensitiveWords" column="sensitive_words" /> |
|||
<result property="viewCount" column="view_count" /> |
|||
<result property="replyCount" column="reply_count" /> |
|||
<result property="createdTime" column="created_time" /> |
|||
<result property="avatar" column="avatar" /> |
|||
<result property="images" column="images" /> |
|||
</resultMap> |
|||
|
|||
<sql id="selectMuhuConsultationFormsVo"> |
|||
select form_id, farmer_name, user_id, title, description, animal_type, animal_age, animal_gender, images, status, is_sensitive, sensitive_words, view_count, reply_count, created_time, avatar from muhu_consultation_forms |
|||
</sql> |
|||
|
|||
<select id="selectMuhuConsultationFormsList" parameterType="MuhuConsultationForms" resultMap="MuhuConsultationFormsResult"> |
|||
SELECT |
|||
cf.*, |
|||
(SELECT COUNT(*) FROM vet_comments vc WHERE vc.consultation_id = cf.form_id) as reply_count |
|||
FROM muhu_consultation_forms cf |
|||
<where> |
|||
<if test="farmerName != null "> and cf.farmer_name = #{farmerName}</if> |
|||
<if test="userId != null "> and cf.user_id = #{userId}</if> |
|||
<if test="title != null and title != ''"> |
|||
<bind name="titleLike" value="'%' + title + '%'" /> |
|||
and cf.title like #{titleLike} |
|||
</if> |
|||
<if test="description != null and description != ''"> |
|||
<bind name="descriptionLike" value="'%' + description + '%'" /> |
|||
and cf.description like #{descriptionLike} |
|||
</if> |
|||
<if test="animalType != null and animalType != ''"> and cf.animal_type = #{animalType}</if> |
|||
<if test="animalAge != null and animalAge != ''"> and cf.animal_age = #{animalAge}</if> |
|||
<if test="animalGender != null and animalGender != ''"> and cf.animal_gender = #{animalGender}</if> |
|||
<if test="status != null and status != ''"> and cf.status = #{status}</if> |
|||
<if test="isSensitive != null "> and cf.is_sensitive = #{isSensitive}</if> |
|||
<if test="avatar != null and avatar != ''"> and cf.avatar = #{avatar}</if> |
|||
</where> |
|||
ORDER BY cf.created_time DESC |
|||
</select> |
|||
|
|||
<select id="selectMuhuConsultationFormsByFormId" parameterType="Long" resultMap="MuhuConsultationFormsResult"> |
|||
SELECT |
|||
cf.*, |
|||
(SELECT COUNT(*) FROM vet_comments vc WHERE vc.consultation_id = cf.form_id) as reply_count |
|||
FROM muhu_consultation_forms cf |
|||
WHERE cf.form_id = #{formId} |
|||
</select> |
|||
|
|||
<insert id="insertMuhuConsultationForms" parameterType="MuhuConsultationForms" useGeneratedKeys="true" keyProperty="formId"> |
|||
insert into muhu_consultation_forms |
|||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|||
<if test="farmerName != null">farmer_name,</if> |
|||
<if test="userId != null">user_id,</if> |
|||
<if test="title != null and title != ''">title,</if> |
|||
<if test="description != null and description != ''">description,</if> |
|||
<if test="animalType != null">animal_type,</if> |
|||
<if test="animalAge != null and animalAge != ''">animal_age,</if> |
|||
<if test="animalGender != null and animalGender != ''">animal_gender,</if> |
|||
<if test="status != null">status,</if> |
|||
<if test="isSensitive != null and isSensitive != ''">is_sensitive,</if> |
|||
<if test="sensitiveWords != null and sensitiveWords != ''">sensitive_words,</if> |
|||
<if test="viewCount != null and viewCount != ''">view_count,</if> |
|||
<if test="replyCount != null and replyCount != ''">reply_count,</if> |
|||
<if test="avatar != null and avatar != ''">avatar,</if> |
|||
<if test="images != null and images != ''">images,</if> |
|||
created_time, |
|||
</trim> |
|||
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|||
<if test="farmerName != null">#{farmerName},</if> |
|||
<if test="userId != null">#{userId},</if> |
|||
<if test="title != null and title != ''">#{title},</if> |
|||
<if test="description != null and description != ''">#{description},</if> |
|||
<if test="animalType != null">#{animalType},</if> |
|||
<if test="animalAge != null and animalAge != ''">#{animalAge},</if> |
|||
<if test="animalGender != null and animalGender != ''">#{animalGender},</if> |
|||
<if test="status != null">#{status},</if> |
|||
<if test="isSensitive != null and isSensitive != ''">#{isSensitive},</if> |
|||
<if test="sensitiveWords != null and sensitiveWords != ''">#{sensitiveWords},</if> |
|||
<if test="viewCount != null and viewCount != ''">#{viewCount},</if> |
|||
<if test="replyCount != null and replyCount != ''">#{replyCount},</if> |
|||
<if test="avatar != null and avatar != ''">#{avatar},</if> |
|||
<if test="images != null and images != ''">#{images},</if> |
|||
now(), |
|||
</trim> |
|||
</insert> |
|||
|
|||
<update id="updateMuhuConsultationForms" parameterType="MuhuConsultationForms"> |
|||
update muhu_consultation_forms |
|||
<trim prefix="SET" suffixOverrides=","> |
|||
<if test="farmerName != null">farmer_name = #{farmerName},</if> |
|||
<if test="userId != null">user_id = #{userId},</if> |
|||
<if test="title != null and title != ''">title = #{title},</if> |
|||
<if test="description != null and description != ''">description = #{description},</if> |
|||
<if test="animalType != null">animal_type = #{animalType},</if> |
|||
<if test="animalAge != null and animalAge != ''">animal_age = #{animalAge},</if> |
|||
<if test="animalGender != null and animalGender != ''">animal_gender = #{animalGender},</if> |
|||
<if test="status != null">status = #{status},</if> |
|||
<if test="isSensitive != null">is_sensitive = #{isSensitive},</if> |
|||
<if test="sensitiveWords != null">sensitive_words = #{sensitiveWords},</if> |
|||
<if test="viewCount != null">view_count = #{viewCount},</if> |
|||
<if test="replyCount != null">reply_count = #{replyCount},</if> |
|||
<if test="createdTime != null">created_time = #{createdTime},</if> |
|||
<if test="avatar != null and avatar != ''">avatar = #{avatar},</if> |
|||
<if test="images != null and images != ''">images = #{images},</if> |
|||
</trim> |
|||
where form_id = #{formId} |
|||
</update> |
|||
|
|||
<delete id="deleteMuhuConsultationFormsByFormId" parameterType="Long"> |
|||
delete from muhu_consultation_forms where form_id = #{formId} |
|||
</delete> |
|||
|
|||
<delete id="deleteMuhuConsultationFormsByFormIds" parameterType="String"> |
|||
delete from muhu_consultation_forms where form_id in |
|||
<foreach item="formId" collection="array" open="(" separator="," close=")"> |
|||
#{formId} |
|||
</foreach> |
|||
</delete> |
|||
</mapper> |
|||
@ -0,0 +1,136 @@ |
|||
<?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.system.mapper.SysExpertConsultationMapper"> |
|||
|
|||
<resultMap type="SysExpertConsultation" id="SysExpertConsultationResult"> |
|||
<result property="consultationId" column="consultation_id" /> |
|||
<result property="userId" column="user_id" /> |
|||
<result property="expertId" column="expert_id" /> |
|||
<result property="formId" column="form_id" /> |
|||
<result property="consultationType" column="consultation_type" /> |
|||
<result property="consultationStatus" column="consultation_status" /> |
|||
<result property="consultationTitle" column="consultation_title" /> |
|||
<result property="initialContent" column="initial_content" /> |
|||
<result property="initialAttachments" column="initial_attachments" /> |
|||
<result property="messages" column="messages" /> |
|||
<result property="rating" column="rating" /> |
|||
<result property="evaluation" column="evaluation" /> |
|||
<result property="evaluationTags" column="evaluation_tags" /> |
|||
<result property="evaluationTime" column="evaluation_time" /> |
|||
<result property="startTime" column="start_time" /> |
|||
<result property="endTime" column="end_time" /> |
|||
<result property="createdTime" column="created_time" /> |
|||
<result property="updatedTime" column="updated_time" /> |
|||
</resultMap> |
|||
|
|||
<sql id="selectSysExpertConsultationVo"> |
|||
select consultation_id, user_id, expert_id, form_id, consultation_type, consultation_status, consultation_title, initial_content, initial_attachments, messages, rating, evaluation, evaluation_tags, evaluation_time, start_time, end_time, created_time, updated_time from sys_expert_consultation |
|||
</sql> |
|||
|
|||
<select id="selectSysExpertConsultationList" parameterType="SysExpertConsultation" resultMap="SysExpertConsultationResult"> |
|||
<include refid="selectSysExpertConsultationVo"/> |
|||
<where> |
|||
<if test="userId != null "> and user_id = #{userId}</if> |
|||
<if test="expertId != null "> and expert_id = #{expertId}</if> |
|||
<if test="formId != null "> and form_id = #{formId}</if> |
|||
<if test="consultationType != null and consultationType != ''"> and consultation_type = #{consultationType}</if> |
|||
<if test="consultationStatus != null and consultationStatus != ''"> and consultation_status = #{consultationStatus}</if> |
|||
<if test="consultationTitle != null and consultationTitle != ''"> and consultation_title = #{consultationTitle}</if> |
|||
<if test="initialContent != null and initialContent != ''"> and initial_content = #{initialContent}</if> |
|||
<if test="initialAttachments != null and initialAttachments != ''"> and initial_attachments = #{initialAttachments}</if> |
|||
<if test="messages != null and messages != ''"> and messages = #{messages}</if> |
|||
<if test="rating != null "> and rating = #{rating}</if> |
|||
<if test="evaluation != null and evaluation != ''"> and evaluation = #{evaluation}</if> |
|||
<if test="evaluationTags != null and evaluationTags != ''"> and evaluation_tags = #{evaluationTags}</if> |
|||
<if test="evaluationTime != null "> and evaluation_time = #{evaluationTime}</if> |
|||
<if test="startTime != null "> and start_time = #{startTime}</if> |
|||
<if test="endTime != null "> and end_time = #{endTime}</if> |
|||
<if test="createdTime != null "> and created_time = #{createdTime}</if> |
|||
<if test="updatedTime != null "> and updated_time = #{updatedTime}</if> |
|||
</where> |
|||
</select> |
|||
|
|||
<select id="selectSysExpertConsultationByConsultationId" parameterType="Long" resultMap="SysExpertConsultationResult"> |
|||
<include refid="selectSysExpertConsultationVo"/> |
|||
where consultation_id = #{consultationId} |
|||
</select> |
|||
|
|||
<insert id="insertSysExpertConsultation" parameterType="SysExpertConsultation" useGeneratedKeys="true" keyProperty="consultationId"> |
|||
insert into sys_expert_consultation |
|||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|||
<if test="userId != null">user_id,</if> |
|||
<if test="expertId != null">expert_id,</if> |
|||
<if test="formId != null">form_id,</if> |
|||
<if test="consultationType != null">consultation_type,</if> |
|||
<if test="consultationStatus != null">consultation_status,</if> |
|||
<if test="consultationTitle != null">consultation_title,</if> |
|||
<if test="initialContent != null">initial_content,</if> |
|||
<if test="initialAttachments != null">initial_attachments,</if> |
|||
<if test="messages != null">messages,</if> |
|||
<if test="rating != null">rating,</if> |
|||
<if test="evaluation != null">evaluation,</if> |
|||
<if test="evaluationTags != null">evaluation_tags,</if> |
|||
<if test="evaluationTime != null">evaluation_time,</if> |
|||
<if test="startTime != null">start_time,</if> |
|||
<if test="endTime != null">end_time,</if> |
|||
<if test="createdTime != null">created_time,</if> |
|||
<if test="updatedTime != null">updated_time,</if> |
|||
</trim> |
|||
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|||
<if test="userId != null">#{userId},</if> |
|||
<if test="expertId != null">#{expertId},</if> |
|||
<if test="formId != null">#{formId},</if> |
|||
<if test="consultationType != null">#{consultationType},</if> |
|||
<if test="consultationStatus != null">#{consultationStatus},</if> |
|||
<if test="consultationTitle != null">#{consultationTitle},</if> |
|||
<if test="initialContent != null">#{initialContent},</if> |
|||
<if test="initialAttachments != null">#{initialAttachments},</if> |
|||
<if test="messages != null">#{messages},</if> |
|||
<if test="rating != null">#{rating},</if> |
|||
<if test="evaluation != null">#{evaluation},</if> |
|||
<if test="evaluationTags != null">#{evaluationTags},</if> |
|||
<if test="evaluationTime != null">#{evaluationTime},</if> |
|||
<if test="startTime != null">#{startTime},</if> |
|||
<if test="endTime != null">#{endTime},</if> |
|||
<if test="createdTime != null">#{createdTime},</if> |
|||
<if test="updatedTime != null">#{updatedTime},</if> |
|||
</trim> |
|||
</insert> |
|||
|
|||
<update id="updateSysExpertConsultation" parameterType="SysExpertConsultation"> |
|||
update sys_expert_consultation |
|||
<trim prefix="SET" suffixOverrides=","> |
|||
<if test="userId != null">user_id = #{userId},</if> |
|||
<if test="expertId != null">expert_id = #{expertId},</if> |
|||
<if test="formId != null">form_id = #{formId},</if> |
|||
<if test="consultationType != null">consultation_type = #{consultationType},</if> |
|||
<if test="consultationStatus != null">consultation_status = #{consultationStatus},</if> |
|||
<if test="consultationTitle != null">consultation_title = #{consultationTitle},</if> |
|||
<if test="initialContent != null">initial_content = #{initialContent},</if> |
|||
<if test="initialAttachments != null">initial_attachments = #{initialAttachments},</if> |
|||
<if test="messages != null">messages = #{messages},</if> |
|||
<if test="rating != null">rating = #{rating},</if> |
|||
<if test="evaluation != null">evaluation = #{evaluation},</if> |
|||
<if test="evaluationTags != null">evaluation_tags = #{evaluationTags},</if> |
|||
<if test="evaluationTime != null">evaluation_time = #{evaluationTime},</if> |
|||
<if test="startTime != null">start_time = #{startTime},</if> |
|||
<if test="endTime != null">end_time = #{endTime},</if> |
|||
<if test="createdTime != null">created_time = #{createdTime},</if> |
|||
<if test="updatedTime != null">updated_time = #{updatedTime},</if> |
|||
</trim> |
|||
where consultation_id = #{consultationId} |
|||
</update> |
|||
|
|||
<delete id="deleteSysExpertConsultationByConsultationId" parameterType="Long"> |
|||
delete from sys_expert_consultation where consultation_id = #{consultationId} |
|||
</delete> |
|||
|
|||
<delete id="deleteSysExpertConsultationByConsultationIds" parameterType="String"> |
|||
delete from sys_expert_consultation where consultation_id in |
|||
<foreach item="consultationId" collection="array" open="(" separator="," close=")"> |
|||
#{consultationId} |
|||
</foreach> |
|||
</delete> |
|||
</mapper> |
|||
@ -0,0 +1,143 @@ |
|||
<?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.VetCommentsMapper"> |
|||
|
|||
<resultMap type="VetComments" id="VetCommentsResult"> |
|||
<result property="id" column="id" /> |
|||
<result property="consultationId" column="consultation_id" /> |
|||
<result property="replyName" column="reply_name" /> |
|||
<result property="content" column="content" /> |
|||
<result property="images" column="images" /> |
|||
<result property="isSensitive" column="is_sensitive" /> |
|||
<result property="sensitiveWords" column="sensitive_words" /> |
|||
<result property="createdAt" column="created_at" /> |
|||
<result property="updatedAt" column="updated_at" /> |
|||
<result property="userId" column="user_id" /> |
|||
<result property="title" column="title" /> |
|||
<result property="hospital" column="hospital" /> |
|||
<result property="experience" column="experience" /> |
|||
<result property="avatar" column="avatar" /> |
|||
</resultMap> |
|||
|
|||
<sql id="selectVetCommentsVo"> |
|||
select |
|||
id, |
|||
consultation_id, |
|||
reply_name, |
|||
content, |
|||
images, |
|||
is_sensitive, |
|||
sensitive_words, |
|||
created_at, |
|||
updated_at, |
|||
user_id, |
|||
<!-- 添加这三个字段 --> |
|||
title, |
|||
hospital, |
|||
experience, |
|||
avatar |
|||
from vet_comments |
|||
</sql> |
|||
|
|||
<select id="selectVetCommentsList" parameterType="VetComments" resultMap="VetCommentsResult"> |
|||
<include refid="selectVetCommentsVo"/> |
|||
<where> |
|||
<if test="consultationId != null "> and consultation_id = #{consultationId}</if> |
|||
<if test="replyName != null "> and reply_name like concat('%', #{replyName}, '%')</if> |
|||
<if test="content != null and content != ''"> and content = #{content}</if> |
|||
<if test="images != null and images != ''"> and images = #{images}</if> |
|||
<if test="isSensitive != null "> and is_sensitive = #{isSensitive}</if> |
|||
<if test="sensitiveWords != null and sensitiveWords != ''"> and sensitive_words = #{sensitiveWords}</if> |
|||
<if test="createdAt != null "> and created_at = #{createdAt}</if> |
|||
<if test="updatedAt != null "> and updated_at = #{updatedAt}</if> |
|||
<if test="userId != null "> and user_id = #{userId}</if> |
|||
<if test="avatar != null and avatar != ''"> and cf.avatar = #{avatar}</if> |
|||
<if test="title != null and title != ''"> and title like concat('%', #{title}, '%')</if> |
|||
<if test="hospital != null and hospital != ''"> and hospital like concat('%', #{hospital}, '%')</if> |
|||
<if test="experience != null and experience != ''"> and experience like concat('%', #{experience}, '%')</if> |
|||
</where> |
|||
</select> |
|||
|
|||
<select id="selectVetCommentsById" parameterType="Long" resultMap="VetCommentsResult"> |
|||
<include refid="selectVetCommentsVo"/> |
|||
where id = #{id} |
|||
</select> |
|||
|
|||
<insert id="insertVetComments" parameterType="VetComments" useGeneratedKeys="true" keyProperty="id"> |
|||
insert into vet_comments |
|||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|||
<if test="consultationId != null">consultation_id,</if> |
|||
<if test="replyName != null">reply_name,</if> |
|||
<if test="content != null">content,</if> |
|||
<if test="images != null">images,</if> |
|||
<if test="isSensitive != null">is_sensitive,</if> |
|||
<if test="sensitiveWords != null">sensitive_words,</if> |
|||
<if test="createdAt != null">created_at,</if> |
|||
<if test="updatedAt != null">updated_at,</if> |
|||
<if test="userId != null">user_id,</if> |
|||
<if test="title != null">title,</if> |
|||
<if test="hospital != null">hospital,</if> |
|||
<if test="experience != null">experience,</if> |
|||
<if test="avatar != null and avatar != ''">avatar,</if> |
|||
</trim> |
|||
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|||
<if test="consultationId != null">#{consultationId},</if> |
|||
<if test="replyName != null">#{replyName},</if> |
|||
<if test="content != null">#{content},</if> |
|||
<if test="images != null">#{images},</if> |
|||
<if test="isSensitive != null">#{isSensitive},</if> |
|||
<if test="sensitiveWords != null">#{sensitiveWords},</if> |
|||
<if test="createdAt != null">#{createdAt},</if> |
|||
<if test="updatedAt != null">#{updatedAt},</if> |
|||
<if test="userId != null">#{userId},</if> |
|||
<if test="title != null">#{title},</if> |
|||
<if test="hospital != null">#{hospital},</if> |
|||
<if test="experience != null">#{experience},</if> |
|||
<if test="avatar != null and avatar != ''">#{avatar},</if> |
|||
</trim> |
|||
</insert> |
|||
|
|||
<update id="updateVetComments" parameterType="VetComments"> |
|||
update vet_comments |
|||
<trim prefix="SET" suffixOverrides=","> |
|||
<if test="consultationId != null">consultation_id = #{consultationId},</if> |
|||
<if test="replyName != null">reply_name = #{replyName},</if> |
|||
<if test="content != null">content = #{content},</if> |
|||
<if test="images != null">images = #{images},</if> |
|||
<if test="isSensitive != null">is_sensitive = #{isSensitive},</if> |
|||
<if test="sensitiveWords != null">sensitive_words = #{sensitiveWords},</if> |
|||
<if test="createdAt != null">created_at = #{createdAt},</if> |
|||
<if test="updatedAt != null">updated_at = #{updatedAt},</if> |
|||
<if test="userId != null">user_id = #{userId},</if> |
|||
<if test="title != null">title = #{title},</if> |
|||
<if test="hospital != null">hospital = #{hospital},</if> |
|||
<if test="experience != null">experience = #{experience},</if> |
|||
<if test="avatar != null and avatar != ''">avatar = #{avatar},</if> |
|||
</trim> |
|||
where id = #{id} |
|||
</update> |
|||
|
|||
<delete id="deleteVetCommentsById" parameterType="Long"> |
|||
delete from vet_comments where id = #{id} |
|||
</delete> |
|||
|
|||
<delete id="deleteVetCommentsByIds" parameterType="String"> |
|||
delete from vet_comments where id in |
|||
<foreach item="id" collection="array" open="(" separator="," close=")"> |
|||
#{id} |
|||
</foreach> |
|||
</delete> |
|||
|
|||
<!-- 新增:更新用户专业信息的SQL --> |
|||
<update id="updateUserProfessionalInfo"> |
|||
UPDATE sys_user |
|||
SET |
|||
title = #{title}, |
|||
hospital = #{hospital}, |
|||
experience = #{experience}, |
|||
update_time = NOW() |
|||
WHERE user_id = #{userId} |
|||
</update> |
|||
</mapper> |
|||
@ -0,0 +1,132 @@ |
|||
<?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.VetExpertsMapper"> |
|||
|
|||
<resultMap type="VetExperts" id="VetExpertsResult"> |
|||
<result property="expertId" column="expert_id" /> |
|||
<result property="userId" column="user_id" /> |
|||
<result property="avatar" column="avatar" /> |
|||
<result property="realName" column="real_name" /> |
|||
<result property="title" column="title" /> |
|||
<result property="iphone" column="iphone" /> |
|||
<result property="email" column="email" /> |
|||
<result property="address" column="address" /> |
|||
<result property="expertiseArea" column="expertise_area" /> |
|||
<result property="isOnline" column="is_online" /> |
|||
<result property="remark" column="remark" /> |
|||
<result property="sortOrder" column="sort_order" /> |
|||
<result property="status" column="status" /> |
|||
<result property="createdAt" column="created_at" /> |
|||
<result property="updatedAt" column="updated_at" /> |
|||
<result property="expert" column="expert" /> |
|||
<result property="workExperience" column="work_experience" /> |
|||
</resultMap> |
|||
|
|||
<sql id="selectVetExpertsVo"> |
|||
select expert_id, user_id, avatar, real_name, iphone, email, address, |
|||
expertise_area, is_online, remark, sort_order, status, created_at, updated_at, title, expert, work_experience |
|||
from vet_experts |
|||
</sql> |
|||
|
|||
<select id="selectVetExpertsList" parameterType="VetExperts" resultMap="VetExpertsResult"> |
|||
<include refid="selectVetExpertsVo"/> |
|||
<where> |
|||
<if test="userId != null "> and user_id = #{userId}</if> |
|||
<if test="realName != null and realName != ''"> and real_name like concat('%', #{realName}, '%')</if> |
|||
<if test="iphone != null and iphone != ''"> and iphone = #{iphone}</if> |
|||
<if test="email != null and email != ''"> and email = #{email}</if> |
|||
<if test="address != null and address != ''"> and address = #{address}</if> |
|||
<if test="expertiseArea != null and expertiseArea != ''"> and expertise_area = #{expertiseArea}</if> |
|||
<if test="isOnline != null "> and is_online = #{isOnline}</if> |
|||
<if test="remark != null and remark != ''"> and remark = #{remark}</if> |
|||
<if test="sortOrder != null "> and sort_order = #{sortOrder}</if> |
|||
<if test="status != null and status != ''"> and status = #{status}</if> |
|||
<if test="createdAt != null "> and created_at = #{createdAt}</if> |
|||
<if test="updatedAt != null "> and updated_at = #{updatedAt}</if> |
|||
<if test="title != null and title != ''"> and title = #{title}</if> |
|||
<if test="expert != null and expert != ''"> and expert = #{expert}</if> |
|||
<if test="workExperience != null and workExperience != ''"> and work_experience = #{workExperience})</if> |
|||
</where> |
|||
</select> |
|||
|
|||
<select id="selectVetExpertsByExpertId" parameterType="Long" resultMap="VetExpertsResult"> |
|||
<include refid="selectVetExpertsVo"/> |
|||
where expert_id = #{expertId} |
|||
</select> |
|||
|
|||
<insert id="insertVetExperts" parameterType="VetExperts" useGeneratedKeys="true" keyProperty="expertId"> |
|||
insert into vet_experts |
|||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|||
<if test="userId != null">user_id,</if> |
|||
<if test="avatar != null">avatar,</if> |
|||
<if test="realName != null">real_name,</if> |
|||
<if test="iphone != null">iphone,</if> |
|||
<if test="email != null">email,</if> |
|||
<if test="address != null">address,</if> |
|||
<if test="expertiseArea != null">expertise_area,</if> |
|||
<if test="isOnline != null">is_online,</if> |
|||
<if test="remark != null">remark,</if> |
|||
<if test="sortOrder != null">sort_order,</if> |
|||
<if test="status != null">status,</if> |
|||
<if test="createdAt != null">created_at,</if> |
|||
<if test="updatedAt != null">updated_at,</if> |
|||
<if test="title != null">title,</if> |
|||
<if test="expert != null">expert,</if> |
|||
<if test="workExperience != null">work_experience,</if> |
|||
</trim> |
|||
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|||
<if test="userId != null">#{userId},</if> |
|||
<if test="avatar != null">#{avatar},</if> |
|||
<if test="realName != null">#{realName},</if> |
|||
<if test="iphone != null">#{iphone},</if> |
|||
<if test="email != null">#{email},</if> |
|||
<if test="address != null">#{address},</if> |
|||
<if test="expertiseArea != null">#{expertiseArea},</if> |
|||
<if test="isOnline != null">#{isOnline},</if> |
|||
<if test="remark != null">#{remark},</if> |
|||
<if test="sortOrder != null">#{sortOrder},</if> |
|||
<if test="status != null">#{status},</if> |
|||
<if test="createdAt != null">#{createdAt},</if> |
|||
<if test="updatedAt != null">#{updatedAt},</if> |
|||
<if test="title != null">#{title},</if> |
|||
<if test="expert != null">#{expert},</if> |
|||
<if test="workExperience != null">#{workExperience},</if> |
|||
</trim> |
|||
</insert> |
|||
|
|||
<update id="updateVetExperts" parameterType="VetExperts"> |
|||
update vet_experts |
|||
<trim prefix="SET" suffixOverrides=","> |
|||
<if test="userId != null">user_id = #{userId},</if> |
|||
<if test="avatar != null">avatar = #{avatar},</if> |
|||
<if test="realName != null">real_name = #{realName},</if> |
|||
<if test="iphone != null">iphone = #{iphone},</if> |
|||
<if test="email != null">email = #{email},</if> |
|||
<if test="address != null">address = #{address},</if> |
|||
<if test="expertiseArea != null">expertise_area = #{expertiseArea},</if> |
|||
<if test="isOnline != null">is_online = #{isOnline},</if> |
|||
<if test="remark != null">remark = #{remark},</if> |
|||
<if test="sortOrder != null">sort_order = #{sortOrder},</if> |
|||
<if test="status != null">status = #{status},</if> |
|||
<if test="createdAt != null">created_at = #{createdAt},</if> |
|||
<if test="updatedAt != null">updated_at = #{updatedAt},</if> |
|||
<if test="title != null">title = #{title},</if> |
|||
<if test="expert != null">expert = #{expert},</if> |
|||
<if test="workExperience != null">work_experience = #{workExperience},</if> |
|||
</trim> |
|||
where expert_id = #{expertId} |
|||
</update> |
|||
|
|||
<delete id="deleteVetExpertsByExpertId" parameterType="Long"> |
|||
delete from vet_experts where expert_id = #{expertId} |
|||
</delete> |
|||
|
|||
<delete id="deleteVetExpertsByExpertIds" parameterType="String"> |
|||
delete from vet_experts where expert_id in |
|||
<foreach item="expertId" collection="array" open="(" separator="," close=")"> |
|||
#{expertId} |
|||
</foreach> |
|||
</delete> |
|||
</mapper> |
|||
@ -0,0 +1,44 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
// 查询问诊单列表
|
|||
export function listConsultation(query) { |
|||
return request({ |
|||
url: '/muhu/consultation/list', |
|||
method: 'get', |
|||
params: query |
|||
}) |
|||
} |
|||
|
|||
// 查询问诊单详细
|
|||
export function getConsultation(formId) { |
|||
return request({ |
|||
url: '/muhu/consultation/' + formId, |
|||
method: 'get' |
|||
}) |
|||
} |
|||
|
|||
// 新增问诊单
|
|||
export function addConsultation(data) { |
|||
return request({ |
|||
url: '/muhu/consultation', |
|||
method: 'post', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 修改问诊单
|
|||
export function updateConsultation(data) { |
|||
return request({ |
|||
url: '/muhu/consultation', |
|||
method: 'put', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 删除问诊单
|
|||
export function delConsultation(formId) { |
|||
return request({ |
|||
url: '/muhu/consultation/' + formId, |
|||
method: 'delete' |
|||
}) |
|||
} |
|||
@ -0,0 +1,44 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
// 查询专家咨询列表
|
|||
export function listConsultation(query) { |
|||
return request({ |
|||
url: '/system/consultation/list', |
|||
method: 'get', |
|||
params: query |
|||
}) |
|||
} |
|||
|
|||
// 查询专家咨询详细
|
|||
export function getConsultation(consultationId) { |
|||
return request({ |
|||
url: '/system/consultation/' + consultationId, |
|||
method: 'get' |
|||
}) |
|||
} |
|||
|
|||
// 新增专家咨询
|
|||
export function addConsultation(data) { |
|||
return request({ |
|||
url: '/system/consultation', |
|||
method: 'post', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 修改专家咨询
|
|||
export function updateConsultation(data) { |
|||
return request({ |
|||
url: '/system/consultation', |
|||
method: 'put', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 删除专家咨询
|
|||
export function delConsultation(consultationId) { |
|||
return request({ |
|||
url: '/system/consultation/' + consultationId, |
|||
method: 'delete' |
|||
}) |
|||
} |
|||
@ -0,0 +1,44 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
// 查询专家信息列表
|
|||
export function listExperts(query) { |
|||
return request({ |
|||
url: '/vet/experts/list', |
|||
method: 'get', |
|||
params: query |
|||
}) |
|||
} |
|||
|
|||
// 查询专家信息详细
|
|||
export function getExperts(expertId) { |
|||
return request({ |
|||
url: '/vet/experts/' + expertId, |
|||
method: 'get' |
|||
}) |
|||
} |
|||
|
|||
// 新增专家信息
|
|||
export function addExperts(data) { |
|||
return request({ |
|||
url: '/vet/experts', |
|||
method: 'post', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 修改专家信息
|
|||
export function updateExperts(data) { |
|||
return request({ |
|||
url: '/vet/experts', |
|||
method: 'put', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 删除专家信息
|
|||
export function delExperts(expertId) { |
|||
return request({ |
|||
url: '/vet/experts/' + expertId, |
|||
method: 'delete' |
|||
}) |
|||
} |
|||
@ -0,0 +1,367 @@ |
|||
<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="title"> |
|||
<el-input |
|||
v-model="queryParams.title" |
|||
placeholder="请输入问诊标题" |
|||
clearable |
|||
@keyup.enter.native="handleQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="是否含敏感词" prop="isSensitive"> |
|||
<el-input |
|||
v-model="queryParams.isSensitive" |
|||
placeholder="请输入是否含敏感词" |
|||
clearable |
|||
@keyup.enter.native="handleQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="查看次数" prop="viewCount"> |
|||
<el-input |
|||
v-model="queryParams.viewCount" |
|||
placeholder="请输入查看次数" |
|||
clearable |
|||
@keyup.enter.native="handleQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="回复数量" prop="replyCount"> |
|||
<el-input |
|||
v-model="queryParams.replyCount" |
|||
placeholder="请输入回复数量" |
|||
clearable |
|||
@keyup.enter.native="handleQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
|||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
|
|||
<el-row :gutter="10" class="mb8"> |
|||
<el-col :span="1.5"> |
|||
<el-button |
|||
type="primary" |
|||
plain |
|||
icon="el-icon-plus" |
|||
size="mini" |
|||
@click="handleAdd" |
|||
v-hasPermi="['muhu:consultation: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="['muhu:consultation: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="['muhu:consultation: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="['muhu:consultation:export']"--> |
|||
<!-- >导出</el-button>--> |
|||
<!-- </el-col>--> |
|||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
|||
</el-row> |
|||
|
|||
<el-table v-loading="loading" :data="consultationList" @selection-change="handleSelectionChange"> |
|||
<el-table-column type="selection" width="55" align="center" /> |
|||
<el-table-column label="头像" align="center" prop="avatar" width="100"> |
|||
<template slot-scope="scope"> |
|||
<image-preview :src="scope.row.avatar" :width="50" :height="50" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="发布者" align="center" prop="farmerName" /> |
|||
<el-table-column label="问诊标题" align="center" prop="title" /> |
|||
<el-table-column label="病情描述" align="center" prop="description" /> |
|||
<el-table-column label="牲畜种类" align="center" prop="animalType" /> |
|||
<el-table-column label="牲畜年龄" align="center" prop="animalAge" /> |
|||
<el-table-column label="牲畜性别" align="center" prop="animalGender" /> |
|||
<el-table-column label="症状照片" align="center" prop="images" width="100"> |
|||
<template slot-scope="scope"> |
|||
<image-preview :src="scope.row.images" :width="50" :height="50" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="回复状态" align="center" prop="status" /> |
|||
<el-table-column label="回复条数" align="center" prop="replyCount" /> |
|||
<el-table-column label="问诊时间" align="center" prop="createdTime" /> |
|||
<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-chat-dot-round" |
|||
@click="handleReply(scope.row)" |
|||
v-hasPermi="['vet:comments:list']" |
|||
>回复</el-button> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-edit" |
|||
@click="handleUpdate(scope.row)" |
|||
v-hasPermi="['muhu:consultation:edit']" |
|||
>修改</el-button> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-delete" |
|||
@click="handleDelete(scope.row)" |
|||
v-hasPermi="['muhu:consultation: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="title"> |
|||
<el-input v-model="form.title" placeholder="请输入问诊标题" /> |
|||
</el-form-item> |
|||
<el-form-item label="病情描述" prop="description"> |
|||
<el-input v-model="form.description" type="textarea" placeholder="请输入内容" /> |
|||
</el-form-item> |
|||
<el-form-item label="牲畜种类" prop="animalType"> |
|||
<el-input v-model="form.animalType" placeholder="请输入牲畜种类" /> |
|||
</el-form-item> |
|||
<el-form-item label="牲畜年龄" prop="animalAge"> |
|||
<el-input v-model="form.animalAge" placeholder="请输入牲畜年龄" /> |
|||
</el-form-item> |
|||
<el-form-item label="牲畜性别" prop="animalGender"> |
|||
<el-input v-model="form.animalGender" placeholder="请输入牲畜性别" /> |
|||
</el-form-item> |
|||
<el-form-item label="症状照片" prop="images"> |
|||
<image-upload v-model="form.images" /> |
|||
</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> |
|||
|
|||
<!-- 回复管理对话框 --> |
|||
<el-dialog |
|||
title="回复" |
|||
:visible.sync="replyOpen" |
|||
width="1000px" |
|||
append-to-body |
|||
:close-on-click-modal="false" |
|||
> |
|||
<comments-list |
|||
:consultation-id="currentConsultationId" |
|||
v-if="replyOpen" |
|||
/> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { listConsultation, getConsultation, delConsultation, addConsultation, updateConsultation } from "@/api/muhu/consultation" |
|||
import CommentsList from '@/views/vet/comments/index.vue'; |
|||
|
|||
export default { |
|||
name: "Consultation", |
|||
components: { |
|||
CommentsList |
|||
}, |
|||
data() { |
|||
return { |
|||
// 遮罩层 |
|||
loading: true, |
|||
// 选中数组 |
|||
ids: [], |
|||
// 非单个禁用 |
|||
single: true, |
|||
// 非多个禁用 |
|||
multiple: true, |
|||
// 显示搜索条件 |
|||
showSearch: true, |
|||
// 总条数 |
|||
total: 0, |
|||
// 问诊单表格数据 |
|||
consultationList: [], |
|||
// 当前问诊ID(用于回复) |
|||
currentConsultationId: null, |
|||
// 是否显示回复对话框 |
|||
replyOpen: false, |
|||
// 弹出层标题 |
|||
title: "", |
|||
// 是否显示弹出层 |
|||
open: false, |
|||
// 查询参数 |
|||
queryParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
farmerId: null, |
|||
title: null, |
|||
description: null, |
|||
animalType: null, |
|||
images: null, |
|||
status: null, |
|||
isSensitive: null, |
|||
sensitiveWords: null, |
|||
viewCount: null, |
|||
replyCount: null |
|||
}, |
|||
// 表单参数 |
|||
form: {}, |
|||
// 表单校验 |
|||
rules: { |
|||
farmerId: [ |
|||
{ required: true, message: "发布者ID不能为空", trigger: "blur" } |
|||
], |
|||
title: [ |
|||
{ required: true, message: "问诊标题不能为空", trigger: "blur" } |
|||
], |
|||
description: [ |
|||
{ required: true, message: "病情描述不能为空", trigger: "blur" } |
|||
], |
|||
} |
|||
} |
|||
}, |
|||
created() { |
|||
this.getList() |
|||
}, |
|||
methods: { |
|||
/** 查询问诊单列表 */ |
|||
getList() { |
|||
this.loading = true |
|||
listConsultation(this.queryParams).then(response => { |
|||
this.consultationList = response.rows |
|||
this.total = response.total |
|||
this.loading = false |
|||
}) |
|||
}, |
|||
// 取消按钮 |
|||
cancel() { |
|||
this.open = false |
|||
this.reset() |
|||
}, |
|||
// 表单重置 |
|||
reset() { |
|||
this.form = { |
|||
formId: null, |
|||
farmerId: null, |
|||
title: null, |
|||
description: null, |
|||
animalType: null, |
|||
images: null, |
|||
status: null, |
|||
isSensitive: null, |
|||
sensitiveWords: null, |
|||
viewCount: null, |
|||
replyCount: 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.formId) |
|||
this.single = selection.length!==1 |
|||
this.multiple = !selection.length |
|||
}, |
|||
/** 回复按钮操作 */ |
|||
handleReply(row) { |
|||
this.currentRow = row |
|||
this.currentConsultationId = row.formId |
|||
this.replyOpen = true |
|||
|
|||
// 调试信息 |
|||
console.log('点击回复,问诊单ID:', row.formId) |
|||
console.log('当前currentConsultationId:', this.currentConsultationId) |
|||
}, |
|||
/** 新增按钮操作 */ |
|||
handleAdd() { |
|||
this.reset() |
|||
this.open = true |
|||
this.title = "添加问诊单" |
|||
}, |
|||
/** 修改按钮操作 */ |
|||
handleUpdate(row) { |
|||
this.reset() |
|||
const formId = row.formId || this.ids |
|||
getConsultation(formId).then(response => { |
|||
this.form = response.data |
|||
this.open = true |
|||
this.title = "修改问诊单" |
|||
}) |
|||
}, |
|||
/** 提交按钮 */ |
|||
submitForm() { |
|||
this.$refs["form"].validate(valid => { |
|||
if (valid) { |
|||
if (this.form.formId != null) { |
|||
updateConsultation(this.form).then(response => { |
|||
this.$modal.msgSuccess("修改成功") |
|||
this.open = false |
|||
this.getList() |
|||
}) |
|||
} else { |
|||
addConsultation(this.form).then(response => { |
|||
this.$modal.msgSuccess("新增成功") |
|||
this.open = false |
|||
this.getList() |
|||
}) |
|||
} |
|||
} |
|||
}) |
|||
}, |
|||
/** 删除按钮操作 */ |
|||
handleDelete(row) { |
|||
const formIds = row.formId || this.ids |
|||
this.$modal.confirm('是否确认删除问诊单编号为"' + formIds + '"的数据项?').then(function() { |
|||
return delConsultation(formIds) |
|||
}).then(() => { |
|||
this.getList() |
|||
this.$modal.msgSuccess("删除成功") |
|||
}).catch(() => {}) |
|||
}, |
|||
/** 导出按钮操作 */ |
|||
handleExport() { |
|||
this.download('muhu/consultation/export', { |
|||
...this.queryParams |
|||
}, `consultation_${new Date().getTime()}.xlsx`) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
@ -0,0 +1,460 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
|||
<el-form-item label="用户ID" prop="userId"> |
|||
<el-input |
|||
v-model="queryParams.userId" |
|||
placeholder="请输入用户ID" |
|||
clearable |
|||
@keyup.enter.native="handleQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="专家ID" prop="expertId"> |
|||
<el-input |
|||
v-model="queryParams.expertId" |
|||
placeholder="请输入专家ID" |
|||
clearable |
|||
@keyup.enter.native="handleQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="关联问诊单ID" prop="formId"> |
|||
<el-input |
|||
v-model="queryParams.formId" |
|||
placeholder="请输入关联问诊单ID" |
|||
clearable |
|||
@keyup.enter.native="handleQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="咨询标题" prop="consultationTitle"> |
|||
<el-input |
|||
v-model="queryParams.consultationTitle" |
|||
placeholder="请输入咨询标题" |
|||
clearable |
|||
@keyup.enter.native="handleQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="用户评分(1-5分)" prop="rating"> |
|||
<el-input |
|||
v-model="queryParams.rating" |
|||
placeholder="请输入用户评分(1-5分)" |
|||
clearable |
|||
@keyup.enter.native="handleQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="用户评价内容" prop="evaluation"> |
|||
<el-input |
|||
v-model="queryParams.evaluation" |
|||
placeholder="请输入用户评价内容" |
|||
clearable |
|||
@keyup.enter.native="handleQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="评价时间" prop="evaluationTime"> |
|||
<el-date-picker clearable |
|||
v-model="queryParams.evaluationTime" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="请选择评价时间"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label="咨询开始时间" prop="startTime"> |
|||
<el-date-picker clearable |
|||
v-model="queryParams.startTime" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="请选择咨询开始时间"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label="咨询结束时间" prop="endTime"> |
|||
<el-date-picker clearable |
|||
v-model="queryParams.endTime" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="请选择咨询结束时间"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label="创建时间" prop="createdTime"> |
|||
<el-date-picker clearable |
|||
v-model="queryParams.createdTime" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="请选择创建时间"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label="更新时间" prop="updatedTime"> |
|||
<el-date-picker clearable |
|||
v-model="queryParams.updatedTime" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="请选择更新时间"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
|||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
|
|||
<el-row :gutter="10" class="mb8"> |
|||
<el-col :span="1.5"> |
|||
<el-button |
|||
type="primary" |
|||
plain |
|||
icon="el-icon-plus" |
|||
size="mini" |
|||
@click="handleAdd" |
|||
v-hasPermi="['system:consultation:add']" |
|||
>新增</el-button> |
|||
</el-col> |
|||
<el-col :span="1.5"> |
|||
<el-button |
|||
type="success" |
|||
plain |
|||
icon="el-icon-edit" |
|||
size="mini" |
|||
:disabled="single" |
|||
@click="handleUpdate" |
|||
v-hasPermi="['system:consultation:edit']" |
|||
>修改</el-button> |
|||
</el-col> |
|||
<el-col :span="1.5"> |
|||
<el-button |
|||
type="danger" |
|||
plain |
|||
icon="el-icon-delete" |
|||
size="mini" |
|||
:disabled="multiple" |
|||
@click="handleDelete" |
|||
v-hasPermi="['system:consultation: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:consultation:export']" |
|||
>导出</el-button> |
|||
</el-col> |
|||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
|||
</el-row> |
|||
|
|||
<el-table v-loading="loading" :data="consultationList" @selection-change="handleSelectionChange"> |
|||
<el-table-column type="selection" width="55" align="center" /> |
|||
<el-table-column label="咨询ID" align="center" prop="consultationId" /> |
|||
<el-table-column label="用户ID" align="center" prop="userId" /> |
|||
<el-table-column label="专家ID" align="center" prop="expertId" /> |
|||
<el-table-column label="关联问诊单ID" align="center" prop="formId" /> |
|||
<el-table-column label="咨询类型: 1-图文咨询, 2-电话咨询, 3-视频咨询" align="center" prop="consultationType" /> |
|||
<el-table-column label="咨询状态: 0-待接诊, 1-进行中, 2-已完成, 3-已取消" align="center" prop="consultationStatus" /> |
|||
<el-table-column label="咨询标题" align="center" prop="consultationTitle" /> |
|||
<el-table-column label="用户初始咨询内容" align="center" prop="initialContent" /> |
|||
<el-table-column label="用户初始附件(JSON数组)" align="center" prop="initialAttachments" /> |
|||
<el-table-column label="对话消息(JSON格式)" align="center" prop="messages" /> |
|||
<el-table-column label="用户评分(1-5分)" align="center" prop="rating" /> |
|||
<el-table-column label="用户评价内容" align="center" prop="evaluation" /> |
|||
<el-table-column label="评价标签(JSON数组)" align="center" prop="evaluationTags" /> |
|||
<el-table-column label="评价时间" align="center" prop="evaluationTime" width="180"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ parseTime(scope.row.evaluationTime, '{y}-{m}-{d}') }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="咨询开始时间" align="center" prop="startTime" width="180"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d}') }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="咨询结束时间" align="center" prop="endTime" width="180"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="创建时间" align="center" prop="createdTime" width="180"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ parseTime(scope.row.createdTime, '{y}-{m}-{d}') }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="更新时间" align="center" prop="updatedTime" width="180"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ parseTime(scope.row.updatedTime, '{y}-{m}-{d}') }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
|||
<template slot-scope="scope"> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-edit" |
|||
@click="handleUpdate(scope.row)" |
|||
v-hasPermi="['system:consultation:edit']" |
|||
>修改</el-button> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-delete" |
|||
@click="handleDelete(scope.row)" |
|||
v-hasPermi="['system:consultation: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="专家ID" prop="expertId"> |
|||
<el-input v-model="form.expertId" placeholder="请输入专家ID" /> |
|||
</el-form-item> |
|||
<el-form-item label="关联问诊单ID" prop="formId"> |
|||
<el-input v-model="form.formId" placeholder="请输入关联问诊单ID" /> |
|||
</el-form-item> |
|||
<el-form-item label="咨询标题" prop="consultationTitle"> |
|||
<el-input v-model="form.consultationTitle" placeholder="请输入咨询标题" /> |
|||
</el-form-item> |
|||
<el-form-item label="用户初始咨询内容"> |
|||
<editor v-model="form.initialContent" :min-height="192"/> |
|||
</el-form-item> |
|||
<el-form-item label="对话消息(JSON格式)" prop="messages"> |
|||
<el-input v-model="form.messages" type="textarea" placeholder="请输入内容" /> |
|||
</el-form-item> |
|||
<el-form-item label="用户评分(1-5分)" prop="rating"> |
|||
<el-input v-model="form.rating" placeholder="请输入用户评分(1-5分)" /> |
|||
</el-form-item> |
|||
<el-form-item label="用户评价内容" prop="evaluation"> |
|||
<el-input v-model="form.evaluation" placeholder="请输入用户评价内容" /> |
|||
</el-form-item> |
|||
<el-form-item label="评价时间" prop="evaluationTime"> |
|||
<el-date-picker clearable |
|||
v-model="form.evaluationTime" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="请选择评价时间"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label="咨询开始时间" prop="startTime"> |
|||
<el-date-picker clearable |
|||
v-model="form.startTime" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="请选择咨询开始时间"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label="咨询结束时间" prop="endTime"> |
|||
<el-date-picker clearable |
|||
v-model="form.endTime" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="请选择咨询结束时间"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label="创建时间" prop="createdTime"> |
|||
<el-date-picker clearable |
|||
v-model="form.createdTime" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="请选择创建时间"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label="更新时间" prop="updatedTime"> |
|||
<el-date-picker clearable |
|||
v-model="form.updatedTime" |
|||
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 { listConsultation, getConsultation, delConsultation, addConsultation, updateConsultation } from "@/api/system/consultation" |
|||
|
|||
export default { |
|||
name: "Consultation", |
|||
data() { |
|||
return { |
|||
// 遮罩层 |
|||
loading: true, |
|||
// 选中数组 |
|||
ids: [], |
|||
// 非单个禁用 |
|||
single: true, |
|||
// 非多个禁用 |
|||
multiple: true, |
|||
// 显示搜索条件 |
|||
showSearch: true, |
|||
// 总条数 |
|||
total: 0, |
|||
// 专家咨询表格数据 |
|||
consultationList: [], |
|||
// 弹出层标题 |
|||
title: "", |
|||
// 是否显示弹出层 |
|||
open: false, |
|||
// 查询参数 |
|||
queryParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
userId: null, |
|||
expertId: null, |
|||
formId: null, |
|||
consultationType: null, |
|||
consultationStatus: null, |
|||
consultationTitle: null, |
|||
initialContent: null, |
|||
initialAttachments: null, |
|||
messages: null, |
|||
rating: null, |
|||
evaluation: null, |
|||
evaluationTags: null, |
|||
evaluationTime: null, |
|||
startTime: null, |
|||
endTime: null, |
|||
createdTime: null, |
|||
updatedTime: null |
|||
}, |
|||
// 表单参数 |
|||
form: {}, |
|||
// 表单校验 |
|||
rules: { |
|||
userId: [ |
|||
{ required: true, message: "用户ID不能为空", trigger: "blur" } |
|||
], |
|||
expertId: [ |
|||
{ required: true, message: "专家ID不能为空", trigger: "blur" } |
|||
], |
|||
} |
|||
} |
|||
}, |
|||
created() { |
|||
this.getList() |
|||
}, |
|||
methods: { |
|||
/** 查询专家咨询列表 */ |
|||
getList() { |
|||
this.loading = true |
|||
listConsultation(this.queryParams).then(response => { |
|||
this.consultationList = response.rows |
|||
this.total = response.total |
|||
this.loading = false |
|||
}) |
|||
}, |
|||
// 取消按钮 |
|||
cancel() { |
|||
this.open = false |
|||
this.reset() |
|||
}, |
|||
// 表单重置 |
|||
reset() { |
|||
this.form = { |
|||
consultationId: null, |
|||
userId: null, |
|||
expertId: null, |
|||
formId: null, |
|||
consultationType: null, |
|||
consultationStatus: null, |
|||
consultationTitle: null, |
|||
initialContent: null, |
|||
initialAttachments: null, |
|||
messages: null, |
|||
rating: null, |
|||
evaluation: null, |
|||
evaluationTags: null, |
|||
evaluationTime: null, |
|||
startTime: null, |
|||
endTime: null, |
|||
createdTime: null, |
|||
updatedTime: 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.consultationId) |
|||
this.single = selection.length!==1 |
|||
this.multiple = !selection.length |
|||
}, |
|||
/** 新增按钮操作 */ |
|||
handleAdd() { |
|||
this.reset() |
|||
this.open = true |
|||
this.title = "添加专家咨询" |
|||
}, |
|||
/** 修改按钮操作 */ |
|||
handleUpdate(row) { |
|||
this.reset() |
|||
const consultationId = row.consultationId || this.ids |
|||
getConsultation(consultationId).then(response => { |
|||
this.form = response.data |
|||
this.open = true |
|||
this.title = "修改专家咨询" |
|||
}) |
|||
}, |
|||
/** 提交按钮 */ |
|||
submitForm() { |
|||
this.$refs["form"].validate(valid => { |
|||
if (valid) { |
|||
if (this.form.consultationId != null) { |
|||
updateConsultation(this.form).then(response => { |
|||
this.$modal.msgSuccess("修改成功") |
|||
this.open = false |
|||
this.getList() |
|||
}) |
|||
} else { |
|||
addConsultation(this.form).then(response => { |
|||
this.$modal.msgSuccess("新增成功") |
|||
this.open = false |
|||
this.getList() |
|||
}) |
|||
} |
|||
} |
|||
}) |
|||
}, |
|||
/** 删除按钮操作 */ |
|||
handleDelete(row) { |
|||
const consultationIds = row.consultationId || this.ids |
|||
this.$modal.confirm('是否确认删除专家咨询编号为"' + consultationIds + '"的数据项?').then(function() { |
|||
return delConsultation(consultationIds) |
|||
}).then(() => { |
|||
this.getList() |
|||
this.$modal.msgSuccess("删除成功") |
|||
}).catch(() => {}) |
|||
}, |
|||
/** 导出按钮操作 */ |
|||
handleExport() { |
|||
this.download('system/consultation/export', { |
|||
...this.queryParams |
|||
}, `consultation_${new Date().getTime()}.xlsx`) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
@ -0,0 +1,285 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<!-- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">--> |
|||
<!-- <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:comments: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:comments: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:comments: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:comments:export']"--> |
|||
<!-- >导出</el-button>--> |
|||
<!-- </el-col>--> |
|||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
|||
</el-row> |
|||
|
|||
<el-table v-loading="loading" :data="commentsList" @selection-change="handleSelectionChange"> |
|||
<el-table-column type="selection" width="55" align="center" /> |
|||
<el-table-column label="头像" align="center" prop="avatar" width="100"> |
|||
<template slot-scope="scope"> |
|||
<image-preview :src="scope.row.avatar" :width="50" :height="50" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="回复者" align="center" prop="replyName" /> |
|||
<el-table-column label="职称" align="center" prop="title" /> |
|||
<el-table-column label="从属医院" align="center" prop="hospital" /> |
|||
<el-table-column label="从业经验" align="center" prop="experience" /> |
|||
<el-table-column label="回复内容" align="center" prop="content" /> |
|||
<el-table-column label="回复图片" align="center" prop="images" width="100"> |
|||
<template slot-scope="scope"> |
|||
<image-preview :src="scope.row.images" :width="50" :height="50" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="回复时间" align="center" prop="updatedAt" 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" 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:comments:edit']" |
|||
>修改</el-button> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-delete" |
|||
@click="handleDelete(scope.row)" |
|||
v-hasPermi="['vet:comments: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="content"> |
|||
<el-input v-model="form.content" placeholder="请输入回复内容" /> |
|||
</el-form-item> |
|||
<el-form-item label="回复图片" prop="images"> |
|||
<image-upload v-model="form.images" /> |
|||
</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 { listComments, getComments, delComments, addComments, updateComments } from "@/api/vet/comments" |
|||
|
|||
export default { |
|||
name: "Comments", |
|||
props: { |
|||
// 接收问诊单ID |
|||
consultationId: { |
|||
type: Number, |
|||
required: true |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
// 遮罩层 |
|||
loading: true, |
|||
// 选中数组 |
|||
ids: [], |
|||
// 非单个禁用 |
|||
single: true, |
|||
// 非多个禁用 |
|||
multiple: true, |
|||
// 显示搜索条件 |
|||
showSearch: true, |
|||
// 总条数 |
|||
total: 0, |
|||
// 兽医回复表格数据 |
|||
commentsList: [], |
|||
// 弹出层标题 |
|||
title: "", |
|||
// 是否显示弹出层 |
|||
open: false, |
|||
// 查询参数 |
|||
queryParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
consultationId: null, |
|||
replyName: null, |
|||
content: null, |
|||
images: null, |
|||
isSensitive: null, |
|||
sensitiveWords: null, |
|||
createdAt: null, |
|||
updatedAt: null, |
|||
userId: null |
|||
}, |
|||
// 表单参数 |
|||
form: { |
|||
consultationId: null |
|||
}, |
|||
// 表单校验 |
|||
rules: { |
|||
} |
|||
} |
|||
}, |
|||
created() { |
|||
this.queryParams.consultationId = Number(this.consultationId) |
|||
this.getList() |
|||
}, |
|||
methods: { |
|||
/** 查询兽医回复列表 */ |
|||
getList() { |
|||
this.loading = true |
|||
listComments(this.queryParams).then(response => { |
|||
this.commentsList = response.rows |
|||
this.total = response.total |
|||
this.loading = false |
|||
}) |
|||
}, |
|||
// 取消按钮 |
|||
cancel() { |
|||
this.open = false |
|||
this.reset() |
|||
}, |
|||
// 表单重置 |
|||
reset() { |
|||
this.form = { |
|||
id: null, |
|||
consultationId: this.consultationId, |
|||
replyName: null, |
|||
content: null, |
|||
images: null, |
|||
isSensitive: null, |
|||
sensitiveWords: null, |
|||
createdAt: null, |
|||
updatedAt: null, |
|||
userId: 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 = "添加兽医回复" |
|||
this.form.consultationId = this.consultationId; |
|||
}, |
|||
/** 修改按钮操作 */ |
|||
handleUpdate(row) { |
|||
this.reset() |
|||
const id = row.id || this.ids |
|||
getComments(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) { |
|||
updateComments(this.form).then(response => { |
|||
this.$modal.msgSuccess("修改成功") |
|||
this.open = false |
|||
this.getList() |
|||
}) |
|||
} else { |
|||
addComments(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 delComments(ids) |
|||
}).then(() => { |
|||
this.getList() |
|||
this.$modal.msgSuccess("删除成功") |
|||
}).catch(() => {}) |
|||
}, |
|||
/** 导出按钮操作 */ |
|||
handleExport() { |
|||
this.download('vet/comments/export', { |
|||
...this.queryParams |
|||
}, `comments_${new Date().getTime()}.xlsx`) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
@ -0,0 +1,317 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
|||
</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:experts: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:experts: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:experts: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:experts:export']" |
|||
>导出</el-button> |
|||
</el-col> |
|||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
|||
</el-row> |
|||
|
|||
<el-table v-loading="loading" :data="expertsList" @selection-change="handleSelectionChange"> |
|||
<el-table-column type="selection" width="55" align="center" /> |
|||
<el-table-column label="真实姓名" align="center" prop="realName" /> |
|||
<el-table-column label="联系电话" align="center" prop="iphone" /> |
|||
<el-table-column label="电子邮箱" align="center" prop="email" /> |
|||
<el-table-column label="职称" align="center" prop="title" /> |
|||
<el-table-column label="从业经验" align="center" prop="workExperience" /> |
|||
<el-table-column label="专家类型" align="center" prop="expert" /> |
|||
<el-table-column label="擅长领域" align="center" prop="expertiseArea" /> |
|||
<el-table-column label="工作单位" align="center" prop="address" /> |
|||
<el-table-column label="在线状态" align="center" prop="isOnline" /> |
|||
<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-chat-dot-round" |
|||
@click="handleConsultation(scope.row)" |
|||
v-hasPermi="['system:consultation:view']" |
|||
>咨询</el-button> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-edit" |
|||
@click="handleUpdate(scope.row)" |
|||
v-hasPermi="['vet:experts:edit']" |
|||
>修改</el-button> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-delete" |
|||
@click="handleDelete(scope.row)" |
|||
v-hasPermi="['vet:experts: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="realName"> |
|||
<el-input v-model="form.realName" placeholder="请输入真实姓名" /> |
|||
</el-form-item> |
|||
<el-form-item label="擅长领域" prop="expertiseArea"> |
|||
<el-input v-model="form.expertiseArea" placeholder="请输入擅长领域" /> |
|||
</el-form-item> |
|||
<el-form-item label="联系方式" prop="contactInfo"> |
|||
<el-input v-model="form.contactInfo" type="textarea" placeholder="请输入内容" /> |
|||
</el-form-item> |
|||
<el-form-item label="在线状态" prop="isOnline"> |
|||
<el-select v-model="form.isOnline" placeholder="请选择在线状态" clearable> |
|||
<el-option v-for="dict in dict.type.is_online" :key="dict.value" :label="dict.label" :value="dict.value" /> |
|||
</el-select> |
|||
</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> |
|||
<!-- 专家咨询对话框 --> |
|||
<el-dialog |
|||
:title="`专家咨询 - ${selectedExpertName}`" |
|||
:visible.sync="consultationDialogVisible" |
|||
width="90%" |
|||
top="5vh" |
|||
append-to-body> |
|||
<consultation-component |
|||
:expert-id="selectedExpertId" |
|||
:expert-name="selectedExpertName" |
|||
v-if="consultationDialogVisible" |
|||
/> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button @click="consultationDialogVisible = false">关 闭</el-button> |
|||
</div> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { listExperts, getExperts, delExperts, addExperts, updateExperts } from "@/api/vet/experts" |
|||
import ConsultationComponent from '@/views/system/consultation/index.vue' |
|||
|
|||
export default { |
|||
name: "Experts", |
|||
dicts: ['is_online'], |
|||
components: { |
|||
ConsultationComponent |
|||
}, |
|||
data() { |
|||
return { |
|||
// 遮罩层 |
|||
loading: true, |
|||
// 选中数组 |
|||
ids: [], |
|||
// 非单个禁用 |
|||
single: true, |
|||
// 非多个禁用 |
|||
multiple: true, |
|||
// 显示搜索条件 |
|||
showSearch: true, |
|||
// 总条数 |
|||
total: 0, |
|||
// 专家信息表格数据 |
|||
expertsList: [], |
|||
// 弹出层标题 |
|||
title: "", |
|||
// 是否显示弹出层 |
|||
open: false, |
|||
// 咨询对话框可见性 |
|||
consultationDialogVisible: false, |
|||
// 选中的专家ID |
|||
selectedExpertId: null, |
|||
// 选中的专家姓名 |
|||
selectedExpertName: '', |
|||
// 查询参数 |
|||
queryParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
userId: null, |
|||
realName: null, |
|||
expertiseArea: null, |
|||
contactInfo: null, |
|||
isOnline: null, |
|||
sortOrder: null, |
|||
status: null, |
|||
createdAt: null, |
|||
updatedAt: null |
|||
}, |
|||
// 表单参数 |
|||
form: {}, |
|||
// 表单校验 |
|||
rules: { |
|||
userId: [ |
|||
{ required: true, message: "关联用户ID不能为空", trigger: "blur" } |
|||
], |
|||
} |
|||
} |
|||
}, |
|||
created() { |
|||
this.getList() |
|||
}, |
|||
methods: { |
|||
/** 查询专家信息列表 */ |
|||
getList() { |
|||
this.loading = true |
|||
listExperts(this.queryParams).then(response => { |
|||
this.expertsList = response.rows.map(item => { |
|||
// 使用字典转换在线状态 |
|||
const onlineStatus = this.dict.type.is_online.find(dict => dict.value === item.isOnline) |
|||
return { |
|||
...item, |
|||
isOnlineText: onlineStatus ? onlineStatus.label : item.isOnline |
|||
} |
|||
}) |
|||
this.total = response.total |
|||
this.loading = false |
|||
}) |
|||
}, |
|||
// 取消按钮 |
|||
cancel() { |
|||
this.open = false |
|||
this.reset() |
|||
}, |
|||
// 表单重置 |
|||
reset() { |
|||
this.form = { |
|||
expertId: null, |
|||
userId: null, |
|||
realName: null, |
|||
expertiseArea: null, |
|||
contactInfo: null, |
|||
isOnline: null, |
|||
sortOrder: null, |
|||
status: 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.expertId) |
|||
this.single = selection.length!==1 |
|||
this.multiple = !selection.length |
|||
}, |
|||
/** 新增按钮操作 */ |
|||
handleAdd() { |
|||
this.reset() |
|||
this.open = true |
|||
this.title = "添加专家信息" |
|||
}, |
|||
/** 修改按钮操作 */ |
|||
handleUpdate(row) { |
|||
this.reset() |
|||
const expertId = row.expertId || this.ids |
|||
getExperts(expertId).then(response => { |
|||
this.form = response.data |
|||
this.open = true |
|||
this.title = "修改专家信息" |
|||
}) |
|||
}, |
|||
/** 咨询按钮操作 */ |
|||
handleConsultation(row) { |
|||
this.selectedExpertId = row.expertId |
|||
this.selectedExpertName = row.realName |
|||
this.consultationDialogVisible = true |
|||
}, |
|||
/** 提交按钮 */ |
|||
submitForm() { |
|||
this.$refs["form"].validate(valid => { |
|||
if (valid) { |
|||
if (this.form.expertId != null) { |
|||
updateExperts(this.form).then(response => { |
|||
this.$modal.msgSuccess("修改成功") |
|||
this.open = false |
|||
this.getList() |
|||
}) |
|||
} else { |
|||
addExperts(this.form).then(response => { |
|||
this.$modal.msgSuccess("新增成功") |
|||
this.open = false |
|||
this.getList() |
|||
}) |
|||
} |
|||
} |
|||
}) |
|||
}, |
|||
/** 删除按钮操作 */ |
|||
handleDelete(row) { |
|||
const expertIds = row.expertId || this.ids |
|||
this.$modal.confirm('是否确认删除专家信息编号为"' + expertIds + '"的数据项?').then(function() { |
|||
return delExperts(expertIds) |
|||
}).then(() => { |
|||
this.getList() |
|||
this.$modal.msgSuccess("删除成功") |
|||
}).catch(() => {}) |
|||
}, |
|||
/** 导出按钮操作 */ |
|||
handleExport() { |
|||
this.download('vet/experts/export', { |
|||
...this.queryParams |
|||
}, `experts_${new Date().getTime()}.xlsx`) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue