Browse Source

图像坐标返回标志位

master
zhizhi wu 4 years ago
parent
commit
de2174b3de
  1. 2
      src/main/java/com/ccsens/yanyuan/bean/vo/TrainBelongVo.java
  2. 14
      src/main/java/com/ccsens/yanyuan/service/TalkingPenService.java
  3. 2
      src/main/java/com/ccsens/yanyuan/util/YanYuanConstant.java
  4. 4
      src/main/resources/application.yml
  5. 3
      src/main/resources/mapper_dao/TrainCardDao.xml

2
src/main/java/com/ccsens/yanyuan/bean/vo/TrainBelongVo.java

@ -67,6 +67,8 @@ public class TrainBelongVo {
private BigDecimal coordinatesY;
@ApiModelProperty("操作时间")
private Long operateTime;
@ApiModelProperty("标志 1:按下(开始) 0:普通 3:抬起(结束)")
private Byte sign;
}
@Data

14
src/main/java/com/ccsens/yanyuan/service/TalkingPenService.java

@ -283,6 +283,7 @@ public class TalkingPenService implements ITalkingPenService {
List<TrainProcessPoint> processPoints = new ArrayList<>();
List<TrainProcessLine> processLines = new ArrayList<>();
TrainProcessPoint prev = null;
boolean emptyPackage = true;
for (int i = 0; i < points.size() ; i+=group) {
double x = points.get(i + TalkingPenDto.Point.OID3_X).getValue()/ 100.0;
@ -296,6 +297,7 @@ public class TalkingPenService implements ITalkingPenService {
TrainProcessPoint initPoint = initPoint(cardId, label, x, y, time, (int)angle, points);
processPoints.add(initPoint);
prev = initPoint;
emptyPackage = false;
}
if (label == TalkingPenDto.Point.SIGN_START) {
// 开始
@ -308,6 +310,7 @@ public class TalkingPenService implements ITalkingPenService {
} else {
// 其他
if (prev == null) {
// 前面的点都是空点,上一个非开始点应该为结束点
TrainProcessPointExample pointExample = new TrainProcessPointExample();
pointExample.createCriteria().andCardIdEqualTo(cardId);
pointExample.setOrderByClause("id desc limit 1");
@ -316,6 +319,13 @@ public class TalkingPenService implements ITalkingPenService {
continue;
}
prev = trainProcessPoints.get(0);
if (prev.getSign() == TalkingPenDto.Point.SIGN_CENTER) {
TrainProcessPoint update = new TrainProcessPoint();
update.setId(prev.getId());
update.setSign(TalkingPenDto.Point.SIGN_END);
trainProcessDao.updateByPrimaryKeySelective(update);
log.info("修改上一个点为结束点:{}", update);
}
}
if (processLines.isEmpty()) {
// 查询系统中的最近的线条
@ -345,7 +355,9 @@ public class TalkingPenService implements ITalkingPenService {
trainProcessDao.replaceLineBatch(processLines);
}
judgeProcess(trainCard, coordinates, firstDto.getAuthId());
if (!emptyPackage) {
judgeProcess(trainCard, coordinates, firstDto.getAuthId());
}
}
/**

2
src/main/java/com/ccsens/yanyuan/util/YanYuanConstant.java

@ -155,7 +155,7 @@ public class YanYuanConstant {
* 点读笔判断找不同是否正确
*/
public final static String TALKING_PEN_JUDGE_AUDIO_KEY = "talking_pen_judge_{}_audio";
public final static long TALKING_PEN_JUDGE_AUDIO_TIME = 1;
public final static long TALKING_PEN_JUDGE_AUDIO_TIME = 60;
/**
* 点读笔试题查询下一个
*/

4
src/main/resources/application.yml

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

3
src/main/resources/mapper_dao/TrainCardDao.xml

@ -16,6 +16,7 @@
<result property="coordinatesX" column="coordinates_x"/>
<result property="coordinatesY" column="coordinates_y"/>
<result property="operateTime" column="real_time"/>
<result property="sign" column="sign"/>
</collection>
</resultMap>
@ -23,7 +24,7 @@
select c.id as trainRecordId,c.created_at AS createdAt, 1 as resultType, c.equipment_id as equipmentId, c.assist_id as assistId,
t.id as toolId, t.`code` as toolCode,
tc.url as cardUrl,
pp.id as ppId, pp.coordinates_x, pp.coordinates_y, pp.real_time
pp.id as ppId, pp.coordinates_x, pp.coordinates_y, pp.real_time, pp.sign
from u_train_card c
left join t_tool_equipment e on c.equipment_id = e.id and e.rec_status = 0
left join t_tool t on e.tool_id = t.id and t.rec_status = 0

Loading…
Cancel
Save