Browse Source

bug修改

sd
zhizhi wu 4 years ago
parent
commit
41d1064f3b
  1. 2
      ht/src/main/java/com/ccsens/ht/bean/dto/QuestionDto.java
  2. 2
      ht/src/main/java/com/ccsens/ht/bean/dto/message/MessageDto.java
  3. 9
      ht/src/main/java/com/ccsens/ht/bean/vo/QuestionShowVo.java
  4. 56
      ht/src/main/java/com/ccsens/ht/service/QuestionService.java
  5. 4
      ht/src/main/resources/application.yml
  6. 4
      ht/src/main/resources/mapper_dao/HtQuestionOptionDescDao.xml
  7. 8
      util/src/main/java/com/ccsens/util/bean/message/common/MessageRule.java

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

@ -43,7 +43,7 @@ public class QuestionDto {
@ApiModelProperty("选项集合") @ApiModelProperty("选项集合")
private List<Option> options; private List<Option> options;
@ApiModelProperty("病友画图或录音") @ApiModelProperty("病友画图或录音")
private String path; private List<String> paths;
} }
@Data @Data
@ApiModel("QuestionDtoOption") @ApiModel("QuestionDtoOption")

2
ht/src/main/java/com/ccsens/ht/bean/dto/message/MessageDto.java

@ -28,6 +28,8 @@ public class MessageDto<T> {
@ApiModel("通知跳转到指定题目") @ApiModel("通知跳转到指定题目")
@Data @Data
public static final class QuestionInform{ public static final class QuestionInform{
@ApiModelProperty("taskId")
private Long taskId;
@ApiModelProperty("提醒文案") @ApiModelProperty("提醒文案")
private String content; private String content;
@ApiModelProperty("量表") @ApiModelProperty("量表")

9
ht/src/main/java/com/ccsens/ht/bean/vo/QuestionShowVo.java

@ -18,7 +18,7 @@ public class QuestionShowVo {
@Data @Data
@ApiModel("显示信息") @ApiModel("显示信息")
public static class Show{ public static class Show{
@ApiModelProperty("类型 0:倒计时 1:限制选项数量 2:选中某些指定选项执行操作 3:显示内容") @ApiModelProperty("类型 0:倒计时 1:限制选项数量 2:不是选中指定选项执行操作 3:显示内容")
private byte showType; private byte showType;
} }
@ -66,10 +66,13 @@ public class QuestionShowVo {
@ApiModel("倒计时配置") @ApiModel("倒计时配置")
@Data @Data
public static class MesTimer { public static class MesTimer {
@ApiModelProperty("提醒文案")
private String content;
@ApiModelProperty("限制类型 0:跳转指定题目") @ApiModelProperty("限制类型 0:跳转指定题目")
private byte type; private byte type;
@ApiModelProperty("taskId")
private Long taskId;
@ApiModelProperty("提醒文案")
private String content;
@ApiModelProperty("量表") @ApiModelProperty("量表")
private String code; private String code;
@ApiModelProperty("序号") @ApiModelProperty("序号")

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

@ -365,41 +365,43 @@ public class QuestionService implements IQuestionService {
} }
private void saveAnswerRecord(QuestionDto.Score score, HtQuestion question) { private void saveAnswerRecord(QuestionDto.Score score, HtQuestion question) {
if (StrUtil.isNotBlank(score.getPath())) { if (CollectionUtil.isEmpty(score.getPaths())) {
HtPatientQuestionRecordExample example = new HtPatientQuestionRecordExample(); return;
String type; }
switch (question.getOperateType()) { String type;
//语音 switch (question.getOperateType()) {
case Constant.Ht.Operation.VOICE: //语音
case Constant.Ht.Operation.VOICE:
//敲击 //敲击
case Constant.Ht.Operation.KNOCK: case Constant.Ht.Operation.KNOCK:
type = Constant.Ht.Record.ANSWER_AUDIO; type = Constant.Ht.Record.ANSWER_AUDIO;
break; break;
//画图 //画图
case Constant.Ht.Operation.PAINT: case Constant.Ht.Operation.PAINT:
case Constant.Ht.Operation.PAINT_HALF: case Constant.Ht.Operation.PAINT_HALF:
case Constant.Ht.Operation.PAINT_HALF_IMG: case Constant.Ht.Operation.PAINT_HALF_IMG:
case Constant.Ht.Operation.PAINT_NO_IMG: case Constant.Ht.Operation.PAINT_NO_IMG:
type = Constant.Ht.Record.ANSWER_IMG; type = Constant.Ht.Record.ANSWER_IMG;
break; break;
default: default:
type = Constant.Ht.Record.ANSWER_TEXT; type = Constant.Ht.Record.ANSWER_TEXT;
break; break;
} }
example.createCriteria().andPatientReportIdEqualTo(score.getPatientReportId()).andQuestionIdEqualTo(score.getQuestionId()).andRecordTypeEqualTo(type); HtPatientQuestionRecordExample example = new HtPatientQuestionRecordExample();
HtPatientQuestionRecord delRecord = new HtPatientQuestionRecord(); example.createCriteria().andPatientReportIdEqualTo(score.getPatientReportId()).andQuestionIdEqualTo(score.getQuestionId()).andRecordTypeEqualTo(type);
delRecord.setIsDel(Constant.Ht.IS_DEL); HtPatientQuestionRecord delRecord = new HtPatientQuestionRecord();
htPatientQuestionRecordMapper.updateByExampleSelective(delRecord, example); delRecord.setIsDel(Constant.Ht.IS_DEL);
htPatientQuestionRecordMapper.updateByExampleSelective(delRecord, example);
score.getPaths().forEach(path->{
HtPatientQuestionRecord record = new HtPatientQuestionRecord(); HtPatientQuestionRecord record = new HtPatientQuestionRecord();
record.setId(snowflake.nextId()); record.setId(snowflake.nextId());
record.setPatientReportId(score.getPatientReportId()); record.setPatientReportId(score.getPatientReportId());
record.setQuestionId(score.getQuestionId()); record.setQuestionId(score.getQuestionId());
record.setRecordTime(System.currentTimeMillis()); record.setRecordTime(System.currentTimeMillis());
record.setRecordType(type); record.setRecordType(type);
record.setRecordValue(score.getPath()); record.setRecordValue(path);
htPatientQuestionRecordMapper.insertSelective(record); htPatientQuestionRecordMapper.insertSelective(record);
} });
} }
private void countScore(QuestionDto.Score score, String parentCode, HtPatientReport report, List<HtPatientScore> scores, HtQuestionScoringRule rule) { private void countScore(QuestionDto.Score score, String parentCode, HtPatientReport report, List<HtPatientScore> scores, HtQuestionScoringRule rule) {

4
ht/src/main/resources/application.yml

@ -1,5 +1,5 @@
spring: spring:
profiles: profiles:
active: prod active: test
include: common, util-prod include: common, util-test

4
ht/src/main/resources/mapper_dao/HtQuestionOptionDescDao.xml

@ -6,14 +6,14 @@
<insert id="insertBatch"> <insert id="insertBatch">
replace into t_ht_question_option_desc (id, option_id, type, replace into t_ht_question_option_desc (id, option_id, type,
sort, content, remark) sort, content, remark)
values valuesrec_status
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
(#{item.id}, #{item.optionId}, #{item.type}, #{item.sort}, (#{item.id}, #{item.optionId}, #{item.type}, #{item.sort},
#{item.content}, #{item.remark}) #{item.content}, #{item.remark})
</foreach> </foreach>
</insert> </insert>
<delete id="delete"> <delete id="delete">
update t_ht_question_option_desc set rec_status = 0 where option_id in update t_ht_question_option_desc set is_del = 1 where option_id in
<foreach collection="list" item="item" open="(" close=")" separator=","> <foreach collection="list" item="item" open="(" close=")" separator=",">
#{item} #{item}
</foreach> </foreach>

8
util/src/main/java/com/ccsens/util/bean/message/common/MessageRule.java

@ -64,11 +64,7 @@ public class MessageRule {
messageRule = new MessageRule((byte) 0, AckRule.ALWAYS, 10, (byte) 1,0L); messageRule = new MessageRule((byte) 0, AckRule.ALWAYS, 10, (byte) 1,0L);
break; break;
case Queue: case Queue:
messageRule = new MessageRule((byte) 1, AckRule.ALWAYS, 10, (byte) 1,0L);
break;
case Rest: case Rest:
messageRule = new MessageRule((byte) 1, AckRule.ALWAYS, 10, (byte) 1,0L);
break;
case Server: case Server:
messageRule = new MessageRule((byte) 1, AckRule.ALWAYS, 10, (byte) 1,0L); messageRule = new MessageRule((byte) 1, AckRule.ALWAYS, 10, (byte) 1,0L);
break; break;
@ -80,13 +76,13 @@ public class MessageRule {
/** /**
* 不需要回复ACK离线状态直接丢弃 * 不需要回复ACK离线状态直接丢弃
* @return * @return messageRule
*/ */
public static MessageRule noAck(){ public static MessageRule noAck(){
MessageRule rule = new MessageRule(); MessageRule rule = new MessageRule();
rule.setAckRule(MessageRule.AckRule.NONE); rule.setAckRule(MessageRule.AckRule.NONE);
rule.setOfflineDiscard((byte) 1); rule.setOfflineDiscard((byte) 1);
rule.setNoAckRetryTimes(3); rule.setNoAckRetryTimes(1);
return rule; return rule;
} }
} }

Loading…
Cancel
Save