Browse Source

拆分记录(需要再加)

Administrator 2 years ago
parent
commit
fe130a0c0d

+ 22 - 0
src/main/java/com/jkcredit/invoice/mapper/waybill/WayBillSplitInfoMapper.java

@@ -0,0 +1,22 @@
+package com.jkcredit.invoice.mapper.waybill;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jkcredit.invoice.model.entity.waybill.NoCarWayBillSplitInfo;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+ * 拆分记录接口
+ * @author mumuxigua
+ */
+@Repository
+public interface WayBillSplitInfoMapper extends BaseMapper<NoCarWayBillSplitInfo> {
+
+    int batchInsert(List<NoCarWayBillSplitInfo> noCarWayBillSplitInfos);
+
+    List<NoCarWayBillSplitInfo> selectNoCarWayBillSplitInfosByOrgNum(String wayBillNum);
+
+    int updateStatusById(@Param("id") Long id,@Param("waybillstatus") byte status);
+}

+ 80 - 0
src/main/java/com/jkcredit/invoice/model/entity/waybill/NoCarWayBillSplitInfo.java

@@ -0,0 +1,80 @@
+package com.jkcredit.invoice.model.entity.waybill;
+
+/**
+ *拆分记录表
+ */
+public class NoCarWayBillSplitInfo {
+    /**
+     * id
+     */
+    private Long id;
+
+    /**
+     * 运单编号
+     */
+    private String waybillNum;
+    /**
+     * 原运单编号
+     */
+    private String orgWaybillNum;
+    /**
+     * 拆分后开始时间
+     */
+    private String waybillStartTime;
+    /**
+     * 拆分后结束时间
+     */
+    private String waybillEndTime;
+    /**
+     * 原运单编号
+     */
+    private byte waybillstatus;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getWaybillNum() {
+        return waybillNum;
+    }
+
+    public void setWaybillNum(String waybillNum) {
+        this.waybillNum = waybillNum;
+    }
+
+    public String getOrgWaybillNum() {
+        return orgWaybillNum;
+    }
+
+    public void setOrgWaybillNum(String orgWaybillNum) {
+        this.orgWaybillNum = orgWaybillNum;
+    }
+
+    public String getWaybillStartTime() {
+        return waybillStartTime;
+    }
+
+    public void setWaybillStartTime(String waybillStartTime) {
+        this.waybillStartTime = waybillStartTime;
+    }
+
+    public String getWaybillEndTime() {
+        return waybillEndTime;
+    }
+
+    public void setWaybillEndTime(String waybillEndTime) {
+        this.waybillEndTime = waybillEndTime;
+    }
+
+    public byte getWaybillstatus() {
+        return waybillstatus;
+    }
+
+    public void setWaybillstatus(byte waybillstatus) {
+        this.waybillstatus = waybillstatus;
+    }
+}

+ 34 - 0
src/main/java/com/jkcredit/invoice/service/nocar/WayBillSplitInfoService.java

@@ -0,0 +1,34 @@
+package com.jkcredit.invoice.service.nocar;
+
+import com.jkcredit.invoice.model.entity.waybill.NoCarWayBillSplitInfo;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 运单拆分接口
+ */
+public interface WayBillSplitInfoService {
+    /**
+     * 批量插入
+     * @param noCarWayBillSplitInfos
+     * @return
+     */
+    int batchInsert(List<NoCarWayBillSplitInfo> noCarWayBillSplitInfos);
+
+    /**
+     * 根据原始运单号查询拆分记录
+     * @param wayBillNum
+     * @return
+     */
+    List<NoCarWayBillSplitInfo> selectNoCarWayBillSplitInfosByOrgNum(String wayBillNum);
+
+    /**
+     * 更新状态
+     * @param id
+     * @param status
+     * @return
+     */
+    int updateStatusById(@Param("id") Long id, @Param("waybillstatus") byte status);
+}

+ 31 - 0
src/main/java/com/jkcredit/invoice/service/nocar/impl/WayBillSplitInfoServiceImpl.java

@@ -0,0 +1,31 @@
+package com.jkcredit.invoice.service.nocar.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.jkcredit.invoice.mapper.waybill.WayBillSplitInfoMapper;
+import com.jkcredit.invoice.model.entity.waybill.NoCarWayBillSplitInfo;
+import com.jkcredit.invoice.service.nocar.WayBillSplitInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service("wayBillSplitInfoService")
+public class WayBillSplitInfoServiceImpl  extends ServiceImpl<WayBillSplitInfoMapper, NoCarWayBillSplitInfo> implements WayBillSplitInfoService{
+    @Autowired
+    WayBillSplitInfoMapper wayBillSplitInfoMapper;
+    @Override
+    public int batchInsert(List<NoCarWayBillSplitInfo> noCarWayBillSplitInfos) {
+        int num = wayBillSplitInfoMapper.batchInsert(noCarWayBillSplitInfos);
+        return num;
+    }
+
+    @Override
+    public List<NoCarWayBillSplitInfo> selectNoCarWayBillSplitInfosByOrgNum(String wayBillNum) {
+        return wayBillSplitInfoMapper.selectNoCarWayBillSplitInfosByOrgNum(wayBillNum);
+    }
+
+    @Override
+    public int updateStatusById(Long id, byte status) {
+        return wayBillSplitInfoMapper.updateStatusById(id,status);
+    }
+}

+ 46 - 0
src/main/resources/mapper/waybill/WayBillSplitInfoMapper.xml

@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jkcredit.invoice.mapper.waybill.WayBillSplitInfoMapper">
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.jkcredit.invoice.model.entity.waybill.NoCarWayBillSplitInfo">
+        <id column="id" property="id"/>
+        <result column="waybillNum" property="waybillNum"/>
+        <result column="orgWaybillNum" property="orgWaybillNum"/>
+        <result column="waybillStartTime" property="waybillStartTime"/>
+        <result column="waybillEndTime" property="waybillEndTime"/>
+        <result column="waybillstatus" property="waybillstatus"/>
+    </resultMap>
+
+    <sql id="baseSql">
+         id,
+         waybillNum,
+         orgWaybillNum,
+         waybillStartTime,
+         waybillEndTime,
+         waybillstatus
+    </sql>
+    <insert id="batchInsert" parameterType="java.util.List" >
+        insert into t_waybill_split_info (
+             waybillNum,
+             orgWaybillNum,
+             waybillStartTime,
+             waybillEndTime,
+             waybillstatus
+        )
+        values
+        <foreach collection="list" separator="," item="item">
+            ( #{item.waybillNum,jdbcType=VARCHAR}, #{item.orgWaybillNum,jdbcType=VARCHAR},
+            #{item.waybillStartTime,jdbcType=VARCHAR}, #{item.waybillEndTime,jdbcType=VARCHAR}, #{item.waybillstatus,jdbcType=INTEGER}
+            )
+        </foreach>
+
+    </insert>
+
+
+  <select id="selectNoCarWayBillSplitInfosByOrgNum" parameterType="java.lang.String" resultMap="BaseResultMap">
+      select <include refid="baseSql" /> from t_waybill_split_info where orgWaybillNum=#{wayBillNum,jdbcType=VARCHAR}
+  </select>
+   <update id="updateStatusById" parameterType="java.util.Map">
+       UPDATE t_waybill_split_info set waybillstatus = #{waybillstatus} where id = #{id}
+   </update>
+</mapper>