Browse Source

Merge branch 'pt' of dd.tall.wiki:ccsens_wiki/ccsenscloud into pt

recovery
zy_Java 5 years ago
parent
commit
423e0c6578
  1. 46
      tcm/src/main/java/com/ccsens/tcm/api/DoctorController.java
  2. 6
      tcm/src/main/java/com/ccsens/tcm/api/PatientController.java
  3. 11
      tcm/src/main/java/com/ccsens/tcm/api/StatisticalAnalysisController.java
  4. 24
      tcm/src/main/java/com/ccsens/tcm/bean/dto/DoctorDto.java
  5. 22
      tcm/src/main/java/com/ccsens/tcm/bean/dto/PatientDto.java
  6. 11
      tcm/src/main/java/com/ccsens/tcm/bean/po/Doctor.java
  7. 60
      tcm/src/main/java/com/ccsens/tcm/bean/po/DoctorExample.java
  8. 22
      tcm/src/main/java/com/ccsens/tcm/bean/po/PatientInformation.java
  9. 120
      tcm/src/main/java/com/ccsens/tcm/bean/po/PatientInformationExample.java
  10. 9
      tcm/src/main/java/com/ccsens/tcm/bean/vo/DoctorVo.java
  11. 2
      tcm/src/main/java/com/ccsens/tcm/bean/vo/StatisticVo.java
  12. 4
      tcm/src/main/java/com/ccsens/tcm/config/SpringConfig.java
  13. 9
      tcm/src/main/java/com/ccsens/tcm/persist/dao/DoctorDao.java
  14. 8
      tcm/src/main/java/com/ccsens/tcm/persist/dao/PatientDao.java
  15. 33
      tcm/src/main/java/com/ccsens/tcm/service/DoctorService.java
  16. 16
      tcm/src/main/java/com/ccsens/tcm/service/IDoctorService.java
  17. 8
      tcm/src/main/java/com/ccsens/tcm/service/IPatientService.java
  18. 40
      tcm/src/main/java/com/ccsens/tcm/service/PatientService.java
  19. 14
      tcm/src/main/java/com/ccsens/tcm/uitl/Constant.java
  20. 2
      tcm/src/main/resources/druid-dev.yml
  21. 2
      tcm/src/main/resources/druid-green.yml
  22. 2
      tcm/src/main/resources/druid-test.yml
  23. 15
      tcm/src/main/resources/mapper_dao/DoctorDao.xml
  24. 35
      tcm/src/main/resources/mapper_dao/PatientDao.xml
  25. 43
      tcm/src/main/resources/mapper_raw/DoctorMapper.xml
  26. 44
      tcm/src/main/resources/mapper_raw/PatientInformationMapper.xml

46
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<List<DoctorVo.Simple>> selPatientInformationList(@ApiParam @Validated @RequestBody QueryDto<DoctorDto.Simple> params) {
log.info("查询医生信息:{}",params);
List<DoctorVo.Simple> doctors = doctorService.queryDoctor(params.getParam(), params.getUserId());
log.info("查询医生信息成功");
return JsonResponse.newInstance().ok(doctors);
}
}

6
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<PageInfo<PatientVo.SelPatient>> selPatientInformationList(@ApiParam @Validated @RequestBody QueryDto<PatientDto.SelPatientList> 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"})

11
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<PageInfo<StatisticVo.RecentAnalysisVO>> hospitalAdjacentTasks(@ApiParam @Validated @RequestBody QueryDto<StatisticDto.RecentAnalysisDto> params){
log.info("临近任务统计:{}",params);
PageInfo<StatisticVo.RecentAnalysisVO> 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"})

24
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;
}
}

22
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<Long> 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;
}
}

11
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);

60
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<Byte> values) {
addCriterion("role in", values, "role");
return (Criteria) this;
}
public Criteria andRoleNotIn(List<Byte> 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;

22
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);

120
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<Long> values) {
addCriterion("check_id in", values, "checkId");
return (Criteria) this;
}
public Criteria andCheckIdNotIn(List<Long> 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<Long> values) {
addCriterion("pass_id in", values, "passId");
return (Criteria) this;
}
public Criteria andPassIdNotIn(List<Long> 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;

9
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;
}
}

2
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("患者进度返回参数")

4
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;

9
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<DoctorVo.Detail> queryDetail(@Param("userId") Long userId);
/**
* 查询医生id 和name
* @param param 条件
* @param userId 根据userId查询医院ID
* @return id name
*/
List<DoctorVo.Simple> querySimple(@Param("param") DoctorDto.Simple param, @Param("userId") Long userId);
}

8
tcm/src/main/java/com/ccsens/tcm/persist/dao/PatientDao.java

@ -85,4 +85,12 @@ public interface PatientDao {
* @return 生物样本
*/
List<BiologicalSamplesVo.selBiolog> queryByPatient(@Param("param") BiologicalSamplesDto.QueryByPatient param, @Param("userId") Long userId);
/**
* 医院所有医生的临近任务
* @param param 分页
* @param userId userId
* @return 临近任务
*/
List<StatisticVo.RecentAnalysisVO> hospitalAdjacentTasks(@Param("param") StatisticDto.RecentAnalysisDto param, @Param("userId") Long userId);
}

33
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<DoctorVo.Simple> queryDoctor(DoctorDto.Simple param, Long userId) {
return doctorDao.querySimple(param, userId);
}
}

16
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<DoctorVo.Simple> queryDoctor(DoctorDto.Simple param, Long userId);
}

8
tcm/src/main/java/com/ccsens/tcm/service/IPatientService.java

@ -90,4 +90,12 @@ public interface IPatientService {
* @return 生物样本
*/
List<BiologicalSamplesVo.selBiolog> queryByPatient(BiologicalSamplesDto.QueryByPatient param, Long userId);
/**
* 和userId在同一个医院的所有医生的临近任务
* @param param 分页
* @param userId userId
* @return 临近任务
*/
PageInfo<StatisticVo.RecentAnalysisVO> hospitalAdjacentTasks(StatisticDto.RecentAnalysisDto param, Long userId);
}

40
tcm/src/main/java/com/ccsens/tcm/service/PatientService.java

@ -269,20 +269,21 @@ public class PatientService implements IPatientService {
@Override
public PageInfo<PatientVo.SelPatient> selPatientInformationList(PatientDto.SelPatientList param, Long userId) {
PageHelper.startPage(param.getPageNum(),param.getPageSize());
if (param.getHospitalIds() == null) {
param.setHospitalIds(new ArrayList<>());
}
List<DoctorVo.Detail> 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<DoctorVo.Detail> 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<PatientVo.SelPatient> 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<StatisticVo.RecentAnalysisVO> 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<StatisticVo.RecentAnalysisVO> recentAnalysisVOS= patientDao.hospitalAdjacentTasks(param,userId);
return new PageInfo<>(recentAnalysisVOS);
}
}

14
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 {

2
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

2
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

2
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

15
tcm/src/main/resources/mapper_dao/DoctorDao.xml

@ -21,4 +21,19 @@
AND d.rec_status = 0
AND h.rec_status = 0
</select>
<select id="querySimple" resultType="com.ccsens.tcm.bean.vo.DoctorVo$Simple">
SELECT
id, name
FROM
t_doctor
WHERE
role = #{param.role}
<if test="param.authority == 1">
AND hospital_id IN ( SELECT hospital_id FROM t_doctor WHERE user_id = #{userId} AND rec_status = 0 )
</if>
<if test="param.hospitalId != null and param.hospitalId != 0">
AND hospital_id = #{param.hospitalId}
</if>
AND rec_status = 0
</select>
</mapper>

35
tcm/src/main/resources/mapper_dao/PatientDao.xml

@ -172,17 +172,26 @@
<if test="param.hospitalization!=null and param.hospitalization!='' ">
and tpi.hospitalization like concat('%', #{param.hospitalization}, '%')
</if>
<if test="param.code!=null and param.code!='' ">
<if test="param.code != null and param.code != '' ">
and tpi.code like concat('%',#{param.code}, '%')
</if>
<if test="param.inpatientId!=null and param.inpatientId!=0 ">
<if test="param.inpatientId != null and param.inpatientId != 0 ">
and tpi.inpatient_id= #{param.inpatientId}
</if>
<if test="param.inputStatus!=null and param.inputStatus!=0 ">
<if test="param.hospitalId != null and param.hospitalId != 0 ">
and tpi.hospital_id= #{param.hospitalId}
</if>
<if test="param.inputStatus != null and param.inputStatus != 0 ">
and tpi.input_status= #{param.inputStatus}
</if>
<if test="param.doctorName!=null and param.doctorName!='' ">
and d.name like concat('%',#{param.doctorName},'%')
<if test="param.startTime != null ">
and tpi.created_at &gt;= #{param.startTime}
</if>
<if test="param.endTime != null ">
and tpi.created_at &lt;= #{param.endTime}
</if>
<if test="param.doctorId!=null and param.doctorId!=0 ">
and d.id = #{param.doctorId}
</if>
<choose>
<when test="param.queryAuthority == 0">
@ -466,7 +475,7 @@
where tbs.rec_status=0
group by th.id
</select>
<select id="adjacentTasks" resultType="com.ccsens.tcm.bean.vo.StatisticVo$RecentAnalysisVO">
<sql id="adjacentTasksSql">
select
tpr.id,
(
@ -495,8 +504,9 @@
WHEN ( DATEDIFF( now( ), tpr.contents ) &gt;= 0 AND DATEDIFF( now( ), tpr.contents ) &lt;= 5 ) THEN
'第一次数据收集'
END
) as task from t_patient_record tpr
) as task, d.name as doctorName from t_patient_record tpr
left join t_patient_information tpi on tpi.id=tpr.patient_id and tpi.rec_status=0
left join t_doctor d on tpi.user_id = d.user_id and d.rec_status = 0
where tpr.rec_status=0
and tpr.test_questions_id=#{param.testQuestionsId}
and (
@ -506,8 +516,19 @@
OR ( DATEDIFF( now( ), tpr.contents ) &gt;= 360 AND DATEDIFF( now( ), tpr.contents ) &lt;= 370 )
OR ( DATEDIFF( now( ), tpr.contents ) &gt;= 0 AND DATEDIFF( now( ), tpr.contents ) &lt;= 5 )
)
</sql>
<select id="adjacentTasks" resultType="com.ccsens.tcm.bean.vo.StatisticVo$RecentAnalysisVO">
<include refid="adjacentTasksSql"/>
and tpr.user_id=#{userId}
</select>
<select id="hospitalAdjacentTasks" resultType="com.ccsens.tcm.bean.vo.StatisticVo$RecentAnalysisVO">
<include refid="adjacentTasksSql"/>
and tpr.user_id in (
select d.user_id from
(select hospital_id from t_doctor where user_id = #{userId}) h, t_doctor d
where h.hospital_id = d.hospital_id
)
</select>
<resultMap id="selPatientProgress1" type="com.ccsens.tcm.bean.vo.StatisticVo$PatientProgressVo">
<id property="id" column="id" />
<result property="hospitalization" column="hospitalization" />

43
tcm/src/main/resources/mapper_raw/DoctorMapper.xml

@ -5,6 +5,7 @@
<id column="id" jdbcType="BIGINT" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="hospital_id" jdbcType="BIGINT" property="hospitalId" />
<result column="role" jdbcType="TINYINT" property="role" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="operator" jdbcType="BIGINT" property="operator" />
@ -71,7 +72,7 @@
</where>
</sql>
<sql id="Base_Column_List">
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
</sql>
<select id="selectByExample" parameterType="com.ccsens.tcm.bean.po.DoctorExample" resultMap="BaseResultMap">
select
@ -104,28 +105,30 @@
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.tcm.bean.po.Doctor">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into t_doctor (name, hospital_id, user_id,
remark, operator, created_at,
updated_at, rec_status)
values (#{name,jdbcType=VARCHAR}, #{hospitalId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT},
#{remark,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP},
#{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT})
insert into t_doctor (id, name, hospital_id,
role, user_id, remark,
operator, created_at, updated_at,
rec_status)
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{hospitalId,jdbcType=BIGINT},
#{role,jdbcType=TINYINT}, #{userId,jdbcType=BIGINT}, #{remark,jdbcType=VARCHAR},
#{operator,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP},
#{recStatus,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.tcm.bean.po.Doctor">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into t_doctor
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="name != null">
name,
</if>
<if test="hospitalId != null">
hospital_id,
</if>
<if test="role != null">
role,
</if>
<if test="userId != null">
user_id,
</if>
@ -146,12 +149,18 @@
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="hospitalId != null">
#{hospitalId,jdbcType=BIGINT},
</if>
<if test="role != null">
#{role,jdbcType=TINYINT},
</if>
<if test="userId != null">
#{userId,jdbcType=BIGINT},
</if>
@ -190,6 +199,9 @@
<if test="record.hospitalId != null">
hospital_id = #{record.hospitalId,jdbcType=BIGINT},
</if>
<if test="record.role != null">
role = #{record.role,jdbcType=TINYINT},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=BIGINT},
</if>
@ -218,6 +230,7 @@
set id = #{record.id,jdbcType=BIGINT},
name = #{record.name,jdbcType=VARCHAR},
hospital_id = #{record.hospitalId,jdbcType=BIGINT},
role = #{record.role,jdbcType=TINYINT},
user_id = #{record.userId,jdbcType=BIGINT},
remark = #{record.remark,jdbcType=VARCHAR},
operator = #{record.operator,jdbcType=BIGINT},
@ -237,6 +250,9 @@
<if test="hospitalId != null">
hospital_id = #{hospitalId,jdbcType=BIGINT},
</if>
<if test="role != null">
role = #{role,jdbcType=TINYINT},
</if>
<if test="userId != null">
user_id = #{userId,jdbcType=BIGINT},
</if>
@ -262,6 +278,7 @@
update t_doctor
set name = #{name,jdbcType=VARCHAR},
hospital_id = #{hospitalId,jdbcType=BIGINT},
role = #{role,jdbcType=TINYINT},
user_id = #{userId,jdbcType=BIGINT},
remark = #{remark,jdbcType=VARCHAR},
operator = #{operator,jdbcType=BIGINT},

44
tcm/src/main/resources/mapper_raw/PatientInformationMapper.xml

@ -9,6 +9,8 @@
<result column="age" jdbcType="INTEGER" property="age" />
<result column="input_status" jdbcType="TINYINT" property="inputStatus" />
<result column="hospital_id" jdbcType="BIGINT" property="hospitalId" />
<result column="check_id" jdbcType="BIGINT" property="checkId" />
<result column="pass_id" jdbcType="BIGINT" property="passId" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="update_at" jdbcType="TIMESTAMP" property="updateAt" />
@ -73,8 +75,8 @@
</where>
</sql>
<sql id="Base_Column_List">
id, hospitalization, code, inpatient_id, age, input_status, hospital_id, user_id,
created_at, update_at, rec_status
id, hospitalization, code, inpatient_id, age, input_status, hospital_id, check_id,
pass_id, user_id, created_at, update_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.tcm.bean.po.PatientInformationExample" resultMap="BaseResultMap">
select
@ -109,12 +111,14 @@
<insert id="insert" parameterType="com.ccsens.tcm.bean.po.PatientInformation">
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>
<insert id="insertSelective" parameterType="com.ccsens.tcm.bean.po.PatientInformation">
insert into t_patient_information
@ -140,6 +144,12 @@
<if test="hospitalId != null">
hospital_id,
</if>
<if test="checkId != null">
check_id,
</if>
<if test="passId != null">
pass_id,
</if>
<if test="userId != null">
user_id,
</if>
@ -175,6 +185,12 @@
<if test="hospitalId != null">
#{hospitalId,jdbcType=BIGINT},
</if>
<if test="checkId != null">
#{checkId,jdbcType=BIGINT},
</if>
<if test="passId != null">
#{passId,jdbcType=BIGINT},
</if>
<if test="userId != null">
#{userId,jdbcType=BIGINT},
</if>
@ -219,6 +235,12 @@
<if test="record.hospitalId != null">
hospital_id = #{record.hospitalId,jdbcType=BIGINT},
</if>
<if test="record.checkId != null">
check_id = #{record.checkId,jdbcType=BIGINT},
</if>
<if test="record.passId != null">
pass_id = #{record.passId,jdbcType=BIGINT},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=BIGINT},
</if>
@ -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 @@
<if test="hospitalId != null">
hospital_id = #{hospitalId,jdbcType=BIGINT},
</if>
<if test="checkId != null">
check_id = #{checkId,jdbcType=BIGINT},
</if>
<if test="passId != null">
pass_id = #{passId,jdbcType=BIGINT},
</if>
<if test="userId != null">
user_id = #{userId,jdbcType=BIGINT},
</if>
@ -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},

Loading…
Cancel
Save