Commit eee2b3f3 authored by 332784038@qq.com's avatar 332784038@qq.com

重置修改提单业务bug修复

parent 53f5ebcb
......@@ -291,10 +291,16 @@ public class MakeBillOfLadingServiceImpl extends AbstractService<MakeBillOfLadin
return makeBillOfLading.getId();
}
@SneakyThrows
@Override
@Transactional(rollbackFor = Exception.class)
public void updateMakeBillOfLading(MakeBillOfLadingUpdateReqVO updateReqVO) {
// 校验存在
this.validateMakeBillOfLadingExists(updateReqVO.getId());
MakeBillOfLadingDO makeBillOfLading = makeBillOfLadingMapper.selectById(updateReqVO.getId());
if (makeBillOfLading == null) {
throw exception(MAKE_BILL_OF_LADING_NOT_EXISTS);
}
// 更新
MakeBillOfLadingDO updateObj =
MakeBillOfLadingConvert.INSTANCE.convert(updateReqVO);
......@@ -302,9 +308,38 @@ public class MakeBillOfLadingServiceImpl extends AbstractService<MakeBillOfLadin
updateObj.setStatus(2);
//end 提单直接审批通过
makeBillOfLadingMapper.updateById(updateObj);
OrderBackVO order = orderQueryService.getOrder(Long.valueOf(makeBillOfLadingMapper.selectById(updateReqVO.getId()).getOrderId()));
OrderDO order = orderQueryService.getOrderById(Long.valueOf(makeBillOfLading.getOrderId()));
OrderObjectiveDO orderObjectiveDO = orderObjectiveService.getByOrderId(order.getOrderId());
//得到订单目的仓
String destStr = "";
if (null != orderObjectiveDO && null != orderObjectiveDO.getObjectiveWarehouseId()) {
WarehouseDO warehouseDO = warehouseService.getWarehouse(orderObjectiveDO.getObjectiveWarehouseId());
destStr = warehouseDO.getTitleEn();
}
if (StrUtil.isBlank(order.getContainerNumber())) {
throw exception(MAKE_BILL_OF_SELF_NULL);
}
if (StrUtil.isBlank(order.getTidanNo())) {
throw exception(MAKE_BILL_OF_ORDER_NULL);
}
FileClient masterFileClient = fileConfigService.getMasterFileClient();
String domain = masterFileClient.getDomain();
//创建空运的PDF提单
String pdfFileName = "/admin/shipment/" + StrUtil.blankToDefault(order.getContainerNumber(), "") + "/pdf/" + StrUtil.blankToDefault(order.getTidanNo(), "") + " " + StrUtil.blankToDefault(order.getMarks(), "") + " " + StrUtil.blankToDefault(destStr, "") + ".pdf";
String pdfUrl = domain + pdfFileName;
String pdfPath = prePath + pdfFileName;
try {
AirHtmlToPdfUtil.convertHtmlToPdf(updateObj.getBillContent(), pdfPath);
} catch (Exception e) {
throw new RuntimeException(e);
}
//设置生成的PDF路径
updateObj.setImgUrl(pdfUrl);
/*
String bpmProcessId =
bpmCreateServiceFactory.createBmp(SecurityFrameworkUtils.getLoginUserId(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment