luobang 2 år sedan
förälder
incheckning
ec82fd1255

+ 2 - 2
pom.xml

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

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

@@ -3,9 +3,13 @@ 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();
 }

+ 27 - 7
src/main/java/com/steerinfo/dil/model/DilCapacityTimes.java

@@ -3,7 +3,6 @@ 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;
 
@@ -15,7 +14,10 @@ public class DilCapacityTimes implements IBasePO<BigDecimal> {
     @ApiModelProperty(value="主键ID",required=true)
     private BigDecimal timesId;
 
-    @ApiModelProperty(value="",required=false)
+    /**
+     * 时间(TIMES_VALUE,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="时间",required=false)
     private Date timesValue;
 
     /**
@@ -24,8 +26,17 @@ public class DilCapacityTimes implements IBasePO<BigDecimal> {
     @ApiModelProperty(value="类型(1:进厂;2:出厂)",required=false)
     private BigDecimal timesType;
 
-    @ApiModelProperty(value="",required=false)
-    private BigDecimal timesRemark;
+    /**
+     * 备注(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;
 
@@ -63,12 +74,20 @@ public class DilCapacityTimes implements IBasePO<BigDecimal> {
         this.timesType = timesType;
     }
 
-    public BigDecimal getTimesRemark() {
+    public String getTimesRemark() {
         return timesRemark;
     }
 
-    public void setTimesRemark(BigDecimal timesRemark) {
-        this.timesRemark = 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
@@ -81,6 +100,7 @@ public class DilCapacityTimes implements IBasePO<BigDecimal> {
         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();

+ 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);
     }
 

+ 84 - 60
src/main/resources/com/steerinfo/dil/mapper/DilCapacityTimesMapper.xml

@@ -5,13 +5,14 @@
     <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="DECIMAL" property="timesRemark" />
+    <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_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_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
@@ -20,7 +21,7 @@
     SELECT <include refid="columns_alias"/> FROM DIL_CAPACITY_TIMES t
   </sql>
   <sql id="where">
-    <where> 
+    <where>
       <if test="timesId != null">
         and TIMES_ID = #{timesId}
       </if>
@@ -30,13 +31,16 @@
       <if test="timesType != null">
         and TIMES_TYPE = #{timesType}
       </if>
-      <if test="timesRemark != null">
+      <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> 
+    <where>
       <if test="timesId != null">
         and TIMES_ID = #{timesId}
       </if>
@@ -46,8 +50,11 @@
       <if test="timesType != null">
         and TIMES_TYPE = #{timesType}
       </if>
-      <if test="timesRemark != null">
-        and TIMES_REMARK = #{timesRemark}
+      <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>
@@ -57,22 +64,25 @@
   </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">
-        or TIMES_REMARK = #{timesRemark}
-      </if>
+    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)
-    values (#{timesId,jdbcType=DECIMAL}, #{timesValue,jdbcType=TIMESTAMP}, #{timesType,jdbcType=DECIMAL}, 
-      #{timesRemark,jdbcType=DECIMAL})
+    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
@@ -89,6 +99,9 @@
       <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">
@@ -101,15 +114,19 @@
         #{timesType,jdbcType=DECIMAL},
       </if>
       <if test="timesRemark != null">
-        #{timesRemark,jdbcType=DECIMAL},
+        #{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=DECIMAL}
+        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">
@@ -122,7 +139,10 @@
         TIMES_TYPE = #{timesType,jdbcType=DECIMAL},
       </if>
       <if test="timesRemark != null">
-        TIMES_REMARK = #{timesRemark,jdbcType=DECIMAL},
+        TIMES_REMARK = #{timesRemark,jdbcType=VARCHAR},
+      </if>
+      <if test="timesCapacityNumber != null">
+        TIMES_CAPACITY_NUMBER = #{timesCapacityNumber,jdbcType=VARCHAR},
       </if>
     </set>
     where TIMES_ID = #{timesId,jdbcType=DECIMAL}
@@ -140,49 +160,53 @@
     <include refid="whereLike"/>
   </select>
   <insert id="batchInsert" parameterType="java.util.List">
-    insert into DIL_CAPACITY_TIMES 
-      (TIMES_ID, 
-      TIMES_VALUE, TIMES_TYPE, TIMES_REMARK
-      )
-    ( <foreach collection="list" item="item" separator="union all"> 
-   select  
-      #{item.timesId,jdbcType=DECIMAL}, 
-      #{item.timesValue,jdbcType=TIMESTAMP}, #{item.timesType,jdbcType=DECIMAL}, #{item.timesRemark,jdbcType=DECIMAL}
-       from dual  
-   </foreach> )
+    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=DECIMAL}
-       </foreach>
-     where TIMES_ID in 
-     <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
-    #{item.timesId,jdbcType=DECIMAL}
-     </foreach> 
+    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 
+    where TIMES_ID in
     <foreach collection="list" item="id" open="(" close=")" separator=",">
       #{id}
     </foreach>
   </delete>
   <!-- 友情提示!!!-->
   <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
-  
+
 </mapper>