|
|
@@ -720,6 +720,34 @@ public class OrderServiceImpl implements OrderService {
|
|
|
baseWaybill.setChargeFeePrint("**");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ if (printType.equals("子单") || printType.equals("回单") || printType.equals("主单")) {
|
|
|
+ baseWaybill.setSenderPhone(hidePhone(baseWaybill.getSenderPhone()));
|
|
|
+ baseWaybill.setReceiverPhone(hidePhone(baseWaybill.getReceiverPhone()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private String hidePhone(String phoneNumber) {
|
|
|
+ if (phoneNumber == null || phoneNumber.length() < 7) {
|
|
|
+ return phoneNumber;
|
|
|
+ }
|
|
|
+ int head = 3; // 前面保留3位
|
|
|
+ int tail = 4; // 后面保留4位
|
|
|
+ int body = phoneNumber.length() - head - tail;
|
|
|
+
|
|
|
+ if (body <= 0) {
|
|
|
+ return phoneNumber;
|
|
|
+ }
|
|
|
+
|
|
|
+ String regex = String.format("(\\d{%d})(\\d{%d})(\\d{%d})", head, body, tail);
|
|
|
+ return phoneNumber.replaceAll(regex, "$1" + "*".repeat(body) + "$3");
|
|
|
+ }
|
|
|
+
|
|
|
+ private String quantityPrintFormat(Integer quantity, Integer quantity1, Integer quantity2, Integer quantity3) {
|
|
|
+ return quantity + "(" +
|
|
|
+ String.format("%4d", quantity1) + "," +
|
|
|
+ String.format("%4d", quantity2) + "," +
|
|
|
+ String.format("%4d", quantity3) + ")";
|
|
|
}
|
|
|
|
|
|
private void createPrintData(PrintApiRequest printApiRequest, List<String> transportOrderIds,
|
|
|
@@ -810,7 +838,7 @@ public class OrderServiceImpl implements OrderService {
|
|
|
|
|
|
needHideChargeFee(newBaseWaybill, "主单");
|
|
|
|
|
|
- masterWaybills.add(baseWaybill);
|
|
|
+ masterWaybills.add(newBaseWaybill);
|
|
|
}
|
|
|
printApiRequest.setMasterWaybillList(masterWaybills);
|
|
|
}
|
|
|
@@ -1089,13 +1117,13 @@ public class OrderServiceImpl implements OrderService {
|
|
|
}
|
|
|
}
|
|
|
vo.setQuantity(quantity);
|
|
|
- vo.setQuantityPrint(quantity + "("+ quantitys[0] + "," + quantitys[1] + "," + quantitys[2] + ")");
|
|
|
+ vo.setQuantityPrint(quantityPrintFormat(quantity, quantitys[0], quantitys[1], quantitys[2]));
|
|
|
vo.setCargoName(String.join(",", cargoName));
|
|
|
} else {
|
|
|
vo.setComputeWeight(new Double(1));
|
|
|
vo.setComputeWeight(new Double(0.01));
|
|
|
vo.setQuantity(0);
|
|
|
- vo.setQuantityPrint(0 + "("+ 0 + "," + 0 + "," + 0 + ")");
|
|
|
+ vo.setQuantityPrint(quantityPrintFormat(0,0,0,0));
|
|
|
vo.setCargoName("");
|
|
|
}
|
|
|
|