From 197eb5829ab1637e1e352dec4350551e1ad5443d Mon Sep 17 00:00:00 2001 From: Wtd <1658714322@qq.com> Date: Sun, 22 Oct 2023 15:25:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=A1=A8=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=92=8C=E6=9B=B4=E6=94=B9=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../patient/circle/domain/Disease.java | 55 ++++++++------ .../patient/circle/domain/PatientCircle.java | 71 +++++++++++++++---- .../patient/circle/domain/Review.java | 53 +++++++++++--- .../february/patient/circle/domain/User.java | 18 +++-- .../circle/controller/PatientController.java | 21 +++++- .../patient/circle/mapper/PatientMapper.java | 4 +- .../circle/service/PatientService.java | 5 +- .../service/impl/PatientServiceImpl.java | 22 ++++-- .../src/main/resources/bootstrap.yml | 10 +-- .../resources/mapper/circle/PatientMapper.xml | 70 +++++++++--------- 10 files changed, 231 insertions(+), 98 deletions(-) diff --git a/february-patient/february-patient-circle/february-patient-circle-common/src/main/java/com/february/patient/circle/domain/Disease.java b/february-patient/february-patient-circle/february-patient-circle-common/src/main/java/com/february/patient/circle/domain/Disease.java index 96a482e..79ca657 100644 --- a/february-patient/february-patient-circle/february-patient-circle-common/src/main/java/com/february/patient/circle/domain/Disease.java +++ b/february-patient/february-patient-circle/february-patient-circle-common/src/main/java/com/february/patient/circle/domain/Disease.java @@ -1,5 +1,6 @@ package com.february.patient.circle.domain; +import io.swagger.models.auth.In; import lombok.Data; /** * @program: patient @@ -9,32 +10,44 @@ import lombok.Data; **/ @Data public class Disease { - /** - * 病症详情id - */ - private Integer diseaseDetailId; +// /** +// * 病症详情id +// */ +// private Integer diseaseDetailId; +// /** +// * 病症id +// */ +// private Integer diseaseId; +// /** +// * 病理 +// */ +// private String diseaseDetailPathology; +// /** +// * 病状 +// */ +// private String diseaseDetailSymptom; +// /** +// * 宜与忌 +// */ +// private String diseaseDetailAnnouncements; +// /** +// * 西药治疗 +// */ +// private String diseaseDetailUsage; +// /** +// * 所属科目 +// */ +// private String diseaseName; /** * 病症id */ private Integer diseaseId; /** - * 病理 - */ - private String diseaseDetailPathology; - /** - * 病状 - */ - private String diseaseDetailSymptom; - /** - * 宜与忌 - */ - private String diseaseDetailAnnouncements; - /** - * 西药治疗 - */ - private String diseaseDetailUsage; - /** - * 所属科目 + * 科室及病症名称 */ private String diseaseName; + /** + * 父级id + */ + private Integer diseaseParentId; } diff --git a/february-patient/february-patient-circle/february-patient-circle-common/src/main/java/com/february/patient/circle/domain/PatientCircle.java b/february-patient/february-patient-circle/february-patient-circle-common/src/main/java/com/february/patient/circle/domain/PatientCircle.java index c19e38f..f10b284 100644 --- a/february-patient/february-patient-circle/february-patient-circle-common/src/main/java/com/february/patient/circle/domain/PatientCircle.java +++ b/february-patient/february-patient-circle/february-patient-circle-common/src/main/java/com/february/patient/circle/domain/PatientCircle.java @@ -1,5 +1,6 @@ package com.february.patient.circle.domain; +import io.swagger.models.auth.In; import lombok.Data; import java.util.Date; @@ -12,24 +13,68 @@ import java.util.Date; **/ @Data public class PatientCircle { +// /** +// * 病友圈id +// */ +// private Integer patientCircleId; +// /** +// * 病友圈标题 +// */ +// private String patientCircleTitle; +// /** +// * 发布时间 +// */ +// private Date patientCircleTime; +// /** +// * 病友圈详情 +// */ +// private String patientCircleDetails; +// /** +// * 用户id +// */ +// private Integer userId; +// /** +// * 所属科室id +// */ +// private Integer diseaseId; +// /** +// * 所属科室名称 +// */ +// private String diseaseName; /** * 病友圈id */ private Integer patientCircleId; /** - * 病友圈标题 - */ - private String patientCircleTitle; - /** - * 发布时间 - */ - private Date patientCircleTime; - /** - * 病友圈详情 - */ - private String patientCircleDetails; - /** - * 用户id + * 用户ID */ private Integer userId; + /** + * 病症id + */ + private Integer diseaseId; + /** + * 病症详情 + */ + private String diseaseDetail; + /** + * 治疗经历id + */ + private Integer diseaseProcessId; + /** + * 相关图片 + */ + private String pic; + /** + * 收藏数 + */ + private Integer collectNum; + /** + * 评论数 + */ + private Integer reviewNum; + /** + * 被采纳id + */ + private Integer adoptedId; } diff --git a/february-patient/february-patient-circle/february-patient-circle-common/src/main/java/com/february/patient/circle/domain/Review.java b/february-patient/february-patient-circle/february-patient-circle-common/src/main/java/com/february/patient/circle/domain/Review.java index 560f1b7..f8226e9 100644 --- a/february-patient/february-patient-circle/february-patient-circle-common/src/main/java/com/february/patient/circle/domain/Review.java +++ b/february-patient/february-patient-circle/february-patient-circle-common/src/main/java/com/february/patient/circle/domain/Review.java @@ -1,5 +1,6 @@ package com.february.patient.circle.domain; +import io.swagger.models.auth.In; import lombok.Data; import java.util.Date; @@ -12,14 +13,50 @@ import java.util.Date; **/ @Data public class Review { +// /** +// * 评论id +// */ +// private Integer reviewId; +// /** +// * 评论者 +// */ +// private String reviewName; +// /** +// * 评论内容 +// */ +// private String reviewDetail; +// /** +// * 评论时间 +// */ +// private Date reviewTime; +// /** +// * 点赞数 +// */ +// private Integer upvoteNum; +// /** +// * 嘲讽数 +// */ +// private Integer negativeNum; +// /** +// * 头像 +// */ +// private String avatar; +// /** +// * 是否采纳 +// */ +// private Integer isAdopt; /** * 评论id */ private Integer reviewId; /** - * 评论者 + * 头像 */ - private String reviewName; + private String avatar; + /** + * 用户ID + */ + private Integer userId; /** * 评论内容 */ @@ -31,17 +68,13 @@ public class Review { /** * 点赞数 */ - private Integer upvoteNum; + private Integer approveNum; /** - * 嘲讽数 + * 不认同数 */ - private Integer negativeNum; - /** - * 头像 - */ - private String avatar; + private Integer disapproveNum; /** * 是否采纳 */ - private Integer isAdopt; + private Integer isAdopted; } diff --git a/february-patient/february-patient-circle/february-patient-circle-common/src/main/java/com/february/patient/circle/domain/User.java b/february-patient/february-patient-circle/february-patient-circle-common/src/main/java/com/february/patient/circle/domain/User.java index a180829..5de5787 100644 --- a/february-patient/february-patient-circle/february-patient-circle-common/src/main/java/com/february/patient/circle/domain/User.java +++ b/february-patient/february-patient-circle/february-patient-circle-common/src/main/java/com/february/patient/circle/domain/User.java @@ -1,5 +1,6 @@ package com.february.patient.circle.domain; +import io.swagger.models.auth.In; import lombok.Data; import java.math.BigDecimal; @@ -20,13 +21,16 @@ public class User { * 用户名 */ private String userName; +// /** +// * 用户邮箱 +// */ +// private String userEmail; +// /** +// * 用户邮箱账号 +// */ +// private String userEmailNumber; /** - * 用户邮箱 + * 角色id */ - private String userEmail; - /** - * 用户邮箱账号 - */ - private String userEmailNumber; - + private Integer roleId; } diff --git a/february-patient/february-patient-circle/february-patient-circle-server/src/main/java/com/february/patient/circle/controller/PatientController.java b/february-patient/february-patient-circle/february-patient-circle-server/src/main/java/com/february/patient/circle/controller/PatientController.java index 25e5f85..a91a899 100644 --- a/february-patient/february-patient-circle/february-patient-circle-server/src/main/java/com/february/patient/circle/controller/PatientController.java +++ b/february-patient/february-patient-circle/february-patient-circle-server/src/main/java/com/february/patient/circle/controller/PatientController.java @@ -7,6 +7,7 @@ import com.february.patient.circle.domain.request.PatientRequest; import com.february.patient.circle.domain.request.ReviewPatientRequest; import com.february.patient.circle.result.Result; import com.february.patient.circle.service.PatientService; +import io.swagger.models.auth.In; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @@ -29,8 +30,8 @@ public class PatientController { * @return */ @PostMapping("/patientCircleList") - public Result> patientCircleList(Integer userId){ - return patientService.patientCircleList(userId); + public Result> patientCircleList(Integer diseaseId){ + return patientService.patientCircleList(diseaseId); } /** * 个人信息展示 @@ -130,8 +131,24 @@ public class PatientController { public Result patientToSick(@RequestBody ReviewPatientRequest reviewPatientRequest){ return patientService.patientToSick(reviewPatientRequest); } + + /** + * 上传照片文件 + * @param file + * @return + */ @PostMapping("/uploadMsg") public Result uploadMsg(@RequestParam("file")MultipartFile file){ return patientService.uploadMsg(file); } + + /** + * 科室名称查询 + * @param diseaseId + * @return + */ + @PostMapping("/findDiseaseName") + public String findDiseaseName(@RequestParam Integer diseaseId){ + return patientService.findDiseaseName(diseaseId); + } } diff --git a/february-patient/february-patient-circle/february-patient-circle-server/src/main/java/com/february/patient/circle/mapper/PatientMapper.java b/february-patient/february-patient-circle/february-patient-circle-server/src/main/java/com/february/patient/circle/mapper/PatientMapper.java index 85491d8..a4cd189 100644 --- a/february-patient/february-patient-circle/february-patient-circle-server/src/main/java/com/february/patient/circle/mapper/PatientMapper.java +++ b/february-patient/february-patient-circle/february-patient-circle-server/src/main/java/com/february/patient/circle/mapper/PatientMapper.java @@ -18,7 +18,7 @@ import java.util.List; **/ @Mapper public interface PatientMapper { - List patientCircleList(@Param("userId") Integer userId); + List patientCircleList(@Param("diseaseId") Integer diseaseId); @@ -41,4 +41,6 @@ public interface PatientMapper { List patientList(@Param("patientNickname") String patientNickname); Integer patientToSick(ReviewPatientRequest reviewPatientRequest); + + String findDiseaseName(@Param("diseaseId") Integer diseaseId); } diff --git a/february-patient/february-patient-circle/february-patient-circle-server/src/main/java/com/february/patient/circle/service/PatientService.java b/february-patient/february-patient-circle/february-patient-circle-server/src/main/java/com/february/patient/circle/service/PatientService.java index d031201..794ac40 100644 --- a/february-patient/february-patient-circle/february-patient-circle-server/src/main/java/com/february/patient/circle/service/PatientService.java +++ b/february-patient/february-patient-circle/february-patient-circle-server/src/main/java/com/february/patient/circle/service/PatientService.java @@ -6,6 +6,7 @@ import com.february.patient.circle.domain.request.PatientCircleRequest; import com.february.patient.circle.domain.request.PatientRequest; import com.february.patient.circle.domain.request.ReviewPatientRequest; import com.february.patient.circle.result.Result; +import io.swagger.models.auth.In; import org.springframework.stereotype.Component; import org.springframework.web.multipart.MultipartFile; @@ -19,7 +20,7 @@ import java.util.List; **/ @Component public interface PatientService { - Result> patientCircleList(Integer userId); + Result> patientCircleList(Integer diseaseId); Result> patientList(String patientNickname); @@ -44,4 +45,6 @@ public interface PatientService { Result patientToSick(ReviewPatientRequest reviewPatientRequest); Result uploadMsg(MultipartFile file); + + String findDiseaseName(Integer diseaseId); } diff --git a/february-patient/february-patient-circle/february-patient-circle-server/src/main/java/com/february/patient/circle/service/impl/PatientServiceImpl.java b/february-patient/february-patient-circle/february-patient-circle-server/src/main/java/com/february/patient/circle/service/impl/PatientServiceImpl.java index 428f004..e1de79a 100644 --- a/february-patient/february-patient-circle/february-patient-circle-server/src/main/java/com/february/patient/circle/service/impl/PatientServiceImpl.java +++ b/february-patient/february-patient-circle/february-patient-circle-server/src/main/java/com/february/patient/circle/service/impl/PatientServiceImpl.java @@ -1,6 +1,6 @@ package com.february.patient.circle.service.impl; - +import org.apache.poi.util.IOUtils; import com.february.patient.circle.constants.JwtConstants; import com.february.patient.circle.domain.*; import com.february.patient.circle.domain.request.PatientCircleRequest; @@ -12,6 +12,7 @@ import com.february.patient.circle.service.PatientService; import com.february.patient.circle.util.FastUtil; import com.february.patient.circle.util.OssUtil; import io.swagger.models.auth.In; +import lombok.Cleanup; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.web.multipart.MultipartFile; @@ -33,8 +34,12 @@ public class PatientServiceImpl implements PatientService { @Autowired private OssUtil ossUtil; @Override - public Result> patientCircleList(Integer userId) { - List list=patientMapper.patientCircleList(userId); + public Result> patientCircleList(Integer diseaseId) { + String diseaseName = findDiseaseName(diseaseId); + List list=patientMapper.patientCircleList(diseaseId); + list.forEach(l->{ + l.setDiseaseName(diseaseName); + }); return Result.success(list); } @@ -88,9 +93,10 @@ public class PatientServiceImpl implements PatientService { @Override public Result upload(MultipartFile file) { + String upload=""; try { - String upload = fastUtil.upload(file); - return Result.success("http://10.100.1.2:8888/"+upload,"上传成功"); + upload = fastUtil.upload(file); + return Result.success("http://47.120.41.50:8888/"+upload,"上传成功"); }catch (Exception e){ e.printStackTrace(); } @@ -122,4 +128,10 @@ public class PatientServiceImpl implements PatientService { } return Result.success("上传失败"); } + + @Override + public String findDiseaseName(Integer diseaseId) { + + return patientMapper.findDiseaseName(diseaseId); + } } diff --git a/february-patient/february-patient-circle/february-patient-circle-server/src/main/resources/bootstrap.yml b/february-patient/february-patient-circle/february-patient-circle-server/src/main/resources/bootstrap.yml index 8a1f4e0..0f21902 100644 --- a/february-patient/february-patient-circle/february-patient-circle-server/src/main/resources/bootstrap.yml +++ b/february-patient/february-patient-circle/february-patient-circle-server/src/main/resources/bootstrap.yml @@ -16,23 +16,23 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 10.100.1.2:8848 + server-addr: 47.120.41.50:8848 config: # 配置中心地址 - server-addr: 10.100.1.2:8848 + server-addr: 47.120.41.50:8848 # 配置文件格式 file-extension: yml # 共享配置 shared-configs: - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} rabbitmq: - host: 10.100.1.3 + host: 47.113.230.149 fdfs: so-timeout: 1500 # socket 连接时长 connect-timeout: 600 # 连接 tracker 服务器超时时长 # 这两个是你服务器的 IP 地址,注意 23000 端口也要打开,阿里云服务器记得配置安全组。tracker 要和 stroage 服务进行交流 - tracker-list: 10.100.1.2:22122 - web-server-url: 10.100.1.2:8888 + tracker-list: 47.120.41.50:22122 + web-server-url: 47.120.41.50:8888 pool: jmx-enabled: false # 生成缩略图 diff --git a/february-patient/february-patient-circle/february-patient-circle-server/src/main/resources/mapper/circle/PatientMapper.xml b/february-patient/february-patient-circle/february-patient-circle-server/src/main/resources/mapper/circle/PatientMapper.xml index cfdbe0c..b8b9412 100644 --- a/february-patient/february-patient-circle/february-patient-circle-server/src/main/resources/mapper/circle/PatientMapper.xml +++ b/february-patient/february-patient-circle/february-patient-circle-server/src/main/resources/mapper/circle/PatientMapper.xml @@ -1,37 +1,41 @@ - - INSERT INTO `patient`.`t_patient_circle_log` (`patient_circle_title`, `disease_id`, `drug_id`, `patient_circle_detail`, `hospital`, `patient_circle_start_time`, `patient_circle_end_time`, `patient_circle_process`, `patient_circle_picture`) VALUES ( #{patientCircleTitle}, #{diseaseId}, #{drugId}, #{patientCircleDetail}, #{hospital}, #{patientCircleStartTime}, #{patientCircleEndTime}, #{patientCircleProcess}, #{patientCirclePicture}) - - - INSERT INTO `ry-cloud`.`t_review` (`review_id`, `review_detail`) VALUES (#{reviewId},#{reviewDetail}) - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +