病友圈最新
parent
037643567e
commit
cd84674a50
|
@ -63,6 +63,11 @@ public class SecurityUtils
|
|||
{
|
||||
// 从header获取token标识
|
||||
String token = request.getHeader(TokenConstants.AUTHENTICATION);
|
||||
if (StringUtils.isEmpty(token))
|
||||
{
|
||||
// 从参数获取token
|
||||
token = request.getHeader(TokenConstants.SESSIONID);
|
||||
}
|
||||
return replaceTokenPrefix(token);
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ import java.util.Map;
|
|||
* @Author 栗永斌
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/verify/v1")
|
||||
@RequestMapping("/user/verify/v1")
|
||||
public class CollectSickController {
|
||||
@Autowired
|
||||
CollectSickService service;
|
||||
|
@ -60,8 +60,9 @@ public class CollectSickController {
|
|||
*/
|
||||
@PostMapping("/file")
|
||||
public void file(MultipartFile file) {
|
||||
// TODO 存储OSS
|
||||
|
||||
String s = OssUtil.uploadMultipartFile(file);
|
||||
|
||||
String host = "https://cardnumber.market.alicloudapi.com";
|
||||
String path = "/rest/160601/ocr/ocr_idcard.json";
|
||||
String appcode = "94e0f9d0960f4931ad24eabfa187dcfe";
|
||||
|
@ -143,4 +144,5 @@ public class CollectSickController {
|
|||
}
|
||||
return imgBase64;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ package doctor.controller;
|
|||
import doctor.common.core.domain.HealthR;
|
||||
import doctor.common.core.domain.R;
|
||||
import doctor.domain.entity.*;
|
||||
import doctor.service.DiseaseCategoryService;
|
||||
import doctor.service.DiseaseKnowledgeService;
|
||||
import doctor.service.HealthJobTitleService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -33,6 +34,14 @@ public class DiseaseKnowledgeController {
|
|||
List<Department> departments= diseaseKnowledgeService.findDepartment();
|
||||
return HealthR.ok(departments);
|
||||
}
|
||||
@Autowired
|
||||
private DiseaseCategoryService diseaseCategoryService;
|
||||
|
||||
@GetMapping("/findDiseaseCategory")
|
||||
public HealthR<List<DiseaseCategory>> findDiseaseCategory(@RequestParam Integer departmentId){
|
||||
List<DiseaseCategory> list=diseaseCategoryService.findDiseaseCategory(departmentId);
|
||||
return HealthR.ok(list);
|
||||
}
|
||||
|
||||
//罕见病症详情
|
||||
@GetMapping("/findDiseaseKnowledge")
|
||||
|
@ -53,11 +62,13 @@ public class DiseaseKnowledgeController {
|
|||
List<DrugsCategory> list=diseaseKnowledgeService.findDrugsKnowledgeList(drugsCategoryId);
|
||||
return HealthR.ok(list);
|
||||
}
|
||||
|
||||
@GetMapping("/findDrugsKnowledge")
|
||||
public HealthR <DrugsKnowledge> findDrugsKnowledge(@RequestParam Integer id){
|
||||
DrugsKnowledge list=diseaseKnowledgeService.findDrugsKnowledge(id);
|
||||
return HealthR.ok(list);
|
||||
}
|
||||
|
||||
@GetMapping("/popularSearch")
|
||||
public HealthR<List<PopularSearchEntity>> popularSeach(){
|
||||
List<PopularSearchEntity> list=diseaseKnowledgeService.popularSeach();
|
||||
|
@ -68,8 +79,4 @@ public class DiseaseKnowledgeController {
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,62 @@
|
|||
package doctor.controller;
|
||||
|
||||
import doctor.common.core.domain.HealthR;
|
||||
import doctor.domain.entity.*;
|
||||
import doctor.service.DepartmentService;
|
||||
import doctor.service.DiseaseCategoryService;
|
||||
import doctor.service.DiseaseKnowledgeService;
|
||||
import doctor.service.HealthDepartmentService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static com.github.pagehelper.page.PageMethod.startPage;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/knowledgeBase/v1")
|
||||
public class HealthDepartmentController {
|
||||
|
||||
@Autowired
|
||||
private HealthDepartmentService healthV1Service;
|
||||
@Autowired
|
||||
private DiseaseCategoryService diseaseCategoryService;
|
||||
|
||||
@Autowired
|
||||
private DiseaseKnowledgeService diseaseKnowledgeService;
|
||||
//罕见病症详情
|
||||
@GetMapping("/findDiseaseKnowledge")
|
||||
public HealthR<List<DiseaseKnowledge>> findDiseaseKnowledge(@RequestParam Integer diseaseCategoryId){
|
||||
return HealthR.ok(diseaseKnowledgeService.findDiseaseKnowledge(diseaseCategoryId));
|
||||
}
|
||||
|
||||
@GetMapping("/findDrugsCategoryList")
|
||||
public HealthR<List<DrugsCategory>> findDrugsCategoryList(){
|
||||
return HealthR.ok(diseaseKnowledgeService.findDrugsCategoryList());
|
||||
}
|
||||
@GetMapping("/findDrugsKnowledgeList")
|
||||
public HealthR<List<DrugsCategory>> findDrugsKnowledgeList(@RequestParam Integer drugsCategoryId,
|
||||
@RequestParam(value = "page",defaultValue = "1") Integer page,
|
||||
@RequestParam(value = "count",defaultValue = "5") Integer count){
|
||||
|
||||
startPage(page,count);
|
||||
List<DrugsCategory> list=diseaseKnowledgeService.findDrugsKnowledgeList(drugsCategoryId);
|
||||
return HealthR.ok(list);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/findDiseaseCategory")
|
||||
public HealthR<List<DiseaseCategory>> findDiseaseCategory(@RequestParam Integer departmentId){
|
||||
List<DiseaseCategory> list=diseaseCategoryService.findDiseaseCategory(departmentId);
|
||||
return HealthR.ok(list);
|
||||
}
|
||||
|
||||
@GetMapping("/findDepartment")
|
||||
public HealthR<List<DepartmentEntity>> findDepartment(){
|
||||
List<DepartmentEntity> departmentEntities=healthV1Service.findDepartment();
|
||||
return HealthR.ok(departmentEntities);
|
||||
}
|
||||
}
|
|
@ -25,47 +25,13 @@ import java.util.List;
|
|||
* @Author 栗永斌
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/sickCircle/v1/")
|
||||
@RequestMapping("/user/sickCircle/v1/")
|
||||
public class PatientController {
|
||||
|
||||
@Autowired
|
||||
private PatientService patientService;
|
||||
|
||||
@Autowired
|
||||
private SickCircleService sickCircleService;
|
||||
|
||||
/**
|
||||
* 发表评论
|
||||
*/
|
||||
@PostMapping("/publishComment")
|
||||
public Result<SickCommentVo> publishComment(
|
||||
@RequestParam("sickCircleId") Integer sickCircleId,
|
||||
@RequestParam("content") String content) {
|
||||
|
||||
return sickCircleService.publishComment(sickCircleId, content);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 点采
|
||||
* @param opinion
|
||||
* @return
|
||||
*/
|
||||
@PutMapping("expressOpinion")
|
||||
public HealthR expressOpinion(@RequestParam("opinion") Integer opinion){
|
||||
// return sickCircleServer.expressOpinion(commentId, opinion);
|
||||
System.out.println(opinion);
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增病友圈
|
||||
*/
|
||||
@PostMapping("/publishSickCircle")
|
||||
public HealthR<SickCircleEntity> publishSickCircle(@RequestBody SickCircleEntity sickCircleEntity) {
|
||||
|
||||
return sickCircleService.publishSickCircle(sickCircleEntity);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -78,7 +44,8 @@ public class PatientController {
|
|||
@GetMapping("/findSickCircleList")
|
||||
public HealthR<List<SickCircleEntity>> sickCircleList(@RequestParam(value = "departmentId",required = false) Integer departmentId,
|
||||
@RequestParam(value = "page",defaultValue = "1") Integer page,
|
||||
@RequestParam(value = "count",defaultValue = "10") Integer count) {
|
||||
@RequestParam(value = "count",defaultValue = "20") Integer count) {
|
||||
|
||||
return patientService.sickCircleList(departmentId);
|
||||
}
|
||||
|
||||
|
@ -122,9 +89,27 @@ public class PatientController {
|
|||
* @param keyWord
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("searchSickCircle")
|
||||
@GetMapping("/searchSickCircle")
|
||||
public HealthR<List<SickCircleEntity>> searchSickCircle(@RequestParam(value = "keyWord",required = false) String keyWord){
|
||||
System.out.println(keyWord);
|
||||
return patientService.searchSickCircle(keyWord);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询患者创建的病友圈
|
||||
* @param patientUserId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/findPatientSickCircleList")
|
||||
public HealthR<List<SickCircleEntity>> findPatientSickCircleList(@RequestParam(value = "patientUserId",required = false) Integer patientUserId,
|
||||
@RequestParam(value = "page",defaultValue = "1") Integer page,
|
||||
@RequestParam(value = "count",defaultValue = "20") Integer count) {
|
||||
startPage(page, count);
|
||||
return patientService.findPatientSickCircleList(patientUserId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,69 @@
|
|||
package doctor.controller;
|
||||
|
||||
import com.alibaba.nacos.api.model.v2.Result;
|
||||
import doctor.common.core.domain.HealthR;
|
||||
import doctor.domain.entity.SickCircleEntity;
|
||||
import doctor.domain.vo.SickCommentVo;
|
||||
import doctor.service.SickCircleServer;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
/**
|
||||
* @ClassName SickCircle
|
||||
* @Description 新增病友圈
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/user/sickCircle/verify/v1/")
|
||||
public class SickCircleController {
|
||||
@Autowired
|
||||
SickCircleServer sickCircleServer;
|
||||
|
||||
|
||||
/**
|
||||
* 新增病友圈
|
||||
*/
|
||||
@PostMapping("/publishSickCircle")
|
||||
public HealthR<SickCircleEntity> publishSickCircle(@RequestBody SickCircleEntity sickCircleEntity) {
|
||||
|
||||
return sickCircleServer.publishSickCircle(sickCircleEntity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传图片
|
||||
*
|
||||
* @param picture
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/uploadSickCirclePicture")
|
||||
public Result upload(@RequestParam("picture") MultipartFile picture) {
|
||||
return sickCircleServer.pictures(picture);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 发表评论
|
||||
*/
|
||||
@PostMapping("/publishComment")
|
||||
public Result<SickCommentVo> publishComment(
|
||||
@RequestParam("sickCircleId") Integer sickCircleId,
|
||||
@RequestParam("content") String content) {
|
||||
return sickCircleServer.publishComment(sickCircleId, content);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 点采
|
||||
* @param opinion
|
||||
* @return
|
||||
*/
|
||||
@PutMapping("expressOpinion")
|
||||
public HealthR expressOpinion(@RequestParam("commentId") Integer commentId,
|
||||
@RequestParam("opinion") Integer opinion){
|
||||
// return sickCircleServer.expressOpinion(commentId, opinion);
|
||||
|
||||
return sickCircleServer.expressOpinion(commentId, opinion);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -9,41 +9,99 @@ import java.util.Date;
|
|||
|
||||
@Data
|
||||
public class SickCircleEntity {
|
||||
/**
|
||||
* 病例ID
|
||||
*/
|
||||
private Integer sickCircleId;
|
||||
|
||||
private Integer userId;
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 病例标题
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
private Integer departmentId;
|
||||
|
||||
/**
|
||||
* 采纳评论ID
|
||||
*/
|
||||
private Integer adoptCommentId;
|
||||
|
||||
/**
|
||||
* 疾病名称
|
||||
*/
|
||||
private String disease;
|
||||
|
||||
|
||||
/**
|
||||
* 病例详情
|
||||
*/
|
||||
private String detail;
|
||||
|
||||
/**
|
||||
* 治疗医院
|
||||
*/
|
||||
private String treatmentHospital;
|
||||
|
||||
/**
|
||||
* 治疗开始时间
|
||||
*/
|
||||
private Date treatmentStartTime;
|
||||
|
||||
/**
|
||||
* 治疗结束时间
|
||||
*/
|
||||
private Date treatmentEndTime;
|
||||
|
||||
/**
|
||||
* 治疗过程
|
||||
*/
|
||||
private String treatmentProcess;
|
||||
|
||||
/**
|
||||
* 图片
|
||||
*/
|
||||
private String picture;
|
||||
|
||||
/**
|
||||
* 发布时间
|
||||
*/
|
||||
private Date releaseTime;
|
||||
|
||||
/**
|
||||
* 采纳时间
|
||||
*/
|
||||
private Date adoptTime;
|
||||
|
||||
/**
|
||||
* 治愈人数
|
||||
*/
|
||||
private Integer amount;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 收藏数
|
||||
*/
|
||||
private Integer collectionNum;
|
||||
|
||||
/**
|
||||
* 评论数
|
||||
*/
|
||||
private Integer commentNum;
|
||||
|
||||
/**
|
||||
* 科室名称
|
||||
*/
|
||||
private String department;
|
||||
|
||||
}
|
||||
|
|
|
@ -2,6 +2,8 @@ package doctor.domain.entity;
|
|||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @ClassName SickConmentEntity
|
||||
* @Description 评论表
|
||||
|
@ -10,19 +12,32 @@ import lombok.Data;
|
|||
@Data
|
||||
public class SickCommentEntity {
|
||||
|
||||
// 私有变量,评论的ID
|
||||
private String id;
|
||||
// 私有变量,评论所属的圈子ID
|
||||
private String sickCircleId;
|
||||
// 私有变量,评论的用户ID
|
||||
private String userId;
|
||||
// 私有变量,评论的内容
|
||||
// // 私有变量,评论的ID
|
||||
// private String id;
|
||||
// // 私有变量,评论所属的圈子ID
|
||||
// private String sickCircleId;
|
||||
// // 私有变量,评论的用户ID
|
||||
// private String patientUserId;
|
||||
// // 私有变量,评论的内容
|
||||
// private String content;
|
||||
// // 私有变量,评论的评论时间
|
||||
// private String commentTime;
|
||||
// // 私有变量,是否为医生评论
|
||||
// private String whetherDoctor;
|
||||
// // 私有变量,评论的创建时间
|
||||
// private String createTime;
|
||||
|
||||
|
||||
private String content;
|
||||
// 私有变量,评论的评论时间
|
||||
private String commentTime;
|
||||
// 私有变量,是否为医生评论
|
||||
private String whetherDoctor;
|
||||
// 私有变量,评论的创建时间
|
||||
private String createTime;
|
||||
private Date createTime;
|
||||
private Integer patientUserId;
|
||||
private Integer whetherDoctor;
|
||||
private Integer commentId;
|
||||
private Integer opposeNum;
|
||||
private Integer supportNum;
|
||||
private Integer opinion;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -37,4 +37,6 @@ public interface PatientMapper {
|
|||
|
||||
List<SickCircleEntity> searchSickCircle(@Param("keyWord") String keyWord);
|
||||
|
||||
List<SickCircleEntity> findPatientSickCircleList(@Param("patientUserId") Integer patientUserId);
|
||||
|
||||
}
|
||||
|
|
|
@ -3,18 +3,22 @@ package doctor.mapper;
|
|||
import doctor.domain.entity.SickCircleEntity;
|
||||
import doctor.domain.vo.SickInfoVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface SickCircleMapper {
|
||||
List<SickCircleEntity> findSickCircleList(Integer departmentId);
|
||||
List<SickCircleEntity> findSickCircleList(@Param("departmentId") Integer departmentId);
|
||||
|
||||
SickCircleEntity findSickCircleInfo(Integer sickCircleId);
|
||||
SickCircleEntity findSickCircleInfo(@Param("sickCircleId") Integer sickCircleId);
|
||||
|
||||
SickCircleEntity findSickCircleInfoByKeyWord(String keyWord);
|
||||
SickCircleEntity findSickCircleInfoByKeyWord(@Param("keyWord") String keyWord);
|
||||
|
||||
void publishComment(Integer sickCircleId, Long userid, String content);
|
||||
void publishComment(@Param("sickCircleId") Integer sickCircleId, @Param("userid") Long userid, @Param("content") String content);
|
||||
|
||||
void publishSickCircle(SickCircleEntity sickCircleEntity);
|
||||
|
||||
|
||||
void expressOpinion(@Param("commentId") Integer commentId, @Param("opinion") Integer opinion, @Param("userid") Long userid);
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import doctor.common.core.domain.HealthR;
|
|||
import doctor.domain.entity.SickCircleEntity;
|
||||
import doctor.domain.entity.SickCommentEntity;
|
||||
import doctor.domain.entity.SymptomEntity;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -29,13 +30,15 @@ public interface PatientService {
|
|||
|
||||
|
||||
|
||||
HealthR<List<SickCircleEntity>> sickCircleList(Integer departmentId);
|
||||
HealthR<List<SickCircleEntity>> sickCircleList(@Param("departmentId") Integer departmentId);
|
||||
|
||||
|
||||
HealthR<List<SickCommentEntity>> findSickCircleCommentList(Integer sickCircleId);
|
||||
HealthR<List<SickCommentEntity>> findSickCircleCommentList(@Param("sickCircleId") Integer sickCircleId);
|
||||
|
||||
|
||||
|
||||
HealthR<List<SickCircleEntity>> searchSickCircle(String keyWord);
|
||||
|
||||
HealthR<List<SickCircleEntity>> findPatientSickCircleList(Integer patientUserId);
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
package doctor.service;
|
||||
|
||||
import com.alibaba.nacos.api.model.v2.Result;
|
||||
import doctor.common.core.domain.HealthR;
|
||||
import doctor.domain.entity.SickCircleEntity;
|
||||
import doctor.domain.vo.SickCommentVo;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* @ClassName SickCircleServer
|
||||
* @Description 描述
|
||||
*/
|
||||
public interface SickCircleServer {
|
||||
HealthR<SickCircleEntity> publishSickCircle(SickCircleEntity sickCircleEntity);
|
||||
Result pictures(MultipartFile picture);
|
||||
Result<SickCommentVo> publishComment(Integer sickCircleId, String content);
|
||||
|
||||
|
||||
HealthR expressOpinion(Integer commentId, Integer opinion);
|
||||
|
||||
}
|
|
@ -4,6 +4,7 @@ import com.alibaba.nacos.api.model.v2.Result;
|
|||
import doctor.common.core.constant.TokenConstants;
|
||||
import doctor.common.core.domain.HealthR;
|
||||
import doctor.common.security.service.TokenService;
|
||||
import doctor.common.security.utils.SecurityUtils;
|
||||
import doctor.domain.entity.SickCircleEntity;
|
||||
import doctor.domain.entity.SickCommentEntity;
|
||||
import doctor.domain.entity.SymptomEntity;
|
||||
|
@ -28,12 +29,6 @@ public class PatientServiceImpl implements PatientService {
|
|||
@Autowired
|
||||
private PatientMapper patientMapper;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public HealthR<List<SickCircleEntity>> sickCircleList(Integer departmentId) {
|
||||
/**
|
||||
|
@ -62,9 +57,16 @@ public class PatientServiceImpl implements PatientService {
|
|||
@Override
|
||||
public HealthR<List<SickCircleEntity>> searchSickCircle(String keyWord) {
|
||||
List<SickCircleEntity> list= patientMapper.searchSickCircle(keyWord);
|
||||
|
||||
return HealthR.ok(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HealthR<List<SickCircleEntity>> findPatientSickCircleList(Integer patientUserId) {
|
||||
List<SickCircleEntity> sickCircleEntity = patientMapper.findPatientSickCircleList(patientUserId);
|
||||
return HealthR.ok(sickCircleEntity);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public SickCircleEntity findSickCircleInfo(Integer id) {
|
||||
|
|
|
@ -0,0 +1,107 @@
|
|||
package doctor.service.impl;
|
||||
|
||||
import com.alibaba.nacos.api.model.v2.Result;
|
||||
import doctor.common.core.constant.TokenConstants;
|
||||
import doctor.common.core.domain.HealthR;
|
||||
import doctor.common.core.domain.R;
|
||||
import doctor.common.security.service.TokenService;
|
||||
import doctor.common.core.utils.StringUtils;
|
||||
import doctor.domain.entity.SickCircleEntity;
|
||||
import doctor.domain.vo.SickCommentVo;
|
||||
import doctor.mapper.SickCircleMapper;
|
||||
import doctor.service.SickCircleServer;
|
||||
import doctor.system.api.model.LoginUser;
|
||||
import doctor.util.OssUtil;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.persistence.Access;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* @ClassName SickCircleServerImpl
|
||||
* @Description 描述
|
||||
*/
|
||||
@Service
|
||||
@Log4j2
|
||||
public class SickCircleServerImpl implements SickCircleServer {
|
||||
|
||||
@Autowired
|
||||
SickCircleMapper mapper;
|
||||
|
||||
@Override
|
||||
public HealthR<SickCircleEntity> publishSickCircle(SickCircleEntity sickCircleEntity) {
|
||||
if (StringUtils.isEmpty(sickCircleEntity.getTitle())) {
|
||||
Result.failure("标题不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(sickCircleEntity.getTitle())) {
|
||||
Result.failure("标题不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(sickCircleEntity.getDisease())) {
|
||||
Result.failure("症状不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(sickCircleEntity.getDetail())) {
|
||||
Result.failure("描述不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(sickCircleEntity.getTreatmentProcess())) {
|
||||
Result.failure("治疗过程不能为空");
|
||||
}
|
||||
LoginUser login = Login();
|
||||
sickCircleEntity.setUserId(login.getUserid());
|
||||
String s = redisTemplate.opsForValue().get("url");
|
||||
sickCircleEntity.setPicture(s);
|
||||
mapper.publishSickCircle(sickCircleEntity);
|
||||
return HealthR.ok(sickCircleEntity);
|
||||
}
|
||||
|
||||
|
||||
@Autowired
|
||||
HttpServletRequest httpServletRequest;
|
||||
@Autowired
|
||||
TokenService tokenService;
|
||||
|
||||
private LoginUser Login() {
|
||||
|
||||
String header = httpServletRequest.getHeader(TokenConstants.SESSIONID);
|
||||
LoginUser loginUser = tokenService.getLoginUser(header);
|
||||
return loginUser;
|
||||
}
|
||||
|
||||
|
||||
@Autowired
|
||||
RedisTemplate<String,String> redisTemplate;
|
||||
@Override
|
||||
public Result pictures(MultipartFile picture) {
|
||||
String url = OssUtil.uploadMultipartFile(picture);
|
||||
if (StringUtils.isEmpty(url)){
|
||||
log.info("上传oss成功:"+url);
|
||||
}
|
||||
// redisTemplate.opsForValue().set("usr",url);
|
||||
return Result.success(url);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<SickCommentVo> publishComment(Integer sickCircleId, String content) {
|
||||
//获取用户对象
|
||||
LoginUser login = Login();
|
||||
//获取用户id
|
||||
Long userid = login.getUserid();
|
||||
|
||||
mapper.publishComment(sickCircleId,userid, content);
|
||||
|
||||
return Result.success(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HealthR expressOpinion(Integer commentId, Integer opinion) {
|
||||
LoginUser login = Login();
|
||||
Long userid = login.getUserid();
|
||||
mapper.expressOpinion(commentId, opinion,userid);
|
||||
|
||||
return HealthR.ok();
|
||||
}
|
||||
|
||||
}
|
|
@ -90,7 +90,7 @@ public class SickCircleServiceImpl extends BaseController implements SickCircleS
|
|||
Result.failure("治疗过程不能为空");
|
||||
}
|
||||
LoginUser login = Login();
|
||||
sickCircleEntity.setUserId(login.getUserid().intValue());
|
||||
sickCircleEntity.setUserId(login.getUserid());
|
||||
|
||||
sickCircleMapper.publishSickCircle(sickCircleEntity);
|
||||
return HealthR.ok(sickCircleEntity);
|
||||
|
|
|
@ -8,4 +8,5 @@
|
|||
<select id="list" resultType="doctor.domain.entity.DiseaseCategory">
|
||||
select *from disease_category where department_id=#{departmentId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
|
@ -28,14 +28,32 @@
|
|||
SELECT sick_circle.*,department.department_name department FROM sick_circle LEFT JOIN department on sick_circle.department_id=department.id
|
||||
WHERE sick_circle.sick_circle_id=#{id}
|
||||
</select>
|
||||
|
||||
<select id="findSickCircleCommentList" resultType="doctor.domain.entity.SickCommentEntity">
|
||||
select * from sick_circle_comment where sick_circle_id=#{sickCircleId}
|
||||
SELECT
|
||||
sick_circle_comment.content,
|
||||
sick_circle_comment.create_time,
|
||||
sick_circle_comment.patient_user_id,
|
||||
sick_circle_comment.whether_doctor,
|
||||
sick_circle_comment_count.comment_id,
|
||||
sick_circle_comment_count.oppose_num,
|
||||
sick_circle_comment_count.support_num,
|
||||
sick_circle_comment_view.opinion
|
||||
FROM
|
||||
sick_circle_comment
|
||||
LEFT JOIN sick_circle_comment_count ON sick_circle_comment.patient_user_id = sick_circle_comment_count.comment_id LEFT JOIN sick_circle_comment_view on sick_circle_comment.patient_user_id=sick_circle_comment_view.opinion where
|
||||
sick_circle_comment.sick_circle_id=#{sickCircleId}
|
||||
</select>
|
||||
|
||||
<select id="searchSickCircle" resultType="doctor.domain.entity.SickCircleEntity">
|
||||
select sick_circle_id , `user_id`, `title`, `department_id`, `adopt_comment_id`, `disease`, `detail`, `treatment_hospital`, `treatment_start_time`, `treatment_end_time`, `treatment_process`, `picture`, `release_time`, `adopt_time`, `amount`, `create_time`, `collection_num`, `comment_num`
|
||||
from sick_circle where
|
||||
|
||||
disease like '%${keyWord}%';
|
||||
from sick_circle where disease like '%${keyWord}%' or title like '%${keyWord}%' or detail like '%${keyWord}%';
|
||||
|
||||
</select>
|
||||
<select id="findPatientSickCircleList" resultType="doctor.domain.entity.SickCircleEntity"
|
||||
parameterType="java.lang.Integer">
|
||||
select sick_circle_id , `user_id`, `title`, `department_id`, `adopt_comment_id`, `disease`, `detail`, `treatment_hospital`, `treatment_start_time`, `treatment_end_time`, `treatment_process`, `picture`, `release_time`, `adopt_time`, `amount`, `create_time`, `collection_num`, `comment_num`
|
||||
from sick_circle where user_id=#{patientUserId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
|
@ -24,4 +24,8 @@
|
|||
INSERT INTO `doctor`.`sick_circle_comment` ( `sick_circle_id`, `user_id`, `content`, `comment_time`, `whether_doctor`, `create_time`)
|
||||
VALUES (#{sickCircleId},#{userid},#{content},now(),1,now())
|
||||
</insert>
|
||||
<insert id="expressOpinion">
|
||||
UPDATE sick_circle_comment_view set opinion=#{opinion} ,user_id=#{userid} WHERE comment_id=#{commentId}
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
|
|
Loading…
Reference in New Issue