|
|
@@ -2861,22 +2861,7 @@ public class OtcTradeOrderServiceImpl implements OtcTradeOrderService {
|
|
|
Integer direction = baseInfo != null && baseInfo.get("direction") != null ? (Integer) baseInfo.get("direction") : 0;
|
|
|
baseData.put("direction", direction != null && direction == 1 ? "宜昌-重庆" : "重庆-宜昌");
|
|
|
// 如果为上水(宜昌 - 重庆)则航期往后推一天
|
|
|
- if( direction == 1 ){
|
|
|
- LocalDateTime travelDateTime = baseInfo != null && baseInfo.get("travelDate") != null
|
|
|
- ? (LocalDateTime) baseInfo.get("travelDate")
|
|
|
- : null;
|
|
|
- // 航期往前推一天
|
|
|
- if (travelDateTime != null) {
|
|
|
- baseData.put("travelDate", travelDateTime.plusDays(-1).format(DateTimeFormatter.ofPattern("yyyy.M.d")));
|
|
|
- } else {
|
|
|
- baseData.put("travelDate", "");
|
|
|
- }
|
|
|
- } else {
|
|
|
- // 下水(重庆 - 宜昌)保持原航期
|
|
|
- baseData.put("travelDate", baseInfo != null && baseInfo.get("travelDate") != null
|
|
|
- ? ((LocalDateTime) baseInfo.get("travelDate")).format(DateTimeFormatter.ofPattern("yyyy.M.d"))
|
|
|
- : "");
|
|
|
- }
|
|
|
+ baseData.put("travelDate", formatTravelDate(baseInfo, direction));
|
|
|
|
|
|
// 总人数和国籍统计
|
|
|
int totalCount = visitorList != null ? visitorList.size() : 0;
|
|
|
@@ -2998,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)); // 应收款
|
|
|
|
|
|
|
|
|
@@ -3052,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"));
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 准备房间入住类型描述
|
|
|
*
|