zhizhi wu 5 years ago
parent
commit
b69e6db2eb
  1. 2
      health/src/main/java/com/ccsens/health/bean/dto/JourneyDto.java
  2. 5
      health/src/main/java/com/ccsens/health/persist/dao/JourneyDao.java
  3. 3
      health/src/main/java/com/ccsens/health/service/HealthService.java
  4. 2
      health/src/main/java/com/ccsens/health/service/JourneyService.java
  5. 2
      health/src/main/resources/druid-prod.yml
  6. 6
      health/src/main/resources/mapper_dao/JourneyDao.xml
  7. 14
      ht/src/main/java/com/ccsens/ht/api/PatientController.java
  8. 3
      ht/src/main/java/com/ccsens/ht/api/PatientReportController.java
  9. 5
      ht/src/main/java/com/ccsens/ht/bean/dto/QuestionDto.java
  10. 11
      ht/src/main/java/com/ccsens/ht/bean/po/HtPatientAcp.java
  11. 60
      ht/src/main/java/com/ccsens/ht/bean/po/HtPatientAcpExample.java
  12. 11
      ht/src/main/java/com/ccsens/ht/bean/po/HtPatientBody.java
  13. 60
      ht/src/main/java/com/ccsens/ht/bean/po/HtPatientBodyExample.java
  14. 11
      ht/src/main/java/com/ccsens/ht/bean/po/HtPatientFamily.java
  15. 60
      ht/src/main/java/com/ccsens/ht/bean/po/HtPatientFamilyExample.java
  16. 11
      ht/src/main/java/com/ccsens/ht/bean/po/HtPatientFamilyIllness.java
  17. 60
      ht/src/main/java/com/ccsens/ht/bean/po/HtPatientFamilyIllnessExample.java
  18. 11
      ht/src/main/java/com/ccsens/ht/bean/po/HtPatientIllnessHistory.java
  19. 60
      ht/src/main/java/com/ccsens/ht/bean/po/HtPatientIllnessHistoryExample.java
  20. 11
      ht/src/main/java/com/ccsens/ht/bean/po/HtPatientParentIllness.java
  21. 60
      ht/src/main/java/com/ccsens/ht/bean/po/HtPatientParentIllnessExample.java
  22. 11
      ht/src/main/java/com/ccsens/ht/bean/po/HtPatientPersional.java
  23. 60
      ht/src/main/java/com/ccsens/ht/bean/po/HtPatientPersionalExample.java
  24. 22
      ht/src/main/java/com/ccsens/ht/bean/po/HtPatientReport.java
  25. 130
      ht/src/main/java/com/ccsens/ht/bean/po/HtPatientReportExample.java
  26. 11
      ht/src/main/java/com/ccsens/ht/bean/po/HtPatientScore.java
  27. 60
      ht/src/main/java/com/ccsens/ht/bean/po/HtPatientScoreExample.java
  28. 16
      ht/src/main/java/com/ccsens/ht/bean/vo/PatientReportVo.java
  29. 11
      ht/src/main/java/com/ccsens/ht/bean/vo/PatientVo.java
  30. 8
      ht/src/main/java/com/ccsens/ht/persist/dao/HtPositionDao.java
  31. 1
      ht/src/main/java/com/ccsens/ht/service/ImportService.java
  32. 22
      ht/src/main/java/com/ccsens/ht/service/PatientReportService.java
  33. 64
      ht/src/main/java/com/ccsens/ht/service/PatientService.java
  34. 51
      ht/src/main/java/com/ccsens/ht/service/QuestionService.java
  35. 2
      ht/src/main/java/com/ccsens/ht/uitl/Constant.java
  36. 1
      ht/src/main/resources/mapper_dao/HtPatientReportDao.xml
  37. 14
      ht/src/main/resources/mapper_dao/HtPositionDao.xml
  38. 29
      ht/src/main/resources/mapper_raw/HtPatientAcpMapper.xml
  39. 29
      ht/src/main/resources/mapper_raw/HtPatientBodyMapper.xml
  40. 27
      ht/src/main/resources/mapper_raw/HtPatientFamilyIllnessMapper.xml
  41. 29
      ht/src/main/resources/mapper_raw/HtPatientFamilyMapper.xml
  42. 25
      ht/src/main/resources/mapper_raw/HtPatientIllnessHistoryMapper.xml
  43. 27
      ht/src/main/resources/mapper_raw/HtPatientParentIllnessMapper.xml
  44. 25
      ht/src/main/resources/mapper_raw/HtPatientPersionalMapper.xml
  45. 44
      ht/src/main/resources/mapper_raw/HtPatientReportMapper.xml
  46. 27
      ht/src/main/resources/mapper_raw/HtPatientScoreMapper.xml
  47. 2
      util/src/main/java/com/ccsens/util/CodeEnum.java

2
health/src/main/java/com/ccsens/health/bean/dto/JourneyDto.java

@ -212,6 +212,8 @@ public class JourneyDto {
@Data
@ApiModel("复课查询")
public static class BackClass{
@ApiModelProperty("班级名称")
private String className;
@ApiModelProperty("查询时间 默认当前时间")
private Long endTime = System.currentTimeMillis();
@ApiModelProperty("第几页")

5
health/src/main/java/com/ccsens/health/persist/dao/JourneyDao.java

@ -1,5 +1,6 @@
package com.ccsens.health.persist.dao;
import com.ccsens.health.bean.dto.JourneyDto;
import com.ccsens.health.bean.dto.MemberDto;
import com.ccsens.health.bean.po.Journey;
import com.ccsens.health.bean.vo.JourneyVo;
@ -23,10 +24,10 @@ public interface JourneyDao extends JourneyMapper {
/**
* 根据时间查询复课情况
* @param endTime
* @param backClass
* @return
*/
List<JourneyVo.ClassBack> classBackStatistics(@Param("endTime") Long endTime);
List<JourneyVo.ClassBack> classBackStatistics(JourneyDto.BackClass backClass);
/**
* 根据学号姓名时间查询校外行程

3
health/src/main/java/com/ccsens/health/service/HealthService.java

@ -57,7 +57,7 @@ public class HealthService implements IHealthService {
private RedisUtil redisUtil;
@Autowired
private IAsyncService asyncService;
@Value("spring.profiles.active")
@Value("${spring.profiles.active}")
private String active;
@Override
@ -98,6 +98,7 @@ public class HealthService implements IHealthService {
HealthVo.HealthTypeRedis healthType = readHealthType(healthInfo.getHealthTypeId());
//健康码颜色(默认绿色)
Future<String> future = null;
log.info("active:{}", active);
if ("prod".equals(active)) {
WxXcxUtil.LineColor color = getLineColor(healthType);
future = asyncService.generateQRCode("d=" + userId, color);

2
health/src/main/java/com/ccsens/health/service/JourneyService.java

@ -74,7 +74,7 @@ public class JourneyService implements IJourneyService{
@Override
public PageInfo<JourneyVo.ClassBack> classBackStatistics(JourneyDto.BackClass backClass) {
PageHelper.startPage(backClass.getPageNum(), backClass.getPageSize());
List<JourneyVo.ClassBack> vos = journeyDao.classBackStatistics(backClass.getEndTime());
List<JourneyVo.ClassBack> vos = journeyDao.classBackStatistics(backClass);
return new PageInfo<>(vos);
}

2
health/src/main/resources/druid-prod.yml

@ -10,7 +10,7 @@ spring:
filterUrlPattern: /*
filters: stat,wall
initialSize: 5
maxActive: 20
maxActive: 100
maxPoolPreparedStatementPerConnectionSize: 20
maxWait: 60000
minEvictableIdleTimeMillis: 300000

6
health/src/main/resources/mapper_dao/JourneyDao.xml

@ -60,7 +60,11 @@
</select>
<select id="classBackStatistics" resultType="com.ccsens.health.bean.vo.JourneyVo$ClassBack">
select t1.department as className, t1.totalNum, ifNull(t2.backNum,0) as backNum, t1.totalNum-IFNULL(t2.backNum,0) as noBackNum from
(select department, count(id) as totalNum from t_member where type in (0,1) group by department) t1
(select department, count(id) as totalNum from t_member where type in (0,1)
<if test="className != null and className != ''">
and department = #{className}
</if>
group by department) t1
left join
(select m.department, count(DISTINCT j.user_id) as backNum from
t_journey j left join t_real_name_auth a on j.user_id = a.user_id

14
ht/src/main/java/com/ccsens/ht/api/PatientController.java

@ -1,6 +1,7 @@
package com.ccsens.ht.api;
import cn.hutool.core.util.IdcardUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ccsens.ht.annotation.DoctorAudit;
import com.ccsens.cloudutil.annotation.MustLogin;
@ -74,7 +75,7 @@ public class PatientController {
List<HtPatient> patients = patientService.selectPatient(patient);
log.info("病友查询结果:{}", patients);
return JsonResponse.newInstance().ok(PatientVo.Query.copy(patients));
return JsonResponse.newInstance().ok(PatientVo.Query.copy(patients, params.getUserId()));
}
/**
@ -133,7 +134,16 @@ public class PatientController {
public JsonResponse queryPatientOtherMsg(@RequestBody @ApiParam @Valid QueryDto<PatientDto.QueryOtherMsg> params) {
log.info("查询其他信息请求参数:{}", params);
List list = patientService.queryPatientOtherMsg(params.getParam(), params.getUserId());
return JsonResponse.newInstance().ok(list);
JSONArray array = JSONObject.parseArray(JSONObject.toJSONString(list));
String key = "recorder";
for (Object obj: array) {
JSONObject json = (JSONObject) obj;
boolean isNotRecorder = json.get(key) != null
&& json.getLongValue(key) != 0
&& json.getLongValue(key) != params.getUserId().longValue();
json.put("modifyAuth", isNotRecorder ? 0 : 1);
}
return JsonResponse.newInstance().ok(array);
}
@MustLogin

3
ht/src/main/java/com/ccsens/ht/api/PatientReportController.java

@ -70,7 +70,7 @@ public class PatientReportController {
}
@MustLogin
@ApiOperation(value = "查询报告单列表",notes = "根据病人ID查询报告单列表")
@ApiOperation(value = "查询报告单列表",notes = "根据病人ID/医生ID查询报告单列表")
@ApiImplicitParams({
@ApiImplicitParam(name = "json", value = "编辑报告单信息", required = true)
})
@ -123,7 +123,6 @@ public class PatientReportController {
log.info("文件路径:{}", path);
PatientReportVo.Export export = new PatientReportVo.Export();
export.setPath(path);
return JsonResponse.newInstance().ok(export);
}

5
ht/src/main/java/com/ccsens/ht/bean/dto/QuestionDto.java

@ -49,9 +49,8 @@ public class QuestionDto {
@NotNull(message = "选项ID不能为空")
@ApiModelProperty("选项ID")
private Long id;
// @ApiModelProperty("病友画图或录音")
// private String path;
@ApiModelProperty("答题时间")
private Long answerTime;
}
}

11
ht/src/main/java/com/ccsens/ht/bean/po/HtPatientAcp.java

@ -32,6 +32,8 @@ public class HtPatientAcp implements Serializable {
private Byte isDel;
private Long recorder;
private static final long serialVersionUID = 1L;
public Long getId() {
@ -146,6 +148,14 @@ public class HtPatientAcp implements Serializable {
this.isDel = isDel;
}
public Long getRecorder() {
return recorder;
}
public void setRecorder(Long recorder) {
this.recorder = recorder;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
@ -166,6 +176,7 @@ public class HtPatientAcp implements Serializable {
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", isDel=").append(isDel);
sb.append(", recorder=").append(recorder);
sb.append("]");
return sb.toString();
}

60
ht/src/main/java/com/ccsens/ht/bean/po/HtPatientAcpExample.java

@ -1034,6 +1034,66 @@ public class HtPatientAcpExample {
addCriterion("is_del not between", value1, value2, "isDel");
return (Criteria) this;
}
public Criteria andRecorderIsNull() {
addCriterion("recorder is null");
return (Criteria) this;
}
public Criteria andRecorderIsNotNull() {
addCriterion("recorder is not null");
return (Criteria) this;
}
public Criteria andRecorderEqualTo(Long value) {
addCriterion("recorder =", value, "recorder");
return (Criteria) this;
}
public Criteria andRecorderNotEqualTo(Long value) {
addCriterion("recorder <>", value, "recorder");
return (Criteria) this;
}
public Criteria andRecorderGreaterThan(Long value) {
addCriterion("recorder >", value, "recorder");
return (Criteria) this;
}
public Criteria andRecorderGreaterThanOrEqualTo(Long value) {
addCriterion("recorder >=", value, "recorder");
return (Criteria) this;
}
public Criteria andRecorderLessThan(Long value) {
addCriterion("recorder <", value, "recorder");
return (Criteria) this;
}
public Criteria andRecorderLessThanOrEqualTo(Long value) {
addCriterion("recorder <=", value, "recorder");
return (Criteria) this;
}
public Criteria andRecorderIn(List<Long> values) {
addCriterion("recorder in", values, "recorder");
return (Criteria) this;
}
public Criteria andRecorderNotIn(List<Long> values) {
addCriterion("recorder not in", values, "recorder");
return (Criteria) this;
}
public Criteria andRecorderBetween(Long value1, Long value2) {
addCriterion("recorder between", value1, value2, "recorder");
return (Criteria) this;
}
public Criteria andRecorderNotBetween(Long value1, Long value2) {
addCriterion("recorder not between", value1, value2, "recorder");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

11
ht/src/main/java/com/ccsens/ht/bean/po/HtPatientBody.java

@ -32,6 +32,8 @@ public class HtPatientBody implements Serializable {
private Byte isDel;
private Long recorder;
private static final long serialVersionUID = 1L;
public Long getId() {
@ -146,6 +148,14 @@ public class HtPatientBody implements Serializable {
this.isDel = isDel;
}
public Long getRecorder() {
return recorder;
}
public void setRecorder(Long recorder) {
this.recorder = recorder;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
@ -166,6 +176,7 @@ public class HtPatientBody implements Serializable {
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", isDel=").append(isDel);
sb.append(", recorder=").append(recorder);
sb.append("]");
return sb.toString();
}

60
ht/src/main/java/com/ccsens/ht/bean/po/HtPatientBodyExample.java

@ -1014,6 +1014,66 @@ public class HtPatientBodyExample {
addCriterion("is_del not between", value1, value2, "isDel");
return (Criteria) this;
}
public Criteria andRecorderIsNull() {
addCriterion("recorder is null");
return (Criteria) this;
}
public Criteria andRecorderIsNotNull() {
addCriterion("recorder is not null");
return (Criteria) this;
}
public Criteria andRecorderEqualTo(Long value) {
addCriterion("recorder =", value, "recorder");
return (Criteria) this;
}
public Criteria andRecorderNotEqualTo(Long value) {
addCriterion("recorder <>", value, "recorder");
return (Criteria) this;
}
public Criteria andRecorderGreaterThan(Long value) {
addCriterion("recorder >", value, "recorder");
return (Criteria) this;
}
public Criteria andRecorderGreaterThanOrEqualTo(Long value) {
addCriterion("recorder >=", value, "recorder");
return (Criteria) this;
}
public Criteria andRecorderLessThan(Long value) {
addCriterion("recorder <", value, "recorder");
return (Criteria) this;
}
public Criteria andRecorderLessThanOrEqualTo(Long value) {
addCriterion("recorder <=", value, "recorder");
return (Criteria) this;
}
public Criteria andRecorderIn(List<Long> values) {
addCriterion("recorder in", values, "recorder");
return (Criteria) this;
}
public Criteria andRecorderNotIn(List<Long> values) {
addCriterion("recorder not in", values, "recorder");
return (Criteria) this;
}
public Criteria andRecorderBetween(Long value1, Long value2) {
addCriterion("recorder between", value1, value2, "recorder");
return (Criteria) this;
}
public Criteria andRecorderNotBetween(Long value1, Long value2) {
addCriterion("recorder not between", value1, value2, "recorder");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

11
ht/src/main/java/com/ccsens/ht/bean/po/HtPatientFamily.java

@ -28,6 +28,8 @@ public class HtPatientFamily implements Serializable {
private Byte isDel;
private Long recorder;
private static final long serialVersionUID = 1L;
public Long getId() {
@ -126,6 +128,14 @@ public class HtPatientFamily implements Serializable {
this.isDel = isDel;
}
public Long getRecorder() {
return recorder;
}
public void setRecorder(Long recorder) {
this.recorder = recorder;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
@ -144,6 +154,7 @@ public class HtPatientFamily implements Serializable {
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", isDel=").append(isDel);
sb.append(", recorder=").append(recorder);
sb.append("]");
return sb.toString();
}

60
ht/src/main/java/com/ccsens/ht/bean/po/HtPatientFamilyExample.java

@ -844,6 +844,66 @@ public class HtPatientFamilyExample {
addCriterion("is_del not between", value1, value2, "isDel");
return (Criteria) this;
}
public Criteria andRecorderIsNull() {
addCriterion("recorder is null");
return (Criteria) this;
}
public Criteria andRecorderIsNotNull() {
addCriterion("recorder is not null");
return (Criteria) this;
}
public Criteria andRecorderEqualTo(Long value) {
addCriterion("recorder =", value, "recorder");
return (Criteria) this;
}
public Criteria andRecorderNotEqualTo(Long value) {
addCriterion("recorder <>", value, "recorder");
return (Criteria) this;
}
public Criteria andRecorderGreaterThan(Long value) {
addCriterion("recorder >", value, "recorder");
return (Criteria) this;
}
public Criteria andRecorderGreaterThanOrEqualTo(Long value) {
addCriterion("recorder >=", value, "recorder");
return (Criteria) this;
}
public Criteria andRecorderLessThan(Long value) {
addCriterion("recorder <", value, "recorder");
return (Criteria) this;
}
public Criteria andRecorderLessThanOrEqualTo(Long value) {
addCriterion("recorder <=", value, "recorder");
return (Criteria) this;
}
public Criteria andRecorderIn(List<Long> values) {
addCriterion("recorder in", values, "recorder");
return (Criteria) this;
}
public Criteria andRecorderNotIn(List<Long> values) {
addCriterion("recorder not in", values, "recorder");
return (Criteria) this;
}
public Criteria andRecorderBetween(Long value1, Long value2) {
addCriterion("recorder between", value1, value2, "recorder");
return (Criteria) this;
}
public Criteria andRecorderNotBetween(Long value1, Long value2) {
addCriterion("recorder not between", value1, value2, "recorder");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

11
ht/src/main/java/com/ccsens/ht/bean/po/HtPatientFamilyIllness.java

@ -26,6 +26,8 @@ public class HtPatientFamilyIllness implements Serializable {
private Byte isDel;
private Long recorder;
private static final long serialVersionUID = 1L;
public Long getId() {
@ -116,6 +118,14 @@ public class HtPatientFamilyIllness implements Serializable {
this.isDel = isDel;
}
public Long getRecorder() {
return recorder;
}
public void setRecorder(Long recorder) {
this.recorder = recorder;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
@ -133,6 +143,7 @@ public class HtPatientFamilyIllness implements Serializable {
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", isDel=").append(isDel);
sb.append(", recorder=").append(recorder);
sb.append("]");
return sb.toString();
}

60
ht/src/main/java/com/ccsens/ht/bean/po/HtPatientFamilyIllnessExample.java

@ -804,6 +804,66 @@ public class HtPatientFamilyIllnessExample {
addCriterion("is_del not between", value1, value2, "isDel");
return (Criteria) this;
}
public Criteria andRecorderIsNull() {
addCriterion("recorder is null");
return (Criteria) this;
}
public Criteria andRecorderIsNotNull() {
addCriterion("recorder is not null");
return (Criteria) this;
}
public Criteria andRecorderEqualTo(Long value) {
addCriterion("recorder =", value, "recorder");
return (Criteria) this;
}
public Criteria andRecorderNotEqualTo(Long value) {
addCriterion("recorder <>", value, "recorder");
return (Criteria) this;
}
public Criteria andRecorderGreaterThan(Long value) {
addCriterion("recorder >", value, "recorder");
return (Criteria) this;
}
public Criteria andRecorderGreaterThanOrEqualTo(Long value) {
addCriterion("recorder >=", value, "recorder");
return (Criteria) this;
}
public Criteria andRecorderLessThan(Long value) {
addCriterion("recorder <", value, "recorder");
return (Criteria) this;
}
public Criteria andRecorderLessThanOrEqualTo(Long value) {
addCriterion("recorder <=", value, "recorder");
return (Criteria) this;
}
public Criteria andRecorderIn(List<Long> values) {
addCriterion("recorder in", values, "recorder");
return (Criteria) this;
}
public Criteria andRecorderNotIn(List<Long> values) {
addCriterion("recorder not in", values, "recorder");
return (Criteria) this;
}
public Criteria andRecorderBetween(Long value1, Long value2) {
addCriterion("recorder between", value1, value2, "recorder");
return (Criteria) this;
}
public Criteria andRecorderNotBetween(Long value1, Long value2) {
addCriterion("recorder not between", value1, value2, "recorder");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

11
ht/src/main/java/com/ccsens/ht/bean/po/HtPatientIllnessHistory.java

@ -66,6 +66,8 @@ public class HtPatientIllnessHistory implements Serializable {
private Byte isDel;
private Long recorder;
private static final long serialVersionUID = 1L;
public Long getId() {
@ -316,6 +318,14 @@ public class HtPatientIllnessHistory implements Serializable {
this.isDel = isDel;
}
public Long getRecorder() {
return recorder;
}
public void setRecorder(Long recorder) {
this.recorder = recorder;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
@ -353,6 +363,7 @@ public class HtPatientIllnessHistory implements Serializable {
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", isDel=").append(isDel);
sb.append(", recorder=").append(recorder);
sb.append("]");
return sb.toString();
}

60
ht/src/main/java/com/ccsens/ht/bean/po/HtPatientIllnessHistoryExample.java

@ -1974,6 +1974,66 @@ public class HtPatientIllnessHistoryExample {
addCriterion("is_del not between", value1, value2, "isDel");
return (Criteria) this;
}
public Criteria andRecorderIsNull() {
addCriterion("recorder is null");
return (Criteria) this;
}
public Criteria andRecorderIsNotNull() {
addCriterion("recorder is not null");
return (Criteria) this;
}
public Criteria andRecorderEqualTo(Long value) {
addCriterion("recorder =", value, "recorder");
return (Criteria) this;
}
public Criteria andRecorderNotEqualTo(Long value) {
addCriterion("recorder <>", value, "recorder");
return (Criteria) this;
}
public Criteria andRecorderGreaterThan(Long value) {
addCriterion("recorder >", value, "recorder");
return (Criteria) this;
}
public Criteria andRecorderGreaterThanOrEqualTo(Long value) {
addCriterion("recorder >=", value, "recorder");
return (Criteria) this;
}
public Criteria andRecorderLessThan(Long value) {
addCriterion("recorder <", value, "recorder");
return (Criteria) this;
}
public Criteria andRecorderLessThanOrEqualTo(Long value) {
addCriterion("recorder <=", value, "recorder");
return (Criteria) this;
}
public Criteria andRecorderIn(List<Long> values) {
addCriterion("recorder in", values, "recorder");
return (Criteria) this;
}
public Criteria andRecorderNotIn(List<Long> values) {
addCriterion("recorder not in", values, "recorder");
return (Criteria) this;
}
public Criteria andRecorderBetween(Long value1, Long value2) {
addCriterion("recorder between", value1, value2, "recorder");
return (Criteria) this;
}
public Criteria andRecorderNotBetween(Long value1, Long value2) {
addCriterion("recorder not between", value1, value2, "recorder");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

11
ht/src/main/java/com/ccsens/ht/bean/po/HtPatientParentIllness.java

@ -44,6 +44,8 @@ public class HtPatientParentIllness implements Serializable {
private Byte isDel;
private Long recorder;
private static final long serialVersionUID = 1L;
public Long getId() {
@ -206,6 +208,14 @@ public class HtPatientParentIllness implements Serializable {
this.isDel = isDel;
}
public Long getRecorder() {
return recorder;
}
public void setRecorder(Long recorder) {
this.recorder = recorder;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
@ -232,6 +242,7 @@ public class HtPatientParentIllness implements Serializable {
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", isDel=").append(isDel);
sb.append(", recorder=").append(recorder);
sb.append("]");
return sb.toString();
}

60
ht/src/main/java/com/ccsens/ht/bean/po/HtPatientParentIllnessExample.java

@ -1314,6 +1314,66 @@ public class HtPatientParentIllnessExample {
addCriterion("is_del not between", value1, value2, "isDel");
return (Criteria) this;
}
public Criteria andRecorderIsNull() {
addCriterion("recorder is null");
return (Criteria) this;
}
public Criteria andRecorderIsNotNull() {
addCriterion("recorder is not null");
return (Criteria) this;
}
public Criteria andRecorderEqualTo(Long value) {
addCriterion("recorder =", value, "recorder");
return (Criteria) this;
}
public Criteria andRecorderNotEqualTo(Long value) {
addCriterion("recorder <>", value, "recorder");
return (Criteria) this;
}
public Criteria andRecorderGreaterThan(Long value) {
addCriterion("recorder >", value, "recorder");
return (Criteria) this;
}
public Criteria andRecorderGreaterThanOrEqualTo(Long value) {
addCriterion("recorder >=", value, "recorder");
return (Criteria) this;
}
public Criteria andRecorderLessThan(Long value) {
addCriterion("recorder <", value, "recorder");
return (Criteria) this;
}
public Criteria andRecorderLessThanOrEqualTo(Long value) {
addCriterion("recorder <=", value, "recorder");
return (Criteria) this;
}
public Criteria andRecorderIn(List<Long> values) {
addCriterion("recorder in", values, "recorder");
return (Criteria) this;
}
public Criteria andRecorderNotIn(List<Long> values) {
addCriterion("recorder not in", values, "recorder");
return (Criteria) this;
}
public Criteria andRecorderBetween(Long value1, Long value2) {
addCriterion("recorder between", value1, value2, "recorder");
return (Criteria) this;
}
public Criteria andRecorderNotBetween(Long value1, Long value2) {
addCriterion("recorder not between", value1, value2, "recorder");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

11
ht/src/main/java/com/ccsens/ht/bean/po/HtPatientPersional.java

@ -54,6 +54,8 @@ public class HtPatientPersional implements Serializable {
private Byte isDel;
private Long recorder;
private static final long serialVersionUID = 1L;
public Long getId() {
@ -256,6 +258,14 @@ public class HtPatientPersional implements Serializable {
this.isDel = isDel;
}
public Long getRecorder() {
return recorder;
}
public void setRecorder(Long recorder) {
this.recorder = recorder;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
@ -287,6 +297,7 @@ public class HtPatientPersional implements Serializable {
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", isDel=").append(isDel);
sb.append(", recorder=").append(recorder);
sb.append("]");
return sb.toString();
}

60
ht/src/main/java/com/ccsens/ht/bean/po/HtPatientPersionalExample.java

@ -1614,6 +1614,66 @@ public class HtPatientPersionalExample {
addCriterion("is_del not between", value1, value2, "isDel");
return (Criteria) this;
}
public Criteria andRecorderIsNull() {
addCriterion("recorder is null");
return (Criteria) this;
}
public Criteria andRecorderIsNotNull() {
addCriterion("recorder is not null");
return (Criteria) this;
}
public Criteria andRecorderEqualTo(Long value) {
addCriterion("recorder =", value, "recorder");
return (Criteria) this;
}
public Criteria andRecorderNotEqualTo(Long value) {
addCriterion("recorder <>", value, "recorder");
return (Criteria) this;
}
public Criteria andRecorderGreaterThan(Long value) {
addCriterion("recorder >", value, "recorder");
return (Criteria) this;
}
public Criteria andRecorderGreaterThanOrEqualTo(Long value) {
addCriterion("recorder >=", value, "recorder");
return (Criteria) this;
}
public Criteria andRecorderLessThan(Long value) {
addCriterion("recorder <", value, "recorder");
return (Criteria) this;
}
public Criteria andRecorderLessThanOrEqualTo(Long value) {
addCriterion("recorder <=", value, "recorder");
return (Criteria) this;
}
public Criteria andRecorderIn(List<Long> values) {
addCriterion("recorder in", values, "recorder");
return (Criteria) this;
}
public Criteria andRecorderNotIn(List<Long> values) {
addCriterion("recorder not in", values, "recorder");
return (Criteria) this;
}
public Criteria andRecorderBetween(Long value1, Long value2) {
addCriterion("recorder between", value1, value2, "recorder");
return (Criteria) this;
}
public Criteria andRecorderNotBetween(Long value1, Long value2) {
addCriterion("recorder not between", value1, value2, "recorder");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

22
ht/src/main/java/com/ccsens/ht/bean/po/HtPatientReport.java

@ -46,6 +46,10 @@ public class HtPatientReport implements Serializable {
private Byte isDel;
private Byte showStatus;
private String hospital;
private static final long serialVersionUID = 1L;
public Long getId() {
@ -216,6 +220,22 @@ public class HtPatientReport implements Serializable {
this.isDel = isDel;
}
public Byte getShowStatus() {
return showStatus;
}
public void setShowStatus(Byte showStatus) {
this.showStatus = showStatus;
}
public String getHospital() {
return hospital;
}
public void setHospital(String hospital) {
this.hospital = hospital == null ? null : hospital.trim();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
@ -243,6 +263,8 @@ public class HtPatientReport implements Serializable {
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", isDel=").append(isDel);
sb.append(", showStatus=").append(showStatus);
sb.append(", hospital=").append(hospital);
sb.append("]");
return sb.toString();
}

130
ht/src/main/java/com/ccsens/ht/bean/po/HtPatientReportExample.java

@ -1474,6 +1474,136 @@ public class HtPatientReportExample {
addCriterion("is_del not between", value1, value2, "isDel");
return (Criteria) this;
}
public Criteria andShowStatusIsNull() {
addCriterion("show_status is null");
return (Criteria) this;
}
public Criteria andShowStatusIsNotNull() {
addCriterion("show_status is not null");
return (Criteria) this;
}
public Criteria andShowStatusEqualTo(Byte value) {
addCriterion("show_status =", value, "showStatus");
return (Criteria) this;
}
public Criteria andShowStatusNotEqualTo(Byte value) {
addCriterion("show_status <>", value, "showStatus");
return (Criteria) this;
}
public Criteria andShowStatusGreaterThan(Byte value) {
addCriterion("show_status >", value, "showStatus");
return (Criteria) this;
}
public Criteria andShowStatusGreaterThanOrEqualTo(Byte value) {
addCriterion("show_status >=", value, "showStatus");
return (Criteria) this;
}
public Criteria andShowStatusLessThan(Byte value) {
addCriterion("show_status <", value, "showStatus");
return (Criteria) this;
}
public Criteria andShowStatusLessThanOrEqualTo(Byte value) {
addCriterion("show_status <=", value, "showStatus");
return (Criteria) this;
}
public Criteria andShowStatusIn(List<Byte> values) {
addCriterion("show_status in", values, "showStatus");
return (Criteria) this;
}
public Criteria andShowStatusNotIn(List<Byte> values) {
addCriterion("show_status not in", values, "showStatus");
return (Criteria) this;
}
public Criteria andShowStatusBetween(Byte value1, Byte value2) {
addCriterion("show_status between", value1, value2, "showStatus");
return (Criteria) this;
}
public Criteria andShowStatusNotBetween(Byte value1, Byte value2) {
addCriterion("show_status not between", value1, value2, "showStatus");
return (Criteria) this;
}
public Criteria andHospitalIsNull() {
addCriterion("hospital is null");
return (Criteria) this;
}
public Criteria andHospitalIsNotNull() {
addCriterion("hospital is not null");
return (Criteria) this;
}
public Criteria andHospitalEqualTo(String value) {
addCriterion("hospital =", value, "hospital");
return (Criteria) this;
}
public Criteria andHospitalNotEqualTo(String value) {
addCriterion("hospital <>", value, "hospital");
return (Criteria) this;
}
public Criteria andHospitalGreaterThan(String value) {
addCriterion("hospital >", value, "hospital");
return (Criteria) this;
}
public Criteria andHospitalGreaterThanOrEqualTo(String value) {
addCriterion("hospital >=", value, "hospital");
return (Criteria) this;
}
public Criteria andHospitalLessThan(String value) {
addCriterion("hospital <", value, "hospital");
return (Criteria) this;
}
public Criteria andHospitalLessThanOrEqualTo(String value) {
addCriterion("hospital <=", value, "hospital");
return (Criteria) this;
}
public Criteria andHospitalLike(String value) {
addCriterion("hospital like", value, "hospital");
return (Criteria) this;
}
public Criteria andHospitalNotLike(String value) {
addCriterion("hospital not like", value, "hospital");
return (Criteria) this;
}
public Criteria andHospitalIn(List<String> values) {
addCriterion("hospital in", values, "hospital");
return (Criteria) this;
}
public Criteria andHospitalNotIn(List<String> values) {
addCriterion("hospital not in", values, "hospital");
return (Criteria) this;
}
public Criteria andHospitalBetween(String value1, String value2) {
addCriterion("hospital between", value1, value2, "hospital");
return (Criteria) this;
}
public Criteria andHospitalNotBetween(String value1, String value2) {
addCriterion("hospital not between", value1, value2, "hospital");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

11
ht/src/main/java/com/ccsens/ht/bean/po/HtPatientScore.java

@ -32,6 +32,8 @@ public class HtPatientScore implements Serializable {
private Byte isDel;
private Long answerTime;
private static final long serialVersionUID = 1L;
public Long getId() {
@ -146,6 +148,14 @@ public class HtPatientScore implements Serializable {
this.isDel = isDel;
}
public Long getAnswerTime() {
return answerTime;
}
public void setAnswerTime(Long answerTime) {
this.answerTime = answerTime;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
@ -166,6 +176,7 @@ public class HtPatientScore implements Serializable {
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", isDel=").append(isDel);
sb.append(", answerTime=").append(answerTime);
sb.append("]");
return sb.toString();
}

60
ht/src/main/java/com/ccsens/ht/bean/po/HtPatientScoreExample.java

@ -984,6 +984,66 @@ public class HtPatientScoreExample {
addCriterion("is_del not between", value1, value2, "isDel");
return (Criteria) this;
}
public Criteria andAnswerTimeIsNull() {
addCriterion("answer_time is null");
return (Criteria) this;
}
public Criteria andAnswerTimeIsNotNull() {
addCriterion("answer_time is not null");
return (Criteria) this;
}
public Criteria andAnswerTimeEqualTo(Long value) {
addCriterion("answer_time =", value, "answerTime");
return (Criteria) this;
}
public Criteria andAnswerTimeNotEqualTo(Long value) {
addCriterion("answer_time <>", value, "answerTime");
return (Criteria) this;
}
public Criteria andAnswerTimeGreaterThan(Long value) {
addCriterion("answer_time >", value, "answerTime");
return (Criteria) this;
}
public Criteria andAnswerTimeGreaterThanOrEqualTo(Long value) {
addCriterion("answer_time >=", value, "answerTime");
return (Criteria) this;
}
public Criteria andAnswerTimeLessThan(Long value) {
addCriterion("answer_time <", value, "answerTime");
return (Criteria) this;
}
public Criteria andAnswerTimeLessThanOrEqualTo(Long value) {
addCriterion("answer_time <=", value, "answerTime");
return (Criteria) this;
}
public Criteria andAnswerTimeIn(List<Long> values) {
addCriterion("answer_time in", values, "answerTime");
return (Criteria) this;
}
public Criteria andAnswerTimeNotIn(List<Long> values) {
addCriterion("answer_time not in", values, "answerTime");
return (Criteria) this;
}
public Criteria andAnswerTimeBetween(Long value1, Long value2) {
addCriterion("answer_time between", value1, value2, "answerTime");
return (Criteria) this;
}
public Criteria andAnswerTimeNotBetween(Long value1, Long value2) {
addCriterion("answer_time not between", value1, value2, "answerTime");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

16
ht/src/main/java/com/ccsens/ht/bean/vo/PatientReportVo.java

@ -96,6 +96,8 @@ public class PatientReportVo {
private String educationalStatusUnit;
@ApiModelProperty("职业")
private Byte career;
@ApiModelProperty("医院")
private String hospital;
public List<PdfUtil.Row> toPdfRow(){
Map<Byte, String> careerMap = new HashMap<>();
@ -128,17 +130,17 @@ public class PatientReportVo {
"病案号:" + this.hospitalNumber)
);
//第四栏
Date date = null;
if (this.reportTime > 0) {
date = new Date();
date.setTime(this.reportTime);
}
// Date date = null;
// if (this.reportTime > 0) {
// date = new Date();
// date.setTime(this.reportTime);
// }
rows.add(
fillRow(
"临床诊断:" + this.clinicalDiagnosis,
"",
"检查日期:" + (date == null ? "" : DateUtil.format(date, "yyyy-MM-dd")))
"","")
// "检查日期:" + (date == null ? "" : DateUtil.format(date, "yyyy-MM-dd")))
);
return rows;

11
ht/src/main/java/com/ccsens/ht/bean/vo/PatientVo.java

@ -1,5 +1,6 @@
package com.ccsens.ht.bean.vo;
import cn.hutool.core.collection.CollectionUtil;
import com.ccsens.ht.bean.po.HtPatient;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -74,8 +75,10 @@ public class PatientVo {
private String remark;
@ApiModelProperty("第一次录入人ID")
private Long recorder;
@ApiModelProperty("修改权限 0:没有 1:有")
private Byte modifyAuth;
public static List<Query> copy(List<HtPatient> patients) {
public static List<Query> copy(List<HtPatient> patients, Long userId) {
List<Query> querys = new ArrayList<>();
if (CollectionUtils.isEmpty(patients)) {
return querys;
@ -83,12 +86,14 @@ public class PatientVo {
patients.forEach(patient -> {
Query query = new Query();
BeanUtils.copyProperties(patient, query);
boolean isNotRecorder = patient.getRecorder() != null
&& patient.getRecorder().longValue() != 0
&& patient.getRecorder().longValue() != userId.longValue();
query.setModifyAuth((byte)(isNotRecorder ? 0 : 1));
querys.add(query);
});
return querys;
}
}
@ApiModel("PatientVoEdit")

8
ht/src/main/java/com/ccsens/ht/persist/dao/HtPositionDao.java

@ -40,4 +40,12 @@ public interface HtPositionDao extends HtPositionMapper {
* @return
*/
List<Long> queryAllLowerPosition(@Param("id") Long id);
/**
* 查询所在医院
* @param positionId
* @return
*/
String queryHospital(@Param("positionId") Long positionId);
}

1
ht/src/main/java/com/ccsens/ht/service/ImportService.java

@ -399,6 +399,7 @@ public class ImportService implements IImportService {
imgType.add((byte)2);
imgType.add((byte)7);
imgType.add((byte)8);
imgType.add((byte)5);
questionStr = imgType.contains(question.getType()) && StrUtil.isNotEmpty(questionStr) ? PropUtil.imgDomain + questionStr : questionStr;
question.setQuestion(questionStr);
question.setRecordType(objs.length > 5 && !StringUtils.isEmpty(objs[5]) ? String.valueOf(objs[5]) : Constant.Ht.STRING_DEFAULT);

22
ht/src/main/java/com/ccsens/ht/service/PatientReportService.java

@ -27,6 +27,7 @@ import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.*;
@ -46,17 +47,17 @@ public class PatientReportService implements IPatientReportService {
@Autowired
private Snowflake snowflake;
@Autowired
@Resource
private HtDoctorMapper htDoctorMapper;
@Autowired
@Resource
private HtPatientReportDao htPatientReportDao;
@Autowired
@Resource
private HtPatientMapper htPatientMapper;
@Autowired
@Resource
private HtPositionDao htPositionDao;
@Autowired
@Resource
private HtPatientReportRecordMapper htPatientReportRecordMapper;
@Autowired
@Resource
private HtPatientFollowUpMapper htPatientFollowUpMapper;
@Override
@ -90,6 +91,9 @@ public class PatientReportService implements IPatientReportService {
htPatientReport.setName(Constant.Ht.Report.PARENT_NAME + DateUtil.today());
htPatientReport.setSerialNumber(htPatient.getId() + "_" + (times + 1));
htPatientReport.setReportTime(System.currentTimeMillis());
// 查询医院信息
String hospital = htPositionDao.queryHospital(doctors.get(0).getPositionId());
htPatientReport.setHospital(hospital);
htPatientReportDao.insertSelective(htPatientReport);
log.info("生成病友报告单:{}", generate);
PatientReportVo.Generate generateVo = new PatientReportVo.Generate();
@ -168,10 +172,10 @@ public class PatientReportService implements IPatientReportService {
List<HtDoctor> doctors = htDoctorMapper.selectByExample(doctorExample);
log.info("当前用户是否为医生:{}", CollectionUtil.isNotEmpty(doctors));
if (query.getPatientId() != null) {
reportExample.createCriteria().andPatientIdEqualTo(query.getPatientId());
reportExample.createCriteria().andPatientIdEqualTo(query.getPatientId()).andShowStatusEqualTo(Constant.Ht.Report.SHOW_HISTORY);
//.andInitialImpressionIsNotNull().andInitialImpressionNotEqualTo("");
} else if (CollectionUtil.isNotEmpty(doctors)) {
reportExample.createCriteria().andDoctorIdEqualTo(doctors.get(0).getId());
reportExample.createCriteria().andDoctorIdEqualTo(doctors.get(0).getId()).andShowStatusEqualTo(Constant.Ht.Report.SHOW_HISTORY);
//.andInitialImpressionIsNotNull().andInitialImpressionNotEqualTo("");
} else {
log.info("既无病人信息,有无医生信息,不允许查询");
@ -387,7 +391,7 @@ public class PatientReportService implements IPatientReportService {
addCell(row2,"报告日期:",4,1, 0);
content.add(row2);
String path = PropUtil.imgDomain + "/" + PdfUtil.credatePdf(PropUtil.path, detail.getPatient().getName(), detail.getPatient().toPdfRow(), content);
String path = PropUtil.imgDomain + "/" + PdfUtil.credatePdf(PropUtil.path, detail.getPatient().getHospital()+Constant.Ht.Report.PARENT_NAME, detail.getPatient().toPdfRow(), content);
report.setUrl(path);
htPatientReportDao.updateByPrimaryKeySelective(report);
log.info("生成文件路径:{}", path);

64
ht/src/main/java/com/ccsens/ht/service/PatientService.java

@ -26,6 +26,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
@ -44,9 +45,9 @@ import java.util.Map;
public class PatientService implements IPatientService {
@Autowired
private Snowflake snowflake;
@Autowired
@Resource
private HtPatientReportMapper htPatientReportMapper;
@Autowired
@Resource
private HtPatientMapper htPatientMapper;
@Autowired
private TallFeignClient tallFeignClient;
@ -60,7 +61,7 @@ public class PatientService implements IPatientService {
example.setOrderByClause("create_time desc");
List<HtPatient> htPatients = htPatientMapper.selectByExample(example);
PageInfo pageInfo = new PageInfo(htPatients);
List<PatientVo.Query> copy = PatientVo.Query.copy(pageInfo.getList());
List<PatientVo.Query> copy = PatientVo.Query.copy(pageInfo.getList(), userId);
pageInfo.setList(copy);
return pageInfo;
}
@ -137,8 +138,10 @@ public class PatientService implements IPatientService {
if (patient.getId()!=null && patient.getId() > 0 && oldPatient.getId().longValue()!=patient.getId().longValue()) {
return 0;
}
} else if (patient.getId() != null && patient.getId().longValue() !=0){
oldPatient = htPatientMapper.selectByPrimaryKey(patient.getId());
log.info("修改身份证:{}", oldPatient);
}
} else {
oldPatient = htPatientMapper.selectByPrimaryKey(patient.getId());
if (oldPatient == null) {
@ -146,7 +149,6 @@ public class PatientService implements IPatientService {
}
}
if (oldPatient == null || oldPatient.getUserId() == null || oldPatient.getUserId() == 0) {
UserDto.DefaultUserSingup signup = new UserDto.DefaultUserSingup();
signup.setAccount(patient.getMobile());
@ -169,6 +171,13 @@ public class PatientService implements IPatientService {
tallFeignClient.assignRoles(assign);
}
if (oldPatient != null) {
boolean isNotRecorder = oldPatient.getRecorder() != null
&& oldPatient.getRecorder().longValue() != 0
&& oldPatient.getRecorder().longValue() != userId.longValue();
log.info("不是录入者操作:{}", isNotRecorder);
if (isNotRecorder) {
throw new BaseException(CodeEnum.RECORDER_NOT);
}
patient.setId(oldPatient.getId());
htPatientMapper.updateByPrimaryKeySelective(patient);
} else {
@ -221,27 +230,42 @@ public class PatientService implements IPatientService {
@Override
public long editPatientOtherMsg(PatientDto.EditOtherMsg edit, Long userId) {
String type = edit.getEditType();
JSONObject json = edit.getModel();
Object bean = SpringContextUtils.getBean(type.substring(0,1).toLowerCase() + type.substring(1) + "Mapper");
//有id则修改,无则添加
String methodName;
String id = "id";
if (json.getLong(id) == null || json.getLong(id) == 0 ) {
methodName = "insertSelective";
json.put("isDel", 0);
json.put(id, snowflake.nextId());
} else {
methodName = "updateByPrimaryKey";
}
try {
String type = edit.getEditType();
JSONObject json = edit.getModel();
Object bean = SpringContextUtils.getBean(type.substring(0,1).toLowerCase() + type.substring(1) + "Mapper");
//有id则修改,无则添加
String methodName;
String id = "id";
String recorder = "recorder";
if (json.getLong(id) == null || json.getLong(id) == 0 ) {
methodName = "insertSelective";
json.put("isDel", 0);
json.put(id, snowflake.nextId());
json.put(recorder, userId);
} else {
methodName = "updateByPrimaryKeySelective";
Method method = bean.getClass().getMethod("selectByPrimaryKey", Long.class);
//方法调用(保存/修改)
Object invoke = method.invoke(bean, json.getLong(id));
log.info("查询病人其他信息:{}", invoke);
if (invoke == null) {
throw new BaseException(CodeEnum.PARAM_ERROR);
}
JSONObject queryJson = JSONObject.parseObject(JSONObject.toJSONString(invoke));
if (queryJson.getLongValue(recorder)!=0 && queryJson.getLongValue(recorder) != userId.longValue()) {
log.info("录入者:{}和当前用户:{}不是同一个人", queryJson.getLongValue(recorder), userId);
throw new BaseException(CodeEnum.RECORDER_NOT);
}
}
log.info("{}:{}", methodName, json);
//请求参数
Class<?> modelClass = Class.forName("com.ccsens.ht.bean.po." + type);
Object model = json.toJavaObject(modelClass);
//方法
Method method = bean.getClass().getMethod(methodName, modelClass);
log.info("method:{}", method);
//方法调用(保存/修改)
method.invoke(bean, model);
return json.getLong("id");

51
ht/src/main/java/com/ccsens/ht/service/QuestionService.java

@ -24,6 +24,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
@ -45,21 +46,21 @@ public class QuestionService implements IQuestionService {
@Autowired
private Snowflake snowflake;
@Autowired
@Resource
private HtQuestionDao htQuestionDao;
@Autowired
@Resource
private HtQuestionIntroducerDao htQuestionIntroducerDao;
@Autowired
@Resource
private HtQuestionOptionDao htQuestionOptionDao;
@Autowired
@Resource
private HtPatientQuestionRecordMapper htPatientQuestionRecordMapper;
@Autowired
@Resource
private HtPatientScoreDao htPatientScoreDao;
@Autowired
@Resource
private HtPatientReportMapper htPatientReportMapper;
@Autowired
@Resource
private HtQuestionScoringRuleDao htQuestionScoringRuleDao;
@Autowired
@Resource
private HtReportDao htReportDao;
@ -170,6 +171,10 @@ public class QuestionService implements IQuestionService {
if (report == null) {
return CodeEnum.PARAM_ERROR;
}
if (StrUtil.isNotBlank(report.getClinicalDiagnosis())) {
log.info("报告单已经填写临床诊断,不能修改答案");
return CodeEnum.REPORT_HAD_COMPLETED;
}
//查询规则
HtQuestionScoringRuleExample ruleExample = new HtQuestionScoringRuleExample();
ruleExample.createCriteria().andQuestionIdEqualTo(question.getId());
@ -217,9 +222,27 @@ public class QuestionService implements IQuestionService {
// 保存答案
saveAnswerRecord(score, question);
//修改报告单是否完成一次测评
changeShowStatus(report, question);
return CodeEnum.SUCCESS;
}
/**
* 修改报告单显示状态
* @param report
* @param question
*/
private void changeShowStatus(HtPatientReport report, HtQuestion question) {
if (report.getShowStatus() != null && report.getShowStatus().byteValue() == Constant.Ht.Report.SHOW_HISTORY) {
return;
}
Integer maxSort = htQuestionDao.selectMaxSort(question.getEvaluationCode());
if (question.getSort() != null && question.getSort().intValue() >= maxSort) {
report.setShowStatus(Constant.Ht.Report.SHOW_HISTORY);
htPatientReportMapper.updateByPrimaryKeySelective(report);
}
}
private void saveAnswerRecord(QuestionDto.Score score, HtQuestion question) {
if (StrUtil.isNotBlank(score.getPath())) {
HtPatientQuestionRecordExample example = new HtPatientQuestionRecordExample();
@ -323,7 +346,8 @@ public class QuestionService implements IQuestionService {
List<HtPatientScore> scores = new ArrayList<>();
for(QuestionDto.Option option : score.getOptions()) {
HtQuestionOption questionOption = idOption.get(option.getId());
assembleScore(score, question, report, ruleList, nameOption, scores, questionOption);
assembleScore(score, option, question, report, ruleList, nameOption, scores, questionOption);
}
String special = "NPI";
if (special.equalsIgnoreCase(question.getEvaluationCode())) {
@ -331,7 +355,7 @@ public class QuestionService implements IQuestionService {
example.createCriteria().andQuestionIdEqualTo(question.getId()).andNameEqualTo("result");
List<HtQuestionOption> htQuestionOptions = htQuestionOptionDao.selectByExample(example);
for (HtQuestionOption option: htQuestionOptions) {
assembleScore(score, question, report, ruleList, nameOption, scores, option);
assembleScore(score, null, question, report, ruleList, nameOption, scores, option);
}
}
@ -341,14 +365,15 @@ public class QuestionService implements IQuestionService {
/**
* 组装分数对象
* @param score
* @param option 当前选项前端传入
* @param question
* @param report
* @param ruleList
* @param nameOption
* @param scores
* @param questionOption
* @param questionOption 当前选项数据库查询
*/
private void assembleScore(QuestionDto.Score score, HtQuestion question, HtPatientReport report, List<HtQuestionScoringRule> ruleList, Map<String, HtQuestionOption> nameOption, List<HtPatientScore> scores, HtQuestionOption questionOption) {
private void assembleScore(QuestionDto.Score score, QuestionDto.Option option, HtQuestion question, HtPatientReport report, List<HtQuestionScoringRule> ruleList, Map<String, HtQuestionOption> nameOption, List<HtPatientScore> scores, HtQuestionOption questionOption) {
HtPatientScore patientScore = new HtPatientScore();
patientScore.setId(snowflake.nextId());
patientScore.setPatientReportId(score.getPatientReportId());
@ -363,7 +388,7 @@ public class QuestionService implements IQuestionService {
} else {
patientScore.setScore(questionOption.getScore());
}
patientScore.setAnswerTime(option == null ? System.currentTimeMillis() : option.getAnswerTime() == null ? 0 : option.getAnswerTime());
patientScore.setType(CollectionUtil.isNotEmpty(ruleList) ? Constant.Ht.Score.ANSWER : Constant.Ht.Score.ANSWER_SCORE);
scores.add(patientScore);
}

2
ht/src/main/java/com/ccsens/ht/uitl/Constant.java

@ -109,6 +109,8 @@ public class Constant {
public final static Byte TYPE_EVALUATION = 2;
public final static String IGNORE_SCORE = "[个]";
public final static String MOCA_SJZ = "SZJ";
/**在历史报告单中显示*/
public final static byte SHOW_HISTORY = 1;
public final static Map<String, Byte> TYPE = new HashMap<>();
static {
//1:报告单 2:测评 3:测评子类 4:二级子类

1
ht/src/main/resources/mapper_dao/HtPatientReportDao.xml

@ -25,6 +25,7 @@
<result column="educational_status" jdbcType="TINYINT" property="educationalStatus" />
<result column="educational_status_unit" jdbcType="VARCHAR" property="educationalStatusUnit" />
<result column="career" jdbcType="TINYINT" property="career" />
<result column="hospital" jdbcType="VARCHAR" property="hospital" />
</resultMap>
<resultMap id="ScoreMap" type="com.ccsens.ht.bean.vo.PatientReportVo$ReportScore">
<result column="code" jdbcType="VARCHAR" property="code"/>

14
ht/src/main/resources/mapper_dao/HtPositionDao.xml

@ -59,5 +59,19 @@
(select @pids := #{id,jdbcType=BIGINT}) t2
) t3 where t3.type = 3 and ischild != 0
</select>
<select id="queryHospital" resultType="java.lang.String">
select t2.name from
(
select @r as _id,(select @r:=superior_department_id from t_ht_position where id = _id) as parent_id,
@l:=@l + 1 as lvl
from (SELECT @r := #{positionId,jdbcType=BIGINT}, @l := 0) vars,
t_ht_position h
where @r &lt;&gt; 0 and is_del = 0
) t1
JOIN t_ht_position t2
on t1._id = t2.id
where t2.is_del = 0 and t2.superior_department_id = 0
ORDER BY t1.lvl desc;
</select>
</mapper>

29
ht/src/main/resources/mapper_raw/HtPatientAcpMapper.xml

@ -16,6 +16,7 @@
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="is_del" jdbcType="TINYINT" property="isDel" />
<result column="recorder" jdbcType="BIGINT" property="recorder" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -77,7 +78,7 @@
</sql>
<sql id="Base_Column_List">
id, patient_id, ct, mri, hcy, vb12, folic_acid, tt3, tt4, tsh, remark, create_time,
update_time, is_del
update_time, is_del, recorder
</sql>
<select id="selectByExample" parameterType="com.ccsens.ht.bean.po.HtPatientAcpExample" resultMap="BaseResultMap">
select
@ -113,13 +114,13 @@
insert into t_ht_patient_acp (id, patient_id, ct,
mri, hcy, vb12, folic_acid,
tt3, tt4, tsh, remark,
create_time, update_time, is_del
)
create_time, update_time, is_del,
recorder)
values (#{id,jdbcType=BIGINT}, #{patientId,jdbcType=BIGINT}, #{ct,jdbcType=VARCHAR},
#{mri,jdbcType=VARCHAR}, #{hcy,jdbcType=VARCHAR}, #{vb12,jdbcType=VARCHAR}, #{folicAcid,jdbcType=VARCHAR},
#{tt3,jdbcType=VARCHAR}, #{tt4,jdbcType=VARCHAR}, #{tsh,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{isDel,jdbcType=TINYINT}
)
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{isDel,jdbcType=TINYINT},
#{recorder,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.ht.bean.po.HtPatientAcp">
insert into t_ht_patient_acp
@ -166,6 +167,9 @@
<if test="isDel != null">
is_del,
</if>
<if test="recorder != null">
recorder,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -210,6 +214,9 @@
<if test="isDel != null">
#{isDel,jdbcType=TINYINT},
</if>
<if test="recorder != null">
#{recorder,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.ht.bean.po.HtPatientAcpExample" resultType="java.lang.Long">
@ -263,6 +270,9 @@
<if test="record.isDel != null">
is_del = #{record.isDel,jdbcType=TINYINT},
</if>
<if test="record.recorder != null">
recorder = #{record.recorder,jdbcType=BIGINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -283,7 +293,8 @@
remark = #{record.remark,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
is_del = #{record.isDel,jdbcType=TINYINT}
is_del = #{record.isDel,jdbcType=TINYINT},
recorder = #{record.recorder,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -330,6 +341,9 @@
<if test="isDel != null">
is_del = #{isDel,jdbcType=TINYINT},
</if>
<if test="recorder != null">
recorder = #{recorder,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
@ -347,7 +361,8 @@
remark = #{remark,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
is_del = #{isDel,jdbcType=TINYINT}
is_del = #{isDel,jdbcType=TINYINT},
recorder = #{recorder,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

29
ht/src/main/resources/mapper_raw/HtPatientBodyMapper.xml

@ -16,6 +16,7 @@
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="is_del" jdbcType="TINYINT" property="isDel" />
<result column="recorder" jdbcType="BIGINT" property="recorder" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -77,7 +78,7 @@
</sql>
<sql id="Base_Column_List">
id, patient_id, height, weight, waistline, blood_pressure_shrink, blood_pressure_diastole,
resting_heart_rate, vision, auditory, remark, create_time, update_time, is_del
resting_heart_rate, vision, auditory, remark, create_time, update_time, is_del, recorder
</sql>
<select id="selectByExample" parameterType="com.ccsens.ht.bean.po.HtPatientBodyExample" resultMap="BaseResultMap">
select
@ -114,14 +115,14 @@
weight, waistline, blood_pressure_shrink,
blood_pressure_diastole, resting_heart_rate,
vision, auditory, remark,
create_time, update_time, is_del
)
create_time, update_time, is_del,
recorder)
values (#{id,jdbcType=BIGINT}, #{patientId,jdbcType=BIGINT}, #{height,jdbcType=VARCHAR},
#{weight,jdbcType=VARCHAR}, #{waistline,jdbcType=VARCHAR}, #{bloodPressureShrink,jdbcType=VARCHAR},
#{bloodPressureDiastole,jdbcType=VARCHAR}, #{restingHeartRate,jdbcType=VARCHAR},
#{vision,jdbcType=TINYINT}, #{auditory,jdbcType=TINYINT}, #{remark,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{isDel,jdbcType=TINYINT}
)
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{isDel,jdbcType=TINYINT},
#{recorder,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.ht.bean.po.HtPatientBody">
insert into t_ht_patient_body
@ -168,6 +169,9 @@
<if test="isDel != null">
is_del,
</if>
<if test="recorder != null">
recorder,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -212,6 +216,9 @@
<if test="isDel != null">
#{isDel,jdbcType=TINYINT},
</if>
<if test="recorder != null">
#{recorder,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.ht.bean.po.HtPatientBodyExample" resultType="java.lang.Long">
@ -265,6 +272,9 @@
<if test="record.isDel != null">
is_del = #{record.isDel,jdbcType=TINYINT},
</if>
<if test="record.recorder != null">
recorder = #{record.recorder,jdbcType=BIGINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -285,7 +295,8 @@
remark = #{record.remark,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
is_del = #{record.isDel,jdbcType=TINYINT}
is_del = #{record.isDel,jdbcType=TINYINT},
recorder = #{record.recorder,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -332,6 +343,9 @@
<if test="isDel != null">
is_del = #{isDel,jdbcType=TINYINT},
</if>
<if test="recorder != null">
recorder = #{recorder,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
@ -349,7 +363,8 @@
remark = #{remark,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
is_del = #{isDel,jdbcType=TINYINT}
is_del = #{isDel,jdbcType=TINYINT},
recorder = #{recorder,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

27
ht/src/main/resources/mapper_raw/HtPatientFamilyIllnessMapper.xml

@ -13,6 +13,7 @@
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="is_del" jdbcType="TINYINT" property="isDel" />
<result column="recorder" jdbcType="BIGINT" property="recorder" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -74,7 +75,7 @@
</sql>
<sql id="Base_Column_List">
id, patient_id, name, relation, diagnose, onset_age, now_age, remark, create_time,
update_time, is_del
update_time, is_del, recorder
</sql>
<select id="selectByExample" parameterType="com.ccsens.ht.bean.po.HtPatientFamilyIllnessExample" resultMap="BaseResultMap">
select
@ -110,11 +111,13 @@
insert into t_ht_patient_family_illness (id, patient_id, name,
relation, diagnose, onset_age,
now_age, remark, create_time,
update_time, is_del)
update_time, is_del, recorder
)
values (#{id,jdbcType=BIGINT}, #{patientId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR},
#{relation,jdbcType=VARCHAR}, #{diagnose,jdbcType=VARCHAR}, #{onsetAge,jdbcType=INTEGER},
#{nowAge,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{isDel,jdbcType=TINYINT})
#{updateTime,jdbcType=TIMESTAMP}, #{isDel,jdbcType=TINYINT}, #{recorder,jdbcType=BIGINT}
)
</insert>
<insert id="insertSelective" parameterType="com.ccsens.ht.bean.po.HtPatientFamilyIllness">
insert into t_ht_patient_family_illness
@ -152,6 +155,9 @@
<if test="isDel != null">
is_del,
</if>
<if test="recorder != null">
recorder,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -187,6 +193,9 @@
<if test="isDel != null">
#{isDel,jdbcType=TINYINT},
</if>
<if test="recorder != null">
#{recorder,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.ht.bean.po.HtPatientFamilyIllnessExample" resultType="java.lang.Long">
@ -231,6 +240,9 @@
<if test="record.isDel != null">
is_del = #{record.isDel,jdbcType=TINYINT},
</if>
<if test="record.recorder != null">
recorder = #{record.recorder,jdbcType=BIGINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -248,7 +260,8 @@
remark = #{record.remark,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
is_del = #{record.isDel,jdbcType=TINYINT}
is_del = #{record.isDel,jdbcType=TINYINT},
recorder = #{record.recorder,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -286,6 +299,9 @@
<if test="isDel != null">
is_del = #{isDel,jdbcType=TINYINT},
</if>
<if test="recorder != null">
recorder = #{recorder,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
@ -300,7 +316,8 @@
remark = #{remark,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
is_del = #{isDel,jdbcType=TINYINT}
is_del = #{isDel,jdbcType=TINYINT},
recorder = #{recorder,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

29
ht/src/main/resources/mapper_raw/HtPatientFamilyMapper.xml

@ -14,6 +14,7 @@
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="is_del" jdbcType="TINYINT" property="isDel" />
<result column="recorder" jdbcType="BIGINT" property="recorder" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -75,7 +76,7 @@
</sql>
<sql id="Base_Column_List">
id, patient_id, name, age, sex, educational_status, relation, is_live_together, remark,
create_time, update_time, is_del
create_time, update_time, is_del, recorder
</sql>
<select id="selectByExample" parameterType="com.ccsens.ht.bean.po.HtPatientFamilyExample" resultMap="BaseResultMap">
select
@ -111,13 +112,13 @@
insert into t_ht_patient_family (id, patient_id, name,
age, sex, educational_status,
relation, is_live_together, remark,
create_time, update_time, is_del
)
create_time, update_time, is_del,
recorder)
values (#{id,jdbcType=BIGINT}, #{patientId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR},
#{age,jdbcType=TINYINT}, #{sex,jdbcType=TINYINT}, #{educationalStatus,jdbcType=TINYINT},
#{relation,jdbcType=TINYINT}, #{isLiveTogether,jdbcType=TINYINT}, #{remark,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{isDel,jdbcType=TINYINT}
)
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{isDel,jdbcType=TINYINT},
#{recorder,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.ht.bean.po.HtPatientFamily">
insert into t_ht_patient_family
@ -158,6 +159,9 @@
<if test="isDel != null">
is_del,
</if>
<if test="recorder != null">
recorder,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -196,6 +200,9 @@
<if test="isDel != null">
#{isDel,jdbcType=TINYINT},
</if>
<if test="recorder != null">
#{recorder,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.ht.bean.po.HtPatientFamilyExample" resultType="java.lang.Long">
@ -243,6 +250,9 @@
<if test="record.isDel != null">
is_del = #{record.isDel,jdbcType=TINYINT},
</if>
<if test="record.recorder != null">
recorder = #{record.recorder,jdbcType=BIGINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -261,7 +271,8 @@
remark = #{record.remark,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
is_del = #{record.isDel,jdbcType=TINYINT}
is_del = #{record.isDel,jdbcType=TINYINT},
recorder = #{record.recorder,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -302,6 +313,9 @@
<if test="isDel != null">
is_del = #{isDel,jdbcType=TINYINT},
</if>
<if test="recorder != null">
recorder = #{recorder,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
@ -317,7 +331,8 @@
remark = #{remark,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
is_del = #{isDel,jdbcType=TINYINT}
is_del = #{isDel,jdbcType=TINYINT},
recorder = #{recorder,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

25
ht/src/main/resources/mapper_raw/HtPatientIllnessHistoryMapper.xml

@ -33,6 +33,7 @@
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="is_del" jdbcType="TINYINT" property="isDel" />
<result column="recorder" jdbcType="BIGINT" property="recorder" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -97,7 +98,7 @@
wuis, hcvd, parkinson_disease, epilepsy, brain_trauma, hypertension, diabetes, hlp,
hyperhomocysteinemia, vb12_deficiency, thyroid_disease, copd, asthma, insomnia, sleep_suspend,
ckd, rheumatoid, depression, general_anesthesia_surgery, remark, create_time, update_time,
is_del
is_del, recorder
</sql>
<select id="selectByExample" parameterType="com.ccsens.ht.bean.po.HtPatientIllnessHistoryExample" resultMap="BaseResultMap">
select
@ -140,7 +141,7 @@
insomnia, sleep_suspend, ckd,
rheumatoid, depression, general_anesthesia_surgery,
remark, create_time, update_time,
is_del)
is_del, recorder)
values (#{id,jdbcType=BIGINT}, #{patientId,jdbcType=BIGINT}, #{cardiacArrestHistory,jdbcType=TINYINT},
#{angina,jdbcType=TINYINT}, #{mi,jdbcType=TINYINT}, #{atrialFibrillation,jdbcType=TINYINT},
#{chf,jdbcType=TINYINT}, #{otherCardiovascularDiseases,jdbcType=TINYINT}, #{wuis,jdbcType=TINYINT},
@ -151,7 +152,7 @@
#{insomnia,jdbcType=TINYINT}, #{sleepSuspend,jdbcType=TINYINT}, #{ckd,jdbcType=TINYINT},
#{rheumatoid,jdbcType=TINYINT}, #{depression,jdbcType=TINYINT}, #{generalAnesthesiaSurgery,jdbcType=INTEGER},
#{remark,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{isDel,jdbcType=TINYINT})
#{isDel,jdbcType=TINYINT}, #{recorder,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.ht.bean.po.HtPatientIllnessHistory">
insert into t_ht_patient_illness_history
@ -249,6 +250,9 @@
<if test="isDel != null">
is_del,
</if>
<if test="recorder != null">
recorder,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -344,6 +348,9 @@
<if test="isDel != null">
#{isDel,jdbcType=TINYINT},
</if>
<if test="recorder != null">
#{recorder,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.ht.bean.po.HtPatientIllnessHistoryExample" resultType="java.lang.Long">
@ -448,6 +455,9 @@
<if test="record.isDel != null">
is_del = #{record.isDel,jdbcType=TINYINT},
</if>
<if test="record.recorder != null">
recorder = #{record.recorder,jdbcType=BIGINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -485,7 +495,8 @@
remark = #{record.remark,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
is_del = #{record.isDel,jdbcType=TINYINT}
is_del = #{record.isDel,jdbcType=TINYINT},
recorder = #{record.recorder,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -583,6 +594,9 @@
<if test="isDel != null">
is_del = #{isDel,jdbcType=TINYINT},
</if>
<if test="recorder != null">
recorder = #{recorder,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
@ -617,7 +631,8 @@
remark = #{remark,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
is_del = #{isDel,jdbcType=TINYINT}
is_del = #{isDel,jdbcType=TINYINT},
recorder = #{recorder,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

27
ht/src/main/resources/mapper_raw/HtPatientParentIllnessMapper.xml

@ -22,6 +22,7 @@
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="is_del" jdbcType="TINYINT" property="isDel" />
<result column="recorder" jdbcType="BIGINT" property="recorder" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -84,7 +85,7 @@
<sql id="Base_Column_List">
id, patient_id, memory, language, space, emotion, depression, illusion, delusion,
derepression, irritable, personality_changes, exercise, first_illness, reason, change_form,
remark, create_time, update_time, is_del
remark, create_time, update_time, is_del, recorder
</sql>
<select id="selectByExample" parameterType="com.ccsens.ht.bean.po.HtPatientParentIllnessExample" resultMap="BaseResultMap">
select
@ -123,14 +124,16 @@
derepression, irritable, personality_changes,
exercise, first_illness, reason,
change_form, remark, create_time,
update_time, is_del)
update_time, is_del, recorder
)
values (#{id,jdbcType=BIGINT}, #{patientId,jdbcType=BIGINT}, #{memory,jdbcType=TINYINT},
#{language,jdbcType=TINYINT}, #{space,jdbcType=TINYINT}, #{emotion,jdbcType=TINYINT},
#{depression,jdbcType=TINYINT}, #{illusion,jdbcType=TINYINT}, #{delusion,jdbcType=TINYINT},
#{derepression,jdbcType=TINYINT}, #{irritable,jdbcType=TINYINT}, #{personalityChanges,jdbcType=TINYINT},
#{exercise,jdbcType=TINYINT}, #{firstIllness,jdbcType=TINYINT}, #{reason,jdbcType=TINYINT},
#{changeForm,jdbcType=TINYINT}, #{remark,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{isDel,jdbcType=TINYINT})
#{updateTime,jdbcType=TIMESTAMP}, #{isDel,jdbcType=TINYINT}, #{recorder,jdbcType=BIGINT}
)
</insert>
<insert id="insertSelective" parameterType="com.ccsens.ht.bean.po.HtPatientParentIllness">
insert into t_ht_patient_parent_illness
@ -195,6 +198,9 @@
<if test="isDel != null">
is_del,
</if>
<if test="recorder != null">
recorder,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -257,6 +263,9 @@
<if test="isDel != null">
#{isDel,jdbcType=TINYINT},
</if>
<if test="recorder != null">
#{recorder,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.ht.bean.po.HtPatientParentIllnessExample" resultType="java.lang.Long">
@ -328,6 +337,9 @@
<if test="record.isDel != null">
is_del = #{record.isDel,jdbcType=TINYINT},
</if>
<if test="record.recorder != null">
recorder = #{record.recorder,jdbcType=BIGINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -354,7 +366,8 @@
remark = #{record.remark,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
is_del = #{record.isDel,jdbcType=TINYINT}
is_del = #{record.isDel,jdbcType=TINYINT},
recorder = #{record.recorder,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -419,6 +432,9 @@
<if test="isDel != null">
is_del = #{isDel,jdbcType=TINYINT},
</if>
<if test="recorder != null">
recorder = #{recorder,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
@ -442,7 +458,8 @@
remark = #{remark,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
is_del = #{isDel,jdbcType=TINYINT}
is_del = #{isDel,jdbcType=TINYINT},
recorder = #{recorder,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

25
ht/src/main/resources/mapper_raw/HtPatientPersionalMapper.xml

@ -27,6 +27,7 @@
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="is_del" jdbcType="TINYINT" property="isDel" />
<result column="recorder" jdbcType="BIGINT" property="recorder" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -90,7 +91,7 @@
id, patient_id, smoking_history, smoking_year, smoking_amount, smoking_quit, smoking_quit_year,
drink_history, drink_year, drink_type, drink_amount, tea_coffee_history, tea_coffee_year,
tea_coffee_type, tea_coffee_frequency, tea_coffee_quit, tea_coffee_quit_year, dietary_habit,
workout_time, sleep_time, snore, remark, create_time, update_time, is_del
workout_time, sleep_time, snore, remark, create_time, update_time, is_del, recorder
</sql>
<select id="selectByExample" parameterType="com.ccsens.ht.bean.po.HtPatientPersionalExample" resultMap="BaseResultMap">
select
@ -131,7 +132,7 @@
tea_coffee_quit, tea_coffee_quit_year, dietary_habit,
workout_time, sleep_time, snore,
remark, create_time, update_time,
is_del)
is_del, recorder)
values (#{id,jdbcType=BIGINT}, #{patientId,jdbcType=BIGINT}, #{smokingHistory,jdbcType=TINYINT},
#{smokingYear,jdbcType=INTEGER}, #{smokingAmount,jdbcType=INTEGER}, #{smokingQuit,jdbcType=TINYINT},
#{smokingQuitYear,jdbcType=INTEGER}, #{drinkHistory,jdbcType=TINYINT}, #{drinkYear,jdbcType=INTEGER},
@ -140,7 +141,7 @@
#{teaCoffeeQuit,jdbcType=TINYINT}, #{teaCoffeeQuitYear,jdbcType=INTEGER}, #{dietaryHabit,jdbcType=TINYINT},
#{workoutTime,jdbcType=TINYINT}, #{sleepTime,jdbcType=INTEGER}, #{snore,jdbcType=TINYINT},
#{remark,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{isDel,jdbcType=TINYINT})
#{isDel,jdbcType=TINYINT}, #{recorder,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.ht.bean.po.HtPatientPersional">
insert into t_ht_patient_persional
@ -220,6 +221,9 @@
<if test="isDel != null">
is_del,
</if>
<if test="recorder != null">
recorder,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -297,6 +301,9 @@
<if test="isDel != null">
#{isDel,jdbcType=TINYINT},
</if>
<if test="recorder != null">
#{recorder,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.ht.bean.po.HtPatientPersionalExample" resultType="java.lang.Long">
@ -383,6 +390,9 @@
<if test="record.isDel != null">
is_del = #{record.isDel,jdbcType=TINYINT},
</if>
<if test="record.recorder != null">
recorder = #{record.recorder,jdbcType=BIGINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -414,7 +424,8 @@
remark = #{record.remark,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
is_del = #{record.isDel,jdbcType=TINYINT}
is_del = #{record.isDel,jdbcType=TINYINT},
recorder = #{record.recorder,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -494,6 +505,9 @@
<if test="isDel != null">
is_del = #{isDel,jdbcType=TINYINT},
</if>
<if test="recorder != null">
recorder = #{recorder,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
@ -522,7 +536,8 @@
remark = #{remark,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
is_del = #{isDel,jdbcType=TINYINT}
is_del = #{isDel,jdbcType=TINYINT},
recorder = #{recorder,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

44
ht/src/main/resources/mapper_raw/HtPatientReportMapper.xml

@ -23,6 +23,8 @@
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="is_del" jdbcType="TINYINT" property="isDel" />
<result column="show_status" jdbcType="TINYINT" property="showStatus" />
<result column="hospital" jdbcType="VARCHAR" property="hospital" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -85,7 +87,7 @@
<sql id="Base_Column_List">
id, name, patient_id, patient_idcard, patient_age, doctor_id, serial_number, initial_impression,
clinical_diagnosis, pasi, department, bed_number, report_time, check_time, evaluation_code,
url, qr_code_url, remark, create_time, update_time, is_del
url, qr_code_url, remark, create_time, update_time, is_del, show_status, hospital
</sql>
<select id="selectByExample" parameterType="com.ccsens.ht.bean.po.HtPatientReportExample" resultMap="BaseResultMap">
select
@ -124,16 +126,16 @@
pasi, department, bed_number,
report_time, check_time, evaluation_code,
url, qr_code_url, remark,
create_time, update_time, is_del
)
create_time, update_time, is_del,
show_status, hospital)
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{patientId,jdbcType=BIGINT},
#{patientIdcard,jdbcType=VARCHAR}, #{patientAge,jdbcType=TINYINT}, #{doctorId,jdbcType=BIGINT},
#{serialNumber,jdbcType=VARCHAR}, #{initialImpression,jdbcType=VARCHAR}, #{clinicalDiagnosis,jdbcType=VARCHAR},
#{pasi,jdbcType=TINYINT}, #{department,jdbcType=VARCHAR}, #{bedNumber,jdbcType=VARCHAR},
#{reportTime,jdbcType=BIGINT}, #{checkTime,jdbcType=BIGINT}, #{evaluationCode,jdbcType=VARCHAR},
#{url,jdbcType=VARCHAR}, #{qrCodeUrl,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{isDel,jdbcType=TINYINT}
)
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{isDel,jdbcType=TINYINT},
#{showStatus,jdbcType=TINYINT}, #{hospital,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.ht.bean.po.HtPatientReport">
insert into t_ht_patient_report
@ -201,6 +203,12 @@
<if test="isDel != null">
is_del,
</if>
<if test="showStatus != null">
show_status,
</if>
<if test="hospital != null">
hospital,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -266,6 +274,12 @@
<if test="isDel != null">
#{isDel,jdbcType=TINYINT},
</if>
<if test="showStatus != null">
#{showStatus,jdbcType=TINYINT},
</if>
<if test="hospital != null">
#{hospital,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.ht.bean.po.HtPatientReportExample" resultType="java.lang.Long">
@ -340,6 +354,12 @@
<if test="record.isDel != null">
is_del = #{record.isDel,jdbcType=TINYINT},
</if>
<if test="record.showStatus != null">
show_status = #{record.showStatus,jdbcType=TINYINT},
</if>
<if test="record.hospital != null">
hospital = #{record.hospital,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -367,7 +387,9 @@
remark = #{record.remark,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
is_del = #{record.isDel,jdbcType=TINYINT}
is_del = #{record.isDel,jdbcType=TINYINT},
show_status = #{record.showStatus,jdbcType=TINYINT},
hospital = #{record.hospital,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -435,6 +457,12 @@
<if test="isDel != null">
is_del = #{isDel,jdbcType=TINYINT},
</if>
<if test="showStatus != null">
show_status = #{showStatus,jdbcType=TINYINT},
</if>
<if test="hospital != null">
hospital = #{hospital,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
@ -459,7 +487,9 @@
remark = #{remark,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
is_del = #{isDel,jdbcType=TINYINT}
is_del = #{isDel,jdbcType=TINYINT},
show_status = #{showStatus,jdbcType=TINYINT},
hospital = #{hospital,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

27
ht/src/main/resources/mapper_raw/HtPatientScoreMapper.xml

@ -16,6 +16,7 @@
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="is_del" jdbcType="TINYINT" property="isDel" />
<result column="answer_time" jdbcType="BIGINT" property="answerTime" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -77,7 +78,7 @@
</sql>
<sql id="Base_Column_List">
id, patient_report_id, patient_id, question_parent_code, question_id, option_id,
option_name, score, type, answer, remark, create_time, update_time, is_del
option_name, score, type, answer, remark, create_time, update_time, is_del, answer_time
</sql>
<select id="selectByExample" parameterType="com.ccsens.ht.bean.po.HtPatientScoreExample" resultMap="BaseResultMap">
select
@ -114,12 +115,14 @@
question_parent_code, question_id, option_id,
option_name, score, type,
answer, remark, create_time,
update_time, is_del)
update_time, is_del, answer_time
)
values (#{id,jdbcType=BIGINT}, #{patientReportId,jdbcType=BIGINT}, #{patientId,jdbcType=BIGINT},
#{questionParentCode,jdbcType=VARCHAR}, #{questionId,jdbcType=BIGINT}, #{optionId,jdbcType=BIGINT},
#{optionName,jdbcType=VARCHAR}, #{score,jdbcType=INTEGER}, #{type,jdbcType=TINYINT},
#{answer,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{isDel,jdbcType=TINYINT})
#{updateTime,jdbcType=TIMESTAMP}, #{isDel,jdbcType=TINYINT}, #{answerTime,jdbcType=BIGINT}
)
</insert>
<insert id="insertSelective" parameterType="com.ccsens.ht.bean.po.HtPatientScore">
insert into t_ht_patient_score
@ -166,6 +169,9 @@
<if test="isDel != null">
is_del,
</if>
<if test="answerTime != null">
answer_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -210,6 +216,9 @@
<if test="isDel != null">
#{isDel,jdbcType=TINYINT},
</if>
<if test="answerTime != null">
#{answerTime,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.ht.bean.po.HtPatientScoreExample" resultType="java.lang.Long">
@ -263,6 +272,9 @@
<if test="record.isDel != null">
is_del = #{record.isDel,jdbcType=TINYINT},
</if>
<if test="record.answerTime != null">
answer_time = #{record.answerTime,jdbcType=BIGINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -283,7 +295,8 @@
remark = #{record.remark,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
is_del = #{record.isDel,jdbcType=TINYINT}
is_del = #{record.isDel,jdbcType=TINYINT},
answer_time = #{record.answerTime,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -330,6 +343,9 @@
<if test="isDel != null">
is_del = #{isDel,jdbcType=TINYINT},
</if>
<if test="answerTime != null">
answer_time = #{answerTime,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
@ -347,7 +363,8 @@
remark = #{remark,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
is_del = #{isDel,jdbcType=TINYINT}
is_del = #{isDel,jdbcType=TINYINT},
answer_time = #{answerTime,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

2
util/src/main/java/com/ccsens/util/CodeEnum.java

@ -106,6 +106,8 @@ public enum CodeEnum {
NO_IMPORT_DATA(88,"没有有效的数据,请检查您的导入文件。",true),
FILL_ERROR(89,"您的信息填写有误,请检查您的信息。",true),
ACCOUNT_BIND(90,"您的帐号已经绑定了,请重新进入小程序。",true),
RECORDER_NOT(91, "对不起,您不是该信息的录入者,不能修改信息。", true),
REPORT_HAD_COMPLETED(92, "报告单已经完成,不能再修改答题记录。", true),
;
public CodeEnum addMsg(String msg){

Loading…
Cancel
Save