浏览代码

20211019后端更新代码

mashengyi 3 年之前
父节点
当前提交
c38a84c7ae
共有 19 个文件被更改,包括 182 次插入17 次删除
  1. 6 3
      src/main/java/com/jkcredit/invoice/controller/localBussiness/NoCarController.java
  2. 58 7
      src/main/java/com/jkcredit/invoice/controller/localBussiness/SelfCarController.java
  3. 2 0
      src/main/java/com/jkcredit/invoice/credit/SimpleCORSFilter.java
  4. 1 0
      src/main/java/com/jkcredit/invoice/mapper/Binvoce/SelfCarInvoiceMapper.java
  5. 3 0
      src/main/java/com/jkcredit/invoice/mapper/waybill/SellCarTradeMapper.java
  6. 4 4
      src/main/java/com/jkcredit/invoice/model/entity/invoice/BillInvoice.java
  7. 4 0
      src/main/java/com/jkcredit/invoice/model/entity/invoice/SelfCarInvoice.java
  8. 4 0
      src/main/java/com/jkcredit/invoice/model/entity/waybill/SelfCarTrade.java
  9. 14 3
      src/main/java/com/jkcredit/invoice/service/nocar/impl/NocarInvoiceServiceImpl.java
  10. 4 0
      src/main/java/com/jkcredit/invoice/service/selfCar/SelfCarInvoiceService.java
  11. 3 0
      src/main/java/com/jkcredit/invoice/service/selfCar/SelfCarTradeService.java
  12. 28 0
      src/main/java/com/jkcredit/invoice/service/selfCar/impl/SelfCarInvoiceServiceImpl.java
  13. 27 0
      src/main/java/com/jkcredit/invoice/service/selfCar/impl/SelfCarTradeServiceImpl.java
  14. 10 0
      src/main/resources/mapper/invoice/SelfCarInvoiceMapper.xml
  15. 14 0
      src/main/resources/mapper/waybill/SellCarTradeMapper.xml
  16. 二进制
      src/main/resources/static/templates/excel/无车发票查询模板.xlsx
  17. 二进制
      src/main/resources/static/templates/excel/无车运单查询模板.xlsx
  18. 二进制
      src/main/resources/static/templates/excel/自有车交易查询模板.xlsx
  19. 二进制
      src/main/resources/static/templates/excel/自有车发票查询模板.xlsx

+ 6 - 3
src/main/java/com/jkcredit/invoice/controller/localBussiness/NoCarController.java

@@ -229,7 +229,7 @@ public class NoCarController {
             ImportParams params = new ImportParams();
             params.setTitleRows(1);
             params.setHeadRows(1);
-            params.setKeyIndex(2);
+           // params.setKeyIndex(2);
             List<BillInvoice> list = ExcelImportUtil.importExcel(file.getInputStream(), BillInvoice.class,params) ;
             RespR respR = nocarInvoiceService.findImportNocarInvoices(list);
             return respR;
@@ -254,7 +254,7 @@ public class NoCarController {
             ImportParams params = new ImportParams();
             params.setTitleRows(1);
             params.setHeadRows(1);
-            params.setKeyIndex(2);
+          //  params.setKeyIndex(2);
             List<NoCarWayBill> list = ExcelImportUtil.importExcel(file.getInputStream(), NoCarWayBill.class,params) ;
             RespR respR = noCarBillWayService.findImportNocarBillWay(list);
             return respR;
@@ -446,11 +446,14 @@ public class NoCarController {
             }else if("2".equals(fileName)){
                 fileName = "运单结束模板.xlsx";
             }else if("3".equals(fileName)){
-                fileName = "历史运单模板.xlsx";
             }else if("4".equals(fileName)){
                 fileName = "无车发票查询模板.xlsx";
             }else if("5".equals(fileName)){
                 fileName = "无车运单查询模板.xlsx";
+            }else if("6".equals(fileName)){
+                fileName = "自有车交易查询模板.xlsx";
+            }else if("7".equals(fileName)){
+                fileName = "自有车发票查询模板.xlsx";
             }
             OutputStream outputStream = null;
             InputStream inputStream = null;

+ 58 - 7
src/main/java/com/jkcredit/invoice/controller/localBussiness/SelfCarController.java

@@ -1,13 +1,14 @@
 package com.jkcredit.invoice.controller.localBussiness;
+import cn.afterturn.easypoi.excel.ExcelImportUtil;
+import cn.afterturn.easypoi.excel.entity.ImportParams;
 import cn.com.taiji.sdk.model.comm.protocol.tts.invoice.server.B2BInvoiceListModel;
 import cn.com.taiji.sdk.model.comm.protocol.tts.trade.service.CardTradeModel;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jkcredit.invoice.annotation.LoginRequired;
-import com.jkcredit.invoice.model.entity.Calculate.NoCarCalculateInfor;
 import com.jkcredit.invoice.model.entity.Calculate.SelfCarCalculateInfor;
 import com.jkcredit.invoice.model.entity.customer.CustomerCarRec;
+import com.jkcredit.invoice.model.entity.invoice.BillInvoice;
 import com.jkcredit.invoice.model.entity.invoice.SelfCarInvoice;
-import com.jkcredit.invoice.model.entity.waybill.NoCarWayBill;
 import com.jkcredit.invoice.model.entity.waybill.SelfCarTrade;
 import com.jkcredit.invoice.service.CalculateInfor.SelfCarCalculateInfoService;
 import com.jkcredit.invoice.service.lowerService.SelfCarServiceL;
@@ -15,16 +16,13 @@ import com.jkcredit.invoice.service.lowerService.vo.*;
 import com.jkcredit.invoice.service.selfCar.SelfCarInvoiceService;
 import com.jkcredit.invoice.service.selfCar.SelfCarService;
 import com.jkcredit.invoice.service.selfCar.SelfCarTradeService;
-import com.jkcredit.invoice.service.upService.SelfCarInterface;
 import com.jkcredit.invoice.util.RespR;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.util.StringUtils;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
@@ -284,4 +282,57 @@ public class SelfCarController {
         }
     }
 
+
+
+    /**
+     * 批量查询自有车交易信息
+     *
+     * @param file    参数集
+     * @return
+     */
+    @PostMapping("/batchImportSelfcarTrades")
+    @ApiOperation(value="批量查询自有车交易信息", notes="批量查询自有车交易信息")
+    @LoginRequired
+    public RespR batchImportSelfcarTrades(@RequestParam("file") MultipartFile file) {
+        try {
+            ImportParams params = new ImportParams();
+            params.setTitleRows(1);
+            params.setHeadRows(1);
+            // params.setKeyIndex(2);
+            List<SelfCarTrade> list = ExcelImportUtil.importExcel(file.getInputStream(), SelfCarTrade.class,params) ;
+            RespR respR = selfCarTradeService.batchImportSelfcarTrades(list);
+            return respR;
+        }catch (Exception e){
+            e.printStackTrace();
+            return new RespR(false,e.getMessage());
+        }
+    }
+
+
+
+    /**
+     * 批量查询自有车发票信息
+     *
+     * @param file    参数集
+     * @return
+     */
+    @PostMapping("/batchImportSelfcarInvoices")
+    @ApiOperation(value="批量查询自有车发票信息", notes="批量查询自有车发票信息")
+    @LoginRequired
+    public RespR batchImportSelfcarInvoices(@RequestParam("file") MultipartFile file) {
+        try {
+            ImportParams params = new ImportParams();
+            params.setTitleRows(1);
+            params.setHeadRows(1);
+            // params.setKeyIndex(2);
+            List<SelfCarInvoice> list = ExcelImportUtil.importExcel(file.getInputStream(), SelfCarInvoice.class,params) ;
+            RespR respR = selfCarInvoiceService.findImportSelfcarInvoices(list);
+            return respR;
+        }catch (Exception e){
+            e.printStackTrace();
+            return new RespR(false,e.getMessage());
+        }
+    }
+
+
 }

+ 2 - 0
src/main/java/com/jkcredit/invoice/credit/SimpleCORSFilter.java

@@ -143,6 +143,8 @@ public class SimpleCORSFilter implements Filter {
             "/selfCar/getTradeList",
             "/selfCar/applTradeList",
             "/selfCar/findSelfcarInvoiceByTime",
+            "/selfCar/batchImportSelfcarInvoices",
+            "/selfCar/batchImportSelfcarTrades",
 
 
             "/param",

+ 1 - 0
src/main/java/com/jkcredit/invoice/mapper/Binvoce/SelfCarInvoiceMapper.java

@@ -17,6 +17,7 @@ public interface SelfCarInvoiceMapper extends BaseMapper<SelfCarInvoice> {
     int updateByPrimaryKey(SelfCarInvoice record);
 
     List<SelfCarInvoice> selectByTrade(String tradeId);
+    List<SelfCarInvoice> selectByCardId(String cardId);
 
     List<SelfCarInvoice> selectByTradeAndInvoiceMakeTime(SelfCarInvoice record);
 }

+ 3 - 0
src/main/java/com/jkcredit/invoice/mapper/waybill/SellCarTradeMapper.java

@@ -19,4 +19,7 @@ public interface SellCarTradeMapper extends BaseMapper<SelfCarTrade> {
     int updateByTradeId(SelfCarTrade record);
 
     SelfCarTrade selectByTradeId(String tradeId);
+
+    List<SelfCarTrade> selectByCardId(String cardId);
+
 }

+ 4 - 4
src/main/java/com/jkcredit/invoice/model/entity/invoice/BillInvoice.java

@@ -22,14 +22,14 @@ public class BillInvoice {
      */
     private String companyName;
     /**
-     * 发票
+     * 发票
      */
-    @Excel(name = "发票码")
+    @Excel(name = "发票码")
     private String invoiceNum;
     /**
-     * 发票
+     * 发票
      */
-    @Excel(name = "发票码")
+    @Excel(name = "发票码")
     private String invoiceCode;
     /**
      *开票时间

+ 4 - 0
src/main/java/com/jkcredit/invoice/model/entity/invoice/SelfCarInvoice.java

@@ -1,5 +1,7 @@
 package com.jkcredit.invoice.model.entity.invoice;
 
+import cn.afterturn.easypoi.excel.annotation.Excel;
+
 /**
  * 自有车发票
  */
@@ -23,6 +25,7 @@ public class SelfCarInvoice {
     /**
      * etc卡号
      */
+    @Excel(name = "etc卡号")
     private String cardId;
     /**
      * 发票号码
@@ -104,6 +107,7 @@ public class SelfCarInvoice {
     /**
      * 交易ID
      */
+    @Excel(name = "交易id")
     private String tradeId;
 
     /**

+ 4 - 0
src/main/java/com/jkcredit/invoice/model/entity/waybill/SelfCarTrade.java

@@ -1,5 +1,7 @@
 package com.jkcredit.invoice.model.entity.waybill;
 
+import cn.afterturn.easypoi.excel.annotation.Excel;
+
 /**
  * 自有车交易
  */
@@ -27,11 +29,13 @@ public class SelfCarTrade {
     /**
      * etc卡号
      */
+    @Excel(name = "etc卡号")
     private String cardId;
 
     /**
      * 交易id
      */
+    @Excel(name = "交易id")
     private String tradeId;
 
     /**

+ 14 - 3
src/main/java/com/jkcredit/invoice/service/nocar/impl/NocarInvoiceServiceImpl.java

@@ -38,11 +38,22 @@ public class NocarInvoiceServiceImpl extends ServiceImpl<BillInvoiceMapper,BillI
 
         List<BillInvoice> billInvoicesTmp = new ArrayList<BillInvoice>();
         for (BillInvoice billInvoice:billInvoices) {
-            if(StringUtils.isEmpty(billInvoice.getInvoiceNum()) || StringUtils.isEmpty(billInvoice.getInvoiceCode())){
+            if(StringUtils.isNotEmpty(billInvoice.getWaybillNum()) && StringUtils.isEmpty(billInvoice.getInvoiceNum())
+                    &&  StringUtils.isEmpty(billInvoice.getInvoiceCode())){
+                List<BillInvoice> bills =  billInvoiceMapper.selectByBillNum(billInvoice.getWaybillNum());
+                billInvoicesTmp.addAll(bills);
+            }else if(StringUtils.isNotEmpty(billInvoice.getWaybillNum()) && StringUtils.isNotEmpty(billInvoice.getInvoiceNum())
+                    &&  StringUtils.isNotEmpty(billInvoice.getInvoiceCode())){
+                BillInvoice bill =  billInvoiceMapper.selectAllByPageByBillInvoice(billInvoice);
+                billInvoicesTmp.add(bill);
+            }else if(StringUtils.isEmpty(billInvoice.getWaybillNum()) && StringUtils.isNotEmpty(billInvoice.getInvoiceNum())
+                    &&  StringUtils.isNotEmpty(billInvoice.getInvoiceCode())){
+                BillInvoice bill =  billInvoiceMapper.selectAllByPageByBillInvoice(billInvoice);
+                billInvoicesTmp.add(bill);
+            }else{
                 return new RespR<>("失败","0");
             }
-            BillInvoice bill =  billInvoiceMapper.selectAllByPageByBillInvoice(billInvoice);
-            billInvoicesTmp.add(bill);
+
         }
         return new RespR<>(billInvoicesTmp,"1");
     }

+ 4 - 0
src/main/java/com/jkcredit/invoice/service/selfCar/SelfCarInvoiceService.java

@@ -3,6 +3,8 @@ package com.jkcredit.invoice.service.selfCar;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jkcredit.invoice.model.entity.invoice.SelfCarInvoice;
+import com.jkcredit.invoice.model.entity.waybill.SelfCarTrade;
+import com.jkcredit.invoice.util.RespR;
 
 import java.util.List;
 
@@ -17,4 +19,6 @@ public interface SelfCarInvoiceService{
      * @return
      */
     IPage<List<SelfCarInvoice>> findByPageAndInvoice(Page page, SelfCarInvoice selfCarInvoice);
+
+    RespR findImportSelfcarInvoices(List<SelfCarInvoice> list);
 }

+ 3 - 0
src/main/java/com/jkcredit/invoice/service/selfCar/SelfCarTradeService.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jkcredit.invoice.model.entity.waybill.NoCarWayBill;
 import com.jkcredit.invoice.model.entity.waybill.SelfCarTrade;
+import com.jkcredit.invoice.util.RespR;
 
 import java.util.List;
 
@@ -18,4 +19,6 @@ public interface SelfCarTradeService {
      * @return
      */
     IPage<List<SelfCarTrade>> findByPageAndTrade(Page page, SelfCarTrade selfCarTrade);
+
+    RespR batchImportSelfcarTrades(List<SelfCarTrade> list);
 }

+ 28 - 0
src/main/java/com/jkcredit/invoice/service/selfCar/impl/SelfCarInvoiceServiceImpl.java

@@ -5,10 +5,14 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.jkcredit.invoice.mapper.Binvoce.SelfCarInvoiceMapper;
 import com.jkcredit.invoice.model.entity.invoice.SelfCarInvoice;
+import com.jkcredit.invoice.model.entity.waybill.SelfCarTrade;
 import com.jkcredit.invoice.service.selfCar.SelfCarInvoiceService;
+import com.jkcredit.invoice.util.RespR;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
 import java.util.List;
 
 @Service
@@ -19,4 +23,28 @@ public class SelfCarInvoiceServiceImpl extends ServiceImpl<SelfCarInvoiceMapper,
     public IPage<List<SelfCarInvoice>> findByPageAndInvoice(Page page, SelfCarInvoice selfCarInvoice) {
         return selfCarInvoiceMapper.selectAllByPage(page,selfCarInvoice);
     }
+
+
+
+    @Override
+    public RespR findImportSelfcarInvoices(List<SelfCarInvoice> selfCarInvoices) {
+        if(selfCarInvoices ==null || 0 == selfCarInvoices.size()){
+            return new RespR<>("失败","0");
+        }
+
+        List<SelfCarInvoice> selfCarInvoicesTmp = new ArrayList<SelfCarInvoice>();
+        for (SelfCarInvoice selfCarInvoice:selfCarInvoices) {
+            if(StringUtils.isNotEmpty(selfCarInvoice.getCardId()) && StringUtils.isEmpty(selfCarInvoice.getTradeId())){
+                List<SelfCarInvoice> cars =  selfCarInvoiceMapper.selectByCardId(selfCarInvoice.getCardId());
+                selfCarInvoicesTmp.addAll(cars);
+            }else if(StringUtils.isEmpty(selfCarInvoice.getCardId()) && StringUtils.isNotEmpty(selfCarInvoice.getTradeId())){
+                List<SelfCarInvoice> cars =  selfCarInvoiceMapper.selectByTrade(selfCarInvoice.getTradeId());
+                selfCarInvoicesTmp.addAll(cars);
+            }else{
+                return new RespR<>("失败","0");
+            }
+
+        }
+        return new RespR<>(selfCarInvoicesTmp,"1");
+    }
 }

+ 27 - 0
src/main/java/com/jkcredit/invoice/service/selfCar/impl/SelfCarTradeServiceImpl.java

@@ -5,9 +5,12 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.jkcredit.invoice.mapper.waybill.SellCarTradeMapper;
 import com.jkcredit.invoice.model.entity.waybill.SelfCarTrade;
 import com.jkcredit.invoice.service.selfCar.SelfCarTradeService;
+import com.jkcredit.invoice.util.RespR;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
 import java.util.List;
 @Service
 public class SelfCarTradeServiceImpl extends ServiceImpl<SellCarTradeMapper,SelfCarTrade> implements SelfCarTradeService{
@@ -17,4 +20,28 @@ public class SelfCarTradeServiceImpl extends ServiceImpl<SellCarTradeMapper,Self
     public IPage<List<SelfCarTrade>> findByPageAndTrade(Page page, SelfCarTrade selfCarTrade) {
         return sellCarTradeMapper.selectAllByPage(page,selfCarTrade);
     }
+
+
+
+    @Override
+    public RespR batchImportSelfcarTrades(List<SelfCarTrade> selfCarTrades) {
+        if(selfCarTrades ==null || 0 == selfCarTrades.size()){
+            return new RespR<>("失败","0");
+        }
+
+        List<SelfCarTrade> selfCarTradeTmp = new ArrayList<SelfCarTrade>();
+        for (SelfCarTrade selfCarTrade:selfCarTrades) {
+            if(StringUtils.isNotEmpty(selfCarTrade.getCardId()) && StringUtils.isEmpty(selfCarTrade.getTradeId())){
+                List<SelfCarTrade> cars =  sellCarTradeMapper.selectByCardId(selfCarTrade.getCardId());
+                selfCarTradeTmp.addAll(cars);
+            }else if(StringUtils.isEmpty(selfCarTrade.getCardId()) && StringUtils.isNotEmpty(selfCarTrade.getTradeId())){
+                SelfCarTrade car =  sellCarTradeMapper.selectByTradeId(selfCarTrade.getTradeId());
+                selfCarTradeTmp.add(car);
+            }else{
+                return new RespR<>("失败","0");
+            }
+
+        }
+        return new RespR<>(selfCarTradeTmp,"1");
+    }
 }

+ 10 - 0
src/main/resources/mapper/invoice/SelfCarInvoiceMapper.xml

@@ -153,6 +153,16 @@
         from t_SelfCarInvoice
         where tradeId = #{tradeId,jdbcType=VARCHAR}
     </select>
+
+    <select id="selectByCardId" resultMap="BaseResultMap" parameterType="java.lang.String" >
+        select
+        <include refid="baseSql" />
+        from t_SelfCarInvoice
+        where cardId = #{cardId,jdbcType=VARCHAR}
+    </select>
+
+
+
     <select id="selectByTradeAndInvoiceMakeTime" resultMap="BaseResultMap" parameterType="com.jkcredit.invoice.model.entity.invoice.SelfCarInvoice" >
         select
         <include refid="baseSql" />

+ 14 - 0
src/main/resources/mapper/waybill/SellCarTradeMapper.xml

@@ -118,4 +118,18 @@
         companyReferencenum = #{companyReferencenum,jdbcType=VARCHAR}
         where tradeId = #{tradeId,jdbcType=INTEGER}
     </update>
+
+
+
+
+    <select id="selectByCardId" resultMap="BaseResultMap" parameterType="java.lang.String" >
+        select
+        <include refid="baseSql" />
+        from t_SellCarTrade
+        where cardId = #{cardId,jdbcType=VARCHAR}
+    </select>
+
+
+
+
 </mapper>

二进制
src/main/resources/static/templates/excel/无车发票查询模板.xlsx


二进制
src/main/resources/static/templates/excel/无车运单查询模板.xlsx


二进制
src/main/resources/static/templates/excel/自有车交易查询模板.xlsx


二进制
src/main/resources/static/templates/excel/自有车发票查询模板.xlsx