|
@ -82,6 +82,11 @@ public class TalkingPenService implements ITalkingPenService { |
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
public void dealIndex(TalkingPenDto talkingPen) throws Exception { |
|
|
public void dealIndex(TalkingPenDto talkingPen) throws Exception { |
|
|
|
|
|
if (talkingPen.getValue() == 128847481L) { |
|
|
|
|
|
log.info("当前的序号是:{},是特殊码,发送8", talkingPen.getValue()); |
|
|
|
|
|
sendAudio(8, talkingPen.getAuthId()); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
YanYuanConstant.Card card = YanYuanConstant.Card.getByCardIndex(talkingPen.getValue()); |
|
|
YanYuanConstant.Card card = YanYuanConstant.Card.getByCardIndex(talkingPen.getValue()); |
|
|
byte type = card == null ? YanYuanConstant.CardType.INDEX : card.getType(); |
|
|
byte type = card == null ? YanYuanConstant.CardType.INDEX : card.getType(); |
|
|
long value = card == null ? talkingPen.getValue() : card.getRealIndex(); |
|
|
long value = card == null ? talkingPen.getValue() : card.getRealIndex(); |
|
@ -472,7 +477,7 @@ public class TalkingPenService implements ITalkingPenService { |
|
|
log.info("{}缓存:{}", key, o); |
|
|
log.info("{}缓存:{}", key, o); |
|
|
if (currents.size() >= max) { |
|
|
if (currents.size() >= max) { |
|
|
log.info("{}正确数量已经大等于最大正确数:{}", trainCardId, max); |
|
|
log.info("{}正确数量已经大等于最大正确数:{}", trainCardId, max); |
|
|
if (o == null) { |
|
|
if (o == null || (Integer)o < max) { |
|
|
sendAudio(YanYuanConstant.Equipment.AUDIO_DIFFERENCE_COMPLETE, authId); |
|
|
sendAudio(YanYuanConstant.Equipment.AUDIO_DIFFERENCE_COMPLETE, authId); |
|
|
} |
|
|
} |
|
|
return; |
|
|
return; |
|
@ -486,7 +491,7 @@ public class TalkingPenService implements ITalkingPenService { |
|
|
trainCorrectDao.insertSelective(correct); |
|
|
trainCorrectDao.insertSelective(correct); |
|
|
currents.add(curPointPlace); |
|
|
currents.add(curPointPlace); |
|
|
} |
|
|
} |
|
|
if (o == null) { |
|
|
if (o == null || (Integer)o < currents.size()) { |
|
|
int audioIndex = currents.size() >= max ? YanYuanConstant.Equipment.AUDIO_DIFFERENCE_COMPLETE : |
|
|
int audioIndex = currents.size() >= max ? YanYuanConstant.Equipment.AUDIO_DIFFERENCE_COMPLETE : |
|
|
YanYuanConstant.Equipment.AUDIO_DIFFERENCE_CURRENT; |
|
|
YanYuanConstant.Equipment.AUDIO_DIFFERENCE_CURRENT; |
|
|
sendAudio(audioIndex, authId); |
|
|
sendAudio(audioIndex, authId); |
|
@ -684,6 +689,7 @@ public class TalkingPenService implements ITalkingPenService { |
|
|
//记录一下点读笔发送的语音,时长1分钟,若1分钟内发送过相同的内容,则不再发送(时长待定,该判断待讨论)
|
|
|
//记录一下点读笔发送的语音,时长1分钟,若1分钟内发送过相同的内容,则不再发送(时长待定,该判断待讨论)
|
|
|
String key = StrUtil.format(YanYuanConstant.Equipment.TALKING_PEN_AUDIO_KEY, talkingPenSerial); |
|
|
String key = StrUtil.format(YanYuanConstant.Equipment.TALKING_PEN_AUDIO_KEY, talkingPenSerial); |
|
|
Object o = redisUtil.get(key); |
|
|
Object o = redisUtil.get(key); |
|
|
|
|
|
log.info("发送语音:key:{}, value:{},即将发送的语音:{},笔的序号:{}", key, o, value, talkingPenSerial); |
|
|
if (o != null) { |
|
|
if (o != null) { |
|
|
int oldValue = (Integer) o; |
|
|
int oldValue = (Integer) o; |
|
|
if (oldValue == YanYuanConstant.Equipment.AUDIO_NO_TRAINEE) { |
|
|
if (oldValue == YanYuanConstant.Equipment.AUDIO_NO_TRAINEE) { |
|
@ -724,6 +730,7 @@ public class TalkingPenService implements ITalkingPenService { |
|
|
log.info("给点读笔发送消息:{}", inMessage); |
|
|
log.info("给点读笔发送消息:{}", inMessage); |
|
|
//发送消息
|
|
|
//发送消息
|
|
|
messageService.sendTo(inMessage); |
|
|
messageService.sendTo(inMessage); |
|
|
|
|
|
redisUtil.set(key, value, YanYuanConstant.Equipment.TALKING_PEN_JUDGE_AUDIO_TIME); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|