修复用户名缓存问题

This commit is contained in:
lulz1 2024-03-19 22:53:33 +08:00
parent ee71c07052
commit e2524f4145
5 changed files with 24 additions and 33 deletions

View File

@ -72,7 +72,7 @@ public class OrderEvent implements Serializable {
case ORDER_EVENT_CHANGE -> FSSC_FLIGHT_STATUS_CHANGE;
case ORDER_EVENT_CANCEL -> FSSC_ORDER_STATUS_CANCEL;
case ORDER_EVENT_ORDERED -> FSSC_FLIGHT_STATUS_SUCCESS;
case ORDER_EVENT_REFUND -> FSSC_FLIGHT_STATUS_REFUND;
case ORDER_EVENT_REFUND -> FSSC_FLIGHT_STATUS_CHANGE;
case ORDER_EVENT_UNKNOWN -> FSSC_FLIGHT_STATUS_SUCCESS;
case ORDER_EVENT_FINISH -> FSSC_FLIGHT_STATUS_SUCCESS;
case ORDER_EVENT_ETA -> FSSC_FLIGHT_STATUS_SUCCESS;

View File

@ -7,6 +7,7 @@ import com.chint.domain.repository.LocationRepository;
import com.chint.domain.repository.OrderDetailRepository;
import com.chint.domain.repository.RouteRepository;
import com.chint.domain.repository.UserRepository;
import com.chint.infrastructure.util.BigDecimalCalculator;
import com.chint.interfaces.rest.ctrip.dto.search.car.*;
import com.chint.interfaces.rest.ctrip.dto.search.flight.*;
import com.chint.interfaces.rest.ctrip.dto.search.hotel.ClientInfo;
@ -22,6 +23,7 @@ import java.util.Optional;
import static com.chint.infrastructure.constant.BelongSystemConstant.*;
import static com.chint.infrastructure.constant.CommonMessageConstant.NOT_FOUND;
import static com.chint.infrastructure.constant.FSSCConstant.*;
import static com.chint.infrastructure.constant.OrderConstant.ORDER_EVENT_CANCEL;
import static com.chint.infrastructure.constant.OrderConstant.ORDER_EVENT_ETA;
import static com.chint.infrastructure.constant.UtilConstant.KEEP_TWO_DECIMAL_ZERO;
@ -206,10 +208,9 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
//处理订单的状态信息
first.ifPresent(orderDetail -> {
OrderEvent lastEvent = orderDetail.getLastEvent();
if (lastEvent != null) {
flightOrderDetail.setOrderStatus(lastEvent.mapToFlightOrderDetailStatus());
} else {
flightOrderDetail.setOrderStatus(FSSC_FLIGHT_STATUS_SUCCESS);
flightOrderDetail.setOrderStatus(FSSC_FLIGHT_STATUS_SUCCESS);
if (lastEvent != null && lastEvent.getEventType().equals(ORDER_EVENT_CANCEL)) {
flightOrderDetail.setOrderStatus(FSSC_ORDER_STATUS_CANCEL);
}
});
@ -272,23 +273,15 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
flightOrderDetail.setSeatPoint(flightInfo.getFlightClass());
flightOrderDetail.setSeatPointName(flightInfo.getClassName());
flightOrderDetail.setFlightModel(flightInfo.getFlight());
//前后收服务费
//前后收服务费,燃油费机建费
flightOrderDetail.setPreServiceFee(String.valueOf(flightInfo.getItineraryFee()));
if (flightOrderDetail.getOrderStatus().equals(FSSC_FLIGHT_STATUS_SUCCESS)) {
flightOrderDetail.setFuelTax(String.valueOf(flightInfo.getOilFee()));
flightOrderDetail.setAirportTax(String.valueOf(flightInfo.getTax()));
flightOrderDetail.setFacePrice(String.valueOf(flightInfo.getPrice()));
flightOrderDetail.setStandard(flightInfo.getClassName() + flightInfo.getPriceRate());
flightOrderDetail.setNotBookedLowestPriceReason(flightInfo.getReasonDesc());
} else {
flightOrderDetail.setFuelTax(KEEP_TWO_DECIMAL_ZERO);
flightOrderDetail.setAirportTax(KEEP_TWO_DECIMAL_ZERO);
flightOrderDetail.setFacePrice(KEEP_TWO_DECIMAL_ZERO);
flightOrderDetail.setStandard(flightInfo.getClassName() + flightInfo.getPriceRate());
}
flightOrderDetail.setFuelTax(String.valueOf(flightInfo.getOilFee()));
flightOrderDetail.setAirportTax(String.valueOf(flightInfo.getTax()));
flightOrderDetail.setFacePrice(String.valueOf(flightInfo.getPrice()));
flightOrderDetail.setStandard(flightInfo.getClassName() + flightInfo.getPriceRate());
flightOrderDetail.setNotBookedLowestPriceReason(flightInfo.getReasonDesc());
}
List<TripRecordInfo> tripRecordInfoList = flightOrderInfoEntity.getTripRecordInfoList();
if (tripRecordInfoList != null && !tripRecordInfoList.isEmpty()) {
TripRecordInfo tripRecordInfo = tripRecordInfoList.get(0);
@ -310,7 +303,7 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
flightOrderDetail.getOrderStatus().equals(FSSC_FLIGHT_STATUS_CHANGE)) {
String[] split = flightOrderDetail.getDetailId().split("-");
//要找出对应退票信息
if(split.length > 1){
if (split.length > 1) {
ChangeInfo changeInfo = sequenceInfo
.getChangeInfo()
.stream()
@ -345,9 +338,10 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
flightOrderDetail.getOrderStatus().equals(FSSC_FLIGHT_STATUS_REFUND)) {
FlightRefundDetail refundDetail = refundDetailList.get(0);
//这里加一个判断 只有退票状态的机票加入 退票手续费
flightOrderDetail.setRefundFee(String.valueOf(refundDetail.getRefundFee()));
flightOrderDetail.setChangeFee(String.valueOf(refundDetail.getRefundFee()));
flightOrderDetail.setRefundAmount(String.valueOf(flightRefundInfo.getPayCustomerAmount()));
flightOrderDetail.setRefundAmount(BigDecimalCalculator.add(
String.valueOf(flightOrderBasicInfo.getAmount()), String.valueOf(flightOrderBasicInfo.getChangeAmount())
));
flightOrderDetail.setOrderAmount("-" + flightRefundInfo.getPayCustomerAmount());
flightOrderDetail.setCompanyPaymentAmount("-" + flightRefundInfo.getPayCustomerAmount());
} else {

View File

@ -4,6 +4,7 @@ import com.chint.domain.aggregates.user.User;
import com.chint.domain.repository.UserRepository;
import com.chint.infrastructure.repository.jdbc.JdbcUserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Repository;
@ -19,12 +20,14 @@ public class UserRepositoryImpl implements UserRepository {
}
@Cacheable(value = "RindByUserEmployeeNo",key = "#employeeNo")
@Cacheable(value = "UserEmployeeNoCache", key = "#employeeNo")
@Override
public User findByUserEmployeeNo(String employeeNo) {
return jdbcUserRepository.findByEmployeeNo(employeeNo);
}
@CacheEvict(value = "UserEmployeeNoCache", key = "#user.employeeNo")
@Override
public User save(User user) {
return jdbcUserRepository.save(user);

View File

@ -144,8 +144,6 @@ public class PostRequest {
return cachedUrl.getUrl();
}
}
int i = Runtime.getRuntime().availableProcessors();
log.info("执行get前当前线程数为" + i);
HttpGet request = new HttpGet(url); // 替换为你的URL
request.setHeader("User-Agent", androidUserAgent);
@ -158,8 +156,6 @@ public class PostRequest {
HttpResponse response = null;
try {
response = client.execute(request);
int i2 = Runtime.getRuntime().availableProcessors();
log.info("执行execute后当前线程数为" + i2);
} catch (IOException e) {
return REDIRECT_NOT_EXIST;
}
@ -169,8 +165,6 @@ public class PostRequest {
} else if (location != null) {
String reDirectUrl = location.getValue();
reDirectUrlCache.put(url, CachedUrl.of(reDirectUrl));
int i3 = Runtime.getRuntime().availableProcessors();
log.info("获取location后当前线程数为" + i3);
return reDirectUrl;
} else {
reDirectUrlCache.put(url, CachedUrl.ofError(REDIRECT_NOT_EXIST));

View File

@ -70,12 +70,12 @@ public class BPMRequest {
//改签申请
public BPMResponse reschedule(RescheduleDto rescheduleDto, String sysCode, String employeeNo, String accountCompany) {
return switch (sysCode) {
//case "FSSC", "H3BPM" -> submitWorkflow(rescheduleDto, employeeNo, accountCompany, CANCEL_AND_CHANGE);
//case "XNFSSC" -> BPMSubmitWorkflow("JG_AS_CLGQSQ", rescheduleDto, XNBPMUrl, sysCode, employeeNo);
//case "ANFSSC" -> new BPMResponse(true);
case "FSSC", "H3BPM" -> submitWorkflow(rescheduleDto, employeeNo, accountCompany, CANCEL_AND_CHANGE);
case "XNFSSC" -> BPMSubmitWorkflow("JG_AS_CLGQSQ", rescheduleDto, XNBPMUrl, sysCode, employeeNo);
case "ANFSSC" -> new BPMResponse(true);
default -> {
BPMResponse bpmResponse = new BPMResponse();
bpmResponse.setSuccess(true);
bpmResponse.setSuccess(false);
bpmResponse.setMessage("订单系统标识不正确!");
yield bpmResponse;
}