|
@@ -87,9 +87,6 @@ public class GenerateCodeConsumer {
|
|
|
@Autowired
|
|
|
private RedissonClient redissonClient;
|
|
|
|
|
|
- @Autowired
|
|
|
- private TableStorePlusUtils tableStorePlusUtils;
|
|
|
-
|
|
|
@Autowired
|
|
|
private QrPackageBatchMapper qrPackageBatchMapper;
|
|
|
|
|
@@ -99,9 +96,6 @@ public class GenerateCodeConsumer {
|
|
|
@Autowired
|
|
|
private BaseFactoryMapper baseFactoryMapper;
|
|
|
|
|
|
- @Autowired
|
|
|
- private QrBoxCodeFormatMapper boxCodeFormatMapper;
|
|
|
-
|
|
|
@Autowired
|
|
|
private QrBoxCodeFormatSplitMapper qrBoxCodeFormatSplitMapper;
|
|
|
|
|
@@ -144,12 +138,8 @@ public class GenerateCodeConsumer {
|
|
|
|
|
|
@SneakyThrows
|
|
|
@RabbitHandler
|
|
|
- @RabbitListener(queues = GenerateCodeConsumer.GENERATE_CODE_BY_REPERTORY_QUEUE)
|
|
|
- public void onMessage(String id, Message message, Channel channel) {
|
|
|
- // 手工ack
|
|
|
- Long deliveryTag = (Long)message.getHeaders().get(AmqpHeaders.DELIVERY_TAG);
|
|
|
- channel.basicAck(deliveryTag, false);
|
|
|
-
|
|
|
+ @RabbitListener(queues = GenerateCodeConsumer.GENERATE_CODE_BY_REPERTORY_QUEUE,ackMode = "AUTO")
|
|
|
+ public void onMessage(String id) {
|
|
|
//判断rabbit消息是否为空
|
|
|
if(StringUtils.isEmpty(id)){
|
|
|
throw new BusinessException("队列监听数据为空!");
|
|
@@ -177,10 +167,6 @@ public class GenerateCodeConsumer {
|
|
|
qrPackage.setId(Long.parseLong(id));
|
|
|
qrPackage.setGenerateStatus(QrPackageGenerateStatusEnum.GENERATE_FAIL.getCode());
|
|
|
qrPackageService.failedRollback(qrPackage);
|
|
|
- } finally {
|
|
|
- // 手工ack
|
|
|
-// Long deliveryTag = (Long)message.getHeaders().get(AmqpHeaders.DELIVERY_TAG);
|
|
|
-// channel.basicAck(deliveryTag, false);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -695,11 +681,8 @@ public class GenerateCodeConsumer {
|
|
|
if (groupSum < 0 || str.length() < groupSum){
|
|
|
result.add(str.toCharArray());
|
|
|
}else {
|
|
|
-
|
|
|
int group = str.length() / groupSum ;
|
|
|
-
|
|
|
int count = 0;
|
|
|
-
|
|
|
while (true){
|
|
|
if (result.size() + 1 == groupSum){
|
|
|
result.add(str.substring(count * group).toCharArray());
|
|
@@ -708,9 +691,7 @@ public class GenerateCodeConsumer {
|
|
|
result.add(str.substring(count * group ,count * group + group ).toCharArray());
|
|
|
count ++ ;
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
return result;
|
|
|
}
|
|
|
}
|