diff --git a/src/main/java/com/ccsens/yanyuan/service/TalkingPenService.java b/src/main/java/com/ccsens/yanyuan/service/TalkingPenService.java index ae2b7d5..e15a894 100644 --- a/src/main/java/com/ccsens/yanyuan/service/TalkingPenService.java +++ b/src/main/java/com/ccsens/yanyuan/service/TalkingPenService.java @@ -437,7 +437,8 @@ public class TalkingPenService implements ITalkingPenService { for (ToolFindDifference d : differences) { for (CoordinateDto.Point p : coordinates) { // 计算点到距离的平方和 - double supplier = Math.pow(p.getX() - d.getCoordinatesX().intValue(), 2) + Math.pow(p.getX() - d.getCoordinatesX().intValue(), 2); + double supplier = Math.pow(p.getX() - d.getCoordinatesX().intValue(), 2) + Math.pow(p.getY() - d.getCoordinatesY().intValue(), 2); + log.info("正确点:{},当前点:{}, 距离平方:{}, 正确平方:{}", d, p, supplier, pow); if (supplier <= pow) { current++; } else { @@ -445,13 +446,17 @@ public class TalkingPenService implements ITalkingPenService { } } int currentRate = current * 100 / (current + error); + log.info("正确比例:{}, 正确数:{}, 错误数:{}", currentRate, current, error); if (currentRate > percentNum) { percentNum = currentRate; curPlace = d.getWhichPlace(); } + current = 0; error = 0; } + + // 比较比例 if (percentNum >= minPercent) { // 大于标准比例 @@ -491,12 +496,12 @@ public class TalkingPenService implements ITalkingPenService { trainCorrectDao.insertSelective(correct); currents.add(curPointPlace); } - if (o == null || (Integer)o < currents.size()) { +// if (o == null || (Integer)o < currents.size()) { int audioIndex = currents.size() >= max ? YanYuanConstant.Equipment.AUDIO_DIFFERENCE_COMPLETE : YanYuanConstant.Equipment.AUDIO_DIFFERENCE_CURRENT; sendAudio(audioIndex, authId); log.info("{}继续找下一个,播放语音:{}", trainCardId, audioIndex); - } +// } redisUtil.set(key, currents.size(), YanYuanConstant.Equipment.TALKING_PEN_JUDGE_AUDIO_TIME); } diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index e7ae801..3b80b5c 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -29,7 +29,7 @@ swagger: enable: true eureka: instance: - ip-address: 121.36.106.168 + ip-address: 119.3.214.36 gatewayUrl: https://www.tall.wiki/gateway/ notGatewayUrl: https://www.tall.wiki/ diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index c3b11fb..5abf242 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,4 +1,4 @@ spring: profiles: - active: test - include: common, util-test + active: prod + include: common, util-prod