| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.basic.entity.dto.SimpleStorageDto; |
| | | import com.ruoyi.basic.service.StorageBlobService; |
| | | import com.ruoyi.business.dto.ReceiptPaymentDto; |
| | | import com.ruoyi.business.dto.SalesRecordDto; |
| | | import com.ruoyi.business.entity.DuePayable; |
| | | import com.ruoyi.business.entity.ReceiptPayment; |
| | | import com.ruoyi.business.entity.SalesRecord; |
| | | import com.ruoyi.business.mapper.ReceiptPaymentMapper; |
| | | import com.ruoyi.business.mapper.SalesRecordMapper; |
| | | import com.ruoyi.business.service.ReceiptPaymentService; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | |
| | | import jakarta.annotation.Resource; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | import java.time.YearMonth; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.Stream; |
| | | |
| | | @Service |
| | | public class ReceiptPaymentServiceImpl extends ServiceImpl<ReceiptPaymentMapper, ReceiptPayment> implements ReceiptPaymentService { |
| | |
| | | private ReceiptPaymentMapper receiptPaymentMapper; |
| | | @Autowired |
| | | private SalesRecordMapper salesRecordMapper; |
| | | |
| | | @Resource |
| | | private StorageBlobService storageBlobService; |
| | | |
| | | |
| | | /** |
| | | * 回款登记新增 |
| | |
| | | |
| | | @Override |
| | | public IPage<ReceiptPaymentDto> receiptPaymentHistoryListPage(Page page, ReceiptPaymentDto receiptPaymentDto) { |
| | | return receiptPaymentMapper.bindInvoiceNoRegPage(page, receiptPaymentDto); |
| | | |
| | | IPage<ReceiptPaymentDto> receiptPaymentDtoIPage = receiptPaymentMapper.bindInvoiceNoRegPage(page, receiptPaymentDto); |
| | | |
| | | List<ReceiptPaymentDto> dtoList = receiptPaymentDtoIPage.getRecords(); |
| | | Map<Long, List<Long>> attachMap = dtoList.stream().collect(Collectors.toMap( |
| | | (ReceiptPaymentDto receiptPaymentDto1) -> receiptPaymentDto1.getId().longValue(), |
| | | it -> { |
| | | if (StringUtils.isNotBlank(it.getAttachUpload())) { |
| | | return Arrays.stream(it.getAttachUpload().split(",")) |
| | | .map(Long::parseLong) |
| | | .collect(Collectors.toList()); |
| | | } else { |
| | | return List.of(); |
| | | } |
| | | } |
| | | )); |
| | | Map<Long, List<SimpleStorageDto>> conver = storageBlobService.conver(attachMap); |
| | | dtoList.forEach(it->{ |
| | | it.setAttachFileList(conver.get(it.getId().longValue())); |
| | | }); |
| | | return receiptPaymentDtoIPage; |
| | | } |
| | | |
| | | @Override |