功能完善

master
Yang Haoyu 2023-10-24 19:15:58 +08:00
parent 11abf54521
commit 4a96df6661
16 changed files with 475 additions and 28 deletions

View File

@ -0,0 +1,47 @@
package com.grail.publice.domain;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* @ClassName : Comment
* @Description :
* @Author : YHY
* @Date: 2023-10-24 14:40
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Comment {
/**
* Id
*/
private Integer commentId;
/**
*
*/
private String commentContent;
/**
*
*/
private Date commentTime;
/**
* Id
*/
private Integer userId;
/**
*
*/
private Integer commentSpeciality;
/**
*
*/
private Integer commentSatisfied;
/**
* id
*/
private Integer giftId;
}

View File

@ -0,0 +1,33 @@
package com.grail.publice.domain;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @ClassName : Gift
* @Description :
* @Author : YHY
* @Date: 2023-10-24 14:46
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Gift {
/**
* Id
*/
private Integer giftId;
/**
*
*/
private String giftName;
/**
*
*/
private Integer giftPrice;
/**
*
*/
private String giftPicture;
}

View File

@ -0,0 +1,55 @@
package com.grail.publice.domain.response;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* @ClassName : ResponseComment
* @Description :
* @Author : YHY
* @Date: 2023-10-24 15:29
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResponseComment {
/**
* Id
*/
private Integer commentId;
/**
*
*/
private String commentContent;
/**
*
*/
private Date commentTime;
/**
* Id
*/
private Integer userId;
/**
*
*/
private String userName;
/**
*
*/
private Integer commentSpeciality;
/**
*
*/
private Integer commentSatisfied;
/**
* id
*/
private Integer giftId;
/**
*
*/
private String giftName;
}

View File

@ -0,0 +1,71 @@
package com.grail.publice.domain.response;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
/**
* @ClassName : ResponseDoctor
* @Description :
* @Author : YHY
* @Date: 2023-10-24 13:49
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResponseDoctor {
/**
*Id
*/
private Integer doctorId;
/**
*
*/
private String dockerName;
/**
*
*/
private String doctorHospital;
/**
*
*/
private String doctorCareer;
/**
*
*/
private String doctorPicture;
/**
*
*/
private String personalProfile;
/**
*
*/
private String doctorField;
/**
* Id
*/
private Integer departmentId;
/**
*
*/
private String departmentName;
/**
*
*/
private Integer replyStatus;
/**
*
*/
private String replyContent;
/**
* Id
*/
private Integer userId;
/**
*
*/
private BigDecimal consultationPrice;
}

View File

@ -0,0 +1,33 @@
package com.grail.publice.domain.response;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @ClassName : ResponseGift
* @Description :
* @Author : YHY
* @Date: 2023-10-24 16:28
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResponseGift {
/**
* Id
*/
private Integer giftId;
/**
*
*/
private String giftName;
/**
*
*/
private Integer giftPrice;
/**
*
*/
private String giftPicture;
}

View File

@ -0,0 +1,67 @@
package com.grail.doctor.publice.controller;
import com.grail.common.core.domain.Result;
import com.grail.doctor.publice.service.CommentServlce;
import com.grail.publice.domain.Gift;
import com.grail.publice.domain.response.ResponseComment;
import lombok.extern.log4j.Log4j2;
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.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
* @ClassName : CommentController
* @Description :
* @Author : YHY
* @Date: 2023-10-24 14:53
*/
@RestController
@RequestMapping("/comment")
@Log4j2
public class CommentController {
@Autowired
private CommentServlce commentServlce;
@Autowired
private HttpServletRequest request;
/**
* @Description: &&
No such property: code for class: Script1
* @return: com.grail.common.core.domain.Result<java.util.List<com.grail.publice.domain.response.ResponseComment>>
* @Author: YHY
* @Updator: YHY
* @Date 2023/10/24 15:37
*/
@GetMapping("/commentList")
public Result<List<ResponseComment>> commentList(){
log.info("功能名称查询患者问诊评论信息根据用户选择查科室及详细功能进行排序请求URL【{}】,请求方法:【{}】",request.getRequestURI(),
request.getMethod());
Result<List<ResponseComment>> result = commentServlce.commentList();
log.info("功能名称查询患者问诊评论信息根据用户选择查科室及详细功能进行排序请求URL【{}】,请求方法:【{}】",request.getRequestURI(),
request.getMethod());
return result;
}
/**
* @Description:
No such property: code for class: Script1
* @return: com.grail.common.core.domain.Result<java.util.List<com.grail.publice.domain.Gift>>
* @Author: YHY
* @Updator: YHY
* @Date 2023/10/24 16:26
*/
@GetMapping("/giftList")
public Result<List<Gift>> giftList(){
log.info("功能名称查询礼物记录根据用户选择查科室及详细功能进行排序请求URL【{}】,请求方法:【{}】",request.getRequestURI(),
request.getMethod());
Result<List<Gift>> result = commentServlce.giftList();
log.info("功能名称查询礼物记录根据用户选择查科室及详细功能进行排序请求URL【{}】,请求方法:【{}】",request.getRequestURI(),
request.getMethod());
return result;
}
}

View File

@ -36,7 +36,7 @@ public class ConsultationController {
* @Updator: YHY
* @Date 2023/10/19 22:12
*/
@PostMapping("/consultationList")
@GetMapping("/consultationList")
public Result<List<Consultation>> consultationList(){
log.info("功能名称问诊聊天详情数据请求URL【{}】,请求方法:【{}】",request.getRequestURI(),
request.getMethod());

View File

@ -1,13 +1,17 @@
package com.grail.doctor.publice.controller;
import com.alibaba.fastjson.JSONObject;
import com.grail.common.core.domain.Result;
import com.grail.doctor.publice.service.DoctorService;
import com.grail.publice.domain.Consultation;
import com.grail.publice.domain.Doctor;
import com.grail.publice.domain.request.RequestDoctor;
import com.grail.publice.domain.response.ResponseDoctor;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
@ -18,9 +22,12 @@ import java.util.List;
*/
@RestController
@RequestMapping("/doctor")
@Log4j2
public class DoctorController {
@Autowired
private DoctorService doctorService;
@Autowired
private HttpServletRequest request;
/**
* @Description:
@ -30,9 +37,32 @@ public class DoctorController {
* @Updator: YHY
* @Date 2023/10/22 15:40
*/
@PostMapping("/doctorList")
public Result<List<Doctor>> doctorList(){
Result<List<Doctor>> result = doctorService.doctorList();
@GetMapping("/doctorList")
public Result<List<ResponseDoctor>> doctorList(@RequestBody RequestDoctor requestDoctor){
log.info("功能名称查询医生信息根据用户选择查科室及详细功能进行排序请求URL【{}】,请求方法:【{}】,请求参数:【{}】",request.getRequestURI(),
request.getMethod(),requestDoctor);
Result<List<ResponseDoctor>> result = doctorService.doctorList(requestDoctor);
log.info("功能名称查询医生信息根据用户选择查科室及详细功能进行排序请求URL【{}】,请求方法:【{}】,响应结果:【{}】",request.getRequestURI(),
request.getMethod(), JSONObject.toJSONString(result));
return result;
}
/**
* @Description:Id
No such property: code for class: Script1
* @return: com.grail.common.core.domain.Result<com.grail.publice.domain.response.ResponseDoctor>
* @Author: YHY
* @Updator: YHY
* @Date 2023/10/24 14:07
*/
@GetMapping("/findDoctorById/{doctorId}")
public Result<ResponseDoctor> findDoctorById(@PathVariable("doctorId") Integer doctorId){
log.info("功能名称根据Id查询医生详细信息请求URL【{}】,请求方法:【{}】,请求参数:【{}】",request.getRequestURI(),
request.getMethod(),doctorId);
Result<ResponseDoctor> result = doctorService.findDoctorById(doctorId);
log.info("功能名称根据Id查询医生详细信息请求URL【{}】,请求方法:【{}】,响应结果:【{}】",request.getRequestURI(),
request.getMethod(), JSONObject.toJSONString(result));
return result;
}
}

View File

@ -0,0 +1,20 @@
package com.grail.doctor.publice.mapper;
import com.grail.publice.domain.Gift;
import com.grail.publice.domain.response.ResponseComment;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @ClassName : CommentMapper
* @Description :
* @Author : YHY
* @Date: 2023-10-24 15:25
*/
@Mapper
public interface CommentMapper {
List<ResponseComment> commentList();
List<Gift> giftList();
}

View File

@ -1,7 +1,11 @@
package com.grail.doctor.publice.mapper;
import com.grail.common.core.domain.Result;
import com.grail.publice.domain.Doctor;
import com.grail.publice.domain.request.RequestDoctor;
import com.grail.publice.domain.response.ResponseDoctor;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -13,5 +17,7 @@ import java.util.List;
*/
@Mapper
public interface DoctorMapper {
List<Doctor> doctorList();
List<ResponseDoctor> doctorList(RequestDoctor requestDoctor);
Result<ResponseDoctor> findDoctorById(@Param("doctorId") Integer doctorId);
}

View File

@ -0,0 +1,19 @@
package com.grail.doctor.publice.service;
import com.grail.common.core.domain.Result;
import com.grail.publice.domain.Gift;
import com.grail.publice.domain.response.ResponseComment;
import java.util.List;
/**
* @ClassName : CommentServlce
* @Description :
* @Author : YHY
* @Date: 2023-10-24 15:23
*/
public interface CommentServlce {
Result<List<ResponseComment>> commentList();
Result<List<Gift>> giftList();
}

View File

@ -2,6 +2,8 @@ package com.grail.doctor.publice.service;
import com.grail.common.core.domain.Result;
import com.grail.publice.domain.Doctor;
import com.grail.publice.domain.request.RequestDoctor;
import com.grail.publice.domain.response.ResponseDoctor;
import java.util.List;
@ -12,5 +14,7 @@ import java.util.List;
* @Date: 2023-10-22 10:09
*/
public interface DoctorService {
Result<List<Doctor>> doctorList();
Result<List<ResponseDoctor>> doctorList(RequestDoctor requestDoctor);
Result<ResponseDoctor> findDoctorById(Integer doctorId);
}

View File

@ -0,0 +1,35 @@
package com.grail.doctor.publice.service.impl;
import com.grail.common.core.domain.Result;
import com.grail.doctor.publice.mapper.CommentMapper;
import com.grail.doctor.publice.service.CommentServlce;
import com.grail.publice.domain.Gift;
import com.grail.publice.domain.response.ResponseComment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @ClassName : CommentServlceimpl
* @Description :
* @Author : YHY
* @Date: 2023-10-24 15:23
*/
@Service
public class CommentServlceimpl implements CommentServlce {
@Autowired
private CommentMapper commentMapper;
@Override
public Result<List<ResponseComment>> commentList() {
List<ResponseComment> list = commentMapper.commentList();
return Result.success(list);
}
@Override
public Result<List<Gift>> giftList() {
List<Gift> list = commentMapper.giftList();
return Result.success(list);
}
}

View File

@ -4,8 +4,11 @@ import com.grail.common.core.domain.Result;
import com.grail.doctor.publice.mapper.DoctorMapper;
import com.grail.doctor.publice.service.DoctorService;
import com.grail.publice.domain.Doctor;
import com.grail.publice.domain.request.RequestDoctor;
import com.grail.publice.domain.response.ResponseDoctor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
@ -21,8 +24,13 @@ public class DoctorServiceimpl implements DoctorService {
private DoctorMapper doctorMapper;
@Override
public Result<List<Doctor>> doctorList() {
List<Doctor> list = doctorMapper.doctorList();
public Result<List<ResponseDoctor>> doctorList(RequestDoctor requestDoctor) {
List<ResponseDoctor> list = doctorMapper.doctorList(requestDoctor);
return Result.success(list);
}
@Override
public Result<ResponseDoctor> findDoctorById(Integer doctorId) {
return doctorMapper.findDoctorById(doctorId);
}
}

View File

@ -0,0 +1,13 @@
<?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.grail.doctor.publice.mapper.CommentMapper">
<select id="commentList" resultType="com.grail.publice.domain.response.ResponseComment">
select t_comment.*,gift_name,user_name from t_comment left join
t_gift on t_comment.gift_id=t_gift.gift_id left join t_user
on t_comment.user_id=t_user.user_id
</select>
<select id="giftList" resultType="com.grail.publice.domain.Gift">
select * from t_gift
</select>
</mapper>

View File

@ -2,24 +2,30 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.grail.doctor.publice.mapper.DoctorMapper">
<select id="doctorList" resultType="com.grail.publice.domain.Doctor">
<select id="doctorList" resultType="com.grail.publice.domain.response.ResponseDoctor">
select t_doctor.*,department_name from t_doctor left join
t_department on t_doctor.department_id=t_department.department_id
<if test="sort == 1">
order by doctor_id <if test="key==1"> desc </if>
<if test="key!=1"> asc </if>
</if>
<if test="sort == 2">
order by department_name <if test="key==1"> desc </if>
<if test="key!=1"> asc </if>
</if>
<if test="sort == 3">
order by department_name <if test="key==1"> desc </if>
<if test="key!=1"> asc </if>
</if>
<if test="sort == 4">
order by consultation_price <if test="key==1"> desc </if>
<if test="key!=1"> asc </if>
</if>
<where>
<if test="sort == 1">
order by doctor_id <if test="key==1"> desc </if>
<if test="key!=1"> asc </if>
</if>
<if test="sort == 2">
order by department_name <if test="key==1"> desc </if>
<if test="key!=1"> asc </if>
</if>
<if test="sort == 3">
order by department_name <if test="key==1"> desc </if>
<if test="key!=1"> asc </if>
</if>
<if test="sort == 4">
order by consultation_price <if test="key==1"> desc </if>
<if test="key!=1"> asc </if>
</if>
</where>
</select>
<select id="findDoctorById" resultType="com.grail.publice.domain.response.ResponseDoctor">
select t_doctor.*,department_name from t_doctor left join
t_department on t_doctor.department_id=t_department.department_id where doctor_id=#{doctorId}
</select>
</mapper>