|
|
|
@ -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()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
|