|
|
|
@ -1,11 +1,11 @@ |
|
|
|
|
package com.jianshui.invoice.service.impl; |
|
|
|
|
|
|
|
|
|
import java.util.Arrays; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.*; |
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil; |
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
import com.jianshui.common.core.domain.AjaxResult; |
|
|
|
|
import com.jianshui.common.core.domain.entity.SysDictData; |
|
|
|
|
import com.jianshui.common.utils.DateUtils; |
|
|
|
|
import com.jianshui.common.utils.DictUtils; |
|
|
|
|
import com.jianshui.common.utils.spring.SpringUtils; |
|
|
|
@ -15,12 +15,11 @@ import com.jianshui.invoice.mapper.InvoiceMapper; |
|
|
|
|
import com.jianshui.queue.consumer.RedisQueueConsumer; |
|
|
|
|
import com.jianshui.queue.dto.RedisQueueMessage; |
|
|
|
|
import com.jianshui.queue.utils.RedisQueueUtil; |
|
|
|
|
import com.jianshui.system.service.ISysDictTypeService; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
|
|
|
|
import com.jianshui.common.utils.StringUtils; |
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
import com.jianshui.invoice.domain.BillDetail; |
|
|
|
@ -43,6 +42,9 @@ public class BillInfoServiceImpl implements IBillInfoService { |
|
|
|
|
@Autowired |
|
|
|
|
private InvoiceMapper invoiceMapper; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private ISysDictTypeService dictTypeService; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 查询开票信息 |
|
|
|
|
* |
|
|
|
@ -62,7 +64,63 @@ public class BillInfoServiceImpl implements IBillInfoService { |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public List<BillInfo> selectBillInfoList(BillInfo billInfo) { |
|
|
|
|
return billInfoMapper.selectBillInfoList(billInfo); |
|
|
|
|
|
|
|
|
|
List<BillInfo> billInfos = billInfoMapper.selectBillInfoList(billInfo); |
|
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(billInfos)) { |
|
|
|
|
|
|
|
|
|
Map<String,String> invoiceTypeDictMap = new HashMap<>(); ; |
|
|
|
|
|
|
|
|
|
List<SysDictData> invoiceTypeData = dictTypeService.selectDictDataByType("invoice_type"); |
|
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(invoiceTypeData)){ |
|
|
|
|
invoiceTypeData.forEach(e->invoiceTypeDictMap.put(e.getDictValue(),e.getDictLabel())); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Map<String,String> billTypeDictMap = new HashMap<>(); ; |
|
|
|
|
|
|
|
|
|
List<SysDictData> billTypeData = dictTypeService.selectDictDataByType("bill_type"); |
|
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(billTypeData)){ |
|
|
|
|
billTypeData.forEach(e->billTypeDictMap.put(e.getDictValue(),e.getDictLabel())); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Map<String,String> invocieStatusDictMap = new HashMap<>(); ; |
|
|
|
|
|
|
|
|
|
List<SysDictData> invocieStatusData = dictTypeService.selectDictDataByType("invoice_status"); |
|
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(invocieStatusData)){ |
|
|
|
|
invocieStatusData.forEach(e->invocieStatusDictMap.put(e.getDictValue(),e.getDictLabel())); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Map<String,String> tsfsDictMap = new HashMap<>(); ; |
|
|
|
|
|
|
|
|
|
List<SysDictData> tsfsData = dictTypeService.selectDictDataByType("tsfs"); |
|
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(tsfsData)){ |
|
|
|
|
tsfsData.forEach(e->tsfsDictMap.put(e.getDictValue(),e.getDictLabel())); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Map<String,String> sourceDictMap = new HashMap<>(); ; |
|
|
|
|
|
|
|
|
|
List<SysDictData> sourceData = dictTypeService.selectDictDataByType("source"); |
|
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(sourceData)){ |
|
|
|
|
sourceData.forEach(e->sourceDictMap.put(e.getDictValue(),e.getDictLabel())); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (BillInfo bill : billInfos) { |
|
|
|
|
bill.setInvoiceType(invoiceTypeDictMap.get(bill.getInvoiceType())); |
|
|
|
|
bill.setBillType(billTypeDictMap.get(bill.getBillType())); |
|
|
|
|
bill.setBillState(invocieStatusDictMap.get(bill.getState()==null?"":bill.getState().toString())); |
|
|
|
|
bill.setTsfs(tsfsDictMap.get(bill.getTsfs())); |
|
|
|
|
bill.setSource(sourceDictMap.get(bill.getSource())); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return billInfos; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|