结算明细字段映射调整

This commit is contained in:
dengwc 2024-04-07 16:09:51 +08:00
parent edb6072433
commit f922c6d987
2 changed files with 25 additions and 7 deletions

View File

@ -41,6 +41,8 @@ public class LyOrderRecordExtensionFactory implements OrderRecordExtensionFactor
@Autowired
private JdbcRouteRepository jdbcRouteRepository;
@Autowired
private OrderRecordFactory orderRecordFactory;
@Autowired
private JdbcOrderTravelRepository orderTravelRepository;
@ -120,7 +122,7 @@ public class LyOrderRecordExtensionFactory implements OrderRecordExtensionFactor
.setFlightCompName(lyOrderFlightRecord.getAirlineCompanyName())//航空公司名称
.setFlightLowestPrice(String.valueOf(lyOrderFlightRecord.getFligthMinPrice()))//航班最低价
.setFlightNum(lyOrderFlightRecord.getFligthNo())//航班号
.setOrderAmount(String.valueOf(lyOrderFlightRecord.getToBePayAmount())) //结算总额
.setOrderAmount(String.valueOf(lyOrderFlightRecord.getTicketTotalAmount())) //结算总额
.setFacePrice(String.valueOf(lyOrderFlightRecord.getTicketOutAmount())) //票面价
.setNoTaxAmt(String.valueOf(BigDecimal.valueOf(lyOrderFlightRecord.getTicketTotalAmount() == null ? 0 : lyOrderFlightRecord.getTicketTotalAmount())
.subtract(BigDecimal.valueOf(lyOrderFlightRecord.getTicketDeductibleTax() == null ? 0 : lyOrderFlightRecord.getTicketDeductibleTax())))) //未税金额
@ -148,7 +150,7 @@ public class LyOrderRecordExtensionFactory implements OrderRecordExtensionFactor
.setOrderStatus("") //结算状态
// .setExpenseOrderAmount("") //订单金额
// .setSettleOrderFlag() //订单对账状态
.setPayAmount(String.valueOf(lyOrderFlightRecord.getToBePayAmount() + lyOrderFlightRecord.getServiceAmount()))//支付金额
.setPayAmount(String.valueOf(lyOrderFlightRecord.getToBePayAmount()))//支付金额
;
//订单明细字段赋值
setFlightRecordDetail(orderFlightRecord, flightOrderDetail);

View File

@ -29,6 +29,9 @@ import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
@Slf4j
@Service
@ -94,15 +97,28 @@ public class LyStatementOrder {
String endTime = LocalDateTime.now().format(formatter);
for (ResStatementList.OnlineStatementList onlineStatement : onlineStatementList) {
String statementCode = onlineStatement.getStatementCode();//对账单编码
// 提交任务给线程池处理
// 定义线程池可以根据实际情况调整线程数量
ExecutorService executor = Executors.newFixedThreadPool(4); // 创建一个包含4个线程的线程池
//1.查询机票账单详情
flightStatement(statementCode, startTime, endTime);
executor.submit(() -> flightStatement(statementCode, startTime, endTime));
//2.查询酒店账单详情
hotelStatement(statementCode, startTime, endTime);
executor.submit(() -> hotelStatement(statementCode, startTime, endTime));
//3.查询火车票账单详情
trainStatement(statementCode, startTime, endTime);
executor.submit(() -> trainStatement(statementCode, startTime, endTime));
//4.查询用车账单详情
carStatement(statementCode, startTime, endTime);
executor.submit(() -> carStatement(statementCode, startTime, endTime));
// 关闭线程池
executor.shutdown();
try {
// 等待所有任务执行完成或者超时时间到达这里设置为一天
boolean flag = executor.awaitTermination(1, TimeUnit.HOURS);
} catch (InterruptedException e) {
// 处理中断异常
log.error(e.getMessage());
// 强制关闭线程池
executor.shutdownNow();
}
}
log.info("保存成功!");
}