1.20
parent
a334ab2fb8
commit
9dbbdf5731
|
@ -15,11 +15,11 @@ spring:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 101.34.77.101:8848
|
server-addr: 101.34.77.101:8848
|
||||||
namespace: 9de208a6-cb30-41ae-a880-78196c99c050
|
namespace: 7e1e997d-5fa4-4f84-9f48-3e0adf830a37
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 101.34.77.101:8848
|
server-addr: 101.34.77.101:8848
|
||||||
namespace: 9de208a6-cb30-41ae-a880-78196c99c050
|
namespace: 7e1e997d-5fa4-4f84-9f48-3e0adf830a37
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -15,11 +15,11 @@ spring:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 101.34.77.101:8848
|
server-addr: 101.34.77.101:8848
|
||||||
namespace: 9de208a6-cb30-41ae-a880-78196c99c050
|
namespace: 7e1e997d-5fa4-4f84-9f48-3e0adf830a37
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 101.34.77.101:8848
|
server-addr: 101.34.77.101:8848
|
||||||
namespace: 9de208a6-cb30-41ae-a880-78196c99c050
|
namespace: 7e1e997d-5fa4-4f84-9f48-3e0adf830a37
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -15,11 +15,11 @@ spring:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 101.34.77.101:8848
|
server-addr: 101.34.77.101:8848
|
||||||
namespace: 9de208a6-cb30-41ae-a880-78196c99c050
|
namespace: 7e1e997d-5fa4-4f84-9f48-3e0adf830a37
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 101.34.77.101:8848
|
server-addr: 101.34.77.101:8848
|
||||||
namespace: 9de208a6-cb30-41ae-a880-78196c99c050
|
namespace: 7e1e997d-5fa4-4f84-9f48-3e0adf830a37
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -15,11 +15,11 @@ spring:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 101.34.77.101:8848
|
server-addr: 101.34.77.101:8848
|
||||||
namespace: 9de208a6-cb30-41ae-a880-78196c99c050
|
namespace: 7e1e997d-5fa4-4f84-9f48-3e0adf830a37
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 101.34.77.101:8848
|
server-addr: 101.34.77.101:8848
|
||||||
namespace: 9de208a6-cb30-41ae-a880-78196c99c050
|
namespace: 7e1e997d-5fa4-4f84-9f48-3e0adf830a37
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -4,6 +4,7 @@ package doctor.controller;
|
||||||
import doctor.common.core.domain.HealthR;
|
import doctor.common.core.domain.HealthR;
|
||||||
import doctor.common.core.domain.R;
|
import doctor.common.core.domain.R;
|
||||||
import doctor.domain.entity.*;
|
import doctor.domain.entity.*;
|
||||||
|
import doctor.service.DiseaseCategoryService;
|
||||||
import doctor.service.DiseaseKnowledgeService;
|
import doctor.service.DiseaseKnowledgeService;
|
||||||
import doctor.service.HealthJobTitleService;
|
import doctor.service.HealthJobTitleService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -27,6 +28,8 @@ import static doctor.common.core.utils.PageUtils.startPage;
|
||||||
public class DiseaseKnowledgeController {
|
public class DiseaseKnowledgeController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private DiseaseKnowledgeService diseaseKnowledgeService;
|
private DiseaseKnowledgeService diseaseKnowledgeService;
|
||||||
|
@Autowired
|
||||||
|
private DiseaseCategoryService diseaseCategoryService;
|
||||||
|
|
||||||
@GetMapping("/findDepartment")
|
@GetMapping("/findDepartment")
|
||||||
public HealthR<List<Department>> findDepartment(){
|
public HealthR<List<Department>> findDepartment(){
|
||||||
|
@ -63,6 +66,12 @@ public class DiseaseKnowledgeController {
|
||||||
List<PopularSearchEntity> list=diseaseKnowledgeService.popularSeach();
|
List<PopularSearchEntity> list=diseaseKnowledgeService.popularSeach();
|
||||||
return HealthR.ok(list);
|
return HealthR.ok(list);
|
||||||
}
|
}
|
||||||
|
@GetMapping("/findDiseaseCategory")
|
||||||
|
public HealthR<List<DiseaseCategory>> findDiseaseCategory(@RequestParam Integer departmentId){
|
||||||
|
List<DiseaseCategory> list=diseaseCategoryService.findDiseaseCategory(departmentId);
|
||||||
|
return HealthR.ok(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@ package doctor.controller;
|
||||||
|
|
||||||
import doctor.common.core.domain.HealthR;
|
import doctor.common.core.domain.HealthR;
|
||||||
import doctor.domain.entity.DoctorEntity;
|
import doctor.domain.entity.DoctorEntity;
|
||||||
|
import doctor.domain.vo.DoctorVo;
|
||||||
import doctor.service.DoctorService;
|
import doctor.service.DoctorService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
@ -12,6 +13,8 @@ import org.springframework.web.bind.annotation.RestController;
|
||||||
import javax.print.Doc;
|
import javax.print.Doc;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import static com.github.pagehelper.page.PageMethod.startPage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @BelongsProject: Medical_Treatment
|
* @BelongsProject: Medical_Treatment
|
||||||
* @BelongsPackage: doctor.controller
|
* @BelongsPackage: doctor.controller
|
||||||
|
@ -24,13 +27,14 @@ public class DoctorController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private DoctorService doctorService;
|
private DoctorService doctorService;
|
||||||
@GetMapping("/findDoctorList")
|
@GetMapping("/findDoctorList")
|
||||||
public HealthR<List<DoctorEntity>> findDoctorList(@RequestParam Integer deptId,
|
public HealthR<List<DoctorVo>> findDoctorList(@RequestParam Integer deptId,
|
||||||
@RequestParam Integer condition,
|
@RequestParam Integer condition,
|
||||||
@RequestParam Integer sortBy,
|
@RequestParam Integer sortBy,
|
||||||
@RequestParam(value = "page",defaultValue = "1") Integer page,
|
@RequestParam(value = "page",defaultValue = "1") Integer page,
|
||||||
@RequestParam(value = "count",defaultValue = "5") Integer count
|
@RequestParam(value = "count",defaultValue = "5") Integer count
|
||||||
){
|
){
|
||||||
List<DoctorEntity> list=doctorService.findDoctorList(deptId);
|
startPage(page,count);
|
||||||
|
List<DoctorVo> list=doctorService.findDoctorList(deptId,condition,sortBy);
|
||||||
return HealthR.ok(list);
|
return HealthR.ok(list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ public class InquiryController {
|
||||||
@GetMapping("/v1/findDoctorInfo")
|
@GetMapping("/v1/findDoctorInfo")
|
||||||
public HealthR<DoctorVo> findDoctorInfo(@RequestHeader Integer userId,
|
public HealthR<DoctorVo> findDoctorInfo(@RequestHeader Integer userId,
|
||||||
@RequestHeader String sessionId,
|
@RequestHeader String sessionId,
|
||||||
@RequestParam Integer doctorId) {
|
@RequestParam(value = "doctorId",defaultValue = "2") Integer doctorId) {
|
||||||
DoctorVo doctorVo = inquiryService.findDoctorInfo(doctorId);
|
DoctorVo doctorVo = inquiryService.findDoctorInfo(doctorId);
|
||||||
return HealthR.ok(doctorVo);
|
return HealthR.ok(doctorVo);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
package doctor.convert;
|
||||||
|
|
||||||
|
import doctor.domain.entity.DoctorEntity;
|
||||||
|
import doctor.domain.vo.DoctorVo;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.Mapping;
|
||||||
|
import org.mapstruct.Mappings;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface DoctorConvert {
|
||||||
|
|
||||||
|
DoctorConvert INSTANCE = Mappers.getMapper(DoctorConvert.class);
|
||||||
|
|
||||||
|
DoctorEntity doctorVoToDoctorEntity(DoctorVo doctorVo);
|
||||||
|
@Mappings({
|
||||||
|
@Mapping(source = "id", target = "doctorId")
|
||||||
|
})
|
||||||
|
DoctorVo doctorEntityToDoctorVo(DoctorEntity doctorEntity);
|
||||||
|
List<DoctorVo> doctorEntityListToDoctorVoList(List<DoctorEntity> doctorEntityList);
|
||||||
|
|
||||||
|
List<DoctorEntity> doctorVoListToDoctorEntityList(List<DoctorVo> doctorVoList);
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
package doctor.domain.entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @BelongsProject: Medical_Treatment
|
||||||
|
* @BelongsPackage: doctor.domain.entity
|
||||||
|
* @Author: jpz
|
||||||
|
* @CreateTime: 2024/1/19 11:41
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class DoctorAskCount {
|
||||||
|
private Integer id;
|
||||||
|
private Integer doctorAskCount;
|
||||||
|
private Integer number;
|
||||||
|
private Date updateTime;
|
||||||
|
private Date createTime;
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
package doctor.domain.entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @BelongsProject: Medical_Treatment
|
||||||
|
* @BelongsPackage: doctor.domain.entity
|
||||||
|
* @Author: jpz
|
||||||
|
* @CreateTime: 2024/1/18 18:33
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class DoctorCharge {
|
||||||
|
private Integer id;
|
||||||
|
private Integer doctorId;
|
||||||
|
private Integer cost;
|
||||||
|
private Date updateTime;
|
||||||
|
private Date createTime;
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
package doctor.domain.entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @BelongsProject: Medical_Treatment
|
||||||
|
* @BelongsPackage: doctor.domain.entity
|
||||||
|
* @Author: jpz
|
||||||
|
* @CreateTime: 2024/1/18 18:48
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class DoctorCommentCount {
|
||||||
|
private Integer id;
|
||||||
|
private Integer doctorId;
|
||||||
|
private Integer praiseNum;
|
||||||
|
private Integer badNum;
|
||||||
|
private Date createTime;
|
||||||
|
}
|
|
@ -24,6 +24,7 @@ public class DoctorEntity {
|
||||||
private String phone;
|
private String phone;
|
||||||
private String pwd;
|
private String pwd;
|
||||||
private String name;
|
private String name;
|
||||||
|
private String jobTitle;
|
||||||
private String imagePic;
|
private String imagePic;
|
||||||
private String inauguralHospital;
|
private String inauguralHospital;
|
||||||
private String personalProfile;
|
private String personalProfile;
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
package doctor.domain.entity;
|
package doctor.domain.entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
@ -10,42 +12,16 @@ import java.util.Date;
|
||||||
* @Author: jpz
|
* @Author: jpz
|
||||||
* @CreateTime: 2024/1/8 21:49
|
* @CreateTime: 2024/1/8 21:49
|
||||||
*/
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
public class UserDoctorFollowEntity {
|
public class UserDoctorFollowEntity {
|
||||||
private Integer id;
|
private Integer id;
|
||||||
private Integer userId;
|
private Long userId;
|
||||||
private Integer doctorId;
|
private Integer doctorId;
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
public Integer getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(Integer id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getUserId() {
|
|
||||||
return userId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUserId(Integer userId) {
|
|
||||||
this.userId = userId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getDoctorId() {
|
|
||||||
return doctorId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDoctorId(Integer doctorId) {
|
|
||||||
this.doctorId = doctorId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getCreateTime() {
|
|
||||||
return createTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCreateTime(Date createTime) {
|
|
||||||
this.createTime = createTime;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,12 +24,7 @@ public class DoctorVo {
|
||||||
private double praise;
|
private double praise;
|
||||||
private Integer serverNum;
|
private Integer serverNum;
|
||||||
private Integer servicePrice;
|
private Integer servicePrice;
|
||||||
private Integer followFlag;
|
|
||||||
private String personalProfile;
|
|
||||||
private String goodField;
|
|
||||||
private Integer commentNum;
|
|
||||||
private Integer praiseNum;
|
private Integer praiseNum;
|
||||||
private Integer badNum;
|
private Integer badNum;
|
||||||
private List<DoctorReceiveGift> doctorReceiveGiftList;
|
private Integer commentNum;
|
||||||
private List<Comment> commentVoList;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package doctor.mapper;
|
package doctor.mapper;
|
||||||
|
|
||||||
import doctor.domain.entity.DoctorEntity;
|
import doctor.domain.entity.DoctorEntity;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.mybatis.spring.annotation.MapperScan;
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -13,5 +14,6 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
@MapperScan
|
@MapperScan
|
||||||
public interface DoctorMapper {
|
public interface DoctorMapper {
|
||||||
List<DoctorEntity> findDoctorList(Integer deptId);
|
// List<DoctorEntity> findDoctorList(Integer deptId, Integer condition, Integer sortBy);
|
||||||
|
List<DoctorEntity> findDoctorList(@Param("deptId") Integer deptId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
package doctor.mapper;
|
package doctor.mapper;
|
||||||
|
|
||||||
|
import doctor.domain.entity.DoctorAskCount;
|
||||||
import doctor.domain.entity.InquiryDetailsRecordEntity;
|
import doctor.domain.entity.InquiryDetailsRecordEntity;
|
||||||
|
import doctor.domain.entity.InquiryRecordEntity;
|
||||||
|
import doctor.domain.entity.UserDoctorFollowEntity;
|
||||||
|
import doctor.domain.vo.DoctorVo;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
@ -19,4 +23,20 @@ public interface InquiryMapper {
|
||||||
void consultDoctor(@Param("userId") Integer userId, @Param("doctorId") Integer doctorId);
|
void consultDoctor(@Param("userId") Integer userId, @Param("doctorId") Integer doctorId);
|
||||||
|
|
||||||
String findDoctorUserNameByDoctorId(@Param("doctorId") Integer doctorId);
|
String findDoctorUserNameByDoctorId(@Param("doctorId") Integer doctorId);
|
||||||
|
|
||||||
|
DoctorVo findDoctorInfo(@Param("doctorId") Integer doctorId);
|
||||||
|
|
||||||
|
void followDoctor(@Param("userDoctorFollowEntity") UserDoctorFollowEntity userDoctorFollowEntity);
|
||||||
|
|
||||||
|
void delCancelFollow(@Param("userid") Long userid, @Param("doctorId") Integer doctorId);
|
||||||
|
|
||||||
|
InquiryRecordEntity findInquiryRecordById(@Param("recordId") Integer recordId, int i);
|
||||||
|
|
||||||
|
void endInquiry(@Param("recordId") Integer recordId);
|
||||||
|
|
||||||
|
DoctorAskCount getDoctorAskCount(@Param("doctorId") Integer doctorId);
|
||||||
|
|
||||||
|
void addDoctorAskCount(DoctorAskCount doctorAskCount);
|
||||||
|
|
||||||
|
void updDoctorAskCount(DoctorAskCount doctorAskCount);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package doctor.service;
|
package doctor.service;
|
||||||
|
|
||||||
import doctor.domain.entity.DoctorEntity;
|
import doctor.domain.entity.DoctorEntity;
|
||||||
|
import doctor.domain.vo.DoctorVo;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -11,5 +12,5 @@ import java.util.List;
|
||||||
* @CreateTime: 2024/1/15 11:32
|
* @CreateTime: 2024/1/15 11:32
|
||||||
*/
|
*/
|
||||||
public interface DoctorService {
|
public interface DoctorService {
|
||||||
List<DoctorEntity> findDoctorList(Integer deptId);
|
List<DoctorVo> findDoctorList(Integer deptId, Integer condition, Integer sortBy);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,17 @@
|
||||||
package doctor.service.impl;
|
package doctor.service.impl;
|
||||||
|
|
||||||
|
import doctor.convert.DoctorConvert;
|
||||||
|
import doctor.domain.entity.DoctorCharge;
|
||||||
|
import doctor.domain.entity.DoctorCommentCount;
|
||||||
import doctor.domain.entity.DoctorEntity;
|
import doctor.domain.entity.DoctorEntity;
|
||||||
|
import doctor.domain.vo.DoctorVo;
|
||||||
import doctor.mapper.DoctorMapper;
|
import doctor.mapper.DoctorMapper;
|
||||||
import doctor.service.DoctorService;
|
import doctor.service.DoctorService;
|
||||||
|
import doctor.system.api.domain.Doctor;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -19,8 +25,33 @@ public class DoctorServiceimpl implements DoctorService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private DoctorMapper doctorMapper;
|
private DoctorMapper doctorMapper;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DoctorEntity> findDoctorList(Integer deptId) {
|
public List<DoctorVo> findDoctorList(Integer deptId, Integer condition, Integer sortBy) {
|
||||||
return doctorMapper.findDoctorList(deptId);
|
List<DoctorEntity> doctorEntities=doctorMapper.findDoctorList(deptId);//获取指定部门的医生实体列表
|
||||||
|
// List<DoctorVo> doctorVos=new ArrayList<>();
|
||||||
|
// for (DoctorEntity doctorEntity : doctorVoList) {
|
||||||
|
// DoctorVo doctorVo = new DoctorVo();
|
||||||
|
// DoctorCharge doctorCharge = doctorMapper.doctorCharge(doctorEntity.getId()); // 获医生的收费信
|
||||||
|
// doctorVo.setServicePrice(doctorCharge.getCost()); // 设置医生的收费价格
|
||||||
|
// doctorVo.setDoctorId(doctorEntity.getId());
|
||||||
|
// doctorVo.setDoctorName(doctorEntity.getName());
|
||||||
|
// doctorVo.setDoctorName(doctorVo.getDoctorName());
|
||||||
|
// doctorVo.setImagePic(doctorVo.getImagePic());
|
||||||
|
// doctorVo.setJobTitle(doctorEntity.getJobTitle());
|
||||||
|
// doctorVo.setInauguralHospital(doctorVo.getInauguralHospital());
|
||||||
|
// DoctorCommentCount doctored=doctorMapper.doctorCommentCount(doctorEntity.getId());
|
||||||
|
// doctorVo.setPraiseNum(doctored.getPraiseNum());
|
||||||
|
// doctorVo.setCommentNum(doctored.getPraiseNum()+doctored.getBadNum());
|
||||||
|
// doctorVo.setBadNum(doctored.getBadNum());
|
||||||
|
// doctorVo.setPraise(doctorVo.getPraiseNum()/doctorVo.getCommentNum());
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
|
List<DoctorVo> doctorVos= DoctorConvert.INSTANCE.doctorEntityListToDoctorVoList(doctorEntities);
|
||||||
|
|
||||||
|
return doctorVos;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,16 +1,21 @@
|
||||||
package doctor.service.impl;
|
package doctor.service.impl;
|
||||||
|
|
||||||
import doctor.domain.entity.InquiryDetailsRecordEntity;
|
import doctor.common.security.utils.SecurityUtils;
|
||||||
|
import doctor.domain.entity.*;
|
||||||
import doctor.domain.vo.DoctorVo;
|
import doctor.domain.vo.DoctorVo;
|
||||||
import doctor.domain.vo.InquiryDetailsRecordVo;
|
import doctor.domain.vo.InquiryDetailsRecordVo;
|
||||||
import doctor.mapper.InquiryMapper;
|
import doctor.mapper.InquiryMapper;
|
||||||
import doctor.service.InquiryService;
|
import doctor.service.InquiryService;
|
||||||
|
import doctor.system.api.domain.Doctor;
|
||||||
|
import doctor.system.api.model.LoginUser;
|
||||||
import doctor.util.ConvertUtil;
|
import doctor.util.ConvertUtil;
|
||||||
import doctor.util.RSAUtils;
|
import doctor.util.RSAUtils;
|
||||||
import doctor.util.RsaKey;
|
import doctor.util.RsaKey;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.sql.Timestamp;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -32,17 +37,22 @@ public class InquiryServiceImpl implements InquiryService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DoctorVo findDoctorInfo(Integer doctorId) {
|
public DoctorVo findDoctorInfo(Integer doctorId) {
|
||||||
|
// DoctorCharge doctorCharge=inquiryMapper.doctorCharge(doctorId);
|
||||||
|
// DoctorCommentCount doctorCommentCount=inquiryMapper.doctorCommentCount(doctorId);
|
||||||
|
return inquiryMapper.findDoctorInfo(doctorId);
|
||||||
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String consultDoctor(Integer userId, Integer doctorId) {
|
public String consultDoctor(Integer userId, Integer doctorId) {
|
||||||
inquiryMapper.consultDoctor(userId,doctorId);
|
inquiryMapper.consultDoctor(userId,doctorId);
|
||||||
String doctorUserName = inquiryMapper.findDoctorUserNameByDoctorId(doctorId);
|
String doctorUserName1 = inquiryMapper.findDoctorUserNameByDoctorId(doctorId);
|
||||||
try {
|
try {
|
||||||
String s = RSAUtils.rsaDecrypt(doctorUserName, RsaKey.PUBLIC_KEY);
|
List<String> strings = RSAUtils.rsaEncrypt(doctorUserName1, RsaKey.PUBLIC_KEY);
|
||||||
return s;
|
String doctorUserName = strings.get(0);
|
||||||
|
System.out.println("==============="+doctorUserName);
|
||||||
|
return doctorUserName;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
@ -50,16 +60,61 @@ public class InquiryServiceImpl implements InquiryService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void followDoctor(Integer userId, Integer doctorId) {
|
public void followDoctor(Integer userId, Integer doctorId) {
|
||||||
|
if (doctorId==0){
|
||||||
|
throw new RuntimeException("医生Id不能为空");
|
||||||
|
}else {
|
||||||
|
UserDoctorFollowEntity userDoctorFollowEntity = new UserDoctorFollowEntity();
|
||||||
|
LoginUser loginUser= SecurityUtils.getLoginUser();
|
||||||
|
Long userid = loginUser.getUserid();
|
||||||
|
userDoctorFollowEntity.setUserId(userid);
|
||||||
|
userDoctorFollowEntity.setDoctorId(doctorId);
|
||||||
|
userDoctorFollowEntity.setCreateTime(new Date());
|
||||||
|
inquiryMapper.followDoctor(userDoctorFollowEntity);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//取消关注
|
||||||
@Override
|
@Override
|
||||||
public void cancelFollow(Integer userId, Integer doctorId) {
|
public void cancelFollow(Integer userId, Integer doctorId) {
|
||||||
|
LoginUser loginUser= SecurityUtils.getLoginUser();
|
||||||
|
Long userid=loginUser.getUserid();
|
||||||
|
inquiryMapper.delCancelFollow(userid,doctorId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//结束问增
|
||||||
@Override
|
@Override
|
||||||
public void endInquiry(Integer userId, Integer recordId) {
|
public void endInquiry(Integer userId, Integer recordId) {
|
||||||
|
//检查问诊记录Id是否为空
|
||||||
|
if (recordId == 0) {
|
||||||
|
throw new RuntimeException("问诊记录Id不能为空");
|
||||||
|
}
|
||||||
|
//结束问诊,获取问诊记录信息
|
||||||
|
InquiryRecordEntity inquiryRecordEntity = inquiryMapper.findInquiryRecordById(recordId,1);
|
||||||
|
//结束问诊,修改问诊记录状态
|
||||||
|
inquiryMapper.endInquiry(recordId);
|
||||||
|
if (inquiryRecordEntity==null){
|
||||||
|
throw new RuntimeException("没有找到该问诊记录");
|
||||||
|
}
|
||||||
|
//获取医生问诊次数信息
|
||||||
|
DoctorAskCount doctorAskCount=inquiryMapper.getDoctorAskCount(inquiryRecordEntity.getDoctorId());
|
||||||
|
// 如果医生问诊次数信息为空,表示医生首次问诊,添加新的记录
|
||||||
|
if (doctorAskCount==null){
|
||||||
|
doctorAskCount = new DoctorAskCount();
|
||||||
|
doctorAskCount.setDoctorAskCount(inquiryRecordEntity.getDoctorId());
|
||||||
|
doctorAskCount.setNumber(1);
|
||||||
|
doctorAskCount.setUpdateTime(new Date());
|
||||||
|
doctorAskCount.setCreateTime(new Timestamp(new Date().getTime()));
|
||||||
|
// 添加医生问诊次数记录到数据库
|
||||||
|
inquiryMapper.addDoctorAskCount(doctorAskCount);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// 如果医生已有问诊次数记录,增加次数并更新信息
|
||||||
|
doctorAskCount.setNumber(doctorAskCount.getNumber() + 1);
|
||||||
|
doctorAskCount.setUpdateTime(new Date());
|
||||||
|
|
||||||
|
// 更新医生问诊次数记录到数据库
|
||||||
|
inquiryMapper.updDoctorAskCount(doctorAskCount);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,8 +5,14 @@
|
||||||
<mapper namespace="doctor.mapper.DoctorMapper">
|
<mapper namespace="doctor.mapper.DoctorMapper">
|
||||||
|
|
||||||
|
|
||||||
|
<!-- <select id="findDoctorList" resultType="doctor.domain.entity.DoctorEntity">-->
|
||||||
|
<!-- select *-->
|
||||||
|
<!-- from doctor where department_id = #{deptId}-->
|
||||||
|
<!-- </select>-->
|
||||||
|
<!-- <select id="findDoctorList" resultType="doctor.domain.entity.DoctorEntity">-->
|
||||||
|
<!-- select * from doctor where department_id = #{deptId}-->
|
||||||
|
<!-- </select>-->
|
||||||
<select id="findDoctorList" resultType="doctor.domain.entity.DoctorEntity">
|
<select id="findDoctorList" resultType="doctor.domain.entity.DoctorEntity">
|
||||||
select *
|
select * from doctor where department_id = #{deptId}
|
||||||
from doctor where department_id = #{deptId}
|
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -20,6 +20,25 @@
|
||||||
now()
|
now()
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
|
<insert id="followDoctor">
|
||||||
|
insert into user_doctor_follow (doctor_id, user_id, create_time)values (#{doctorId}, #{userId}, #{createTime})
|
||||||
|
</insert>
|
||||||
|
<insert id="addDoctorAskCount">
|
||||||
|
insert into doctor_ask_count (doctor_id, number, create_time)
|
||||||
|
values (#{doctorId}, #{number}, #{createTime})
|
||||||
|
</insert>
|
||||||
|
<update id="endInquiry">
|
||||||
|
update inquiry_record set status = 2 where id = #{recordId}
|
||||||
|
</update>
|
||||||
|
<update id="updDoctorAskCount">
|
||||||
|
update doctor_ask_count
|
||||||
|
set number = #{number},
|
||||||
|
update_time = #{updateTime}
|
||||||
|
where doctor_id = #{doctorId}
|
||||||
|
</update>
|
||||||
|
<delete id="delCancelFollow">
|
||||||
|
delete from user_doctor_follow where doctor_id = #{doctorId} and user_id = #{userId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
|
||||||
<select id="findHistoryInquiryRecord" resultType="doctor.domain.entity.InquiryDetailsRecordEntity">
|
<select id="findHistoryInquiryRecord" resultType="doctor.domain.entity.InquiryDetailsRecordEntity">
|
||||||
|
@ -27,6 +46,30 @@
|
||||||
from inquiry_details_record
|
from inquiry_details_record
|
||||||
</select>
|
</select>
|
||||||
<select id="findDoctorUserNameByDoctorId" resultType="java.lang.String">
|
<select id="findDoctorUserNameByDoctorId" resultType="java.lang.String">
|
||||||
select user_name from doctor where doctor_id=#{doctorId}
|
select user_name from doctor where department_id=#{doctorId}
|
||||||
|
</select>
|
||||||
|
<select id="findDoctorInfo" resultType="doctor.domain.vo.DoctorVo">
|
||||||
|
select * from doctor where department_id=#{doctorId}
|
||||||
|
</select>
|
||||||
|
<select id="findInquiryRecordById" resultType="doctor.domain.entity.InquiryRecordEntity">
|
||||||
|
SELECT inquiry_record.id as id,
|
||||||
|
inquiry_record.user_id as userId,
|
||||||
|
inquiry_record.doctor_id as doctorId,
|
||||||
|
inquiry_record.status as status,
|
||||||
|
inquiry_record.inquiry_time as inquiryTime,
|
||||||
|
inquiry_record.create_time as createTime
|
||||||
|
FROM inquiry_record
|
||||||
|
WHERE inquiry_record.id = #{recordId}
|
||||||
|
and inquiry_record.status = #{status}
|
||||||
|
ORDER BY inquiry_record.create_time DESC LIMIT 1
|
||||||
|
</select>
|
||||||
|
<select id="getDoctorAskCount" resultType="doctor.domain.entity.DoctorAskCount">
|
||||||
|
SELECT
|
||||||
|
doctor_ask_count.doctor_id as doctorId,
|
||||||
|
doctor_ask_count.number as number,
|
||||||
|
doctor_ask_count.update_time as updateTime,
|
||||||
|
doctor_ask_count.create_time as createTime
|
||||||
|
FROM doctor_ask_count
|
||||||
|
WHERE doctor_ask_count.doctor_id = #{doctorId}
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -15,11 +15,11 @@ spring:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 101.34.77.101:8848
|
server-addr: 101.34.77.101:8848
|
||||||
namespace: 9de208a6-cb30-41ae-a880-78196c99c050
|
namespace: 7e1e997d-5fa4-4f84-9f48-3e0adf830a37
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 101.34.77.101:8848
|
server-addr: 101.34.77.101:8848
|
||||||
namespace: 9de208a6-cb30-41ae-a880-78196c99c050
|
namespace: 7e1e997d-5fa4-4f84-9f48-3e0adf830a37
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -15,11 +15,11 @@ spring:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 101.34.77.101:8848
|
server-addr: 101.34.77.101:8848
|
||||||
namespace: 9de208a6-cb30-41ae-a880-78196c99c050
|
namespace: 7e1e997d-5fa4-4f84-9f48-3e0adf830a37
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 101.34.77.101:8848
|
server-addr: 101.34.77.101:8848
|
||||||
namespace: 9de208a6-cb30-41ae-a880-78196c99c050
|
namespace: 7e1e997d-5fa4-4f84-9f48-3e0adf830a37
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -15,11 +15,11 @@ spring:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 101.34.77.101:8848
|
server-addr: 101.34.77.101:8848
|
||||||
namespace: 9de208a6-cb30-41ae-a880-78196c99c050
|
namespace: 7e1e997d-5fa4-4f84-9f48-3e0adf830a37
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 101.34.77.101:8848
|
server-addr: 101.34.77.101:8848
|
||||||
namespace: 9de208a6-cb30-41ae-a880-78196c99c050
|
namespace: 7e1e997d-5fa4-4f84-9f48-3e0adf830a37
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
Loading…
Reference in New Issue