dengyj 3 vuotta sitten
vanhempi
commit
0b82288855
22 muutettua tiedostoa jossa 1540 lisäystä ja 72 poistoa
  1. 137 35
      src/main/java/com/steerinfo/baseinfo/meterbasehistaredata/mapper/MeterBaseHisTareDataMapper.xml
  2. 80 17
      src/main/java/com/steerinfo/baseinfo/meterbasehistaredata/model/MeterBaseHisTareData.java
  3. 29 0
      src/main/java/com/steerinfo/baseinfo/meterbasehistaredata/service/impl/MeterBaseHisTareDataServiceImpl.java
  4. 110 7
      src/main/java/com/steerinfo/baseinfo/meterbasetermtaredata/mapper/MeterBaseTermTareDataMapper.xml
  5. 60 0
      src/main/java/com/steerinfo/baseinfo/meterbasetermtaredata/model/MeterBaseTermTareData.java
  6. 22 1
      src/main/java/com/steerinfo/baseinfo/meterbasetermtaredata/service/impl/MeterBaseTermTareDataServiceImpl.java
  7. 55 0
      src/main/java/com/steerinfo/meterwork/meterworkcaractual/controller/MeterWorkCarActualController.java
  8. 3 0
      src/main/java/com/steerinfo/meterwork/meterworkcaractual/service/IMeterWorkCarActualService.java
  9. 363 2
      src/main/java/com/steerinfo/meterwork/meterworkcaractual/service/impl/MeterWorkCarActualServiceImpl.java
  10. 5 2
      src/main/java/com/steerinfo/meterwork/meterworkcarnoidentify/mapper/MeterWorkCarnoIdentifyMapper.xml
  11. 4 4
      src/main/java/com/steerinfo/meterwork/meterworkcarnoidentify/service/impl/MeterWorkCarnoIdentifyServiceImpl.java
  12. 39 0
      src/main/java/com/steerinfo/meterwork/meterworkdatacount/controller/MeterWorkDataCountController.java
  13. 3 0
      src/main/java/com/steerinfo/meterwork/meterworkdatacount/mapper/MeterWorkDataCountMapper.java
  14. 81 0
      src/main/java/com/steerinfo/meterwork/meterworkdatacount/mapper/MeterWorkDataCountMapper.xml
  15. 18 0
      src/main/java/com/steerinfo/meterwork/meterworkdatacount/model/CarActualTareWeightComparison.java
  16. 259 0
      src/main/java/com/steerinfo/meterwork/meterworkdatacount/model/RailwayActualGrossWeightComparison.java
  17. 5 0
      src/main/java/com/steerinfo/meterwork/meterworkdatacount/service/IMeterWorkDataCountService.java
  18. 82 1
      src/main/java/com/steerinfo/meterwork/meterworkdatacount/service/impl/MeterWorkDataCountServiceImpl.java
  19. 19 0
      src/main/java/com/steerinfo/meterwork/meterworkimage/controller/MeterWorkImageController.java
  20. 1 0
      src/main/java/com/steerinfo/meterwork/meterworkimage/service/IMeterWorkImageService.java
  21. 155 1
      src/main/java/com/steerinfo/meterwork/meterworkimage/service/impl/MeterWorkImageServiceImpl.java
  22. 10 2
      src/main/java/com/steerinfo/meterwork/meterworkrailwayactfirst/service/impl/MeterWorkRailwayActFirstServiceImpl.java

+ 137 - 35
src/main/java/com/steerinfo/baseinfo/meterbasehistaredata/mapper/MeterBaseHisTareDataMapper.xml

@@ -16,24 +16,30 @@
     <result column="CREATE_MAN_NO" jdbcType="VARCHAR" property="createManNo" />
     <result column="CREATE_MAN_NAME" jdbcType="VARCHAR" property="createManName" />
     <result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="UPDATE_MAN_NO" jdbcType="VARCHAR" property="updateManNo" />
+    <result column="UPDATE_MAN_NAME" jdbcType="VARCHAR" property="updateManName" />
+    <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
+    <result column="NOTE" jdbcType="VARCHAR" property="note" />
   </resultMap>
   <sql id="columns">
     DATA_NO, BASE_SPOT_NO, BASE_SPOT_NAME, CAR_NO, METER_WEIGHT, METER_NAME, METER_TIME, 
-    UP_WEIGHT, AVG_WEIGHT, METER_NUM, VALUE_FLAG, CREATE_MAN_NO, CREATE_MAN_NAME, CREATE_TIME
+    UP_WEIGHT, AVG_WEIGHT, METER_NUM, VALUE_FLAG, CREATE_MAN_NO, CREATE_MAN_NAME, CREATE_TIME, 
+    UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME, NOTE
   </sql>
   <sql id="columns_alias">
     t.DATA_NO, t.BASE_SPOT_NO, t.BASE_SPOT_NAME, t.CAR_NO, t.METER_WEIGHT, t.METER_NAME, 
     t.METER_TIME, t.UP_WEIGHT, t.AVG_WEIGHT, t.METER_NUM, t.VALUE_FLAG, t.CREATE_MAN_NO, 
-    t.CREATE_MAN_NAME, t.CREATE_TIME
+    t.CREATE_MAN_NAME, t.CREATE_TIME, t.UPDATE_MAN_NO, t.UPDATE_MAN_NAME, t.UPDATE_TIME, 
+    t.NOTE
   </sql>
   <sql id="select">
-    SELECT <include refid="columns"/> FROM METER_BASE_HIS_TARE_DATA
+    SELECT <include refid="columns" /> FROM METER_BASE_HIS_TARE_DATA
   </sql>
   <sql id="select_alias">
-    SELECT <include refid="columns_alias"/> FROM METER_BASE_HIS_TARE_DATA t
+    SELECT <include refid="columns_alias" /> FROM METER_BASE_HIS_TARE_DATA t
   </sql>
   <sql id="where">
-    <where>
+    <where> 
       <if test="dataNo != null and dataNo != ''">
         and DATA_NO = #{dataNo}
       </if>
@@ -76,10 +82,22 @@
       <if test="createTime != null">
         and TO_CHAR(CREATE_TIME,'yyyy-MM-dd') = #{createTime}
       </if>
+      <if test="updateManNo != null and updateManNo != ''">
+        and UPDATE_MAN_NO = #{updateManNo}
+      </if>
+      <if test="updateManName != null and updateManName != ''">
+        and UPDATE_MAN_NAME = #{updateManName}
+      </if>
+      <if test="updateTime != null">
+        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
+      </if>
+      <if test="note != null and note != ''">
+        and NOTE = #{note}
+      </if>
     </where>
   </sql>
   <sql id="whereLike">
-    <where>
+    <where> 
       <if test="dataNo != null and dataNo != ''">
         and DATA_NO LIKE '%${dataNo}%'
       </if>
@@ -122,6 +140,18 @@
       <if test="createTime != null">
         and TO_CHAR(CREATE_TIME,'yyyy-MM-dd') = #{createTime}
       </if>
+      <if test="updateManNo != null and updateManNo != ''">
+        and UPDATE_MAN_NO LIKE '%${updateManNo}%'
+      </if>
+      <if test="updateManName != null and updateManName != ''">
+        and UPDATE_MAN_NAME LIKE '%${updateManName}%'
+      </if>
+      <if test="updateTime != null">
+        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
+      </if>
+      <if test="note != null and note != ''">
+        and NOTE LIKE '%${note}%'
+      </if>
     </where>
   </sql>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
@@ -170,18 +200,34 @@
       <if test="createTime != null">
         or TO_CHAR(CREATE_TIME,'yyyy-MM-dd') = '#{createTime}'
       </if>
+      <if test="updateManNo != null and updateManNo != ''">
+        or UPDATE_MAN_NO = #{updateManNo}
+      </if>
+      <if test="updateManName != null and updateManName != ''">
+        or UPDATE_MAN_NAME = #{updateManName}
+      </if>
+      <if test="updateTime != null">
+        or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
+      </if>
+      <if test="note != null and note != ''">
+        or NOTE = #{note}
+      </if>
   </delete>
   <insert id="insert" parameterType="com.steerinfo.baseinfo.meterbasehistaredata.model.MeterBaseHisTareData">
     insert into METER_BASE_HIS_TARE_DATA (DATA_NO, BASE_SPOT_NO, BASE_SPOT_NAME, 
       CAR_NO, METER_WEIGHT, METER_NAME, 
       METER_TIME, UP_WEIGHT, AVG_WEIGHT, 
       METER_NUM, VALUE_FLAG, CREATE_MAN_NO, 
-      CREATE_MAN_NAME, CREATE_TIME)
+      CREATE_MAN_NAME, CREATE_TIME, UPDATE_MAN_NO, 
+      UPDATE_MAN_NAME, UPDATE_TIME, NOTE
+      )
     values (#{dataNo,jdbcType=VARCHAR}, #{baseSpotNo,jdbcType=VARCHAR}, #{baseSpotName,jdbcType=VARCHAR}, 
       #{carNo,jdbcType=VARCHAR}, #{meterWeight,jdbcType=DECIMAL}, #{meterName,jdbcType=VARCHAR}, 
       #{meterTime,jdbcType=TIMESTAMP}, #{upWeight,jdbcType=DECIMAL}, #{avgWeight,jdbcType=DECIMAL}, 
       #{meterNum,jdbcType=DECIMAL}, #{valueFlag,jdbcType=VARCHAR}, #{createManNo,jdbcType=VARCHAR}, 
-      #{createManName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP})
+      #{createManName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateManNo,jdbcType=VARCHAR}, 
+      #{updateManName,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{note,jdbcType=VARCHAR}
+      )
   </insert>
   <insert id="insertSelective" parameterType="com.steerinfo.baseinfo.meterbasehistaredata.model.MeterBaseHisTareData">
     insert into METER_BASE_HIS_TARE_DATA
@@ -228,6 +274,18 @@
       <if test="createTime != null">
         CREATE_TIME,
       </if>
+      <if test="updateManNo != null">
+        UPDATE_MAN_NO,
+      </if>
+      <if test="updateManName != null">
+        UPDATE_MAN_NAME,
+      </if>
+      <if test="updateTime != null">
+        UPDATE_TIME,
+      </if>
+      <if test="note != null">
+        NOTE,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="dataNo != null">
@@ -272,6 +330,18 @@
       <if test="createTime != null">
         #{createTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="updateManNo != null">
+        #{updateManNo,jdbcType=VARCHAR},
+      </if>
+      <if test="updateManName != null">
+        #{updateManName,jdbcType=VARCHAR},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="note != null">
+        #{note,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKey" parameterType="com.steerinfo.baseinfo.meterbasehistaredata.model.MeterBaseHisTareData">
@@ -288,7 +358,11 @@
       VALUE_FLAG = #{valueFlag,jdbcType=VARCHAR},
       CREATE_MAN_NO = #{createManNo,jdbcType=VARCHAR},
       CREATE_MAN_NAME = #{createManName,jdbcType=VARCHAR},
-      CREATE_TIME = #{createTime,jdbcType=TIMESTAMP}
+      CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
+      UPDATE_MAN_NO = #{updateManNo,jdbcType=VARCHAR},
+      UPDATE_MAN_NAME = #{updateManName,jdbcType=VARCHAR},
+      UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
+      NOTE = #{note,jdbcType=VARCHAR}
     where DATA_NO = #{dataNo,jdbcType=VARCHAR}
   </update>
   <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.baseinfo.meterbasehistaredata.model.MeterBaseHisTareData">
@@ -333,22 +407,32 @@
       <if test="createTime != null">
         CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="updateManNo != null">
+        UPDATE_MAN_NO = #{updateManNo,jdbcType=VARCHAR},
+      </if>
+      <if test="updateManName != null">
+        UPDATE_MAN_NAME = #{updateManName,jdbcType=VARCHAR},
+      </if>
+      <if test="updateTime != null">
+        UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="note != null">
+        NOTE = #{note,jdbcType=VARCHAR},
+      </if>
     </set>
     where DATA_NO = #{dataNo,jdbcType=VARCHAR}
   </update>
   <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
-    <include refid="select"/>
+    <include refid="select" />
     where DATA_NO = #{dataNo,jdbcType=VARCHAR}
   </select>
   <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    <include refid="select"/>
-    <include refid="where"/>
-    order by CREATE_TIME  desc
+    <include refid="select" />
+    <include refid="where" />
   </select>
   <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    <include refid="select"/>
-    <include refid="whereLike"/>
-    order by CREATE_TIME  desc
+    <include refid="select" />
+    <include refid="whereLike" />
   </select>
   <insert id="batchInsert" parameterType="java.util.List">
     insert into METER_BASE_HIS_TARE_DATA 
@@ -357,7 +441,8 @@
       METER_WEIGHT, METER_NAME, METER_TIME, 
       UP_WEIGHT, AVG_WEIGHT, METER_NUM, 
       VALUE_FLAG, CREATE_MAN_NO, CREATE_MAN_NAME, 
-      CREATE_TIME)
+      CREATE_TIME, UPDATE_MAN_NO, UPDATE_MAN_NAME, 
+      UPDATE_TIME, NOTE)
     ( <foreach collection="list" item="item" separator="union all"> 
    select  
       #{item.dataNo,jdbcType=VARCHAR}, 
@@ -365,84 +450,101 @@
       #{item.meterWeight,jdbcType=DECIMAL}, #{item.meterName,jdbcType=VARCHAR}, #{item.meterTime,jdbcType=TIMESTAMP}, 
       #{item.upWeight,jdbcType=DECIMAL}, #{item.avgWeight,jdbcType=DECIMAL}, #{item.meterNum,jdbcType=DECIMAL}, 
       #{item.valueFlag,jdbcType=VARCHAR}, #{item.createManNo,jdbcType=VARCHAR}, #{item.createManName,jdbcType=VARCHAR}, 
-      #{item.createTime,jdbcType=TIMESTAMP} from dual  
+      #{item.createTime,jdbcType=TIMESTAMP}, #{item.updateManNo,jdbcType=VARCHAR}, #{item.updateManName,jdbcType=VARCHAR}, 
+      #{item.updateTime,jdbcType=TIMESTAMP}, #{item.note,jdbcType=VARCHAR} from dual  
    </foreach> )
   </insert>
   <update id="batchUpdate" parameterType="java.util.List">
      update METER_BASE_HIS_TARE_DATA
      set
        DATA_NO=
-       <foreach collection="list" item="item" index="index" separator=" " open="case DATA_NO" close="end">
+       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
           when #{item.dataNo,jdbcType=VARCHAR} then #{item.dataNo,jdbcType=VARCHAR}
        </foreach>
        ,BASE_SPOT_NO=
-       <foreach collection="list" item="item" index="index" separator=" " open="case DATA_NO" close="end">
+       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
           when #{item.dataNo,jdbcType=VARCHAR} then #{item.baseSpotNo,jdbcType=VARCHAR}
        </foreach>
        ,BASE_SPOT_NAME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case DATA_NO" close="end">
+       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
           when #{item.dataNo,jdbcType=VARCHAR} then #{item.baseSpotName,jdbcType=VARCHAR}
        </foreach>
        ,CAR_NO=
-       <foreach collection="list" item="item" index="index" separator=" " open="case DATA_NO" close="end">
+       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
           when #{item.dataNo,jdbcType=VARCHAR} then #{item.carNo,jdbcType=VARCHAR}
        </foreach>
        ,METER_WEIGHT=
-       <foreach collection="list" item="item" index="index" separator=" " open="case DATA_NO" close="end">
+       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
           when #{item.dataNo,jdbcType=VARCHAR} then #{item.meterWeight,jdbcType=DECIMAL}
        </foreach>
        ,METER_NAME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case DATA_NO" close="end">
+       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
           when #{item.dataNo,jdbcType=VARCHAR} then #{item.meterName,jdbcType=VARCHAR}
        </foreach>
        ,METER_TIME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case DATA_NO" close="end">
+       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
           when #{item.dataNo,jdbcType=VARCHAR} then #{item.meterTime,jdbcType=TIMESTAMP}
        </foreach>
        ,UP_WEIGHT=
-       <foreach collection="list" item="item" index="index" separator=" " open="case DATA_NO" close="end">
+       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
           when #{item.dataNo,jdbcType=VARCHAR} then #{item.upWeight,jdbcType=DECIMAL}
        </foreach>
        ,AVG_WEIGHT=
-       <foreach collection="list" item="item" index="index" separator=" " open="case DATA_NO" close="end">
+       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
           when #{item.dataNo,jdbcType=VARCHAR} then #{item.avgWeight,jdbcType=DECIMAL}
        </foreach>
        ,METER_NUM=
-       <foreach collection="list" item="item" index="index" separator=" " open="case DATA_NO" close="end">
+       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
           when #{item.dataNo,jdbcType=VARCHAR} then #{item.meterNum,jdbcType=DECIMAL}
        </foreach>
        ,VALUE_FLAG=
-       <foreach collection="list" item="item" index="index" separator=" " open="case DATA_NO" close="end">
+       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
           when #{item.dataNo,jdbcType=VARCHAR} then #{item.valueFlag,jdbcType=VARCHAR}
        </foreach>
        ,CREATE_MAN_NO=
-       <foreach collection="list" item="item" index="index" separator=" " open="case DATA_NO" close="end">
+       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
           when #{item.dataNo,jdbcType=VARCHAR} then #{item.createManNo,jdbcType=VARCHAR}
        </foreach>
        ,CREATE_MAN_NAME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case DATA_NO" close="end">
+       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
           when #{item.dataNo,jdbcType=VARCHAR} then #{item.createManName,jdbcType=VARCHAR}
        </foreach>
        ,CREATE_TIME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case DATA_NO" close="end">
+       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
           when #{item.dataNo,jdbcType=VARCHAR} then #{item.createTime,jdbcType=TIMESTAMP}
        </foreach>
+       ,UPDATE_MAN_NO=
+       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
+          when #{item.dataNo,jdbcType=VARCHAR} then #{item.updateManNo,jdbcType=VARCHAR}
+       </foreach>
+       ,UPDATE_MAN_NAME=
+       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
+          when #{item.dataNo,jdbcType=VARCHAR} then #{item.updateManName,jdbcType=VARCHAR}
+       </foreach>
+       ,UPDATE_TIME=
+       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
+          when #{item.dataNo,jdbcType=VARCHAR} then #{item.updateTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,NOTE=
+       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
+          when #{item.dataNo,jdbcType=VARCHAR} then #{item.note,jdbcType=VARCHAR}
+       </foreach>
      where DATA_NO in 
-     <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
+     <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
     #{item.dataNo,jdbcType=VARCHAR}
      </foreach> 
   </update>
   <delete id="batchDelete" parameterType="java.util.List">
     delete from METER_BASE_HIS_TARE_DATA
     where DATA_NO in 
-    <foreach collection="list" item="id" open="(" close=")" separator=",">
+    <foreach close=")" collection="list" item="id" open="(" separator=",">
       #{id}
     </foreach>
   </delete>
   <!-- 友情提示!!!-->
-  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
   <select id="getNewID" parameterType="java.lang.String" resultType="java.lang.String">
     SELECT LPAD(NVL(MAX(TO_NUMBER(SUBSTR(DATA_NO, LENGTH(DATA_NO) - 3))),0) + 1,4,'0') DATA_NO
     FROM METER_BASE_HIS_TARE_DATA where instr(DATA_NO,#{afl,jdbcType=VARCHAR})>0
   </select>
+
 </mapper>

+ 80 - 17
src/main/java/com/steerinfo/baseinfo/meterbasehistaredata/model/MeterBaseHisTareData.java

@@ -1,14 +1,17 @@
 package com.steerinfo.baseinfo.meterbasehistaredata.model;
 
 import com.steerinfo.framework.model.IBasePO;
+import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
+
 import java.util.Date;
 
+@ApiModel(value="历史皮重数据维护表")
 public class MeterBaseHisTareData implements IBasePO<String> {
     /**
-     * 数据编号(DATA_NO,VARCHAR,20)
+     * 数据编号(YYYYMMDD+4位流水)(DATA_NO,VARCHAR,20)
      */
-    @ApiModelProperty(value="数据编号",required=true)
+    @ApiModelProperty(value="数据编号(YYYYMMDD+4位流水)",required=true)
     private String dataNo;
 
     /**
@@ -30,33 +33,33 @@ public class MeterBaseHisTareData implements IBasePO<String> {
     private String carNo;
 
     /**
-     * 皮重数据(METER_WEIGHT,DECIMAL,10)
+     * 皮重数据(KG)(METER_WEIGHT,DECIMAL,10)
      */
-    @ApiModelProperty(value="皮重数据",required=true)
+    @ApiModelProperty(value="皮重数据(KG)",required=true)
     private Long meterWeight;
 
     /**
      * 皮重计量员(METER_NAME,VARCHAR,20)
      */
-    @ApiModelProperty(value="皮重计量员",required=true)
+    @ApiModelProperty(value="皮重计量员",required=false)
     private String meterName;
 
     /**
-     * 皮重计量时间(METER_TIME,TIMESTAMP,7)
+     * 皮重计量时间(YYYY-MM-DD HH:mm:ss)(METER_TIME,TIMESTAMP,7)
      */
-    @ApiModelProperty(value="皮重计量时间",required=true)
+    @ApiModelProperty(value="皮重计量时间(YYYY-MM-DD HH:mm:ss)",required=true)
     private Date meterTime;
 
     /**
-     * 上一次皮重(UP_WEIGHT,DECIMAL,10)
+     * 上一次皮重(KG)(UP_WEIGHT,DECIMAL,10)
      */
-    @ApiModelProperty(value="上一次皮重",required=true)
+    @ApiModelProperty(value="上一次皮重(KG)",required=true)
     private Long upWeight;
 
     /**
-     * 平均皮重(AVG_WEIGHT,DECIMAL,10)
+     * 平均皮重((平均*次数+当前)/(次数+1))(AVG_WEIGHT,DECIMAL,10)
      */
-    @ApiModelProperty(value="平均皮重",required=true)
+    @ApiModelProperty(value="平均皮重((平均*次数+当前)/(次数+1))",required=true)
     private Long avgWeight;
 
     /**
@@ -66,29 +69,53 @@ public class MeterBaseHisTareData implements IBasePO<String> {
     private Long meterNum;
 
     /**
-     * 状态(VALUE_FLAG,VARCHAR,1)
+     * 状态(0:有效;1:无效)(VALUE_FLAG,VARCHAR,1)
      */
-    @ApiModelProperty(value="状态",required=true)
+    @ApiModelProperty(value="状态(0:有效;1:无效)",required=true)
     private String valueFlag;
 
     /**
      * 创建人编号(CREATE_MAN_NO,VARCHAR,20)
      */
-    @ApiModelProperty(value="创建人编号",required=true)
+    @ApiModelProperty(value="创建人编号",required=false)
     private String createManNo;
 
     /**
      * 创建人姓名(CREATE_MAN_NAME,VARCHAR,30)
      */
-    @ApiModelProperty(value="创建人姓名",required=true)
+    @ApiModelProperty(value="创建人姓名",required=false)
     private String createManName;
 
     /**
-     * 创建时间(CREATE_TIME,TIMESTAMP,7)
+     * 创建时间(YYYY-MM-DD HH:mm:SS)(CREATE_TIME,TIMESTAMP,7)
      */
-    @ApiModelProperty(value="创建时间",required=true)
+    @ApiModelProperty(value="创建时间(YYYY-MM-DD HH:mm:SS)",required=true)
     private Date createTime;
 
+    /**
+     * 修改人编号(UPDATE_MAN_NO,VARCHAR,20)
+     */
+    @ApiModelProperty(value="修改人编号",required=false)
+    private String updateManNo;
+
+    /**
+     * 修改人姓名(UPDATE_MAN_NAME,VARCHAR,30)
+     */
+    @ApiModelProperty(value="修改人姓名",required=false)
+    private String updateManName;
+
+    /**
+     * 修改时间(YYYY-MM-DD HH:mm:SS)(UPDATE_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="修改时间(YYYY-MM-DD HH:mm:SS)",required=false)
+    private Date updateTime;
+
+    /**
+     * 操作原因(NOTE,VARCHAR,255)
+     */
+    @ApiModelProperty(value="操作原因",required=false)
+    private String note;
+
     private static final long serialVersionUID = 1L;
 
     @Override
@@ -213,6 +240,38 @@ public class MeterBaseHisTareData implements IBasePO<String> {
         this.createTime = createTime;
     }
 
+    public String getUpdateManNo() {
+        return updateManNo;
+    }
+
+    public void setUpdateManNo(String updateManNo) {
+        this.updateManNo = updateManNo == null ? null : updateManNo.trim();
+    }
+
+    public String getUpdateManName() {
+        return updateManName;
+    }
+
+    public void setUpdateManName(String updateManName) {
+        this.updateManName = updateManName == null ? null : updateManName.trim();
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public String getNote() {
+        return note;
+    }
+
+    public void setNote(String note) {
+        this.note = note == null ? null : note.trim();
+    }
+
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
@@ -233,6 +292,10 @@ public class MeterBaseHisTareData implements IBasePO<String> {
         sb.append(", createManNo=").append(createManNo);
         sb.append(", createManName=").append(createManName);
         sb.append(", createTime=").append(createTime);
+        sb.append(", updateManNo=").append(updateManNo);
+        sb.append(", updateManName=").append(updateManName);
+        sb.append(", updateTime=").append(updateTime);
+        sb.append(", note=").append(note);
         sb.append(", serialVersionUID=").append(serialVersionUID);
         sb.append("]");
         return sb.toString();

+ 29 - 0
src/main/java/com/steerinfo/baseinfo/meterbasehistaredata/service/impl/MeterBaseHisTareDataServiceImpl.java

@@ -1,15 +1,20 @@
 package com.steerinfo.baseinfo.meterbasehistaredata.service.impl;
 
+import com.steerinfo.baseinfo.meterbaseoperationlog.mapper.MeterBaseOperationLogMapper;
+import com.steerinfo.baseinfo.meterbaseoperationlog.model.MeterBaseOperationLog;
 import com.steerinfo.framework.mapper.IBaseMapper;
 import com.steerinfo.framework.service.impl.BaseServiceImpl;
 import com.steerinfo.baseinfo.meterbasehistaredata.model.MeterBaseHisTareData;
 import com.steerinfo.baseinfo.meterbasehistaredata.mapper.MeterBaseHisTareDataMapper;
 import com.steerinfo.baseinfo.meterbasehistaredata.service.IMeterBaseHisTareDataService;
+import com.steerinfo.framework.user.UserPayload;
+import com.steerinfo.util.PublicMethod;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
 
 import javax.annotation.Resource;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 
@@ -32,6 +37,9 @@ public class MeterBaseHisTareDataServiceImpl extends BaseServiceImpl<MeterBaseHi
     @Resource
     private MeterBaseHisTareDataMapper meterBaseHisTareDataMapper;
 
+    @Resource
+    private MeterBaseOperationLogMapper meterBaseOperationLogMapper;
+
     @Override
     protected IBaseMapper<MeterBaseHisTareData, String> getMapper() {
         return meterBaseHisTareDataMapper;
@@ -64,9 +72,30 @@ public class MeterBaseHisTareDataServiceImpl extends BaseServiceImpl<MeterBaseHi
     public String abolish(MeterBaseHisTareData model)
     {
         try {
+
+            UserPayload payload = UserPayload.getCurrUser();
+            String userId = payload.getUserCode();
+            String userName = payload.getUserName();
+
             model.setId(model.getId());
             model.setValueFlag("1");
+            model.setUpdateManNo(userId);
+            model.setUpdateManName(userName);
+            model.setUpdateTime(new Date());
+            model.setNote(model.getNote());
             meterBaseHisTareDataMapper.updateByPrimaryKeySelective(model);
+
+            MeterBaseOperationLog logModel = new MeterBaseOperationLog();
+            logModel.setId(PublicMethod.IdCreate(2));
+            logModel.setCreateManNo(userId);
+            logModel.setCreateManName(userName);
+            logModel.setCreateTime(new Date());
+            logModel.setOperationPage("web端-历史皮重数据维护");
+            logModel.setOperationFunction("作废");
+            logModel.setOperationId(model.getId());
+            logModel.setOperationCarnNo(model.getCarNo());
+            logModel.setOperationBeforeFix(model.getNote());
+            meterBaseOperationLogMapper.insertSelective(logModel);
         } catch (Exception ex) {
             ex.printStackTrace();
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();

+ 110 - 7
src/main/java/com/steerinfo/baseinfo/meterbasetermtaredata/mapper/MeterBaseTermTareDataMapper.xml

@@ -21,16 +21,22 @@
     <result column="METER_WEIGHT" jdbcType="DECIMAL" property="meterWeight" />
     <result column="SPOT_AREA_NO" jdbcType="VARCHAR" property="spotAreaNo" />
     <result column="SPOT_AREA_NAME" jdbcType="VARCHAR" property="spotAreaName" />
+    <result column="UPDATE_MAN_NO" jdbcType="VARCHAR" property="updateManNo" />
+    <result column="UPDATE_MAN_NAME" jdbcType="VARCHAR" property="updateManName" />
+    <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
+    <result column="NOTE" jdbcType="VARCHAR" property="note" />
   </resultMap>
   <sql id="columns">
     DATA_NO, BASE_SPOT_NO, BASE_SPOT_NAME, CAR_NO, METER_NAME, METER_TIME, START_TIME, 
     END_TIME, WARN_TIME, UP_WEIGHT, AVG_WEIGHT, VALUE_FLAG, CREATE_MAN_NO, CREATE_MAN_NAME, 
-    CREATE_TIME, METER_NUM, METER_WEIGHT, SPOT_AREA_NO, SPOT_AREA_NAME
+    CREATE_TIME, METER_NUM, METER_WEIGHT, SPOT_AREA_NO, SPOT_AREA_NAME, UPDATE_MAN_NO, 
+    UPDATE_MAN_NAME, UPDATE_TIME, NOTE
   </sql>
   <sql id="columns_alias">
     t.DATA_NO, t.BASE_SPOT_NO, t.BASE_SPOT_NAME, t.CAR_NO, t.METER_NAME, t.METER_TIME, 
     t.START_TIME, t.END_TIME, t.WARN_TIME, t.UP_WEIGHT, t.AVG_WEIGHT, t.VALUE_FLAG, t.CREATE_MAN_NO, 
-    t.CREATE_MAN_NAME, t.CREATE_TIME, t.METER_NUM, t.METER_WEIGHT, t.SPOT_AREA_NO, t.SPOT_AREA_NAME
+    t.CREATE_MAN_NAME, t.CREATE_TIME, t.METER_NUM, t.METER_WEIGHT, t.SPOT_AREA_NO, t.SPOT_AREA_NAME, 
+    t.UPDATE_MAN_NO, t.UPDATE_MAN_NAME, t.UPDATE_TIME, t.NOTE
   </sql>
   <sql id="select">
     SELECT <include refid="columns" /> FROM METER_BASE_TERM_TARE_DATA
@@ -97,6 +103,18 @@
       <if test="spotAreaName != null and spotAreaName != ''">
         and SPOT_AREA_NAME = #{spotAreaName}
       </if>
+      <if test="updateManNo != null and updateManNo != ''">
+        and UPDATE_MAN_NO = #{updateManNo}
+      </if>
+      <if test="updateManName != null and updateManName != ''">
+        and UPDATE_MAN_NAME = #{updateManName}
+      </if>
+      <if test="updateTime != null">
+        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
+      </if>
+      <if test="note != null and note != ''">
+        and NOTE = #{note}
+      </if>
     </where>
   </sql>
   <sql id="whereLike">
@@ -158,6 +176,18 @@
       <if test="spotAreaName != null and spotAreaName != ''">
         and SPOT_AREA_NAME LIKE '%${spotAreaName}%'
       </if>
+      <if test="updateManNo != null and updateManNo != ''">
+        and UPDATE_MAN_NO LIKE '%${updateManNo}%'
+      </if>
+      <if test="updateManName != null and updateManName != ''">
+        and UPDATE_MAN_NAME LIKE '%${updateManName}%'
+      </if>
+      <if test="updateTime != null">
+        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
+      </if>
+      <if test="note != null and note != ''">
+        and NOTE LIKE '%${note}%'
+      </if>
     </where>
   </sql>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
@@ -221,6 +251,18 @@
       <if test="spotAreaName != null and spotAreaName != ''">
         or SPOT_AREA_NAME = #{spotAreaName}
       </if>
+      <if test="updateManNo != null and updateManNo != ''">
+        or UPDATE_MAN_NO = #{updateManNo}
+      </if>
+      <if test="updateManName != null and updateManName != ''">
+        or UPDATE_MAN_NAME = #{updateManName}
+      </if>
+      <if test="updateTime != null">
+        or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
+      </if>
+      <if test="note != null and note != ''">
+        or NOTE = #{note}
+      </if>
   </delete>
   <insert id="insert" parameterType="com.steerinfo.baseinfo.meterbasetermtaredata.model.MeterBaseTermTareData">
     insert into METER_BASE_TERM_TARE_DATA (DATA_NO, BASE_SPOT_NO, BASE_SPOT_NAME, 
@@ -229,14 +271,16 @@
       UP_WEIGHT, AVG_WEIGHT, VALUE_FLAG, 
       CREATE_MAN_NO, CREATE_MAN_NAME, CREATE_TIME, 
       METER_NUM, METER_WEIGHT, SPOT_AREA_NO, 
-      SPOT_AREA_NAME)
+      SPOT_AREA_NAME, UPDATE_MAN_NO, UPDATE_MAN_NAME, 
+      UPDATE_TIME, NOTE)
     values (#{dataNo,jdbcType=VARCHAR}, #{baseSpotNo,jdbcType=VARCHAR}, #{baseSpotName,jdbcType=VARCHAR}, 
       #{carNo,jdbcType=VARCHAR}, #{meterName,jdbcType=VARCHAR}, #{meterTime,jdbcType=TIMESTAMP}, 
       #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, #{warnTime,jdbcType=TIMESTAMP}, 
       #{upWeight,jdbcType=DECIMAL}, #{avgWeight,jdbcType=DECIMAL}, #{valueFlag,jdbcType=VARCHAR}, 
       #{createManNo,jdbcType=VARCHAR}, #{createManName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
       #{meterNum,jdbcType=DECIMAL}, #{meterWeight,jdbcType=DECIMAL}, #{spotAreaNo,jdbcType=VARCHAR}, 
-      #{spotAreaName,jdbcType=VARCHAR})
+      #{spotAreaName,jdbcType=VARCHAR}, #{updateManNo,jdbcType=VARCHAR}, #{updateManName,jdbcType=VARCHAR}, 
+      #{updateTime,jdbcType=TIMESTAMP}, #{note,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.steerinfo.baseinfo.meterbasetermtaredata.model.MeterBaseTermTareData">
     insert into METER_BASE_TERM_TARE_DATA
@@ -298,6 +342,18 @@
       <if test="spotAreaName != null">
         SPOT_AREA_NAME,
       </if>
+      <if test="updateManNo != null">
+        UPDATE_MAN_NO,
+      </if>
+      <if test="updateManName != null">
+        UPDATE_MAN_NAME,
+      </if>
+      <if test="updateTime != null">
+        UPDATE_TIME,
+      </if>
+      <if test="note != null">
+        NOTE,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="dataNo != null">
@@ -357,6 +413,18 @@
       <if test="spotAreaName != null">
         #{spotAreaName,jdbcType=VARCHAR},
       </if>
+      <if test="updateManNo != null">
+        #{updateManNo,jdbcType=VARCHAR},
+      </if>
+      <if test="updateManName != null">
+        #{updateManName,jdbcType=VARCHAR},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="note != null">
+        #{note,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKey" parameterType="com.steerinfo.baseinfo.meterbasetermtaredata.model.MeterBaseTermTareData">
@@ -378,7 +446,11 @@
       METER_NUM = #{meterNum,jdbcType=DECIMAL},
       METER_WEIGHT = #{meterWeight,jdbcType=DECIMAL},
       SPOT_AREA_NO = #{spotAreaNo,jdbcType=VARCHAR},
-      SPOT_AREA_NAME = #{spotAreaName,jdbcType=VARCHAR}
+      SPOT_AREA_NAME = #{spotAreaName,jdbcType=VARCHAR},
+      UPDATE_MAN_NO = #{updateManNo,jdbcType=VARCHAR},
+      UPDATE_MAN_NAME = #{updateManName,jdbcType=VARCHAR},
+      UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
+      NOTE = #{note,jdbcType=VARCHAR}
     where DATA_NO = #{dataNo,jdbcType=VARCHAR}
   </update>
   <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.baseinfo.meterbasetermtaredata.model.MeterBaseTermTareData">
@@ -438,6 +510,18 @@
       <if test="spotAreaName != null">
         SPOT_AREA_NAME = #{spotAreaName,jdbcType=VARCHAR},
       </if>
+      <if test="updateManNo != null">
+        UPDATE_MAN_NO = #{updateManNo,jdbcType=VARCHAR},
+      </if>
+      <if test="updateManName != null">
+        UPDATE_MAN_NAME = #{updateManName,jdbcType=VARCHAR},
+      </if>
+      <if test="updateTime != null">
+        UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="note != null">
+        NOTE = #{note,jdbcType=VARCHAR},
+      </if>
     </set>
     where DATA_NO = #{dataNo,jdbcType=VARCHAR}
   </update>
@@ -462,7 +546,8 @@
       AVG_WEIGHT, VALUE_FLAG, CREATE_MAN_NO, 
       CREATE_MAN_NAME, CREATE_TIME, 
       METER_NUM, METER_WEIGHT, SPOT_AREA_NO, 
-      SPOT_AREA_NAME)
+      SPOT_AREA_NAME, UPDATE_MAN_NO, UPDATE_MAN_NAME, 
+      UPDATE_TIME, NOTE)
     ( <foreach collection="list" item="item" separator="union all"> 
    select  
       #{item.dataNo,jdbcType=VARCHAR}, 
@@ -472,7 +557,8 @@
       #{item.avgWeight,jdbcType=DECIMAL}, #{item.valueFlag,jdbcType=VARCHAR}, #{item.createManNo,jdbcType=VARCHAR}, 
       #{item.createManName,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP}, 
       #{item.meterNum,jdbcType=DECIMAL}, #{item.meterWeight,jdbcType=DECIMAL}, #{item.spotAreaNo,jdbcType=VARCHAR}, 
-      #{item.spotAreaName,jdbcType=VARCHAR} from dual  
+      #{item.spotAreaName,jdbcType=VARCHAR}, #{item.updateManNo,jdbcType=VARCHAR}, #{item.updateManName,jdbcType=VARCHAR}, 
+      #{item.updateTime,jdbcType=TIMESTAMP}, #{item.note,jdbcType=VARCHAR} from dual  
    </foreach> )
   </insert>
   <update id="batchUpdate" parameterType="java.util.List">
@@ -554,6 +640,22 @@
        <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
           when #{item.dataNo,jdbcType=VARCHAR} then #{item.spotAreaName,jdbcType=VARCHAR}
        </foreach>
+       ,UPDATE_MAN_NO=
+       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
+          when #{item.dataNo,jdbcType=VARCHAR} then #{item.updateManNo,jdbcType=VARCHAR}
+       </foreach>
+       ,UPDATE_MAN_NAME=
+       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
+          when #{item.dataNo,jdbcType=VARCHAR} then #{item.updateManName,jdbcType=VARCHAR}
+       </foreach>
+       ,UPDATE_TIME=
+       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
+          when #{item.dataNo,jdbcType=VARCHAR} then #{item.updateTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,NOTE=
+       <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
+          when #{item.dataNo,jdbcType=VARCHAR} then #{item.note,jdbcType=VARCHAR}
+       </foreach>
      where DATA_NO in 
      <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
     #{item.dataNo,jdbcType=VARCHAR}
@@ -568,6 +670,7 @@
   </delete>
   <!-- 友情提示!!!-->
   <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+
   <select id="getNewID" parameterType="java.lang.String" resultType="java.lang.String">
     SELECT LPAD(NVL(MAX(TO_NUMBER(SUBSTR(DATA_NO, LENGTH(DATA_NO) -2))),0) + 1,3,'0') DATA_NO
     FROM METER_BASE_TERM_TARE_DATA where instr(DATA_NO,#{createTime,jdbcType=VARCHAR})>0

+ 60 - 0
src/main/java/com/steerinfo/baseinfo/meterbasetermtaredata/model/MeterBaseTermTareData.java

@@ -123,6 +123,30 @@ public class MeterBaseTermTareData implements IBasePO<String> {
     @ApiModelProperty(value="计量点所属区域名称",required=false)
     private String spotAreaName;
 
+    /**
+     * 修改人编号(UPDATE_MAN_NO,VARCHAR,20)
+     */
+    @ApiModelProperty(value="修改人编号",required=false)
+    private String updateManNo;
+
+    /**
+     * 修改人姓名(UPDATE_MAN_NAME,VARCHAR,30)
+     */
+    @ApiModelProperty(value="修改人姓名",required=false)
+    private String updateManName;
+
+    /**
+     * 修改时间(YYYY-MM-DD HH:mm:SS)(UPDATE_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="修改时间(YYYY-MM-DD HH:mm:SS)",required=false)
+    private Date updateTime;
+
+    /**
+     * 操作原因(NOTE,VARCHAR,255)
+     */
+    @ApiModelProperty(value="操作原因",required=false)
+    private String note;
+
     private static final long serialVersionUID = 1L;
 
     @Override
@@ -287,6 +311,38 @@ public class MeterBaseTermTareData implements IBasePO<String> {
         this.spotAreaName = spotAreaName == null ? null : spotAreaName.trim();
     }
 
+    public String getUpdateManNo() {
+        return updateManNo;
+    }
+
+    public void setUpdateManNo(String updateManNo) {
+        this.updateManNo = updateManNo == null ? null : updateManNo.trim();
+    }
+
+    public String getUpdateManName() {
+        return updateManName;
+    }
+
+    public void setUpdateManName(String updateManName) {
+        this.updateManName = updateManName == null ? null : updateManName.trim();
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public String getNote() {
+        return note;
+    }
+
+    public void setNote(String note) {
+        this.note = note == null ? null : note.trim();
+    }
+
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
@@ -312,6 +368,10 @@ public class MeterBaseTermTareData implements IBasePO<String> {
         sb.append(", meterWeight=").append(meterWeight);
         sb.append(", spotAreaNo=").append(spotAreaNo);
         sb.append(", spotAreaName=").append(spotAreaName);
+        sb.append(", updateManNo=").append(updateManNo);
+        sb.append(", updateManName=").append(updateManName);
+        sb.append(", updateTime=").append(updateTime);
+        sb.append(", note=").append(note);
         sb.append(", serialVersionUID=").append(serialVersionUID);
         sb.append("]");
         return sb.toString();

+ 22 - 1
src/main/java/com/steerinfo/baseinfo/meterbasetermtaredata/service/impl/MeterBaseTermTareDataServiceImpl.java

@@ -35,6 +35,7 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
 
 import javax.annotation.Resource;
+import javax.validation.Payload;
 import java.math.BigDecimal;
 import java.text.SimpleDateFormat;
 import java.util.*;
@@ -125,9 +126,29 @@ public class MeterBaseTermTareDataServiceImpl extends BaseServiceImpl<MeterBaseT
     @Override
     public String abolish(MeterBaseTermTareData model) {
         try {
+            UserPayload payload = UserPayload.getCurrUser();
+            String userId = payload.getUserCode();
+            String userName = payload.getUserName();
+
             model.setId(model.getId());
             model.setValueFlag("1");
-            meterBaseTermTareDataMapper.updateByPrimaryKey(model);
+            model.setUpdateManNo(userId);
+            model.setUpdateManName(userName);
+            model.setUpdateTime(new Date());
+            model.setNote(model.getNote());
+            meterBaseTermTareDataMapper.updateByPrimaryKeySelective(model);
+
+            MeterBaseOperationLog logModel = new MeterBaseOperationLog();
+            logModel.setId(PublicMethod.IdCreate(2));
+            logModel.setCreateManNo(userId);
+            logModel.setCreateManName(userName);
+            logModel.setCreateTime(new Date());
+            logModel.setOperationPage("web端-期限皮重数据维护");
+            logModel.setOperationFunction("作废");
+            logModel.setOperationId(model.getId());
+            logModel.setOperationCarnNo(model.getCarNo());
+            logModel.setOperationBeforeFix(model.getNote());
+            meterBaseOperationLogMapper.insertSelective(logModel);
         } catch (Exception ex) {
             ex.printStackTrace();
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();

+ 55 - 0
src/main/java/com/steerinfo/meterwork/meterworkcaractual/controller/MeterWorkCarActualController.java

@@ -10,6 +10,7 @@ import com.steerinfo.framework.service.pagehelper.PageList;
 import com.steerinfo.framework.utils.collection.ListUtils;
 import com.steerinfo.metermonitor.metermonitornote.model.MeterMonitorNote;
 import com.steerinfo.meterwork.dto.CommonCombination;
+import com.steerinfo.meterwork.dto.MeterWorkCarActualFirstDto;
 import com.steerinfo.meterwork.except.MarkerMetException;
 import com.steerinfo.meterwork.metertolimsold.mapper.MeterToLimsOldMapper;
 import com.steerinfo.meterwork.meterworkcaractual.mapper.MeterWorkCarActualMapper;
@@ -1028,4 +1029,58 @@ throw new MarkerMetException(500, "操作异常!!");
             throw new MarkerMetException(500, "操作异常!!");
         }
     }
+
+    @ApiOperation(value = "本地计量-普通委托解除结净", notes = "将结净后的数据进行还原;关键词:updateManNo、updateManName、actualNo")
+    @PostMapping(value = "/localCommonRemove")
+    public RESTfulResult localCommonRemove(@RequestBody HashMap params) {
+        RESTfulResult rm = failed();
+        try {
+            rm = meterWorkCarActualService.localCommonRemove(params);
+        } catch (MarkerMetException e) {
+            e.printStackTrace();
+            rm.setMessage(e.getMessage());
+        } catch (Exception e) {
+            e.printStackTrace();
+            rm.setMessage("操作异常,请确认!");
+        }
+        return rm;
+    }
+
+    @ApiOperation(value = "本地计量-匹配委托", notes = "将结净后的数据进行还原;关键词:updateManNo、updateManName、actualNo、predictionNo、note")
+    @PostMapping(value = "/localMatchPrediction")
+    public RESTfulResult localMatchPrediction(@RequestBody MeterWorkCarActual model) {
+        RESTfulResult rm = failed();
+        try {
+            rm = meterWorkCarActualService.localMatchPrediction(model.getActualNo(), model.getPredictionNo(), model.getUpdateManNo(), model.getPredictionNo(), model.getNote());
+            return rm;
+        } catch (MarkerMetException e) {
+            e.printStackTrace();
+            rm.setMessage(e.getMessage());
+        } catch (Exception e) {
+            e.printStackTrace();
+            rm.setMessage("操作异常,请确认!");
+        } finally {
+
+        }
+        return rm;
+    }
+
+    @ApiOperation(value = "本地计量-解除委托", notes = "将结净后的数据进行还原;关键词:updateManNo、updateManName、actualNo")
+    @PostMapping(value = "/localRemovePrediction")
+    public RESTfulResult localRemovePrediction(@RequestBody MeterWorkCarActual model) {
+        RESTfulResult rm = failed();
+        try {
+            MeterWorkCarActual mwca = meterWorkCarActualService.localRemovePrediction(model);
+            return success(mwca);
+        } catch (MarkerMetException e) {
+            e.printStackTrace();
+            rm.setMessage(e.getMessage());
+        } catch (Exception e) {
+            e.printStackTrace();
+            rm.setMessage("操作异常,请确认!");
+        } finally {
+
+        }
+        return rm;
+    }
 }

+ 3 - 0
src/main/java/com/steerinfo/meterwork/meterworkcaractual/service/IMeterWorkCarActualService.java

@@ -53,8 +53,10 @@ public interface IMeterWorkCarActualService extends IBaseService<MeterWorkCarAct
     int manualInput (MeterWorkCarActual model);
 
     RESTfulResult matchPrediction(String actualNo, String predictionNo, String note);
+    RESTfulResult localMatchPrediction(String actualNo, String predictionNo,String updateManNo, String updateManName, String note);
 
     MeterWorkCarActual cleanPrediction(MeterWorkCarActual model);
+    MeterWorkCarActual localRemovePrediction(MeterWorkCarActual model);
 
     PageList<MeterWorkCarActual> selectView(Map<Objects,String> parmas,Integer pageNum, Integer pageSize);
 
@@ -66,6 +68,7 @@ public interface IMeterWorkCarActualService extends IBaseService<MeterWorkCarAct
 
     RESTfulResult specialRemove(HashMap map);
     RESTfulResult commonRemove(HashMap map);
+    RESTfulResult localCommonRemove(HashMap map);
 
     MeterWorkCarActual termclean(String actualFirstNo, String dataNo);
 

+ 363 - 2
src/main/java/com/steerinfo/meterwork/meterworkcaractual/service/impl/MeterWorkCarActualServiceImpl.java

@@ -1167,6 +1167,141 @@ public class MeterWorkCarActualServiceImpl extends BaseServiceImpl<MeterWorkCarA
         return rm;
     }
 
+    @Override
+    public RESTfulResult localCommonRemove(HashMap params) {
+        RESTfulResult rm = new RESTfulResult();
+        rm.setFailed();
+        rm.setData(null);
+        rm.setCode("500");
+        try{
+            MeterWorkCarActual actualModel = meterWorkCarActualMapper.selectByPrimaryKey(params.get("actualNo").toString());
+            if(actualModel == null){
+                rm.setMessage("未找到结净计量数据,请确认!!!");
+                return rm;
+            }
+            List<MeterWorkCarActual> models = new ArrayList<MeterWorkCarActual>();
+            models.add(actualModel);
+            for(MeterWorkCarActual modelTemp: models) {
+                if(modelTemp.getPredictionNo() != null && StringUtils.isNotEmpty(modelTemp.getPredictionNo())){
+                    PreTrackScale scaleTemp = preTrackScaleMapper.selectByPrimaryKey(modelTemp.getPredictionNo());
+                    if(scaleTemp.getValueFlag().equals("9")) {
+                        rm.setMessage("结净数据中包含已结算的委托!!!");
+                        return rm;
+                    }
+//                    if(scaleTemp.getPredictionType().equals("5") || scaleTemp.getPredictionType().equals("6") || scaleTemp.getPredictionType().equals("7")){
+//                        rm.setMessage("结净数据中包含特殊委托匹配结净的数据!!!");
+//                        return rm;
+//                    }
+                }
+            }
+            String userId = params.get("updateManNo") != null ? params.get("updateManNo").toString(): "";
+            String userName = params.get("updateManName") != null ? params.get("updateManName").toString(): "";
+
+            for (MeterWorkCarActual model: models) {
+                //循环每一个结净记录
+                //委托不能为空
+                // 改委托
+                PreTrackScale scale = new PreTrackScale();
+                if (StringUtils.isNotEmpty(model.getPredictionNo())) {
+                    scale = preTrackScaleMapper.selectByPrimaryKey(model.getPredictionNo());
+                    scale.setValueFlag("1");
+                    scale.setUploadFlag("1");
+                    scale.setUpdateTime(new Date());
+                    scale.setUpdateManNo(userId);
+                    scale.setUpdateManName(userName);
+                    preTrackScaleMapper.updateByPrimaryKeySelective(scale);
+                }else {
+                    if(StringUtils.isNotEmpty(model.getActualFirst1No())) {
+                        MeterWorkCarActualFirst gross = meterWorkCarActualFirstMapper.selectByPrimaryKey(model.getActualFirst1No());
+                        if(StringUtils.isNotEmpty(gross.getPredictionNo())) {
+                            scale = preTrackScaleMapper.selectByPrimaryKey(gross.getPredictionNo());
+                            scale.setValueFlag("1");
+                            scale.setUploadFlag("1");
+                            scale.setUpdateTime(new Date());
+                            scale.setUpdateManNo(userId);
+                            scale.setUpdateManName(userName);
+                            preTrackScaleMapper.updateByPrimaryKeySelective(scale);
+                        }
+                    }
+                    if(StringUtils.isNotEmpty(model.getActualFirst2No())) {
+                        MeterWorkCarActualFirst tare = meterWorkCarActualFirstMapper.selectByPrimaryKey(model.getActualFirst2No());
+                        if(StringUtils.isNotEmpty(tare.getPredictionNo())) {
+                            scale = preTrackScaleMapper.selectByPrimaryKey(tare.getPredictionNo());
+                            scale.setValueFlag("1");
+                            scale.setUploadFlag("1");
+                            scale.setUpdateTime(new Date());
+                            scale.setUpdateManNo(userId);
+                            scale.setUpdateManName(userName);
+                            preTrackScaleMapper.updateByPrimaryKeySelective(scale);
+                        }
+                    }
+                }
+                // 清空一次毛重、皮重委托信息
+                MeterWorkCarActualFirst firstGross;
+                MeterWorkCarActualFirst firstTare;
+                if(StringUtils.isNotEmpty(model.getActualFirst1No())&&StringUtils.isNotEmpty(model.getActualFirst2No())){
+                    firstGross = meterWorkCarActualFirstMapper.selectAndRemove(model.getActualFirst1No());
+                    firstTare =  meterWorkCarActualFirstMapper.selectAndRemove(model.getActualFirst2No());
+                }else{
+                    firstGross = meterWorkCarActualFirstMapper.selectByPrimaryKey(model.getActualFirst1No());
+                    firstTare = meterWorkCarActualFirstMapper.selectByPrimaryKey(model.getActualFirst2No());
+                }
+                if(firstGross != null){
+                    firstGross.setValueFlag(DbConstants.VALID);
+                    firstGross.setUpdateManNo(userId);
+                    firstGross.setUpdateManName(userName);
+                    firstGross.setNote(model.getNote());
+                    firstGross.setUpdateTime(new Date());
+                    firstGross.setIsPreScale("0");
+                    firstGross.setValueFlag("0");
+                    meterWorkCarActualFirstMapper.updateByPrimaryKey(firstGross);
+                }
+                if(firstTare != null){
+                    firstTare.setValueFlag(DbConstants.VALID);
+                    firstTare.setUpdateManNo(userId);
+                    firstTare.setUpdateManName(userName);
+                    firstTare.setNote(model.getNote());
+                    firstTare.setUpdateTime(new Date());
+                    firstTare.setIsPreScale("0");
+                    firstTare.setValueFlag("0");
+                    meterWorkCarActualFirstMapper.updateByPrimaryKey(firstTare);
+                }
+                // 作废结净
+                MeterWorkCarActual modelTemp = meterWorkCarActualMapper.cleanPredcition(model.getActualNo());
+                modelTemp.setUploadFlag("1");
+                modelTemp.setValueFlag("0");
+                modelTemp.setIsPreScale("0");
+                modelTemp.setUpdateManNo(userId);
+                modelTemp.setUpdateManName(userName);
+                modelTemp.setUpdateTime(new Date());
+                meterWorkCarActualMapper.updateByPrimaryKey(modelTemp);
+                //删结净
+                //meterWorkCarActualMapper.deleteByPrimaryKey(model.getActualNo());
+
+                MeterBaseOperationLog logModel = new MeterBaseOperationLog();
+                logModel.setId(PublicMethod.IdCreate(2));
+                logModel.setCreateManNo(userId);
+                logModel.setCreateManName(userName);
+                logModel.setCreateTime(new Date());
+                logModel.setOperationPage("C#端-本地计量结净数据维护");
+                logModel.setOperationFunction("结净废除");
+                logModel.setOperationId(model.getActualNo());
+                logModel.setOperationPredictionNo(model.getPredictionNo());
+                logModel.setOperationCarnNo(model.getCarNo());
+                logModel.setOperationBeforeFix(model.toString());
+                logModel.setOperationAfterFix(modelTemp.toString());
+                meterBaseOperationLogMapper.insertSelective(logModel);
+            }
+            rm.setSucceed();
+            rm.setMessage("操作成功!!");
+            rm.setCode("200");
+        }catch(Exception e){
+            e.printStackTrace();
+            rm.setMessage("操作异常,请确认!>>>" + e.getMessage());
+        }
+        return rm;
+    }
+
     @Override
     @Transactional(rollbackFor = Exception.class)
     public int manualInput (MeterWorkCarActual model) {
@@ -1380,14 +1515,14 @@ public class MeterWorkCarActualServiceImpl extends BaseServiceImpl<MeterWorkCarA
             // 毛重
             MeterWorkCarActualFirst grossrow = meterWorkCarActualFirstMapper.selectAndMatch(model.getActualFirst1No(), predictionNo);
             grossrow.setUpdateTime(new Date());
-            grossrow.setUpdateManName(userName + ": 结净数据匹配委托操作");
+            grossrow.setUpdateManName(userName);
             grossrow.setUpdateManNo(userId);
             grossrow.setIsPreScale("1");
             meterWorkCarActualFirstMapper.updateByPrimaryKey(grossrow);
             // 皮重
             MeterWorkCarActualFirst tarerow = meterWorkCarActualFirstMapper.selectAndMatch(model.getActualFirst2No(), predictionNo);
             tarerow.setUpdateTime(new Date());
-            tarerow.setUpdateManName(userName + ": 结净数据匹配委托操作");
+            tarerow.setUpdateManName(userName);
             tarerow.setUpdateManNo(userId);
             tarerow.setIsPreScale("1");
             meterWorkCarActualFirstMapper.updateByPrimaryKey(tarerow);
@@ -1443,6 +1578,130 @@ public class MeterWorkCarActualServiceImpl extends BaseServiceImpl<MeterWorkCarA
         return rm;
     }
 
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public RESTfulResult localMatchPrediction(String actualNo, String predictionNo,String updateManNo, String updateManName, String note) {
+        RESTfulResult rm = new RESTfulResult();
+        rm.setFailed();
+        rm.setCode("500");
+        try{
+            if (com.steerinfo.util.StringUtils.isEmpty(actualNo)) {
+                rm.setMessage("结净数据主键不能为空,请确认!!");
+                return rm;
+            }
+            if (com.steerinfo.util.StringUtils.isEmpty(predictionNo)) {
+                rm.setMessage("预报编号不能为空,请确认!!");
+                return rm;
+            }
+
+            MeterWorkCarActual model = meterWorkCarActualMapper.selectByPrimaryKey(actualNo);
+            PreTrackScale scale = preTrackScaleMapper.selectByPrimaryKey(predictionNo);
+            if(model == null) {
+                rm.setMessage("不存在对应的结净数据,请确认!!");
+                return rm;
+            }else if(!model.getIsPreScale().equals("0")) {
+                rm.setMessage("只有未匹配的净重数据才能进行委托匹配操作");
+                return rm;
+            }
+            SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            if(model.getUpdateTime() != null && StringUtils.isNotEmpty(model.getUpdateTime().toString())) {
+                String sDate = df.format(model.getUpdateTime());
+                String eDate = df.format(new Date());
+                long sTime = df.parse(sDate).getTime();
+                long eTime = df.parse(eDate).getTime();
+                long diff = (eTime - sTime) / 1000;
+                if(diff <= 15) {
+                    rm.setMessage("匹配委托需在解除委托15秒后进行,请稍等");
+                    return rm;
+                }
+            }
+            if(scale == null) {
+                rm.setMessage("不存在对应的预报数据,请确认!!");
+                return rm;
+            }else {
+                if(scale.getValueFlag().equals("2")) {
+                    rm.setMessage("只有未使用的委托才能进行匹配委托操作,请确认!!");
+                    return rm;
+                }
+                if (!model.getCarNo().equals(scale.getCarNo())) {
+                    rm.setMessage("结净数据中车号和预报中车号不一致,请确认!!");
+                    return rm;
+                }
+//                if (!scale.getPredictionType().equals("1")) {
+//                    rm.setMessage("委托信息不是普通委托不能进行匹配委托,请确认!!");
+//                    return rm;
+//                }
+            }
+            String userId = updateManNo;
+            String userName = updateManName;
+
+            // 处理一次计量数据
+            // 毛重
+            MeterWorkCarActualFirst grossrow = meterWorkCarActualFirstMapper.selectAndMatch(model.getActualFirst1No(), predictionNo);
+            grossrow.setUpdateTime(new Date());
+            grossrow.setUpdateManName(userName);
+            grossrow.setUpdateManNo(userId);
+            grossrow.setIsPreScale("1");
+            meterWorkCarActualFirstMapper.updateByPrimaryKey(grossrow);
+            // 皮重
+            MeterWorkCarActualFirst tarerow = meterWorkCarActualFirstMapper.selectAndMatch(model.getActualFirst2No(), predictionNo);
+            tarerow.setUpdateTime(new Date());
+            tarerow.setUpdateManName(userName);
+            tarerow.setUpdateManNo(userId);
+            tarerow.setIsPreScale("1");
+            meterWorkCarActualFirstMapper.updateByPrimaryKey(tarerow);
+
+            MeterWorkCarActual mwca = meterWorkCarActualMapper.mathPredcition(actualNo, predictionNo);
+            mwca.setPredictionType("1");
+            mwca.setCreateManName(userName);
+            mwca.setCreateTime(new Date());
+            mwca.setUpdateManNo(userId);
+            mwca.setUpdateManName(userName);
+            mwca.setUpdateTime(new Date());
+            mwca.setNote("匹配委托");
+            mwca.setIsPreScale("1");
+            mwca.setValueFlag("1");
+            mwca.setUploadFlag("1");
+            meterWorkCarActualMapper.updateByPrimaryKey(mwca);
+
+            // 处理预报
+            if (scale != null) {
+                scale.setValueFlag("2");
+                scale.setUploadFlag("1");
+                scale.setPredictionType("1");
+                scale.setUpdateTime(new Date());
+                scale.setUpdateManNo("system");
+                scale.setUpdateManName("计量结净数据匹配委托操作");
+                scale.setMeasureStation(mwca.getNetSpot3No());
+                scale.setMeasureStationName(mwca.getNetSpot3Name());
+                preTrackScaleMapper.updateByPrimaryKeySelective(scale);
+            }
+
+            MeterBaseOperationLog logModel = new MeterBaseOperationLog();
+            logModel.setId(PublicMethod.IdCreate(2));
+            logModel.setCreateManNo(userId);
+            logModel.setCreateManName(userName);
+            logModel.setCreateTime(new Date());
+            logModel.setOperationPage("C#端-本地计量结净数据维护");
+            logModel.setOperationFunction("匹配委托");
+            logModel.setOperationId(model.getActualNo());
+            logModel.setOperationPredictionNo(predictionNo);
+            logModel.setOperationCarnNo(model.getCarNo());
+            logModel.setOperationBeforeFix(model.toString());
+            logModel.setOperationAfterFix(mwca.toString());
+            meterBaseOperationLogMapper.insertSelective(logModel);
+
+            rm.setSucceed();
+            rm.setCode("200");
+            rm.setData(mwca);
+            rm.setMessage("操作成功!!");
+        }catch(Exception e) {
+            e.printStackTrace();
+            rm.setMessage("操作异常!!");
+        }
+        return rm;
+    }
+
     @Override
     @Transactional(rollbackFor = Exception.class)
     public MeterWorkCarActual cleanPrediction (MeterWorkCarActual model) throws MarkerMetException {
@@ -1544,6 +1803,108 @@ public class MeterWorkCarActualServiceImpl extends BaseServiceImpl<MeterWorkCarA
         meterBaseOperationLogMapper.insertSelective(logModel);
         return mwca;
     }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public MeterWorkCarActual localRemovePrediction(MeterWorkCarActual model) throws MarkerMetException {
+        if (model.getActualNo() == null || "".equals(model.getActualNo())) {
+            throw new MarkerMetException(500, "结净数据主键不能为空");
+        }
+        if (!model.getValueFlag().equals("1") && model.getPredictionNo() != null && !"".equals(model.getPredictionNo())) {
+            throw new MarkerMetException(500, "只有有效已匹配的结净数据才能进行解除操作");
+        }
+        MeterWorkCarActual mwcaquery = meterWorkCarActualMapper.selectByPrimaryKey(model.getActualNo());
+        if (mwcaquery == null) {
+            throw new MarkerMetException(500, "不存在对应的结净数据");
+        }else {
+            try{
+                SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                if(mwcaquery.getUpdateTime() != null && StringUtils.isNotEmpty(mwcaquery.getUpdateTime().toString())) {
+                    String sDate = df.format(mwcaquery.getUpdateTime());
+                    String eDate = df.format(new Date());
+                    long sTime = df.parse(sDate).getTime();
+                    long eTime = df.parse(eDate).getTime();
+                    long diff = (eTime - sTime) / 1000;
+                    if(diff <= 15) {
+                        throw new MarkerMetException(500, "解除委托需在匹配委托15秒后进行,请稍等");
+                    }
+                }
+            } catch (ParseException e) {
+                e.printStackTrace();
+                throw new MarkerMetException(500, "操作异常");
+            }
+        }
+
+        PreTrackScale scaleTemp = preTrackScaleMapper.selectByPrimaryKey(model.getPredictionNo());
+        if(scaleTemp.getPredictionNo() != null && StringUtils.isNotEmpty(scaleTemp.getPredictionNo())) {
+            if(scaleTemp.getValueFlag().equals("9")) {
+                throw new MarkerMetException(500, "结净数据包含已结算的委托!!!");
+            }
+//            if(scaleTemp.getPredictionType().equals("5") || scaleTemp.getPredictionType().equals("6") || scaleTemp.getPredictionType().equals("7")){
+//                throw new MarkerMetException(500, "结净数据中包含特殊委托匹配结净的数据!!!");
+//            }
+        }
+
+        String userId = model.getUpdateManNo();
+        String userName = model.getUpdateManName();
+        // 处理一次计量数据
+        // 毛重
+        MeterWorkCarActualFirst grossrow = meterWorkCarActualFirstMapper.selectAndRemove(model.getActualFirst1No());
+//        grossrow.setValueFlag("3");
+        grossrow.setUpdateTime(new Date());
+        grossrow.setUpdateManName(userName);
+        grossrow.setUpdateManNo(userId);
+        grossrow.setIsPreScale("0");
+        meterWorkCarActualFirstMapper.updateByPrimaryKey(grossrow);
+
+        // 皮重
+        MeterWorkCarActualFirst tarerow = meterWorkCarActualFirstMapper.selectAndRemove(model.getActualFirst2No());
+//        tarerow.setValueFlag("3");
+        tarerow.setUpdateTime(new Date());
+        tarerow.setUpdateManName(userName);
+        tarerow.setUpdateManNo(userId);
+        tarerow.setIsPreScale("0");
+        meterWorkCarActualFirstMapper.updateByPrimaryKey(tarerow);
+
+        // 处理预报
+        if (StringUtils.isNotEmpty(model.getPredictionNo())) {
+            PreTrackScale scale = new PreTrackScale();
+            scale.setPredictionNo(model.getPredictionNo());
+            scale.setValueFlag("1");
+            scale.setUploadFlag("1");
+            scale.setUpdateTime(new Date());
+            scale.setUpdateManNo("system");
+            scale.setUpdateManName("计量结净数据解除委托操作");
+            preTrackScaleMapper.updateByPrimaryKeySelective(scale);
+        }
+        MeterWorkCarActual mwca = meterWorkCarActualMapper.cleanPredcition(model.getActualNo());
+
+        mwca.setUpdateManNo(userId);
+        mwca.setUpdateManName(userName);
+        mwca.setUpdateTime(new Date());
+        mwca.setNote("撤销委托");
+        //mwca.setValueFlag("3");
+        mwca.setIsPreScale("0");
+        mwca.setUploadFlag("1");
+        mwca.setValueFlag("1");
+        meterWorkCarActualMapper.updateByPrimaryKey(mwca);
+
+        MeterBaseOperationLog logModel = new MeterBaseOperationLog();
+        logModel.setId(PublicMethod.IdCreate(2));
+        logModel.setCreateManNo(userId);
+        logModel.setCreateManName(userName);
+        logModel.setCreateTime(new Date());
+        logModel.setOperationPage("C#端-本地计量结净数据维护");
+        logModel.setOperationFunction("撤销委托");
+        logModel.setOperationId(mwcaquery.getActualNo());
+        logModel.setOperationPredictionNo(mwcaquery.getPredictionNo());
+        logModel.setOperationCarnNo(mwcaquery.getCarNo());
+        logModel.setOperationBeforeFix(mwcaquery.toString());
+        logModel.setOperationAfterFix(mwca.toString());
+        meterBaseOperationLogMapper.insertSelective(logModel);
+        return mwca;
+    }
+
     /**
      * @param actualFirstNo 毛重数据
      * @param dataNo        皮重数据

+ 5 - 2
src/main/java/com/steerinfo/meterwork/meterworkcarnoidentify/mapper/MeterWorkCarnoIdentifyMapper.xml

@@ -451,9 +451,12 @@
        B.car_no first_car_no,
        A.car_no,
        A.video_car_no1,
-       case when (select C.video_car_no1 from Meter_Work_Carno_Identify C where C.Actual_First_No = A.Actual_First_No and C.video_car_no1 = A.car_no) is  not null then '是' else '否' end vedio_car_no1_flag,
+       case when (select C.video_car_no2 from Meter_Work_Carno_Identify C where C.Actual_First_No = A.Actual_First_No and C.video_car_no2 = B.car_no and C.Video_Car_No1 = B.car_no ) is not null then '否'
+            when (select C.video_car_no1 from Meter_Work_Carno_Identify C where C.Actual_First_No = A.Actual_First_No and C.video_car_no1 = B.car_no) is  not null then '是'
+            else '否' end vedio_car_no1_flag,
        A.video_car_no2,
-       case when (select C.video_car_no2 from Meter_Work_Carno_Identify C where C.Actual_First_No = A.Actual_First_No and C.video_car_no2 = A.car_no) is not null then '是' else '否' end vedio_car_no2_flag,
+       case when (select C.video_car_no2 from Meter_Work_Carno_Identify C where C.Actual_First_No = A.Actual_First_No and C.video_car_no2 = B.car_no) is not null then '是'
+            else '否' end vedio_car_no2_flag,
        A.Rfid_Car_No,
        (select D.car_No from meter_base_rfid_info D where D.RFID_code in (select C.rfid_car_no from Meter_Work_Carno_Identify C where C.Actual_First_No = A.Actual_First_No and A.Car_No_type = '2')) rfid_carNo,
        A.scan_car_no

+ 4 - 4
src/main/java/com/steerinfo/meterwork/meterworkcarnoidentify/service/impl/MeterWorkCarnoIdentifyServiceImpl.java

@@ -132,14 +132,14 @@ public class MeterWorkCarnoIdentifyServiceImpl extends BaseServiceImpl<MeterWork
                     countGunUsedIdentify = models.stream().filter(model -> model.getBaseSpotNo().equals(spot.getBaseSpotNo())
                             && model.getBaseSpotName().equals(spot.getBaseSpotName())
                             && model.getCarNoType().equals("1")
-                            && StringUtils.isNotEmpty(model.getVideoCarNo1())
-                            && model.getVideoCarNo1().equals(model.getFirstCarNo())).count();
+                            && StringUtils.isNotEmpty(model.getVideoCarNo2())
+                            && model.getVideoCarNo2().equals(model.getFirstCarNo())).count();
                     //球机车号使用数 - 枪机和球机同时等于一次车号识别数
                     countBallUsedIdentify = models.stream().filter(model -> model.getBaseSpotNo().equals(spot.getBaseSpotNo())
                             && model.getBaseSpotName().equals(spot.getBaseSpotName())
                             && model.getCarNoType().equals("1")
-                            && StringUtils.isNotEmpty(model.getVideoCarNo2())
-                            && model.getVideoCarNo2().equals(model.getFirstCarNo())).count()
+                            && StringUtils.isNotEmpty(model.getVideoCarNo1())
+                            && model.getVideoCarNo1().equals(model.getFirstCarNo())).count()
                             - models.stream().filter(model -> model.getBaseSpotNo().equals(spot.getBaseSpotNo())
                                 && model.getBaseSpotName().equals(spot.getBaseSpotName())
                                 && model.getCarNoType().equals("1")

+ 39 - 0
src/main/java/com/steerinfo/meterwork/meterworkdatacount/controller/MeterWorkDataCountController.java

@@ -449,4 +449,43 @@ public class MeterWorkDataCountController extends BaseRESTfulController {
             throw new MarkerMetException(500, "操作异常!!");
         }
     }
+
+    @ApiOperation(value = "汽车衡结净数据皮重核查明细-获取列表", notes = "分页模糊查询")
+    //@RequiresPermissions("meterworkcaractualfirst:view")
+    @PostMapping(value = "/carActualTareWeightComparisonDetail")
+    public RESTfulResult carActualTareWeightComparisonDetail(@RequestBody(required = false) HashMap parmas) {
+        try {
+            PageList<CarActualTareWeightComparison> list = meterWorkDataCountService.carActualTareWeightComparisonDetail(parmas);
+            return success(list);
+        } catch (Exception ex) {
+            ex.printStackTrace();
+            throw new MarkerMetException(500, "操作异常!!");
+        }
+    }
+
+    @ApiOperation(value = "轨道衡结净数据同车型、同物料毛重核查-获取列表", notes = "分页模糊查询")
+    //@RequiresPermissions("meterworkcaractualfirst:view")
+    @PostMapping(value = "/railwayActualGrossWeightComparison")
+    public RESTfulResult railwayActualGrossWeightComparison(@RequestBody(required = false) HashMap parmas) {
+        try {
+            PageList<RailwayActualGrossWeightComparison> list = meterWorkDataCountService.railwayActualGrossWeightComparison(parmas);
+            return success(list);
+        } catch (Exception ex) {
+            ex.printStackTrace();
+            throw new MarkerMetException(500, "操作异常!!");
+        }
+    }
+
+    @ApiOperation(value = "轨道衡结净数据同车型、同物料毛重核查比对明细-获取列表", notes = "分页模糊查询")
+    //@RequiresPermissions("meterworkcaractualfirst:view")
+    @PostMapping(value = "/railwayActualGrossWeightComparisonDetail")
+    public RESTfulResult railwayActualGrossWeightComparisonDetail(@RequestBody(required = false) HashMap parmas) {
+        try {
+            PageList<RailwayActualGrossWeightComparison> list = meterWorkDataCountService.railwayActualGrossWeightComparisonDetail(parmas);
+            return success(list);
+        } catch (Exception ex) {
+            ex.printStackTrace();
+            throw new MarkerMetException(500, "操作异常!!");
+        }
+    }
 }

+ 3 - 0
src/main/java/com/steerinfo/meterwork/meterworkdatacount/mapper/MeterWorkDataCountMapper.java

@@ -25,4 +25,7 @@ public interface MeterWorkDataCountMapper {
     List<MeterBaseSpotInfo> rfidIdentifyAnalysisSummarySpot(HashMap<String, Object> param);
     List<RfidIdentifyAnalysis> rfidIdentifyAnalysisSummary(HashMap<String, Object> param);
     List<CarActualTareWeightComparison> carActualTareWeightComparison(HashMap<String, Object> param);
+    List<CarActualTareWeightComparison> carActualTareWeightComparisonDetail(HashMap<String, Object> param);
+    List<RailwayActualGrossWeightComparison> railwayActualGrossWeightComparison(HashMap<String, Object> param);
+    List<RailwayActualGrossWeightComparison> railwayActualGrossWeightComparisonDetail(HashMap<String, Object> param);
 }

+ 81 - 0
src/main/java/com/steerinfo/meterwork/meterworkdatacount/mapper/MeterWorkDataCountMapper.xml

@@ -964,4 +964,85 @@
         </if>
         order by A.net_time desc
     </select>
+
+    <select id="carActualTareWeightComparisonDetail" parameterType="java.util.HashMap"
+            resultType="com.steerinfo.meterwork.meterworkdatacount.model.CarActualTareWeightComparison">
+        select A.car_no carNo,
+            A.matter_no matterNo,
+            A.matter_name matterName,
+            to_char(round(avg(A.tare_weight) / 1000, 2), 'FM9999999999999999.00') avgTareWeight
+        from meter_work_car_actual A
+        where 1 = 1
+        <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
+            and  A.net_time  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss')
+            and A.net_time  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
+        </if>
+        group by A.car_no, A.matter_no, A.matter_name
+    </select>
+
+    <select id="railwayActualGrossWeightComparison" parameterType="java.util.HashMap"
+            resultType="com.steerinfo.meterwork.meterworkdatacount.model.RailwayActualGrossWeightComparison">
+        select A.actual_no actualNo,
+               A.actual_first1_no actualFirst1No,
+               A.actual_first2_no actualFirst2No,
+               case when A.net_mode = '1' then '远程计量'
+                    when A.net_mode = '2' then '智能计量'
+                    when A.net_mode = '3' then '手工计量'
+                    else A.net_mode end netMode,
+               A.railway_type_no railwayTypeNo,
+               A.railway_type_name railwayTypeName,
+               A.prediction_no predictionNo,
+               A.railway_no railwayNo,
+               A.matter_no matterNo,
+               A.matter_name matterName,
+               to_char(round(A.gross_Weight/1000, 2),'FM9999999999999999.00') grossWeight,
+               to_char(round(A.tare_weight/1000, 2),'FM9999999999999999.00') tareWeight,
+               to_char(round(A.net_weight/1000, 2),'FM9999999999999999.00') netWeight,
+               A.forwarding_unit_name forwardingUnitName,
+               A.receiving_uint_name receivingUintName,
+               A.conveyance_type conveyanceType,
+               case when A.meter_type_Name = 'SendToOutTms' then '外发'
+                    when A.meter_type_Name = 'GM2GM' or A.meter_type_name = 'InnerTms' then '厂内转储'
+                    when A.meter_type_Name = 'PO2GM' then '外进'
+                    else A.meter_type_Name end meterTypeName,
+               A.theory_amount theoryAmount,
+               A.gross_time grossTime,
+               A.base_spot1_name baseSpot1Name,
+               A.gross_man_name grossManName,
+               A.tare_time tareTime,
+               A.base_spot2_name baseSpot2Name,
+               A.tare_man_name tareManName,
+               case when A.value_flag = '0' then '作废'
+                    when A.value_flag = '1' then '有效-未上传'
+                    when A.value_flag = '2' then '有效-已上传'
+                    else A.value_flag end valueFlag,
+               case when A.upload_flag = '1' then '待上传'
+                    when A.upload_flag = '2' then '已上传'
+                    else A.upload_flag end uploadFlag
+        from meter_work_railway_actual A
+        where 1 = 1
+        and A.value_Flag != '0'
+        <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
+            and  A.net_time  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss')
+            and A.net_time  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
+        </if>
+    </select>
+
+    <select id="railwayActualGrossWeightComparisonDetail" parameterType="java.util.HashMap"
+            resultType="com.steerinfo.meterwork.meterworkdatacount.model.RailwayActualGrossWeightComparison">
+        select A.conveyance_type conveyanceType,
+               A.matter_no matterNo,
+               A.matter_name matterName,
+               to_char(round(avg(A.gross_Weight)/1000, 2),'FM9999999999999999.00') avgGrossWeight
+        from meter_work_railway_actual A
+        where 1 = 1
+        and A.value_Flag != '0'
+        <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
+            and  A.net_time  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss')
+            and A.net_time  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
+        </if>
+        group by A.conveyance_Type,
+                 A.matter_No,
+                 A.matter_Name
+    </select>
 </mapper>

+ 18 - 0
src/main/java/com/steerinfo/meterwork/meterworkdatacount/model/CarActualTareWeightComparison.java

@@ -14,6 +14,8 @@ public class CarActualTareWeightComparison {
     private String matterName;
     private BigDecimal grossWeight;
     private BigDecimal tareWeight;
+    private BigDecimal avgTareWeight;
+    private BigDecimal avgTareWeightSub;
     private BigDecimal netWeight;
     private Date grossTime;
     private Date tareTime;
@@ -117,6 +119,22 @@ public class CarActualTareWeightComparison {
         this.tareWeight = tareWeight;
     }
 
+    public BigDecimal getAvgTareWeight() {
+        return avgTareWeight;
+    }
+
+    public void setAvgTareWeight(BigDecimal avgTareWeight) {
+        this.avgTareWeight = avgTareWeight;
+    }
+
+    public BigDecimal getAvgTareWeightSub() {
+        return avgTareWeightSub;
+    }
+
+    public void setAvgTareWeightSub(BigDecimal avgTareWeightSub) {
+        this.avgTareWeightSub = avgTareWeightSub;
+    }
+
     public BigDecimal getNetWeight() {
         return netWeight;
     }

+ 259 - 0
src/main/java/com/steerinfo/meterwork/meterworkdatacount/model/RailwayActualGrossWeightComparison.java

@@ -0,0 +1,259 @@
+package com.steerinfo.meterwork.meterworkdatacount.model;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+public class RailwayActualGrossWeightComparison {
+    private String actualNo;
+    private String actualFirst1No;
+    private String actualFirst2No;
+    private String netMode;
+    private String railwayTypeNo;
+    private String railwayTypeName;
+    private String predictionNo;
+    private String railwayNo;
+    private String matterName;
+    private BigDecimal grossWeight;
+    private BigDecimal avgGrossWeight;
+    private BigDecimal avgGrossWeightSub;
+    private BigDecimal tareWeight;
+    private BigDecimal netWeight;
+    private String forwardingUnitName;
+    private String receivingUintName;
+    private String conveyanceType;
+    private String matterNo;
+    private String meterTypeName;
+    private String theoryAmount;
+    private Date grossTime;
+    private String baseSpot1Name;
+    private String grossManName;
+    private Date tareTime;
+    private String baseSpot2Name;
+    private String tareManName;
+    private String valueFlag;
+    private String uploadFlag;
+
+    public String getActualNo() {
+        return actualNo;
+    }
+
+    public void setActualNo(String actualNo) {
+        this.actualNo = actualNo;
+    }
+
+    public String getActualFirst1No() {
+        return actualFirst1No;
+    }
+
+    public void setActualFirst1No(String actualFirst1No) {
+        this.actualFirst1No = actualFirst1No;
+    }
+
+    public String getActualFirst2No() {
+        return actualFirst2No;
+    }
+
+    public void setActualFirst2No(String actualFirst2No) {
+        this.actualFirst2No = actualFirst2No;
+    }
+
+    public String getNetMode() {
+        return netMode;
+    }
+
+    public void setNetMode(String netMode) {
+        this.netMode = netMode;
+    }
+
+    public String getRailwayTypeNo() {
+        return railwayTypeNo;
+    }
+
+    public void setRailwayTypeNo(String railwayTypeNo) {
+        this.railwayTypeNo = railwayTypeNo;
+    }
+
+    public String getRailwayTypeName() {
+        return railwayTypeName;
+    }
+
+    public void setRailwayTypeName(String railwayTypeName) {
+        this.railwayTypeName = railwayTypeName;
+    }
+
+    public String getPredictionNo() {
+        return predictionNo;
+    }
+
+    public void setPredictionNo(String predictionNo) {
+        this.predictionNo = predictionNo;
+    }
+
+    public String getRailwayNo() {
+        return railwayNo;
+    }
+
+    public void setRailwayNo(String railwayNo) {
+        this.railwayNo = railwayNo;
+    }
+
+    public String getMatterName() {
+        return matterName;
+    }
+
+    public void setMatterName(String matterName) {
+        this.matterName = matterName;
+    }
+
+    public BigDecimal getGrossWeight() {
+        return grossWeight;
+    }
+
+    public void setGrossWeight(BigDecimal grossWeight) {
+        this.grossWeight = grossWeight;
+    }
+
+    public BigDecimal getAvgGrossWeight() {
+        return avgGrossWeight;
+    }
+
+    public void setAvgGrossWeight(BigDecimal avgGrossWeight) {
+        this.avgGrossWeight = avgGrossWeight;
+    }
+
+    public BigDecimal getAvgGrossWeightSub() {
+        return avgGrossWeightSub;
+    }
+
+    public void setAvgGrossWeightSub(BigDecimal avgGrossWeightSub) {
+        this.avgGrossWeightSub = avgGrossWeightSub;
+    }
+
+    public BigDecimal getTareWeight() {
+        return tareWeight;
+    }
+
+    public void setTareWeight(BigDecimal tareWeight) {
+        this.tareWeight = tareWeight;
+    }
+
+    public BigDecimal getNetWeight() {
+        return netWeight;
+    }
+
+    public void setNetWeight(BigDecimal netWeight) {
+        this.netWeight = netWeight;
+    }
+
+    public String getForwardingUnitName() {
+        return forwardingUnitName;
+    }
+
+    public void setForwardingUnitName(String forwardingUnitName) {
+        this.forwardingUnitName = forwardingUnitName;
+    }
+
+    public String getReceivingUintName() {
+        return receivingUintName;
+    }
+
+    public void setReceivingUintName(String receivingUintName) {
+        this.receivingUintName = receivingUintName;
+    }
+
+    public String getConveyanceType() {
+        return conveyanceType;
+    }
+
+    public void setConveyanceType(String conveyanceType) {
+        this.conveyanceType = conveyanceType;
+    }
+
+    public String getMatterNo() {
+        return matterNo;
+    }
+
+    public void setMatterNo(String matterNo) {
+        this.matterNo = matterNo;
+    }
+
+    public String getMeterTypeName() {
+        return meterTypeName;
+    }
+
+    public void setMeterTypeName(String meterTypeName) {
+        this.meterTypeName = meterTypeName;
+    }
+
+    public String getTheoryAmount() {
+        return theoryAmount;
+    }
+
+    public void setTheoryAmount(String theoryAmount) {
+        this.theoryAmount = theoryAmount;
+    }
+
+    public Date getGrossTime() {
+        return grossTime;
+    }
+
+    public void setGrossTime(Date grossTime) {
+        this.grossTime = grossTime;
+    }
+
+    public String getBaseSpot1Name() {
+        return baseSpot1Name;
+    }
+
+    public void setBaseSpot1Name(String baseSpot1Name) {
+        this.baseSpot1Name = baseSpot1Name;
+    }
+
+    public String getGrossManName() {
+        return grossManName;
+    }
+
+    public void setGrossManName(String grossManName) {
+        this.grossManName = grossManName;
+    }
+
+    public Date getTareTime() {
+        return tareTime;
+    }
+
+    public void setTareTime(Date tareTime) {
+        this.tareTime = tareTime;
+    }
+
+    public String getBaseSpot2Name() {
+        return baseSpot2Name;
+    }
+
+    public void setBaseSpot2Name(String baseSpot2Name) {
+        this.baseSpot2Name = baseSpot2Name;
+    }
+
+    public String getTareManName() {
+        return tareManName;
+    }
+
+    public void setTareManName(String tareManName) {
+        this.tareManName = tareManName;
+    }
+
+    public String getValueFlag() {
+        return valueFlag;
+    }
+
+    public void setValueFlag(String valueFlag) {
+        this.valueFlag = valueFlag;
+    }
+
+    public String getUploadFlag() {
+        return uploadFlag;
+    }
+
+    public void setUploadFlag(String uploadFlag) {
+        this.uploadFlag = uploadFlag;
+    }
+}

+ 5 - 0
src/main/java/com/steerinfo/meterwork/meterworkdatacount/service/IMeterWorkDataCountService.java

@@ -22,5 +22,10 @@ public interface IMeterWorkDataCountService{
     List<HashMap> rfidIdentifyAnalysisSummary(HashMap<String, Object> params);
     PageList<RfidIdentifyAnalysis> rfidIdentifyAnalysisDetail(HashMap<String, Object> params);
     List<HashMap> pikaCarNumAnalysisSummary(HashMap<String, Object> params);
+    //汽车衡结净数据皮重核查明细
     PageList<CarActualTareWeightComparison> carActualTareWeightComparison(HashMap<String, Object> params);
+    PageList<CarActualTareWeightComparison> carActualTareWeightComparisonDetail(HashMap<String, Object> params);
+    //轨道衡同车型同物料毛重核查明细
+    PageList<RailwayActualGrossWeightComparison> railwayActualGrossWeightComparison(HashMap<String, Object> params);
+    PageList<RailwayActualGrossWeightComparison> railwayActualGrossWeightComparisonDetail(HashMap<String, Object> params);
 }

+ 82 - 1
src/main/java/com/steerinfo/meterwork/meterworkdatacount/service/impl/MeterWorkDataCountServiceImpl.java

@@ -17,6 +17,7 @@ import com.steerinfo.meterwork.meterworkrailwayactfirst.mapper.MeterWorkRailwayA
 import com.steerinfo.meterwork.meterworkrailwayactual.mapper.MeterWorkRailwayActualMapper;
 import com.steerinfo.meterwork.meterworkrailwayactual.model.MeterWorkRailwayActual;
 import com.steerinfo.util.StringUtils;
+import org.apache.poi.hssf.record.ArrayRecord;
 import org.apache.shiro.crypto.hash.Hash;
 import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
@@ -28,6 +29,8 @@ import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.stream.Collectors;
 
+import static java.lang.Math.abs;
+
 @Service
 public class MeterWorkDataCountServiceImpl implements IMeterWorkDataCountService {
 
@@ -118,7 +121,7 @@ public class MeterWorkDataCountServiceImpl implements IMeterWorkDataCountService
                             Date timeDate2 = simpleFormat.parse(sdf.format(model.getCreateTime()));
                             long time1 = timeDate1.getTime();
                             long time2 = timeDate2.getTime();
-                            int minutes = Math.abs((int) ((time1 - time2) / (1000 * 60)));
+                            int minutes = abs((int) ((time1 - time2) / (1000 * 60)));
                             if (StringUtils.isEmpty(model.getWeightType()) || StringUtils.isEmpty(modelsB.get(0).getWeightType())) {
                                 if (modelsB.get(0).getSpotAreaNo().equals(model.getSpotAreaNo())
                                         && minutes <= 20) {
@@ -1130,4 +1133,82 @@ public class MeterWorkDataCountServiceImpl implements IMeterWorkDataCountService
         PageList pageInfo = new PageList(rows);
         return pageInfo;
     }
+
+    @Override
+    public PageList<CarActualTareWeightComparison> carActualTareWeightComparisonDetail(HashMap<String, Object> params) {
+        PageHelper.startPage(Integer.parseInt(params.get("pageNum").toString()), Integer.parseInt(params.get("pageSize").toString()));
+        BigDecimal avgTareWeight = params.get("avgTareWeight") != null ? new BigDecimal(params.get("avgTareWeight").toString()): new BigDecimal(0);
+        //查询所有结净数据
+        List<CarActualTareWeightComparison> rowsActual = meterWorkDataCountMapper.carActualTareWeightComparison(params);
+        //根据车号、物料编号、物料名称进行分组并求平均值
+        List<CarActualTareWeightComparison> rowsDetail = meterWorkDataCountMapper.carActualTareWeightComparisonDetail(params);
+        List<CarActualTareWeightComparison> rows = new ArrayList<>();
+        if(rowsDetail.size() >= 1) {
+            //循环分组List<车号、物料编号、物料名称>
+            for(CarActualTareWeightComparison modelDetail: rowsDetail) {
+                if(rowsActual.size() >= 1) {
+                    for (CarActualTareWeightComparison modelActual: rowsActual) {
+                        //判断车号、物料编号、物料名称是否一致、一致把平均值写入,并添加
+                        if(modelDetail.getCarNo() != null && modelActual.getCarNo() != null && modelDetail.getCarNo().equals(modelActual.getCarNo())
+                            && modelDetail.getMatterNo() != null && modelActual.getMatterNo() != null && modelDetail.getMatterNo().equals(modelActual.getMatterNo())
+                            && modelDetail.getMatterName() != null && modelActual.getMatterName() != null && modelDetail.getMatterName().equals(modelActual.getMatterName())) {
+                            //结净数据皮重-平均皮重大于等于输入值,就写入
+                            BigDecimal sub = (modelActual.getTareWeight().subtract(modelDetail.getAvgTareWeight())).abs();
+                            //avgTareWeight < sub
+                            if(avgTareWeight.compareTo(sub) == -1) {
+                                modelActual.setAvgTareWeight(modelDetail.getAvgTareWeight());
+                                modelActual.setAvgTareWeightSub(sub);
+                                rows.add(modelActual);
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        PageList pageInfo = new PageList(rows);
+        return pageInfo;
+    }
+
+    @Override
+    public PageList<RailwayActualGrossWeightComparison> railwayActualGrossWeightComparison(HashMap<String, Object> params) {
+        PageHelper.startPage(Integer.parseInt(params.get("pageNum").toString()), Integer.parseInt(params.get("pageSize").toString()));
+        List<RailwayActualGrossWeightComparison> rows = meterWorkDataCountMapper.railwayActualGrossWeightComparison(params);
+        PageList pageInfo = new PageList(rows);
+        return pageInfo;
+    }
+
+    @Override
+    public PageList<RailwayActualGrossWeightComparison> railwayActualGrossWeightComparisonDetail(HashMap<String, Object> params) {
+        PageHelper.startPage(Integer.parseInt(params.get("pageNum").toString()), Integer.parseInt(params.get("pageSize").toString()));
+        BigDecimal avgGrossWeight = params.get("avgGrossWeight") != null ? new BigDecimal(params.get("avgGrossWeight").toString()): new BigDecimal(0);
+        //查询所有结净数据
+        List<RailwayActualGrossWeightComparison> rowsActual = meterWorkDataCountMapper.railwayActualGrossWeightComparison(params);
+        //根据车型、物料编号、物料名称进行分组并求平均值
+        List<RailwayActualGrossWeightComparison> rowsDetail = meterWorkDataCountMapper.railwayActualGrossWeightComparisonDetail(params);
+        List<RailwayActualGrossWeightComparison> rows = new ArrayList<>();
+        if(rowsDetail.size() >= 1) {
+            //循环分组List<车型、物料编号、物料名称>
+            for(RailwayActualGrossWeightComparison modelDetail: rowsDetail) {
+                if(rowsActual.size() >= 1) {
+                    for (RailwayActualGrossWeightComparison modelActual: rowsActual) {
+                        //判断车型、物料编号、物料名称是否一致、一致把平均值写入,并添加
+                        if(modelDetail.getConveyanceType() != null && modelActual.getConveyanceType() != null && modelDetail.getConveyanceType().equals(modelActual.getConveyanceType())
+                                && modelDetail.getMatterNo() != null && modelActual.getMatterNo() != null && modelDetail.getMatterNo().equals(modelActual.getMatterNo())
+                                && modelDetail.getMatterName() != null && modelActual.getMatterName() != null && modelDetail.getMatterName().equals(modelActual.getMatterName())) {
+                            //结净数据毛重-平均毛重大于等于输入值,就写入
+                            BigDecimal sub = (modelActual.getGrossWeight().subtract(modelDetail.getAvgGrossWeight())).abs();
+                            //avgGrossWeight < sub
+                            if(avgGrossWeight.compareTo(sub) == -1) {
+                                modelActual.setAvgGrossWeight(modelDetail.getAvgGrossWeight());
+                                modelActual.setAvgGrossWeightSub(sub);
+                                rows.add(modelActual);
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        PageList pageInfo = new PageList(rows);
+        return pageInfo;
+    }
 }

+ 19 - 0
src/main/java/com/steerinfo/meterwork/meterworkimage/controller/MeterWorkImageController.java

@@ -215,6 +215,25 @@ public class MeterWorkImageController extends BaseRESTfulController {
         return rm;
     }
 
+    @ApiOperation(value = "轨道衡核查界面---获取净重(一毛一皮)和空皮轨道衡图片路径", notes = "批量处理界面---获取净重(一毛一皮)、空皮轨道衡图片路径")
+    @GetMapping(value = "/getAllRailwayImageUrl")
+    public RESTfulResult getAllRailwayImageUrl(@RequestParam HashMap<String, Object> map) {
+        RESTfulResult rm = failed();
+        try {
+            rm = meterWorkImageService.getAllRailwayImageUrl(map);
+        } catch (MarkerMetException e) {
+            e.printStackTrace();
+            rm.setCode("200");
+            rm.setMessage(e.getMessage());
+        } catch (Exception e) {
+            e.printStackTrace();
+            rm.setMessage("操作异常,请确认!");
+        } finally {
+
+        }
+        return rm;
+    }
+
     @ApiOperation(value = "C#创建", notes = "根据MeterWorkImage对象创建")
     @PostMapping(value = "/doSaveWf", produces = "application/json;charset=UTF-8")
     public RESTfulResult doSaveWf(@RequestBody MeterWorkImage model) {

+ 1 - 0
src/main/java/com/steerinfo/meterwork/meterworkimage/service/IMeterWorkImageService.java

@@ -29,6 +29,7 @@ public interface IMeterWorkImageService extends IBaseService<MeterWorkImage, Str
     RESTfulResult queryRailwayUrl(String actualFirstNo);
     RESTfulResult getRailwayImageUrl(HashMap<String, Object> map);
     RESTfulResult getRailwayActualImageUrl(HashMap<String, Object> map);
+    RESTfulResult getAllRailwayImageUrl(HashMap<String, Object> map);
 
     RESTfulResult doSaveWf(MeterWorkImage mwi);
     RESTfulResult doSaveRailwayWf(MeterWorkImage mwi);

+ 155 - 1
src/main/java/com/steerinfo/meterwork/meterworkimage/service/impl/MeterWorkImageServiceImpl.java

@@ -288,10 +288,164 @@ public class MeterWorkImageServiceImpl extends BaseServiceImpl<MeterWorkImage, S
             Assert.isTrue(actualModel != null, "净重数据不存在");
             String grossNo = actualModel.getActualFirst1No() == null? "": "R" + actualModel.getActualFirst1No();
             String tareNo = actualModel.getActualFirst2No() == null ? "": "R" + actualModel.getActualFirst2No();
+            String tare_No = map.get("tareNo") == null? "": "R" + map.get("tareNo").toString();
+            HashMap<String, Object> imageMap = new HashMap<>();
+            List<String> grossImageURL = new ArrayList<>();
+            List<String> tareImageURL = new ArrayList<>();
+            List<String> tareNoImageURL = new ArrayList<>();
+
+            if(StringUtils.isNotEmpty(grossNo)) {
+                MeterWorkImage mwi = meterWorkImageMapper.selectByPrimaryKey(grossNo);
+                if(mwi != null) {
+                    if (mwi.getImageFile1() != null && !mwi.getImageFile1().equals("")) {
+                        String no = mwi.getImageFile1();
+                        grossImageURL.add(no);
+                    }
+                    if (mwi.getImageFile2() != null && !mwi.getImageFile2().equals("")) {
+                        String no = mwi.getImageFile2();
+                        grossImageURL.add(no);
+                    }
+                    if (mwi.getImageFile3() != null && !mwi.getImageFile3().equals("")) {
+                        String no = mwi.getImageFile3();
+                        grossImageURL.add(no);
+                    }
+                    if (mwi.getImageFile4() != null && !mwi.getImageFile4().equals("")) {
+                        String no = mwi.getImageFile4();
+                        grossImageURL.add(no);
+                    }
+                    if (mwi.getImageFile5() != null && !mwi.getImageFile5().equals("")) {
+                        String no = mwi.getImageFile5();
+                        grossImageURL.add(no);
+                    }
+                    if (mwi.getImageFile6() != null && !mwi.getImageFile6().equals("")) {
+                        String no = mwi.getImageFile6();
+                        grossImageURL.add(no);
+                    }
+                    if (mwi.getImageFile7() != null && !mwi.getImageFile7().equals("")) {
+                        String no = mwi.getImageFile7();
+                        grossImageURL.add(no);
+                    }
+                    if (mwi.getImageFile8() != null && !mwi.getImageFile8().equals("")) {
+                        String no = mwi.getImageFile8();
+                        grossImageURL.add(no);
+                    }
+                }
+            }
+
+            if(StringUtils.isNotEmpty(tareNo)) {
+                MeterWorkImage mwi = meterWorkImageMapper.selectByPrimaryKey(tareNo);
+                if(mwi != null) {
+                    if (mwi.getImageFile1() != null && !mwi.getImageFile1().equals("")) {
+                        String no = mwi.getImageFile1();
+                        tareImageURL.add(no);
+                    }
+                    if (mwi.getImageFile2() != null && !mwi.getImageFile2().equals("")) {
+                        String no = mwi.getImageFile2();
+                        tareImageURL.add(no);
+                    }
+                    if (mwi.getImageFile3() != null && !mwi.getImageFile3().equals("")) {
+                        String no = mwi.getImageFile3();
+                        tareImageURL.add(no);
+                    }
+                    if (mwi.getImageFile4() != null && !mwi.getImageFile4().equals("")) {
+                        String no = mwi.getImageFile4();
+                        tareImageURL.add(no);
+                    }
+                    if (mwi.getImageFile5() != null && !mwi.getImageFile5().equals("")) {
+                        String no = mwi.getImageFile5();
+                        tareImageURL.add(no);
+                    }
+                    if (mwi.getImageFile6() != null && !mwi.getImageFile6().equals("")) {
+                        String no = mwi.getImageFile6();
+                        tareImageURL.add(no);
+                    }
+                    if (mwi.getImageFile7() != null && !mwi.getImageFile7().equals("")) {
+                        String no = mwi.getImageFile7();
+                        tareImageURL.add(no);
+                    }
+                    if (mwi.getImageFile8() != null && !mwi.getImageFile8().equals("")) {
+                        String no = mwi.getImageFile8();
+                        tareImageURL.add(no);
+                    }
+                }
+            }
+            if(StringUtils.isNotEmpty(tare_No)) {
+                MeterWorkImage mwi = meterWorkImageMapper.selectByPrimaryKey(tare_No);
+                if(mwi != null) {
+                    if (mwi.getImageFile1() != null && !mwi.getImageFile1().equals("")) {
+                        String no = mwi.getImageFile1();
+                        tareNoImageURL.add(no);
+                    }
+                    if (mwi.getImageFile2() != null && !mwi.getImageFile2().equals("")) {
+                        String no = mwi.getImageFile2();
+                        tareNoImageURL.add(no);
+                    }
+                    if (mwi.getImageFile3() != null && !mwi.getImageFile3().equals("")) {
+                        String no = mwi.getImageFile3();
+                        tareNoImageURL.add(no);
+                    }
+                    if (mwi.getImageFile4() != null && !mwi.getImageFile4().equals("")) {
+                        String no = mwi.getImageFile4();
+                        tareNoImageURL.add(no);
+                    }
+                    if (mwi.getImageFile5() != null && !mwi.getImageFile5().equals("")) {
+                        String no = mwi.getImageFile5();
+                        tareNoImageURL.add(no);
+                    }
+                    if (mwi.getImageFile6() != null && !mwi.getImageFile6().equals("")) {
+                        String no = mwi.getImageFile6();
+                        tareNoImageURL.add(no);
+                    }
+                    if (mwi.getImageFile7() != null && !mwi.getImageFile7().equals("")) {
+                        String no = mwi.getImageFile7();
+                        tareNoImageURL.add(no);
+                    }
+                    if (mwi.getImageFile8() != null && !mwi.getImageFile8().equals("")) {
+                        String no = mwi.getImageFile8();
+                        tareNoImageURL.add(no);
+                    }
+                }
+            }
+            imageMap.put("grossImageURL", grossImageURL);
+            imageMap.put("tareImageURL", tareImageURL);
+            imageMap.put("tareNoImageURL", tareNoImageURL);
+            rm.setSucceed();
+            rm.setCode("200");
+            rm.setData(imageMap);
+            rm.setMessage("操作成功");
+        } catch (Exception e){
+            e.printStackTrace();
+            rm.setMessage(e.getMessage());
+        }
+        return rm;
+    }
+
+    @Override
+    public RESTfulResult getAllRailwayImageUrl(HashMap<String, Object> map) {
+        RESTfulResult rm = new RESTfulResult();
+        rm.setFailed();
+        try {
+            String actualNo = map.get("actualNo") == null ? "": map.get("actualNo").toString();
+            String railwayTypeNo = map.get("railwayTypeNo") == null ? "": map.get("railwayTypeNo").toString();
+            Assert.isTrue(StringUtils.isNotEmpty(actualNo), "净重计量编号为空");
+            MeterWorkRailwayActual actualModel = meterWorkRailwayActualMapper.selectByPrimaryKey(actualNo);
+            Assert.isTrue(actualModel != null, "净重数据不存在");
+            String grossNo = "";
+            String tareNo = "";
+            String tare_No = "";
+            if(railwayTypeNo.equals("001019002")
+                    || railwayTypeNo.equals("001019004")) {
+                grossNo = actualModel.getActualFirst1No() == null? "": actualModel.getActualFirst1No();
+                tareNo = actualModel.getActualFirst2No() == null ? "": actualModel.getActualFirst2No();
+                tare_No = map.get("tareNo") == null? "": map.get("tareNo").toString();
+            }else {
+                grossNo = actualModel.getActualFirst1No() == null? "": "R" + actualModel.getActualFirst1No();
+                tareNo = actualModel.getActualFirst2No() == null ? "": "R" + actualModel.getActualFirst2No();
+                tare_No = map.get("tareNo") == null? "": "R" + map.get("tareNo").toString();
+            }
             if(grossNo.equals(tareNo)) {
                 tareNo = "";
             }
-            String tare_No = map.get("tareNo") == null? "": "R" + map.get("tareNo").toString();
             HashMap<String, Object> imageMap = new HashMap<>();
             List<String> grossImageURL = new ArrayList<>();
             List<String> tareImageURL = new ArrayList<>();

+ 10 - 2
src/main/java/com/steerinfo/meterwork/meterworkrailwayactfirst/service/impl/MeterWorkRailwayActFirstServiceImpl.java

@@ -4373,10 +4373,12 @@ public class MeterWorkRailwayActFirstServiceImpl extends BaseServiceImpl<MeterWo
             String scaleNo = "";
             //从勾选的委托、两个一次数据中赋值委托号
             if(scale != null && scale.getPredictionNo() != null && StringUtils.isNotEmpty(scale.getPredictionNo())){
-                if((grossModel.getPredictionNo() != null && StringUtils.isNotEmpty(grossModel.getPredictionNo()) && !scale.getPredictionNo().equals(grossModel.getPredictionNo()))){
+                if((grossModel.getPredictionNo() != null && StringUtils.isNotEmpty(grossModel.getPredictionNo())
+                        && !scale.getPredictionNo().equals(grossModel.getPredictionNo()))){
                     rm.setMessage("毛重一次计量数据与勾选中的委托号不一致,请确认!!");
                     return rm;
-                }else if(tareModel.getPredictionNo() != null && StringUtils.isNotEmpty(tareModel.getPredictionNo()) && !scale.getPredictionNo().equals(tareModel.getPredictionNo())){
+                }else if(tareModel.getPredictionNo() != null && StringUtils.isNotEmpty(tareModel.getPredictionNo())
+                        && !scale.getPredictionNo().equals(tareModel.getPredictionNo())){
                     rm.setMessage("皮重一次计量数据与勾选中的委托号不一致,请确认!!");
                     return rm;
                 }
@@ -4402,6 +4404,12 @@ public class MeterWorkRailwayActFirstServiceImpl extends BaseServiceImpl<MeterWo
                     return rm;
                 }
 
+                //判断委托车号是否包含毛重后三位;例如:传的委托里的车号(175029)是以毛重里的车号(029)结尾的,得顺便把毛重的车号改了再结净
+                if(scale.getRailwayNo().endsWith(model01.getRailwayNo())) {
+                    model01.setRailwayNo(scale.getRailwayNo());
+                    meterWorkRailwayActFirstMapper.updateByPrimaryKeySelective(model01);
+                }
+
                 //将委托中的编号和收发货的等数据拷贝进一次数据中
                 MeterWorkRailwayActFirst first1 = meterWorkRailwayActFirstMapper.selectAndMatch(model01.getActualFirstNo(), scale.getPredictionNo());
                 BeanUtils.copyProperties(first1, model01);