From 978654e2e5888d8ab0ba947dd51ffde4711df35a Mon Sep 17 00:00:00 2001 From: lulz1 Date: Tue, 28 May 2024 10:44:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E9=AB=98=E5=BE=B7=E7=94=A8=E8=BD=A6?= =?UTF-8?q?=E6=98=8E=E7=BB=86=EF=BC=8C=E7=94=A8=E8=BD=A6=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E5=8F=96=E5=80=BC=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../amap_order_record/AmapCarOrderRecord.java | 103 ++++++++++++++++++ .../chint/domain/aggregates/user/User.java | 6 +- .../AmapOrderExtensionFactoryImpl.java | 2 +- .../LYOrderExtensionFactoryImpl.java | 3 - .../AmapOrderRecordExtensionFactory.java | 23 ++-- .../service/auth/AuthenticateServiceImpl.java | 2 +- .../data_center/user/UserHttpRequestImpl.java | 1 - src/main/resources/application-test.yml | 8 +- src/test/java/com/chint/AmapTest.java | 2 +- src/test/java/com/chint/LYTest.java | 2 +- .../java/com/chint/RouteApplicationTests.java | 20 +--- 11 files changed, 129 insertions(+), 43 deletions(-) create mode 100644 src/main/java/com/chint/domain/aggregates/order/order_record/amap_order_record/AmapCarOrderRecord.java diff --git a/src/main/java/com/chint/domain/aggregates/order/order_record/amap_order_record/AmapCarOrderRecord.java b/src/main/java/com/chint/domain/aggregates/order/order_record/amap_order_record/AmapCarOrderRecord.java new file mode 100644 index 00000000..095b2ac5 --- /dev/null +++ b/src/main/java/com/chint/domain/aggregates/order/order_record/amap_order_record/AmapCarOrderRecord.java @@ -0,0 +1,103 @@ +package com.chint.domain.aggregates.order.order_record.amap_order_record; + +import cn.hutool.core.bean.BeanUtil; +import com.chint.interfaces.rest.amap.dto.settlement.FinishedOrderResponse; +import lombok.Data; +import org.springframework.data.annotation.Id; +import org.springframework.data.relational.core.mapping.Table; + +import java.io.Serial; +import java.io.Serializable; + +@Data +@Table("amap_car_order_record") +public class AmapCarOrderRecord implements Serializable { + @Serial + private static final long serialVersionUID = 2119081773011455611L; + @Id + private Long id; + private Double addFee; + private String amapOrderId; + private String amapRideType; + private String approvalEUserId; + private String approvalSecondType; + private String approvalUserName; + private String autoEnterprisePay; + private Double bridgeFee; + private Double cancelFee; + private String cardId; + private String cityName; + private String confirmFeeTime; + private String cpAmapOid; + private String cpCode; + private String cpName; + private String cpOrderId; + private String dep1; + private String dep10; + private String dep11; + private String dep12; + private String dep13; + private String dep14; + private String dep15; + private String dep2; + private String dep3; + private String dep4; + private String dep5; + private String dep6; + private String dep7; + private String dep8; + private String dep9; + private String departTime; + private String departmentId; + private Double dispatchAmount; + private String ds; + private String eId; + private String eName; + private String eUserId; + private String endCity; + private String endName; + private Double enterpriseAmount; + private Double estimateMileage; + private Double estimatePrice; + private String financeCostcenterCode; + private String financeCostcenterDesc; + private String gmtCreate; + private String gmtCreate103; + private String gmtCreate104; + private String gmtCreateEndTime106; + private String gmtCreateStartTime106; + private Double highwayFee; + private Double individualAmount; + private Double infoFees; + private String isCancelFeeOrder; + private String isChangeFee; + private Double mileage; + private Double orderAmount; + private String orderEnterance; + private String orderRelyId; + private Double otherFee; + private String outApplyRecordId; + private String parentProjectCode; + private String parentProjectName; + private Double parkingFee; + private String processStatus; + private String projectCode; + private String realName; + private String regulationId; + private String regulationName; + private String relationEntId; + private String relationEntName; + private String remark; + private String result; + private String resultType; + private Double servicefee; + private String signCompanyName; + private String startName; + private Double totalCouponAmount; + private Double travelFee; + private String userId; + + public static AmapCarOrderRecord of(FinishedOrderResponse.ListElement listElement){ + return BeanUtil.copyProperties(listElement, AmapCarOrderRecord.class); + } +} diff --git a/src/main/java/com/chint/domain/aggregates/user/User.java b/src/main/java/com/chint/domain/aggregates/user/User.java index 4e0d238b..b2702496 100644 --- a/src/main/java/com/chint/domain/aggregates/user/User.java +++ b/src/main/java/com/chint/domain/aggregates/user/User.java @@ -108,9 +108,8 @@ public class User implements Serializable { // 获取公司代码,优先从用户获取,若为空则从登录参数中获取 String companyCode = Optional.ofNullable(this.getCompanyCode()) .orElseGet(() -> { - User currentUser = BaseContext.getCurrentUser(); - if (currentUser != null && currentUser.getUserLoginParam() != null) { - return currentUser.getUserLoginParam().getCompanyCode(); + if (this.getUserLoginParam() != null) { + return this.getUserLoginParam().getCompanyCode(); } return null; }); @@ -332,7 +331,6 @@ public class User implements Serializable { Claim employeeNo = claims.get(AuthMessageConstant.USER_EMPLOYEE_NO); Claim name = claims.get(AuthMessageConstant.USER_NAME); Claim employeeLevel = claims.get(AuthMessageConstant.USER_EMPLOYEE_LEVEL); - // Claim rankCode = claims.get(AuthMessageConstant.USER_RANK_CODE); Claim companyCode = claims.get(AuthMessageConstant.USER_COMPANY_CODE); Claim loginParam = claims.get(AuthMessageConstant.USER_LOGIN_PARAM); Claim standardLevel = claims.get(AuthMessageConstant.USER_STANDARD_LEVEL); diff --git a/src/main/java/com/chint/domain/factoriy/order_detail/AmapOrderExtensionFactoryImpl.java b/src/main/java/com/chint/domain/factoriy/order_detail/AmapOrderExtensionFactoryImpl.java index 03cda7af..4f84082d 100644 --- a/src/main/java/com/chint/domain/factoriy/order_detail/AmapOrderExtensionFactoryImpl.java +++ b/src/main/java/com/chint/domain/factoriy/order_detail/AmapOrderExtensionFactoryImpl.java @@ -171,7 +171,7 @@ public class AmapOrderExtensionFactoryImpl implements OrderExtensionFactory { carOrderDetail.setToStationName(data.getEndName()); carOrderDetail.setFromCity(data.getStartCity()); carOrderDetail.setToCity(data.getEndCity()); - carOrderDetail.setCarModel(data.getRideType()); + carOrderDetail.setCarModel(data.getRideTypeName()); } carOrderDetail.setSupplier(SUPPLIER_AMAP_CN_NAME); diff --git a/src/main/java/com/chint/domain/factoriy/order_detail/LYOrderExtensionFactoryImpl.java b/src/main/java/com/chint/domain/factoriy/order_detail/LYOrderExtensionFactoryImpl.java index b29931d9..dfb14229 100644 --- a/src/main/java/com/chint/domain/factoriy/order_detail/LYOrderExtensionFactoryImpl.java +++ b/src/main/java/com/chint/domain/factoriy/order_detail/LYOrderExtensionFactoryImpl.java @@ -421,17 +421,14 @@ public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory { if (!list.isEmpty()) { hotelOrderDetail.setStandardItems(list.get(0)); } - if (hotelOrderDetail.getOrderStatus().equals(FSSC_FLIGHT_STATUS_SUCCESS)) { hotelOrderDetail.setOrderAmount(String.valueOf(room.getSalesPrice())); } - hotelOrderDetail.setCompanyAmount(String.valueOf(room.getCompanyPrice())); hotelOrderDetail.setPersonalAmount(String.valueOf(room.getPersonalPrice())); } } - @Override public OtherOrderDetail createOtherOrderDetail(Object otherOrderDetailData) { return null; diff --git a/src/main/java/com/chint/domain/factoriy/order_record/AmapOrderRecordExtensionFactory.java b/src/main/java/com/chint/domain/factoriy/order_record/AmapOrderRecordExtensionFactory.java index da8f21a5..f900ef4b 100644 --- a/src/main/java/com/chint/domain/factoriy/order_record/AmapOrderRecordExtensionFactory.java +++ b/src/main/java/com/chint/domain/factoriy/order_record/AmapOrderRecordExtensionFactory.java @@ -5,27 +5,16 @@ import com.chint.domain.aggregates.order.order_record.OrderCarRecord; import com.chint.domain.aggregates.order.order_record.OrderFlightRecord; import com.chint.domain.aggregates.order.order_record.OrderHotelRecord; import com.chint.domain.aggregates.order.order_record.OrderTrainRecord; -import com.chint.domain.aggregates.order.order_record.ctrip_order_record.CTripCarPassengerInfo; -import com.chint.domain.aggregates.order.order_record.ctrip_order_record.CTripCarRecord; import com.chint.interfaces.rest.amap.dto.settlement.FinishedOrderResponse; import org.springframework.stereotype.Component; -import java.util.List; import java.util.Optional; -import static com.chint.infrastructure.constant.BelongSystemConstant.TRAVAL_SYS_TYPE_CTRIP; - @Component -public class AmapOrderRecordExtensionFactory implements OrderRecordExtensionFactory{ +public class AmapOrderRecordExtensionFactory implements OrderRecordExtensionFactory { - private OrderRecordBasic buildWithRecord(Object orderCarRecordData) { - FinishedOrderResponse.ListElement carRecordData = (FinishedOrderResponse.ListElement) orderCarRecordData; - String[] split = carRecordData.getRemark().split("-"); - return null; - } - @Override public OrderCarRecord createCarOrderRecord(Object orderCarRecordData) { FinishedOrderResponse.ListElement carRecordData = (FinishedOrderResponse.ListElement) orderCarRecordData; @@ -38,6 +27,7 @@ public class AmapOrderRecordExtensionFactory implements OrderRecordExtensionFact return null; } + //"remark": "浙江正泰电器股份有限公司-736847b909ad11ee814d7dd3d5149cac-WZSqtwxm001-ZTSC002400011-FSSC-CLSQ240524000006", @Override public OrderTrainRecord createTrainOrderRecord(Object orderTrainRecordData) { return null; @@ -53,6 +43,15 @@ public class AmapOrderRecordExtensionFactory implements OrderRecordExtensionFact return null; } + private OrderRecordBasic buildWithRecord(Object orderCarRecordData) { + FinishedOrderResponse.ListElement carRecordData = (FinishedOrderResponse.ListElement) orderCarRecordData; + OrderRecordBasic orderRecordBasic = new OrderRecordBasic(); +// orderRecordBasic.loadBookingInfo( +// carRecordData.get +// ) + return null; + } + @Override public OrderCarRecord createCarOrderRecord(Object orderCarRecordData, Optional routeOrder) { return null; diff --git a/src/main/java/com/chint/domain/service/auth/AuthenticateServiceImpl.java b/src/main/java/com/chint/domain/service/auth/AuthenticateServiceImpl.java index f5fd4e7f..021d2766 100644 --- a/src/main/java/com/chint/domain/service/auth/AuthenticateServiceImpl.java +++ b/src/main/java/com/chint/domain/service/auth/AuthenticateServiceImpl.java @@ -58,6 +58,7 @@ public class AuthenticateServiceImpl implements AuthenticateService { if (user != null) { // 部分数据需要通过查询外部的http来获取 user.setUserLoginParam(userLoginParam); + httpRequest.loadUserInfo(user); return getUserLoginResult(user); } else { User newUser = userFactory.create(userLoginParam.getSfno()); @@ -74,7 +75,6 @@ public class AuthenticateServiceImpl implements AuthenticateService { UserLoginParam userLoginParam = user.getUserLoginParam(); user.setCompanyCode(userLoginParam.getCompanyCode()); user.setUserLoginParam(userLoginParam); - httpRequest.loadUserInfo(user); List fsscSystemList = user.getFsscSystemList(); Map claims = new HashMap<>(); claims.put(USER_ID, user.getUserId()); diff --git a/src/main/java/com/chint/interfaces/rest/data_center/user/UserHttpRequestImpl.java b/src/main/java/com/chint/interfaces/rest/data_center/user/UserHttpRequestImpl.java index 5bd72bdc..77fcadc1 100644 --- a/src/main/java/com/chint/interfaces/rest/data_center/user/UserHttpRequestImpl.java +++ b/src/main/java/com/chint/interfaces/rest/data_center/user/UserHttpRequestImpl.java @@ -161,7 +161,6 @@ public class UserHttpRequestImpl implements UserHttpRequest { .filter(userDataDTO -> "A".equals(userDataDTO.getStatus())) .toList(); - if (fromJson.isEmpty()) { user.setStatus(0); Command.of(UserDisabledCommand.class).user(user).sendToQueue(); diff --git a/src/main/resources/application-test.yml b/src/main/resources/application-test.yml index 3075716c..75135ba2 100644 --- a/src/main/resources/application-test.yml +++ b/src/main/resources/application-test.yml @@ -46,10 +46,10 @@ logging: #正式 ly: appId: zhengtai - account: 4f9cb1080b564dd0a94aa95f7a19c8b5 - password: 1fD3SutgzfS48qznYQiq - secret: WOHzCMvHd823iHgH - baseUrl: https://api.qa.dttrip.cn/openapi + account: ab9fe0c19dd64a99b936fded72c3bb94 + password: glHRJJ9JMUwNfQ8OwAQi + secret: MnghmYJpM1U2RaLx + baseUrl: https://api.dttrip.cn/openapi ifForwardRequest: false forwardRequestBaseUrl: https://secureqrdev-t.chint.com/llz diff --git a/src/test/java/com/chint/AmapTest.java b/src/test/java/com/chint/AmapTest.java index 07004fbf..567d4813 100644 --- a/src/test/java/com/chint/AmapTest.java +++ b/src/test/java/com/chint/AmapTest.java @@ -61,7 +61,7 @@ public class AmapTest { @Test public void search() { Gson gson = new Gson(); - AmapOrderDetailResponse orderDetailResponse = orderDetailRequest.queryOrderDetail("40920084001340019626730137"); + AmapOrderDetailResponse orderDetailResponse = orderDetailRequest.queryOrderDetail("40168289001340014634615053"); System.out.println(gson.toJson(orderDetailResponse)); } diff --git a/src/test/java/com/chint/LYTest.java b/src/test/java/com/chint/LYTest.java index 4a2b8ebd..ad9971da 100644 --- a/src/test/java/com/chint/LYTest.java +++ b/src/test/java/com/chint/LYTest.java @@ -828,7 +828,7 @@ public class LYTest { @Test void searchHotel() { - HotelDetailResponse hotelOrderDetail = lySearchRequest.getHotelOrderDetail("HO20240410160000601814"); + HotelDetailResponse hotelOrderDetail = lySearchRequest.getHotelOrderDetail("HO20240330143900871266"); Gson gson = new Gson(); String json = gson.toJson(hotelOrderDetail); System.out.println(json); diff --git a/src/test/java/com/chint/RouteApplicationTests.java b/src/test/java/com/chint/RouteApplicationTests.java index cc07c44c..a2649ca1 100644 --- a/src/test/java/com/chint/RouteApplicationTests.java +++ b/src/test/java/com/chint/RouteApplicationTests.java @@ -299,10 +299,10 @@ class RouteApplicationTests { @Test void loginSign() { - String sfno = "060726001"; + String sfno = "220531010"; String syscode = "FSSC"; String billcode = "CLSQ240225000099"; - String companycode = "正泰集团股份有限公司"; + String companycode = "A70000021"; String timespan = "1708908662738"; String s = Digest.md5(sfno + syscode + billcode + companycode + LOGIN_SECRET_KEY + timespan); System.out.println(s); @@ -310,10 +310,10 @@ class RouteApplicationTests { @Test void loginSignProd() { - String sfno = "001019002"; + String sfno = "220531010"; String syscode = "FSSC"; String billcode = "CLSQ240225000099"; - String companycode = "正泰集团股份有限公司"; + String companycode = "A70000021"; String timespan = "1708908662738"; String key = "ZhengTaiRoute"; String s = Digest.md5(sfno + syscode + billcode + companycode + key + timespan); @@ -1410,16 +1410,6 @@ class RouteApplicationTests { @Test void roleTest() { - System.out.println(System.currentTimeMillis()); - User byId = userRepository.findByUserEmployeeNo("230615020").loadRoleOrg(); - System.out.println(System.currentTimeMillis()); - byId.loadRoleOrg(); - System.out.println(System.currentTimeMillis()); - byId.loadRoleOrg(); - System.out.println(System.currentTimeMillis()); - byId.loadRoleOrg(); - System.out.println(System.currentTimeMillis()); - byId.loadRoleOrg(); - System.out.println(System.currentTimeMillis()); + } }