Browse Source

自有车添加本地计费时间,无车添加拆分运单号字段

Administrator 1 year ago
parent
commit
a746b8c5d4

+ 5 - 0
src/main/java/com/jkcredit/invoice/controller/business/SelfCarController.java

@@ -324,6 +324,11 @@ public class SelfCarController {
                 carCalculateInfor.setCalTimeStart(res[0]);
                 carCalculateInfor.setCalTimeEnd(res[1]);
             }
+            if (!StringUtils.isEmpty(carCalculateInfor.getActCalTime()) && !NULL.equals(carCalculateInfor.getCalTime())) {
+                String[] res = carCalculateInfor.getActCalTime().split(",");
+                carCalculateInfor.setActCalTimeStart(res[0]);
+                carCalculateInfor.setActCalTimeEnd(res[1]);
+            }
             RespR respR = new RespR(selfCarCalculateInfoService.findByPageAndCalculateInfor(page, carCalculateInfor));
             return respR;
         } catch (Exception e) {

+ 33 - 0
src/main/java/com/jkcredit/invoice/model/entity/calculate/SelfCarCalculateInfor.java

@@ -45,9 +45,18 @@ public class SelfCarCalculateInfor {
      */
     private String calTime;
 
+    /**
+     * 本系统实际计费时间
+     */
+    private String actCalTime;
+
     private String calTimeStart;
 
     private String calTimeEnd;
+
+    private String actCalTimeStart;
+
+    private String actCalTimeEnd;
     /**
      * 开票时间
      */
@@ -150,6 +159,30 @@ public class SelfCarCalculateInfor {
         this.companyName = companyName;
     }
 
+    public String getActCalTime() {
+        return actCalTime;
+    }
+
+    public void setActCalTime(String actCalTime) {
+        this.actCalTime = actCalTime;
+    }
+
+    public String getActCalTimeStart() {
+        return actCalTimeStart;
+    }
+
+    public void setActCalTimeStart(String actCalTimeStart) {
+        this.actCalTimeStart = actCalTimeStart;
+    }
+
+    public String getActCalTimeEnd() {
+        return actCalTimeEnd;
+    }
+
+    public void setActCalTimeEnd(String actCalTimeEnd) {
+        this.actCalTimeEnd = actCalTimeEnd;
+    }
+
     @Override
     public String toString() {
         return "SelfCarCalculateInfor{" +

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

@@ -97,6 +97,8 @@ public class BillInvoice {
     @Excel(name = "运单编号")
     private String waybillNum;
 
+    private String waybillNumAct;
+
     private List<String> waybillNums;
 
     private List<String> plateNums;
@@ -517,6 +519,14 @@ public class BillInvoice {
         this.plateNums = plateNums;
     }
 
+    public String getWaybillNumAct() {
+        return waybillNumAct;
+    }
+
+    public void setWaybillNumAct(String waybillNumAct) {
+        this.waybillNumAct = waybillNumAct;
+    }
+
     @Override
     public String toString() {
         return "BillInvoice{" +

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

@@ -137,6 +137,11 @@ public class SelfCarInvoice {
      */
     private String calculateTime;
 
+    /**
+     * 实际计费时间
+     */
+    private String aclCalculateTime;
+
     public Long getId() {
         return id;
     }
@@ -401,6 +406,14 @@ public class SelfCarInvoice {
         this.tradeIds = tradeIds;
     }
 
+    public String getAclCalculateTime() {
+        return aclCalculateTime;
+    }
+
+    public void setAclCalculateTime(String aclCalculateTime) {
+        this.aclCalculateTime = aclCalculateTime;
+    }
+
     @Override
     public String toString() {
         return "SelfCarInvoice{" +
@@ -432,6 +445,7 @@ public class SelfCarInvoice {
                 ", tradeId='" + tradeId + '\'' +
                 ", buyerName='" + buyerName + '\'' +
                 ", buyerTaxpayerCode='" + buyerTaxpayerCode + '\'' +
+                ", aclCalculateTime='" + aclCalculateTime + '\'' +
                 '}';
     }
 }

+ 1 - 0
src/main/java/com/jkcredit/invoice/service/lowerservice/impl/NoCarServiceImpl.java

@@ -876,6 +876,7 @@ public class NoCarServiceImpl implements NoCarService {
             billInvoice.setCompanyName(noCarWayBill.getCompanyName());
             billInvoice.setCompanyNum(noCarWayBill.getCompanyNum());
             billInvoice.setCustomerName(noCarWayBill.getCustomerName());
+            billInvoice.setWaybillNumAct(billInvoice.getWaybillNum());
             billInvoice.setWaybillNum(noCarWayBill.getBillNum());
             //扣费明细入账
             NoCarCalculateInfor calculateInfor = new NoCarCalculateInfor();

+ 1 - 0
src/main/java/com/jkcredit/invoice/service/lowerservice/impl/SelfCarCustServiceImpl.java

@@ -246,6 +246,7 @@ public class SelfCarCustServiceImpl implements SelfCarCustService {
             carCalculateInfor.setEtcNum(selfCarTrade.getCardId());
             if (calculateInforMapper.selectByEtcAndTime(carCalculateInfor) == null) {
                 needFee = MathUtil.add(needFee, carCalculateInfor.getFee());
+                carCalculateInfor.setActCalTime(DateUtil.getCurrentDateStr());
                 calculateInforMapper.insert(carCalculateInfor);
             }
         }

+ 10 - 4
src/main/resources/mapper/calculateinfor/SefCarCalculateInforMapper.xml

@@ -7,7 +7,8 @@
         <result column="customId" property="customId"/>
         <result column="companyNum" property="companyNum"/>
         <!-- <result column="tradeId" property="tradeId"/>-->
-          <result column="fee" property="fee"/>
+        <result column="fee" property="fee"/>
+        <result column="actCalTime" property="actCalTime"/>
         <!--  <result column="calculateTime" property="calculateTime"/>-->
         <!--  <result column="ctype" property="ctype"/>-->
          <result column="invoiceMkTime" property="invoiceMkTime"/>
@@ -26,7 +27,8 @@
          invoiceMkTime,
          companyReferencenum,
          companyName,
-         companyLongName
+         companyLongName,
+         actCalTime
      </sql>
      <select id="selectAllByPage" resultMap="BaseResultMap">
          select
@@ -52,6 +54,9 @@
          <if test="calculateInfor.calTime != null and calculateInfor.calTime != ''">
              and  calTime BETWEEN #{calculateInfor.calTimeStart} and #{calculateInfor.calTimeEnd}
          </if>
+         <if test="calculateInfor.actCalTime != null and calculateInfor.actCalTime != ''">
+             and  actCalTime BETWEEN #{calculateInfor.actCalTimeStart} and #{calculateInfor.actCalTimeEnd}
+         </if>
          order by id DESC
      </select>
      <select id="selectByEtcAndTime" resultMap="BaseResultMap" parameterType="com.jkcredit.invoice.model.entity.calculate.SelfCarCalculateInfor">
@@ -65,10 +70,11 @@
          companyNum,
          etcNum,
          fee,
-         calTime,invoiceMkTime,companyReferencenum,companyName,companyLongName
+         calTime,invoiceMkTime,companyReferencenum,companyName,companyLongName,actCalTime
          )
          values ( #{customId,jdbcType=VARCHAR}, #{companyNum,jdbcType=VARCHAR},
-         #{etcNum,jdbcType=VARCHAR}, #{fee,jdbcType=DOUBLE},#{calTime,jdbcType=VARCHAR},#{invoiceMkTime,jdbcType=VARCHAR},#{companyReferencenum,jdbcType=VARCHAR},#{companyName,jdbcType=VARCHAR},#{companyLongName,jdbcType=VARCHAR}
+         #{etcNum,jdbcType=VARCHAR}, #{fee,jdbcType=DOUBLE},#{calTime,jdbcType=VARCHAR},#{invoiceMkTime,jdbcType=VARCHAR},
+         #{companyReferencenum,jdbcType=VARCHAR},#{companyName,jdbcType=VARCHAR},#{companyLongName,jdbcType=VARCHAR},#{actCalTime,jdbcType=VARCHAR}
          )
      </insert>
      <resultMap id="staticResultMap" type="java.util.Map">

+ 6 - 3
src/main/resources/mapper/invoice/BillInvoiceMapper.xml

@@ -39,6 +39,7 @@
         <result column="interType" property="interType"/>
         <result column="invoiceStatus" property="invoiceStatus"/>
         <result column="msg" property="msg"/>
+        <result column="waybillNumAct" property="waybillNumAct"/>
     </resultMap>
 
     <sql id="baseSql">
@@ -76,7 +77,7 @@
     </sql>
     <select id="selectAllByPage" resultMap="BaseResultMap">
         select
-        <include refid="baseSql" />,waybillStatus billStatus,calculateTime,invoiceStatus,msg
+        <include refid="baseSql" />,waybillStatus billStatus,calculateTime,invoiceStatus,msg,waybillNumAct
         from t_billInvoice
         <where>
             <if test="billInvoice.customerName != null and billInvoice.customerName != ''">
@@ -190,7 +191,8 @@
             buyerName,
             buyerTaxpayerCode,calculateTime,
             invoiceStatus,
-            msg
+            msg,
+            waybillNumAct
         )
         values ( #{companyNum,jdbcType=VARCHAR},#{customerName,jdbcType=VARCHAR},#{companyName,jdbcType=VARCHAR},#{waybillNum,jdbcType=VARCHAR}, #{invoiceNum,jdbcType=VARCHAR},
                 #{invoiceCode,jdbcType=VARCHAR}, #{invoiceMakeTime,jdbcType=VARCHAR}, #{invoiceUrl,jdbcType=VARCHAR},
@@ -203,6 +205,7 @@
                 ,#{calculateTime,jdbcType=VARCHAR}
                 ,#{invoiceStatus,jdbcType=INTEGER}
                 ,#{msg,jdbcType=VARCHAR}
+                ,#{waybillNumAct,jdbcType=VARCHAR}
         )
     </insert>
     <update id="updateByPrimaryKey" parameterType="com.jkcredit.invoice.model.entity.invoice.BillInvoice" >
@@ -279,7 +282,7 @@
     </update>
     <select id="selectByBillNum" resultMap="BaseResultMap" parameterType="java.lang.String" >
         select
-        <include refid="baseSql" />,calculateTime,invoiceStatus,msg
+        <include refid="baseSql" />,calculateTime,invoiceStatus,msg,waybillNumAct
         from t_billInvoice
         where  waybillNum = BINARY #{waybillNum,jdbcType=VARCHAR}
     </select>

+ 4 - 1
src/main/resources/mapper/invoice/SelfCarInvoiceMapper.xml

@@ -28,6 +28,7 @@
         <result column="buyerTaxpayerCode" property="buyerTaxpayerCode"/>
         <result column="tradeStatus" property="tradeStatus"/>
         <result column="calculateTime" property="calculateTime"/>
+        <result column="aclCalculateTime" property="aclCalculateTime"/>
     </resultMap>
 
     <sql id="baseSql">
@@ -57,7 +58,9 @@
     </sql>
     <select id="selectAllByPage" resultMap="BaseResultMap">
         select
-        <include refid="baseSql" />,(select DISTINCT t.status from t_SellCarTrade t where t.tradeId = g.tradeId ) tradeStatus,(select f.calTime from t_SelfCalculateInfor f where f.etcNum = cardId and instr(g.exTime,f.calTime)>0) calculateTime
+        <include refid="baseSql" />,(select DISTINCT t.status from t_SellCarTrade t where t.tradeId = g.tradeId ) tradeStatus
+        ,(select f.calTime from t_SelfCalculateInfor f where f.etcNum = cardId and instr(g.exTime,f.calTime)>0) calculateTime
+        ,(select f.actCalTime from t_SelfCalculateInfor f where f.etcNum = cardId and instr(g.exTime,f.calTime)>0) aclCalculateTime
         from t_SelfCarInvoice g
         <where>
             <if test="selfCarInvoice.companyName != null and selfCarInvoice.companyName != ''">