| | |
| | | package com.by4cloud.platformx.business.service.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.ObjUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | |
| | | import com.by4cloud.platformx.business.service.ContractService; |
| | | import com.by4cloud.platformx.business.service.PaymentOffsetService; |
| | | import com.by4cloud.platformx.common.core.util.R; |
| | | import com.by4cloud.platformx.common.security.util.SecurityUtils; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | ; |
| | | |
| | | /** |
| | | * 抵抹账 |
| | |
| | | List<ContractPaymentSchedule> scheduleList = contractPaymentScheduleMapper.selectList(Wrappers.<ContractPaymentSchedule>lambdaQuery() |
| | | .eq(ContractPaymentSchedule::getContractId,contract.getId()).ne(ContractPaymentSchedule::getPaymentStatus,2) |
| | | .ne(ContractPaymentSchedule::getPaymentStatus,3).orderByAsc(ContractPaymentSchedule::getCreateTime)); |
| | | if (ArrayUtil.isNotEmpty(scheduleList.toArray())){ |
| | | if (CollUtil.isNotEmpty(scheduleList)){ |
| | | BigDecimal remain = paymentOffset.getOffsetAmount(); |
| | | for (ContractPaymentSchedule schedule:scheduleList) { |
| | | BigDecimal lastRemain = remain; |
| | |
| | | } |
| | | contractService.updateById(contract); |
| | | // 查询所有付款阶段是否都付款完成 |
| | | // if (ArrayUtil.isNotEmpty(scheduleList.toArray())){ |
| | | // if (.isNotEmpty(scheduleList)){ |
| | | // if (scheduleList.stream().allMatch(item -> Objects.equals(item.getPaymentStatus(), 2))){ |
| | | // contract.setContractStatus(3); |
| | | // contractService.updateById(contract); |