|
@@ -112,6 +112,9 @@ public class GenerateCodeConsumer {
|
|
|
@Autowired
|
|
|
private RedisClient redisClient;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private BaseMaterialMapper baseMaterialMapper;
|
|
|
+
|
|
|
//生成码数据
|
|
|
final List<QrData> qrDataList = new LinkedList<>();
|
|
|
|
|
@@ -130,6 +133,9 @@ public class GenerateCodeConsumer {
|
|
|
/** 声明码对应的值 */
|
|
|
public Long codeIndex = 0L;
|
|
|
|
|
|
+ //该包下共有多少码数量
|
|
|
+ public Long sum = 0L;
|
|
|
+
|
|
|
@SneakyThrows
|
|
|
@RabbitHandler
|
|
|
@RabbitListener(queues = GenerateCodeConsumer.GENERATE_CODE_BY_REPERTORY_QUEUE)
|
|
@@ -260,8 +266,10 @@ public class GenerateCodeConsumer {
|
|
|
}
|
|
|
|
|
|
//2-保存压缩文件并上传oss
|
|
|
- //压缩后得名字
|
|
|
- String zipName = DateTimeFormatter.ofPattern("yyyyMMddHHmmss").format(LocalDateTime.now())+".zip";
|
|
|
+ //压缩后得名字 正式码_SAP订单号_物料名称_文件内码数量
|
|
|
+ BaseMaterial baseMaterial = baseMaterialMapper.selectById(qrPackage.getMaterialId());
|
|
|
+ String zipName = "正式码_"+qrPackage.getSapOrderNo()+"_"+baseMaterial.getMaterialName()+"_"+sum+".zip";
|
|
|
+ sum = 0L;
|
|
|
//压缩密码
|
|
|
String pas = RandomCodeUtils.getStr(6);
|
|
|
log.info("生成密码:"+pas);
|
|
@@ -353,6 +361,7 @@ public class GenerateCodeConsumer {
|
|
|
qrCodes.addAll(qrCodeCope);
|
|
|
});
|
|
|
tableStorePlusUtils.putRow(qrCodes);
|
|
|
+ sum+=qrCodes.size();
|
|
|
}
|
|
|
|
|
|
/**
|