Browse Source

20201229添加关联试题的id

sd
zy_Java 5 years ago
parent
commit
49d85e7a29
  1. 2
      ht/src/main/java/com/ccsens/ht/bean/vo/QuestionVo.java
  2. 23
      ht/src/main/java/com/ccsens/ht/service/QuestionService.java
  3. 2
      ht/src/main/java/com/ccsens/ht/uitl/Constant.java
  4. 4
      ht/src/main/resources/application.yml
  5. 8
      util/src/main/java/com/ccsens/util/config/ControllerExceptionHandler.java

2
ht/src/main/java/com/ccsens/ht/bean/vo/QuestionVo.java

@ -277,6 +277,8 @@ public class QuestionVo {
private Long questionId; private Long questionId;
@ApiModelProperty("题目类型") @ApiModelProperty("题目类型")
private byte questionType; private byte questionType;
@ApiModelProperty("用户操作类型")
private byte operateType;
@ApiModelProperty("题目详情(画图题的图片)") @ApiModelProperty("题目详情(画图题的图片)")
private String questionName; private String questionName;
@ApiModelProperty("开始时间") @ApiModelProperty("开始时间")

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

@ -483,7 +483,7 @@ public class QuestionService implements IQuestionService {
log.info("报告单id:{},试题id:{}",param.getPatientReportId(),param.getQuestionId()); log.info("报告单id:{},试题id:{}",param.getPatientReportId(),param.getQuestionId());
HtPatientCanvasExample canvasExample = new HtPatientCanvasExample(); HtPatientCanvasExample canvasExample = new HtPatientCanvasExample();
canvasExample.createCriteria().andPatientReportIdEqualTo(param.getPatientReportId()).andQuestionIdEqualTo(param.getQuestionId()); canvasExample.createCriteria().andPatientReportIdEqualTo(param.getPatientReportId()).andQuestionIdEqualTo(param.getQuestionId());
canvasExample.setOrderByClause("begin_time DESC"); canvasExample.setOrderByClause("create_time DESC");
List<HtPatientCanvas> patientCanvasList = patientCanvasDao.selectByExample(canvasExample); List<HtPatientCanvas> patientCanvasList = patientCanvasDao.selectByExample(canvasExample);
log.info("查询画图记录:{}",patientCanvasList); log.info("查询画图记录:{}",patientCanvasList);
if(CollectionUtil.isEmpty(patientCanvasList)){ if(CollectionUtil.isEmpty(patientCanvasList)){
@ -501,6 +501,7 @@ public class QuestionService implements IQuestionService {
patientCanvas.setQuestionId(htPatientCanvas.getQuestionId()); patientCanvas.setQuestionId(htPatientCanvas.getQuestionId());
patientCanvas.setQuestionType(question.getType()); patientCanvas.setQuestionType(question.getType());
patientCanvas.setQuestionName(question.getQuestion()); patientCanvas.setQuestionName(question.getQuestion());
patientCanvas.setOperateType(question.getOperateType());
patientCanvas.setBeginTime(htPatientCanvas.getBeginTime()); patientCanvas.setBeginTime(htPatientCanvas.getBeginTime());
QuestionVo.Canvas canvas = new QuestionVo.Canvas(); QuestionVo.Canvas canvas = new QuestionVo.Canvas();
@ -530,10 +531,11 @@ public class QuestionService implements IQuestionService {
int b = 0; int b = 0;
for(QuestionVo.Point point : canvasPoints){ for(QuestionVo.Point point : canvasPoints){
if(a < 4){ if(a < 4){
point.setColor(b);
a++; a++;
}else { }else {
b += c; b += c;
a = 0; a = 1;
} }
point.setColor(b); point.setColor(b);
} }
@ -546,7 +548,7 @@ public class QuestionService implements IQuestionService {
a++; a++;
}else { }else {
b++; b++;
a = 0; a = 1;
} }
point.setColor(colours.get(b)); point.setColor(colours.get(b));
} }
@ -565,9 +567,18 @@ public class QuestionService implements IQuestionService {
parameter.setStartDuration(htPatientCanvas.getBeginTime() - htPatientCanvas.getOpenCanvasTime()); parameter.setStartDuration(htPatientCanvas.getBeginTime() - htPatientCanvas.getOpenCanvasTime());
//获取轨迹信息 //获取轨迹信息
List<QuestionVo.Point> canvasPoints = patientCanvasDao.getCanvasPoints(htPatientCanvas.getId()); List<QuestionVo.Point> canvasPoints = patientCanvasDao.getCanvasPoints(htPatientCanvas.getId());
if(CollectionUtil.isEmpty(canvasPoints)){
return parameter;
}
//最后一笔的结束时间 //最后一笔的结束时间
String[] pointsLast = canvasPoints.get(canvasPoints.size() - 1).getValue().split(";"); String[] pointsLast = canvasPoints.get(canvasPoints.size() - 1).getValue().split(";");
if(pointsLast.length <= 0){
return parameter;
}
String[] split = pointsLast[pointsLast.length - 1].split(","); String[] split = pointsLast[pointsLast.length - 1].split(",");
if(split.length <= 0){
return parameter;
}
long endTime = Long.parseLong(split[split.length - 1]); long endTime = Long.parseLong(split[split.length - 1]);
//超出占比 //超出占比
parameter.setBeyondProportion(htPatientCanvas.getBeyondProportion()); parameter.setBeyondProportion(htPatientCanvas.getBeyondProportion());
@ -594,7 +605,13 @@ public class QuestionService implements IQuestionService {
continue; continue;
} }
String[] s = a[0].split(","); String[] s = a[0].split(",");
if(s.length <= 0){
continue;
}
String[] e = a[a.length - 1].split(","); String[] e = a[a.length - 1].split(",");
if(e.length <= 0){
continue;
}
long duration = Long.parseLong(e[e.length - 1]) - Long.parseLong(s[s.length - 1]); long duration = Long.parseLong(e[e.length - 1]) - Long.parseLong(s[s.length - 1]);
lineParameter.setDuration(duration); lineParameter.setDuration(duration);
//长度 //长度

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

@ -27,7 +27,7 @@ public class Constant {
public final static List<Integer> COLOUR = new ArrayList<>(); public final static List<Integer> COLOUR = new ArrayList<>();
static { static {
COLOUR.add(0); COLOUR.add(0);
COLOUR.add(30); COLOUR.add(40);
COLOUR.add(120); COLOUR.add(120);
COLOUR.add(240); COLOUR.add(240);
} }

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

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

8
util/src/main/java/com/ccsens/util/config/ControllerExceptionHandler.java

@ -56,7 +56,7 @@ public class ControllerExceptionHandler {
sb.append(fieldError.getField()).append("=[").append(fieldError.getRejectedValue()).append("]") sb.append(fieldError.getField()).append("=[").append(fieldError.getRejectedValue()).append("]")
.append(fieldError.getDefaultMessage()); .append(fieldError.getDefaultMessage());
e.printStackTrace(); e.printStackTrace();
log.info("BindException", e); log.error("BindException", e);
return JsonResponse.newInstance().fail(-11,sb.toString()); return JsonResponse.newInstance().fail(-11,sb.toString());
} }
@ -64,7 +64,7 @@ public class ControllerExceptionHandler {
@ResponseBody @ResponseBody
public JsonResponse handleHttpMessageNotReadableException(HttpMessageNotReadableException e) { public JsonResponse handleHttpMessageNotReadableException(HttpMessageNotReadableException e) {
e.printStackTrace(); e.printStackTrace();
log.info("HttpMessageNotReadableException", e); log.error("HttpMessageNotReadableException", e);
return JsonResponse.newInstance().fail(-12,e.getMessage()); return JsonResponse.newInstance().fail(-12,e.getMessage());
} }
@ -72,7 +72,7 @@ public class ControllerExceptionHandler {
@ResponseBody @ResponseBody
public JsonResponse jsonBaseExceptionHandler(HttpServletRequest req, BaseException e) { public JsonResponse jsonBaseExceptionHandler(HttpServletRequest req, BaseException e) {
e.printStackTrace(); e.printStackTrace();
log.info("BaseException",e); log.error("BaseException",e);
if (e.getCodeEnum() != null) { if (e.getCodeEnum() != null) {
return JsonResponse.newInstance().ok(e.getCodeEnum()); return JsonResponse.newInstance().ok(e.getCodeEnum());
} }
@ -83,7 +83,7 @@ public class ControllerExceptionHandler {
@ResponseBody @ResponseBody
public JsonResponse jsonExceptionHandler(HttpServletRequest req, Exception e) { public JsonResponse jsonExceptionHandler(HttpServletRequest req, Exception e) {
e.printStackTrace(); e.printStackTrace();
log.info("Exception",e); log.error("Exception",e);
return JsonResponse.newInstance().fail(-1,e.getMessage()); return JsonResponse.newInstance().fail(-1,e.getMessage());
} }
} }
Loading…
Cancel
Save