|
@@ -307,27 +307,20 @@ public class TqContractServiceImpl implements ITqContractService
|
|
**/
|
|
**/
|
|
private List<TqContractLift> attachTqContractLift(TqContractDto tqContractDto, List<TqContractLift> tqContractLiftList){
|
|
private List<TqContractLift> attachTqContractLift(TqContractDto tqContractDto, List<TqContractLift> tqContractLiftList){
|
|
//根据实际排产日期查询汇率
|
|
//根据实际排产日期查询汇率
|
|
- List<ContractCurrencyTime> scheduleList = tqContractLiftList.stream()
|
|
|
|
- .filter(tqContractLift -> tqContractLift.getSigningDate() != null) // Filter out null signing dates
|
|
|
|
|
|
+ List<ContractCurrencyTime> scheduleList = tqContractLiftList.stream().filter(tqContractLift -> tqContractLift.getActualProductionScheduleDate() != null) // Filter out null signing dates
|
|
.map(tqContractLift -> new ContractCurrencyTime(
|
|
.map(tqContractLift -> new ContractCurrencyTime(
|
|
- Long.parseLong(tqContractLift.getCurrencyId()), // Assuming this returns a long
|
|
|
|
- tqContractLift.getActualProductionScheduleDate()
|
|
|
|
|
|
+ Long.parseLong(tqContractLift.getCurrencyId()), tqContractLift.getActualProductionScheduleDate()
|
|
))
|
|
))
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
Map<Long, BigDecimal> scheduleListIdAndRateMap = tbContractCurrencyService.selectExchangeRateByCurrencyId(scheduleList);
|
|
Map<Long, BigDecimal> scheduleListIdAndRateMap = tbContractCurrencyService.selectExchangeRateByCurrencyId(scheduleList);
|
|
//根据实际发货排产日期查询汇率
|
|
//根据实际发货排产日期查询汇率
|
|
- List<ContractCurrencyTime> deliveryList = tqContractLiftList.stream()
|
|
|
|
- .filter(tqContractLift -> tqContractLift.getSigningDate() != null) // Filter out null signing dates
|
|
|
|
|
|
+ List<ContractCurrencyTime> deliveryList = tqContractLiftList.stream().filter(tqContractLift -> tqContractLift.getActualDeliveryDate() != null) // Filter out null signing dates
|
|
.map(tqContractLift -> new ContractCurrencyTime(
|
|
.map(tqContractLift -> new ContractCurrencyTime(
|
|
- Long.parseLong(tqContractLift.getCurrencyId()), // Assuming this returns a long
|
|
|
|
- tqContractLift.getActualDeliveryDate()
|
|
|
|
|
|
+ Long.parseLong(tqContractLift.getCurrencyId()), tqContractLift.getActualDeliveryDate()
|
|
))
|
|
))
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
Map<Long, BigDecimal> deliveryListIdAndRateMap = tbContractCurrencyService.selectExchangeRateByCurrencyId(deliveryList);
|
|
Map<Long, BigDecimal> deliveryListIdAndRateMap = tbContractCurrencyService.selectExchangeRateByCurrencyId(deliveryList);
|
|
|
|
|
|
-// //获取版本
|
|
|
|
-// Long version = tqContractLiftHistoryMapper.selectVersionMaxFromHistory(tqContractDto.getContractNo());
|
|
|
|
-// String contractNoVersionNo = version == null ? "1": String.valueOf(version+1L);
|
|
|
|
tqContractLiftList.forEach(item -> {
|
|
tqContractLiftList.forEach(item -> {
|
|
item.setContractNo(tqContractDto.getContractNo());
|
|
item.setContractNo(tqContractDto.getContractNo());
|
|
item.setContractName(tqContractDto.getContractName());
|
|
item.setContractName(tqContractDto.getContractName());
|
|
@@ -351,6 +344,7 @@ public class TqContractServiceImpl implements ITqContractService
|
|
if(scheduleListIdAndRateMap.containsKey(Long.parseLong(item.getCurrencyId()))){
|
|
if(scheduleListIdAndRateMap.containsKey(Long.parseLong(item.getCurrencyId()))){
|
|
item.setRate4ProductionScheduling(scheduleListIdAndRateMap.get(Long.parseLong(item.getCurrencyId())));
|
|
item.setRate4ProductionScheduling(scheduleListIdAndRateMap.get(Long.parseLong(item.getCurrencyId())));
|
|
}
|
|
}
|
|
|
|
+ //发货汇率
|
|
if(deliveryListIdAndRateMap.containsKey(Long.parseLong(item.getCurrencyId()))){
|
|
if(deliveryListIdAndRateMap.containsKey(Long.parseLong(item.getCurrencyId()))){
|
|
item.setRate4Shipment(deliveryListIdAndRateMap.get(Long.parseLong(item.getCurrencyId())));
|
|
item.setRate4Shipment(deliveryListIdAndRateMap.get(Long.parseLong(item.getCurrencyId())));
|
|
}
|
|
}
|