From a1159c1bb6b36002a7d461e16707613c9d57a6e2 Mon Sep 17 00:00:00 2001 From: huangxh3 Date: Thu, 1 Feb 2024 17:08:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=96=E9=83=A8=E5=B7=AE=E6=97=85=E5=8D=95?= =?UTF-8?q?=E5=90=8C=E6=AD=A5dto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ly/dto/applyordersync/AOSApprove.java | 18 +++++++++ .../AOSCityBookableQuantity.java | 18 +++++++++ .../ly/dto/applyordersync/AOSCostCenter.java | 19 ++++++++++ .../rest/ly/dto/applyordersync/AOSDetail.java | 17 +++++++++ .../rest/ly/dto/applyordersync/AOSItem.java | 20 ++++++++++ .../applyordersync/AOSManyPeopleFloating.java | 19 ++++++++++ .../applyordersync/AOSOnePeopleFloating.java | 16 ++++++++ .../AOSOtherCityTravelPolicy.java | 21 ++++++++++ .../rest/ly/dto/applyordersync/AOSPerson.java | 24 ++++++++++++ .../applyordersync/AOSPreTravelPolicy.java | 18 +++++++++ .../ly/dto/applyordersync/AOSSubmitItem.java | 17 +++++++++ .../ly/dto/applyordersync/ApplyOrderSync.java | 38 +++++++++++++++++++ .../rest/user/UserHttpRequestImpl.java | 4 +- src/main/resources/application-dev.yml | 3 +- src/test/java/com/chint/LTTest.java | 4 +- 15 files changed, 253 insertions(+), 3 deletions(-) create mode 100644 src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSApprove.java create mode 100644 src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSCityBookableQuantity.java create mode 100644 src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSCostCenter.java create mode 100644 src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSDetail.java create mode 100644 src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSItem.java create mode 100644 src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSManyPeopleFloating.java create mode 100644 src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSOnePeopleFloating.java create mode 100644 src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSOtherCityTravelPolicy.java create mode 100644 src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSPerson.java create mode 100644 src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSPreTravelPolicy.java create mode 100644 src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSSubmitItem.java create mode 100644 src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/ApplyOrderSync.java diff --git a/src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSApprove.java b/src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSApprove.java new file mode 100644 index 00000000..81ecdcdb --- /dev/null +++ b/src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSApprove.java @@ -0,0 +1,18 @@ +package com.chint.interfaces.rest.ly.dto.applyordersync; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 审批人列表 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class AOSApprove { + private String outEmployeeId;//审批人外部员工ID + private Integer approveType;//审批人管控的预定类型 + private Integer approveGrade;//审批层级 + +} diff --git a/src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSCityBookableQuantity.java b/src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSCityBookableQuantity.java new file mode 100644 index 00000000..afa04125 --- /dev/null +++ b/src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSCityBookableQuantity.java @@ -0,0 +1,18 @@ +package com.chint.interfaces.rest.ly.dto.applyordersync; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 城市可预订次数 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class AOSCityBookableQuantity { + private String city;//城市 + private String quantity;//次数 + private Integer type;//类型 + private String policyCode;//差旅政策Code +} diff --git a/src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSCostCenter.java b/src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSCostCenter.java new file mode 100644 index 00000000..61053492 --- /dev/null +++ b/src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSCostCenter.java @@ -0,0 +1,19 @@ +package com.chint.interfaces.rest.ly.dto.applyordersync; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 成本中心列表 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class AOSCostCenter { + private String costCenterName;//成本中心名称 + private String costCenterCode;//成本中心Code + private String costCenterTypeName;//成本中心类型名称 + private String costCenterTypeCode;//成本中心类型Code + private Boolean isDefault;//是否默认值 +} diff --git a/src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSDetail.java b/src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSDetail.java new file mode 100644 index 00000000..b7e9e83c --- /dev/null +++ b/src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSDetail.java @@ -0,0 +1,17 @@ +package com.chint.interfaces.rest.ly.dto.applyordersync; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 外部差旅政策 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class AOSDetail { + private String cityName;//城市名称 + private Integer maxPrice;//入住标准 + private Integer violationStrategy;//违规策略 +} diff --git a/src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSItem.java b/src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSItem.java new file mode 100644 index 00000000..b1ef00cb --- /dev/null +++ b/src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSItem.java @@ -0,0 +1,20 @@ +package com.chint.interfaces.rest.ly.dto.applyordersync; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 差旅内容 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class AOSItem { + private String startDate; + private String endDate; + private String departCity; + private String arriveCity; + private String otherCity; + private String baseCity; +} diff --git a/src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSManyPeopleFloating.java b/src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSManyPeopleFloating.java new file mode 100644 index 00000000..20269460 --- /dev/null +++ b/src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSManyPeopleFloating.java @@ -0,0 +1,19 @@ +package com.chint.interfaces.rest.ly.dto.applyordersync; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 多人入住时入住标准上浮 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class AOSManyPeopleFloating { + private Integer type;//类型 + private Integer value;//值 + private String basePriceType;//基准价模式 + private String roomPriceType;//房价模式 + +} diff --git a/src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSOnePeopleFloating.java b/src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSOnePeopleFloating.java new file mode 100644 index 00000000..de0e88e9 --- /dev/null +++ b/src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSOnePeopleFloating.java @@ -0,0 +1,16 @@ +package com.chint.interfaces.rest.ly.dto.applyordersync; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 单人入住时入住标准上浮 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class AOSOnePeopleFloating { + private Integer type;//类型 + private Integer value;//值 +} diff --git a/src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSOtherCityTravelPolicy.java b/src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSOtherCityTravelPolicy.java new file mode 100644 index 00000000..9c0e192b --- /dev/null +++ b/src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSOtherCityTravelPolicy.java @@ -0,0 +1,21 @@ +package com.chint.interfaces.rest.ly.dto.applyordersync; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 其他城市政策 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class AOSOtherCityTravelPolicy { + + private Integer maxPrice;//入住标准 + private Integer violationStrategy;//违规策略 + + + + +} diff --git a/src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSPerson.java b/src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSPerson.java new file mode 100644 index 00000000..b2849c3e --- /dev/null +++ b/src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSPerson.java @@ -0,0 +1,24 @@ +package com.chint.interfaces.rest.ly.dto.applyordersync; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 差旅内容 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class AOSPerson { + private String name; + private Integer relation; + private Integer passengerType; + private Integer credentialType; + private String credentialNo; + private String credentialExpiredDate; + private String nationality; + private String birthday; + private String mobilePhone; + private String outEmployeeId; +} diff --git a/src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSPreTravelPolicy.java b/src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSPreTravelPolicy.java new file mode 100644 index 00000000..8b5f5dee --- /dev/null +++ b/src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSPreTravelPolicy.java @@ -0,0 +1,18 @@ +package com.chint.interfaces.rest.ly.dto.applyordersync; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 前置差旅政策 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class AOSPreTravelPolicy { + private String policyCode;//差旅政策Code + private Integer productTypeId;//产品ID + private Integer approveRuleType;//使用差旅单审批规则 + +} diff --git a/src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSSubmitItem.java b/src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSSubmitItem.java new file mode 100644 index 00000000..3bfbd183 --- /dev/null +++ b/src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/AOSSubmitItem.java @@ -0,0 +1,17 @@ +package com.chint.interfaces.rest.ly.dto.applyordersync; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 行程提交项 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class AOSSubmitItem { + private String code;//行程提交项代码 + private String content;//行程提交项内容 + +} diff --git a/src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/ApplyOrderSync.java b/src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/ApplyOrderSync.java new file mode 100644 index 00000000..1e6fe79a --- /dev/null +++ b/src/main/java/com/chint/interfaces/rest/ly/dto/applyordersync/ApplyOrderSync.java @@ -0,0 +1,38 @@ +package com.chint.interfaces.rest.ly.dto.applyordersync; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class ApplyOrderSync { + private String outTravelApplyNo;//外部差旅单单号 + private Integer travelApplyType;//差旅类型 + private String travelApplyTime;//差旅单申请时间 + private String travelUpdateTime;//差旅单更新时间 + private Integer operationType;//操作类型 + private String outEnterpriseId;//外部企业id + private String outEmployeeId;//外部员工ID(申请人) + private String travelDescription;//差旅内容 + private String bookableProducts;//可预订产品 + private Integer status;//差旅单状态 + private double travelBudget;//差旅申请单预算 + private String travelRemark;//其他差旅 + private Integer carBookableQuantity;//可用车次数 + private Integer bookableQuantity;//机票&火车票可预订数量 + private Integer roomBookableQuantity;//酒店可预订间数 + private String travelPolicyCode;//差旅政策代码(差旅职级) + private String redirectUrl;//重定向地址 + + private List itemList; + private List personList; + private List preTravelPolicyList; + private List cityTravelPolicies; + private List submitItemList; + private List approverList; + private List costCenterList; +} diff --git a/src/main/java/com/chint/interfaces/rest/user/UserHttpRequestImpl.java b/src/main/java/com/chint/interfaces/rest/user/UserHttpRequestImpl.java index b03456fb..1a52ae72 100644 --- a/src/main/java/com/chint/interfaces/rest/user/UserHttpRequestImpl.java +++ b/src/main/java/com/chint/interfaces/rest/user/UserHttpRequestImpl.java @@ -40,7 +40,9 @@ public class UserHttpRequestImpl implements UserHttpRequest { private User loadSFAndRank(User user) { List loadSFInfo = loadSFInfo(user); String custManaLevel = loadSFInfo.get(0).getCust_manaLevel(); - String level = custManaLevel != null ? custManaLevel : loadSFInfo.get(0).getCust_profLevel(); + // String level = custManaLevel != null ? custManaLevel : loadSFInfo.get(0).getCust_profLevel(); + String level = custManaLevel != null ? custManaLevel : "M0"; + if (level.contains("R")) { level = level.substring(0, level.length() - 3) + "M0"; } diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 379524b8..d71619f4 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -5,7 +5,8 @@ chint: datasource: driver-class-name: com.mysql.cj.jdbc.Driver host: localhost + # host: 10.9.56.48 port: 3306 database: itinerary_booking username: root - password: 123456 + password: root diff --git a/src/test/java/com/chint/LTTest.java b/src/test/java/com/chint/LTTest.java index 5f426dca..a41a31ae 100644 --- a/src/test/java/com/chint/LTTest.java +++ b/src/test/java/com/chint/LTTest.java @@ -19,6 +19,7 @@ public class LTTest { private LYUserRequest lyUserRequest; private User user = new User(1L, 230615020L, 1, "卢麟哲", "1033719135@qq.com", "15857193365"); + private User hxh = new User(1L, 231116009L, 1, "黄小恒", "1628870217@qq.com", "18296007063"); @Test void loadToken(){ @@ -27,7 +28,8 @@ public class LTTest { @Test void saveCurrentUser2Ly(){ - BaseContext.setCurrentUser(user); + // BaseContext.setCurrentUser(user); + BaseContext.setCurrentUser(hxh); System.out.println(lyUserRequest.saveCurrentUser()); }