|
|
@@ -2855,14 +2855,13 @@ public class OtcTradeOrderServiceImpl implements OtcTradeOrderService {
|
|
|
// 时间
|
|
|
LocalDateTime newDate = LocalDateTime.now();
|
|
|
baseData.put("newDate", newDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
|
|
|
- // 航期(格式化:yyyy.M.d)
|
|
|
- baseData.put("travelDate", baseInfo != null && baseInfo.get("travelDate") != null
|
|
|
- ? ((LocalDateTime) baseInfo.get("travelDate")).format(DateTimeFormatter.ofPattern("yyyy.M.d"))
|
|
|
- : "");
|
|
|
+
|
|
|
|
|
|
// 航向(1=宜昌-重庆,其他=重庆-宜昌)
|
|
|
Integer direction = baseInfo != null && baseInfo.get("direction") != null ? (Integer) baseInfo.get("direction") : 0;
|
|
|
baseData.put("direction", direction != null && direction == 1 ? "宜昌-重庆" : "重庆-宜昌");
|
|
|
+ // 如果为上水(宜昌 - 重庆)则航期往后推一天
|
|
|
+ baseData.put("travelDate", formatTravelDate(baseInfo, direction));
|
|
|
|
|
|
// 总人数和国籍统计
|
|
|
int totalCount = visitorList != null ? visitorList.size() : 0;
|
|
|
@@ -2984,7 +2983,8 @@ public class OtcTradeOrderServiceImpl implements OtcTradeOrderService {
|
|
|
item.put("orderNo", StringUtils.isEmpty(visitor.getOrderNo()) ? "" : visitor.getOrderNo()); // 订单号
|
|
|
item.put("groupNo", StringUtils.isEmpty(visitor.getGroupNo()) ? "" : visitor.getGroupNo()); // 团号
|
|
|
item.put("direction", StringUtils.isEmpty(visitor.getDirection()) ? "" : visitor.getDirection()); // 航向(宜昌-重庆/重庆-宜昌)
|
|
|
- item.put("travelDate", StringUtils.isEmpty(visitor.getTravelDate()) ? "" : visitor.getTravelDate()); // 航期(格式:yyyy.M.d)
|
|
|
+
|
|
|
+ item.put("travelDate", formatTravelDate(baseInfo, direction));
|
|
|
item.put("amount", orderAmountMap.getOrDefault(visitor.getOrderNo(), BigDecimal.ZERO)); // 应收款
|
|
|
|
|
|
|
|
|
@@ -3038,6 +3038,27 @@ public class OtcTradeOrderServiceImpl implements OtcTradeOrderService {
|
|
|
return new File(tmpFile);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 格式化航期日期
|
|
|
+ *
|
|
|
+ * @param baseInfo 基础信息 Map
|
|
|
+ * @param direction 航向(1=宜昌 - 重庆,其他=重庆 - 宜昌)
|
|
|
+ * @return 格式化后的航期字符串(yyyy.M.d),上水时往前推一天
|
|
|
+ */
|
|
|
+ private String formatTravelDate(Map<String, Object> baseInfo, Integer direction) {
|
|
|
+ if (baseInfo == null || baseInfo.get("travelDate") == null) {
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+
|
|
|
+ LocalDateTime travelDateTime = (LocalDateTime) baseInfo.get("travelDate");
|
|
|
+ // 上水(宜昌 - 重庆)航期往前推一天
|
|
|
+ if (direction != null && direction == 1) {
|
|
|
+ travelDateTime = travelDateTime.plusDays(-1);
|
|
|
+ }
|
|
|
+
|
|
|
+ return travelDateTime.format(DateTimeFormatter.ofPattern("yyyy.M.d"));
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 准备房间入住类型描述
|
|
|
*
|