|
|
@@ -6250,6 +6250,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
throw new RuntimeException("未查到海运出口单据,发送失败!");
|
|
|
}
|
|
|
StringBuilder text = new StringBuilder();
|
|
|
+ StringBuilder messageBody = new StringBuilder();
|
|
|
if ("SOC".equals(bills.getBoxBelongsTo()) && "DD,MH".contains(bills.getBillType())) {
|
|
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
List<RouteCost> costList = routeCostService.list(new LambdaQueryWrapper<RouteCost>()
|
|
|
@@ -6257,8 +6258,8 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
.eq(RouteCost::getDestinationId, bills.getPodId())
|
|
|
.eq(RouteCost::getShippingCompanyId, bills.getCarrierId())
|
|
|
.eq(RouteCost::getBusinessType, bills.getBoxBelongsTo())
|
|
|
- .apply( "DATE_FORMAT(effective_start_date,'%Y-%m-%d') <= '" + formatter.format(bills.getEtd()) + "'")
|
|
|
- .apply( "DATE_FORMAT(effective_end_date,'%Y-%m-%d') >= '" + formatter.format(bills.getEtd()) + "'")
|
|
|
+ .apply("DATE_FORMAT(effective_start_date,'%Y-%m-%d') <= '" + formatter.format(bills.getEtd()) + "'")
|
|
|
+ .apply("DATE_FORMAT(effective_end_date,'%Y-%m-%d') >= '" + formatter.format(bills.getEtd()) + "'")
|
|
|
);
|
|
|
if (costList.isEmpty()) {
|
|
|
throw new RuntimeException("请先维护成本!");
|
|
|
@@ -6311,11 +6312,12 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
.sorted(Comparator.comparing(RouteCostItem::getOceanFreight))
|
|
|
.collect(Collectors.toList());
|
|
|
if (price.compareTo(minCostItem.get(0).getOceanFreight()) < 0) {
|
|
|
- text.append("提单号:").append(bills.getMblno()).append("箱型:").append(containers.getCntrTypeCode()).append("应收海运费:"+price+"大于成本中心海运费:"+minCostItem.get(0).getOceanFreight()+",发送失败!");
|
|
|
+ text.append("提单号:").append(bills.getMblno()).append("箱型:").append(containers.getCntrTypeCode()).append("应收海运费:" + price + "小于成本中心海运费:" + minCostItem.get(0).getOceanFreight() + "!");
|
|
|
+ messageBody.append("提单号:").append(bills.getMblno()).append("应收海运费:" + price + "小于成本中心海运费:" + minCostItem.get(0).getOceanFreight() + "!");
|
|
|
}
|
|
|
- if (containerNumberItemList.stream().filter(e -> e.getPid().equals(containers.getPid()))
|
|
|
+ if (containerNumberItemList.stream().filter(e -> e.getBoxType().equals(containers.getCntrTypeCode()))
|
|
|
.mapToInt(SeaContainerNumberItem::getOccupyNum).sum() != containers.getQuantity()) {
|
|
|
- text.append("提单号:").append(bills.getMblno()).append("箱型:").append(containers.getCntrTypeCode()).append("箱量与所选放箱号数量不等,发送失败!");
|
|
|
+ text.append("提单号:").append(bills.getMblno()).append("箱型:").append(containers.getCntrTypeCode()).append("箱量与所选放箱号数量不等!");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -6324,10 +6326,10 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
String url = "/iosBasicData/OceanFreightImport/bills/index";
|
|
|
String pageLabel = "海运出口";
|
|
|
String pageStatus = "this.$store.getters.domSaleStatus";
|
|
|
- String messageBody = "发送下货纸:" + text;
|
|
|
- billUtils.sendMessage(bills, url, pageLabel, pageStatus, messageBody, "2", bills.getOperatorId(), "成本中心");
|
|
|
+ messageBody.append("发送人:").append(AuthUtil.getUserName());
|
|
|
+ billUtils.sendMessage(bills, url, pageLabel, pageStatus, messageBody.toString(), "2", bills.getOperatorId(), "成本中心");
|
|
|
// return R.success(text.toString());
|
|
|
- throw new RuntimeException("未查到应收海运费,发送失败!");
|
|
|
+ throw new RuntimeException(text.toString());
|
|
|
} else {
|
|
|
return R.success("操作成功");
|
|
|
}
|
|
|
@@ -6375,17 +6377,18 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
excel.setHblno(item.getHblno());
|
|
|
excel.setQuantityCntrDescr(item.getQuantityCntrDescr());
|
|
|
excel.setGrossWeight(item.getGrossWeight());
|
|
|
+ String containerNumber = "";
|
|
|
List<PreContainers> preContainers = preContainersList.stream().filter(e -> e.getPid().equals(item.getId()))
|
|
|
.collect(Collectors.toList());
|
|
|
- if (!preContainers.isEmpty()) {
|
|
|
- List<Long> preContainersId = preContainers.stream().map(PreContainers::getId).collect(Collectors.toList());
|
|
|
+ for (PreContainers containers : preContainers) {
|
|
|
List<SeaContainerNumberItem> containerNumberItems = containerNumberItemList.stream().filter(e ->
|
|
|
- preContainersId.contains(e.getPid())).collect(Collectors.toList());
|
|
|
- if (!containerNumberItems.isEmpty()) {
|
|
|
- excel.setContainerNumber(containerNumberItems.stream().map(SeaContainerNumberItem::getContainerNumber)
|
|
|
- .collect(Collectors.joining(",")));
|
|
|
+ containers.getCntrTypeCode().equals(e.getBoxType()) && 0 != e.getOccupyNum()).collect(Collectors.toList());
|
|
|
+ for (SeaContainerNumberItem numberItem : containerNumberItems) {
|
|
|
+ containerNumber = containerNumber + numberItem.getContainerNumber() + " " + numberItem.getOccupyNum() + "*" +
|
|
|
+ containers.getCntrTypeCode() + "\n";
|
|
|
}
|
|
|
}
|
|
|
+ excel.setContainerNumber(containerNumber);
|
|
|
excelList.add(excel);
|
|
|
}
|
|
|
return R.data(excelList);
|