|
@@ -4,6 +4,7 @@ import cn.hutool.core.io.FileUtil;
|
|
|
import cn.hutool.core.io.file.FileWriter;
|
|
|
import com.abi.base.foundation.util.RedisClient;
|
|
|
import com.abi.qms.platform.dao.entity.*;
|
|
|
+import com.abi.qms.platform.dao.enums.CodePackageOrderTypeEnum;
|
|
|
import com.abi.qms.platform.dao.enums.InvalidEnum;
|
|
|
import com.abi.qms.platform.dao.enums.QrPackageGenerateStatusEnum;
|
|
|
import com.abi.qms.platform.dao.enums.QrRepertoryTypeEnum;
|
|
@@ -15,6 +16,7 @@ import com.abi.qms.platform.feign.BasicServiceClient;
|
|
|
import com.abi.qms.platform.infrastructure.qr.build.parent.SerialBuildCode;
|
|
|
import com.abi.qms.platform.infrastructure.util.BuildCodeUtil;
|
|
|
import com.abi.qms.platform.infrastructure.util.RandomCodeUtils;
|
|
|
+import com.abi.qms.platform.service.QrPackageBookingOrderService;
|
|
|
import com.abi.qms.platform.service.QrPackageService;
|
|
|
import com.abi.task.common.api.exception.BusinessException;
|
|
|
import com.abi.task.common.tablestore.TableStorePlusUtils;
|
|
@@ -115,6 +117,9 @@ public class GenerateCodeConsumer {
|
|
|
@Autowired
|
|
|
private AmqpTemplate amqpTemplate;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private QrPackageBookingOrderService qrPackageBookingOrderService;
|
|
|
+
|
|
|
//生成码数据
|
|
|
final List<QrData> qrDataList = new LinkedList<>();
|
|
|
|
|
@@ -275,8 +280,16 @@ public class GenerateCodeConsumer {
|
|
|
|
|
|
//3-保存压缩文件并上传oss
|
|
|
//压缩后得名字 正式码_SAP订单号_物料名称_文件内码数量
|
|
|
- BaseMaterial baseMaterial = baseMaterialMapper.selectById(qrPackage.getMaterialId());
|
|
|
- String zipName = "正式码_"+qrPackage.getSapOrderNo()+"_"+baseMaterial.getMaterialName()+"_"+sum+".zip";
|
|
|
+ String materialName = null;
|
|
|
+ if(CodePackageOrderTypeEnum.SAP_ORDER.is(qrPackage.getOrderType())){
|
|
|
+ BaseMaterial baseMaterial = baseMaterialMapper.selectById(qrPackage.getMaterialId());
|
|
|
+ materialName = baseMaterial==null?"":baseMaterial.getMaterialName();
|
|
|
+ }else{
|
|
|
+ QrPackageBookingOrder bookingOrder = qrPackageBookingOrderService.getBookingOrder(qrPackage.getBookingOrder());
|
|
|
+ materialName = bookingOrder==null?"":bookingOrder.getMaterialName();
|
|
|
+ }
|
|
|
+
|
|
|
+ String zipName = "正式码_"+qrPackage.getSapOrderNo()+"_"+materialName+"_"+sum+".zip";
|
|
|
sum = 0L;
|
|
|
//压缩密码
|
|
|
String pas = RandomCodeUtils.getStr(6);
|
|
@@ -312,7 +325,7 @@ public class GenerateCodeConsumer {
|
|
|
BaseFactory baseFactory = baseFactoryMapper.selectOne(baseQuery);
|
|
|
//发送邮件
|
|
|
String aliPath = qrPackage.getDownloadPath().substring(qrPackage.getDownloadPath().lastIndexOf("/") + 1);
|
|
|
- qrPackageService.sendEmailForQrPackageCreated(baseFactory.getEmail(),qrPackage.getSapOrderNo(),aliPath,qrPackage.getZipPassword());
|
|
|
+ qrPackageService.sendEmailForQrPackageCreated(baseFactory.getEmail(),qrPackage,aliPath,qrPackage.getZipPassword());
|
|
|
//邮件发送后修改状态
|
|
|
qrPackageMapper.updateById(qrPackage);
|
|
|
QrIndex index = new QrIndex();
|