|
@@ -357,19 +357,20 @@ public class CargoTitleDetailsServiceImpl extends ServiceImpl<CargoTitleDetailsM
|
|
|
String transferOutNo = "HQZR"+df.format(new Date())+newNo;
|
|
|
cargoTitleDetails.setTransferOutNo(transferOutNo);
|
|
|
//货权赎回
|
|
|
- if (cargoTitleDetails.getRedeemContractNo()!=null){
|
|
|
- ContractManagementInfo contractManagementInfo=contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
|
|
|
- .eq("comp_id",cargoTitleDetails.getCompId())
|
|
|
- .eq("contract_no",cargoTitleDetails.getRedeemContractNo()));
|
|
|
- if (contractManagementInfo!=null){
|
|
|
- //本次赎回大于待赎回时 全部赎回
|
|
|
- if (cargoTitleDetails.getTransferOutWeight()>(contractManagementInfo.getExpectedRedemption()-contractManagementInfo.getRedeemed())){
|
|
|
- contractManagementInfo.setRedeemed(contractManagementInfo.getExpectedRedemption());
|
|
|
- }
|
|
|
- else {
|
|
|
- contractManagementInfo.setRedeemed(contractManagementInfo.getRedeemed() + cargoTitleDetails.getTransferOutWeight());
|
|
|
+ if (!CollectionUtils.isEmpty(cargoTitleDetails.getRedeemContractNoList())){
|
|
|
+ for (CargoTitleDetails cargoTitleDetails1:cargoTitleDetails.getRedeemContractNoList()) {
|
|
|
+ ContractManagementInfo contractManagementInfo = contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
|
|
|
+ .eq("comp_id", cargoTitleDetails.getCompId())
|
|
|
+ .eq("contract_no", cargoTitleDetails1.getRedeemContractNo()));
|
|
|
+ if (contractManagementInfo != null) {
|
|
|
+ //本次赎回大于待赎回时 全部赎回
|
|
|
+ if (cargoTitleDetails1.getTransferOutWeight() > (contractManagementInfo.getExpectedRedemption() - contractManagementInfo.getRedeemed())) {
|
|
|
+ contractManagementInfo.setRedeemed(contractManagementInfo.getExpectedRedemption());
|
|
|
+ } else {
|
|
|
+ contractManagementInfo.setRedeemed(contractManagementInfo.getRedeemed() + cargoTitleDetails1.getTransferOutWeight());
|
|
|
+ }
|
|
|
+ contractManagementInfoService.updateById(contractManagementInfo);
|
|
|
}
|
|
|
- contractManagementInfoService.updateById(contractManagementInfo);
|
|
|
}
|
|
|
}
|
|
|
List<CargoPositionDetails> cargoPositionDetailsList = cargoTitleDetails.getCargoPositionDetailsList();
|