Commit 4db4266e authored by 李健华's avatar 李健华

修改只有核销单号的逻辑

parent b3176c84
...@@ -39,5 +39,8 @@ public interface TransactionReceiptRecordRepo extends JpaRepository<TransactionR ...@@ -39,5 +39,8 @@ public interface TransactionReceiptRecordRepo extends JpaRepository<TransactionR
@Query(value = "select * from transaction_receipt_record where order_no = ?1 and import_status = 1 and export_status != 1 order by id desc", nativeQuery = true) @Query(value = "select * from transaction_receipt_record where order_no = ?1 and import_status = 1 and export_status != 1 order by id desc", nativeQuery = true)
List<TransactionReceiptRecord> selectRecords(String orderNo); List<TransactionReceiptRecord> selectRecords(String orderNo);
@Query(value = "select * from transaction_receipt_record where consume_no = ?1 and import_status = 1 and export_status != 1 order by id desc", nativeQuery = true)
List<TransactionReceiptRecord> selectRecordsConsumeNo(String orderNo);
} }
...@@ -425,6 +425,9 @@ public class TransactionReceiptRecordServiceImpl implements ITransactionReceiptR ...@@ -425,6 +425,9 @@ public class TransactionReceiptRecordServiceImpl implements ITransactionReceiptR
//生成pdf //生成pdf
String directory =record.getSerialNo()+record.getUserName(); String directory =record.getSerialNo()+record.getUserName();
String pdfFileName = record.getUserId()+"-"+record.getUserName()+"-"+record.getOrderNo()+".pdf"; String pdfFileName = record.getUserId()+"-"+record.getUserName()+"-"+record.getOrderNo()+".pdf";
if (StringUtils.isNotEmpty(record.getConsumeNo())) {
pdfFileName = record.getUserId()+"-"+record.getUserName()+"-"+record.getConsumeNo()+".pdf";
}
FileToZip.mkdir(uploadLocalPath+directory); FileToZip.mkdir(uploadLocalPath+directory);
log.info("导出文件生成pdf begin:"+pdfFileName); log.info("导出文件生成pdf begin:"+pdfFileName);
generatePDF(transactionReceiptVOList.get(0),uploadLocalPath+"/"+directory+"/"+pdfFileName); generatePDF(transactionReceiptVOList.get(0),uploadLocalPath+"/"+directory+"/"+pdfFileName);
...@@ -708,7 +711,10 @@ public class TransactionReceiptRecordServiceImpl implements ITransactionReceiptR ...@@ -708,7 +711,10 @@ public class TransactionReceiptRecordServiceImpl implements ITransactionReceiptR
if(!successList.isEmpty()){ if(!successList.isEmpty()){
for(String orderNo :successList){ for(String orderNo :successList){
if(StringUtils.isNotBlank(orderNo)){ if(StringUtils.isNotBlank(orderNo)){
List<TransactionReceiptRecord> list = transactionReceiptRecordRepo.selectRecords(orderNo); List<TransactionReceiptRecord> list = transactionReceiptRecordRepo.selectRecordsConsumeNo(orderNo);
if (list.isEmpty()) {
list = transactionReceiptRecordRepo.selectRecords(orderNo);
}
if(!list.isEmpty()){ if(!list.isEmpty()){
list.get(0).setExportStatus(VoucherExportStatus.EXPORT_SUCCESS.getCode()); list.get(0).setExportStatus(VoucherExportStatus.EXPORT_SUCCESS.getCode());
list.get(0).setSignStatus(VoucherExportStatus.EXPORT_SUCCESS.getCode()); list.get(0).setSignStatus(VoucherExportStatus.EXPORT_SUCCESS.getCode());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment