Selaa lähdekoodia

Merge branch 'master' of https://git.steerinfo.com/DAL-DAZHOU1/DAL-TMS-TRUCK-API

liyg 2 vuotta sitten
vanhempi
commit
75b6e28c11

+ 2 - 1
pom.xml

@@ -163,7 +163,8 @@
                     <targetPackage>com.steerinfo.dil</targetPackage>
                     <tables>
 <!--                        <param>MEASURE_JSON_DATA</param>-->
-<!--                        <param>TMSTRUCK_TOTAL_RESULT</param>-->
+<!--                        <param>DIL_TABLE_COLUMN_ROLE</param>-->
+                        <param>DIL_CAPACITY_TIMES</param>
                     </tables>
                 </configuration>
                 <executions>

+ 15 - 0
src/main/java/com/steerinfo/dil/mapper/DilCapacityTimesMapper.java

@@ -0,0 +1,15 @@
+package com.steerinfo.dil.mapper;
+
+import com.steerinfo.dil.model.DilCapacityTimes;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+
+import java.math.BigDecimal;
+
+@Mapper
+public interface DilCapacityTimesMapper extends IBaseMapper<DilCapacityTimes, BigDecimal> {
+
+    @Select("select seq__Dil_CAPACITY_TIMES.nextval from dual")
+    BigDecimal getDilCapacityTimesId();
+}

+ 108 - 0
src/main/java/com/steerinfo/dil/model/DilCapacityTimes.java

@@ -0,0 +1,108 @@
+package com.steerinfo.dil.model;
+
+import com.steerinfo.framework.model.IBasePO;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.math.BigDecimal;
+import java.util.Date;
+
+@ApiModel(value="车辆时间线")
+public class DilCapacityTimes implements IBasePO<BigDecimal> {
+    /**
+     * 主键ID(TIMES_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="主键ID",required=true)
+    private BigDecimal timesId;
+
+    /**
+     * 时间(TIMES_VALUE,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="时间",required=false)
+    private Date timesValue;
+
+    /**
+     * 类型(1:进厂;2:出厂)(TIMES_TYPE,DECIMAL,38)
+     */
+    @ApiModelProperty(value="类型(1:进厂;2:出厂)",required=false)
+    private BigDecimal timesType;
+
+    /**
+     * 备注(TIMES_REMARK,VARCHAR,200)
+     */
+    @ApiModelProperty(value="备注",required=false)
+    private String timesRemark;
+
+    /**
+     * 车牌号(TIMES_CAPACITY_NUMBER,VARCHAR,255)
+     */
+    @ApiModelProperty(value="车牌号",required=false)
+    private String timesCapacityNumber;
+
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public BigDecimal getId() {
+        return this.timesId;
+    }
+
+    @Override
+    public void setId(BigDecimal timesId) {
+        this.timesId = timesId;
+    }
+
+    public BigDecimal getTimesId() {
+        return timesId;
+    }
+
+    public void setTimesId(BigDecimal timesId) {
+        this.timesId = timesId;
+    }
+
+    public Date getTimesValue() {
+        return timesValue;
+    }
+
+    public void setTimesValue(Date timesValue) {
+        this.timesValue = timesValue;
+    }
+
+    public BigDecimal getTimesType() {
+        return timesType;
+    }
+
+    public void setTimesType(BigDecimal timesType) {
+        this.timesType = timesType;
+    }
+
+    public String getTimesRemark() {
+        return timesRemark;
+    }
+
+    public void setTimesRemark(String timesRemark) {
+        this.timesRemark = timesRemark == null ? null : timesRemark.trim();
+    }
+
+    public String getTimesCapacityNumber() {
+        return timesCapacityNumber;
+    }
+
+    public void setTimesCapacityNumber(String timesCapacityNumber) {
+        this.timesCapacityNumber = timesCapacityNumber == null ? null : timesCapacityNumber.trim();
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", timesId=").append(timesId);
+        sb.append(", timesValue=").append(timesValue);
+        sb.append(", timesType=").append(timesType);
+        sb.append(", timesRemark=").append(timesRemark);
+        sb.append(", timesCapacityNumber=").append(timesCapacityNumber);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 1 - 4
src/main/java/com/steerinfo/dil/service/impl/StatisticalReportImpl.java

@@ -278,10 +278,7 @@ public class StatisticalReportImpl implements IStatisticalReportService {
                     stringObjectMap.put("group",Integer.parseInt(saleSteelReport.get(j-1).get("group").toString()) + 1);
                 }
             }
-            if( !"取消".equals(stringObjectMap.get("capacityNo")) && !"反审批".equals(stringObjectMap.get("saleOrderStatus")) &&
-            !"已关闭".equals(stringObjectMap.get("orderStatus"))) {
-                set.add(stringObjectMap.get("saleOrderMaterialId"));
-            }
+            set.add(stringObjectMap.get("saleOrderMaterialId"));
             calculateDifferenceTime(stringObjectMap);
             //收货客户筛选
             Map<String, Object> filterConsigneeMap = new HashMap<>();

+ 15 - 0
src/main/java/com/steerinfo/dil/service/impl/TmstruckEnfactoryResultServiceImpl.java

@@ -1,8 +1,10 @@
 package com.steerinfo.dil.service.impl;
 
 import com.steerinfo.dil.feign.OmsFeign;
+import com.steerinfo.dil.mapper.DilCapacityTimesMapper;
 import com.steerinfo.dil.mapper.TmstruckEnfactoryResultMapper;
 import com.steerinfo.dil.mapper.UtilsMapper;
+import com.steerinfo.dil.model.DilCapacityTimes;
 import com.steerinfo.dil.model.TmstruckEnfactoryResult;
 import com.steerinfo.dil.model.TmstruckLeaveFactoryResult;
 import com.steerinfo.dil.service.ITmstruckEnfactoryResultService;
@@ -40,6 +42,9 @@ public class TmstruckEnfactoryResultServiceImpl implements ITmstruckEnfactoryRes
     @Autowired
     private TmstruckTimeTaskResultServiceImpl tmstruckTimeTaskResultService;
 
+    @Autowired
+    private DilCapacityTimesMapper dilCapacityTimesMapper;
+
     @Autowired
     private UtilsServiceImpl utilsService;
 
@@ -256,6 +261,16 @@ public class TmstruckEnfactoryResultServiceImpl implements ITmstruckEnfactoryRes
         }else if (checkMeasureCommission == -2){
             throw new Exception("没有获取到门岗");
         }
+        try {
+            DilCapacityTimes dilCapacityTimes = new DilCapacityTimes();
+            dilCapacityTimes.setId(dilCapacityTimesMapper.getDilCapacityTimesId());
+            dilCapacityTimes.setTimesCapacityNumber(map.get("capacityNumber").toString());
+            dilCapacityTimes.setTimesValue(new Date());
+            dilCapacityTimes.setTimesType(new BigDecimal(1));
+            dilCapacityTimesMapper.insertSelective(dilCapacityTimes);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
         i += tmstruckEnfactoryResultMapper.updateByPrimaryKeySelective(generateEnFactoryResult(map)); //添加进厂实绩
         //修改路段顺序号
         i += utilsService.updateOrderLineSequence(map);

+ 15 - 4
src/main/java/com/steerinfo/dil/service/impl/TmstruckLeaveFactoryResultServiceImpl.java

@@ -3,10 +3,8 @@ package com.steerinfo.dil.service.impl;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.steerinfo.dil.feign.*;
-import com.steerinfo.dil.mapper.TmstruckEnfactoryResultMapper;
-import com.steerinfo.dil.mapper.TmstruckLeaveFactoryResultMapper;
-import com.steerinfo.dil.mapper.TmstruckLoadResultMapper;
-import com.steerinfo.dil.mapper.UtilsMapper;
+import com.steerinfo.dil.mapper.*;
+import com.steerinfo.dil.model.DilCapacityTimes;
 import com.steerinfo.dil.model.TmstruckLeaveFactoryResult;
 import com.steerinfo.dil.model.TmstruckWeightResult;
 import com.steerinfo.dil.service.ITmstruckLeaveFactoryResultService;
@@ -62,6 +60,9 @@ public class TmstruckLeaveFactoryResultServiceImpl implements ITmstruckLeaveFact
     @Autowired
     private TmstruckEnfactoryResultServiceImpl tmstruckEnfactoryResultService;
 
+    @Autowired
+    private DilCapacityTimesMapper dilCapacityTimesMapper;
+
     @Autowired
     TmstruckSmsRusultServiceImpl tmstruckSmsRusultService;
 
@@ -545,6 +546,16 @@ public class TmstruckLeaveFactoryResultServiceImpl implements ITmstruckLeaveFact
         tmstruckLeaveFactoryResult.setInsertUsername("admin");
         tmstruckLeaveFactoryResult.setInsertTime(new Date());
         tmstruckLeaveFactoryResultMapper.updateResultTotalOutStatus(DataChange.dataToBigDecimal(mapValue.get("resultTotalId")));
+        try {
+            DilCapacityTimes dilCapacityTimes = new DilCapacityTimes();
+            dilCapacityTimes.setId(dilCapacityTimesMapper.getDilCapacityTimesId());
+            dilCapacityTimes.setTimesCapacityNumber(mapValue.get("capacityNumber").toString());
+            dilCapacityTimes.setTimesValue(new Date());
+            dilCapacityTimes.setTimesType(new BigDecimal(2));
+            dilCapacityTimesMapper.insertSelective(dilCapacityTimes);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
         return tmstruckLeaveFactoryResultMapper.updateByPrimaryKeySelective(tmstruckLeaveFactoryResult);
     }
 

+ 212 - 0
src/main/resources/com/steerinfo/dil/mapper/DilCapacityTimesMapper.xml

@@ -0,0 +1,212 @@
+<?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.steerinfo.dil.mapper.DilCapacityTimesMapper">
+  <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.DilCapacityTimes">
+    <id column="TIMES_ID" jdbcType="DECIMAL" property="timesId" />
+    <result column="TIMES_VALUE" jdbcType="TIMESTAMP" property="timesValue" />
+    <result column="TIMES_TYPE" jdbcType="DECIMAL" property="timesType" />
+    <result column="TIMES_REMARK" jdbcType="VARCHAR" property="timesRemark" />
+    <result column="TIMES_CAPACITY_NUMBER" jdbcType="VARCHAR" property="timesCapacityNumber" />
+  </resultMap>
+  <sql id="columns">
+    TIMES_ID, TIMES_VALUE, TIMES_TYPE, TIMES_REMARK, TIMES_CAPACITY_NUMBER
+  </sql>
+  <sql id="columns_alias">
+    t.TIMES_ID, t.TIMES_VALUE, t.TIMES_TYPE, t.TIMES_REMARK, t.TIMES_CAPACITY_NUMBER
+  </sql>
+  <sql id="select">
+    SELECT <include refid="columns"/> FROM DIL_CAPACITY_TIMES
+  </sql>
+  <sql id="select_alias">
+    SELECT <include refid="columns_alias"/> FROM DIL_CAPACITY_TIMES t
+  </sql>
+  <sql id="where">
+    <where>
+      <if test="timesId != null">
+        and TIMES_ID = #{timesId}
+      </if>
+      <if test="timesValue != null">
+        and TO_CHAR(TIMES_VALUE,'yyyy-MM-dd') = #{timesValue}
+      </if>
+      <if test="timesType != null">
+        and TIMES_TYPE = #{timesType}
+      </if>
+      <if test="timesRemark != null and timesRemark != ''">
+        and TIMES_REMARK = #{timesRemark}
+      </if>
+      <if test="timesCapacityNumber != null and timesCapacityNumber != ''">
+        and TIMES_CAPACITY_NUMBER = #{timesCapacityNumber}
+      </if>
+    </where>
+  </sql>
+  <sql id="whereLike">
+    <where>
+      <if test="timesId != null">
+        and TIMES_ID = #{timesId}
+      </if>
+      <if test="timesValue != null">
+        and TO_CHAR(TIMES_VALUE,'yyyy-MM-dd') = #{timesValue}
+      </if>
+      <if test="timesType != null">
+        and TIMES_TYPE = #{timesType}
+      </if>
+      <if test="timesRemark != null and timesRemark != ''">
+        and TIMES_REMARK LIKE '%${timesRemark}%'
+      </if>
+      <if test="timesCapacityNumber != null and timesCapacityNumber != ''">
+        and TIMES_CAPACITY_NUMBER LIKE '%${timesCapacityNumber}%'
+      </if>
+    </where>
+  </sql>
+  <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
+    delete from DIL_CAPACITY_TIMES
+    where TIMES_ID = #{timesId,jdbcType=DECIMAL}
+  </delete>
+  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+    delete from DIL_CAPACITY_TIMES
+    where 1!=1
+    <if test="timesValue != null">
+      or TO_CHAR(TIMES_VALUE,'yyyy-MM-dd') = '#{timesValue}'
+    </if>
+    <if test="timesType != null">
+      or TIMES_TYPE = #{timesType}
+    </if>
+    <if test="timesRemark != null and timesRemark != ''">
+      or TIMES_REMARK = #{timesRemark}
+    </if>
+    <if test="timesCapacityNumber != null and timesCapacityNumber != ''">
+      or TIMES_CAPACITY_NUMBER = #{timesCapacityNumber}
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.steerinfo.dil.model.DilCapacityTimes">
+    insert into DIL_CAPACITY_TIMES (TIMES_ID, TIMES_VALUE, TIMES_TYPE,
+                                    TIMES_REMARK, TIMES_CAPACITY_NUMBER)
+    values (#{timesId,jdbcType=DECIMAL}, #{timesValue,jdbcType=TIMESTAMP}, #{timesType,jdbcType=DECIMAL},
+            #{timesRemark,jdbcType=VARCHAR}, #{timesCapacityNumber,jdbcType=VARCHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="com.steerinfo.dil.model.DilCapacityTimes">
+    insert into DIL_CAPACITY_TIMES
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="timesId != null">
+        TIMES_ID,
+      </if>
+      <if test="timesValue != null">
+        TIMES_VALUE,
+      </if>
+      <if test="timesType != null">
+        TIMES_TYPE,
+      </if>
+      <if test="timesRemark != null">
+        TIMES_REMARK,
+      </if>
+      <if test="timesCapacityNumber != null">
+        TIMES_CAPACITY_NUMBER,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="timesId != null">
+        #{timesId,jdbcType=DECIMAL},
+      </if>
+      <if test="timesValue != null">
+        #{timesValue,jdbcType=TIMESTAMP},
+      </if>
+      <if test="timesType != null">
+        #{timesType,jdbcType=DECIMAL},
+      </if>
+      <if test="timesRemark != null">
+        #{timesRemark,jdbcType=VARCHAR},
+      </if>
+      <if test="timesCapacityNumber != null">
+        #{timesCapacityNumber,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.DilCapacityTimes">
+    update DIL_CAPACITY_TIMES
+    set TIMES_VALUE = #{timesValue,jdbcType=TIMESTAMP},
+        TIMES_TYPE = #{timesType,jdbcType=DECIMAL},
+        TIMES_REMARK = #{timesRemark,jdbcType=VARCHAR},
+        TIMES_CAPACITY_NUMBER = #{timesCapacityNumber,jdbcType=VARCHAR}
+    where TIMES_ID = #{timesId,jdbcType=DECIMAL}
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.DilCapacityTimes">
+    update DIL_CAPACITY_TIMES
+    <set>
+      <if test="timesValue != null">
+        TIMES_VALUE = #{timesValue,jdbcType=TIMESTAMP},
+      </if>
+      <if test="timesType != null">
+        TIMES_TYPE = #{timesType,jdbcType=DECIMAL},
+      </if>
+      <if test="timesRemark != null">
+        TIMES_REMARK = #{timesRemark,jdbcType=VARCHAR},
+      </if>
+      <if test="timesCapacityNumber != null">
+        TIMES_CAPACITY_NUMBER = #{timesCapacityNumber,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where TIMES_ID = #{timesId,jdbcType=DECIMAL}
+  </update>
+  <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
+    <include refid="select"/>
+    where TIMES_ID = #{timesId,jdbcType=DECIMAL}
+  </select>
+  <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    <include refid="select"/>
+    <include refid="where"/>
+  </select>
+  <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    <include refid="select"/>
+    <include refid="whereLike"/>
+  </select>
+  <insert id="batchInsert" parameterType="java.util.List">
+    insert into DIL_CAPACITY_TIMES
+    (TIMES_ID,
+    TIMES_VALUE, TIMES_TYPE, TIMES_REMARK,
+    TIMES_CAPACITY_NUMBER)
+    ( <foreach collection="list" item="item" separator="union all">
+    select
+    #{item.timesId,jdbcType=DECIMAL},
+    #{item.timesValue,jdbcType=TIMESTAMP}, #{item.timesType,jdbcType=DECIMAL}, #{item.timesRemark,jdbcType=VARCHAR},
+    #{item.timesCapacityNumber,jdbcType=VARCHAR} from dual
+  </foreach> )
+  </insert>
+  <update id="batchUpdate" parameterType="java.util.List">
+    update DIL_CAPACITY_TIMES
+    set
+    TIMES_ID=
+    <foreach collection="list" item="item" index="index" separator=" " open="case TIMES_ID" close="end">
+      when #{item.timesId,jdbcType=DECIMAL} then #{item.timesId,jdbcType=DECIMAL}
+    </foreach>
+    ,TIMES_VALUE=
+    <foreach collection="list" item="item" index="index" separator=" " open="case TIMES_ID" close="end">
+      when #{item.timesId,jdbcType=DECIMAL} then #{item.timesValue,jdbcType=TIMESTAMP}
+    </foreach>
+    ,TIMES_TYPE=
+    <foreach collection="list" item="item" index="index" separator=" " open="case TIMES_ID" close="end">
+      when #{item.timesId,jdbcType=DECIMAL} then #{item.timesType,jdbcType=DECIMAL}
+    </foreach>
+    ,TIMES_REMARK=
+    <foreach collection="list" item="item" index="index" separator=" " open="case TIMES_ID" close="end">
+      when #{item.timesId,jdbcType=DECIMAL} then #{item.timesRemark,jdbcType=VARCHAR}
+    </foreach>
+    ,TIMES_CAPACITY_NUMBER=
+    <foreach collection="list" item="item" index="index" separator=" " open="case TIMES_ID" close="end">
+      when #{item.timesId,jdbcType=DECIMAL} then #{item.timesCapacityNumber,jdbcType=VARCHAR}
+    </foreach>
+    where TIMES_ID in
+    <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
+      #{item.timesId,jdbcType=DECIMAL}
+    </foreach>
+  </update>
+  <delete id="batchDelete" parameterType="java.util.List">
+    delete from DIL_CAPACITY_TIMES
+    where TIMES_ID in
+    <foreach collection="list" item="id" open="(" close=")" separator=",">
+      #{id}
+    </foreach>
+  </delete>
+  <!-- 友情提示!!!-->
+  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+
+</mapper>

+ 2 - 4
src/main/resources/com/steerinfo/dil/mapper/StatisticalReportMapper.xml

@@ -3884,12 +3884,10 @@
         ASO.SALE_ORDER_ISSELF_MENTION = '否'
         AND NVL(OO.CAPACITY_ID,0) != 35128
         AND (
-        aso.DELETED BETWEEN 1
-        AND 2
+        aso.DELETED = 2
         AND aso.SALE_ORDER_STATUS = 4
         OR aso.DELETED = 0
-        AND aso.SALE_ORDER_STATUS BETWEEN 0
-        AND 4
+        AND aso.SALE_ORDER_STATUS = 4
         )
         AND R_CARRIER.CARRIER_ABBREVIATION IS NOT NULL
         AND NVL(ASOM.WARRANTY_NUMBER,0) = 0

+ 3 - 1
src/main/resources/com/steerinfo/dil/mapper/TmstruckLeaveFactoryResultMapper.xml

@@ -1382,7 +1382,9 @@
     <select id="queryNumber1" resultType="java.util.Map">
         select oo.PRINTNUMBER "printnumber",oo .PRINTDATE "printDate"
         from OMSTRUCK_ORDER oo
-        where oo.ORDER_NUMBER=#{orderNumber} and OO.ORDER_STATUS=5
+        where oo.ORDER_NUMBER=#{orderNumber}
+        AND OO.ORDER_STATUS IN (2,5)
+        ORDER BY OO.ORDER_ID DESC
         FETCH NEXT 1 ROW ONLY
     </select>