xieb 4 سال پیش
والد
کامیت
9d07a2fdb1
39فایلهای تغییر یافته به همراه2028 افزوده شده و 1052 حذف شده
  1. 1 5
      src/main/java/com/jisco/dynamicweight/dynamicbasebatchdbconfig/controller/DynamicBaseBatchdbConfigController.java
  2. 21 8
      src/main/java/com/jisco/dynamicweight/dynamicbasebatchstation/controller/DynamicBaseBatchStationController.java
  3. 70 17
      src/main/java/com/jisco/dynamicweight/dynamicbasebatchstation/mapper/DynamicBaseBatchStationMapper.xml
  4. 31 0
      src/main/java/com/jisco/dynamicweight/dynamicbasebatchstation/model/DynamicBaseBatchStation.java
  5. 5 0
      src/main/java/com/jisco/dynamicweight/dynamicbasebatchstation/service/IDynamicBaseBatchStationService.java
  6. 9 0
      src/main/java/com/jisco/dynamicweight/dynamicbasebatchstation/service/impl/DynamicBaseBatchStationServiceImpl.java
  7. 21 8
      src/main/java/com/jisco/dynamicweight/dynamicbasemeterial/controller/DynamicBaseMeterialController.java
  8. 70 21
      src/main/java/com/jisco/dynamicweight/dynamicbasemeterial/mapper/DynamicBaseMeterialMapper.xml
  9. 31 0
      src/main/java/com/jisco/dynamicweight/dynamicbasemeterial/model/DynamicBaseMeterial.java
  10. 7 2
      src/main/java/com/jisco/dynamicweight/dynamicbasemeterial/service/IDynamicBaseMeterialService.java
  11. 11 2
      src/main/java/com/jisco/dynamicweight/dynamicbasemeterial/service/impl/DynamicBaseMeterialServiceImpl.java
  12. 16 4
      src/main/java/com/jisco/dynamicweight/dynamicbasereciever/controller/DynamicBaseRecieverController.java
  13. 5 0
      src/main/java/com/jisco/dynamicweight/dynamicbasereciever/service/IDynamicBaseRecieverService.java
  14. 9 0
      src/main/java/com/jisco/dynamicweight/dynamicbasereciever/service/impl/DynamicBaseRecieverServiceImpl.java
  15. 2 4
      src/main/java/com/jisco/dynamicweight/dynamicbasescdbconfig/controller/DynamicBaseScdbConfigController.java
  16. 2 4
      src/main/java/com/jisco/dynamicweight/dynamicbasescstation/controller/DynamicBaseScStationController.java
  17. 16 4
      src/main/java/com/jisco/dynamicweight/dynamicbasesender/controller/DynamicBaseSenderController.java
  18. 4 0
      src/main/java/com/jisco/dynamicweight/dynamicbasesender/service/IDynamicBaseSenderService.java
  19. 8 0
      src/main/java/com/jisco/dynamicweight/dynamicbasesender/service/impl/DynamicBaseSenderServiceImpl.java
  20. 2 4
      src/main/java/com/jisco/dynamicweight/dynamicbasestationmaterial/controller/DynamicBaseStationMaterialController.java
  21. 43 0
      src/main/java/com/jisco/dynamicweight/dynamicworkupdata/InbatchDto.java
  22. 71 4
      src/main/java/com/jisco/dynamicweight/dynamicworkupdata/controller/DynamicWorkUpdataController.java
  23. 884 837
      src/main/java/com/jisco/dynamicweight/dynamicworkupdata/mapper/DynamicWorkUpdataMapper.xml
  24. 96 40
      src/main/java/com/jisco/dynamicweight/dynamicworkupdata/model/DynamicWorkUpdata.java
  25. 39 0
      src/main/java/com/jisco/dynamicweight/enums/ValidFlagEnum.java
  26. 8 8
      src/main/java/com/steerinfo/meterwork/meterworkcaractual/mapper/MeterWorkCarActualMapper.xml
  27. 1 1
      src/main/java/com/steerinfo/meterwork/meterworkcaractual/service/impl/MeterWorkCarActualServiceImpl.java
  28. 7 8
      src/main/java/com/steerinfo/meterwork/meterworkcaractualfirst/mapper/MeterWorkCarActualFirstMapper.xml
  29. 6 6
      src/main/java/com/steerinfo/meterwork/meterworkcaractualfirst/service/impl/MeterWorkCarActualFirstServiceImpl.java
  30. 25 10
      src/main/java/com/steerinfo/meterwork/meterworkrailwayactfirst/controller/MeterWorkRailwayActFirstController.java
  31. 7 0
      src/main/java/com/steerinfo/meterwork/meterworkrailwayactfirst/mapper/MeterWorkRailwayActFirstMapper.java
  32. 31 8
      src/main/java/com/steerinfo/meterwork/meterworkrailwayactfirst/mapper/MeterWorkRailwayActFirstMapper.xml
  33. 4 0
      src/main/java/com/steerinfo/meterwork/meterworkrailwayactfirst/service/IMeterWorkRailwayActFirstService.java
  34. 49 23
      src/main/java/com/steerinfo/meterwork/meterworkrailwayactfirst/service/impl/MeterWorkRailwayActFirstServiceImpl.java
  35. 60 2
      src/main/java/com/steerinfo/meterwork/meterworkrailwayactual/controller/MeterWorkRailwayActualController.java
  36. 21 0
      src/main/java/com/steerinfo/meterwork/meterworkrailwayactual/mapper/MeterWorkRailwayActualMapper.java
  37. 78 5
      src/main/java/com/steerinfo/meterwork/meterworkrailwayactual/mapper/MeterWorkRailwayActualMapper.xml
  38. 8 1
      src/main/java/com/steerinfo/meterwork/meterworkrailwayactual/service/IMeterWorkRailwayActualService.java
  39. 249 16
      src/main/java/com/steerinfo/meterwork/meterworkrailwayactual/service/impl/MeterWorkRailwayActualServiceImpl.java

+ 1 - 5
src/main/java/com/jisco/dynamicweight/dynamicbasebatchdbconfig/controller/DynamicBaseBatchdbConfigController.java

@@ -71,13 +71,9 @@ public class DynamicBaseBatchdbConfigController extends BaseRESTfulController {
     @PostMapping(value = "/")
     public RESTfulResult add(@RequestBody DynamicBaseBatchdbConfig model) {
         checkAdd(model);
-        model.setValidFlag("0");
         model.setCreateManNo(UserUtil.getCurrentUserId());
         model.setCreateManName(UserUtil.getCurrentUserName());
         model.setCreateTime(new Date());
-        model.setUpdateManNo(UserUtil.getCurrentUserId());
-        model.setUpdateManName(UserUtil.getCurrentUserName());
-        model.setUpdateTime(new Date());
         DynamicBaseBatchdbConfig dynamicBaseBatchdbConfig = dynamicBaseBatchdbConfigService.add(model);
         return success(dynamicBaseBatchdbConfig);
     }
@@ -88,7 +84,7 @@ public class DynamicBaseBatchdbConfigController extends BaseRESTfulController {
         Assert.isTrue(StringUtils.isNotBlank(model.getTableName()), "表名不能为空");
 //        Assert.isTrue(StringUtils.isNotBlank(model.getCreateManNo()), "创建人不能为空");
 //        Assert.isTrue(StringUtils.isNotBlank(model.getCreateManName()), "创建人名称不能为空");
-//        Assert.isTrue(StringUtils.isNotBlank(model.getValidFlag()), "有效标识不能为空");
+        Assert.isTrue(StringUtils.isNotBlank(model.getValidFlag()), "有效标识不能为空");
     }
 
     @ApiOperation(value = "获取详细信息", notes = "根据url的id来获取详细信息")

+ 21 - 8
src/main/java/com/jisco/dynamicweight/dynamicbasebatchstation/controller/DynamicBaseBatchStationController.java

@@ -6,10 +6,12 @@ import com.jisco.dynamicweight.dynamicbasebatchstation.service.IDynamicBaseBatch
 import com.jisco.dynamicweight.dynamicbasereciever.model.DynamicBaseReciever;
 import com.jisco.dynamicweight.util.ExcelUtil;
 import com.jisco.dynamicweight.util.UserUtil;
+import com.steerinfo.baseinfo.meterbasecalibrarelation.model.MeterBaseCalibraRelation;
 import com.steerinfo.framework.controller.BaseRESTfulController;
 import com.steerinfo.framework.controller.RESTfulResult;
 import com.steerinfo.framework.service.pagehelper.PageList;
 import com.steerinfo.framework.utils.collection.ListUtils;
+import com.steerinfo.meterwork.except.MarkerMetException;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
@@ -19,10 +21,7 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
+import java.util.*;
 
 /**
  * DynamicBaseBatchStation RESTful接口:
@@ -76,13 +75,12 @@ public class DynamicBaseBatchStationController extends BaseRESTfulController {
         Assert.isTrue(StringUtils.isNotBlank(model.getStationName()), "请输入皮带秤名称!");
         Assert.isTrue(StringUtils.isNotBlank(model.getStationCode()), "请输入皮带秤编码!");
         Assert.isTrue(StringUtils.isNotBlank(model.getPikaCode()), "请输入PIKA系统编码!");
-        model.setValidFlag("0");
+        Assert.isTrue(StringUtils.isNotBlank(model.getValidFlag()), "有效标识不能为空!");
+        Assert.isTrue(Objects.nonNull(model.getIsUpload()), "请选择是否上传!");
+        Assert.isTrue(Objects.nonNull(model.getIsInbatches()), "请选择是否分批!");
         model.setCreateManNo(UserUtil.getCurrentUserId());
         model.setCreateManName(UserUtil.getCurrentUserName());
         model.setCreateTime(new Date());
-        model.setUpdateManNo(UserUtil.getCurrentUserId());
-        model.setUpdateManName(UserUtil.getCurrentUserName());
-        model.setUpdateTime(new Date());
         DynamicBaseBatchStation dynamicBaseBatchStation = dynamicBaseBatchStationService.add(model);
         return success(dynamicBaseBatchStation);
     }
@@ -107,6 +105,9 @@ public class DynamicBaseBatchStationController extends BaseRESTfulController {
         Assert.isTrue(StringUtils.isNotBlank(model.getStationName()), "请输入皮带秤名称!");
         Assert.isTrue(StringUtils.isNotBlank(model.getStationCode()), "请输入皮带秤编码!");
         Assert.isTrue(StringUtils.isNotBlank(model.getPikaCode()), "请输入PIKA系统编码!");
+        Assert.isTrue(StringUtils.isNotBlank(model.getValidFlag()), "有效标识不能为空!");
+        Assert.isTrue(Objects.nonNull(model.getIsUpload()), "请选择是否上传!");
+        Assert.isTrue(Objects.nonNull(model.getIsInbatches()), "请选择是否分批!");
         model.setId(id);
         model.setUpdateManNo(UserUtil.getCurrentUserId());
         model.setUpdateManName(UserUtil.getCurrentUserName());
@@ -134,4 +135,16 @@ public class DynamicBaseBatchStationController extends BaseRESTfulController {
         List<DynamicBaseBatchStation> list = dynamicBaseBatchStationService.query(null);
         ExcelUtil.exportExcel(response, list, DynamicBaseBatchStation.class, "分料系统站点信息");
     }
+
+    @ApiOperation(value = "获取列表", notes = "不分页查询")
+    @GetMapping(value = "/noPage")
+    public RESTfulResult listall(@RequestParam HashMap parmas) {
+        try {
+            List<MeterBaseCalibraRelation> list = dynamicBaseBatchStationService.queryall(parmas);
+            return success(list);
+        } catch (Exception ex) {
+            ex.printStackTrace();
+            throw new MarkerMetException(500, "操作异常!!");
+        }
+    }
 }

+ 70 - 17
src/main/java/com/jisco/dynamicweight/dynamicbasebatchstation/mapper/DynamicBaseBatchStationMapper.xml

@@ -7,6 +7,8 @@
     <result column="STATION_CODE" jdbcType="VARCHAR" property="stationCode" />
     <result column="PIKA_CODE" jdbcType="VARCHAR" property="pikaCode" />
     <result column="SENDER_CODE" jdbcType="VARCHAR" property="senderCode" />
+    <result column="IS_UPLOAD" jdbcType="DECIMAL" property="isUpload" />
+    <result column="IS_INBATCHES" jdbcType="DECIMAL" property="isInbatches" />
     <result column="MEMO" jdbcType="VARCHAR" property="memo" />
     <result column="VALID_FLAG" jdbcType="VARCHAR" property="validFlag" />
     <result column="CREATE_MAN_NO" jdbcType="VARCHAR" property="createManNo" />
@@ -17,13 +19,14 @@
     <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
   </resultMap>
   <sql id="columns">
-    STATION_NO, STATION_NAME, STATION_CODE, PIKA_CODE, SENDER_CODE, MEMO, VALID_FLAG, 
-    CREATE_MAN_NO, CREATE_MAN_NAME, CREATE_TIME, UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME
+    STATION_NO, STATION_NAME, STATION_CODE, PIKA_CODE, SENDER_CODE, IS_UPLOAD, IS_INBATCHES, 
+    MEMO, VALID_FLAG, CREATE_MAN_NO, CREATE_MAN_NAME, CREATE_TIME, UPDATE_MAN_NO, UPDATE_MAN_NAME, 
+    UPDATE_TIME
   </sql>
   <sql id="columns_alias">
-    t.STATION_NO, t.STATION_NAME, t.STATION_CODE, t.PIKA_CODE, t.SENDER_CODE, t.MEMO, 
-    t.VALID_FLAG, t.CREATE_MAN_NO, t.CREATE_MAN_NAME, t.CREATE_TIME, t.UPDATE_MAN_NO, 
-    t.UPDATE_MAN_NAME, t.UPDATE_TIME
+    t.STATION_NO, t.STATION_NAME, t.STATION_CODE, t.PIKA_CODE, t.SENDER_CODE, t.IS_UPLOAD, 
+    t.IS_INBATCHES, t.MEMO, t.VALID_FLAG, t.CREATE_MAN_NO, t.CREATE_MAN_NAME, t.CREATE_TIME, 
+    t.UPDATE_MAN_NO, t.UPDATE_MAN_NAME, t.UPDATE_TIME
   </sql>
   <sql id="select">
     SELECT <include refid="columns"/> FROM DYNAMIC_BASE_BATCH_STATION
@@ -48,6 +51,12 @@
       <if test="senderCode != null and senderCode != ''">
         and SENDER_CODE = #{senderCode}
       </if>
+      <if test="isUpload != null">
+        and IS_UPLOAD = #{isUpload}
+      </if>
+      <if test="isInbatches != null">
+        and IS_INBATCHES = #{isInbatches}
+      </if>
       <if test="memo != null and memo != ''">
         and MEMO = #{memo}
       </if>
@@ -91,6 +100,12 @@
       <if test="senderCode != null and senderCode != ''">
         and SENDER_CODE LIKE '%${senderCode}%'
       </if>
+      <if test="isUpload != null">
+        and IS_UPLOAD = #{isUpload}
+      </if>
+      <if test="isInbatches != null">
+        and IS_INBATCHES = #{isInbatches}
+      </if>
       <if test="memo != null and memo != ''">
         and MEMO LIKE '%${memo}%'
       </if>
@@ -136,6 +151,12 @@
       <if test="senderCode != null and senderCode != ''">
         or SENDER_CODE = #{senderCode}
       </if>
+      <if test="isUpload != null">
+        or IS_UPLOAD = #{isUpload}
+      </if>
+      <if test="isInbatches != null">
+        or IS_INBATCHES = #{isInbatches}
+      </if>
       <if test="memo != null and memo != ''">
         or MEMO = #{memo}
       </if>
@@ -163,15 +184,17 @@
   </delete>
   <insert id="insert" parameterType="com.jisco.dynamicweight.dynamicbasebatchstation.model.DynamicBaseBatchStation">
     insert into DYNAMIC_BASE_BATCH_STATION (STATION_NO, STATION_NAME, STATION_CODE, 
-      PIKA_CODE, SENDER_CODE, MEMO, 
-      VALID_FLAG, CREATE_MAN_NO, CREATE_MAN_NAME, 
-      CREATE_TIME, UPDATE_MAN_NO, UPDATE_MAN_NAME, 
-      UPDATE_TIME)
+      PIKA_CODE, SENDER_CODE, IS_UPLOAD, 
+      IS_INBATCHES, MEMO, VALID_FLAG, 
+      CREATE_MAN_NO, CREATE_MAN_NAME, CREATE_TIME, 
+      UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME
+      )
     values (#{stationNo,jdbcType=VARCHAR}, #{stationName,jdbcType=VARCHAR}, #{stationCode,jdbcType=VARCHAR}, 
-      #{pikaCode,jdbcType=VARCHAR}, #{senderCode,jdbcType=VARCHAR}, #{memo,jdbcType=VARCHAR}, 
-      #{validFlag,jdbcType=VARCHAR}, #{createManNo,jdbcType=VARCHAR}, #{createManName,jdbcType=VARCHAR}, 
-      #{createTime,jdbcType=TIMESTAMP}, #{updateManNo,jdbcType=VARCHAR}, #{updateManName,jdbcType=VARCHAR}, 
-      #{updateTime,jdbcType=TIMESTAMP})
+      #{pikaCode,jdbcType=VARCHAR}, #{senderCode,jdbcType=VARCHAR}, #{isUpload,jdbcType=DECIMAL}, 
+      #{isInbatches,jdbcType=DECIMAL}, #{memo,jdbcType=VARCHAR}, #{validFlag,jdbcType=VARCHAR}, 
+      #{createManNo,jdbcType=VARCHAR}, #{createManName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
+      #{updateManNo,jdbcType=VARCHAR}, #{updateManName,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}
+      )
   </insert>
   <insert id="insertSelective" parameterType="com.jisco.dynamicweight.dynamicbasebatchstation.model.DynamicBaseBatchStation">
     insert into DYNAMIC_BASE_BATCH_STATION
@@ -191,6 +214,12 @@
       <if test="senderCode != null">
         SENDER_CODE,
       </if>
+      <if test="isUpload != null">
+        IS_UPLOAD,
+      </if>
+      <if test="isInbatches != null">
+        IS_INBATCHES,
+      </if>
       <if test="memo != null">
         MEMO,
       </if>
@@ -232,6 +261,12 @@
       <if test="senderCode != null">
         #{senderCode,jdbcType=VARCHAR},
       </if>
+      <if test="isUpload != null">
+        #{isUpload,jdbcType=DECIMAL},
+      </if>
+      <if test="isInbatches != null">
+        #{isInbatches,jdbcType=DECIMAL},
+      </if>
       <if test="memo != null">
         #{memo,jdbcType=VARCHAR},
       </if>
@@ -264,6 +299,8 @@
       STATION_CODE = #{stationCode,jdbcType=VARCHAR},
       PIKA_CODE = #{pikaCode,jdbcType=VARCHAR},
       SENDER_CODE = #{senderCode,jdbcType=VARCHAR},
+      IS_UPLOAD = #{isUpload,jdbcType=DECIMAL},
+      IS_INBATCHES = #{isInbatches,jdbcType=DECIMAL},
       MEMO = #{memo,jdbcType=VARCHAR},
       VALID_FLAG = #{validFlag,jdbcType=VARCHAR},
       CREATE_MAN_NO = #{createManNo,jdbcType=VARCHAR},
@@ -289,6 +326,12 @@
       <if test="senderCode != null">
         SENDER_CODE = #{senderCode,jdbcType=VARCHAR},
       </if>
+      <if test="isUpload != null">
+        IS_UPLOAD = #{isUpload,jdbcType=DECIMAL},
+      </if>
+      <if test="isInbatches != null">
+        IS_INBATCHES = #{isInbatches,jdbcType=DECIMAL},
+      </if>
       <if test="memo != null">
         MEMO = #{memo,jdbcType=VARCHAR},
       </if>
@@ -332,16 +375,18 @@
     insert into DYNAMIC_BASE_BATCH_STATION 
       (STATION_NO, 
       STATION_NAME, STATION_CODE, PIKA_CODE, 
-      SENDER_CODE, MEMO, VALID_FLAG, 
-      CREATE_MAN_NO, CREATE_MAN_NAME, CREATE_TIME, 
+      SENDER_CODE, IS_UPLOAD, IS_INBATCHES, 
+      MEMO, VALID_FLAG, CREATE_MAN_NO, 
+      CREATE_MAN_NAME, CREATE_TIME, 
       UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME
       )
     ( <foreach collection="list" item="item" separator="union all"> 
    select  
       #{item.stationNo,jdbcType=VARCHAR}, 
       #{item.stationName,jdbcType=VARCHAR}, #{item.stationCode,jdbcType=VARCHAR}, #{item.pikaCode,jdbcType=VARCHAR}, 
-      #{item.senderCode,jdbcType=VARCHAR}, #{item.memo,jdbcType=VARCHAR}, #{item.validFlag,jdbcType=VARCHAR}, 
-      #{item.createManNo,jdbcType=VARCHAR}, #{item.createManName,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP}, 
+      #{item.senderCode,jdbcType=VARCHAR}, #{item.isUpload,jdbcType=DECIMAL}, #{item.isInbatches,jdbcType=DECIMAL}, 
+      #{item.memo,jdbcType=VARCHAR}, #{item.validFlag,jdbcType=VARCHAR}, #{item.createManNo,jdbcType=VARCHAR}, 
+      #{item.createManName,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP}, 
       #{item.updateManNo,jdbcType=VARCHAR}, #{item.updateManName,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP}
        from dual  
    </foreach> )
@@ -369,6 +414,14 @@
        <foreach collection="list" item="item" index="index" separator=" " open="case STATION_NO" close="end">
           when #{item.stationNo,jdbcType=VARCHAR} then #{item.senderCode,jdbcType=VARCHAR}
        </foreach>
+       ,IS_UPLOAD=
+       <foreach collection="list" item="item" index="index" separator=" " open="case STATION_NO" close="end">
+          when #{item.stationNo,jdbcType=VARCHAR} then #{item.isUpload,jdbcType=DECIMAL}
+       </foreach>
+       ,IS_INBATCHES=
+       <foreach collection="list" item="item" index="index" separator=" " open="case STATION_NO" close="end">
+          when #{item.stationNo,jdbcType=VARCHAR} then #{item.isInbatches,jdbcType=DECIMAL}
+       </foreach>
        ,MEMO=
        <foreach collection="list" item="item" index="index" separator=" " open="case STATION_NO" close="end">
           when #{item.stationNo,jdbcType=VARCHAR} then #{item.memo,jdbcType=VARCHAR}

+ 31 - 0
src/main/java/com/jisco/dynamicweight/dynamicbasebatchstation/model/DynamicBaseBatchStation.java

@@ -4,6 +4,7 @@ import com.steerinfo.framework.model.IBasePO;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
+import java.math.BigDecimal;
 import java.util.Date;
 
 @ApiModel(value="null")
@@ -38,6 +39,18 @@ public class DynamicBaseBatchStation implements IBasePO<String> {
     @ApiModelProperty(value="发货库房编码",required=false)
     private String senderCode;
 
+    /**
+     * 是否上传皮卡(IS_UPLOAD,DECIMAL,38)
+     */
+    @ApiModelProperty(value="是否上传皮卡",required=true)
+    private BigDecimal isUpload;
+
+    /**
+     * 是否分批(IS_INBATCHES,DECIMAL,38)
+     */
+    @ApiModelProperty(value="是否分批",required=true)
+    private BigDecimal isInbatches;
+
     /**
      * 备注(MEMO,VARCHAR,200)
      */
@@ -138,6 +151,22 @@ public class DynamicBaseBatchStation implements IBasePO<String> {
         this.senderCode = senderCode == null ? null : senderCode.trim();
     }
 
+    public BigDecimal getIsUpload() {
+        return isUpload;
+    }
+
+    public void setIsUpload(BigDecimal isUpload) {
+        this.isUpload = isUpload;
+    }
+
+    public BigDecimal getIsInbatches() {
+        return isInbatches;
+    }
+
+    public void setIsInbatches(BigDecimal isInbatches) {
+        this.isInbatches = isInbatches;
+    }
+
     public String getMemo() {
         return memo;
     }
@@ -213,6 +242,8 @@ public class DynamicBaseBatchStation implements IBasePO<String> {
         sb.append(", stationCode=").append(stationCode);
         sb.append(", pikaCode=").append(pikaCode);
         sb.append(", senderCode=").append(senderCode);
+        sb.append(", isUpload=").append(isUpload);
+        sb.append(", isInbatches=").append(isInbatches);
         sb.append(", memo=").append(memo);
         sb.append(", validFlag=").append(validFlag);
         sb.append(", createManNo=").append(createManNo);

+ 5 - 0
src/main/java/com/jisco/dynamicweight/dynamicbasebatchstation/service/IDynamicBaseBatchStationService.java

@@ -1,8 +1,12 @@
 package com.jisco.dynamicweight.dynamicbasebatchstation.service;
 
 import com.jisco.dynamicweight.dynamicbasebatchstation.model.DynamicBaseBatchStation;
+import com.steerinfo.baseinfo.meterbasecalibrarelation.model.MeterBaseCalibraRelation;
 import com.steerinfo.framework.service.IBaseService;
 
+import java.util.HashMap;
+import java.util.List;
+
 /**
  * DynamicBaseBatchStation服务接口:
  * @author generator
@@ -18,4 +22,5 @@ import com.steerinfo.framework.service.IBaseService;
  */
 public interface IDynamicBaseBatchStationService extends IBaseService<DynamicBaseBatchStation, String>{
 
+    List<MeterBaseCalibraRelation> queryall(HashMap parmas);
 }

+ 9 - 0
src/main/java/com/jisco/dynamicweight/dynamicbasebatchstation/service/impl/DynamicBaseBatchStationServiceImpl.java

@@ -3,11 +3,15 @@ package com.jisco.dynamicweight.dynamicbasebatchstation.service.impl;
 import com.jisco.dynamicweight.dynamicbasebatchstation.mapper.DynamicBaseBatchStationMapper;
 import com.jisco.dynamicweight.dynamicbasebatchstation.model.DynamicBaseBatchStation;
 import com.jisco.dynamicweight.dynamicbasebatchstation.service.IDynamicBaseBatchStationService;
+import com.steerinfo.baseinfo.meterbasecalibrarelation.model.MeterBaseCalibraRelation;
 import com.steerinfo.framework.mapper.IBaseMapper;
 import com.steerinfo.framework.service.impl.BaseServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.HashMap;
+import java.util.List;
+
 /**
  * DynamicBaseBatchStation服务实现:
  * @author generator
@@ -31,4 +35,9 @@ public class DynamicBaseBatchStationServiceImpl extends BaseServiceImpl<DynamicB
     protected IBaseMapper<DynamicBaseBatchStation, String> getMapper() {
         return dynamicBaseBatchStationMapper;
     }
+
+    @Override
+    public List<MeterBaseCalibraRelation> queryall(HashMap parmas) {
+        return dynamicBaseBatchStationMapper.selectByParameters(parmas);
+    }
 }

+ 21 - 8
src/main/java/com/jisco/dynamicweight/dynamicbasemeterial/controller/DynamicBaseMeterialController.java

@@ -6,10 +6,12 @@ import com.jisco.dynamicweight.dynamicbasemeterial.service.IDynamicBaseMeterialS
 import com.jisco.dynamicweight.dynamicbasescstation.model.DynamicBaseScStation;
 import com.jisco.dynamicweight.util.ExcelUtil;
 import com.jisco.dynamicweight.util.UserUtil;
+import com.steerinfo.baseinfo.meterbasecalibrarelation.model.MeterBaseCalibraRelation;
 import com.steerinfo.framework.controller.BaseRESTfulController;
 import com.steerinfo.framework.controller.RESTfulResult;
 import com.steerinfo.framework.service.pagehelper.PageList;
 import com.steerinfo.framework.utils.collection.ListUtils;
+import com.steerinfo.meterwork.except.MarkerMetException;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
@@ -19,10 +21,7 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
+import java.util.*;
 
 /**
  * DynamicBaseMeterial RESTful接口:
@@ -76,13 +75,12 @@ public class DynamicBaseMeterialController extends BaseRESTfulController {
         Assert.isTrue(StringUtils.isNotBlank(model.getMeterialName()), "请输入物料名称!");
         Assert.isTrue(StringUtils.isNotBlank(model.getMeterialCode()), "请输入物料编码!");
         Assert.isTrue(StringUtils.isNotBlank(model.getPikaMeterialName()), "请输入皮卡系统物料名称!");
-        model.setValidFlag("0");
+        Assert.isTrue(StringUtils.isNotBlank(model.getValidFlag()), "有效标识不能为空!");
+        Assert.isTrue(Objects.nonNull(model.getIsReturnedDust()), "请选择是否返粉!");
+        Assert.isTrue(Objects.nonNull(model.getIsCoke()), "请选择是否是焦炭!");
         model.setCreateManNo(UserUtil.getCurrentUserId());
         model.setCreateManName(UserUtil.getCurrentUserName());
         model.setCreateTime(new Date());
-        model.setUpdateManNo(UserUtil.getCurrentUserId());
-        model.setUpdateManName(UserUtil.getCurrentUserName());
-        model.setUpdateTime(new Date());
         DynamicBaseMeterial dynamicBaseMeterial = dynamicBaseMeterialService.add(model);
         return success(dynamicBaseMeterial);
     }
@@ -107,6 +105,9 @@ public class DynamicBaseMeterialController extends BaseRESTfulController {
         Assert.isTrue(StringUtils.isNotBlank(model.getMeterialName()), "请输入物料名称!");
         Assert.isTrue(StringUtils.isNotBlank(model.getMeterialCode()), "请输入物料编码!");
         Assert.isTrue(StringUtils.isNotBlank(model.getPikaMeterialName()), "请输入皮卡系统物料名称!");
+        Assert.isTrue(StringUtils.isNotBlank(model.getValidFlag()), "有效标识不能为空!");
+        Assert.isTrue(Objects.nonNull(model.getIsReturnedDust()), "请选择是否返粉!");
+        Assert.isTrue(Objects.nonNull(model.getIsCoke()), "请选择是否是焦炭!");
         model.setId(id);
         model.setUpdateManNo(UserUtil.getCurrentUserId());
         model.setUpdateManName(UserUtil.getCurrentUserName());
@@ -134,4 +135,16 @@ public class DynamicBaseMeterialController extends BaseRESTfulController {
         List<DynamicBaseMeterial> list = dynamicBaseMeterialService.query(null);
         ExcelUtil.exportExcel(response, list, DynamicBaseMeterial.class, "动态秤物料信息");
     }
+
+    @ApiOperation(value = "获取列表", notes = "不分页查询")
+    @GetMapping(value = "/noPage")
+    public RESTfulResult listall(@RequestParam HashMap parmas) {
+        try {
+            List<MeterBaseCalibraRelation> list = dynamicBaseMeterialService.queryall(parmas);
+            return success(list);
+        } catch (Exception ex) {
+            ex.printStackTrace();
+            throw new MarkerMetException(500, "操作异常!!");
+        }
+    }
 }

+ 70 - 21
src/main/java/com/jisco/dynamicweight/dynamicbasemeterial/mapper/DynamicBaseMeterialMapper.xml

@@ -6,6 +6,8 @@
     <result column="METERIAL_NAME" jdbcType="VARCHAR" property="meterialName" />
     <result column="METERIAL_CODE" jdbcType="VARCHAR" property="meterialCode" />
     <result column="PIKA_METERIAL_NAME" jdbcType="VARCHAR" property="pikaMeterialName" />
+    <result column="IS_RETURNED_DUST" jdbcType="DECIMAL" property="isReturnedDust" />
+    <result column="IS_COKE" jdbcType="DECIMAL" property="isCoke" />
     <result column="MEMO" jdbcType="VARCHAR" property="memo" />
     <result column="VALID_FLAG" jdbcType="VARCHAR" property="validFlag" />
     <result column="CREATE_MAN_NO" jdbcType="VARCHAR" property="createManNo" />
@@ -16,13 +18,14 @@
     <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
   </resultMap>
   <sql id="columns">
-    METERIAL_NO, METERIAL_NAME, METERIAL_CODE, PIKA_METERIAL_NAME, MEMO, VALID_FLAG, 
-    CREATE_MAN_NO, CREATE_MAN_NAME, CREATE_TIME, UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME
+    METERIAL_NO, METERIAL_NAME, METERIAL_CODE, PIKA_METERIAL_NAME, IS_RETURNED_DUST, 
+    IS_COKE, MEMO, VALID_FLAG, CREATE_MAN_NO, CREATE_MAN_NAME, CREATE_TIME, UPDATE_MAN_NO, 
+    UPDATE_MAN_NAME, UPDATE_TIME
   </sql>
   <sql id="columns_alias">
-    t.METERIAL_NO, t.METERIAL_NAME, t.METERIAL_CODE, t.PIKA_METERIAL_NAME, t.MEMO, t.VALID_FLAG, 
-    t.CREATE_MAN_NO, t.CREATE_MAN_NAME, t.CREATE_TIME, t.UPDATE_MAN_NO, t.UPDATE_MAN_NAME, 
-    t.UPDATE_TIME
+    t.METERIAL_NO, t.METERIAL_NAME, t.METERIAL_CODE, t.PIKA_METERIAL_NAME, t.IS_RETURNED_DUST, 
+    t.IS_COKE, t.MEMO, t.VALID_FLAG, t.CREATE_MAN_NO, t.CREATE_MAN_NAME, t.CREATE_TIME, 
+    t.UPDATE_MAN_NO, t.UPDATE_MAN_NAME, t.UPDATE_TIME
   </sql>
   <sql id="select">
     SELECT <include refid="columns"/> FROM DYNAMIC_BASE_METERIAL
@@ -44,6 +47,12 @@
       <if test="pikaMeterialName != null and pikaMeterialName != ''">
         and PIKA_METERIAL_NAME = #{pikaMeterialName}
       </if>
+      <if test="isReturnedDust != null">
+        and IS_RETURNED_DUST = #{isReturnedDust}
+      </if>
+      <if test="isCoke != null">
+        and IS_COKE = #{isCoke}
+      </if>
       <if test="memo != null and memo != ''">
         and MEMO = #{memo}
       </if>
@@ -84,6 +93,12 @@
       <if test="pikaMeterialName != null and pikaMeterialName != ''">
         and PIKA_METERIAL_NAME LIKE '%${pikaMeterialName}%'
       </if>
+      <if test="isReturnedDust != null">
+        and IS_RETURNED_DUST = #{isReturnedDust}
+      </if>
+      <if test="isCoke != null">
+        and IS_COKE = #{isCoke}
+      </if>
       <if test="memo != null and memo != ''">
         and MEMO LIKE '%${memo}%'
       </if>
@@ -126,6 +141,12 @@
       <if test="pikaMeterialName != null and pikaMeterialName != ''">
         or PIKA_METERIAL_NAME = #{pikaMeterialName}
       </if>
+      <if test="isReturnedDust != null">
+        or IS_RETURNED_DUST = #{isReturnedDust}
+      </if>
+      <if test="isCoke != null">
+        or IS_COKE = #{isCoke}
+      </if>
       <if test="memo != null and memo != ''">
         or MEMO = #{memo}
       </if>
@@ -153,15 +174,15 @@
   </delete>
   <insert id="insert" parameterType="com.jisco.dynamicweight.dynamicbasemeterial.model.DynamicBaseMeterial">
     insert into DYNAMIC_BASE_METERIAL (METERIAL_NO, METERIAL_NAME, METERIAL_CODE, 
-      PIKA_METERIAL_NAME, MEMO, VALID_FLAG, 
-      CREATE_MAN_NO, CREATE_MAN_NAME, CREATE_TIME, 
-      UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME
-      )
+      PIKA_METERIAL_NAME, IS_RETURNED_DUST, IS_COKE, 
+      MEMO, VALID_FLAG, CREATE_MAN_NO, 
+      CREATE_MAN_NAME, CREATE_TIME, UPDATE_MAN_NO, 
+      UPDATE_MAN_NAME, UPDATE_TIME)
     values (#{meterialNo,jdbcType=VARCHAR}, #{meterialName,jdbcType=VARCHAR}, #{meterialCode,jdbcType=VARCHAR}, 
-      #{pikaMeterialName,jdbcType=VARCHAR}, #{memo,jdbcType=VARCHAR}, #{validFlag,jdbcType=VARCHAR}, 
-      #{createManNo,jdbcType=VARCHAR}, #{createManName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
-      #{updateManNo,jdbcType=VARCHAR}, #{updateManName,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}
-      )
+      #{pikaMeterialName,jdbcType=VARCHAR}, #{isReturnedDust,jdbcType=DECIMAL}, #{isCoke,jdbcType=DECIMAL}, 
+      #{memo,jdbcType=VARCHAR}, #{validFlag,jdbcType=VARCHAR}, #{createManNo,jdbcType=VARCHAR}, 
+      #{createManName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateManNo,jdbcType=VARCHAR}, 
+      #{updateManName,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP})
   </insert>
   <insert id="insertSelective" parameterType="com.jisco.dynamicweight.dynamicbasemeterial.model.DynamicBaseMeterial">
     insert into DYNAMIC_BASE_METERIAL
@@ -178,6 +199,12 @@
       <if test="pikaMeterialName != null">
         PIKA_METERIAL_NAME,
       </if>
+      <if test="isReturnedDust != null">
+        IS_RETURNED_DUST,
+      </if>
+      <if test="isCoke != null">
+        IS_COKE,
+      </if>
       <if test="memo != null">
         MEMO,
       </if>
@@ -216,6 +243,12 @@
       <if test="pikaMeterialName != null">
         #{pikaMeterialName,jdbcType=VARCHAR},
       </if>
+      <if test="isReturnedDust != null">
+        #{isReturnedDust,jdbcType=DECIMAL},
+      </if>
+      <if test="isCoke != null">
+        #{isCoke,jdbcType=DECIMAL},
+      </if>
       <if test="memo != null">
         #{memo,jdbcType=VARCHAR},
       </if>
@@ -247,6 +280,8 @@
     set METERIAL_NAME = #{meterialName,jdbcType=VARCHAR},
       METERIAL_CODE = #{meterialCode,jdbcType=VARCHAR},
       PIKA_METERIAL_NAME = #{pikaMeterialName,jdbcType=VARCHAR},
+      IS_RETURNED_DUST = #{isReturnedDust,jdbcType=DECIMAL},
+      IS_COKE = #{isCoke,jdbcType=DECIMAL},
       MEMO = #{memo,jdbcType=VARCHAR},
       VALID_FLAG = #{validFlag,jdbcType=VARCHAR},
       CREATE_MAN_NO = #{createManNo,jdbcType=VARCHAR},
@@ -269,6 +304,12 @@
       <if test="pikaMeterialName != null">
         PIKA_METERIAL_NAME = #{pikaMeterialName,jdbcType=VARCHAR},
       </if>
+      <if test="isReturnedDust != null">
+        IS_RETURNED_DUST = #{isReturnedDust,jdbcType=DECIMAL},
+      </if>
+      <if test="isCoke != null">
+        IS_COKE = #{isCoke,jdbcType=DECIMAL},
+      </if>
       <if test="memo != null">
         MEMO = #{memo,jdbcType=VARCHAR},
       </if>
@@ -312,18 +353,18 @@
     insert into DYNAMIC_BASE_METERIAL 
       (METERIAL_NO, 
       METERIAL_NAME, METERIAL_CODE, PIKA_METERIAL_NAME, 
-      MEMO, VALID_FLAG, CREATE_MAN_NO, 
-      CREATE_MAN_NAME, CREATE_TIME, 
-      UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME
-      )
+      IS_RETURNED_DUST, IS_COKE, MEMO, 
+      VALID_FLAG, CREATE_MAN_NO, CREATE_MAN_NAME, 
+      CREATE_TIME, UPDATE_MAN_NO, UPDATE_MAN_NAME, 
+      UPDATE_TIME)
     ( <foreach collection="list" item="item" separator="union all"> 
    select  
       #{item.meterialNo,jdbcType=VARCHAR}, 
       #{item.meterialName,jdbcType=VARCHAR}, #{item.meterialCode,jdbcType=VARCHAR}, #{item.pikaMeterialName,jdbcType=VARCHAR}, 
-      #{item.memo,jdbcType=VARCHAR}, #{item.validFlag,jdbcType=VARCHAR}, #{item.createManNo,jdbcType=VARCHAR}, 
-      #{item.createManName,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP}, 
-      #{item.updateManNo,jdbcType=VARCHAR}, #{item.updateManName,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP}
-       from dual  
+      #{item.isReturnedDust,jdbcType=DECIMAL}, #{item.isCoke,jdbcType=DECIMAL}, #{item.memo,jdbcType=VARCHAR}, 
+      #{item.validFlag,jdbcType=VARCHAR}, #{item.createManNo,jdbcType=VARCHAR}, #{item.createManName,jdbcType=VARCHAR}, 
+      #{item.createTime,jdbcType=TIMESTAMP}, #{item.updateManNo,jdbcType=VARCHAR}, #{item.updateManName,jdbcType=VARCHAR}, 
+      #{item.updateTime,jdbcType=TIMESTAMP} from dual  
    </foreach> )
   </insert>
   <update id="batchUpdate" parameterType="java.util.List">
@@ -345,6 +386,14 @@
        <foreach collection="list" item="item" index="index" separator=" " open="case METERIAL_NO" close="end">
           when #{item.meterialNo,jdbcType=VARCHAR} then #{item.pikaMeterialName,jdbcType=VARCHAR}
        </foreach>
+       ,IS_RETURNED_DUST=
+       <foreach collection="list" item="item" index="index" separator=" " open="case METERIAL_NO" close="end">
+          when #{item.meterialNo,jdbcType=VARCHAR} then #{item.isReturnedDust,jdbcType=DECIMAL}
+       </foreach>
+       ,IS_COKE=
+       <foreach collection="list" item="item" index="index" separator=" " open="case METERIAL_NO" close="end">
+          when #{item.meterialNo,jdbcType=VARCHAR} then #{item.isCoke,jdbcType=DECIMAL}
+       </foreach>
        ,MEMO=
        <foreach collection="list" item="item" index="index" separator=" " open="case METERIAL_NO" close="end">
           when #{item.meterialNo,jdbcType=VARCHAR} then #{item.memo,jdbcType=VARCHAR}

+ 31 - 0
src/main/java/com/jisco/dynamicweight/dynamicbasemeterial/model/DynamicBaseMeterial.java

@@ -4,6 +4,7 @@ import com.steerinfo.framework.model.IBasePO;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
+import java.math.BigDecimal;
 import java.util.Date;
 
 @ApiModel(value="动态秤物料表")
@@ -32,6 +33,18 @@ public class DynamicBaseMeterial implements IBasePO<String> {
     @ApiModelProperty(value="PIKA物料名称",required=false)
     private String pikaMeterialName;
 
+    /**
+     * 是否返粉(IS_RETURNED_DUST,DECIMAL,38)
+     */
+    @ApiModelProperty(value="是否返粉",required=true)
+    private BigDecimal isReturnedDust;
+
+    /**
+     * 是否焦炭(IS_COKE,DECIMAL,0)
+     */
+    @ApiModelProperty(value="是否焦炭",required=true)
+    private Short isCoke;
+
     /**
      * 备注(MEMO,VARCHAR,200)
      */
@@ -124,6 +137,22 @@ public class DynamicBaseMeterial implements IBasePO<String> {
         this.pikaMeterialName = pikaMeterialName == null ? null : pikaMeterialName.trim();
     }
 
+    public BigDecimal getIsReturnedDust() {
+        return isReturnedDust;
+    }
+
+    public void setIsReturnedDust(BigDecimal isReturnedDust) {
+        this.isReturnedDust = isReturnedDust;
+    }
+
+    public Short getIsCoke() {
+        return isCoke;
+    }
+
+    public void setIsCoke(Short isCoke) {
+        this.isCoke = isCoke;
+    }
+
     public String getMemo() {
         return memo;
     }
@@ -198,6 +227,8 @@ public class DynamicBaseMeterial implements IBasePO<String> {
         sb.append(", meterialName=").append(meterialName);
         sb.append(", meterialCode=").append(meterialCode);
         sb.append(", pikaMeterialName=").append(pikaMeterialName);
+        sb.append(", isReturnedDust=").append(isReturnedDust);
+        sb.append(", isCoke=").append(isCoke);
         sb.append(", memo=").append(memo);
         sb.append(", validFlag=").append(validFlag);
         sb.append(", createManNo=").append(createManNo);

+ 7 - 2
src/main/java/com/jisco/dynamicweight/dynamicbasemeterial/service/IDynamicBaseMeterialService.java

@@ -1,15 +1,19 @@
 package com.jisco.dynamicweight.dynamicbasemeterial.service;
 
 import com.jisco.dynamicweight.dynamicbasemeterial.model.DynamicBaseMeterial;
+import com.steerinfo.baseinfo.meterbasecalibrarelation.model.MeterBaseCalibraRelation;
 import com.steerinfo.framework.service.IBaseService;
 
+import java.util.HashMap;
+import java.util.List;
+
 /**
  * DynamicBaseMeterial服务接口:
  * @author generator
- * @version 1.0-SNAPSHORT 2022-01-06 10:10
+ * @version 1.0-SNAPSHORT 2022-01-19 04:34
  * 类描述
  * 修订历史:
- * 日期:2022-01-06
+ * 日期:2022-01-19
  * 作者:generator
  * 参考:
  * 描述:DynamicBaseMeterial服务接口
@@ -18,4 +22,5 @@ import com.steerinfo.framework.service.IBaseService;
  */
 public interface IDynamicBaseMeterialService extends IBaseService<DynamicBaseMeterial, String>{
 
+    List<MeterBaseCalibraRelation> queryall(HashMap parmas);
 }

+ 11 - 2
src/main/java/com/jisco/dynamicweight/dynamicbasemeterial/service/impl/DynamicBaseMeterialServiceImpl.java

@@ -3,18 +3,22 @@ package com.jisco.dynamicweight.dynamicbasemeterial.service.impl;
 import com.jisco.dynamicweight.dynamicbasemeterial.mapper.DynamicBaseMeterialMapper;
 import com.jisco.dynamicweight.dynamicbasemeterial.model.DynamicBaseMeterial;
 import com.jisco.dynamicweight.dynamicbasemeterial.service.IDynamicBaseMeterialService;
+import com.steerinfo.baseinfo.meterbasecalibrarelation.model.MeterBaseCalibraRelation;
 import com.steerinfo.framework.mapper.IBaseMapper;
 import com.steerinfo.framework.service.impl.BaseServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.HashMap;
+import java.util.List;
+
 /**
  * DynamicBaseMeterial服务实现:
  * @author generator
- * @version 1.0-SNAPSHORT 2022-01-06 10:10
+ * @version 1.0-SNAPSHORT 2022-01-19 04:34
  * 类描述
  * 修订历史:
- * 日期:2022-01-06
+ * 日期:2022-01-19
  * 作者:generator
  * 参考:
  * 描述:DynamicBaseMeterial服务实现
@@ -31,4 +35,9 @@ public class DynamicBaseMeterialServiceImpl extends BaseServiceImpl<DynamicBaseM
     protected IBaseMapper<DynamicBaseMeterial, String> getMapper() {
         return dynamicBaseMeterialMapper;
     }
+
+    @Override
+    public List<MeterBaseCalibraRelation> queryall(HashMap parmas) {
+        return dynamicBaseMeterialMapper.selectByParameters(parmas);
+    }
 }

+ 16 - 4
src/main/java/com/jisco/dynamicweight/dynamicbasereciever/controller/DynamicBaseRecieverController.java

@@ -6,10 +6,12 @@ import com.jisco.dynamicweight.dynamicbasereciever.model.DynamicBaseReciever;
 import com.jisco.dynamicweight.dynamicbasereciever.service.IDynamicBaseRecieverService;
 import com.jisco.dynamicweight.util.ExcelUtil;
 import com.jisco.dynamicweight.util.UserUtil;
+import com.steerinfo.baseinfo.meterbasecalibrarelation.model.MeterBaseCalibraRelation;
 import com.steerinfo.framework.controller.BaseRESTfulController;
 import com.steerinfo.framework.controller.RESTfulResult;
 import com.steerinfo.framework.service.pagehelper.PageList;
 import com.steerinfo.framework.utils.collection.ListUtils;
+import com.steerinfo.meterwork.except.MarkerMetException;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
@@ -78,13 +80,10 @@ public class DynamicBaseRecieverController extends BaseRESTfulController {
         Assert.isTrue(StringUtils.isNotBlank(model.getReceiverCode()), "请输入PIKA系统收货单位编码!");
         Assert.isTrue(StringUtils.isNotBlank(model.getReceiverType()), "请输入PIKA系统收货点类型!");
         Assert.isTrue(StringUtils.isNotBlank(model.getDisSysName()), "请输入分料系统收货单位名称!");
-        model.setValidFlag("0");
+        Assert.isTrue(StringUtils.isNotBlank(model.getValidFlag()), "有效标识不能为空!");
         model.setCreateManNo(UserUtil.getCurrentUserId());
         model.setCreateManName(UserUtil.getCurrentUserName());
         model.setCreateTime(new Date());
-        model.setUpdateManNo(UserUtil.getCurrentUserId());
-        model.setUpdateManName(UserUtil.getCurrentUserName());
-        model.setUpdateTime(new Date());
         DynamicBaseReciever dynamicBaseReciever = dynamicBaseRecieverService.add(model);
         return success(dynamicBaseReciever);
     }
@@ -110,6 +109,7 @@ public class DynamicBaseRecieverController extends BaseRESTfulController {
         Assert.isTrue(StringUtils.isNotBlank(model.getReceiverCode()), "请输入PIKA系统收货单位编码!");
         Assert.isTrue(StringUtils.isNotBlank(model.getReceiverType()), "请输入PIKA系统收货点类型!");
         Assert.isTrue(StringUtils.isNotBlank(model.getDisSysName()), "请输入分料系统收货单位名称!");
+        Assert.isTrue(StringUtils.isNotBlank(model.getValidFlag()), "有效标识不能为空!");
         model.setId(id);
         model.setUpdateManNo(UserUtil.getCurrentUserId());
         model.setUpdateManName(UserUtil.getCurrentUserName());
@@ -137,4 +137,16 @@ public class DynamicBaseRecieverController extends BaseRESTfulController {
         List<DynamicBaseReciever> list = dynamicBaseRecieverService.query(null);
         ExcelUtil.exportExcel(response, list, DynamicBaseReciever.class, "收货单位信息");
     }
+
+    @ApiOperation(value = "获取列表", notes = "不分页查询")
+    @GetMapping(value = "/noPage")
+    public RESTfulResult listall(@RequestParam HashMap parmas) {
+        try {
+            List<MeterBaseCalibraRelation> list = dynamicBaseRecieverService.queryall(parmas);
+            return success(list);
+        } catch (Exception ex) {
+            ex.printStackTrace();
+            throw new MarkerMetException(500, "操作异常!!");
+        }
+    }
 }

+ 5 - 0
src/main/java/com/jisco/dynamicweight/dynamicbasereciever/service/IDynamicBaseRecieverService.java

@@ -1,8 +1,12 @@
 package com.jisco.dynamicweight.dynamicbasereciever.service;
 
 import com.jisco.dynamicweight.dynamicbasereciever.model.DynamicBaseReciever;
+import com.steerinfo.baseinfo.meterbasecalibrarelation.model.MeterBaseCalibraRelation;
 import com.steerinfo.framework.service.IBaseService;
 
+import java.util.HashMap;
+import java.util.List;
+
 /**
  * DynamicBaseReciever服务接口:
  * @author generator
@@ -18,4 +22,5 @@ import com.steerinfo.framework.service.IBaseService;
  */
 public interface IDynamicBaseRecieverService extends IBaseService<DynamicBaseReciever, String>{
 
+    List<MeterBaseCalibraRelation> queryall(HashMap parmas);
 }

+ 9 - 0
src/main/java/com/jisco/dynamicweight/dynamicbasereciever/service/impl/DynamicBaseRecieverServiceImpl.java

@@ -3,11 +3,15 @@ package com.jisco.dynamicweight.dynamicbasereciever.service.impl;
 import com.jisco.dynamicweight.dynamicbasereciever.mapper.DynamicBaseRecieverMapper;
 import com.jisco.dynamicweight.dynamicbasereciever.model.DynamicBaseReciever;
 import com.jisco.dynamicweight.dynamicbasereciever.service.IDynamicBaseRecieverService;
+import com.steerinfo.baseinfo.meterbasecalibrarelation.model.MeterBaseCalibraRelation;
 import com.steerinfo.framework.mapper.IBaseMapper;
 import com.steerinfo.framework.service.impl.BaseServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.HashMap;
+import java.util.List;
+
 /**
  * DynamicBaseReciever服务实现:
  * @author generator
@@ -31,4 +35,9 @@ public class DynamicBaseRecieverServiceImpl extends BaseServiceImpl<DynamicBaseR
     protected IBaseMapper<DynamicBaseReciever, String> getMapper() {
         return dynamicBaseRecieverMapper;
     }
+
+    @Override
+    public List<MeterBaseCalibraRelation> queryall(HashMap parmas) {
+        return dynamicBaseRecieverMapper.selectByParameters(parmas);
+    }
 }

+ 2 - 4
src/main/java/com/jisco/dynamicweight/dynamicbasescdbconfig/controller/DynamicBaseScdbConfigController.java

@@ -78,13 +78,10 @@ public class DynamicBaseScdbConfigController extends BaseRESTfulController {
         Assert.isTrue(StringUtils.isNotBlank(model.getUsername()), "请输入用户名!");
         Assert.isTrue(StringUtils.isNotBlank(model.getPassword()), "请输入密码!");
         Assert.isTrue(StringUtils.isNotBlank(model.getTableName()), "请输入表名!");
-        model.setValidFlag("0");
+        Assert.isTrue(StringUtils.isNotBlank(model.getValidFlag()), "有效标识不能为空!");
         model.setCreateManNo(UserUtil.getCurrentUserId());
         model.setCreateManName(UserUtil.getCurrentUserName());
         model.setCreateTime(new Date());
-        model.setUpdateManNo(UserUtil.getCurrentUserId());
-        model.setUpdateManName(UserUtil.getCurrentUserName());
-        model.setUpdateTime(new Date());
         DynamicBaseScdbConfig dynamicBaseScdbConfig = dynamicBaseScdbConfigService.add(model);
         return success(dynamicBaseScdbConfig);
     }
@@ -111,6 +108,7 @@ public class DynamicBaseScdbConfigController extends BaseRESTfulController {
         Assert.isTrue(StringUtils.isNotBlank(model.getUsername()), "请输入用户名!");
         Assert.isTrue(StringUtils.isNotBlank(model.getPassword()), "请输入密码!");
         Assert.isTrue(StringUtils.isNotBlank(model.getTableName()), "请输入表名!");
+        Assert.isTrue(StringUtils.isNotBlank(model.getValidFlag()), "有效标识不能为空!");
         model.setId(id);
         model.setUpdateManNo(UserUtil.getCurrentUserId());
         model.setUpdateManName(UserUtil.getCurrentUserName());

+ 2 - 4
src/main/java/com/jisco/dynamicweight/dynamicbasescstation/controller/DynamicBaseScStationController.java

@@ -82,13 +82,10 @@ public class DynamicBaseScStationController extends BaseRESTfulController {
         Assert.isTrue(StringUtils.isNotBlank(model.getRecieverCode()), "请输入收货库房编码!");
         Assert.isTrue(StringUtils.isNotBlank(model.getRecieverName()), "请输入收货库房!");
         Assert.isTrue(StringUtils.isNotBlank(model.getRecieverType()), "请输入收货点类型!");
-        model.setValidFlag("0");
+        Assert.isTrue(StringUtils.isNotBlank(model.getValidFlag()), "有效标识不能为空!");
         model.setCreateManNo(UserUtil.getCurrentUserId());
         model.setCreateManName(UserUtil.getCurrentUserName());
         model.setCreateTime(new Date());
-        model.setUpdateManNo(UserUtil.getCurrentUserId());
-        model.setUpdateManName(UserUtil.getCurrentUserName());
-        model.setUpdateTime(new Date());
         DynamicBaseScStation dynamicBaseScStation = dynamicBaseScStationService.add(model);
         return success(dynamicBaseScStation);
     }
@@ -119,6 +116,7 @@ public class DynamicBaseScStationController extends BaseRESTfulController {
         Assert.isTrue(StringUtils.isNotBlank(model.getRecieverCode()), "请输入收货库房编码!");
         Assert.isTrue(StringUtils.isNotBlank(model.getRecieverName()), "请输入收货库房!");
         Assert.isTrue(StringUtils.isNotBlank(model.getRecieverType()), "请输入收货点类型!");
+        Assert.isTrue(StringUtils.isNotBlank(model.getValidFlag()), "有效标识不能为空!");
         model.setId(id);
         model.setUpdateManNo(UserUtil.getCurrentUserId());
         model.setUpdateManName(UserUtil.getCurrentUserName());

+ 16 - 4
src/main/java/com/jisco/dynamicweight/dynamicbasesender/controller/DynamicBaseSenderController.java

@@ -4,12 +4,14 @@ import cn.hutool.core.lang.Assert;
 import com.jisco.dynamicweight.dynamicbasereciever.model.DynamicBaseReciever;
 import com.jisco.dynamicweight.util.ExcelUtil;
 import com.jisco.dynamicweight.util.UserUtil;
+import com.steerinfo.baseinfo.meterbasecalibrarelation.model.MeterBaseCalibraRelation;
 import com.steerinfo.framework.controller.BaseRESTfulController;
 import com.steerinfo.framework.controller.RESTfulResult;
 import com.steerinfo.framework.service.pagehelper.PageList;
 import com.steerinfo.framework.utils.collection.ListUtils;
 import com.jisco.dynamicweight.dynamicbasesender.model.DynamicBaseSender;
 import com.jisco.dynamicweight.dynamicbasesender.service.IDynamicBaseSenderService;
+import com.steerinfo.meterwork.except.MarkerMetException;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
@@ -76,13 +78,10 @@ public class DynamicBaseSenderController extends BaseRESTfulController {
         Assert.isTrue(StringUtils.isNotBlank(model.getSenderCode()), "请输入PIKA系统发货单位编码!");
         Assert.isTrue(StringUtils.isNotBlank(model.getSenderType()), "请输入发货点类型!");
         Assert.isTrue(StringUtils.isNotBlank(model.getDisSysName()), "请输入分料系统名称!");
-        model.setValidFlag("0");
+        Assert.isTrue(StringUtils.isNotBlank(model.getValidFlag()), "有效标识不能为空!");
         model.setCreateManNo(UserUtil.getCurrentUserId());
         model.setCreateManName(UserUtil.getCurrentUserName());
         model.setCreateTime(new Date());
-        model.setUpdateManNo(UserUtil.getCurrentUserId());
-        model.setUpdateManName(UserUtil.getCurrentUserName());
-        model.setUpdateTime(new Date());
         DynamicBaseSender dynamicBaseSender = dynamicBaseSenderService.add(model);
         return success(dynamicBaseSender);
     }
@@ -108,6 +107,7 @@ public class DynamicBaseSenderController extends BaseRESTfulController {
         Assert.isTrue(StringUtils.isNotBlank(model.getSenderCode()), "请输入PIKA系统发货单位编码!");
         Assert.isTrue(StringUtils.isNotBlank(model.getSenderType()), "请输入发货点类型!");
         Assert.isTrue(StringUtils.isNotBlank(model.getDisSysName()), "请输入分料系统名称!");
+        Assert.isTrue(StringUtils.isNotBlank(model.getValidFlag()), "有效标识不能为空!");
         model.setId(id);
         model.setUpdateManNo(UserUtil.getCurrentUserId());
         model.setUpdateManName(UserUtil.getCurrentUserName());
@@ -135,4 +135,16 @@ public class DynamicBaseSenderController extends BaseRESTfulController {
         List<DynamicBaseSender> list = dynamicBaseSenderService.query(null);
         ExcelUtil.exportExcel(response, list, DynamicBaseSender.class, "发货单位信息");
     }
+
+    @ApiOperation(value = "获取列表", notes = "不分页查询")
+    @GetMapping(value = "/noPage")
+    public RESTfulResult listall(@RequestParam HashMap parmas) {
+        try {
+            List<MeterBaseCalibraRelation> list = dynamicBaseSenderService.queryall(parmas);
+            return success(list);
+        } catch (Exception ex) {
+            ex.printStackTrace();
+            throw new MarkerMetException(500, "操作异常!!");
+        }
+    }
 }

+ 4 - 0
src/main/java/com/jisco/dynamicweight/dynamicbasesender/service/IDynamicBaseSenderService.java

@@ -1,9 +1,12 @@
 package com.jisco.dynamicweight.dynamicbasesender.service;
 
+import com.steerinfo.baseinfo.meterbasecalibrarelation.model.MeterBaseCalibraRelation;
 import com.steerinfo.framework.service.IBaseService;
 import com.jisco.dynamicweight.dynamicbasesender.model.DynamicBaseSender;
 import java.util.Date;
 import java.math.BigDecimal;
+import java.util.HashMap;
+import java.util.List;
 
 /**
  * DynamicBaseSender服务接口:
@@ -20,4 +23,5 @@ import java.math.BigDecimal;
  */
 public interface IDynamicBaseSenderService extends IBaseService<DynamicBaseSender, String>{
 
+    List<MeterBaseCalibraRelation> queryall(HashMap parmas);
 }

+ 8 - 0
src/main/java/com/jisco/dynamicweight/dynamicbasesender/service/impl/DynamicBaseSenderServiceImpl.java

@@ -1,5 +1,6 @@
 package com.jisco.dynamicweight.dynamicbasesender.service.impl;
 
+import com.steerinfo.baseinfo.meterbasecalibrarelation.model.MeterBaseCalibraRelation;
 import com.steerinfo.framework.mapper.IBaseMapper;
 import com.steerinfo.framework.service.impl.BaseServiceImpl;
 import com.jisco.dynamicweight.dynamicbasesender.model.DynamicBaseSender;
@@ -9,6 +10,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import java.util.Date;
 import java.math.BigDecimal;
+import java.util.HashMap;
+import java.util.List;
 
 /**
  * DynamicBaseSender服务实现:
@@ -33,4 +36,9 @@ public class DynamicBaseSenderServiceImpl extends BaseServiceImpl<DynamicBaseSen
     protected IBaseMapper<DynamicBaseSender, String> getMapper() {
         return dynamicBaseSenderMapper;
     }
+
+    @Override
+    public List<MeterBaseCalibraRelation> queryall(HashMap parmas) {
+        return dynamicBaseSenderMapper.selectByParameters(parmas);
+    }
 }

+ 2 - 4
src/main/java/com/jisco/dynamicweight/dynamicbasestationmaterial/controller/DynamicBaseStationMaterialController.java

@@ -77,13 +77,10 @@ public class DynamicBaseStationMaterialController extends BaseRESTfulController
         Assert.isTrue(StringUtils.isNotBlank(model.getStationName()), "请输入站点名称!");
 //        Assert.isTrue(StringUtils.isNotBlank(model.getMaterialNo()), "请输入物料编号!");
         Assert.isTrue(StringUtils.isNotBlank(model.getMaterialName()), "请输入物料名称!");
-        model.setValidFlag("0");
+        Assert.isTrue(StringUtils.isNotBlank(model.getValidFlag()), "有效标识不能为空!");
         model.setCreateManNo(UserUtil.getCurrentUserId());
         model.setCreateManName(UserUtil.getCurrentUserName());
         model.setCreateTime(new Date());
-        model.setUpdateManNo(UserUtil.getCurrentUserId());
-        model.setUpdateManName(UserUtil.getCurrentUserName());
-        model.setUpdateTime(new Date());
         DynamicBaseStationMaterial dynamicBaseStationMaterial = dynamicBaseStationMaterialService.add(model);
         return success(dynamicBaseStationMaterial);
     }
@@ -109,6 +106,7 @@ public class DynamicBaseStationMaterialController extends BaseRESTfulController
         Assert.isTrue(StringUtils.isNotBlank(model.getStationName()), "请输入站点名称!");
 //        Assert.isTrue(StringUtils.isNotBlank(model.getMaterialNo()), "请输入物料编号!");
         Assert.isTrue(StringUtils.isNotBlank(model.getMaterialName()), "请输入物料名称!");
+        Assert.isTrue(StringUtils.isNotBlank(model.getValidFlag()), "有效标识不能为空!");
         model.setId(id);
         model.setUpdateManNo(UserUtil.getCurrentUserId());
         model.setUpdateManName(UserUtil.getCurrentUserName());

+ 43 - 0
src/main/java/com/jisco/dynamicweight/dynamicworkupdata/InbatchDto.java

@@ -0,0 +1,43 @@
+package com.jisco.dynamicweight.dynamicworkupdata;
+
+import java.math.BigDecimal;
+
+public class InbatchDto {
+
+    private String materialCode;
+    private String materialName;
+    private BigDecimal weight;
+
+    public String getMaterialCode() {
+        return materialCode;
+    }
+
+    public void setMaterialCode(String materialCode) {
+        this.materialCode = materialCode;
+    }
+
+    public String getMaterialName() {
+        return materialName;
+    }
+
+    public void setMaterialName(String materialName) {
+        this.materialName = materialName;
+    }
+
+    public BigDecimal getWeight() {
+        return weight;
+    }
+
+    public void setWeight(BigDecimal weight) {
+        this.weight = weight;
+    }
+
+    @Override
+    public String toString() {
+        return "InbatchDto{" +
+                "materialCode='" + materialCode + '\'' +
+                ", materialName='" + materialName + '\'' +
+                ", weight=" + weight +
+                '}';
+    }
+}

+ 71 - 4
src/main/java/com/jisco/dynamicweight/dynamicworkupdata/controller/DynamicWorkUpdataController.java

@@ -1,9 +1,12 @@
 package com.jisco.dynamicweight.dynamicworkupdata.controller;
 
+import cn.hutool.core.lang.Assert;
 import com.jisco.dynamicweight.dynamicbasestationmaterial.model.DynamicBaseStationMaterial;
+import com.jisco.dynamicweight.dynamicworkupdata.InbatchDto;
 import com.jisco.dynamicweight.dynamicworkupdata.model.DynamicWorkUpdata;
 import com.jisco.dynamicweight.dynamicworkupdata.service.IDynamicWorkUpdataService;
 import com.jisco.dynamicweight.util.ExcelUtil;
+import com.jisco.dynamicweight.util.UserUtil;
 import com.steerinfo.framework.controller.BaseRESTfulController;
 import com.steerinfo.framework.controller.RESTfulResult;
 import com.steerinfo.framework.service.pagehelper.PageList;
@@ -11,14 +14,16 @@ import com.steerinfo.framework.utils.collection.ListUtils;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
+import java.math.BigDecimal;
+import java.util.*;
 
 /**
  * DynamicWorkUpdata RESTful接口:
@@ -71,6 +76,25 @@ public class DynamicWorkUpdataController extends BaseRESTfulController {
     //@RequiresPermissions("dynamicworkupdata:create")
     @PostMapping(value = "/")
     public RESTfulResult add(@RequestBody DynamicWorkUpdata model){
+        Assert.isTrue(StringUtils.isNotBlank(model.getStationCode()), "站点编码不能为空!");
+        Assert.isTrue(StringUtils.isNotBlank(model.getStationName()), "站点名称不能为空!");
+        Assert.isTrue(StringUtils.isNotBlank(model.getMaterialCode()), "物料编码不能为空!");
+        Assert.isTrue(StringUtils.isNotBlank(model.getMaterialName()), "物料名称不能为空!");
+        Assert.isTrue(StringUtils.isNotBlank(model.getRecieverCode()), "收货库房编码不能为空!");
+        Assert.isTrue(StringUtils.isNotBlank(model.getRecieverName()), "收货库房名称不能为空!");
+        Assert.isTrue(StringUtils.isNotBlank(model.getRecieverType()), "收货点类型不能为空!");
+        Assert.isTrue(StringUtils.isNotBlank(model.getSenderCode()), "发货库房编码不能为空!");
+        Assert.isTrue(StringUtils.isNotBlank(model.getSenderName()), "发货库房名称不能为空!");
+        Assert.isTrue(StringUtils.isNotBlank(model.getSenderType()), "发货点类型不能为空!");
+        Assert.isTrue(Objects.nonNull(model.getStartTime()), "开始时间不能为空!");
+        Assert.isTrue(Objects.nonNull(model.getEndTime()), "结束时间不能为空!");
+        Assert.isTrue(Objects.nonNull(model.getWeight()), "重量不能为空!");
+        Assert.isTrue(StringUtils.isNotBlank(model.getValidFlag()), "有效标识不能为空!");
+        model.setUploaded("0");
+        model.setAuditingFlag("0");
+        model.setCreateManNo(UserUtil.getCurrentUserId());
+        model.setCreateManName(UserUtil.getCurrentUserName());
+        model.setCreateTime(new Date());
         DynamicWorkUpdata dynamicWorkUpdata = dynamicWorkUpdataService.add(model);
         return success(dynamicWorkUpdata);
     }
@@ -92,6 +116,23 @@ public class DynamicWorkUpdataController extends BaseRESTfulController {
     //@RequiresPermissions("dynamicworkupdata:update")
     @PutMapping(value = "/{id}", produces  = "application/json;charset=UTF-8")
     public RESTfulResult update(@PathVariable String id, @RequestBody DynamicWorkUpdata model){
+        Assert.isTrue(StringUtils.isNotBlank(model.getStationCode()), "站点编码不能为空!");
+        Assert.isTrue(StringUtils.isNotBlank(model.getStationName()), "站点名称不能为空!");
+        Assert.isTrue(StringUtils.isNotBlank(model.getMaterialCode()), "物料编码不能为空!");
+        Assert.isTrue(StringUtils.isNotBlank(model.getMaterialName()), "物料名称不能为空!");
+        Assert.isTrue(StringUtils.isNotBlank(model.getRecieverCode()), "收货库房编码不能为空!");
+        Assert.isTrue(StringUtils.isNotBlank(model.getRecieverName()), "收货库房名称不能为空!");
+        Assert.isTrue(StringUtils.isNotBlank(model.getRecieverType()), "收货点类型不能为空!");
+        Assert.isTrue(StringUtils.isNotBlank(model.getSenderCode()), "发货库房编码不能为空!");
+        Assert.isTrue(StringUtils.isNotBlank(model.getSenderName()), "发货库房名称不能为空!");
+        Assert.isTrue(StringUtils.isNotBlank(model.getSenderType()), "发货点类型不能为空!");
+        Assert.isTrue(Objects.nonNull(model.getStartTime()), "开始时间不能为空!");
+        Assert.isTrue(Objects.nonNull(model.getEndTime()), "结束时间不能为空!");
+        Assert.isTrue(Objects.nonNull(model.getWeight()), "重量不能为空!");
+        Assert.isTrue(StringUtils.isNotBlank(model.getValidFlag()), "有效标识不能为空!");
+        model.setUpdateManNo(UserUtil.getCurrentUserId());
+        model.setUpdateManName(UserUtil.getCurrentUserName());
+        model.setUpdateTime(new Date());
         model.setId(id);
         DynamicWorkUpdata dynamicWorkUpdata = dynamicWorkUpdataService.modify(model);
         return success(dynamicWorkUpdata);
@@ -118,9 +159,35 @@ public class DynamicWorkUpdataController extends BaseRESTfulController {
     }
 
     @ApiOperation(value = "重新计算", notes = "重新计算煤塔秤数据")
-    @PostMapping(value = "/recalc")//String
+    @GetMapping(value = "/recalc")//String
     public RESTfulResult recalc(){
         dynamicWorkUpdataService.recalc();
         return success();
     }
+
+    @ApiOperation(value = "数据分批", notes = "数据分批")
+    @PostMapping(value = "/inbatchs/{id}")
+    @Transactional
+    public RESTfulResult inbatchs(@PathVariable String id, @RequestBody List<InbatchDto> list){
+        DynamicWorkUpdata updata = dynamicWorkUpdataService.getById(id);
+        Assert.isTrue(updata.getIsInbatches().compareTo(new BigDecimal(1))==0, updata.getStationName() + "不能进行分批!");
+        Assert.isTrue(updata.getWeight().compareTo(new BigDecimal(0))==0, updata.getStationName() + "重量为0,不能进行分批!");
+        BigDecimal total = new BigDecimal(0);
+        for (InbatchDto inbatchDto : list) {
+            DynamicWorkUpdata data = new DynamicWorkUpdata();
+            BeanUtils.copyProperties(updata, data);
+            data.setId(null);
+            data.setUpdataNo(null);
+            data.setMaterialCode(inbatchDto.getMaterialCode());
+            data.setMaterialName(inbatchDto.getMaterialName());
+            data.setWeight(inbatchDto.getWeight());
+            data.setCreateManNo(UserUtil.getCurrentUserId());
+            data.setCreateManName(UserUtil.getCurrentUserName());
+            data.setCreateTime(new Date());
+            dynamicWorkUpdataService.add(data);
+            total = total.add(data.getWeight());
+        }
+        Assert.isTrue(updata.getWeight().compareTo(total) == 0, "分批重量之和与总重量不相等!");
+        return success();
+    }
 }

+ 884 - 837
src/main/java/com/jisco/dynamicweight/dynamicworkupdata/mapper/DynamicWorkUpdataMapper.xml

@@ -1,845 +1,892 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.jisco.dynamicweight.dynamicworkupdata.mapper.DynamicWorkUpdataMapper">
-  <resultMap id="BaseResultMap" type="com.jisco.dynamicweight.dynamicworkupdata.model.DynamicWorkUpdata">
-    <id column="UPDATA_NO" jdbcType="VARCHAR" property="updataNo" />
-    <result column="MATERIAL_NAME" jdbcType="VARCHAR" property="materialName" />
-    <result column="MATERIAL_CODE" jdbcType="VARCHAR" property="materialCode" />
-    <result column="STATION_NAME" jdbcType="VARCHAR" property="stationName" />
-    <result column="STATION_CODE" jdbcType="VARCHAR" property="stationCode" />
-    <result column="RECIEVER_NAME" jdbcType="VARCHAR" property="recieverName" />
-    <result column="RECIEVER_CODE" jdbcType="VARCHAR" property="recieverCode" />
-    <result column="SENDER_NAME" jdbcType="VARCHAR" property="senderName" />
-    <result column="SENDER_CODE" jdbcType="VARCHAR" property="senderCode" />
-    <result column="WEIGHT" jdbcType="VARCHAR" property="weight" />
-    <result column="RECIEVER_TYPE" jdbcType="VARCHAR" property="recieverType" />
-    <result column="SENDER_TYPE" jdbcType="VARCHAR" property="senderType" />
-    <result column="UPLOADED" jdbcType="VARCHAR" property="uploaded" />
-    <result column="START_TIME" jdbcType="TIMESTAMP" property="startTime" />
-    <result column="END_TIME" jdbcType="TIMESTAMP" property="endTime" />
-    <result column="MEMO" jdbcType="VARCHAR" property="memo" />
-    <result column="AUDITING_MAN_NO" jdbcType="VARCHAR" property="auditingManNo" />
-    <result column="ORIGINAL_VALUE" jdbcType="VARCHAR" property="originalValue" />
-    <result column="SYSLOG" jdbcType="VARCHAR" property="syslog" />
-    <result column="AUDITING_MAN_NAME" jdbcType="VARCHAR" property="auditingManName" />
-    <result column="AUDITING_TIME" jdbcType="TIMESTAMP" property="auditingTime" />
-    <result column="AUDITING_FLAG" jdbcType="VARCHAR" property="auditingFlag" />
-    <result column="VALID_FLAG" jdbcType="VARCHAR" property="validFlag" />
-    <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" />
-  </resultMap>
-  <sql id="columns">
-    UPDATA_NO, MATERIAL_NAME, MATERIAL_CODE, STATION_NAME, STATION_CODE, RECIEVER_NAME, 
-    RECIEVER_CODE, SENDER_NAME, SENDER_CODE, WEIGHT, RECIEVER_TYPE, SENDER_TYPE, UPLOADED, 
-    START_TIME, END_TIME, MEMO, AUDITING_MAN_NO, ORIGINAL_VALUE, SYSLOG, AUDITING_MAN_NAME, 
-    AUDITING_TIME, AUDITING_FLAG, VALID_FLAG, CREATE_MAN_NO, CREATE_MAN_NAME, CREATE_TIME, 
-    UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME
-  </sql>
-  <sql id="columns_alias">
-    t.UPDATA_NO, t.MATERIAL_NAME, t.MATERIAL_CODE, t.STATION_NAME, t.STATION_CODE, t.RECIEVER_NAME, 
+    <resultMap id="BaseResultMap" type="com.jisco.dynamicweight.dynamicworkupdata.model.DynamicWorkUpdata">
+        <id column="UPDATA_NO" jdbcType="VARCHAR" property="updataNo"/>
+        <result column="MATERIAL_NAME" jdbcType="VARCHAR" property="materialName"/>
+        <result column="MATERIAL_CODE" jdbcType="VARCHAR" property="materialCode"/>
+        <result column="STATION_NAME" jdbcType="VARCHAR" property="stationName"/>
+        <result column="STATION_CODE" jdbcType="VARCHAR" property="stationCode"/>
+        <result column="RECIEVER_NAME" jdbcType="VARCHAR" property="recieverName"/>
+        <result column="RECIEVER_CODE" jdbcType="VARCHAR" property="recieverCode"/>
+        <result column="SENDER_NAME" jdbcType="VARCHAR" property="senderName"/>
+        <result column="SENDER_CODE" jdbcType="VARCHAR" property="senderCode"/>
+        <result column="WEIGHT" jdbcType="VARCHAR" property="weight"/>
+        <result column="RECIEVER_TYPE" jdbcType="VARCHAR" property="recieverType"/>
+        <result column="SENDER_TYPE" jdbcType="VARCHAR" property="senderType"/>
+        <result column="UPLOADED" jdbcType="VARCHAR" property="uploaded"/>
+        <result column="START_TIME" jdbcType="TIMESTAMP" property="startTime"/>
+        <result column="END_TIME" jdbcType="TIMESTAMP" property="endTime"/>
+        <result column="MEMO" jdbcType="VARCHAR" property="memo"/>
+        <result column="AUDITING_MAN_NO" jdbcType="VARCHAR" property="auditingManNo"/>
+        <result column="ORIGINAL_VALUE" jdbcType="VARCHAR" property="originalValue"/>
+        <result column="SYSLOG" jdbcType="VARCHAR" property="syslog"/>
+        <result column="AUDITING_MAN_NAME" jdbcType="VARCHAR" property="auditingManName"/>
+        <result column="AUDITING_TIME" jdbcType="TIMESTAMP" property="auditingTime"/>
+        <result column="AUDITING_FLAG" jdbcType="VARCHAR" property="auditingFlag"/>
+        <result column="VALID_FLAG" jdbcType="VARCHAR" property="validFlag"/>
+        <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="IS_UPLOAD" jdbcType="VARCHAR" property="isUpload"/>
+        <result column="IS_INBATCHES" jdbcType="VARCHAR" property="isInbatches"/>
+        <result column="IS_RETURNED_DUST" jdbcType="VARCHAR" property="isReturnedDust"/>
+        <result column="IS_COKE" jdbcType="VARCHAR" property="isCoke"/>
+    </resultMap>
+    <sql id="columns">
+        UPDATA_NO
+        , MATERIAL_NAME, MATERIAL_CODE, STATION_NAME, STATION_CODE, RECIEVER_NAME,
+    RECIEVER_CODE, SENDER_NAME, SENDER_CODE, WEIGHT, RECIEVER_TYPE, SENDER_TYPE, UPLOADED,
+    START_TIME, END_TIME, MEMO, AUDITING_MAN_NO, ORIGINAL_VALUE, SYSLOG, AUDITING_MAN_NAME,
+    AUDITING_TIME, AUDITING_FLAG, VALID_FLAG, CREATE_MAN_NO, CREATE_MAN_NAME, CREATE_TIME,
+    UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME, IS_UPLOAD, IS_INBATCHES, IS_RETURNED_DUST,
+    IS_COKE
+    </sql>
+    <sql id="columns_alias">
+        t
+        .
+        UPDATA_NO
+        , t.MATERIAL_NAME, t.MATERIAL_CODE, t.STATION_NAME, t.STATION_CODE, t.RECIEVER_NAME,
     t.RECIEVER_CODE, t.SENDER_NAME, t.SENDER_CODE, t.WEIGHT, t.RECIEVER_TYPE, t.SENDER_TYPE, 
     t.UPLOADED, t.START_TIME, t.END_TIME, t.MEMO, t.AUDITING_MAN_NO, t.ORIGINAL_VALUE, 
     t.SYSLOG, t.AUDITING_MAN_NAME, t.AUDITING_TIME, t.AUDITING_FLAG, t.VALID_FLAG, t.CREATE_MAN_NO, 
     t.CREATE_MAN_NAME, t.CREATE_TIME, t.UPDATE_MAN_NO, t.UPDATE_MAN_NAME, t.UPDATE_TIME
-  </sql>
-  <sql id="select">
-    SELECT <include refid="columns"/> FROM DYNAMIC_WORK_UPDATA
-  </sql>
-  <sql id="select_alias">
-    SELECT <include refid="columns_alias"/> FROM DYNAMIC_WORK_UPDATA t
-  </sql>
-  <sql id="where">
-    <where> 
-      <if test="updataNo != null and updataNo != ''">
-        and UPDATA_NO = #{updataNo}
-      </if>
-      <if test="materialName != null and materialName != ''">
-        and MATERIAL_NAME = #{materialName}
-      </if>
-      <if test="materialCode != null and materialCode != ''">
-        and MATERIAL_CODE = #{materialCode}
-      </if>
-      <if test="stationName != null and stationName != ''">
-        and STATION_NAME = #{stationName}
-      </if>
-      <if test="stationCode != null and stationCode != ''">
-        and STATION_CODE = #{stationCode}
-      </if>
-      <if test="recieverName != null and recieverName != ''">
-        and RECIEVER_NAME = #{recieverName}
-      </if>
-      <if test="recieverCode != null and recieverCode != ''">
-        and RECIEVER_CODE = #{recieverCode}
-      </if>
-      <if test="senderName != null and senderName != ''">
-        and SENDER_NAME = #{senderName}
-      </if>
-      <if test="senderCode != null and senderCode != ''">
-        and SENDER_CODE = #{senderCode}
-      </if>
-      <if test="weight != null and weight != ''">
-        and WEIGHT = #{weight}
-      </if>
-      <if test="recieverType != null and recieverType != ''">
-        and RECIEVER_TYPE = #{recieverType}
-      </if>
-      <if test="senderType != null and senderType != ''">
-        and SENDER_TYPE = #{senderType}
-      </if>
-      <if test="uploaded != null and uploaded != ''">
-        and UPLOADED = #{uploaded}
-      </if>
-      <if test="startTime != null">
-        and TO_CHAR(START_TIME,'yyyy-MM-dd') = #{startTime}
-      </if>
-      <if test="endTime != null">
-        and TO_CHAR(END_TIME,'yyyy-MM-dd HH24:mi:ss') = #{endTime}
-      </if>
-      <if test="endTime1 != null">
-        and TO_CHAR(END_TIME,'yyyy-MM-dd HH24:mi:ss') &gt;= #{endTime1}
-      </if>
-      <if test="endTime2 != null">
-        and TO_CHAR(END_TIME,'yyyy-MM-dd HH24:mi:ss') &lt;= #{endTime2}
-      </if>
-      <if test="memo != null and memo != ''">
-        and MEMO = #{memo}
-      </if>
-      <if test="auditingManNo != null and auditingManNo != ''">
-        and AUDITING_MAN_NO = #{auditingManNo}
-      </if>
-      <if test="originalValue != null and originalValue != ''">
-        and ORIGINAL_VALUE = #{originalValue}
-      </if>
-      <if test="syslog != null and syslog != ''">
-        and SYSLOG = #{syslog}
-      </if>
-      <if test="auditingManName != null and auditingManName != ''">
-        and AUDITING_MAN_NAME = #{auditingManName}
-      </if>
-      <if test="auditingTime != null">
-        and TO_CHAR(AUDITING_TIME,'yyyy-MM-dd') = #{auditingTime}
-      </if>
-      <if test="auditingFlag != null and auditingFlag != ''">
-        and AUDITING_FLAG = #{auditingFlag}
-      </if>
-      <if test="validFlag != null and validFlag != ''">
-        and VALID_FLAG = #{validFlag}
-      </if>
-      <if test="createManNo != null and createManNo != ''">
-        and CREATE_MAN_NO = #{createManNo}
-      </if>
-      <if test="createManName != null and createManName != ''">
-        and CREATE_MAN_NAME = #{createManName}
-      </if>
-      <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>
-    </where>
-  </sql>
-  <sql id="whereLike">
-    <where> 
-      <if test="updataNo != null and updataNo != ''">
-        and UPDATA_NO LIKE '%${updataNo}%'
-      </if>
-      <if test="materialName != null and materialName != ''">
-        and MATERIAL_NAME LIKE '%${materialName}%'
-      </if>
-      <if test="materialCode != null and materialCode != ''">
-        and MATERIAL_CODE LIKE '%${materialCode}%'
-      </if>
-      <if test="stationName != null and stationName != ''">
-        and STATION_NAME LIKE '%${stationName}%'
-      </if>
-      <if test="stationCode != null and stationCode != ''">
-        and STATION_CODE LIKE '%${stationCode}%'
-      </if>
-      <if test="recieverName != null and recieverName != ''">
-        and RECIEVER_NAME LIKE '%${recieverName}%'
-      </if>
-      <if test="recieverCode != null and recieverCode != ''">
-        and RECIEVER_CODE LIKE '%${recieverCode}%'
-      </if>
-      <if test="senderName != null and senderName != ''">
-        and SENDER_NAME LIKE '%${senderName}%'
-      </if>
-      <if test="senderCode != null and senderCode != ''">
-        and SENDER_CODE LIKE '%${senderCode}%'
-      </if>
-      <if test="weight != null and weight != ''">
-        and WEIGHT LIKE '%${weight}%'
-      </if>
-      <if test="recieverType != null and recieverType != ''">
-        and RECIEVER_TYPE LIKE '%${recieverType}%'
-      </if>
-      <if test="senderType != null and senderType != ''">
-        and SENDER_TYPE LIKE '%${senderType}%'
-      </if>
-      <if test="uploaded != null and uploaded != ''">
-        and UPLOADED LIKE '%${uploaded}%'
-      </if>
-      <if test="startTime != null">
-        and TO_CHAR(START_TIME,'yyyy-MM-dd') = #{startTime}
-      </if>
-      <if test="endTime != null">
-        and TO_CHAR(END_TIME,'yyyy-MM-dd HH24:mi:ss') = #{endTime}
-      </if>
-      <if test="endTime1 != null">
-        and TO_CHAR(END_TIME,'yyyy-MM-dd HH24:mi:ss') &gt;= #{endTime1}
-      </if>
-      <if test="endTime2 != null">
-        and TO_CHAR(END_TIME,'yyyy-MM-dd HH24:mi:ss') &lt;= #{endTime2}
-      </if>
-      <if test="memo != null and memo != ''">
-        and MEMO LIKE '%${memo}%'
-      </if>
-      <if test="auditingManNo != null and auditingManNo != ''">
-        and AUDITING_MAN_NO LIKE '%${auditingManNo}%'
-      </if>
-      <if test="originalValue != null and originalValue != ''">
-        and ORIGINAL_VALUE LIKE '%${originalValue}%'
-      </if>
-      <if test="syslog != null and syslog != ''">
-        and SYSLOG LIKE '%${syslog}%'
-      </if>
-      <if test="auditingManName != null and auditingManName != ''">
-        and AUDITING_MAN_NAME LIKE '%${auditingManName}%'
-      </if>
-      <if test="auditingTime != null">
-        and TO_CHAR(AUDITING_TIME,'yyyy-MM-dd') = #{auditingTime}
-      </if>
-      <if test="auditingFlag != null and auditingFlag != ''">
-        and AUDITING_FLAG LIKE '%${auditingFlag}%'
-      </if>
-      <if test="validFlag != null and validFlag != ''">
-        and VALID_FLAG LIKE '%${validFlag}%'
-      </if>
-      <if test="createManNo != null and createManNo != ''">
-        and CREATE_MAN_NO LIKE '%${createManNo}%'
-      </if>
-      <if test="createManName != null and createManName != ''">
-        and CREATE_MAN_NAME LIKE '%${createManName}%'
-      </if>
-      <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>
-    </where>
-  </sql>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
-    delete from DYNAMIC_WORK_UPDATA
-    where UPDATA_NO = #{updataNo,jdbcType=VARCHAR}
-  </delete>
-  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
-    delete from DYNAMIC_WORK_UPDATA
-    where 1!=1 
-      <if test="materialName != null and materialName != ''">
-        or MATERIAL_NAME = #{materialName}
-      </if>
-      <if test="materialCode != null and materialCode != ''">
-        or MATERIAL_CODE = #{materialCode}
-      </if>
-      <if test="stationName != null and stationName != ''">
-        or STATION_NAME = #{stationName}
-      </if>
-      <if test="stationCode != null and stationCode != ''">
-        or STATION_CODE = #{stationCode}
-      </if>
-      <if test="recieverName != null and recieverName != ''">
-        or RECIEVER_NAME = #{recieverName}
-      </if>
-      <if test="recieverCode != null and recieverCode != ''">
-        or RECIEVER_CODE = #{recieverCode}
-      </if>
-      <if test="senderName != null and senderName != ''">
-        or SENDER_NAME = #{senderName}
-      </if>
-      <if test="senderCode != null and senderCode != ''">
-        or SENDER_CODE = #{senderCode}
-      </if>
-      <if test="weight != null and weight != ''">
-        or WEIGHT = #{weight}
-      </if>
-      <if test="recieverType != null and recieverType != ''">
-        or RECIEVER_TYPE = #{recieverType}
-      </if>
-      <if test="senderType != null and senderType != ''">
-        or SENDER_TYPE = #{senderType}
-      </if>
-      <if test="uploaded != null and uploaded != ''">
-        or UPLOADED = #{uploaded}
-      </if>
-      <if test="startTime != null">
-        or TO_CHAR(START_TIME,'yyyy-MM-dd') = '#{startTime}'
-      </if>
-      <if test="endTime != null">
-        or TO_CHAR(END_TIME,'yyyy-MM-dd') = '#{endTime}'
-      </if>
-      <if test="memo != null and memo != ''">
-        or MEMO = #{memo}
-      </if>
-      <if test="auditingManNo != null and auditingManNo != ''">
-        or AUDITING_MAN_NO = #{auditingManNo}
-      </if>
-      <if test="originalValue != null and originalValue != ''">
-        or ORIGINAL_VALUE = #{originalValue}
-      </if>
-      <if test="syslog != null and syslog != ''">
-        or SYSLOG = #{syslog}
-      </if>
-      <if test="auditingManName != null and auditingManName != ''">
-        or AUDITING_MAN_NAME = #{auditingManName}
-      </if>
-      <if test="auditingTime != null">
-        or TO_CHAR(AUDITING_TIME,'yyyy-MM-dd') = '#{auditingTime}'
-      </if>
-      <if test="auditingFlag != null and auditingFlag != ''">
-        or AUDITING_FLAG = #{auditingFlag}
-      </if>
-      <if test="validFlag != null and validFlag != ''">
-        or VALID_FLAG = #{validFlag}
-      </if>
-      <if test="createManNo != null and createManNo != ''">
-        or CREATE_MAN_NO = #{createManNo}
-      </if>
-      <if test="createManName != null and createManName != ''">
-        or CREATE_MAN_NAME = #{createManName}
-      </if>
-      <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>
-  </delete>
-  <insert id="insert" parameterType="com.jisco.dynamicweight.dynamicworkupdata.model.DynamicWorkUpdata">
-    insert into DYNAMIC_WORK_UPDATA (UPDATA_NO, MATERIAL_NAME, MATERIAL_CODE, 
-      STATION_NAME, STATION_CODE, RECIEVER_NAME, 
-      RECIEVER_CODE, SENDER_NAME, SENDER_CODE, 
-      WEIGHT, RECIEVER_TYPE, SENDER_TYPE, 
-      UPLOADED, START_TIME, END_TIME, 
-      MEMO, AUDITING_MAN_NO, ORIGINAL_VALUE, 
-      SYSLOG, AUDITING_MAN_NAME, AUDITING_TIME, 
-      AUDITING_FLAG, VALID_FLAG, CREATE_MAN_NO, 
-      CREATE_MAN_NAME, CREATE_TIME, UPDATE_MAN_NO, 
-      UPDATE_MAN_NAME, UPDATE_TIME)
-    values (#{updataNo,jdbcType=VARCHAR}, #{materialName,jdbcType=VARCHAR}, #{materialCode,jdbcType=VARCHAR}, 
-      #{stationName,jdbcType=VARCHAR}, #{stationCode,jdbcType=VARCHAR}, #{recieverName,jdbcType=VARCHAR}, 
-      #{recieverCode,jdbcType=VARCHAR}, #{senderName,jdbcType=VARCHAR}, #{senderCode,jdbcType=VARCHAR}, 
-      #{weight,jdbcType=VARCHAR}, #{recieverType,jdbcType=VARCHAR}, #{senderType,jdbcType=VARCHAR}, 
-      #{uploaded,jdbcType=VARCHAR}, #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, 
-      #{memo,jdbcType=VARCHAR}, #{auditingManNo,jdbcType=VARCHAR}, #{originalValue,jdbcType=VARCHAR}, 
-      #{syslog,jdbcType=VARCHAR}, #{auditingManName,jdbcType=VARCHAR}, #{auditingTime,jdbcType=TIMESTAMP}, 
-      #{auditingFlag,jdbcType=VARCHAR}, #{validFlag,jdbcType=VARCHAR}, #{createManNo,jdbcType=VARCHAR}, 
-      #{createManName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateManNo,jdbcType=VARCHAR}, 
-      #{updateManName,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP})
-  </insert>
-  <insert id="insertSelective" parameterType="com.jisco.dynamicweight.dynamicworkupdata.model.DynamicWorkUpdata">
-    insert into DYNAMIC_WORK_UPDATA
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="updataNo != null">
-        UPDATA_NO,
-      </if>
-      <if test="materialName != null">
-        MATERIAL_NAME,
-      </if>
-      <if test="materialCode != null">
-        MATERIAL_CODE,
-      </if>
-      <if test="stationName != null">
-        STATION_NAME,
-      </if>
-      <if test="stationCode != null">
-        STATION_CODE,
-      </if>
-      <if test="recieverName != null">
-        RECIEVER_NAME,
-      </if>
-      <if test="recieverCode != null">
-        RECIEVER_CODE,
-      </if>
-      <if test="senderName != null">
-        SENDER_NAME,
-      </if>
-      <if test="senderCode != null">
-        SENDER_CODE,
-      </if>
-      <if test="weight != null">
-        WEIGHT,
-      </if>
-      <if test="recieverType != null">
-        RECIEVER_TYPE,
-      </if>
-      <if test="senderType != null">
-        SENDER_TYPE,
-      </if>
-      <if test="uploaded != null">
-        UPLOADED,
-      </if>
-      <if test="startTime != null">
-        START_TIME,
-      </if>
-      <if test="endTime != null">
-        END_TIME,
-      </if>
-      <if test="memo != null">
-        MEMO,
-      </if>
-      <if test="auditingManNo != null">
-        AUDITING_MAN_NO,
-      </if>
-      <if test="originalValue != null">
-        ORIGINAL_VALUE,
-      </if>
-      <if test="syslog != null">
-        SYSLOG,
-      </if>
-      <if test="auditingManName != null">
-        AUDITING_MAN_NAME,
-      </if>
-      <if test="auditingTime != null">
-        AUDITING_TIME,
-      </if>
-      <if test="auditingFlag != null">
-        AUDITING_FLAG,
-      </if>
-      <if test="validFlag != null">
-        VALID_FLAG,
-      </if>
-      <if test="createManNo != null">
-        CREATE_MAN_NO,
-      </if>
-      <if test="createManName != null">
-        CREATE_MAN_NAME,
-      </if>
-      <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>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="updataNo != null">
-        #{updataNo,jdbcType=VARCHAR},
-      </if>
-      <if test="materialName != null">
-        #{materialName,jdbcType=VARCHAR},
-      </if>
-      <if test="materialCode != null">
-        #{materialCode,jdbcType=VARCHAR},
-      </if>
-      <if test="stationName != null">
-        #{stationName,jdbcType=VARCHAR},
-      </if>
-      <if test="stationCode != null">
-        #{stationCode,jdbcType=VARCHAR},
-      </if>
-      <if test="recieverName != null">
-        #{recieverName,jdbcType=VARCHAR},
-      </if>
-      <if test="recieverCode != null">
-        #{recieverCode,jdbcType=VARCHAR},
-      </if>
-      <if test="senderName != null">
-        #{senderName,jdbcType=VARCHAR},
-      </if>
-      <if test="senderCode != null">
-        #{senderCode,jdbcType=VARCHAR},
-      </if>
-      <if test="weight != null">
-        #{weight,jdbcType=VARCHAR},
-      </if>
-      <if test="recieverType != null">
-        #{recieverType,jdbcType=VARCHAR},
-      </if>
-      <if test="senderType != null">
-        #{senderType,jdbcType=VARCHAR},
-      </if>
-      <if test="uploaded != null">
-        #{uploaded,jdbcType=VARCHAR},
-      </if>
-      <if test="startTime != null">
-        #{startTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="endTime != null">
-        #{endTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="memo != null">
-        #{memo,jdbcType=VARCHAR},
-      </if>
-      <if test="auditingManNo != null">
-        #{auditingManNo,jdbcType=VARCHAR},
-      </if>
-      <if test="originalValue != null">
-        #{originalValue,jdbcType=VARCHAR},
-      </if>
-      <if test="syslog != null">
-        #{syslog,jdbcType=VARCHAR},
-      </if>
-      <if test="auditingManName != null">
-        #{auditingManName,jdbcType=VARCHAR},
-      </if>
-      <if test="auditingTime != null">
-        #{auditingTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="auditingFlag != null">
-        #{auditingFlag,jdbcType=VARCHAR},
-      </if>
-      <if test="validFlag != null">
-        #{validFlag,jdbcType=VARCHAR},
-      </if>
-      <if test="createManNo != null">
-        #{createManNo,jdbcType=VARCHAR},
-      </if>
-      <if test="createManName != null">
-        #{createManName,jdbcType=VARCHAR},
-      </if>
-      <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>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKey" parameterType="com.jisco.dynamicweight.dynamicworkupdata.model.DynamicWorkUpdata">
-    update DYNAMIC_WORK_UPDATA
-    set MATERIAL_NAME = #{materialName,jdbcType=VARCHAR},
-      MATERIAL_CODE = #{materialCode,jdbcType=VARCHAR},
-      STATION_NAME = #{stationName,jdbcType=VARCHAR},
-      STATION_CODE = #{stationCode,jdbcType=VARCHAR},
-      RECIEVER_NAME = #{recieverName,jdbcType=VARCHAR},
-      RECIEVER_CODE = #{recieverCode,jdbcType=VARCHAR},
-      SENDER_NAME = #{senderName,jdbcType=VARCHAR},
-      SENDER_CODE = #{senderCode,jdbcType=VARCHAR},
-      WEIGHT = #{weight,jdbcType=VARCHAR},
-      RECIEVER_TYPE = #{recieverType,jdbcType=VARCHAR},
-      SENDER_TYPE = #{senderType,jdbcType=VARCHAR},
-      UPLOADED = #{uploaded,jdbcType=VARCHAR},
-      START_TIME = #{startTime,jdbcType=TIMESTAMP},
-      END_TIME = #{endTime,jdbcType=TIMESTAMP},
-      MEMO = #{memo,jdbcType=VARCHAR},
-      AUDITING_MAN_NO = #{auditingManNo,jdbcType=VARCHAR},
-      ORIGINAL_VALUE = #{originalValue,jdbcType=VARCHAR},
-      SYSLOG = #{syslog,jdbcType=VARCHAR},
-      AUDITING_MAN_NAME = #{auditingManName,jdbcType=VARCHAR},
-      AUDITING_TIME = #{auditingTime,jdbcType=TIMESTAMP},
-      AUDITING_FLAG = #{auditingFlag,jdbcType=VARCHAR},
-      VALID_FLAG = #{validFlag,jdbcType=VARCHAR},
-      CREATE_MAN_NO = #{createManNo,jdbcType=VARCHAR},
-      CREATE_MAN_NAME = #{createManName,jdbcType=VARCHAR},
-      CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
-      UPDATE_MAN_NO = #{updateManNo,jdbcType=VARCHAR},
-      UPDATE_MAN_NAME = #{updateManName,jdbcType=VARCHAR},
-      UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP}
-    where UPDATA_NO = #{updataNo,jdbcType=VARCHAR}
-  </update>
-  <update id="updateByPrimaryKeySelective" parameterType="com.jisco.dynamicweight.dynamicworkupdata.model.DynamicWorkUpdata">
-    update DYNAMIC_WORK_UPDATA
-    <set>
-      <if test="materialName != null">
-        MATERIAL_NAME = #{materialName,jdbcType=VARCHAR},
-      </if>
-      <if test="materialCode != null">
-        MATERIAL_CODE = #{materialCode,jdbcType=VARCHAR},
-      </if>
-      <if test="stationName != null">
-        STATION_NAME = #{stationName,jdbcType=VARCHAR},
-      </if>
-      <if test="stationCode != null">
-        STATION_CODE = #{stationCode,jdbcType=VARCHAR},
-      </if>
-      <if test="recieverName != null">
-        RECIEVER_NAME = #{recieverName,jdbcType=VARCHAR},
-      </if>
-      <if test="recieverCode != null">
-        RECIEVER_CODE = #{recieverCode,jdbcType=VARCHAR},
-      </if>
-      <if test="senderName != null">
-        SENDER_NAME = #{senderName,jdbcType=VARCHAR},
-      </if>
-      <if test="senderCode != null">
-        SENDER_CODE = #{senderCode,jdbcType=VARCHAR},
-      </if>
-      <if test="weight != null">
-        WEIGHT = #{weight,jdbcType=VARCHAR},
-      </if>
-      <if test="recieverType != null">
-        RECIEVER_TYPE = #{recieverType,jdbcType=VARCHAR},
-      </if>
-      <if test="senderType != null">
-        SENDER_TYPE = #{senderType,jdbcType=VARCHAR},
-      </if>
-      <if test="uploaded != null">
-        UPLOADED = #{uploaded,jdbcType=VARCHAR},
-      </if>
-      <if test="startTime != null">
-        START_TIME = #{startTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="endTime != null">
-        END_TIME = #{endTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="memo != null">
-        MEMO = #{memo,jdbcType=VARCHAR},
-      </if>
-      <if test="auditingManNo != null">
-        AUDITING_MAN_NO = #{auditingManNo,jdbcType=VARCHAR},
-      </if>
-      <if test="originalValue != null">
-        ORIGINAL_VALUE = #{originalValue,jdbcType=VARCHAR},
-      </if>
-      <if test="syslog != null">
-        SYSLOG = #{syslog,jdbcType=VARCHAR},
-      </if>
-      <if test="auditingManName != null">
-        AUDITING_MAN_NAME = #{auditingManName,jdbcType=VARCHAR},
-      </if>
-      <if test="auditingTime != null">
-        AUDITING_TIME = #{auditingTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="auditingFlag != null">
-        AUDITING_FLAG = #{auditingFlag,jdbcType=VARCHAR},
-      </if>
-      <if test="validFlag != null">
-        VALID_FLAG = #{validFlag,jdbcType=VARCHAR},
-      </if>
-      <if test="createManNo != null">
-        CREATE_MAN_NO = #{createManNo,jdbcType=VARCHAR},
-      </if>
-      <if test="createManName != null">
-        CREATE_MAN_NAME = #{createManName,jdbcType=VARCHAR},
-      </if>
-      <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>
-    </set>
-    where UPDATA_NO = #{updataNo,jdbcType=VARCHAR}
-  </update>
-  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
-    <include refid="select"/>
-    where UPDATA_NO = #{updataNo,jdbcType=VARCHAR}
-  </select>
-  <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    <include refid="select"/>
-    <include refid="where"/>
-  </select>
-  <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    <include refid="select"/>
-    <include refid="whereLike"/>
-  </select>
-  <select id="recalc" statementType="CALLABLE">
-    call GENERATEUPDATA();
-  </select>
-  <insert id="batchInsert" parameterType="java.util.List">
-    insert into DYNAMIC_WORK_UPDATA 
-      (UPDATA_NO, 
-      MATERIAL_NAME, MATERIAL_CODE, STATION_NAME, 
-      STATION_CODE, RECIEVER_NAME, RECIEVER_CODE, 
-      SENDER_NAME, SENDER_CODE, WEIGHT, 
-      RECIEVER_TYPE, SENDER_TYPE, UPLOADED, 
-      START_TIME, END_TIME, MEMO, 
-      AUDITING_MAN_NO, ORIGINAL_VALUE, 
-      SYSLOG, AUDITING_MAN_NAME, AUDITING_TIME, 
-      AUDITING_FLAG, VALID_FLAG, CREATE_MAN_NO, 
-      CREATE_MAN_NAME, CREATE_TIME, 
-      UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME
-      )
-    ( <foreach collection="list" item="item" separator="union all"> 
-   select  
-      #{item.updataNo,jdbcType=VARCHAR}, 
-      #{item.materialName,jdbcType=VARCHAR}, #{item.materialCode,jdbcType=VARCHAR}, #{item.stationName,jdbcType=VARCHAR}, 
-      #{item.stationCode,jdbcType=VARCHAR}, #{item.recieverName,jdbcType=VARCHAR}, #{item.recieverCode,jdbcType=VARCHAR}, 
-      #{item.senderName,jdbcType=VARCHAR}, #{item.senderCode,jdbcType=VARCHAR}, #{item.weight,jdbcType=VARCHAR}, 
-      #{item.recieverType,jdbcType=VARCHAR}, #{item.senderType,jdbcType=VARCHAR}, #{item.uploaded,jdbcType=VARCHAR}, 
-      #{item.startTime,jdbcType=TIMESTAMP}, #{item.endTime,jdbcType=TIMESTAMP}, #{item.memo,jdbcType=VARCHAR}, 
-      #{item.auditingManNo,jdbcType=VARCHAR}, #{item.originalValue,jdbcType=VARCHAR}, 
-      #{item.syslog,jdbcType=VARCHAR}, #{item.auditingManName,jdbcType=VARCHAR}, #{item.auditingTime,jdbcType=TIMESTAMP}, 
-      #{item.auditingFlag,jdbcType=VARCHAR}, #{item.validFlag,jdbcType=VARCHAR}, #{item.createManNo,jdbcType=VARCHAR}, 
-      #{item.createManName,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP}, 
-      #{item.updateManNo,jdbcType=VARCHAR}, #{item.updateManName,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP}
-       from dual  
-   </foreach> )
-  </insert>
-  <update id="batchUpdate" parameterType="java.util.List">
-     update DYNAMIC_WORK_UPDATA
-     set
-       UPDATA_NO=
-       <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
-          when #{item.updataNo,jdbcType=VARCHAR} then #{item.updataNo,jdbcType=VARCHAR}
-       </foreach>
-       ,MATERIAL_NAME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
-          when #{item.updataNo,jdbcType=VARCHAR} then #{item.materialName,jdbcType=VARCHAR}
-       </foreach>
-       ,MATERIAL_CODE=
-       <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
-          when #{item.updataNo,jdbcType=VARCHAR} then #{item.materialCode,jdbcType=VARCHAR}
-       </foreach>
-       ,STATION_NAME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
-          when #{item.updataNo,jdbcType=VARCHAR} then #{item.stationName,jdbcType=VARCHAR}
-       </foreach>
-       ,STATION_CODE=
-       <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
-          when #{item.updataNo,jdbcType=VARCHAR} then #{item.stationCode,jdbcType=VARCHAR}
-       </foreach>
-       ,RECIEVER_NAME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
-          when #{item.updataNo,jdbcType=VARCHAR} then #{item.recieverName,jdbcType=VARCHAR}
-       </foreach>
-       ,RECIEVER_CODE=
-       <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
-          when #{item.updataNo,jdbcType=VARCHAR} then #{item.recieverCode,jdbcType=VARCHAR}
-       </foreach>
-       ,SENDER_NAME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
-          when #{item.updataNo,jdbcType=VARCHAR} then #{item.senderName,jdbcType=VARCHAR}
-       </foreach>
-       ,SENDER_CODE=
-       <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
-          when #{item.updataNo,jdbcType=VARCHAR} then #{item.senderCode,jdbcType=VARCHAR}
-       </foreach>
-       ,WEIGHT=
-       <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
-          when #{item.updataNo,jdbcType=VARCHAR} then #{item.weight,jdbcType=VARCHAR}
-       </foreach>
-       ,RECIEVER_TYPE=
-       <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
-          when #{item.updataNo,jdbcType=VARCHAR} then #{item.recieverType,jdbcType=VARCHAR}
-       </foreach>
-       ,SENDER_TYPE=
-       <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
-          when #{item.updataNo,jdbcType=VARCHAR} then #{item.senderType,jdbcType=VARCHAR}
-       </foreach>
-       ,UPLOADED=
-       <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
-          when #{item.updataNo,jdbcType=VARCHAR} then #{item.uploaded,jdbcType=VARCHAR}
-       </foreach>
-       ,START_TIME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
-          when #{item.updataNo,jdbcType=VARCHAR} then #{item.startTime,jdbcType=TIMESTAMP}
-       </foreach>
-       ,END_TIME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
-          when #{item.updataNo,jdbcType=VARCHAR} then #{item.endTime,jdbcType=TIMESTAMP}
-       </foreach>
-       ,MEMO=
-       <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
-          when #{item.updataNo,jdbcType=VARCHAR} then #{item.memo,jdbcType=VARCHAR}
-       </foreach>
-       ,AUDITING_MAN_NO=
-       <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
-          when #{item.updataNo,jdbcType=VARCHAR} then #{item.auditingManNo,jdbcType=VARCHAR}
-       </foreach>
-       ,ORIGINAL_VALUE=
-       <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
-          when #{item.updataNo,jdbcType=VARCHAR} then #{item.originalValue,jdbcType=VARCHAR}
-       </foreach>
-       ,SYSLOG=
-       <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
-          when #{item.updataNo,jdbcType=VARCHAR} then #{item.syslog,jdbcType=VARCHAR}
-       </foreach>
-       ,AUDITING_MAN_NAME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
-          when #{item.updataNo,jdbcType=VARCHAR} then #{item.auditingManName,jdbcType=VARCHAR}
-       </foreach>
-       ,AUDITING_TIME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
-          when #{item.updataNo,jdbcType=VARCHAR} then #{item.auditingTime,jdbcType=TIMESTAMP}
-       </foreach>
-       ,AUDITING_FLAG=
-       <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
-          when #{item.updataNo,jdbcType=VARCHAR} then #{item.auditingFlag,jdbcType=VARCHAR}
-       </foreach>
-       ,VALID_FLAG=
-       <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
-          when #{item.updataNo,jdbcType=VARCHAR} then #{item.validFlag,jdbcType=VARCHAR}
-       </foreach>
-       ,CREATE_MAN_NO=
-       <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
-          when #{item.updataNo,jdbcType=VARCHAR} then #{item.createManNo,jdbcType=VARCHAR}
-       </foreach>
-       ,CREATE_MAN_NAME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
-          when #{item.updataNo,jdbcType=VARCHAR} then #{item.createManName,jdbcType=VARCHAR}
-       </foreach>
-       ,CREATE_TIME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
-          when #{item.updataNo,jdbcType=VARCHAR} then #{item.createTime,jdbcType=TIMESTAMP}
-       </foreach>
-       ,UPDATE_MAN_NO=
-       <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
-          when #{item.updataNo,jdbcType=VARCHAR} then #{item.updateManNo,jdbcType=VARCHAR}
-       </foreach>
-       ,UPDATE_MAN_NAME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
-          when #{item.updataNo,jdbcType=VARCHAR} then #{item.updateManName,jdbcType=VARCHAR}
-       </foreach>
-       ,UPDATE_TIME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
-          when #{item.updataNo,jdbcType=VARCHAR} then #{item.updateTime,jdbcType=TIMESTAMP}
-       </foreach>
-     where UPDATA_NO in 
-     <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
-    #{item.updataNo,jdbcType=VARCHAR}
-     </foreach> 
-  </update>
-  <delete id="batchDelete" parameterType="java.util.List">
-    delete from DYNAMIC_WORK_UPDATA
-    where UPDATA_NO in 
-    <foreach collection="list" item="id" open="(" close=")" separator=",">
-      #{id}
-    </foreach>
-  </delete>
-  <!-- 友情提示!!!-->
-  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
-  
+    </sql>
+    <sql id="select">
+        SELECT
+        <include refid="columns"/>
+        FROM DYNAMIC_WORK_UPDATA
+    </sql>
+    <sql id="select_alias">
+        SELECT
+        <include refid="columns_alias"/>,
+        DYNAMIC_BASE_BATCH_STATION.IS_UPLOAD, DYNAMIC_BASE_BATCH_STATION.IS_INBATCHES,
+        DYNAMIC_BASE_METERIAL.IS_RETURNED_DUST, DYNAMIC_BASE_METERIAL.IS_COKE
+        FROM DYNAMIC_WORK_UPDATA t
+        left join DYNAMIC_BASE_BATCH_STATION on t.STATION_CODE = DYNAMIC_BASE_BATCH_STATION.PIKA_CODE
+        left join DYNAMIC_BASE_METERIAL on t.MATERIAL_CODE = DYNAMIC_BASE_METERIAL.METERIAL_CODE
+    </sql>
+    <sql id="where">
+        <where>
+            <if test="updataNo != null and updataNo != ''">
+                and UPDATA_NO = #{updataNo}
+            </if>
+            <if test="materialName != null and materialName != ''">
+                and MATERIAL_NAME = #{materialName}
+            </if>
+            <if test="materialCode != null and materialCode != ''">
+                and MATERIAL_CODE = #{materialCode}
+            </if>
+            <if test="stationName != null and stationName != ''">
+                and STATION_NAME = #{stationName}
+            </if>
+            <if test="stationCode != null and stationCode != ''">
+                and STATION_CODE = #{stationCode}
+            </if>
+            <if test="recieverName != null and recieverName != ''">
+                and RECIEVER_NAME = #{recieverName}
+            </if>
+            <if test="recieverCode != null and recieverCode != ''">
+                and RECIEVER_CODE = #{recieverCode}
+            </if>
+            <if test="senderName != null and senderName != ''">
+                and SENDER_NAME = #{senderName}
+            </if>
+            <if test="senderCode != null and senderCode != ''">
+                and SENDER_CODE = #{senderCode}
+            </if>
+            <if test="weight != null and weight != ''">
+                and WEIGHT = #{weight}
+            </if>
+            <if test="recieverType != null and recieverType != ''">
+                and RECIEVER_TYPE = #{recieverType}
+            </if>
+            <if test="senderType != null and senderType != ''">
+                and SENDER_TYPE = #{senderType}
+            </if>
+            <if test="uploaded != null and uploaded != ''">
+                and UPLOADED = #{uploaded}
+            </if>
+            <if test="startTime != null">
+                and TO_CHAR(START_TIME,'yyyy-MM-dd') = #{startTime}
+            </if>
+            <if test="endTime != null">
+                and TO_CHAR(END_TIME,'yyyy-MM-dd HH24:mi:ss') = #{endTime}
+            </if>
+            <if test="endTime1 != null">
+                and TO_CHAR(END_TIME,'yyyy-MM-dd HH24:mi:ss') &gt;= #{endTime1}
+            </if>
+            <if test="endTime2 != null">
+                and TO_CHAR(END_TIME,'yyyy-MM-dd HH24:mi:ss') &lt;= #{endTime2}
+            </if>
+            <if test="memo != null and memo != ''">
+                and MEMO = #{memo}
+            </if>
+            <if test="auditingManNo != null and auditingManNo != ''">
+                and AUDITING_MAN_NO = #{auditingManNo}
+            </if>
+            <if test="originalValue != null and originalValue != ''">
+                and ORIGINAL_VALUE = #{originalValue}
+            </if>
+            <if test="syslog != null and syslog != ''">
+                and SYSLOG = #{syslog}
+            </if>
+            <if test="auditingManName != null and auditingManName != ''">
+                and AUDITING_MAN_NAME = #{auditingManName}
+            </if>
+            <if test="auditingTime != null">
+                and TO_CHAR(AUDITING_TIME,'yyyy-MM-dd') = #{auditingTime}
+            </if>
+            <if test="auditingFlag != null and auditingFlag != ''">
+                and AUDITING_FLAG = #{auditingFlag}
+            </if>
+            <if test="validFlag != null and validFlag != ''">
+                and VALID_FLAG = #{validFlag}
+            </if>
+            <if test="createManNo != null and createManNo != ''">
+                and CREATE_MAN_NO = #{createManNo}
+            </if>
+            <if test="createManName != null and createManName != ''">
+                and CREATE_MAN_NAME = #{createManName}
+            </if>
+            <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="isUpload != null">
+                and IS_UPLOAD = #{isUpload}
+            </if>
+            <if test="isInbatches != null">
+                and IS_INBATCHES = #{isInbatches}
+            </if>
+            <if test="isReturnedDust != null">
+                and IS_RETURNED_DUST = #{isReturnedDust}
+            </if>
+            <if test="isCoke != null">
+                and IS_COKE = #{isCoke}
+            </if>
+        </where>
+    </sql>
+    <sql id="whereLike">
+        <where>
+            <if test="updataNo != null and updataNo != ''">
+                and UPDATA_NO LIKE '%${updataNo}%'
+            </if>
+            <if test="materialName != null and materialName != ''">
+                and MATERIAL_NAME LIKE '%${materialName}%'
+            </if>
+            <if test="materialCode != null and materialCode != ''">
+                and MATERIAL_CODE LIKE '%${materialCode}%'
+            </if>
+            <if test="stationName != null and stationName != ''">
+                and STATION_NAME LIKE '%${stationName}%'
+            </if>
+            <if test="stationCode != null and stationCode != ''">
+                and STATION_CODE LIKE '%${stationCode}%'
+            </if>
+            <if test="recieverName != null and recieverName != ''">
+                and RECIEVER_NAME LIKE '%${recieverName}%'
+            </if>
+            <if test="recieverCode != null and recieverCode != ''">
+                and RECIEVER_CODE LIKE '%${recieverCode}%'
+            </if>
+            <if test="senderName != null and senderName != ''">
+                and SENDER_NAME LIKE '%${senderName}%'
+            </if>
+            <if test="senderCode != null and senderCode != ''">
+                and SENDER_CODE LIKE '%${senderCode}%'
+            </if>
+            <if test="weight != null and weight != ''">
+                and WEIGHT LIKE '%${weight}%'
+            </if>
+            <if test="recieverType != null and recieverType != ''">
+                and RECIEVER_TYPE LIKE '%${recieverType}%'
+            </if>
+            <if test="senderType != null and senderType != ''">
+                and SENDER_TYPE LIKE '%${senderType}%'
+            </if>
+            <if test="uploaded != null and uploaded != ''">
+                and UPLOADED LIKE '%${uploaded}%'
+            </if>
+            <if test="startTime != null">
+                and TO_CHAR(START_TIME,'yyyy-MM-dd') = #{startTime}
+            </if>
+            <if test="endTime != null">
+                and TO_CHAR(END_TIME,'yyyy-MM-dd HH24:mi:ss') = #{endTime}
+            </if>
+            <if test="endTime1 != null">
+                and TO_CHAR(END_TIME,'yyyy-MM-dd HH24:mi:ss') &gt;= #{endTime1}
+            </if>
+            <if test="endTime2 != null">
+                and TO_CHAR(END_TIME,'yyyy-MM-dd HH24:mi:ss') &lt;= #{endTime2}
+            </if>
+            <if test="memo != null and memo != ''">
+                and MEMO LIKE '%${memo}%'
+            </if>
+            <if test="auditingManNo != null and auditingManNo != ''">
+                and AUDITING_MAN_NO LIKE '%${auditingManNo}%'
+            </if>
+            <if test="originalValue != null and originalValue != ''">
+                and ORIGINAL_VALUE LIKE '%${originalValue}%'
+            </if>
+            <if test="syslog != null and syslog != ''">
+                and SYSLOG LIKE '%${syslog}%'
+            </if>
+            <if test="auditingManName != null and auditingManName != ''">
+                and AUDITING_MAN_NAME LIKE '%${auditingManName}%'
+            </if>
+            <if test="auditingTime != null">
+                and TO_CHAR(AUDITING_TIME,'yyyy-MM-dd') = #{auditingTime}
+            </if>
+            <if test="auditingFlag != null and auditingFlag != ''">
+                and AUDITING_FLAG LIKE '%${auditingFlag}%'
+            </if>
+            <if test="validFlag != null and validFlag != ''">
+                and VALID_FLAG LIKE '%${validFlag}%'
+            </if>
+            <if test="createManNo != null and createManNo != ''">
+                and CREATE_MAN_NO LIKE '%${createManNo}%'
+            </if>
+            <if test="createManName != null and createManName != ''">
+                and CREATE_MAN_NAME LIKE '%${createManName}%'
+            </if>
+            <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="isUpload != null">
+                and IS_UPLOAD = #{isUpload}
+            </if>
+            <if test="isInbatches != null">
+                and IS_INBATCHES = #{isInbatches}
+            </if>
+            <if test="isReturnedDust != null">
+                and IS_RETURNED_DUST = #{isReturnedDust}
+            </if>
+            <if test="isCoke != null">
+                and IS_COKE = #{isCoke}
+            </if>
+        </where>
+    </sql>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+        delete
+        from DYNAMIC_WORK_UPDATA
+        where UPDATA_NO = #{updataNo,jdbcType=VARCHAR}
+    </delete>
+    <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+        delete from DYNAMIC_WORK_UPDATA
+        where 1!=1
+        <if test="materialName != null and materialName != ''">
+            or MATERIAL_NAME = #{materialName}
+        </if>
+        <if test="materialCode != null and materialCode != ''">
+            or MATERIAL_CODE = #{materialCode}
+        </if>
+        <if test="stationName != null and stationName != ''">
+            or STATION_NAME = #{stationName}
+        </if>
+        <if test="stationCode != null and stationCode != ''">
+            or STATION_CODE = #{stationCode}
+        </if>
+        <if test="recieverName != null and recieverName != ''">
+            or RECIEVER_NAME = #{recieverName}
+        </if>
+        <if test="recieverCode != null and recieverCode != ''">
+            or RECIEVER_CODE = #{recieverCode}
+        </if>
+        <if test="senderName != null and senderName != ''">
+            or SENDER_NAME = #{senderName}
+        </if>
+        <if test="senderCode != null and senderCode != ''">
+            or SENDER_CODE = #{senderCode}
+        </if>
+        <if test="weight != null and weight != ''">
+            or WEIGHT = #{weight}
+        </if>
+        <if test="recieverType != null and recieverType != ''">
+            or RECIEVER_TYPE = #{recieverType}
+        </if>
+        <if test="senderType != null and senderType != ''">
+            or SENDER_TYPE = #{senderType}
+        </if>
+        <if test="uploaded != null and uploaded != ''">
+            or UPLOADED = #{uploaded}
+        </if>
+        <if test="startTime != null">
+            or TO_CHAR(START_TIME,'yyyy-MM-dd') = '#{startTime}'
+        </if>
+        <if test="endTime != null">
+            or TO_CHAR(END_TIME,'yyyy-MM-dd') = '#{endTime}'
+        </if>
+        <if test="memo != null and memo != ''">
+            or MEMO = #{memo}
+        </if>
+        <if test="auditingManNo != null and auditingManNo != ''">
+            or AUDITING_MAN_NO = #{auditingManNo}
+        </if>
+        <if test="originalValue != null and originalValue != ''">
+            or ORIGINAL_VALUE = #{originalValue}
+        </if>
+        <if test="syslog != null and syslog != ''">
+            or SYSLOG = #{syslog}
+        </if>
+        <if test="auditingManName != null and auditingManName != ''">
+            or AUDITING_MAN_NAME = #{auditingManName}
+        </if>
+        <if test="auditingTime != null">
+            or TO_CHAR(AUDITING_TIME,'yyyy-MM-dd') = '#{auditingTime}'
+        </if>
+        <if test="auditingFlag != null and auditingFlag != ''">
+            or AUDITING_FLAG = #{auditingFlag}
+        </if>
+        <if test="validFlag != null and validFlag != ''">
+            or VALID_FLAG = #{validFlag}
+        </if>
+        <if test="createManNo != null and createManNo != ''">
+            or CREATE_MAN_NO = #{createManNo}
+        </if>
+        <if test="createManName != null and createManName != ''">
+            or CREATE_MAN_NAME = #{createManName}
+        </if>
+        <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>
+    </delete>
+    <insert id="insert" parameterType="com.jisco.dynamicweight.dynamicworkupdata.model.DynamicWorkUpdata">
+        insert into DYNAMIC_WORK_UPDATA (UPDATA_NO, MATERIAL_NAME, MATERIAL_CODE,
+                                         STATION_NAME, STATION_CODE, RECIEVER_NAME,
+                                         RECIEVER_CODE, SENDER_NAME, SENDER_CODE,
+                                         WEIGHT, RECIEVER_TYPE, SENDER_TYPE,
+                                         UPLOADED, START_TIME, END_TIME,
+                                         MEMO, AUDITING_MAN_NO, ORIGINAL_VALUE,
+                                         SYSLOG, AUDITING_MAN_NAME, AUDITING_TIME,
+                                         AUDITING_FLAG, VALID_FLAG, CREATE_MAN_NO,
+                                         CREATE_MAN_NAME, CREATE_TIME, UPDATE_MAN_NO,
+                                         UPDATE_MAN_NAME, UPDATE_TIME)
+        values (#{updataNo,jdbcType=VARCHAR}, #{materialName,jdbcType=VARCHAR}, #{materialCode,jdbcType=VARCHAR},
+                #{stationName,jdbcType=VARCHAR}, #{stationCode,jdbcType=VARCHAR}, #{recieverName,jdbcType=VARCHAR},
+                #{recieverCode,jdbcType=VARCHAR}, #{senderName,jdbcType=VARCHAR}, #{senderCode,jdbcType=VARCHAR},
+                #{weight,jdbcType=VARCHAR}, #{recieverType,jdbcType=VARCHAR}, #{senderType,jdbcType=VARCHAR},
+                #{uploaded,jdbcType=VARCHAR}, #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP},
+                #{memo,jdbcType=VARCHAR}, #{auditingManNo,jdbcType=VARCHAR}, #{originalValue,jdbcType=VARCHAR},
+                #{syslog,jdbcType=VARCHAR}, #{auditingManName,jdbcType=VARCHAR}, #{auditingTime,jdbcType=TIMESTAMP},
+                #{auditingFlag,jdbcType=VARCHAR}, #{validFlag,jdbcType=VARCHAR}, #{createManNo,jdbcType=VARCHAR},
+                #{createManName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateManNo,jdbcType=VARCHAR},
+                #{updateManName,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP})
+    </insert>
+    <insert id="insertSelective" parameterType="com.jisco.dynamicweight.dynamicworkupdata.model.DynamicWorkUpdata">
+        insert into DYNAMIC_WORK_UPDATA
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="updataNo != null">
+                UPDATA_NO,
+            </if>
+            <if test="materialName != null">
+                MATERIAL_NAME,
+            </if>
+            <if test="materialCode != null">
+                MATERIAL_CODE,
+            </if>
+            <if test="stationName != null">
+                STATION_NAME,
+            </if>
+            <if test="stationCode != null">
+                STATION_CODE,
+            </if>
+            <if test="recieverName != null">
+                RECIEVER_NAME,
+            </if>
+            <if test="recieverCode != null">
+                RECIEVER_CODE,
+            </if>
+            <if test="senderName != null">
+                SENDER_NAME,
+            </if>
+            <if test="senderCode != null">
+                SENDER_CODE,
+            </if>
+            <if test="weight != null">
+                WEIGHT,
+            </if>
+            <if test="recieverType != null">
+                RECIEVER_TYPE,
+            </if>
+            <if test="senderType != null">
+                SENDER_TYPE,
+            </if>
+            <if test="uploaded != null">
+                UPLOADED,
+            </if>
+            <if test="startTime != null">
+                START_TIME,
+            </if>
+            <if test="endTime != null">
+                END_TIME,
+            </if>
+            <if test="memo != null">
+                MEMO,
+            </if>
+            <if test="auditingManNo != null">
+                AUDITING_MAN_NO,
+            </if>
+            <if test="originalValue != null">
+                ORIGINAL_VALUE,
+            </if>
+            <if test="syslog != null">
+                SYSLOG,
+            </if>
+            <if test="auditingManName != null">
+                AUDITING_MAN_NAME,
+            </if>
+            <if test="auditingTime != null">
+                AUDITING_TIME,
+            </if>
+            <if test="auditingFlag != null">
+                AUDITING_FLAG,
+            </if>
+            <if test="validFlag != null">
+                VALID_FLAG,
+            </if>
+            <if test="createManNo != null">
+                CREATE_MAN_NO,
+            </if>
+            <if test="createManName != null">
+                CREATE_MAN_NAME,
+            </if>
+            <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>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="updataNo != null">
+                #{updataNo,jdbcType=VARCHAR},
+            </if>
+            <if test="materialName != null">
+                #{materialName,jdbcType=VARCHAR},
+            </if>
+            <if test="materialCode != null">
+                #{materialCode,jdbcType=VARCHAR},
+            </if>
+            <if test="stationName != null">
+                #{stationName,jdbcType=VARCHAR},
+            </if>
+            <if test="stationCode != null">
+                #{stationCode,jdbcType=VARCHAR},
+            </if>
+            <if test="recieverName != null">
+                #{recieverName,jdbcType=VARCHAR},
+            </if>
+            <if test="recieverCode != null">
+                #{recieverCode,jdbcType=VARCHAR},
+            </if>
+            <if test="senderName != null">
+                #{senderName,jdbcType=VARCHAR},
+            </if>
+            <if test="senderCode != null">
+                #{senderCode,jdbcType=VARCHAR},
+            </if>
+            <if test="weight != null">
+                #{weight,jdbcType=VARCHAR},
+            </if>
+            <if test="recieverType != null">
+                #{recieverType,jdbcType=VARCHAR},
+            </if>
+            <if test="senderType != null">
+                #{senderType,jdbcType=VARCHAR},
+            </if>
+            <if test="uploaded != null">
+                #{uploaded,jdbcType=VARCHAR},
+            </if>
+            <if test="startTime != null">
+                #{startTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="endTime != null">
+                #{endTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="memo != null">
+                #{memo,jdbcType=VARCHAR},
+            </if>
+            <if test="auditingManNo != null">
+                #{auditingManNo,jdbcType=VARCHAR},
+            </if>
+            <if test="originalValue != null">
+                #{originalValue,jdbcType=VARCHAR},
+            </if>
+            <if test="syslog != null">
+                #{syslog,jdbcType=VARCHAR},
+            </if>
+            <if test="auditingManName != null">
+                #{auditingManName,jdbcType=VARCHAR},
+            </if>
+            <if test="auditingTime != null">
+                #{auditingTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="auditingFlag != null">
+                #{auditingFlag,jdbcType=VARCHAR},
+            </if>
+            <if test="validFlag != null">
+                #{validFlag,jdbcType=VARCHAR},
+            </if>
+            <if test="createManNo != null">
+                #{createManNo,jdbcType=VARCHAR},
+            </if>
+            <if test="createManName != null">
+                #{createManName,jdbcType=VARCHAR},
+            </if>
+            <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>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKey" parameterType="com.jisco.dynamicweight.dynamicworkupdata.model.DynamicWorkUpdata">
+        update DYNAMIC_WORK_UPDATA
+        set MATERIAL_NAME     = #{materialName,jdbcType=VARCHAR},
+            MATERIAL_CODE     = #{materialCode,jdbcType=VARCHAR},
+            STATION_NAME      = #{stationName,jdbcType=VARCHAR},
+            STATION_CODE      = #{stationCode,jdbcType=VARCHAR},
+            RECIEVER_NAME     = #{recieverName,jdbcType=VARCHAR},
+            RECIEVER_CODE     = #{recieverCode,jdbcType=VARCHAR},
+            SENDER_NAME       = #{senderName,jdbcType=VARCHAR},
+            SENDER_CODE       = #{senderCode,jdbcType=VARCHAR},
+            WEIGHT            = #{weight,jdbcType=VARCHAR},
+            RECIEVER_TYPE     = #{recieverType,jdbcType=VARCHAR},
+            SENDER_TYPE       = #{senderType,jdbcType=VARCHAR},
+            UPLOADED          = #{uploaded,jdbcType=VARCHAR},
+            START_TIME        = #{startTime,jdbcType=TIMESTAMP},
+            END_TIME          = #{endTime,jdbcType=TIMESTAMP},
+            MEMO              = #{memo,jdbcType=VARCHAR},
+            AUDITING_MAN_NO   = #{auditingManNo,jdbcType=VARCHAR},
+            ORIGINAL_VALUE    = #{originalValue,jdbcType=VARCHAR},
+            SYSLOG            = #{syslog,jdbcType=VARCHAR},
+            AUDITING_MAN_NAME = #{auditingManName,jdbcType=VARCHAR},
+            AUDITING_TIME     = #{auditingTime,jdbcType=TIMESTAMP},
+            AUDITING_FLAG     = #{auditingFlag,jdbcType=VARCHAR},
+            VALID_FLAG        = #{validFlag,jdbcType=VARCHAR},
+            CREATE_MAN_NO     = #{createManNo,jdbcType=VARCHAR},
+            CREATE_MAN_NAME   = #{createManName,jdbcType=VARCHAR},
+            CREATE_TIME       = #{createTime,jdbcType=TIMESTAMP},
+            UPDATE_MAN_NO     = #{updateManNo,jdbcType=VARCHAR},
+            UPDATE_MAN_NAME   = #{updateManName,jdbcType=VARCHAR},
+            UPDATE_TIME       = #{updateTime,jdbcType=TIMESTAMP}
+        where UPDATA_NO = #{updataNo,jdbcType=VARCHAR}
+    </update>
+    <update id="updateByPrimaryKeySelective"
+            parameterType="com.jisco.dynamicweight.dynamicworkupdata.model.DynamicWorkUpdata">
+        update DYNAMIC_WORK_UPDATA
+        <set>
+            <if test="materialName != null">
+                MATERIAL_NAME = #{materialName,jdbcType=VARCHAR},
+            </if>
+            <if test="materialCode != null">
+                MATERIAL_CODE = #{materialCode,jdbcType=VARCHAR},
+            </if>
+            <if test="stationName != null">
+                STATION_NAME = #{stationName,jdbcType=VARCHAR},
+            </if>
+            <if test="stationCode != null">
+                STATION_CODE = #{stationCode,jdbcType=VARCHAR},
+            </if>
+            <if test="recieverName != null">
+                RECIEVER_NAME = #{recieverName,jdbcType=VARCHAR},
+            </if>
+            <if test="recieverCode != null">
+                RECIEVER_CODE = #{recieverCode,jdbcType=VARCHAR},
+            </if>
+            <if test="senderName != null">
+                SENDER_NAME = #{senderName,jdbcType=VARCHAR},
+            </if>
+            <if test="senderCode != null">
+                SENDER_CODE = #{senderCode,jdbcType=VARCHAR},
+            </if>
+            <if test="weight != null">
+                WEIGHT = #{weight,jdbcType=VARCHAR},
+            </if>
+            <if test="recieverType != null">
+                RECIEVER_TYPE = #{recieverType,jdbcType=VARCHAR},
+            </if>
+            <if test="senderType != null">
+                SENDER_TYPE = #{senderType,jdbcType=VARCHAR},
+            </if>
+            <if test="uploaded != null">
+                UPLOADED = #{uploaded,jdbcType=VARCHAR},
+            </if>
+            <if test="startTime != null">
+                START_TIME = #{startTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="endTime != null">
+                END_TIME = #{endTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="memo != null">
+                MEMO = #{memo,jdbcType=VARCHAR},
+            </if>
+            <if test="auditingManNo != null">
+                AUDITING_MAN_NO = #{auditingManNo,jdbcType=VARCHAR},
+            </if>
+            <if test="originalValue != null">
+                ORIGINAL_VALUE = #{originalValue,jdbcType=VARCHAR},
+            </if>
+            <if test="syslog != null">
+                SYSLOG = #{syslog,jdbcType=VARCHAR},
+            </if>
+            <if test="auditingManName != null">
+                AUDITING_MAN_NAME = #{auditingManName,jdbcType=VARCHAR},
+            </if>
+            <if test="auditingTime != null">
+                AUDITING_TIME = #{auditingTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="auditingFlag != null">
+                AUDITING_FLAG = #{auditingFlag,jdbcType=VARCHAR},
+            </if>
+            <if test="validFlag != null">
+                VALID_FLAG = #{validFlag,jdbcType=VARCHAR},
+            </if>
+            <if test="createManNo != null">
+                CREATE_MAN_NO = #{createManNo,jdbcType=VARCHAR},
+            </if>
+            <if test="createManName != null">
+                CREATE_MAN_NAME = #{createManName,jdbcType=VARCHAR},
+            </if>
+            <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>
+        </set>
+        where UPDATA_NO = #{updataNo,jdbcType=VARCHAR}
+    </update>
+    <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
+        <include refid="select_alias"/>
+        where UPDATA_NO = #{updataNo,jdbcType=VARCHAR}
+    </select>
+    <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+        <include refid="select_alias"/>
+        <include refid="where"/>
+    </select>
+    <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+        <include refid="select_alias"/>
+        <include refid="whereLike"/>
+    </select>
+    <select id="recalc" statementType="CALLABLE">
+        {call GENERATEUPDATA()}
+    </select>
+    <insert id="batchInsert" parameterType="java.util.List">
+        insert into DYNAMIC_WORK_UPDATA
+        (UPDATA_NO,
+        MATERIAL_NAME, MATERIAL_CODE, STATION_NAME,
+        STATION_CODE, RECIEVER_NAME, RECIEVER_CODE,
+        SENDER_NAME, SENDER_CODE, WEIGHT,
+        RECIEVER_TYPE, SENDER_TYPE, UPLOADED,
+        START_TIME, END_TIME, MEMO,
+        AUDITING_MAN_NO, ORIGINAL_VALUE,
+        SYSLOG, AUDITING_MAN_NAME, AUDITING_TIME,
+        AUDITING_FLAG, VALID_FLAG, CREATE_MAN_NO,
+        CREATE_MAN_NAME, CREATE_TIME,
+        UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME
+        )
+        ( <foreach collection="list" item="item" separator="union all">
+        select
+        #{item.updataNo,jdbcType=VARCHAR},
+        #{item.materialName,jdbcType=VARCHAR}, #{item.materialCode,jdbcType=VARCHAR},
+        #{item.stationName,jdbcType=VARCHAR},
+        #{item.stationCode,jdbcType=VARCHAR}, #{item.recieverName,jdbcType=VARCHAR},
+        #{item.recieverCode,jdbcType=VARCHAR},
+        #{item.senderName,jdbcType=VARCHAR}, #{item.senderCode,jdbcType=VARCHAR}, #{item.weight,jdbcType=VARCHAR},
+        #{item.recieverType,jdbcType=VARCHAR}, #{item.senderType,jdbcType=VARCHAR}, #{item.uploaded,jdbcType=VARCHAR},
+        #{item.startTime,jdbcType=TIMESTAMP}, #{item.endTime,jdbcType=TIMESTAMP}, #{item.memo,jdbcType=VARCHAR},
+        #{item.auditingManNo,jdbcType=VARCHAR}, #{item.originalValue,jdbcType=VARCHAR},
+        #{item.syslog,jdbcType=VARCHAR}, #{item.auditingManName,jdbcType=VARCHAR},
+        #{item.auditingTime,jdbcType=TIMESTAMP},
+        #{item.auditingFlag,jdbcType=VARCHAR}, #{item.validFlag,jdbcType=VARCHAR}, #{item.createManNo,jdbcType=VARCHAR},
+        #{item.createManName,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP},
+        #{item.updateManNo,jdbcType=VARCHAR}, #{item.updateManName,jdbcType=VARCHAR},
+        #{item.updateTime,jdbcType=TIMESTAMP}
+        from dual
+    </foreach> )
+    </insert>
+    <update id="batchUpdate" parameterType="java.util.List">
+        update DYNAMIC_WORK_UPDATA
+        set
+        UPDATA_NO=
+        <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
+            when #{item.updataNo,jdbcType=VARCHAR} then #{item.updataNo,jdbcType=VARCHAR}
+        </foreach>
+        ,MATERIAL_NAME=
+        <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
+            when #{item.updataNo,jdbcType=VARCHAR} then #{item.materialName,jdbcType=VARCHAR}
+        </foreach>
+        ,MATERIAL_CODE=
+        <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
+            when #{item.updataNo,jdbcType=VARCHAR} then #{item.materialCode,jdbcType=VARCHAR}
+        </foreach>
+        ,STATION_NAME=
+        <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
+            when #{item.updataNo,jdbcType=VARCHAR} then #{item.stationName,jdbcType=VARCHAR}
+        </foreach>
+        ,STATION_CODE=
+        <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
+            when #{item.updataNo,jdbcType=VARCHAR} then #{item.stationCode,jdbcType=VARCHAR}
+        </foreach>
+        ,RECIEVER_NAME=
+        <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
+            when #{item.updataNo,jdbcType=VARCHAR} then #{item.recieverName,jdbcType=VARCHAR}
+        </foreach>
+        ,RECIEVER_CODE=
+        <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
+            when #{item.updataNo,jdbcType=VARCHAR} then #{item.recieverCode,jdbcType=VARCHAR}
+        </foreach>
+        ,SENDER_NAME=
+        <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
+            when #{item.updataNo,jdbcType=VARCHAR} then #{item.senderName,jdbcType=VARCHAR}
+        </foreach>
+        ,SENDER_CODE=
+        <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
+            when #{item.updataNo,jdbcType=VARCHAR} then #{item.senderCode,jdbcType=VARCHAR}
+        </foreach>
+        ,WEIGHT=
+        <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
+            when #{item.updataNo,jdbcType=VARCHAR} then #{item.weight,jdbcType=VARCHAR}
+        </foreach>
+        ,RECIEVER_TYPE=
+        <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
+            when #{item.updataNo,jdbcType=VARCHAR} then #{item.recieverType,jdbcType=VARCHAR}
+        </foreach>
+        ,SENDER_TYPE=
+        <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
+            when #{item.updataNo,jdbcType=VARCHAR} then #{item.senderType,jdbcType=VARCHAR}
+        </foreach>
+        ,UPLOADED=
+        <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
+            when #{item.updataNo,jdbcType=VARCHAR} then #{item.uploaded,jdbcType=VARCHAR}
+        </foreach>
+        ,START_TIME=
+        <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
+            when #{item.updataNo,jdbcType=VARCHAR} then #{item.startTime,jdbcType=TIMESTAMP}
+        </foreach>
+        ,END_TIME=
+        <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
+            when #{item.updataNo,jdbcType=VARCHAR} then #{item.endTime,jdbcType=TIMESTAMP}
+        </foreach>
+        ,MEMO=
+        <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
+            when #{item.updataNo,jdbcType=VARCHAR} then #{item.memo,jdbcType=VARCHAR}
+        </foreach>
+        ,AUDITING_MAN_NO=
+        <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
+            when #{item.updataNo,jdbcType=VARCHAR} then #{item.auditingManNo,jdbcType=VARCHAR}
+        </foreach>
+        ,ORIGINAL_VALUE=
+        <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
+            when #{item.updataNo,jdbcType=VARCHAR} then #{item.originalValue,jdbcType=VARCHAR}
+        </foreach>
+        ,SYSLOG=
+        <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
+            when #{item.updataNo,jdbcType=VARCHAR} then #{item.syslog,jdbcType=VARCHAR}
+        </foreach>
+        ,AUDITING_MAN_NAME=
+        <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
+            when #{item.updataNo,jdbcType=VARCHAR} then #{item.auditingManName,jdbcType=VARCHAR}
+        </foreach>
+        ,AUDITING_TIME=
+        <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
+            when #{item.updataNo,jdbcType=VARCHAR} then #{item.auditingTime,jdbcType=TIMESTAMP}
+        </foreach>
+        ,AUDITING_FLAG=
+        <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
+            when #{item.updataNo,jdbcType=VARCHAR} then #{item.auditingFlag,jdbcType=VARCHAR}
+        </foreach>
+        ,VALID_FLAG=
+        <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
+            when #{item.updataNo,jdbcType=VARCHAR} then #{item.validFlag,jdbcType=VARCHAR}
+        </foreach>
+        ,CREATE_MAN_NO=
+        <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
+            when #{item.updataNo,jdbcType=VARCHAR} then #{item.createManNo,jdbcType=VARCHAR}
+        </foreach>
+        ,CREATE_MAN_NAME=
+        <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
+            when #{item.updataNo,jdbcType=VARCHAR} then #{item.createManName,jdbcType=VARCHAR}
+        </foreach>
+        ,CREATE_TIME=
+        <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
+            when #{item.updataNo,jdbcType=VARCHAR} then #{item.createTime,jdbcType=TIMESTAMP}
+        </foreach>
+        ,UPDATE_MAN_NO=
+        <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
+            when #{item.updataNo,jdbcType=VARCHAR} then #{item.updateManNo,jdbcType=VARCHAR}
+        </foreach>
+        ,UPDATE_MAN_NAME=
+        <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
+            when #{item.updataNo,jdbcType=VARCHAR} then #{item.updateManName,jdbcType=VARCHAR}
+        </foreach>
+        ,UPDATE_TIME=
+        <foreach collection="list" item="item" index="index" separator=" " open="case UPDATA_NO" close="end">
+            when #{item.updataNo,jdbcType=VARCHAR} then #{item.updateTime,jdbcType=TIMESTAMP}
+        </foreach>
+        where UPDATA_NO in
+        <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
+            #{item.updataNo,jdbcType=VARCHAR}
+        </foreach>
+    </update>
+    <delete id="batchDelete" parameterType="java.util.List">
+        delete from DYNAMIC_WORK_UPDATA
+        where UPDATA_NO in
+        <foreach collection="list" item="id" open="(" close=")" separator=",">
+            #{id}
+        </foreach>
+    </delete>
+    <!-- 友情提示!!!-->
+    <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+
 </mapper>

+ 96 - 40
src/main/java/com/jisco/dynamicweight/dynamicworkupdata/model/DynamicWorkUpdata.java

@@ -4,6 +4,7 @@ import com.steerinfo.framework.model.IBasePO;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
+import java.math.BigDecimal;
 import java.util.Date;
 
 @ApiModel(value="动态秤称重数据")
@@ -66,7 +67,7 @@ public class DynamicWorkUpdata implements IBasePO<String> {
      * 重量(WEIGHT,VARCHAR,20)
      */
     @ApiModelProperty(value="重量",required=false)
-    private String weight;
+    private BigDecimal weight;
 
     /**
      * 收货点类型(RECIEVER_TYPE,VARCHAR,60)
@@ -182,6 +183,30 @@ public class DynamicWorkUpdata implements IBasePO<String> {
     @ApiModelProperty(value="修改时间(YYYY-MM-DD HH:mm:SS)",required=false)
     private Date updateTime;
 
+    /**
+     * 是否上传皮卡(IS_UPLOAD,DECIMAL,38)
+     */
+    @ApiModelProperty(value="是否上传皮卡",required=true)
+    private BigDecimal isUpload;
+
+    /**
+     * 是否分批(IS_INBATCHES,DECIMAL,38)
+     */
+    @ApiModelProperty(value="是否分批",required=true)
+    private BigDecimal isInbatches;
+
+    /**
+     * 是否返粉(IS_RETURNED_DUST,DECIMAL,38)
+     */
+    @ApiModelProperty(value="是否返粉",required=true)
+    private BigDecimal isReturnedDust;
+
+    /**
+     * 是否焦炭(IS_COKE,DECIMAL,0)
+     */
+    @ApiModelProperty(value="是否焦炭",required=true)
+    private Short isCoke;
+
     private static final long serialVersionUID = 1L;
 
     @Override
@@ -266,12 +291,12 @@ public class DynamicWorkUpdata implements IBasePO<String> {
         this.senderCode = senderCode == null ? null : senderCode.trim();
     }
 
-    public String getWeight() {
+    public BigDecimal getWeight() {
         return weight;
     }
 
-    public void setWeight(String weight) {
-        this.weight = weight == null ? null : weight.trim();
+    public void setWeight(BigDecimal weight) {
+        this.weight = weight == null ? null : weight;
     }
 
     public String getRecieverType() {
@@ -426,43 +451,74 @@ public class DynamicWorkUpdata implements IBasePO<String> {
         this.updateTime = updateTime;
     }
 
+    public BigDecimal getIsUpload() {
+        return isUpload;
+    }
+
+    public void setIsUpload(BigDecimal isUpload) {
+        this.isUpload = isUpload;
+    }
+
+    public BigDecimal getIsInbatches() {
+        return isInbatches;
+    }
+
+    public void setIsInbatches(BigDecimal isInbatches) {
+        this.isInbatches = isInbatches;
+    }
+
+    public BigDecimal getIsReturnedDust() {
+        return isReturnedDust;
+    }
+
+    public void setIsReturnedDust(BigDecimal isReturnedDust) {
+        this.isReturnedDust = isReturnedDust;
+    }
+
+    public Short getIsCoke() {
+        return isCoke;
+    }
+
+    public void setIsCoke(Short isCoke) {
+        this.isCoke = isCoke;
+    }
+
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder();
-        sb.append(getClass().getSimpleName());
-        sb.append(" [");
-        sb.append("Hash = ").append(hashCode());
-        sb.append(", updataNo=").append(updataNo);
-        sb.append(", materialName=").append(materialName);
-        sb.append(", materialCode=").append(materialCode);
-        sb.append(", stationName=").append(stationName);
-        sb.append(", stationCode=").append(stationCode);
-        sb.append(", recieverName=").append(recieverName);
-        sb.append(", recieverCode=").append(recieverCode);
-        sb.append(", senderName=").append(senderName);
-        sb.append(", senderCode=").append(senderCode);
-        sb.append(", weight=").append(weight);
-        sb.append(", recieverType=").append(recieverType);
-        sb.append(", senderType=").append(senderType);
-        sb.append(", uploaded=").append(uploaded);
-        sb.append(", startTime=").append(startTime);
-        sb.append(", endTime=").append(endTime);
-        sb.append(", memo=").append(memo);
-        sb.append(", auditingManNo=").append(auditingManNo);
-        sb.append(", originalValue=").append(originalValue);
-        sb.append(", syslog=").append(syslog);
-        sb.append(", auditingManName=").append(auditingManName);
-        sb.append(", auditingTime=").append(auditingTime);
-        sb.append(", auditingFlag=").append(auditingFlag);
-        sb.append(", validFlag=").append(validFlag);
-        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(", serialVersionUID=").append(serialVersionUID);
-        sb.append("]");
-        return sb.toString();
+        return "DynamicWorkUpdata{" +
+                "updataNo='" + updataNo + '\'' +
+                ", materialName='" + materialName + '\'' +
+                ", materialCode='" + materialCode + '\'' +
+                ", stationName='" + stationName + '\'' +
+                ", stationCode='" + stationCode + '\'' +
+                ", recieverName='" + recieverName + '\'' +
+                ", recieverCode='" + recieverCode + '\'' +
+                ", senderName='" + senderName + '\'' +
+                ", senderCode='" + senderCode + '\'' +
+                ", weight='" + weight + '\'' +
+                ", recieverType='" + recieverType + '\'' +
+                ", senderType='" + senderType + '\'' +
+                ", uploaded='" + uploaded + '\'' +
+                ", startTime=" + startTime +
+                ", endTime=" + endTime +
+                ", memo='" + memo + '\'' +
+                ", auditingManNo='" + auditingManNo + '\'' +
+                ", originalValue='" + originalValue + '\'' +
+                ", syslog='" + syslog + '\'' +
+                ", auditingManName='" + auditingManName + '\'' +
+                ", auditingTime=" + auditingTime +
+                ", auditingFlag='" + auditingFlag + '\'' +
+                ", validFlag='" + validFlag + '\'' +
+                ", createManNo='" + createManNo + '\'' +
+                ", createManName='" + createManName + '\'' +
+                ", createTime=" + createTime +
+                ", updateManNo='" + updateManNo + '\'' +
+                ", updateManName='" + updateManName + '\'' +
+                ", updateTime=" + updateTime +
+                ", isUpload=" + isUpload +
+                ", isInbatches=" + isInbatches +
+                ", isReturnedDust=" + isReturnedDust +
+                ", isCoke=" + isCoke +
+                '}';
     }
 }

+ 39 - 0
src/main/java/com/jisco/dynamicweight/enums/ValidFlagEnum.java

@@ -0,0 +1,39 @@
+package com.jisco.dynamicweight.enums;
+
+import lombok.Data;
+
+public enum ValidFlagEnum {
+    VALID("1", "有效"),INVALID("0","无效");
+
+    private String code;
+    private String msg;
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+
+    ValidFlagEnum(String code, String msg) {
+        this.code = code;
+        this.msg = msg;
+    }
+
+    @Override
+    public String toString() {
+        return "ValidFlagEnum{" +
+                "code='" + code + '\'' +
+                ", msg='" + msg + '\'' +
+                '}';
+    }
+}

+ 8 - 8
src/main/java/com/steerinfo/meterwork/meterworkcaractual/mapper/MeterWorkCarActualMapper.xml

@@ -491,8 +491,8 @@
             <if test="dataSource != null and dataSource != ''">
                 and DATA_SOURCE = #{dataSource}
             </if>
-            <if test="netTime1 != null and netTime1 != null and netTime2 != '' and netTime2 != ''">
-                and  NET_TIME  >= TO_DATE(#{netTime1}, 'yyyy-MM-dd HH24:mi:ss') and NET_TIME  &lt;=  TO_DATE(#{netTime2}, 'yyyy-MM-dd HH24:mi:ss')
+            <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
+                and  NET_TIME  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and NET_TIME  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
             </if>
         </where>
     </sql>
@@ -825,8 +825,8 @@
             <if test="dataSource != null and dataSource != ''">
                 and DATA_SOURCE LIKE '%${dataSource}%'
             </if>
-            <if test="netTime1 != null and netTime1 != null and netTime2 != '' and netTime2 != ''">
-                and  NET_TIME  >= TO_DATE(#{netTime1}, 'yyyy-MM-dd HH24:mi:ss') and NET_TIME  &lt;=  TO_DATE(#{netTime2}, 'yyyy-MM-dd HH24:mi:ss')
+            <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
+                and  NET_TIME  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and NET_TIME  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
             </if>
         </where>
     </sql>
@@ -2904,8 +2904,8 @@
 
     <sql id="whereTime">
         <where>
-            <if test="netTime1 != null and netTime1 != null and netTime2 != '' and netTime2 != ''">
-                and  NET_TIME  >= TO_DATE(#{netTime1}, 'yyyy-MM-dd HH24:mi:ss') and NET_TIME  &lt;=  TO_DATE(#{netTime2}, 'yyyy-MM-dd HH24:mi:ss')
+            <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
+                and  NET_TIME  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and NET_TIME  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
             </if>
         </where>
     </sql>
@@ -3090,8 +3090,8 @@
             <if test="valueFlag != null and valueFlag != ''">
                 and value_flag = #{valueFlag}
             </if>
-            <if test="netTime1 != null and netTime1 != null and netTime2 != '' and netTime2 != ''">
-                and  NET_TIME  >= TO_DATE(#{netTime1}, 'yyyy-MM-dd HH24:mi:ss') and NET_TIME  &lt;=  TO_DATE(#{netTime2}, 'yyyy-MM-dd HH24:mi:ss')
+            <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
+                and  NET_TIME  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and NET_TIME  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
             </if>
         </where>
         order by NET_TIME desc

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

@@ -558,7 +558,7 @@ public class MeterWorkCarActualServiceImpl extends BaseServiceImpl<MeterWorkCarA
         if (StringUtils.isNotEmpty(model.getPredictionNo())) {
             PreTrackScale scale = new PreTrackScale();
             scale.setPredictionNo(model.getPredictionNo());
-            scale.setValueFlag("4");
+            scale.setValueFlag("1");
             scale.setUpdateTime(new Date());
             scale.setUpdateManNo("system");
             scale.setUpdateManName("计量洁净数据解除委托操作");

+ 7 - 8
src/main/java/com/steerinfo/meterwork/meterworkcaractualfirst/mapper/MeterWorkCarActualFirstMapper.xml

@@ -405,7 +405,7 @@
       <if test="dataSource != null and dataSource != ''">
         and DATA_SOURCE = #{dataSource}
       </if>
-      <if test="startTime != null and startTime != null and endTime != '' and endTime != ''">
+      <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
         and  CREATE_TIME  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and CREATE_TIME  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
       </if>
     </where>
@@ -679,7 +679,7 @@
       <if test="dataSource != null and dataSource != ''">
         and DATA_SOURCE LIKE '%${dataSource}%'
       </if>
-      <if test="startTime != null and startTime != null and endTime != '' and endTime != ''">
+      <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
         and  CREATE_TIME  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and CREATE_TIME  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
       </if>
     </where>
@@ -2393,7 +2393,7 @@
 
     <sql id="whereTime">
       <where>
-        <if test="startTime != null and startTime != null and endTime != '' and endTime != ''">
+        <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
           and  CREATE_TIME  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and CREATE_TIME  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
         </if>
       </where>
@@ -2444,8 +2444,8 @@
             <if test="valueFlag != null and valueFlag != ''">
                 and VALUE_FLAG = #{valueFlag}
             </if>
-            <if test="createTime1 != null and createTime2 != null and createTime1 != '' and createTime2 != ''">
-                and  CREATE_TIME  >= TO_DATE(#{createTime1}, 'yyyy-MM-dd HH24:mi:ss') and CREATE_TIME  &lt;=  TO_DATE(#{createTime2}, 'yyyy-MM-dd HH24:mi:ss')
+            <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
+              and  CREATE_TIME  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and CREATE_TIME  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
             </if>
         </where>
         order by  CREATE_TIME desc
@@ -2482,9 +2482,8 @@
             <if test="carNo != null and carNo != ''">
                 and CAR_NO LIKE '%${carNo}%'
             </if>
-            <if test="createTime1 != null and createTime2 != null and createTime1 != '' and createTime2 != ''">
-                and TO_CHAR(CREATE_TIME,'yyyy-MM-dd HH24:mi:ss') >= #{createTime1} and TO_CHAR(CREATE_TIME,'yyyy-MM-dd
-                HH24:mi:ss') &lt;= #{createTime2}
+            <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
+              and  CREATE_TIME  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and CREATE_TIME  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
             </if>
         </where>
         order by CREATE_TIME  desc

+ 6 - 6
src/main/java/com/steerinfo/meterwork/meterworkcaractualfirst/service/impl/MeterWorkCarActualFirstServiceImpl.java

@@ -647,12 +647,12 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
         if (model.getCarNo() == null || model.getCarNo().equals("")) {
             throw new MarkerMetException(500, "车号不能为空");
         }
-        if (model.getMeterTypeNo() == null || model.getMeterTypeNo().equals("")) {
-            throw new MarkerMetException(500, "业务类型编号不能为空");
-        }
-        if (model.getMeterTypeName() == null || model.getMeterTypeName().equals("")) {
-            throw new MarkerMetException(500, "业务类型名称不能为空");
-        }
+//        if (model.getMeterTypeNo() == null || model.getMeterTypeNo().equals("")) {
+//            throw new MarkerMetException(500, "业务类型编号不能为空");
+//        }
+//        if (model.getMeterTypeName() == null || model.getMeterTypeName().equals("")) {
+//            throw new MarkerMetException(500, "业务类型名称不能为空");
+//        }
         if (model.getBaseSpotNo() == null || model.getBaseSpotNo().equals("")) {
             throw new MarkerMetException(500, "计量点编号不能为空");
         }

+ 25 - 10
src/main/java/com/steerinfo/meterwork/meterworkrailwayactfirst/controller/MeterWorkRailwayActFirstController.java

@@ -286,17 +286,13 @@ throw new MarkerMetException(500, "操作异常!!");
         return rm;
     }
 
-    @ApiOperation(value = "修改车号", notes = "根据MeterWorkRailwayActFirst对象修改车号")
+    @ApiOperation(value = "修改车号-网页", notes = "根据MeterWorkRailwayActFirst对象修改车号")
     @PostMapping(value = "/updateCar")
     public RESTfulResult updateCar(@RequestBody MeterWorkRailwayActFirst model) {
         RESTfulResult rm = failed();
         try {
-            int num = meterWorkRailwayActFirstService.abolish(model);
-            if (num >= 1) {
+            int num = meterWorkRailwayActFirstService.updateCar(model);
                 return success(num);
-            } else {
-                return failed("停用失败");
-            }
         } catch (MarkerMetException e) {
             e.printStackTrace();
             rm.setMessage(e.getMessage());
@@ -309,7 +305,7 @@ throw new MarkerMetException(500, "操作异常!!");
         return rm;
     }
 
-    @ApiOperation(value = "停用", notes = "根据MeterWorkRailwayActFirst对象修改状态")
+    @ApiOperation(value = "停用-网页", notes = "根据MeterWorkRailwayActFirst对象修改状态")
     @PostMapping(value = "/abolish")
     public RESTfulResult abolish(@RequestBody MeterWorkRailwayActFirst model) {
         RESTfulResult rm = failed();
@@ -333,7 +329,7 @@ throw new MarkerMetException(500, "操作异常!!");
     }
 
 
-    @ApiOperation(value = "启用", notes = "根据MeterWorkRailwayActFirst对象创建")
+    @ApiOperation(value = "启用-网页", notes = "根据MeterWorkRailwayActFirst对象创建")
     @PostMapping(value = "/recover")
     public RESTfulResult recover(@RequestBody MeterWorkRailwayActFirst model) {
         RESTfulResult rm = failed();
@@ -354,7 +350,7 @@ throw new MarkerMetException(500, "操作异常!!");
         return rm;
     }
 
-    @ApiOperation(value = "解除", notes = "根据MeterWorkRailwayActFirst对象创建")
+    @ApiOperation(value = "解除委托-网页", notes = "根据MeterWorkRailwayActFirst对象创建")
     @PostMapping(value = "/remove")
     public RESTfulResult remove(@RequestBody MeterWorkRailwayActFirst model) {
         RESTfulResult rm = failed();
@@ -375,7 +371,26 @@ throw new MarkerMetException(500, "操作异常!!");
         return rm;
     }
 
-    @ApiOperation(value = "匹配", notes = "根据MeterWorkRailwayActFirst对象创建")
+    @ApiOperation(value = "火车号汇总统计汇总-网页", notes = "根据传入时间和火车号,查询给定时间段去重车号")
+    @GetMapping(value = "/distinctCarNo")
+    public RESTfulResult distinctCarNo(String railwayNo, String startTime, String endTime) {
+        RESTfulResult rm = failed();
+        try {
+            List<String> rows = meterWorkRailwayActFirstService.distinctCarNo(railwayNo, startTime, endTime);
+            return success(rows);
+        } catch (MarkerMetException e) {
+            e.printStackTrace();
+            rm.setMessage(e.getMessage());
+        } catch (Exception e) {
+            e.printStackTrace();
+            rm.setMessage("操作异常,请确认!");
+        } finally {
+
+        }
+        return rm;
+    }
+
+    @ApiOperation(value = "匹配委托-网页", notes = "根据MeterWorkRailwayActFirst对象创建")
     @PostMapping(value = "/match")
     public RESTfulResult match(@RequestBody MeterWorkRailwayActFirstDto model) {
         RESTfulResult rm = failed();

+ 7 - 0
src/main/java/com/steerinfo/meterwork/meterworkrailwayactfirst/mapper/MeterWorkRailwayActFirstMapper.java

@@ -2,6 +2,7 @@ package com.steerinfo.meterwork.meterworkrailwayactfirst.mapper;
 
 import com.steerinfo.framework.mapper.IBaseMapper;
 import com.steerinfo.meterwork.dto.StaffPerformanceAnalysis;
+import com.steerinfo.meterwork.meterworkcaractualfirst.model.MeterWorkCarActualFirst;
 import com.steerinfo.meterwork.meterworkrailwayactfirst.model.MeterWorkRailwayActFirst;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
@@ -37,6 +38,12 @@ public interface MeterWorkRailwayActFirstMapper extends IBaseMapper<MeterWorkRai
     List<MeterWorkRailwayActFirst> selectTa(Map<String, Object> parmas);
 
     List<MeterWorkRailwayActFirst> selectSta(HashMap parmas);
+    /**
+     * 根据传入时间和车号,查询给定时间段去重车号
+     * @param obj
+     * @return
+     */
+    List<MeterWorkRailwayActFirst> distinctCarNo(HashMap<String, Object> obj);
 
     int getDataCount(Map<String, Object> mp);
 }

+ 31 - 8
src/main/java/com/steerinfo/meterwork/meterworkrailwayactfirst/mapper/MeterWorkRailwayActFirstMapper.xml

@@ -318,6 +318,9 @@
       <if test="sourceArea != null and sourceArea != ''">
         and SOURCE_AREA = #{sourceArea}
       </if>
+      <if test="startTime != null and startTime != null and endTime != '' and endTime != ''">
+        and  CREATE_TIME  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and CREATE_TIME  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
+      </if>
     </where>
   </sql>
   <sql id="whereLike">
@@ -529,6 +532,9 @@
       <if test="sourceArea != null and sourceArea != ''">
         and SOURCE_AREA LIKE '%${sourceArea}%'
       </if>
+      <if test="startTime != null and startTime != null and endTime != '' and endTime != ''">
+        and  CREATE_TIME  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and CREATE_TIME  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
+      </if>
     </where>
   </sql>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
@@ -1870,6 +1876,13 @@
 
   <!-- 友情提示!!!-->
   <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+
+
+  <sql id="whereTime">
+    <if test="startTime != null and startTime != null and endTime != '' and endTime != ''">
+      and  CREATE_TIME  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and CREATE_TIME  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
+    </if>
+  </sql>
   <select id="getNewID" parameterType="java.lang.String" resultType="java.lang.String">
     SELECT LPAD(NVL(MAX(TO_NUMBER(SUBSTR(ACTUAL_FIRST_NO, LENGTH(ACTUAL_FIRST_NO) - 3))),0) + 1,4,'0') ACTUAL_FIRST_NO
     FROM METER_WORK_RAILWAY_ACT_FIRST where instr(ACTUAL_FIRST_NO,#{afl,jdbcType=VARCHAR})>0
@@ -1908,8 +1921,8 @@
       <if test="railwayTypeName != null and railwayTypeName != ''">
         and RAILWAY_TYPE_NAME = #{railwayTypeName}
       </if>
-      <if test="createTime1 != null and createTime2 != null and createTime1 != '' and createTime2 != ''">
-        and TO_CHAR(CREATE_TIME,'yyyy-MM-dd HH24:mi:ss') >= #{createTime1} and TO_CHAR(CREATE_TIME,'yyyy-MM-dd HH24:mi:ss') &lt;= #{createTime2}
+      <if test="startTime != null and startTime != null and endTime != '' and endTime != ''">
+        and  CREATE_TIME  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and CREATE_TIME  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
       </if>
     </where>
      order by CREATE_TIME desc
@@ -1977,8 +1990,8 @@
       and RECEIVING_UINT_NAME like '%${receivingUintName}%'
     </if>
 
-    <if test="createTime1 != null and createTime2 != null and createTime1 != '' and createTime2 != ''">
-      and  CREATE_TIME  >= TO_DATE(#{createTime1}, 'yyyy-MM-dd HH24:mi:ss') and CREATE_TIME  &lt;=  TO_DATE(#{createTime2}, 'yyyy-MM-dd HH24:mi:ss')
+    <if test="startTime != null and startTime != null and endTime != '' and endTime != ''">
+      and  CREATE_TIME  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and CREATE_TIME  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
     </if>
     order by  CREATE_TIME desc
   </select>
@@ -2301,8 +2314,8 @@
       <if test="railwayModelName != null and railwayModelName != ''">
         and RAILWAY_MODEL_NAME = #{railwayModelName}
       </if>
-      <if test="createTime1 != null and createTime2 != null and createTime1 != '' and createTime2 != ''">
-        and  CREATE_TIME  >= TO_DATE(#{createTime1}, 'yyyy-MM-dd HH24:mi:ss') and CREATE_TIME  &lt;=  TO_DATE(#{createTime2}, 'yyyy-MM-dd HH24:mi:ss')
+      <if test="startTime != null and startTime != null and endTime != '' and endTime != ''">
+        and  CREATE_TIME  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and CREATE_TIME  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
       </if>
     </where>
     order by CREATE_TIME desc
@@ -2502,8 +2515,8 @@
       <if test="railwayModelName != null and railwayModelName != ''">
         and RAILWAY_MODEL_NAME = #{railwayModelName}
       </if>
-      <if test="createTime1 != null and createTime2 != null and createTime1 != '' and createTime2 != ''">
-        and  CREATE_TIME  >= TO_DATE(#{createTime1}, 'yyyy-MM-dd HH24:mi:ss') and CREATE_TIME  &lt;=  TO_DATE(#{createTime2}, 'yyyy-MM-dd HH24:mi:ss')
+      <if test="startTime != null and startTime != null and endTime != '' and endTime != ''">
+        and  CREATE_TIME  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and CREATE_TIME  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
       </if>
     </where>
      order by CREATE_TIME desc
@@ -2512,4 +2525,14 @@
   <select id="getDataCount" parameterType="java.util.HashMap" resultType="java.lang.Integer">
     select count(1) from METER_WORK_RAILWAY_ACT_FIRST where PREDICTION_NO=#{predictionNo}
   </select>
+
+  <!-- 查询:根据传入时间和车号,查询给定时间段去重车号 -->
+  <select id="distinctCarNo" parameterType="java.lang.String" resultMap="BaseResultMap">
+    SELECT distinct RAILWAY_NO
+    from METER_WORK_RAILWAY_ACT_FIRST
+    where VALUE_FLAG != '0' and RAILWAY_NO like '%${railwayNo}%'
+    <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
+      and  CREATE_TIME  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and CREATE_TIME  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
+    </if>
+  </select>
 </mapper>

+ 4 - 0
src/main/java/com/steerinfo/meterwork/meterworkrailwayactfirst/service/IMeterWorkRailwayActFirstService.java

@@ -43,9 +43,13 @@ public interface IMeterWorkRailwayActFirstService extends IBaseService<MeterWork
 
     MeterWorkRailwayActFirst match(String actualFirstNo, String predictionNo);
 
+    int updateCar(MeterWorkRailwayActFirst model);
+
     @Transactional(rollbackFor = Exception.class)
     PageList<MeterWorkRailwayActFirst> selectTa(Map<String, Object> parmas, Integer pageNum, Integer pageSize);
 
+    List<String> distinctCarNo(String railwayNo, String startTime, String endTime);
+
     List<MeterWorkRailwayActFirst> selectNet(String weightType, String railwayNo, String flag);
 
 

+ 49 - 23
src/main/java/com/steerinfo/meterwork/meterworkrailwayactfirst/service/impl/MeterWorkRailwayActFirstServiceImpl.java

@@ -15,6 +15,7 @@ import com.steerinfo.framework.utils.collection.ListUtils;
 import com.steerinfo.meterwork.constants.DbConstants;
 import com.steerinfo.meterwork.dto.StaffPerformanceAnalysis;
 import com.steerinfo.meterwork.except.MarkerMetException;
+import com.steerinfo.meterwork.meterworkcaractualfirst.model.MeterWorkCarActualFirst;
 import com.steerinfo.meterwork.meterworkimage.mapper.MeterWorkImageMapper;
 import com.steerinfo.meterwork.meterworkimage.model.MeterWorkImage;
 import com.steerinfo.meterwork.meterworkrailwayactfirst.mapper.MeterWorkRailwayActFirstMapper;
@@ -37,6 +38,7 @@ import java.math.BigDecimal;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * MeterWorkRailwayActFirst服务实现:
@@ -77,7 +79,6 @@ public class MeterWorkRailwayActFirstServiceImpl extends BaseServiceImpl<MeterWo
     @Resource
     private MeterBaseRailwayWeightMapper meterBaseRailwayWeightMapper;
 
-
     @Override
     protected IBaseMapper<MeterWorkRailwayActFirst, String> getMapper() {
         return meterWorkRailwayActFirstMapper;
@@ -265,6 +266,49 @@ public class MeterWorkRailwayActFirstServiceImpl extends BaseServiceImpl<MeterWo
         }
     }
 
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public int updateCar(MeterWorkRailwayActFirst model) {
+        try {
+            ckeckcar(model);
+            int num = meterWorkRailwayActFirstMapper.updateByPrimaryKeySelective(model);
+            return num;
+        } catch (MarkerMetException e) {
+            throw e;
+        }
+    }
+
+    private void ckeckcar(MeterWorkRailwayActFirst model) throws MarkerMetException {
+        if (model.getActualFirstNo() == null || "".equals(model.getActualFirstNo())) {
+            throw new MarkerMetException(500, "操作数据主键不能为空");
+        }
+        if (model.getValueFlag() == "2") {
+            throw new MarkerMetException(500, "已经洁净的数据不能进行修改");
+        }
+        if (model.getPredictionNo() != null || "".equals(model.getPredictionNo())) {
+            throw new MarkerMetException(500, "已经匹配委托的数据无法修改车号!!");
+        }
+        if (model.getRailwayNo() == null || model.getRailwayNo().equals("")) {
+            throw new MarkerMetException(500, "火车号不能为空");
+        }
+        UserPayload payload = UserPayload.getCurrUser();
+        String userId = payload.getId();
+        String userName = payload.getUserName();
+        model.setUpdateTime(new Date());
+        model.setUpdateManNo(userId);
+        model.setUpdateManName(userName);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public List<String> distinctCarNo(String railwayNo, String startTime, String endTime) {
+        HashMap<String, Object> obj = new HashMap<>();
+        obj.put("railwayNo", railwayNo);
+        obj.put("startTime", startTime);
+        obj.put("endTime", endTime);
+        List<String> list = meterWorkRailwayActFirstMapper.distinctCarNo(obj).stream().map(MeterWorkRailwayActFirst::getRailwayNo).collect(Collectors.toList());
+        return list;
+    }
 
     @Override
     @Transactional(rollbackFor = Exception.class)
@@ -476,31 +520,11 @@ public class MeterWorkRailwayActFirstServiceImpl extends BaseServiceImpl<MeterWo
             pls.setPredictionNo(model.getPredictionNo());
             pls.setValueFlag(DbConstants.VALID); //待使用
 
-            //================eason add 2021-04-26=========================
-            //判断是静态轨道还是动态,如果是动轨,则看是不是砂石,如果是砂石则预报状态跟次数不发生变化,如果是矿山则预报的次数跟状态都可能发生变化
-            if ("001019002".equals(model.getRailwayTypeNo())) {
-                if ("00025".equals(model.getBaseSpotNo())) {//选矿
-                    Map<String, Object> mp = new HashMap<>();
-                    mp.put("predictionNo", model.getPredictionNo());
-                    //查询一次表中存在有效的相同的预报编号信息有多少条,存在1条,则状态退回到待使用,存在多条则退回到正使用
-                    int cnt = meterWorkRailwayActFirstMapper.getDataCount(mp);
-                    if (cnt <= 1) {
-                        pls.setValueFlag(DbConstants.VALID); //待使用
-                    } else {
-                        pls.setValueFlag(DbConstants.IN); //正使用
-                    }
-                    //如果存在使用次数,那么次数+1
-                    if (StringUtils.isNotEmpty(pls.getRailwayCarriageNo())) {
-                        pls.setRailwayCarriageNo((Integer.parseInt(pls.getRailwayCarriageNo()) + 1) + "");
-                    }
-                } else {
-                    pls.setValueFlag(DbConstants.IN); //正使用
-                }
-            }
-            //=============================================================
+            pls.setValueFlag("4");
 
             preRailwayScaleMapper.updateByPrimaryKeySelective(pls);
             MeterWorkRailwayActFirst mwcaf = meterWorkRailwayActFirstMapper.selectAndRemove(model.getActualFirstNo());
+            mwcaf.setValueFlag("3");
             int num = meterWorkRailwayActFirstMapper.updateByPrimaryKey(mwcaf);
             return num;
         } catch (MarkerMetException e) {
@@ -538,9 +562,11 @@ public class MeterWorkRailwayActFirstServiceImpl extends BaseServiceImpl<MeterWo
                 throw new MarkerMetException(500, "该计量作业已匹配!!");
             }
             MeterWorkRailwayActFirst model = meterWorkRailwayActFirstMapper.selectAndMatch(actualFirstNo, predictionNo);
+            model.setValueFlag("1");
             prs.setUpdateTime(new Date());
             prs.setUpdateManNo("system");
             prs.setUpdateManName("火车一次计量匹配操作");
+//            prs.setNote(); 需要添加修改原因写入
             preRailwayScaleMapper.updateByPrimaryKeySelective(prs);
             meterWorkRailwayActFirstMapper.updateByPrimaryKeySelective(model);
             return model;

+ 60 - 2
src/main/java/com/steerinfo/meterwork/meterworkrailwayactual/controller/MeterWorkRailwayActualController.java

@@ -5,6 +5,7 @@ import com.steerinfo.framework.controller.RESTfulResult;
 import com.steerinfo.framework.service.pagehelper.PageList;
 import com.steerinfo.framework.utils.collection.ListUtils;
 import com.steerinfo.meterwork.except.MarkerMetException;
+import com.steerinfo.meterwork.meterworkcaractual.model.MeterWorkCarActual;
 import com.steerinfo.meterwork.meterworkrailwayactfirst.model.MeterWorkRailwayActFirst;
 import com.steerinfo.meterwork.meterworkrailwayactual.model.MeterWorkRailwayActual;
 import com.steerinfo.meterwork.meterworkrailwayactual.service.IMeterWorkRailwayActualService;
@@ -120,6 +121,25 @@ public class MeterWorkRailwayActualController extends BaseRESTfulController {
         }
     }
 
+    @ApiOperation(value = "火车号汇总统计汇总", notes = "根据传入时间和火车号,查询给定时间段去重车号")
+    @GetMapping(value = "/distinctCarNo")
+    public RESTfulResult distinctCarNo(String carNo, String startTime, String endTime) {
+        RESTfulResult rm = failed();
+        try {
+            List<String> rows = meterWorkRailwayActualService.distinctCarNo(carNo, startTime, endTime);
+            return success(rows);
+        } catch (MarkerMetException e) {
+            e.printStackTrace();
+            rm.setMessage(e.getMessage());
+        } catch (Exception e) {
+            e.printStackTrace();
+            rm.setMessage("操作异常,请确认!");
+        } finally {
+
+        }
+        return rm;
+    }
+
     @ApiOperation(value = "更新详细信息", notes = "根据url的id来指定更新对象,并根据传过来的meterWorkRailwayActual信息来更新详细信息")
     @ApiImplicitParams({
             @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String"),
@@ -138,6 +158,44 @@ public class MeterWorkRailwayActualController extends BaseRESTfulController {
         }
     }
 
+    @ApiOperation(value = "匹配委托")
+    @PostMapping(value = "/matchPrediction")
+    public RESTfulResult matchPrediction(@RequestParam String actualNo, String predictionNo, String note) {
+        RESTfulResult rm = failed();
+        try {
+            MeterWorkRailwayActual mwca = meterWorkRailwayActualService.matchPrediction(actualNo, predictionNo, note);
+            return success(mwca);
+        } catch (MarkerMetException e) {
+            e.printStackTrace();
+            rm.setMessage(e.getMessage());
+        } catch (Exception e) {
+            e.printStackTrace();
+            rm.setMessage("操作异常,请确认!");
+        } finally {
+
+        }
+        return rm;
+    }
+
+    @ApiOperation(value = "解除委托")
+    @PostMapping(value = "/removePrediction")
+    public RESTfulResult removePrediction(@RequestBody MeterWorkRailwayActual model) {
+        RESTfulResult rm = failed();
+        try {
+            MeterWorkRailwayActual mwca = meterWorkRailwayActualService.cleanPrediction(model);
+            return success(mwca);
+        } catch (MarkerMetException e) {
+            e.printStackTrace();
+            rm.setMessage(e.getMessage());
+        } catch (Exception e) {
+            e.printStackTrace();
+            rm.setMessage("操作异常,请确认!");
+        } finally {
+
+        }
+        return rm;
+    }
+
     @ApiOperation(value = "删除", notes = "根据url的id来指定删除对象")
     @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String")
     //@RequiresPermissions("meterworkrailwayactual:delete")
@@ -229,10 +287,10 @@ public class MeterWorkRailwayActualController extends BaseRESTfulController {
 
     @ApiOperation(value = "洁净")
     @PostMapping(value = "/clean")
-    public RESTfulResult clean(@RequestParam String actualFirstNo, String dataNo) {
+    public RESTfulResult clean(@RequestParam String actualFirstNo, String dataNo, String predictionNo) {
         RESTfulResult rm = failed();
         try {
-            MeterWorkRailwayActual mwca = meterWorkRailwayActualService.clean(actualFirstNo, dataNo);
+            MeterWorkRailwayActual mwca = meterWorkRailwayActualService.clean(actualFirstNo, dataNo, predictionNo);
             return success(mwca);
         } catch (MarkerMetException e) {
             e.printStackTrace();

+ 21 - 0
src/main/java/com/steerinfo/meterwork/meterworkrailwayactual/mapper/MeterWorkRailwayActualMapper.java

@@ -1,6 +1,8 @@
 package com.steerinfo.meterwork.meterworkrailwayactual.mapper;
 
 import com.steerinfo.framework.mapper.IBaseMapper;
+import com.steerinfo.meterwork.meterworkcaractual.model.MeterWorkCarActual;
+import com.steerinfo.meterwork.meterworkcaractualfirst.model.MeterWorkCarActualFirst;
 import com.steerinfo.meterwork.meterworkrailwayactual.model.MeterWorkRailwayActual;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
@@ -24,6 +26,25 @@ public interface MeterWorkRailwayActualMapper extends IBaseMapper<MeterWorkRailw
     List<MeterWorkRailwayActual> selectDiff(HashMap parmas);
 
     void insertSelectiveBar(MeterWorkRailwayActual netRail);
+    //一次皮重洁净
+    MeterWorkRailwayActual manualAddPre(@feign.Param( value = "actualFirstNo") String actualFirstNo, @feign.Param( value = "dataNo")String dataNo, @feign.Param( value = "predictionNo")String predictionNo);
+    /**
+     * 洁净数据匹配委托
+     */
+    MeterWorkRailwayActual mathPredcition(@feign.Param(value = "actualNo") String actualNo, @feign.Param(value = "predictionNo") String predictionNo);
+
+    /**
+     *
+     *
+     * */
+    MeterWorkRailwayActual cleanPredcition(@feign.Param(value = "actualNo") String actualNo);
+
+    /**
+     * 根据传入时间和车号,查询给定时间段去重车号
+     * @param obj
+     * @return
+     */
+    List<MeterWorkCarActualFirst> distinctCarNo(HashMap<String, Object> obj);
 
     double getGrossAvg(HashMap actual);
 }

+ 78 - 5
src/main/java/com/steerinfo/meterwork/meterworkrailwayactual/mapper/MeterWorkRailwayActualMapper.xml

@@ -346,6 +346,9 @@
       <if test="sourceArea != null and sourceArea != ''">
         and SOURCE_AREA = #{sourceArea}
       </if>
+      <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
+        and  NET_TIME  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and NET_TIME  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
+      </if>
     </where>
   </sql>
   <sql id="whereLike">
@@ -578,6 +581,9 @@
       <if test="sourceArea != null and sourceArea != ''">
         and SOURCE_AREA LIKE '%${sourceArea}%'
       </if>
+      <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
+        and  NET_TIME  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and NET_TIME  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
+      </if>
     </where>
   </sql>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
@@ -2046,7 +2052,11 @@
   <!-- 友情提示!!!-->
   <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
 
-
+  <sql id="whereTime">
+    <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
+      and  NET_TIME  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and NET_TIME  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
+    </if>
+  </sql>
   <select id="selectView" parameterType="java.util.HashMap" resultMap="BaseResultMap">
     SELECT <include refid="columns"/> from METER_WORK_RAILWAY_ACTUAL_VIEW
     <where>
@@ -2086,8 +2096,8 @@
       <if test="railwayTypeName != null and railwayTypeName != ''">
         and RAILWAY_TYPE_NAME = #{railwayTypeName}
       </if>
-      <if test="netTime1 != null and netTime1 != null and netTime2 != '' and netTime2 != ''">
-        and  NET_TIME  >= TO_DATE(#{netTime1}, 'yyyy-MM-dd HH24:mi:ss') and NET_TIME  &lt;=  TO_DATE(#{netTime2}, 'yyyy-MM-dd HH24:mi:ss')
+      <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
+        and  NET_TIME  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and NET_TIME  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
       </if>
     </where>
     order by NET_TIME desc
@@ -2115,6 +2125,59 @@
     where t1.actual_first_no=#{actualFirstNo,jdbcType=VARCHAR} and t2.actual_first_no=#{dataNo,jdbcType=VARCHAR}
  </select>
 
+  <select id="manualAddPre" parameterType="java.lang.String" resultMap="BaseResultMap">
+    select T3.prediction_no PREDICTION_NO, T3.notice_no NOTICE_NO, T3.railway_no RAILWAY_NO, T3.railway_carriage_no RAILWAY_CARRIAGE_NO, T3.matter_no MATTER_NO,
+           T3.matter_name MATTER_NAME, T3.contract_no CONTRACT_NO, T3.batch_no BATCH_NO, T3.customer_supplier_no CUSTOMER_SUPPLIER_NO,
+           T3.customer_supplier_name CUSTOMER_SUPPLIER_NAME, T3.forwarding_unit_no FORWARDING_UNIT_NO, T3.forwarding_unit_name FORWARDING_UNIT_NAME,
+           T3.receiving_uint_no RECEIVING_UINT_NO, T3.receiving_uint_name RECEIVING_UINT_NAME, T3.material_no MATERIAL_NO,
+           T3.material_name MATERIAL_NAME, T3.spec_no SPEC_NO, T3.spec_name SPEC_NAME, T3.load_point_no LOAD_POINT_NO, T3.load_point_name LOAD_POINT_NAME,
+           T3.sample_no SAMPLE_NO,T3.sample_voucher SAMPLE_VOUCHER,T3.carrier_unit_no CARRIER_UNIT_NO,T3.carrier_unit_name CARRIER_UNIT_NAME,
+           T3.meter_type_no METER_TYPE_NO, T3.meter_type_name METER_TYPE_NAME,T1.meter_process_no METER_PROCESS_NO, T1.meter_process_edition_no METER_PROCESS_EDITION_NO,
+           t1.actual_first_no ACTUAL_FIRST1_NO, t1.meter_weight GROSS_WEIGHT, t1.create_man_no GROSS_MAN_NO, t1.create_man_name GROSS_MAN_NAME, t1.create_time GROSS_TIME,
+           t1.base_spot_no BASE_SPOT1_NO, t1.base_spot_name BASE_SPOT1_NAME,t1.meter_class GROSS_CLASS, t1.meter_group GROSS_GROUP, t1.meter_mode GROSS_MODE,t1.railway_type_no RAILWAY_TYPE_NO,t1.railway_type_name RAILWAY_TYPE_NAME,
+           t2.actual_first_no ACTUAL_FIRST2_NO, t2.meter_weight TARE_WEIGHT, t2.create_man_no TARE_MAN_NO, t2.create_man_name TARE_MAN_NAME, t2.create_time TARE_TIME,
+           t2.base_spot_no BASE_SPOT2_NO, t2.base_spot_name BASE_SPOT2_NAME, t2.meter_class TARE_CLASS, t2.meter_group TARE_GROUP,t2.meter_mode TARE_MODE
+            ,t2.arrival ARRIVAL, t2.station STATION,t2.memo MEMO,t2.source_area SOURCE_AREA
+    from METER_WORK_RAILWAY_ACT_FIRST t1,METER_WORK_RAILWAY_ACT_FIRST t2, PRE_RAILWAY_SCALE T3
+    where t1.actual_first_no=#{actualFirstNo,jdbcType=VARCHAR} and t2.actual_first_no=#{dataNo,jdbcType=VARCHAR} AND T3.prediction_no =#{predictionNo,jdbcType=VARCHAR}
+  </select>
+
+  <select id="mathPredcition" parameterType="java.lang.String" resultMap="BaseResultMap">
+    select t.actual_no, t1.prediction_no, t1.notice_no, t1.railway_no,
+           t1.trailer_no, t1.matter_no, t1.matter_name, t1.contract_no,
+           t1.batch_no, t1.customer_supplier_no, t1.customer_supplier_name,
+           t1.forwarding_unit_no, t1.forwarding_unit_name, t1.receiving_uint_no,
+           t1.receiving_uint_name, t1.material_no, t1.material_name,
+           t1.spec_no, t1.spec_name, t1.load_point_no, t1.load_point_name,
+           t1.sample_no, t1.sample_voucher, t1.carrier_unit_no, t1.carrier_unit_name,
+           t1.meter_type_no, t1.meter_type_name, t.meter_process_no, t.meter_process_edition_no,
+           t.actual_first1_no, t.gross_weight, t.gross_man_no, t.gross_man_name, t.gross_time,
+           t.base_spot1_no, t.base_spot1_name, t.gross_class, t.gross_group, t.gross_mode,
+           t.actual_first2_no,  t.tare_weight, t.tare_man_no, t.tare_man_name, t.tare_time,
+           t.base_spot2_no, t.base_spot2_name, t.tare_class, t.tare_group, t.tare_mode,
+           t.net_weight, t.meter_num, t.net_man_no, t.net_man_name, t.net_time, t.net_spot3_no,
+           t.net_spot3_name, t.net_group, t.net_mode, t.value_flag, t.upload_flag, t.check_man_no,
+           t.check_man_name, t.check_time, t.upload_man_no, t.upload_man_name, t.upload_time, t.add_weight,
+           t.net_class, t.tb_flage, t1.railway_no, t.update_man_no, t.update_man_name, t.update_time,
+           t.memo, t1.heat_no, t1.shipment_gross_weight, t1.shipment_net_weight, t1.shipment_num,
+           t1.bind_card_no, t1.prediction_type, t1.prediction_combination, t.meter_pier_name,
+           t.meter_pier_no
+    from meter_work_railway_actual t, pre_railway_scale t1 where t.actual_no = #{actualNo,jdbcType=VARCHAR} and t1.prediction_no = #{predictionNo,jdbcType=VARCHAR}
+  </select>
+
+  <select id="cleanPredcition" parameterType="java.lang.String" resultMap="BaseResultMap">
+    select t.actual_no, t.actual_first1_no,t.railway_no, t.gross_weight, t.gross_man_no, t.gross_man_name, t.gross_time,
+           t.base_spot1_no, t.base_spot1_name, t.gross_class, t.gross_group, t.gross_mode,
+           t.actual_first2_no,  t.tare_weight, t.tare_man_no, t.tare_man_name, t.tare_time,
+           t.base_spot2_no, t.base_spot2_name, t.tare_class, t.tare_group, t.tare_mode,
+           t.net_weight, t.meter_num, t.net_man_no, t.net_man_name, t.net_time, t.net_spot3_no,
+           t.net_spot3_name, t.net_group, t.net_mode, t.value_flag, t.upload_flag, t.check_man_no,
+           t.check_man_name, t.check_time, t.upload_man_no, t.upload_man_name, t.upload_time, t.add_weight,
+           t.net_class, t.tb_flage, t.update_man_no, t.update_man_name, t.update_time,
+           t.memo, t.meter_pier_name, t.meter_pier_no
+    from meter_work_railway_actual t where t.actual_no = #{actualNo,jdbcType=VARCHAR}
+  </select>
+
   <select id="tareAdd" parameterType="java.lang.String" resultMap="BaseResultMap">
    select t1.prediction_no PREDICTION_NO, t1.notice_no NOTICE_NO, t1.railway_no RAILWAY_NO, t1.railway_carriage_no RAILWAY_CARRIAGE_NO, t1.matter_no MATTER_NO,
        t1.matter_name MATTER_NAME, t1.contract_no CONTRACT_NO, t1.batch_no BATCH_NO, t1.customer_supplier_no CUSTOMER_SUPPLIER_NO,
@@ -2335,8 +2398,8 @@
       <if test="grossMode != null and grossMode != ''">
         and GROSS_MODE = #{grossMode}
       </if>
-      <if test="createTime1 != null and createTime2 != null and createTime1 != '' and createTime2 != '' ">
-        and  NET_TIME  >= TO_DATE(#{createTime1}, 'yyyy-MM-dd HH24:mi:ss') and NET_TIME  &lt;=  TO_DATE(#{createTime2}, 'yyyy-MM-dd HH24:mi:ss')
+      <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
+        and  NET_TIME  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and NET_TIME  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
       </if>
     </where>
     order by NET_TIME desc
@@ -2814,4 +2877,14 @@ select nvl(round(avg(gross_weight / 1000), 2),0)
        to_date(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
    and net_spot3_no = #{netSpot3No}
   </select>
+
+  <!-- 查询:根据传入时间和车号,查询给定时间段去重车号 -->
+  <select id="distinctCarNo" parameterType="java.lang.String" resultMap="BaseResultMap">
+    SELECT distinct RAILWAY_NO
+    from METER_WORK_RAILWAY_ACTUAL
+    where VALUE_FLAG != '0' and RAILWAY_NO like '%${railwayNo}%'
+    <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
+      and  NET_TIME  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and NET_TIME  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
+    </if>
+  </select>
 </mapper>

+ 8 - 1
src/main/java/com/steerinfo/meterwork/meterworkrailwayactual/service/IMeterWorkRailwayActualService.java

@@ -3,6 +3,7 @@ package com.steerinfo.meterwork.meterworkrailwayactual.service;
 import com.steerinfo.framework.controller.RESTfulResult;
 import com.steerinfo.framework.service.IBaseService;
 import com.steerinfo.framework.service.pagehelper.PageList;
+import com.steerinfo.meterwork.meterworkcaractual.model.MeterWorkCarActual;
 import com.steerinfo.meterwork.meterworkrailwayactfirst.model.MeterWorkRailwayActFirst;
 import com.steerinfo.meterwork.meterworkrailwayactual.model.MeterWorkRailwayActual;
 import com.steerinfo.pretrack.prerailwayscale.model.PreRailwayScale;
@@ -30,12 +31,18 @@ public interface IMeterWorkRailwayActualService extends IBaseService<MeterWorkRa
 
     int unaudit(List<MeterWorkRailwayActual> model);
 
-    MeterWorkRailwayActual clean(String actualFirstNo, String dataNo);
+    MeterWorkRailwayActual clean(String actualFirstNo, String dataNo, String predictionNo);
+
+    MeterWorkRailwayActual matchPrediction(String actualNo, String predictionNo, String note);
+
+    MeterWorkRailwayActual cleanPrediction(MeterWorkRailwayActual model);
 
     int remove(List<MeterWorkRailwayActual> models);
 
     MeterWorkRailwayActual termclean(String actualFirstNo, String dataNo);
 
+    List<String> distinctCarNo(String carNo, String startTime, String endTime);
+
     PageList<MeterWorkRailwayActual> selectView(HashMap parmas, Integer pageNum, Integer pageSize);
 
     PageList<MeterWorkRailwayActual> selectDiff(HashMap parmas, Integer pageNum, Integer pageSize);

+ 249 - 16
src/main/java/com/steerinfo/meterwork/meterworkrailwayactual/service/impl/MeterWorkRailwayActualServiceImpl.java

@@ -10,6 +10,8 @@ import com.steerinfo.framework.service.pagehelper.PageList;
 import com.steerinfo.framework.user.UserPayload;
 import com.steerinfo.meterwork.constants.DbConstants;
 import com.steerinfo.meterwork.except.MarkerMetException;
+import com.steerinfo.meterwork.meterworkcaractual.model.MeterWorkCarActual;
+import com.steerinfo.meterwork.meterworkcaractualfirst.model.MeterWorkCarActualFirst;
 import com.steerinfo.meterwork.meterworkrailwayactfirst.mapper.MeterWorkRailwayActFirstMapper;
 import com.steerinfo.meterwork.meterworkrailwayactfirst.model.MeterWorkRailwayActFirst;
 import com.steerinfo.meterwork.meterworkrailwayactfirst.service.IMeterWorkRailwayActFirstService;
@@ -19,9 +21,12 @@ import com.steerinfo.meterwork.meterworkrailwayactual.service.IMeterWorkRailwayA
 import com.steerinfo.pretrack.prerailwayscale.mapper.PreRailwayScaleMapper;
 import com.steerinfo.pretrack.prerailwayscale.model.PreRailwayScale;
 import com.steerinfo.pretrack.prerailwayscale.service.IPreRailwayScaleService;
+import com.steerinfo.pretrack.pretrackscale.model.PreTrackScale;
 import com.steerinfo.util.CommonPage;
 import com.steerinfo.util.FieldsCollector;
 import com.steerinfo.util.StringUtils;
+import io.micrometer.core.instrument.Meter;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -31,6 +36,7 @@ import javax.annotation.Resource;
 import java.math.BigDecimal;
 import java.text.SimpleDateFormat;
 import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * MeterWorkRailwayActual服务实现:
@@ -112,7 +118,7 @@ public class MeterWorkRailwayActualServiceImpl extends BaseServiceImpl<MeterWork
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public MeterWorkRailwayActual clean(String actualFirstNo, String dataNo) throws MarkerMetException {
+    public MeterWorkRailwayActual clean(String actualFirstNo, String dataNo, String predictionNo) throws MarkerMetException {
         try {
             if (actualFirstNo == null && actualFirstNo.equals("")) {
                 throw new MarkerMetException(500, "毛重数据编号为空");
@@ -132,44 +138,206 @@ public class MeterWorkRailwayActualServiceImpl extends BaseServiceImpl<MeterWork
             if (mwcaf2.getMeterWeight().compareTo(mwcaf1.getMeterWeight()) == 1) {
                 throw new MarkerMetException(500, "皮重重量大于毛重重量!!");
             }
+
+            // 选中的是否为同一车的数据
+            if (!mwcaf1.getRailwayNo().equals(mwcaf2.getRailwayNo())) {
+                throw new MarkerMetException(500, "请选择同一车号的一次计量数据进行结净");
+            }
+            // 一次计量数据是否已经完成委托匹配
+            if ((mwcaf1.getPredictionNo() != null && "".equals(mwcaf1.getPredictionNo())) || (mwcaf2.getPredictionNo() != null && "".equals(mwcaf2.getPredictionNo()))) {
+                if (!mwcaf1.getPredictionNo().equals(mwcaf2.getPredictionNo())) {
+                    throw new MarkerMetException(500, "选中的两条一次计量数据匹配的委托不一致,不允许进行洁净操作!!!");
+                } else if (predictionNo != null && !"".equals(predictionNo)) {
+                    throw new MarkerMetException(500, "选中的两条一次计量数据已经匹配委托,请正确选择数据!!!");
+                }
+            }
+
+            String preNo = (predictionNo == null ? mwcaf1.getPredictionNo() : predictionNo);
+
+            //修改预报
+            if (preNo != null && !"".equals(preNo)) {
+                // 选中预报和选中一次计量数据中车号是否一致
+                PreRailwayScale queryRow = preRailwayScaleMapper.selectByPrimaryKey(preNo);
+                if (!mwcaf1.getRailwayNo().equals(queryRow.getRailwayNo())) {
+                    throw new MarkerMetException(500, "选中预报中火车号与一次计量数据中火车号不一致!!!");
+                }
+                PreRailwayScale scale = new PreRailwayScale();
+                scale.setPredictionNo(preNo);
+                scale.setValueFlag(DbConstants.NET);
+                scale.setUpdateTime(new Date());
+                scale.setUpdateManNo("system");
+                scale.setUpdateManName("二次计量洁净更新");
+                preRailwayScaleMapper.updateByPrimaryKeySelective(scale);
+            }
+
+            MeterWorkRailwayActual actualRow = new MeterWorkRailwayActual();
+
+            // 判断前端是否传入了预报编号
+            if (predictionNo != null && !"".equals(predictionNo)) {
+                // 根据一次计量数据和预报数据生成净重相关信息
+                MeterWorkRailwayActFirst first1 = meterWorkRailwayActFirstMapper.selectAndMatch(actualFirstNo, predictionNo);
+                BeanUtils.copyProperties(first1,mwcaf1);
+                MeterWorkRailwayActFirst first2 = meterWorkRailwayActFirstMapper.selectAndMatch(dataNo, predictionNo);
+                BeanUtils.copyProperties(first2, mwcaf2);
+                MeterWorkRailwayActual mwca1 = meterWorkRailwayActualMapper.manualAddPre(actualFirstNo, dataNo, predictionNo);
+                BeanUtils.copyProperties(mwca1, actualRow);
+            } else {
+                MeterWorkRailwayActual mwca2 = meterWorkRailwayActualMapper.manualAdd(actualFirstNo, dataNo);
+                BeanUtils.copyProperties(mwca2, actualRow);
+            }
+
             mwcaf1.setValueFlag(DbConstants.NET);
             meterWorkRailwayActFirstMapper.updateByPrimaryKey(mwcaf1);
             mwcaf2.setValueFlag(DbConstants.NET);
             meterWorkRailwayActFirstMapper.updateByPrimaryKey(mwcaf2);
-            MeterWorkRailwayActual mwca = meterWorkRailwayActualMapper.manualAdd(actualFirstNo, dataNo);
-            check(mwca);
 
-            if (mwca.getGrossTime().compareTo(mwca.getTareTime()) == 1) {
-                mwca.setNetSpot3No(mwca.getBaseSpot1No());
-                mwca.setNetSpot3Name(mwca.getBaseSpot1Name());
+            cleanCheck(actualRow);
+
+            if (actualRow.getGrossTime().compareTo(actualRow.getTareTime()) == 1) {
+                actualRow.setNetSpot3No(actualRow.getBaseSpot1No());
+                actualRow.setNetSpot3Name(actualRow.getBaseSpot1Name());
             } else {
-                mwca.setNetSpot3No(mwca.getBaseSpot2No());
-                mwca.setNetSpot3Name(mwca.getBaseSpot2Name());
+                actualRow.setNetSpot3No(actualRow.getBaseSpot2No());
+                actualRow.setNetSpot3Name(actualRow.getBaseSpot2Name());
             }
-            mwca.setNetMode(DbConstants.TYPE);
+            actualRow.setNetMode(DbConstants.TYPE);
             SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
             String no = meterWorkRailwayActualMapper.getNewID(sdf.format(new Date()));
-            mwca.setActualNo(sdf.format(new Date()) + no);
-            mwca.setNetWeight(mwcaf1.getMeterWeight().subtract(mwcaf2.getMeterWeight()));
-            mwca.setValueFlag("0"); //2021年6月24日 默认有效
-            meterWorkRailwayActualMapper.insertSelective(mwca);
+            actualRow.setActualNo(sdf.format(new Date()) + no);
+            actualRow.setNetWeight(mwcaf1.getMeterWeight().subtract(mwcaf2.getMeterWeight()));
+            meterWorkRailwayActualMapper.insertSelective(actualRow);
 
             //预报的处理
-            if (StringUtils.isNotEmpty(mwca.getPredictionNo())) {
+            if (StringUtils.isNotEmpty(actualRow.getPredictionNo())) {
                 PreRailwayScale prs = new PreRailwayScale();
-                prs.setPredictionNo(mwca.getPredictionNo());
+                prs.setPredictionNo(actualRow.getPredictionNo());
                 prs.setValueFlag(DbConstants.NET); //已结净
                 prs.setUpdateTime(new Date());
                 prs.setUpdateManNo("system");
                 prs.setUpdateManName("火车二次计量洁净操作");
                 preRailwayScaleMapper.updateByPrimaryKeySelective(prs);
             }
-            return mwca;
+            return actualRow;
         } catch (MarkerMetException e) {
             throw e;
         }
     }
 
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public MeterWorkRailwayActual matchPrediction (String actualNo, String predictionNo, String note) throws MarkerMetException {
+        if (actualNo == null || "".equals(actualNo)) {
+            throw new MarkerMetException(500, "洁净数据主键不能为空");
+        }
+        if (predictionNo == null || "".equals(predictionNo)) {
+            throw new MarkerMetException(500, "预报编号不能为空");
+        }
+        MeterWorkRailwayActual queryrow = meterWorkRailwayActualMapper.selectByPrimaryKey(actualNo);
+        if (queryrow == null) {
+            throw new MarkerMetException(500, "不存在对应的洁净数据");
+        } else if (!queryrow.getValueFlag().equals("3") || queryrow.getPredictionNo() != null) {
+            throw new MarkerMetException(500, "只有未匹配的净重数据才能进行委托匹配操作");
+        }
+        PreRailwayScale prerow = preRailwayScaleMapper.selectByPrimaryKey(predictionNo);
+        if (prerow == null) {
+            throw new MarkerMetException(500, "不存在对应的预报数据");
+        } else if (!prerow.getValueFlag().equals("1")) {
+            throw new MarkerMetException(500, "只有未使用的委托才能进行匹配委托操作");
+        }
+        if (!queryrow.getRailwayNo().equals(prerow.getRailwayNo())) {
+            throw new MarkerMetException(500, "洁净数据中车号和预报中车号不一致,不允许进行匹配委托操作");
+        }
+        UserPayload payload = UserPayload.getCurrUser();
+        String userId = payload.getId();
+        String userName = payload.getUserName();
+
+        // 处理一次计量数据
+        // 毛重
+        MeterWorkRailwayActFirst grossrow = meterWorkRailwayActFirstMapper.selectAndMatch(queryrow.getActualFirst1No(), predictionNo);
+        grossrow.setUpdateTime(new Date());
+        grossrow.setUpdateManName(userName + ": 洁净数据匹配委托操作");
+        grossrow.setUpdateManNo(userId);
+        meterWorkRailwayActFirstMapper.updateByPrimaryKey(grossrow);
+
+        // 皮重
+        MeterWorkRailwayActFirst tarerow = meterWorkRailwayActFirstMapper.selectAndMatch(queryrow.getActualFirst2No(), predictionNo);
+        tarerow.setUpdateTime(new Date());
+        tarerow.setUpdateManName(userName + ": 洁净数据匹配委托操作");
+        tarerow.setUpdateManNo(userId);
+        meterWorkRailwayActFirstMapper.updateByPrimaryKey(tarerow);
+
+        // 处理预报
+        if (StringUtils.isNotEmpty(predictionNo)) {
+            PreRailwayScale scale = new PreRailwayScale();
+            scale.setPredictionNo(predictionNo);
+            scale.setValueFlag("2");
+            scale.setUpdateTime(new Date());
+            scale.setUpdateManNo("system");
+            scale.setUpdateManName("计量洁净数据匹配委托操作");
+            preRailwayScaleMapper.updateByPrimaryKeySelective(scale);
+        }
+
+        MeterWorkRailwayActual mwca = meterWorkRailwayActualMapper.mathPredcition(actualNo, predictionNo);
+        mwca.setValueFlag("1");
+//        mwca.setNote(note); 添加修改原因记录
+        meterWorkRailwayActualMapper.updateByPrimaryKey(mwca);
+        return mwca;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public MeterWorkRailwayActual cleanPrediction (MeterWorkRailwayActual 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, "只有有效已匹配的洁净数据才能进行解除操作");
+        }
+        MeterWorkRailwayActual mwcaquery = meterWorkRailwayActualMapper.selectByPrimaryKey(model.getActualNo());
+        if (mwcaquery == null) {
+            throw new MarkerMetException(500, "不存在对应的洁净数据");
+        }
+        UserPayload payload = UserPayload.getCurrUser();
+        String userId = payload.getId();
+        String userName = payload.getUserName();
+
+        // 处理一次计量数据
+        // 毛重
+        MeterWorkRailwayActFirst grossrow = meterWorkRailwayActFirstMapper.selectAndRemove(model.getActualFirst1No());
+//        grossrow.setValueFlag("3");
+        grossrow.setUpdateTime(new Date());
+        grossrow.setUpdateManName(userName + ": 洁净数据解除委托操作");
+        grossrow.setUpdateManNo(userId);
+        meterWorkRailwayActFirstMapper.updateByPrimaryKey(grossrow);
+
+        // 皮重
+        MeterWorkRailwayActFirst tarerow = meterWorkRailwayActFirstMapper.selectAndRemove(model.getActualFirst2No());
+//        tarerow.setValueFlag("3");
+        tarerow.setUpdateTime(new Date());
+        tarerow.setUpdateManName(userName + ": 洁净数据解除委托操作");
+        tarerow.setUpdateManNo(userId);
+        meterWorkRailwayActFirstMapper.updateByPrimaryKey(tarerow);
+
+        // 处理预报
+        if (StringUtils.isNotEmpty(model.getPredictionNo())) {
+            PreRailwayScale scale = new PreRailwayScale();
+            scale.setPredictionNo(model.getPredictionNo());
+            scale.setValueFlag("1");
+            scale.setUpdateTime(new Date());
+            scale.setUpdateManNo("system");
+            scale.setUpdateManName("计量洁净数据解除委托操作");
+            preRailwayScaleMapper.updateByPrimaryKeySelective(scale);
+        }
+        MeterWorkRailwayActual mwca = meterWorkRailwayActualMapper.cleanPredcition(model.getActualNo());
+
+        mwca.setUpdateManNo(userId);
+        mwca.setUpdateManName(userName);
+        mwca.setUpdateTime(new Date());
+        mwca.setValueFlag("3");
+        meterWorkRailwayActualMapper.updateByPrimaryKey(mwca);
+        return mwca;
+    }
+
     @Override
     @Transactional(rollbackFor = Exception.class)
     public int remove(List<MeterWorkRailwayActual> models) throws MarkerMetException {
@@ -221,6 +389,17 @@ public class MeterWorkRailwayActualServiceImpl extends BaseServiceImpl<MeterWork
         }
     }
 
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public List<String> distinctCarNo(String railwayNo, String startTime, String endTime) {
+        HashMap<String, Object> obj = new HashMap<>();
+        obj.put("railwayNo", railwayNo);
+        obj.put("startTime", startTime);
+        obj.put("endTime", endTime);
+        List<String> list = meterWorkRailwayActFirstMapper.distinctCarNo(obj).stream().map(MeterWorkRailwayActFirst::getRailwayNo).collect(Collectors.toList());
+        return list;
+    }
+
     @Override
     @Transactional(rollbackFor = Exception.class)
     public int removeDt(List<MeterWorkRailwayActual> models) throws MarkerMetException {
@@ -371,6 +550,7 @@ public class MeterWorkRailwayActualServiceImpl extends BaseServiceImpl<MeterWork
             if (mbrw.getRailwayWeight().compareTo(mwraf1.getMeterWeight()) == 1) {
                 throw new MarkerMetException(500, "皮重重量大于毛重重量!!");
             }
+
             mwraf1.setValueFlag(DbConstants.NET);
             meterWorkRailwayActFirstMapper.updateByPrimaryKey(mwraf1);
             MeterWorkRailwayActual mwca = meterWorkRailwayActualMapper.tareAdd(actualFirstNo, dataNo);
@@ -445,6 +625,59 @@ public class MeterWorkRailwayActualServiceImpl extends BaseServiceImpl<MeterWork
         }
     }
 
+    private void cleanCheck(MeterWorkRailwayActual model) throws MarkerMetException {
+            if (model.getRailwayNo() == null || model.getRailwayNo().equals("")) {
+                throw new MarkerMetException(500, "火车车号不能为空");
+            }
+//        if (model.getMatterNo() == null || model.getMatterNo().equals("")) {
+//            throw new MarkerMetException(500, "物料编号不能为空");
+//        }
+//        if (model.getMatterName() == null || model.getMatterName().equals("")) {
+//            throw new MarkerMetException(500, "物料名称能为空");
+//        }
+//        if (model.getMeterTypeNo() == null || model.getMeterTypeNo().equals("")) {
+//            throw new MarkerMetException(500, "计量类型编号不能为空");
+//        }
+//        if (model.getMeterTypeName() == null || model.getMeterTypeName().equals("")) {
+//            throw new MarkerMetException(500, "计量类型名称不能为空");
+//        }
+        if (model.getActualFirst1No() == null || model.getActualFirst1No().equals("")) {
+            throw new MarkerMetException(500, "毛重计量作业编号不能为空");
+        }
+        if (model.getGrossTime() == null || model.getGrossTime().equals("")) {
+            throw new MarkerMetException(500, "毛重计量时间不能为空");
+        }
+        if (model.getBaseSpot1No() == null || model.getBaseSpot1No().equals("")) {
+            throw new MarkerMetException(500, "毛重计量点编号不能为空");
+        }
+        if (model.getBaseSpot1Name() == null || model.getBaseSpot1Name().equals("")) {
+            throw new MarkerMetException(500, "毛重计量点名称不能为空");
+        }
+        if (model.getActualFirst2No() == null || model.getActualFirst2No().equals("")) {
+            throw new MarkerMetException(500, "皮重计量作业编号不能为空");
+        }
+        if (model.getTareTime() == null || model.getTareTime().equals("")) {
+            throw new MarkerMetException(500, "皮重计量时间不能为空");
+        }
+        if (model.getActualNo() == null && model.getValueFlag() == null && (model.getPredictionNo() == null || "".equals(model.getPredictionNo()))) {
+            model.setValueFlag("3"); // 未匹配
+        } else if (model.getActualNo() == null && model.getValueFlag() == null && (model.getPredictionNo() != null && !"".equals(model.getPredictionNo()))) {
+            model.setValueFlag("1"); // 已匹配
+        }
+
+        if (model.getActualNo() == null && model.getUploadFlag() == null)
+            model.setUploadFlag(DbConstants.INVALID);
+        UserPayload payload = UserPayload.getCurrUser();
+        String userId = payload.getId();
+        String userName = payload.getUserName();
+        if (model.getActualNo() == null) {
+            model.setNetTime(new Date());
+            model.setNetManNo(userId);
+            model.setNetManName(userName);
+//            model.setNote();
+        }
+    }
+
     @Override
     public RESTfulResult doQueryWf(CommonPage<MeterWorkRailwayActual> oci) {
         RESTfulResult rm = new RESTfulResult();