Pārlūkot izejas kodu

添加历史表查询

Administrator 4 mēneši atpakaļ
vecāks
revīzija
bcc3e77d2f

+ 67 - 2
src/main/java/com/jkcredit/invoice/controller/business/NoCarController.java

@@ -173,7 +173,27 @@ public class NoCarController {
             return new RespR(false, e.getMessage());
         }
     }
-
+    /**
+     * 分页查询运单信息
+     *
+     * @param page 参数集
+     * @return 用户集合
+     */
+    @PostMapping("/findBillWayHis")
+    @ApiOperation(value = "分页查询无车运单信息", notes = "分页查询无车运单信息")
+    @LoginRequired(role = AuthenticationInterceptor.AUTH_NOCAR)
+    public RespR findBillWayHis(Page page, NoCarWayBill noCarWayBill, User user) {
+        try {
+            checkHasAuthRole.checkCustomerRole(user, noCarWayBill.getCustomerName());
+            setTimeDue(noCarWayBill);
+            setBillNums(noCarWayBill);
+            RespR respR = new RespR(noCarBillWayService.findByPageAndWayBillHis(page, noCarWayBill));
+            return respR;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return new RespR(false, e.getMessage());
+        }
+    }
     public void setBillNums(NoCarWayBill noCarWayBill) {
         String billNums = noCarWayBill.getBillNum();
         if (!StringUtils.isEmpty(billNums)) {
@@ -311,7 +331,26 @@ public class NoCarController {
             return new RespR(false, e.getMessage());
         }
     }
-
+    /**
+     * 分页查询无车运单信息<2024
+     *
+     * @param page 参数集
+     * @return 用户集合
+     */
+    @PostMapping("/findNocarInvoicesHis")
+    @ApiOperation(value = "分页查询无车发票信息", notes = "分页查询无车发票信息")
+    @LoginRequired(role = AuthenticationInterceptor.AUTH_NOCAR)
+    public RespR findNocarInvoicesHis(Page page, BillInvoice billInvoice, User user) {
+        try {
+            checkHasAuthRole.checkCustomerRole(user, billInvoice.getCustomerName());
+            setParams(billInvoice);
+            RespR respR = new RespR(nocarInvoiceService.findByPageAndInvoiceHis(page, billInvoice));
+            return respR;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return new RespR(false, e.getMessage());
+        }
+    }
     private void setParams(BillInvoice billInvoice) {
         if (!StringUtils.isEmpty(billInvoice.getInvoiceMakeTime()) && !NULL.equals(billInvoice.getInvoiceMakeTime())) {
             String[] res = billInvoice.getInvoiceMakeTime().split(",");
@@ -409,7 +448,33 @@ public class NoCarController {
         }
     }
 
+    /**
+     * 批量查询无车运单信息
+     *
+     * @param file 参数集
+     * @return
+     */
+    @PostMapping("/batchImportNocarBillWayHis")
+    @ApiOperation(value = "批量查询无车运单信息<2024", notes = "批量查询无车运单信息<2024")
+    @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
+    public RespR batchImportNocarBillWayHis(@RequestParam("file") MultipartFile file) {
+        try {
 
+            if (null == file) {
+                return new RespR(false, "批量查询无车运单信息失败,请查看数据是否维护准确");
+            }
+
+            ImportParams params = new ImportParams();
+            params.setTitleRows(1);
+            params.setHeadRows(1);
+            List<NoCarWayBill> list = ExcelImportUtil.importExcel(file.getInputStream(), NoCarWayBill.class, params);
+            RespR respR = noCarBillWayService.findImportNocarBillWay(list);
+            return respR;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return new RespR(false, e.getMessage());
+        }
+    }
     /**
      * 分页查询无车运单统计信息
      *

+ 3 - 0
src/main/java/com/jkcredit/invoice/credit/SimpleCoreFilter.java

@@ -175,6 +175,9 @@ public class SimpleCoreFilter implements Filter {
             "/noCar/updateStatus",
             "/noCar/findBatchList",
             "/noCar/findNocarInvoicesStatic",
+            "/noCar/findNocarInvoicesHis",
+            "/noCar/findBillWayHis",
+            "/noCar/batchImportNocarBillWayHis",
             "/noCar/batchImprotBillWayFile",
             "/noCar/batchImprotBillWay",
             "/noCar/batchImprotHistoryBillWay",

+ 9 - 0
src/main/java/com/jkcredit/invoice/mapper/binvoce/BillInvoiceMapper.java

@@ -27,6 +27,15 @@ public interface BillInvoiceMapper extends BaseMapper<BillInvoice> {
     IPage<List<BillInvoice>> selectAllByPage(Page page, @Param("billInvoice") BillInvoice billInvoice);
 
     /**
+     * 分页查询所有运单发票
+     *
+     * @param page
+     * @param billInvoice
+     * @return
+     */
+    IPage<List<BillInvoice>> selectAllByPageHis(Page page, @Param("billInvoice") BillInvoice billInvoice);
+
+    /**
      * 条件查询所有运单发票
      *
      * @param record

+ 14 - 1
src/main/java/com/jkcredit/invoice/mapper/waybill/NoCarWaybillMapper.java

@@ -24,7 +24,13 @@ public interface NoCarWaybillMapper extends BaseMapper<NoCarWayBill> {
      * @return
      */
     IPage<List<NoCarWayBill>> selectAllByPage(Page page, @Param("noCarWayBill") NoCarWayBill noCarWayBill);
-
+    /**
+     * 查询运单信息分页<2024
+     * @param page
+     * @param noCarWayBill
+     * @return
+     */
+    IPage<List<NoCarWayBill>> selectAllByPageHis(Page page, @Param("noCarWayBill") NoCarWayBill noCarWayBill);
     /**
      * 分页查询 失败运单信息
      * @param page
@@ -70,6 +76,13 @@ public interface NoCarWaybillMapper extends BaseMapper<NoCarWayBill> {
     NoCarWayBill selectByBillNum(String wayBillNum);
 
     /**
+     * 根据运单号查询运单信息<2024
+     * @param wayBillNum
+     * @return
+     */
+    NoCarWayBill selectByBillNumHis(String wayBillNum);
+
+    /**
      * 根据运单号查询运单列表
      * @param wayBillNum
      * @return

+ 16 - 1
src/main/java/com/jkcredit/invoice/service/nocar/NoCarBillWayService.java

@@ -20,7 +20,14 @@ public interface NoCarBillWayService {
      * @return
      */
     IPage<List<NoCarWayBill>> findByPageAndWayBill(Page page, NoCarWayBill noCarWayBill);
-
+    /**
+     * 查询所有运单号接口<2024
+     *
+     * @param page
+     * @param noCarWayBill
+     * @return
+     */
+    IPage<List<NoCarWayBill>> findByPageAndWayBillHis(Page page, NoCarWayBill noCarWayBill);
     /**
      * 查询所有异常运单号接口
      *
@@ -61,4 +68,12 @@ public interface NoCarBillWayService {
      * @return
      */
     RespR findImportNocarBillWay(List<NoCarWayBill> list);
+
+    /**
+     * 查询运单导入记录<2024
+     *
+     * @param list
+     * @return
+     */
+    RespR findImportNocarBillWayHis(List<NoCarWayBill> list);
 }

+ 9 - 0
src/main/java/com/jkcredit/invoice/service/nocar/NocarInvoiceService.java

@@ -23,6 +23,15 @@ public interface NocarInvoiceService {
     IPage<List<BillInvoice>> findByPageAndInvoice(Page page, BillInvoice billInvoice);
 
     /**
+     * 查询所有发票接口
+     *
+     * @param page
+     * @param billInvoice
+     * @return
+     */
+    IPage<List<BillInvoice>> findByPageAndInvoiceHis(Page page, BillInvoice billInvoice);
+
+    /**
      * 查询无车发票统计数据库信息
      *
      * @param billInvoice

+ 20 - 1
src/main/java/com/jkcredit/invoice/service/nocar/impl/NoCarBillWayServiceImpl.java

@@ -67,7 +67,10 @@ public class NoCarBillWayServiceImpl extends ServiceImpl<NoCarWaybillMapper, NoC
     public IPage<List<NoCarWayBill>> findByPageAndWayBill(Page page, NoCarWayBill noCarWayBill) {
         return noCarWaybillMapper.selectAllByPage(page, noCarWayBill);
     }
-
+    @Override
+    public IPage<List<NoCarWayBill>> findByPageAndWayBillHis(Page page, NoCarWayBill noCarWayBill) {
+        return noCarWaybillMapper.selectAllByPageHis(page, noCarWayBill);
+    }
     @Override
     public IPage<List<NoCarWayBill>> findByPageAndWayBillException(Page page, NoCarWayBill noCarWayBill) {
         return noCarWaybillMapper.selectAllByPageException(page, noCarWayBill);
@@ -375,4 +378,20 @@ public class NoCarBillWayServiceImpl extends ServiceImpl<NoCarWaybillMapper, NoC
         }
         return new RespR<>(noCarWayBillsTmp, "1");
     }
+
+    @Override
+    public RespR findImportNocarBillWayHis(List<NoCarWayBill> noCarWayBills) {
+        if (noCarWayBills == null || 0 == noCarWayBills.size()) {
+            return new RespR<>("失败", "0");
+        }
+        List<NoCarWayBill> noCarWayBillsTmp = new ArrayList<NoCarWayBill>();
+        for (NoCarWayBill noCarWayBill : noCarWayBills) {
+            if (StringUtils.isEmpty(noCarWayBill.getBillNum())) {
+                return new RespR<>("失败", "0");
+            }
+            NoCarWayBill bill = noCarWaybillMapper.selectByBillNumHis(noCarWayBill.getBillNum());
+            noCarWayBillsTmp.add(bill);
+        }
+        return new RespR<>(noCarWayBillsTmp, "1");
+    }
 }

+ 5 - 0
src/main/java/com/jkcredit/invoice/service/nocar/impl/NocarInvoiceServiceImpl.java

@@ -30,6 +30,11 @@ public class NocarInvoiceServiceImpl extends ServiceImpl<BillInvoiceMapper, Bill
     }
 
     @Override
+    public IPage<List<BillInvoice>> findByPageAndInvoiceHis(Page page, BillInvoice billInvoice) {
+        return billInvoiceMapper.selectAllByPageHis(page, billInvoice);
+    }
+
+    @Override
     public Map<String, String> findInvoiceStatics(BillInvoice billInvoice) {
         return billInvoiceMapper.findInvoiceStatics(billInvoice);
     }

+ 2 - 0
src/main/java/com/jkcredit/invoice/service/selfcar/SelfCarTradeService.java

@@ -44,4 +44,6 @@ public interface SelfCarTradeService {
      * @return
      */
     boolean updateTradesDb(List<SelfCarTrade> selfCarTrades);
+
+    void deleteRepeatInvoice(List<SelfCarTrade> selfCarTrades);
 }

+ 14 - 0
src/main/java/com/jkcredit/invoice/service/selfcar/impl/SelfCarTradeServiceImpl.java

@@ -120,4 +120,18 @@ public class SelfCarTradeServiceImpl extends ServiceImpl<SellCarTradeMapper, Sel
         });
         return true;
     }
+
+    @Override
+    public void deleteRepeatInvoice(List<SelfCarTrade> selfCarTrades) {
+        selfCarTrades.forEach(selfCarTrade -> {
+            try{
+
+            }catch (Exception e){
+                e.printStackTrace();
+                log.error("{}更新失败{}",selfCarTrade.getCardId(),e.getMessage());
+            }
+
+
+        });
+    }
 }

+ 64 - 0
src/main/resources/mapper/invoice/BillInvoiceMapper.xml

@@ -141,7 +141,71 @@
         </where>
     </select>
 
+    <select id="selectAllByPageHis" resultMap="BaseResultMap">
+        select
+        <include refid="baseSql" />,waybillStatus billStatus,calculateTime,invoiceStatus,msg,waybillNumAct
+        from t_billInvoice_his_one
+        <where>
+            <if test="billInvoice.customerName != null and billInvoice.customerName != ''">
+                and  customerName = BINARY #{billInvoice.customerName}
+            </if>
+            <if test="billInvoice.companyName != null and billInvoice.companyName != ''">
+                and  buyerName = BINARY #{billInvoice.companyName}
+            </if>
+            <if test="billInvoice.invoiceStatus != null and billInvoice.invoiceStatus != ''">
+                and  invoiceStatus = BINARY #{billInvoice.invoiceStatus}
+            </if>
+            <if test="billInvoice.waybillNums != null">
+                and  waybillNum IN
+                <foreach collection="billInvoice.waybillNums" item="billNum" index="index" separator="," open="(" close=")">
+                    #{billNum}
+                </foreach>
+            </if>
+
+            <if test="billInvoice.buyerTaxpayerCode != null and billInvoice.buyerTaxpayerCode != ''">
+                and  buyerTaxpayerCode = BINARY #{billInvoice.buyerTaxpayerCode}
+            </if>
+            <if test="billInvoice.plateNums != null">
+                and  plateNum IN
+                <foreach collection="billInvoice.plateNums" item="plateNum1" index="index" separator="," open="(" close=")">
+                    #{plateNum1}
+                </foreach>
+            </if>
+            <if test="billInvoice.codeAndNumVos != null">
+                and (invoiceCode,invoiceNum) IN
+                <foreach collection="billInvoice.codeAndNumVos" item="codeAndNumVo" index="index" separator="," open="(" close=")">
+                    (#{codeAndNumVo.code},#{codeAndNumVo.num})
+                </foreach>
+            </if>
+            <if test="billInvoice.codeAndNumVos == null">
+                <if test="billInvoice.invoiceCode != null and billInvoice.invoiceCode != ''">
+                    and invoiceCode = #{billInvoice.invoiceCode}
+                </if>
+                <if test="billInvoice.invoiceNum != null and billInvoice.invoiceNum != ''">
+                    and invoiceNum = #{billInvoice.invoiceNum}
+                </if>
+            </if>
+            <!-- <if test="billInvoice.invoiceCodes != null">
+                 and invoiceCode IN
+                 <foreach collection="billInvoice.invoiceCodes" item="invoiceCode" index="index" separator="," open="(" close=")">
+                     #{invoiceCode}
+                 </foreach>
+             </if>
+             <if test="billInvoice.invoiceNums != null">
+                 and invoiceNum in
+                 <foreach collection="billInvoice.invoiceNums" item="invoiceNum" index="index" separator="," open="(" close=")">
+                     #{invoiceNum}
+                 </foreach>
+             </if>-->
+            <if test="billInvoice.invoiceMakeStart != null and billInvoice.invoiceMakeStart != ''">
+                and invoiceMakeTime BETWEEN #{billInvoice.invoiceMakeStart} and #{billInvoice.invoiceMakeEnd}
+            </if>
+            <if test="billInvoice.calculateTimeStart != null and billInvoice.calculateTimeStart != ''"> and
+                calculateTime BETWEEN #{billInvoice.calculateTimeStart} and #{billInvoice.calculateTimeEnd}
 
+            </if>
+        </where>
+    </select>
     <select id="selectAllByPageByBillInvoice" resultMap="BaseResultMap" parameterType="com.jkcredit.invoice.model.entity.invoice.BillInvoice">
         select
         <include refid="baseSql" />

+ 52 - 0
src/main/resources/mapper/waybill/NoCarWaybillMapper.xml

@@ -98,6 +98,52 @@
             </if>
         </where>
     </select>
+    <select id="selectAllByPageHis" resultMap="BaseResultMap">
+        select
+        <include refid="baseSql" />
+        from t_waybill_no_his_one
+        <where>
+            1 = 1
+            <if test="noCarWayBill.hisFlag != null">
+                and hisFlag = #{noCarWayBill.hisFlag,jdbcType=INTEGER}
+            </if>
+            <if test="noCarWayBill.customerName != null and noCarWayBill.customerName != ''">
+                and  customerName = BINARY #{noCarWayBill.customerName}
+            </if>
+            <if test="noCarWayBill.companyName != null and noCarWayBill.companyName != '' and  noCarWayBill.companyName!='全部'">
+                and  companyName = BINARY #{noCarWayBill.companyName}
+            </if>
+            <if test="noCarWayBill.billNums != null">
+                and  billNum in
+                <foreach collection="noCarWayBill.billNums" item="billNum" index="index" separator="," open="(" close=")">
+                    #{billNum}
+                </foreach>
+            </if>
+            <if test="noCarWayBill.taxplayerCode != null and noCarWayBill.taxplayerCode != ''">
+                and  taxplayerCode = BINARY #{noCarWayBill.taxplayerCode}
+            </if>
+            <if test="noCarWayBill.billwayStatus != null and noCarWayBill.billwayStatus != ''">
+                and billwayStatus = #{noCarWayBill.billwayStatus}
+            </if>
+            <if test="noCarWayBill.startBegin != null and noCarWayBill.startBegin != ''">
+                and intfaceStartTime BETWEEN #{noCarWayBill.startBegin} and #{noCarWayBill.startEnd}
+            </if>
+            <if test="noCarWayBill.endBegin != null and noCarWayBill.endBegin != ''">
+                and interfaceEndTime BETWEEN #{noCarWayBill.endBegin} and #{noCarWayBill.endEnd}
+            </if>
+
+            <if test="noCarWayBill.plateNum != null and noCarWayBill.plateNum != ''">
+                and  plateNum = BINARY #{noCarWayBill.plateNum}
+            </if>
+
+            <if test="noCarWayBill.success == 1">
+                and billwayStatus in(1,2,3,4)
+            </if>
+            <if test="noCarWayBill.success == 2">
+                and billwayStatus in(-1,-2,-3)
+            </if>
+        </where>
+    </select>
     <select id="selectAllByPageException" resultMap="BaseResultMap">
         select
         <include refid="baseSql" />,timestampdiff(day,InterfaceEndTime,now()) days
@@ -261,6 +307,12 @@
         from t_waybill_no
         where  billNum = BINARY #{billNum,jdbcType=VARCHAR}
     </select>
+    <select id="selectByBillNumHis" resultMap="BaseResultMap" parameterType="java.lang.String" >
+        select
+        <include refid="baseSql" />
+        from t_waybill_no_his_one
+        where  billNum = BINARY #{billNum,jdbcType=VARCHAR}
+    </select>
     <select id="selectByBillNumForRe" resultMap="BaseResultMap" parameterType="java.lang.String" >
         select
         <include refid="baseSql" />