Administrator 3 vuotta sitten
vanhempi
commit
2e624239cd

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

@@ -11,6 +11,7 @@ import com.jkcredit.invoice.model.entity.customer.CustomerCarRec;
 import com.jkcredit.invoice.model.entity.customer.CustomerOper;
 import com.jkcredit.invoice.model.entity.invoice.BillInvoice;
 import com.jkcredit.invoice.model.entity.waybill.NoCarWayBill;
+import com.jkcredit.invoice.model.vo.CodeAndNumVo;
 import com.jkcredit.invoice.service.CalculateInfor.NoCarCalculateInfoService;
 import com.jkcredit.invoice.service.customer.CustomerOperService;
 import com.jkcredit.invoice.service.lowerService.NoCarService;
@@ -33,6 +34,7 @@ import java.io.*;
 import java.net.URLEncoder;
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 @Api(tags = "无车操作")
@@ -277,14 +279,25 @@ public class NoCarController {
             billInvoice.setWaybillNums(Arrays.asList(billNumArr));
         }
 
-        if(!StringUtils.isEmpty(billInvoice.getInvoiceCode())){
+        if(!StringUtils.isEmpty(billInvoice.getInvoiceCode()) && billInvoice.getInvoiceCode().indexOf(',')>0){
             String [] invoiceCodeArr = billInvoice.getInvoiceCode().split(",");
-            billInvoice.setInvoiceCodes(Arrays.asList(invoiceCodeArr));
-        }
+            String [] invoiceNumArr=null;
+            if( billInvoice.getInvoiceNum()!=null){
+                invoiceNumArr =  billInvoice.getInvoiceNum().split(",");
+            }
+            List<CodeAndNumVo> codeAndNumVos = new ArrayList<>();
+            for (int i=0;i<invoiceCodeArr.length;i++){
+                CodeAndNumVo codeAndNumVo = new CodeAndNumVo();
+                codeAndNumVo.setCode(invoiceCodeArr[i]);
+                if(invoiceNumArr!=null && invoiceNumArr.length>=i+1){
+                    codeAndNumVo.setNum(invoiceNumArr[i]);
+                }else{
+                    codeAndNumVo.setNum("");
+                }
+                codeAndNumVos.add(codeAndNumVo);
+            }
+            billInvoice.setCodeAndNumVos(codeAndNumVos);
 
-        if(!StringUtils.isEmpty(billInvoice.getInvoiceNum())){
-            String [] invoiceNumArr = billInvoice.getInvoiceNum().split(",");
-            billInvoice.setInvoiceNums(Arrays.asList(invoiceNumArr));
         }
     }
     /**

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

@@ -1,6 +1,7 @@
 package com.jkcredit.invoice.model.entity.invoice;
 
 import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.jkcredit.invoice.model.vo.CodeAndNumVo;
 
 import java.util.List;
 
@@ -29,14 +30,13 @@ public class BillInvoice {
     @Excel(name = "发票代码")
     private String invoiceNum;
 
-    private List<String> invoiceNums;
+    private List<CodeAndNumVo> codeAndNumVos;
     /**
      * 发票号码
      */
     @Excel(name = "发票号码")
     private String invoiceCode;
 
-    private List<String> invoiceCodes;
     /**
      *开票时间
      */
@@ -461,20 +461,12 @@ public class BillInvoice {
         this.calculateTimeEnd = calculateTimeEnd;
     }
 
-    public List<String> getInvoiceNums() {
-        return invoiceNums;
+    public List<CodeAndNumVo> getCodeAndNumVos() {
+        return codeAndNumVos;
     }
 
-    public void setInvoiceNums(List<String> invoiceNums) {
-        this.invoiceNums = invoiceNums;
-    }
-
-    public List<String> getInvoiceCodes() {
-        return invoiceCodes;
-    }
-
-    public void setInvoiceCodes(List<String> invoiceCodes) {
-        this.invoiceCodes = invoiceCodes;
+    public void setCodeAndNumVos(List<CodeAndNumVo> codeAndNumVos) {
+        this.codeAndNumVos = codeAndNumVos;
     }
 
     public List<String> getWaybillNums() {

+ 28 - 0
src/main/java/com/jkcredit/invoice/model/vo/CodeAndNumVo.java

@@ -0,0 +1,28 @@
+package com.jkcredit.invoice.model.vo;
+
+public class CodeAndNumVo {
+    /**
+     * 发票代码
+     */
+    private String code;
+    /**
+     * 发票号码
+     */
+    private String num;
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getNum() {
+        return num;
+    }
+
+    public void setNum(String num) {
+        this.num = num;
+    }
+}

+ 16 - 2
src/main/resources/mapper/invoice/BillInvoiceMapper.xml

@@ -96,7 +96,21 @@
             <if test="billInvoice.plateNum != null and billInvoice.plateNum != ''">
                 and  plateNum = BINARY #{billInvoice.plateNum}
             </if>
-            <if test="billInvoice.invoiceCodes != null">
+            <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}
@@ -107,7 +121,7 @@
                 <foreach collection="billInvoice.invoiceNums" item="invoiceNum" index="index" separator="," open="(" close=")">
                     #{invoiceNum}
                 </foreach>
-            </if>
+            </if>-->
             <if test="billInvoice.invoiceMakeStart != null and billInvoice.invoiceMakeStart != ''">
                 and invoiceMakeTime BETWEEN #{billInvoice.invoiceMakeStart} and #{billInvoice.invoiceMakeEnd}
             </if>

+ 6 - 3
src/main/resources/mapper/waybill/NoCarWaybillMapper.xml

@@ -102,7 +102,12 @@
         select
         <include refid="baseSql" />,timestampdiff(day,InterfaceEndTime,now()) days
         from t_waybill_no
-        <where>
+           where
+            billwayStatus = 2
+            and (( InterfaceEndTime &lt; date_sub(now(), interval 20 day) and hisFlag =0)
+            or
+            (InterfaceEndTime &lt; date_sub(now(), interval 7 day) and hisFlag =1)
+            )
             <if test="noCarWayBill.companyName != null and noCarWayBill.companyName != ''">
                 and  companyName = BINARY #{noCarWayBill.companyName}
             </if>
@@ -122,8 +127,6 @@
                 and interfaceEndTime BETWEEN #{noCarWayBill.endBegin} and #{noCarWayBill.endEnd}
             </if>
 
-             and billwayStatus in (-1,-2,-3,4)
-        </where>
     </select>
     <insert id="insert" parameterType="com.jkcredit.invoice.model.entity.waybill.NoCarWayBill" >
         insert into t_waybill_no (