diff --git a/tcm/src/main/java/com/ccsens/tcm/api/DoctorController.java b/tcm/src/main/java/com/ccsens/tcm/api/DoctorController.java new file mode 100644 index 00000000..33fc0642 --- /dev/null +++ b/tcm/src/main/java/com/ccsens/tcm/api/DoctorController.java @@ -0,0 +1,46 @@ +package com.ccsens.tcm.api; + +import com.ccsens.cloudutil.annotation.MustLogin; +import com.ccsens.tcm.bean.dto.DoctorDto; +import com.ccsens.tcm.bean.vo.DoctorVo; +import com.ccsens.tcm.service.IDoctorService; +import com.ccsens.util.JsonResponse; +import com.ccsens.util.bean.dto.QueryDto; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import lombok.extern.slf4j.Slf4j; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import java.util.List; + +/** + * @description: + * @author: whj + * @time: 2021/5/8 11:46 + */ +@Api(tags = "医生接口") +@RestController +@RequestMapping("/doctor") +@Slf4j +public class DoctorController { + + @Resource + private IDoctorService doctorService; + + + @MustLogin + @ApiOperation(value = "查询医生信息", notes = "查询医生信息") + @RequestMapping(value = "/simpleMsg", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) + public JsonResponse> selPatientInformationList(@ApiParam @Validated @RequestBody QueryDto params) { + log.info("查询医生信息:{}",params); + List doctors = doctorService.queryDoctor(params.getParam(), params.getUserId()); + log.info("查询医生信息成功"); + return JsonResponse.newInstance().ok(doctors); + } +} diff --git a/tcm/src/main/java/com/ccsens/tcm/api/PatientController.java b/tcm/src/main/java/com/ccsens/tcm/api/PatientController.java index 46fe5b40..82a83cb6 100644 --- a/tcm/src/main/java/com/ccsens/tcm/api/PatientController.java +++ b/tcm/src/main/java/com/ccsens/tcm/api/PatientController.java @@ -5,6 +5,7 @@ import com.ccsens.tcm.bean.dto.PatientDto; import com.ccsens.tcm.bean.vo.PatientVo; import com.ccsens.tcm.bean.vo.QuestionVo; import com.ccsens.tcm.service.IPatientService; +import com.ccsens.tcm.uitl.Constant; import com.ccsens.util.JsonResponse; import com.ccsens.util.bean.dto.QueryDto; import com.github.pagehelper.PageInfo; @@ -12,6 +13,7 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -52,7 +54,7 @@ public class PatientController { return JsonResponse.newInstance().ok(); } @MustLogin - @ApiOperation(value = "查询患者基本信息", notes = "w:查询患者基本信息") + @ApiOperation(value = "查询患者信息", notes = "w:查询患者信息") @RequestMapping(value = "/selPatientMes", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) public JsonResponse> selPatientInformationList(@ApiParam @Validated @RequestBody QueryDto params) { log.info("查询患者基本信息:{}",params); @@ -62,6 +64,8 @@ public class PatientController { } + + @MustLogin @ApiOperation(value = "保存患者病例信息", notes = "w:提交患者的相关病例信息") @RequestMapping(value = "/saveCaseMes", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) diff --git a/tcm/src/main/java/com/ccsens/tcm/api/StatisticalAnalysisController.java b/tcm/src/main/java/com/ccsens/tcm/api/StatisticalAnalysisController.java index bf9c038e..441076b9 100644 --- a/tcm/src/main/java/com/ccsens/tcm/api/StatisticalAnalysisController.java +++ b/tcm/src/main/java/com/ccsens/tcm/api/StatisticalAnalysisController.java @@ -94,6 +94,17 @@ public class StatisticalAnalysisController { log.info("临近任务统计:{}",params); return JsonResponse.newInstance().ok(recentAnalysisVOPageInfo); } + + @MustLogin + @ApiOperation(value = "同一个医院的所有医生的临近任务", notes = "1007:") + @RequestMapping(value = "/hospitalAdjacentTasks", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) + public JsonResponse> hospitalAdjacentTasks(@ApiParam @Validated @RequestBody QueryDto params){ + log.info("临近任务统计:{}",params); + PageInfo recentAnalysisVOPageInfo=patientService.hospitalAdjacentTasks(params.getParam(),params.getUserId()); + log.info("临近任务统计:{}",params); + return JsonResponse.newInstance().ok(recentAnalysisVOPageInfo); + } + @MustLogin @ApiOperation(value = "进行中患者进度", notes = "1007:") @RequestMapping(value = "/selPatientProgress", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) diff --git a/tcm/src/main/java/com/ccsens/tcm/bean/dto/DoctorDto.java b/tcm/src/main/java/com/ccsens/tcm/bean/dto/DoctorDto.java new file mode 100644 index 00000000..6da4bd23 --- /dev/null +++ b/tcm/src/main/java/com/ccsens/tcm/bean/dto/DoctorDto.java @@ -0,0 +1,24 @@ +package com.ccsens.tcm.bean.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @description: + * @author: whj + * @time: 2021/5/8 11:48 + */ +public class DoctorDto { + + @Data + @ApiModel("查询医院/全部主治医生-请求") + public static class Simple { + @ApiModelProperty("查看权限 1:自己所在医院 2:全部") + private byte authority = 1; + @ApiModelProperty("角色 0:主治医生 1:项目助理 2:医院负责人 3:课题助理 4课题负责人") + private byte role = 0; + @ApiModelProperty("医院ID") + private Long hospitalId; + } +} diff --git a/tcm/src/main/java/com/ccsens/tcm/bean/dto/PatientDto.java b/tcm/src/main/java/com/ccsens/tcm/bean/dto/PatientDto.java index 708ffa52..41a81324 100644 --- a/tcm/src/main/java/com/ccsens/tcm/bean/dto/PatientDto.java +++ b/tcm/src/main/java/com/ccsens/tcm/bean/dto/PatientDto.java @@ -36,20 +36,31 @@ public class PatientDto { @Data @ApiModel("查询患者基本信息") public static class SelPatientList { + + @ApiModelProperty("病患id") private Long id; + + @ApiModelProperty("医院Id") + private Long hospitalId; @ApiModelProperty("研究编号") private String code; @ApiModelProperty("住院号") private String hospitalization; @ApiModelProperty("对照组id") private Long inpatientId; - @ApiModelProperty("录入状态:0:新建 1:数据搜集中 2数据搜集完成 3数据搜集超时 4:废弃") + @ApiModelProperty("录入状态:0:新建 1:数据搜集中 2数据搜集完成 3数据搜集超时 4:废弃 5.审核通过 6已完结") private Byte inputStatus; - @ApiModelProperty("医生名字") - private String doctorName; + @ApiModelProperty("医生Id") + private Long doctorId; @ApiModelProperty("查看权限 0:仅自己 1:医院 2:全部") private byte queryAuthority = 0; + @ApiModelProperty("开始时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date startTime; + @ApiModelProperty("结束时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date endTime; @Min(1) @ApiModelProperty("当前页") private Integer pageNum=1; @@ -57,9 +68,10 @@ public class PatientDto { @Max(20) @ApiModelProperty("每页数量") private Integer pageSize=10; - @ApiModelProperty("医院id 前端不传") + @ApiModelProperty("医院id") private List hospitalIds = new ArrayList<>(); } + @Data @ApiModel("保存患者的多个病例信息") public static class saveCaseMes { @@ -166,7 +178,7 @@ public class PatientDto { @ApiModelProperty("病人id") private Long id; @NotNull - @ApiModelProperty("录入状态:0:新建 1:数据搜集中 2数据搜集完成 3数据搜集超时 4:废弃") + @ApiModelProperty("录入状态 0新建 1数据搜集中 2数据搜集完成 3数据搜集超时 4废弃 5审核通过 6已结算") private Byte inputStatus; } } diff --git a/tcm/src/main/java/com/ccsens/tcm/bean/po/Doctor.java b/tcm/src/main/java/com/ccsens/tcm/bean/po/Doctor.java index d90678f2..c70f739c 100644 --- a/tcm/src/main/java/com/ccsens/tcm/bean/po/Doctor.java +++ b/tcm/src/main/java/com/ccsens/tcm/bean/po/Doctor.java @@ -10,6 +10,8 @@ public class Doctor implements Serializable { private Long hospitalId; + private Byte role; + private Long userId; private String remark; @@ -48,6 +50,14 @@ public class Doctor implements Serializable { this.hospitalId = hospitalId; } + public Byte getRole() { + return role; + } + + public void setRole(Byte role) { + this.role = role; + } + public Long getUserId() { return userId; } @@ -105,6 +115,7 @@ public class Doctor implements Serializable { sb.append(", id=").append(id); sb.append(", name=").append(name); sb.append(", hospitalId=").append(hospitalId); + sb.append(", role=").append(role); sb.append(", userId=").append(userId); sb.append(", remark=").append(remark); sb.append(", operator=").append(operator); diff --git a/tcm/src/main/java/com/ccsens/tcm/bean/po/DoctorExample.java b/tcm/src/main/java/com/ccsens/tcm/bean/po/DoctorExample.java index 8d3d6480..000ad112 100644 --- a/tcm/src/main/java/com/ccsens/tcm/bean/po/DoctorExample.java +++ b/tcm/src/main/java/com/ccsens/tcm/bean/po/DoctorExample.java @@ -295,6 +295,66 @@ public class DoctorExample { return (Criteria) this; } + public Criteria andRoleIsNull() { + addCriterion("role is null"); + return (Criteria) this; + } + + public Criteria andRoleIsNotNull() { + addCriterion("role is not null"); + return (Criteria) this; + } + + public Criteria andRoleEqualTo(Byte value) { + addCriterion("role =", value, "role"); + return (Criteria) this; + } + + public Criteria andRoleNotEqualTo(Byte value) { + addCriterion("role <>", value, "role"); + return (Criteria) this; + } + + public Criteria andRoleGreaterThan(Byte value) { + addCriterion("role >", value, "role"); + return (Criteria) this; + } + + public Criteria andRoleGreaterThanOrEqualTo(Byte value) { + addCriterion("role >=", value, "role"); + return (Criteria) this; + } + + public Criteria andRoleLessThan(Byte value) { + addCriterion("role <", value, "role"); + return (Criteria) this; + } + + public Criteria andRoleLessThanOrEqualTo(Byte value) { + addCriterion("role <=", value, "role"); + return (Criteria) this; + } + + public Criteria andRoleIn(List values) { + addCriterion("role in", values, "role"); + return (Criteria) this; + } + + public Criteria andRoleNotIn(List values) { + addCriterion("role not in", values, "role"); + return (Criteria) this; + } + + public Criteria andRoleBetween(Byte value1, Byte value2) { + addCriterion("role between", value1, value2, "role"); + return (Criteria) this; + } + + public Criteria andRoleNotBetween(Byte value1, Byte value2) { + addCriterion("role not between", value1, value2, "role"); + return (Criteria) this; + } + public Criteria andUserIdIsNull() { addCriterion("user_id is null"); return (Criteria) this; diff --git a/tcm/src/main/java/com/ccsens/tcm/bean/po/PatientInformation.java b/tcm/src/main/java/com/ccsens/tcm/bean/po/PatientInformation.java index 3b1e7515..bdef5d2a 100644 --- a/tcm/src/main/java/com/ccsens/tcm/bean/po/PatientInformation.java +++ b/tcm/src/main/java/com/ccsens/tcm/bean/po/PatientInformation.java @@ -18,6 +18,10 @@ public class PatientInformation implements Serializable { private Long hospitalId; + private Long checkId; + + private Long passId; + private Long userId; private Date createdAt; @@ -84,6 +88,22 @@ public class PatientInformation implements Serializable { this.hospitalId = hospitalId; } + public Long getCheckId() { + return checkId; + } + + public void setCheckId(Long checkId) { + this.checkId = checkId; + } + + public Long getPassId() { + return passId; + } + + public void setPassId(Long passId) { + this.passId = passId; + } + public Long getUserId() { return userId; } @@ -129,6 +149,8 @@ public class PatientInformation implements Serializable { sb.append(", age=").append(age); sb.append(", inputStatus=").append(inputStatus); sb.append(", hospitalId=").append(hospitalId); + sb.append(", checkId=").append(checkId); + sb.append(", passId=").append(passId); sb.append(", userId=").append(userId); sb.append(", createdAt=").append(createdAt); sb.append(", updateAt=").append(updateAt); diff --git a/tcm/src/main/java/com/ccsens/tcm/bean/po/PatientInformationExample.java b/tcm/src/main/java/com/ccsens/tcm/bean/po/PatientInformationExample.java index a88221d9..a7da7c8c 100644 --- a/tcm/src/main/java/com/ccsens/tcm/bean/po/PatientInformationExample.java +++ b/tcm/src/main/java/com/ccsens/tcm/bean/po/PatientInformationExample.java @@ -545,6 +545,126 @@ public class PatientInformationExample { return (Criteria) this; } + public Criteria andCheckIdIsNull() { + addCriterion("check_id is null"); + return (Criteria) this; + } + + public Criteria andCheckIdIsNotNull() { + addCriterion("check_id is not null"); + return (Criteria) this; + } + + public Criteria andCheckIdEqualTo(Long value) { + addCriterion("check_id =", value, "checkId"); + return (Criteria) this; + } + + public Criteria andCheckIdNotEqualTo(Long value) { + addCriterion("check_id <>", value, "checkId"); + return (Criteria) this; + } + + public Criteria andCheckIdGreaterThan(Long value) { + addCriterion("check_id >", value, "checkId"); + return (Criteria) this; + } + + public Criteria andCheckIdGreaterThanOrEqualTo(Long value) { + addCriterion("check_id >=", value, "checkId"); + return (Criteria) this; + } + + public Criteria andCheckIdLessThan(Long value) { + addCriterion("check_id <", value, "checkId"); + return (Criteria) this; + } + + public Criteria andCheckIdLessThanOrEqualTo(Long value) { + addCriterion("check_id <=", value, "checkId"); + return (Criteria) this; + } + + public Criteria andCheckIdIn(List values) { + addCriterion("check_id in", values, "checkId"); + return (Criteria) this; + } + + public Criteria andCheckIdNotIn(List values) { + addCriterion("check_id not in", values, "checkId"); + return (Criteria) this; + } + + public Criteria andCheckIdBetween(Long value1, Long value2) { + addCriterion("check_id between", value1, value2, "checkId"); + return (Criteria) this; + } + + public Criteria andCheckIdNotBetween(Long value1, Long value2) { + addCriterion("check_id not between", value1, value2, "checkId"); + return (Criteria) this; + } + + public Criteria andPassIdIsNull() { + addCriterion("pass_id is null"); + return (Criteria) this; + } + + public Criteria andPassIdIsNotNull() { + addCriterion("pass_id is not null"); + return (Criteria) this; + } + + public Criteria andPassIdEqualTo(Long value) { + addCriterion("pass_id =", value, "passId"); + return (Criteria) this; + } + + public Criteria andPassIdNotEqualTo(Long value) { + addCriterion("pass_id <>", value, "passId"); + return (Criteria) this; + } + + public Criteria andPassIdGreaterThan(Long value) { + addCriterion("pass_id >", value, "passId"); + return (Criteria) this; + } + + public Criteria andPassIdGreaterThanOrEqualTo(Long value) { + addCriterion("pass_id >=", value, "passId"); + return (Criteria) this; + } + + public Criteria andPassIdLessThan(Long value) { + addCriterion("pass_id <", value, "passId"); + return (Criteria) this; + } + + public Criteria andPassIdLessThanOrEqualTo(Long value) { + addCriterion("pass_id <=", value, "passId"); + return (Criteria) this; + } + + public Criteria andPassIdIn(List values) { + addCriterion("pass_id in", values, "passId"); + return (Criteria) this; + } + + public Criteria andPassIdNotIn(List values) { + addCriterion("pass_id not in", values, "passId"); + return (Criteria) this; + } + + public Criteria andPassIdBetween(Long value1, Long value2) { + addCriterion("pass_id between", value1, value2, "passId"); + return (Criteria) this; + } + + public Criteria andPassIdNotBetween(Long value1, Long value2) { + addCriterion("pass_id not between", value1, value2, "passId"); + return (Criteria) this; + } + public Criteria andUserIdIsNull() { addCriterion("user_id is null"); return (Criteria) this; diff --git a/tcm/src/main/java/com/ccsens/tcm/bean/vo/DoctorVo.java b/tcm/src/main/java/com/ccsens/tcm/bean/vo/DoctorVo.java index f88e2095..003cf19d 100644 --- a/tcm/src/main/java/com/ccsens/tcm/bean/vo/DoctorVo.java +++ b/tcm/src/main/java/com/ccsens/tcm/bean/vo/DoctorVo.java @@ -30,4 +30,13 @@ public class DoctorVo { @ApiModelProperty("医院类型 0:项目 1:医院") private byte hospitalType; } + + @ApiModel("查询医院/全部主治医生-响应") + @Data + public static class Simple { + @ApiModelProperty("医生ID") + private Long id; + @ApiModelProperty("医生名字") + private String name; + } } diff --git a/tcm/src/main/java/com/ccsens/tcm/bean/vo/StatisticVo.java b/tcm/src/main/java/com/ccsens/tcm/bean/vo/StatisticVo.java index 46be17e6..248619a7 100644 --- a/tcm/src/main/java/com/ccsens/tcm/bean/vo/StatisticVo.java +++ b/tcm/src/main/java/com/ccsens/tcm/bean/vo/StatisticVo.java @@ -119,6 +119,8 @@ public class StatisticVo { private String task; @ApiModelProperty("研究编号") private String code; + @ApiModelProperty("医生名字") + private String doctorName; } @Data @ApiModel("患者进度返回参数") diff --git a/tcm/src/main/java/com/ccsens/tcm/config/SpringConfig.java b/tcm/src/main/java/com/ccsens/tcm/config/SpringConfig.java index 2482b4ad..1a7ca19d 100644 --- a/tcm/src/main/java/com/ccsens/tcm/config/SpringConfig.java +++ b/tcm/src/main/java/com/ccsens/tcm/config/SpringConfig.java @@ -22,6 +22,7 @@ import javax.sql.DataSource; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.List; +import java.util.TimeZone; @Configuration //public class SpringConfig extends WebMvcConfigurationSupport { @@ -52,13 +53,14 @@ public class SpringConfig implements WebMvcConfigurer { mediaTypeList.add(MediaType.APPLICATION_JSON_UTF8); converter.setSupportedMediaTypes(mediaTypeList); - //converter.setObjectMapper(); + // converter.setObjectMapper(); ObjectMapper objectMapper = new ObjectMapper(); SimpleModule simpleModule = new SimpleModule(); simpleModule.addSerializer(Long.class, ToStringSerializer.instance); simpleModule.addSerializer(Long.TYPE, ToStringSerializer.instance); objectMapper.registerModule(simpleModule); objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + objectMapper.setTimeZone(TimeZone.getTimeZone("GMT+8")); converter.setObjectMapper(objectMapper); return converter; diff --git a/tcm/src/main/java/com/ccsens/tcm/persist/dao/DoctorDao.java b/tcm/src/main/java/com/ccsens/tcm/persist/dao/DoctorDao.java index 0158d55a..dceef2e5 100644 --- a/tcm/src/main/java/com/ccsens/tcm/persist/dao/DoctorDao.java +++ b/tcm/src/main/java/com/ccsens/tcm/persist/dao/DoctorDao.java @@ -1,5 +1,6 @@ package com.ccsens.tcm.persist.dao; +import com.ccsens.tcm.bean.dto.DoctorDto; import com.ccsens.tcm.bean.vo.DoctorVo; import com.ccsens.tcm.persist.mapper.DoctorMapper; import org.apache.ibatis.annotations.Param; @@ -18,4 +19,12 @@ public interface DoctorDao extends DoctorMapper { * @return 医生+医院信息 */ List queryDetail(@Param("userId") Long userId); + + /** + * 查询医生id 和name + * @param param 条件 + * @param userId 根据userId查询医院ID + * @return id name + */ + List querySimple(@Param("param") DoctorDto.Simple param, @Param("userId") Long userId); } diff --git a/tcm/src/main/java/com/ccsens/tcm/persist/dao/PatientDao.java b/tcm/src/main/java/com/ccsens/tcm/persist/dao/PatientDao.java index 4f3e1530..9805ec17 100644 --- a/tcm/src/main/java/com/ccsens/tcm/persist/dao/PatientDao.java +++ b/tcm/src/main/java/com/ccsens/tcm/persist/dao/PatientDao.java @@ -85,4 +85,12 @@ public interface PatientDao { * @return 生物样本 */ List queryByPatient(@Param("param") BiologicalSamplesDto.QueryByPatient param, @Param("userId") Long userId); + + /** + * 医院所有医生的临近任务 + * @param param 分页 + * @param userId userId + * @return 临近任务 + */ + List hospitalAdjacentTasks(@Param("param") StatisticDto.RecentAnalysisDto param, @Param("userId") Long userId); } diff --git a/tcm/src/main/java/com/ccsens/tcm/service/DoctorService.java b/tcm/src/main/java/com/ccsens/tcm/service/DoctorService.java new file mode 100644 index 00000000..9ff514b3 --- /dev/null +++ b/tcm/src/main/java/com/ccsens/tcm/service/DoctorService.java @@ -0,0 +1,33 @@ +package com.ccsens.tcm.service; + +import com.ccsens.tcm.bean.dto.DoctorDto; +import com.ccsens.tcm.bean.vo.DoctorVo; +import com.ccsens.tcm.persist.dao.DoctorDao; +import com.ccsens.tcm.uitl.Constant; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.List; + +/** + * @description: + * @author: whj + * @time: 2021/5/8 11:49 + */ +@Slf4j +@Service +@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) +public class DoctorService implements IDoctorService { + + @Resource + private DoctorDao doctorDao; + + @Override + public List queryDoctor(DoctorDto.Simple param, Long userId) { + + return doctorDao.querySimple(param, userId); + } +} diff --git a/tcm/src/main/java/com/ccsens/tcm/service/IDoctorService.java b/tcm/src/main/java/com/ccsens/tcm/service/IDoctorService.java new file mode 100644 index 00000000..51f86211 --- /dev/null +++ b/tcm/src/main/java/com/ccsens/tcm/service/IDoctorService.java @@ -0,0 +1,16 @@ +package com.ccsens.tcm.service; + +import com.ccsens.tcm.bean.dto.DoctorDto; +import com.ccsens.tcm.bean.vo.DoctorVo; + +import java.util.List; + +public interface IDoctorService { + /** + * 查询医生信息 + * @param param 查看权限 1:自己所在医院 2:全部 + * @param userId 根据查询者确认医院ID + * @return 医生信息 + */ + List queryDoctor(DoctorDto.Simple param, Long userId); +} diff --git a/tcm/src/main/java/com/ccsens/tcm/service/IPatientService.java b/tcm/src/main/java/com/ccsens/tcm/service/IPatientService.java index 715474ae..c586943b 100644 --- a/tcm/src/main/java/com/ccsens/tcm/service/IPatientService.java +++ b/tcm/src/main/java/com/ccsens/tcm/service/IPatientService.java @@ -90,4 +90,12 @@ public interface IPatientService { * @return 生物样本 */ List queryByPatient(BiologicalSamplesDto.QueryByPatient param, Long userId); + + /** + * 和userId在同一个医院的所有医生的临近任务 + * @param param 分页 + * @param userId userId + * @return 临近任务 + */ + PageInfo hospitalAdjacentTasks(StatisticDto.RecentAnalysisDto param, Long userId); } diff --git a/tcm/src/main/java/com/ccsens/tcm/service/PatientService.java b/tcm/src/main/java/com/ccsens/tcm/service/PatientService.java index cde65129..b3120344 100644 --- a/tcm/src/main/java/com/ccsens/tcm/service/PatientService.java +++ b/tcm/src/main/java/com/ccsens/tcm/service/PatientService.java @@ -269,20 +269,21 @@ public class PatientService implements IPatientService { @Override public PageInfo selPatientInformationList(PatientDto.SelPatientList param, Long userId) { PageHelper.startPage(param.getPageNum(),param.getPageSize()); - if (param.getHospitalIds() == null) { - param.setHospitalIds(new ArrayList<>()); - } - List doctors = doctorDao.queryDetail(userId); - for (DoctorVo.Detail doctor: doctors) { - if (doctor.getHospitalType() == Constant.HOSPITAL_PROJECT) { - param.getHospitalIds().clear(); - break; - } else { - param.getHospitalIds().add(doctor.getHospitalId()); - } - } + if (param.getQueryAuthority() == Constant.QUERY_AUTHORITY_HOSPITAL) { + List doctors = doctorDao.queryDetail(userId); + for (DoctorVo.Detail doctor: doctors) { + if (doctor.getHospitalType() == Constant.HOSPITAL_PROJECT) { + if (param.getQueryAuthority() == Constant.QUERY_AUTHORITY_HOSPITAL) { + param.getHospitalIds().clear(); + break; + } + } else { + param.getHospitalIds().add(doctor.getHospitalId()); + } + } + } List selPatientList= patientDao.selPatientInformationList(param, userId); return new PageInfo<>(selPatientList); } @@ -462,7 +463,11 @@ public class PatientService implements IPatientService { PatientInformation patientInformation=new PatientInformation(); patientInformation.setId(param.getId()); patientInformation.setInputStatus(param.getInputStatus()); - patientInformation.setUserId(userId); + if (param.getInputStatus() == Constant.Patient.STATUS_PASS) { + patientInformation.setCheckId(userId); + } else if (param.getInputStatus() == Constant.Patient.STATUS_CLOSE) { + patientInformation.setPassId(userId); + } patientInformationMapper.updateByExampleSelective(patientInformation,patientInformationExample); } @@ -471,5 +476,14 @@ public class PatientService implements IPatientService { return patientDao.queryByPatient(param, userId); } + @Override + public PageInfo hospitalAdjacentTasks(StatisticDto.RecentAnalysisDto param, Long userId) { + Long disease_time=Long.parseLong(String.valueOf(redisUtil.get(Constant.Redis.DISEASE_TIME))); + param.setTestQuestionsId(disease_time); + PageHelper.startPage(param.getPageNum(),param.getPageSize()); + List recentAnalysisVOS= patientDao.hospitalAdjacentTasks(param,userId); + return new PageInfo<>(recentAnalysisVOS); + } + } diff --git a/tcm/src/main/java/com/ccsens/tcm/uitl/Constant.java b/tcm/src/main/java/com/ccsens/tcm/uitl/Constant.java index 0b62b08f..bed16ecd 100644 --- a/tcm/src/main/java/com/ccsens/tcm/uitl/Constant.java +++ b/tcm/src/main/java/com/ccsens/tcm/uitl/Constant.java @@ -38,6 +38,20 @@ public class Constant { public final static byte SEX_WOMAN = 1; /**医院类型*/ public final static byte HOSPITAL_PROJECT = 0; + /**仅查询自己*/ + public final static byte QUERY_AUTHORITY_SELF = 0; + /**查询医院全部*/ + public final static byte QUERY_AUTHORITY_HOSPITAL = 1; + /**查询全部*/ + public final static byte QUERY_AUTHORITY_ALL = 2; + + + public static class Patient { + /**审核通过*/ + public final static byte STATUS_PASS = 5; + /**已完结*/ + public final static byte STATUS_CLOSE = 6; + } public enum Biological { diff --git a/tcm/src/main/resources/druid-dev.yml b/tcm/src/main/resources/druid-dev.yml index d24b0155..ef9253ea 100644 --- a/tcm/src/main/resources/druid-dev.yml +++ b/tcm/src/main/resources/druid-dev.yml @@ -30,7 +30,7 @@ spring: testWhileIdle: true timeBetweenEvictionRunsMillis: 60000 # url: jdbc:mysql://49.233.89.188:3306/tcm?useUnicode=true&characterEncoding=UTF-8 - url: jdbc:mysql://49.232.6.143:3306/tcm?useUnicode=true&characterEncoding=UTF-8 + url: jdbc:mysql://49.232.6.143:3306/tcm?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true # url: jdbc:mysql://127.0.0.1/mt?useUnicode=true&characterEncoding=UTF-8 username: root validationQuery: SELECT 1 FROM DUAL diff --git a/tcm/src/main/resources/druid-green.yml b/tcm/src/main/resources/druid-green.yml index 9c2a7d09..a903729b 100644 --- a/tcm/src/main/resources/druid-green.yml +++ b/tcm/src/main/resources/druid-green.yml @@ -27,7 +27,7 @@ spring: testOnReturn: false testWhileIdle: true timeBetweenEvictionRunsMillis: 60000 - url: jdbc:mysql://127.0.0.1/tcm?useUnicode=true&characterEncoding=UTF-8 + url: jdbc:mysql://127.0.0.1/tcm?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true username: root validationQuery: SELECT 1 FROM DUAL env: CCSENS_TALL \ No newline at end of file diff --git a/tcm/src/main/resources/druid-test.yml b/tcm/src/main/resources/druid-test.yml index 284a37d7..4e42ef0c 100644 --- a/tcm/src/main/resources/druid-test.yml +++ b/tcm/src/main/resources/druid-test.yml @@ -27,7 +27,7 @@ spring: testOnReturn: false testWhileIdle: true timeBetweenEvictionRunsMillis: 60000 - url: jdbc:mysql://test.tall.wiki/tcm?useUnicode=true&characterEncoding=UTF-8 + url: jdbc:mysql://test.tall.wiki/tcm?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true username: root validationQuery: SELECT 1 FROM DUAL env: CCSENS_TALL diff --git a/tcm/src/main/resources/mapper_dao/DoctorDao.xml b/tcm/src/main/resources/mapper_dao/DoctorDao.xml index 2d54a7b2..d9cecf73 100644 --- a/tcm/src/main/resources/mapper_dao/DoctorDao.xml +++ b/tcm/src/main/resources/mapper_dao/DoctorDao.xml @@ -21,4 +21,19 @@ AND d.rec_status = 0 AND h.rec_status = 0 + \ No newline at end of file diff --git a/tcm/src/main/resources/mapper_dao/PatientDao.xml b/tcm/src/main/resources/mapper_dao/PatientDao.xml index 7797c2f6..2df272c3 100644 --- a/tcm/src/main/resources/mapper_dao/PatientDao.xml +++ b/tcm/src/main/resources/mapper_dao/PatientDao.xml @@ -172,17 +172,26 @@ and tpi.hospitalization like concat('%', #{param.hospitalization}, '%') - + and tpi.code like concat('%',#{param.code}, '%') - + and tpi.inpatient_id= #{param.inpatientId} - + + and tpi.hospital_id= #{param.hospitalId} + + and tpi.input_status= #{param.inputStatus} - - and d.name like concat('%',#{param.doctorName},'%') + + and tpi.created_at >= #{param.startTime} + + + and tpi.created_at <= #{param.endTime} + + + and d.id = #{param.doctorId} @@ -466,7 +475,7 @@ where tbs.rec_status=0 group by th.id - + and tpr.user_id=#{userId} + diff --git a/tcm/src/main/resources/mapper_raw/DoctorMapper.xml b/tcm/src/main/resources/mapper_raw/DoctorMapper.xml index 2b2f101a..73e4cf15 100644 --- a/tcm/src/main/resources/mapper_raw/DoctorMapper.xml +++ b/tcm/src/main/resources/mapper_raw/DoctorMapper.xml @@ -5,6 +5,7 @@ + @@ -71,7 +72,7 @@ - id, name, hospital_id, user_id, remark, operator, created_at, updated_at, rec_status + id, name, hospital_id, role, user_id, remark, operator, created_at, updated_at, rec_status select @@ -109,12 +111,14 @@ insert into t_patient_information (id, hospitalization, code, inpatient_id, age, input_status, - hospital_id, user_id, created_at, - update_at, rec_status) + hospital_id, check_id, pass_id, + user_id, created_at, update_at, + rec_status) values (#{id,jdbcType=BIGINT}, #{hospitalization,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, #{inpatientId,jdbcType=BIGINT}, #{age,jdbcType=INTEGER}, #{inputStatus,jdbcType=TINYINT}, - #{hospitalId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, - #{updateAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}) + #{hospitalId,jdbcType=BIGINT}, #{checkId,jdbcType=BIGINT}, #{passId,jdbcType=BIGINT}, + #{userId,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, #{updateAt,jdbcType=TIMESTAMP}, + #{recStatus,jdbcType=TINYINT}) insert into t_patient_information @@ -140,6 +144,12 @@ hospital_id, + + check_id, + + + pass_id, + user_id, @@ -175,6 +185,12 @@ #{hospitalId,jdbcType=BIGINT}, + + #{checkId,jdbcType=BIGINT}, + + + #{passId,jdbcType=BIGINT}, + #{userId,jdbcType=BIGINT}, @@ -219,6 +235,12 @@ hospital_id = #{record.hospitalId,jdbcType=BIGINT}, + + check_id = #{record.checkId,jdbcType=BIGINT}, + + + pass_id = #{record.passId,jdbcType=BIGINT}, + user_id = #{record.userId,jdbcType=BIGINT}, @@ -245,6 +267,8 @@ age = #{record.age,jdbcType=INTEGER}, input_status = #{record.inputStatus,jdbcType=TINYINT}, hospital_id = #{record.hospitalId,jdbcType=BIGINT}, + check_id = #{record.checkId,jdbcType=BIGINT}, + pass_id = #{record.passId,jdbcType=BIGINT}, user_id = #{record.userId,jdbcType=BIGINT}, created_at = #{record.createdAt,jdbcType=TIMESTAMP}, update_at = #{record.updateAt,jdbcType=TIMESTAMP}, @@ -274,6 +298,12 @@ hospital_id = #{hospitalId,jdbcType=BIGINT}, + + check_id = #{checkId,jdbcType=BIGINT}, + + + pass_id = #{passId,jdbcType=BIGINT}, + user_id = #{userId,jdbcType=BIGINT}, @@ -297,6 +327,8 @@ age = #{age,jdbcType=INTEGER}, input_status = #{inputStatus,jdbcType=TINYINT}, hospital_id = #{hospitalId,jdbcType=BIGINT}, + check_id = #{checkId,jdbcType=BIGINT}, + pass_id = #{passId,jdbcType=BIGINT}, user_id = #{userId,jdbcType=BIGINT}, created_at = #{createdAt,jdbcType=TIMESTAMP}, update_at = #{updateAt,jdbcType=TIMESTAMP},