diff --git a/jianshui-invoice/src/main/java/com/jianshui/invoice/domain/BillInfo.java b/jianshui-invoice/src/main/java/com/jianshui/invoice/domain/BillInfo.java index debee40..5ca0f53 100644 --- a/jianshui-invoice/src/main/java/com/jianshui/invoice/domain/BillInfo.java +++ b/jianshui-invoice/src/main/java/com/jianshui/invoice/domain/BillInfo.java @@ -159,7 +159,7 @@ public class BillInfo extends BaseEntity private String tsfs; /** 清单标志 */ - @Excel(name = "清单标志") + @Excel(name = "清单标志 1清单0非清单") private String qdbz; /** 清单项目名称 */ @@ -167,17 +167,20 @@ public class BillInfo extends BaseEntity private String qdxmmc; /** 代开标志 */ - @Excel(name = "代开标志") + @Excel(name = "代开标志 0 非代开 1 代开") private String dkbz; /** 成品油标志 */ - @Excel(name = "成品油标志") + @Excel(name = "成品油标志 0 非成品油 1 成品油") private String cpybz; /** 开票状态 */ - @Excel(name = "开票状态") + private Integer state; + @Excel(name = "开票状态") + private String billState; + /** 订单来源 */ @Excel(name = "订单来源") private String source; @@ -1327,10 +1330,20 @@ public class BillInfo extends BaseEntity this.state = state; } + public void setBillState(String billState) + { + this.billState = billState; + } + public Integer getState() { return state; } + + public String getBillState() + { + return billState; + } public void setSource(String source) { this.source = source; diff --git a/jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/BillInfoServiceImpl.java b/jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/BillInfoServiceImpl.java index b8b2fc6..2f1da8e 100644 --- a/jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/BillInfoServiceImpl.java +++ b/jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/BillInfoServiceImpl.java @@ -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 selectBillInfoList(BillInfo billInfo) { - return billInfoMapper.selectBillInfoList(billInfo); + + List billInfos = billInfoMapper.selectBillInfoList(billInfo); + + if (CollectionUtil.isNotEmpty(billInfos)) { + + Map invoiceTypeDictMap = new HashMap<>(); ; + + List invoiceTypeData = dictTypeService.selectDictDataByType("invoice_type"); + + if (CollectionUtil.isNotEmpty(invoiceTypeData)){ + invoiceTypeData.forEach(e->invoiceTypeDictMap.put(e.getDictValue(),e.getDictLabel())); + } + + Map billTypeDictMap = new HashMap<>(); ; + + List billTypeData = dictTypeService.selectDictDataByType("bill_type"); + + if (CollectionUtil.isNotEmpty(billTypeData)){ + billTypeData.forEach(e->billTypeDictMap.put(e.getDictValue(),e.getDictLabel())); + } + + Map invocieStatusDictMap = new HashMap<>(); ; + + List invocieStatusData = dictTypeService.selectDictDataByType("invoice_status"); + + if (CollectionUtil.isNotEmpty(invocieStatusData)){ + invocieStatusData.forEach(e->invocieStatusDictMap.put(e.getDictValue(),e.getDictLabel())); + } + + Map tsfsDictMap = new HashMap<>(); ; + + List tsfsData = dictTypeService.selectDictDataByType("tsfs"); + + if (CollectionUtil.isNotEmpty(tsfsData)){ + tsfsData.forEach(e->tsfsDictMap.put(e.getDictValue(),e.getDictLabel())); + } + + Map sourceDictMap = new HashMap<>(); ; + + List 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; } /**