Browse Source

静轨结净车次修改

dengyj 4 năm trước cách đây
mục cha
commit
c42feff447

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

@@ -491,12 +491,12 @@ public class MeterWorkCarActualServiceImpl extends BaseServiceImpl<MeterWorkCarA
                     PreTrackScale scaleTemp = preTrackScaleMapper.selectByPrimaryKey(modelTemp.getPredictionNo());
                     if(scaleTemp.getValueFlag().equals("9")) {
                         throw new MarkerMetException(500, "洁净数据中包含已结算的委托!!!");
+
                     }
-                    if(modelTemp.getPredictionType().equals("5") || modelTemp.getPredictionType().equals("6") || modelTemp.getPredictionType().equals("7")){
+                    if(scaleTemp.getPredictionType().equals("5") || scaleTemp.getPredictionType().equals("6") || scaleTemp.getPredictionType().equals("7")){
                         throw new MarkerMetException(500, "洁净数据中包含特殊委托匹配结净的数据!!!");
                     }
                 }
-
             }
 
             for (MeterWorkCarActual model : models) {
@@ -798,7 +798,7 @@ public class MeterWorkCarActualServiceImpl extends BaseServiceImpl<MeterWorkCarA
                         rm.setMessage("洁净数据中包含已结算的委托!!!");
                         return rm;
                     }
-                    if(modelTemp.getPredictionType().equals("5") || modelTemp.getPredictionType().equals("6") || modelTemp.getPredictionType().equals("7")){
+                    if(scaleTemp.getPredictionType().equals("5") || scaleTemp.getPredictionType().equals("6") || scaleTemp.getPredictionType().equals("7")){
                         rm.setMessage("洁净数据中包含特殊委托匹配结净的数据!!!");
                         return rm;
                     }
@@ -1081,12 +1081,15 @@ public class MeterWorkCarActualServiceImpl extends BaseServiceImpl<MeterWorkCarA
         }
 
         PreTrackScale scaleTemp = preTrackScaleMapper.selectByPrimaryKey(model.getPredictionNo());
-        if(scaleTemp.getValueFlag().equals("9")) {
-            throw new MarkerMetException(500, "结净数据包含已结算的委托!!!");
-        }
-        if(model.getPredictionType().equals("5") || model.getPredictionType().equals("6") || model.getPredictionType().equals("7")){
-            throw new MarkerMetException(500, "洁净数据中包含特殊委托匹配结净的数据!!!");
+        if(scaleTemp.getPredictionNo() != null && StringUtils.isNotEmpty(scaleTemp.getPredictionNo())) {
+            if(scaleTemp.getValueFlag().equals("9")) {
+                throw new MarkerMetException(500, "结净数据包含已结算的委托!!!");
+            }
+            if(scaleTemp.getPredictionType().equals("5") || scaleTemp.getPredictionType().equals("6") || scaleTemp.getPredictionType().equals("7")){
+                throw new MarkerMetException(500, "洁净数据中包含特殊委托匹配结净的数据!!!");
+            }
         }
+
         UserPayload payload = UserPayload.getCurrUser();
         String userId = payload.getId();
         String userName = payload.getUserName();

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

@@ -5421,7 +5421,7 @@ public class MeterWorkRailwayActFirstServiceImpl extends BaseServiceImpl<MeterWo
             String lcNo = sdf.format(new Date());
             int count = 0;
             for (MeterWorkRailwayActFirst model : models) {
-                model.setLcNo(lcNo);
+                model.setLcNo(model.getBaseSpotNo() + "-" + lcNo);
                 meterWorkRailwayActFirstMapper.updateByPrimaryKeySelective(model);
                 count++;
             }
@@ -5679,7 +5679,7 @@ public class MeterWorkRailwayActFirstServiceImpl extends BaseServiceImpl<MeterWo
                 //修改毛重一次数据状态
                 grossModel.setValueFlag(DbConstants.NET);
                 grossModel.setUpdateManName("system");
-                grossModel.setUpdateManName("标皮洁净更新");
+                grossModel.setUpdateManName("标皮洁净更新");
                 grossModel.setUpdateTime(new Date());
                 grossModel.setWeightType("0");
                 grossModel.setIsPreSacale("0");

+ 31 - 23
src/main/java/com/steerinfo/meterwork/meterworkrailwayactual/controller/MeterWorkRailwayActualController.java

@@ -184,21 +184,24 @@ public class MeterWorkRailwayActualController extends BaseRESTfulController {
         }
     }
 
+    @ApiOperation(value = "降序获取列表", notes = "web端不分页模糊查询")
+    @PostMapping(value = "/webByLikeDesc")
+    public RESTfulResult webByLikeDesc(@RequestBody HashMap parmas) {
+        try {
+            List<MeterWorkRailwayActual> list = meterWorkRailwayActualService.webByLikeDesc(parmas);
+            return success(list);
+        } catch (Exception ex) {
+            ex.printStackTrace();
+            throw new MarkerMetException(500, "操作异常!!");
+        }
+    }
+
     @ApiOperation(value = "火车号汇总统计汇总", notes = "根据传入时间和火车号,查询给定时间段去重车号")
     @GetMapping(value = "/distinctRailwayNo")
     public RESTfulResult distinctRailwayNo(@RequestParam HashMap param) {
         RESTfulResult rm = failed();
         try {
-            String railwayTypeNo = param.get("railwayTypeNo") == null ? "":param.get("railwayTypeNo").toString();
-            String lcNo = param.get("lcNo") == null ? "" : param.get("lcNo").toString();
-            String railwayNo = param.get("railwayNo") == null ? "":param.get("railwayNo").toString();
-            String startTime = param.get("startTime") == null ? "":param.get("startTime").toString();
-            String endTime = param.get("endTime") == null ? "":param.get("endTime").toString();;
-            String baseSpotName = param.get("baseSpotName") == null ? "": param.get("baseSpotName").toString();
-            String matterName = param.get("matterName") == null ? "": param.get("matterName").toString();
-            String predictionNo = param.get("predictionNo") == null ? "": param.get("predictionNo").toString();
-            String valueFlag = param.get("valueFlag") == null ? "":param.get("valueFlag").toString();
-            List<String> rows = meterWorkRailwayActualService.distinctRailwayNo(railwayTypeNo, lcNo, railwayNo, startTime, endTime, baseSpotName,matterName,predictionNo,valueFlag);
+            List<String> rows = meterWorkRailwayActualService.distinctRailwayNo(param);
             return success(rows);
         } catch (MarkerMetException e) {
             e.printStackTrace();
@@ -217,10 +220,7 @@ public class MeterWorkRailwayActualController extends BaseRESTfulController {
     public RESTfulResult distinctLcNo(@RequestBody HashMap param) {
         RESTfulResult rm = failed();
         try {
-            String railwayTypeNo = param.get("railwayTypeNo") == null ? "":param.get("railwayTypeNo").toString();
-            String startTime = param.get("startTime") == null ? "":param.get("startTime").toString();
-            String endTime = param.get("endTime") == null ? "":param.get("endTime").toString();
-            List<String> rows = meterWorkRailwayActualService.distinctLcNo(railwayTypeNo, startTime, endTime);
+            List<String> rows = meterWorkRailwayActualService.distinctLcNo(param);
             return success(rows);
         } catch (MarkerMetException e) {
             e.printStackTrace();
@@ -240,15 +240,7 @@ public class MeterWorkRailwayActualController extends BaseRESTfulController {
     public RESTfulResult distinctLcNoAndRailwayNo(@RequestBody HashMap param) {
         RESTfulResult rm = failed();
         try {
-            String railwayTypeNo = param.get("railwayTypeNo") == null ? "":param.get("railwayTypeNo").toString();
-            String startTime = param.get("startTime") == null ? "":param.get("startTime").toString();
-            String endTime = param.get("endTime") == null ? "":param.get("endTime").toString();
-            String railwayNo = param.get("railwayNo") == null ? "":param.get("railwayNo").toString();
-            String baseSpotName = param.get("baseSpotName") == null ? "": param.get("baseSpotName").toString();
-            String matterName = param.get("matterName") == null ? "": param.get("matterName").toString();
-            String predictionNo = param.get("predictionNo") == null ? "": param.get("predictionNo").toString();
-            String valueFlag = param.get("valueFlag") == null ? "":param.get("valueFlag").toString();
-            rm = meterWorkRailwayActualService.distinctLcNoAndRailwayNo(railwayTypeNo, startTime, endTime, railwayNo, baseSpotName, matterName,predictionNo, valueFlag);
+            rm = meterWorkRailwayActualService.distinctLcNoAndRailwayNo(param);
             return rm;
         }catch (Exception e) {
             e.printStackTrace();
@@ -520,6 +512,22 @@ public class MeterWorkRailwayActualController extends BaseRESTfulController {
         return rm;
     }
 
+    @ApiOperation(value = "普通委托解除洁净", notes = "将洁净后的数据进行还原")
+    @PostMapping(value = "/commonRemove")
+    public RESTfulResult commonRemove(@RequestBody HashMap params) {
+        RESTfulResult rm = failed();
+        try {
+            rm = meterWorkRailwayActualService.commonRemove(params);
+        } catch (MarkerMetException e) {
+            e.printStackTrace();
+            rm.setMessage(e.getMessage());
+        } catch (Exception e) {
+            e.printStackTrace();
+            rm.setMessage("操作异常,请确认!");
+        }
+        return rm;
+    }
+
     @ApiOperation(value = "解除动态衡洁净数据", notes = "将洁净后的数据进行还原")
     @PostMapping(value = "/removeDynamicModel")
     public RESTfulResult removeDynamicModel(@RequestBody MeterWorkRailwayActual model) {

+ 287 - 229
src/main/java/com/steerinfo/meterwork/meterworkrailwayactual/mapper/MeterWorkRailwayActualMapper.xml

@@ -3757,27 +3757,49 @@
     <if test="valueFlag != null and valueFlag != ''">
       and  VALUE_FLAG = #{valueFlag}
     </if>
+    and ( lc_no in
+    <foreach collection="lcNoTemp" item="item" open="(" separator="," close=")">
+      #{item}
+    </foreach>
+    <if test="lcNoNull != null and lcNoNull != ''">
+      or lc_no is null )
+    </if>
+    <if test="lcNoNull == null or lcNoNull == ''">
+      and lc_no is not null)
+    </if>
     <!--and RAILWAY_NO like '%${railwayNo}%'-->
     <if test="railwayTypeNo != null and railwayTypeNo != ''">
       and  RAILWAY_TYPE_NO = #{railwayTypeNo}
     </if>
-    <if test="lcNo != null and lcNo != ''">
-      and lc_No like '%${lcNo}%'
-    </if>
+<!--    <if test="lcNo != null and lcNo != ''">-->
+<!--      and lc_No like '%${lcNo}%'-->
+<!--    </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>
-    <if test="baseSpotName != null and baseSpotName != ''">
-      and  base_spot_name = #{baseSpotName}
+    <if test="matterNo != null and matterNo != ''">
+      and  matter_no like '%${matterNo}%'
     </if>
     <if test="matterName != null and matterName != ''">
-      and  matter_name = #{matterName}
+      and  matter_name like  '%${matterName}%'
+    </if>
+    <if test="baseSpotNo != null and baseSpotNo != ''">
+      and  net_spot3_No like '%${baseSpotNo}%'
+    </if>
+    <if test="baseSpotName != null and baseSpotName != ''">
+      and  net_spot3_name like '%${baseSpotName}%'
     </if>
     <if test="predictionNo != null and predictionNo != ''">
-      and  prediction_no =  #{predictionNo}
+      and  prediction_no like '%${predictionNo}%'
     </if>
-    <if test="railwayNo != null and railwayNo != ''">
-      and  RAILWAY_NO like '%${railwayNo}%'
+    <if test="forwardingUnitName != null and forwardingUnitName != ''">
+      and  forwarding_Unit_Name like '%${forwardingUnitName}%'
+    </if>
+    <if test="receivingUintName != null and receivingUintName != ''">
+      and  receiving_uint_name like  '%${receivingUintName}%'
+    </if>
+    <if test="valueFlag != null and valueFlag != ''">
+      and  VALUE_FLAG = #{valueFlag}
     </if>
     and value_flag != '0'
   </select>
@@ -3796,20 +3818,35 @@
     <if test="railwayNo != null and railwayNo != ''">
       and  railway_no like  '%${railwayNo}%'
     </if>
+    <if test="baseSpotNo != null and baseSpotNo != ''">
+      and  net_spot3_no like '%${baseSpotNo}%'
+    </if>
     <if test="baseSpotName != null and baseSpotName != ''">
-      and  base_spot_name = #{baseSpotName}
+      and  net_spot3_name like '%${baseSpotName}%'
+    </if>
+    <if test="matterNo != null and matterNo != ''">
+      and  matter_no like '%${matterNo}%'
     </if>
     <if test="matterName != null and matterName != ''">
-      and  matter_name = #{matterName}
+      and  matter_name like '%${matterName}%'
     </if>
     <if test="predictionNo != null and predictionNo != ''">
-      and  prediction_no =  #{predictionNo}
+      and  prediction_no like '%${predictionNo}%'
+    </if>
+    <if test="forwardingUnitName != null and forwardingUnitName != ''">
+      and  forwarding_Unit_Name like '%${forwardingUnitName}%'
+    </if>
+    <if test="receivingUintName != null and receivingUintName != ''">
+      and  receiving_Uint_Name like '%${receivingUintName}%'
     </if>
     <if test="valueFlag != null and valueFlag != ''">
       and  value_flag = #{valueFlag}
     </if>
+    <if test="lcNo != null and lcNo != ''">
+      and  lc_No like '%${lcNo}%'
+    </if>
     and value_flag != '0'
-    and lc_no is not null
+--     and lc_no is not null
   </select>
 
   <select id="selectActual" parameterType="java.lang.String" resultMap="BaseResultMap">
@@ -3827,222 +3864,243 @@
   <select id="likeByDesc" parameterType="java.util.HashMap" resultMap="BaseResultMap">
     <include refid="select" />
     <where>
-      1 = 1
-      <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>
-      <if test="actualNo != null and actualNo != ''">
-        and ACTUAL_NO LIKE '%${actualNo}%'
-      </if>
-      <if test="predictionNo != null and predictionNo != ''">
-        and PREDICTION_NO LIKE '%${predictionNo}%'
-      </if>
-      <if test="noticeNo != null and noticeNo != ''">
-        and NOTICE_NO LIKE '%${noticeNo}%'
-      </if>
-      <if test="railwayNo != null and railwayNo != ''">
-        and RAILWAY_NO LIKE '%${railwayNo}%'
-      </if>
-      <if test="railwayCarriageNo != null and railwayCarriageNo != ''">
-        and RAILWAY_CARRIAGE_NO LIKE '%${railwayCarriageNo}%'
-      </if>
-      <if test="matterNo != null and matterNo != ''">
-        and MATTER_NO LIKE '%${matterNo}%'
-      </if>
-      <if test="matterName != null and matterName != ''">
-        and MATTER_NAME LIKE '%${matterName}%'
-      </if>
-      <if test="contractNo != null and contractNo != ''">
-        and CONTRACT_NO LIKE '%${contractNo}%'
-      </if>
-      <if test="batchNo != null and batchNo != ''">
-        and BATCH_NO LIKE '%${batchNo}%'
-      </if>
-      <if test="customerSupplierNo != null and customerSupplierNo != ''">
-        and CUSTOMER_SUPPLIER_NO LIKE '%${customerSupplierNo}%'
-      </if>
-      <if test="customerSupplierName != null and customerSupplierName != ''">
-        and CUSTOMER_SUPPLIER_NAME LIKE '%${customerSupplierName}%'
-      </if>
-      <if test="forwardingUnitNo != null and forwardingUnitNo != ''">
-        and FORWARDING_UNIT_NO LIKE '%${forwardingUnitNo}%'
-      </if>
-      <if test="forwardingUnitName != null and forwardingUnitName != ''">
-        and FORWARDING_UNIT_NAME LIKE '%${forwardingUnitName}%'
-      </if>
-      <if test="receivingUintNo != null and receivingUintNo != ''">
-        and RECEIVING_UINT_NO LIKE '%${receivingUintNo}%'
-      </if>
-      <if test="receivingUintName != null and receivingUintName != ''">
-        and RECEIVING_UINT_NAME LIKE '%${receivingUintName}%'
-      </if>
-      <if test="materialNo != null and materialNo != ''">
-        and MATERIAL_NO LIKE '%${materialNo}%'
-      </if>
-      <if test="materialName != null and materialName != ''">
-        and MATERIAL_NAME LIKE '%${materialName}%'
-      </if>
-      <if test="specNo != null and specNo != ''">
-        and SPEC_NO LIKE '%${specNo}%'
-      </if>
-      <if test="specName != null and specName != ''">
-        and SPEC_NAME LIKE '%${specName}%'
-      </if>
-      <if test="loadPointNo != null and loadPointNo != ''">
-        and LOAD_POINT_NO LIKE '%${loadPointNo}%'
-      </if>
-      <if test="loadPointName != null and loadPointName != ''">
-        and LOAD_POINT_NAME LIKE '%${loadPointName}%'
-      </if>
-      <if test="sampleVoucher != null and sampleVoucher != ''">
-        and SAMPLE_VOUCHER LIKE '%${sampleVoucher}%'
-      </if>
-      <if test="carrierUnitNo != null and carrierUnitNo != ''">
-        and CARRIER_UNIT_NO LIKE '%${carrierUnitNo}%'
-      </if>
-      <if test="carrierUnitName != null and carrierUnitName != ''">
-        and CARRIER_UNIT_NAME LIKE '%${carrierUnitName}%'
-      </if>
-      <if test="meterTypeNo != null and meterTypeNo != ''">
-        and METER_TYPE_NO LIKE '%${meterTypeNo}%'
-      </if>
-      <if test="meterTypeName != null and meterTypeName != ''">
-        and METER_TYPE_NAME LIKE '%${meterTypeName}%'
-      </if>
-      <if test="meterProcessNo != null and meterProcessNo != ''">
-        and METER_PROCESS_NO LIKE '%${meterProcessNo}%'
-      </if>
-      <if test="meterProcessEditionNo != null and meterProcessEditionNo != ''">
-        and METER_PROCESS_EDITION_NO LIKE '%${meterProcessEditionNo}%'
-      </if>
-      <if test="actualFirst1No != null and actualFirst1No != ''">
-        and ACTUAL_FIRST1_NO LIKE '%${actualFirst1No}%'
-      </if>
-      <if test="grossWeight != null">
-        and GROSS_WEIGHT = #{grossWeight}
-      </if>
-      <if test="grossManNo != null and grossManNo != ''">
-        and GROSS_MAN_NO LIKE '%${grossManNo}%'
-      </if>
-      <if test="grossManName != null and grossManName != ''">
-        and GROSS_MAN_NAME LIKE '%${grossManName}%'
-      </if>
-      <if test="grossTime != null">
-        and TO_CHAR(GROSS_TIME,'yyyy-MM-dd') = #{grossTime}
-      </if>
-      <if test="baseSpot1No != null and baseSpot1No != ''">
-        and BASE_SPOT1_NO LIKE '%${baseSpot1No}%'
-      </if>
-      <if test="baseSpot1Name != null and baseSpot1Name != ''">
-        and BASE_SPOT1_NAME LIKE '%${baseSpot1Name}%'
-      </if>
-      <if test="grossClass != null and grossClass != ''">
-        and GROSS_CLASS LIKE '%${grossClass}%'
-      </if>
-      <if test="grossGroup != null and grossGroup != ''">
-        and GROSS_GROUP LIKE '%${grossGroup}%'
-      </if>
-      <if test="grossMode != null and grossMode != ''">
-        and GROSS_MODE LIKE '%${grossMode}%'
-      </if>
-      <if test="actualFirst2No != null and actualFirst2No != ''">
-        and ACTUAL_FIRST2_NO LIKE '%${actualFirst2No}%'
-      </if>
-      <if test="tareWeight != null">
-        and TARE_WEIGHT = #{tareWeight}
-      </if>
-      <if test="tareManNo != null and tareManNo != ''">
-        and TARE_MAN_NO LIKE '%${tareManNo}%'
-      </if>
-      <if test="tareManName != null and tareManName != ''">
-        and TARE_MAN_NAME LIKE '%${tareManName}%'
-      </if>
-      <if test="tareTime != null">
-        and TO_CHAR(TARE_TIME,'yyyy-MM-dd') = #{tareTime}
-      </if>
-      <if test="baseSpot2No != null and baseSpot2No != ''">
-        and BASE_SPOT2_NO LIKE '%${baseSpot2No}%'
-      </if>
-      <if test="baseSpot2Name != null and baseSpot2Name != ''">
-        and BASE_SPOT2_NAME LIKE '%${baseSpot2Name}%'
-      </if>
-      <if test="tareClass != null and tareClass != ''">
-        and TARE_CLASS LIKE '%${tareClass}%'
-      </if>
-      <if test="tareGroup != null and tareGroup != ''">
-        and TARE_GROUP LIKE '%${tareGroup}%'
-      </if>
-      <if test="tareMode != null and tareMode != ''">
-        and TARE_MODE LIKE '%${tareMode}%'
-      </if>
-      <if test="netWeight != null">
-        and NET_WEIGHT = #{netWeight}
-      </if>
-      <if test="netManNo != null and netManNo != ''">
-        and NET_MAN_NO LIKE '%${netManNo}%'
-      </if>
-      <if test="netManName != null and netManName != ''">
-        and NET_MAN_NAME LIKE '%${netManName}%'
-      </if>
-      <if test="netTime != null">
-        and TO_CHAR(NET_TIME,'yyyy-MM-dd') = #{netTime}
-      </if>
-      <if test="netSpot3No != null and netSpot3No != ''">
-        and NET_SPOT3_NO LIKE '%${netSpot3No}%'
-      </if>
-      <if test="netSpot3Name != null and netSpot3Name != ''">
-        and NET_SPOT3_NAME LIKE '%${netSpot3Name}%'
-      </if>
-      <if test="netMode != null and netMode != ''">
-        and NET_MODE LIKE '%${netMode}%'
-      </if>
-      <if test="valueFlag != null and valueFlag != ''">
-        and VALUE_FLAG LIKE '%${valueFlag}%'
-      </if>
-      <if test="uploadFlag != null and uploadFlag != ''">
-        and UPLOAD_FLAG LIKE '%${uploadFlag}%'
-      </if>
-      <if test="sampleNo != null and sampleNo != ''">
-        and SAMPLE_NO LIKE '%${sampleNo}%'
-      </if>
-      <if test="railwayTypeNo != null and railwayTypeNo != ''">
-        and RAILWAY_TYPE_NO LIKE '%${railwayTypeNo}%'
-      </if>
-      <if test="railwayTypeName != null and railwayTypeName != ''">
-        and RAILWAY_TYPE_NAME LIKE '%${railwayTypeName}%'
-      </if>
-      <if test="waterNum != null">
-        and WATER_NUM = #{waterNum}
-      </if>
-      <if test="arrival != null and arrival != ''">
-        and ARRIVAL LIKE '%${arrival}%'
-      </if>
-      <if test="station != null and station != ''">
-        and STATION LIKE '%${station}%'
-      </if>
-      <if test="senderType != null and senderType != ''">
-        and SENDER_TYPE LIKE '%${senderType}%'
-      </if>
-      <if test="senderRemark != null and senderRemark != ''">
-        and SENDER_REMARK LIKE '%${senderRemark}%'
-      </if>
-      <if test="receiverRemark != null and receiverRemark != ''">
-        and RECEIVER_REMARK LIKE '%${receiverRemark}%'
-      </if>
-      <if test="dataSource != null and dataSource != ''">
-        and DATA_SOURCE LIKE '%${dataSource}%'
-      </if>
-      <if test="isPreSacale != null and isPreSacale != ''">
-        and IS_PRE_SACALE LIKE '%${isPreSacale}%'
-      </if>
-      <if test="lcNo != null and lcNo != ''">
-        and LC_NO LIKE '%${lcNo}%'
-      </if>
-      <if test="predictionType != null and predictionType != ''">
-        and PREDICTION_TYPE LIKE '%${predictionType}%'
-      </if>
-    </where>
-    and value_flag != '0'
+        1 = 1
+        <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>
+        <if test="actualNo != null and actualNo != ''">
+          and ACTUAL_NO LIKE '%${actualNo}%'
+        </if>
+        <if test="predictionNo != null and predictionNo != ''">
+          and PREDICTION_NO LIKE '%${predictionNo}%'
+        </if>
+        <if test="noticeNo != null and noticeNo != ''">
+          and NOTICE_NO LIKE '%${noticeNo}%'
+        </if>
+        <if test="railwayNo != null and railwayNo != ''">
+          and RAILWAY_NO LIKE '%${railwayNo}%'
+        </if>
+        <if test="railwayCarriageNo != null and railwayCarriageNo != ''">
+          and RAILWAY_CARRIAGE_NO LIKE '%${railwayCarriageNo}%'
+        </if>
+        <if test="matterNo != null and matterNo != ''">
+          and MATTER_NO LIKE '%${matterNo}%'
+        </if>
+        <if test="matterName != null and matterName != ''">
+          and MATTER_NAME LIKE '%${matterName}%'
+        </if>
+        <if test="contractNo != null and contractNo != ''">
+          and CONTRACT_NO LIKE '%${contractNo}%'
+        </if>
+        <if test="batchNo != null and batchNo != ''">
+          and BATCH_NO LIKE '%${batchNo}%'
+        </if>
+        <if test="customerSupplierNo != null and customerSupplierNo != ''">
+          and CUSTOMER_SUPPLIER_NO LIKE '%${customerSupplierNo}%'
+        </if>
+        <if test="customerSupplierName != null and customerSupplierName != ''">
+          and CUSTOMER_SUPPLIER_NAME LIKE '%${customerSupplierName}%'
+        </if>
+        <if test="forwardingUnitNo != null and forwardingUnitNo != ''">
+          and FORWARDING_UNIT_NO LIKE '%${forwardingUnitNo}%'
+        </if>
+        <if test="forwardingUnitName != null and forwardingUnitName != ''">
+          and FORWARDING_UNIT_NAME LIKE '%${forwardingUnitName}%'
+        </if>
+        <if test="receivingUintNo != null and receivingUintNo != ''">
+          and RECEIVING_UINT_NO LIKE '%${receivingUintNo}%'
+        </if>
+        <if test="receivingUintName != null and receivingUintName != ''">
+          and RECEIVING_UINT_NAME LIKE '%${receivingUintName}%'
+        </if>
+        <if test="materialNo != null and materialNo != ''">
+          and MATERIAL_NO LIKE '%${materialNo}%'
+        </if>
+        <if test="materialName != null and materialName != ''">
+          and MATERIAL_NAME LIKE '%${materialName}%'
+        </if>
+        <if test="specNo != null and specNo != ''">
+          and SPEC_NO LIKE '%${specNo}%'
+        </if>
+        <if test="specName != null and specName != ''">
+          and SPEC_NAME LIKE '%${specName}%'
+        </if>
+        <if test="loadPointNo != null and loadPointNo != ''">
+          and LOAD_POINT_NO LIKE '%${loadPointNo}%'
+        </if>
+        <if test="loadPointName != null and loadPointName != ''">
+          and LOAD_POINT_NAME LIKE '%${loadPointName}%'
+        </if>
+        <if test="sampleVoucher != null and sampleVoucher != ''">
+          and SAMPLE_VOUCHER LIKE '%${sampleVoucher}%'
+        </if>
+        <if test="carrierUnitNo != null and carrierUnitNo != ''">
+          and CARRIER_UNIT_NO LIKE '%${carrierUnitNo}%'
+        </if>
+        <if test="carrierUnitName != null and carrierUnitName != ''">
+          and CARRIER_UNIT_NAME LIKE '%${carrierUnitName}%'
+        </if>
+        <if test="meterTypeNo != null and meterTypeNo != ''">
+          and METER_TYPE_NO LIKE '%${meterTypeNo}%'
+        </if>
+        <if test="meterTypeName != null and meterTypeName != ''">
+          and METER_TYPE_NAME LIKE '%${meterTypeName}%'
+        </if>
+        <if test="meterProcessNo != null and meterProcessNo != ''">
+          and METER_PROCESS_NO LIKE '%${meterProcessNo}%'
+        </if>
+        <if test="meterProcessEditionNo != null and meterProcessEditionNo != ''">
+          and METER_PROCESS_EDITION_NO LIKE '%${meterProcessEditionNo}%'
+        </if>
+        <if test="actualFirst1No != null and actualFirst1No != ''">
+          and ACTUAL_FIRST1_NO LIKE '%${actualFirst1No}%'
+        </if>
+        <if test="grossWeight != null">
+          and GROSS_WEIGHT = #{grossWeight}
+        </if>
+        <if test="grossManNo != null and grossManNo != ''">
+          and GROSS_MAN_NO LIKE '%${grossManNo}%'
+        </if>
+        <if test="grossManName != null and grossManName != ''">
+          and GROSS_MAN_NAME LIKE '%${grossManName}%'
+        </if>
+        <if test="grossTime != null">
+          and TO_CHAR(GROSS_TIME,'yyyy-MM-dd') = #{grossTime}
+        </if>
+        <if test="baseSpot1No != null and baseSpot1No != ''">
+          and BASE_SPOT1_NO LIKE '%${baseSpot1No}%'
+        </if>
+        <if test="baseSpot1Name != null and baseSpot1Name != ''">
+          and BASE_SPOT1_NAME LIKE '%${baseSpot1Name}%'
+        </if>
+        <if test="grossClass != null and grossClass != ''">
+          and GROSS_CLASS LIKE '%${grossClass}%'
+        </if>
+        <if test="grossGroup != null and grossGroup != ''">
+          and GROSS_GROUP LIKE '%${grossGroup}%'
+        </if>
+        <if test="grossMode != null and grossMode != ''">
+          and GROSS_MODE LIKE '%${grossMode}%'
+        </if>
+        <if test="actualFirst2No != null and actualFirst2No != ''">
+          and ACTUAL_FIRST2_NO LIKE '%${actualFirst2No}%'
+        </if>
+        <if test="tareWeight != null">
+          and TARE_WEIGHT = #{tareWeight}
+        </if>
+        <if test="tareManNo != null and tareManNo != ''">
+          and TARE_MAN_NO LIKE '%${tareManNo}%'
+        </if>
+        <if test="tareManName != null and tareManName != ''">
+          and TARE_MAN_NAME LIKE '%${tareManName}%'
+        </if>
+        <if test="tareTime != null">
+          and TO_CHAR(TARE_TIME,'yyyy-MM-dd') = #{tareTime}
+        </if>
+        <if test="baseSpot2No != null and baseSpot2No != ''">
+          and BASE_SPOT2_NO LIKE '%${baseSpot2No}%'
+        </if>
+        <if test="baseSpot2Name != null and baseSpot2Name != ''">
+          and BASE_SPOT2_NAME LIKE '%${baseSpot2Name}%'
+        </if>
+        <if test="tareClass != null and tareClass != ''">
+          and TARE_CLASS LIKE '%${tareClass}%'
+        </if>
+        <if test="tareGroup != null and tareGroup != ''">
+          and TARE_GROUP LIKE '%${tareGroup}%'
+        </if>
+        <if test="tareMode != null and tareMode != ''">
+          and TARE_MODE LIKE '%${tareMode}%'
+        </if>
+        <if test="netWeight != null">
+          and NET_WEIGHT = #{netWeight}
+        </if>
+        <if test="netManNo != null and netManNo != ''">
+          and NET_MAN_NO LIKE '%${netManNo}%'
+        </if>
+        <if test="netManName != null and netManName != ''">
+          and NET_MAN_NAME LIKE '%${netManName}%'
+        </if>
+        <if test="netTime != null">
+          and TO_CHAR(NET_TIME,'yyyy-MM-dd') = #{netTime}
+        </if>
+        <if test="netSpot3No != null and netSpot3No != ''">
+          and NET_SPOT3_NO LIKE '%${netSpot3No}%'
+        </if>
+        <if test="netSpot3Name != null and netSpot3Name != ''">
+          and NET_SPOT3_NAME LIKE '%${netSpot3Name}%'
+        </if>
+        <if test="netMode != null and netMode != ''">
+          and NET_MODE LIKE '%${netMode}%'
+        </if>
+        <if test="valueFlag != null and valueFlag != ''">
+          and VALUE_FLAG LIKE '%${valueFlag}%'
+        </if>
+        <if test="uploadFlag != null and uploadFlag != ''">
+          and UPLOAD_FLAG LIKE '%${uploadFlag}%'
+        </if>
+        <if test="sampleNo != null and sampleNo != ''">
+          and SAMPLE_NO LIKE '%${sampleNo}%'
+        </if>
+        <if test="railwayTypeNo != null and railwayTypeNo != ''">
+          and RAILWAY_TYPE_NO LIKE '%${railwayTypeNo}%'
+        </if>
+        <if test="railwayTypeName != null and railwayTypeName != ''">
+          and RAILWAY_TYPE_NAME LIKE '%${railwayTypeName}%'
+        </if>
+        <if test="waterNum != null">
+          and WATER_NUM = #{waterNum}
+        </if>
+        <if test="arrival != null and arrival != ''">
+          and ARRIVAL LIKE '%${arrival}%'
+        </if>
+        <if test="station != null and station != ''">
+          and STATION LIKE '%${station}%'
+        </if>
+        <if test="senderType != null and senderType != ''">
+          and SENDER_TYPE LIKE '%${senderType}%'
+        </if>
+        <if test="senderRemark != null and senderRemark != ''">
+          and SENDER_REMARK LIKE '%${senderRemark}%'
+        </if>
+        <if test="receiverRemark != null and receiverRemark != ''">
+          and RECEIVER_REMARK LIKE '%${receiverRemark}%'
+        </if>
+        <if test="dataSource != null and dataSource != ''">
+          and DATA_SOURCE LIKE '%${dataSource}%'
+        </if>
+        <if test="isPreSacale != null and isPreSacale != ''">
+          and IS_PRE_SACALE LIKE '%${isPreSacale}%'
+        </if>
+        <if test="lcNo != null and lcNo != ''">
+          and LC_NO LIKE '%${lcNo}%'
+        </if>
+        <if test="baseSpotNo != null and baseSpotNo != ''">
+          and NET_SPOT3_NO LIKE '%${baseSpotNo}%'
+        </if>
+        <if test="baseSpotName != null and baseSpotName != ''">
+          and NET_SPOT3_NAME LIKE '%${baseSpotName}%'
+        </if>
+        <if test="lcNoTemp != null and lcNoTemp != ''">
+          and ( lc_no in
+          <foreach collection="lcNoTemp" item="item" open="(" separator="," close=")">
+            #{item}
+          </foreach>
+          <if test="lcNoNull != null and lcNoNull != ''">
+            or lc_no is null )
+          </if>
+          <if test="lcNoNull == null or lcNoNull == ''">
+            and lc_no is not null)
+          </if>
+        </if>
+        <if test="predictionType != null and predictionType != ''">
+          and PREDICTION_TYPE LIKE '%${predictionType}%'
+        </if>
+        <if test="flag != null and flag !=''">
+          and lc_no is null
+        </if>
+      </where>
+      and value_flag != '0'
     order by net_time desc
   </select>
   <select id="selectByAcatualFristNo" parameterType="java.util.HashMap" resultMap="BaseResultMap">

+ 5 - 3
src/main/java/com/steerinfo/meterwork/meterworkrailwayactual/service/IMeterWorkRailwayActualService.java

@@ -51,9 +51,9 @@ public interface IMeterWorkRailwayActualService extends IBaseService<MeterWorkRa
 
     int addData(MeterWorkRailwayActual model);
 
-    List<String> distinctRailwayNo(String railwayTypeNo, String lcNo, String railwayNo, String startTime, String endTime,String baseSpotName,String matterName,String predictionNo, String valueFlag);
-    List<String> distinctLcNo(String railwayTypeNo, String startTime, String endTime);
-    RESTfulResult distinctLcNoAndRailwayNo(String railwayTypeNo, String startTime, String endTime, String railwayNo, String baseSpotName, String matterName, String predictionNo, String valueFlag);
+    List<String> distinctRailwayNo(HashMap<String, Object> param);
+    List<String> distinctLcNo(HashMap<String, Object> param);
+    RESTfulResult distinctLcNoAndRailwayNo(HashMap<String, Object> param);
 
     PageList<MeterWorkRailwayActual> selectView(HashMap parmas, Integer pageNum, Integer pageSize);
 
@@ -86,8 +86,10 @@ public interface IMeterWorkRailwayActualService extends IBaseService<MeterWorkRa
     RESTfulResult firstAndEntrustById(String actualNo);
 
     RESTfulResult specialRemove(HashMap map);
+    RESTfulResult commonRemove(HashMap map);
 
     PageList<MeterWorkRailwayActual> likeByDesc(Map<String, Object> parameters, Integer pageNum, Integer pageSize);
+    List<MeterWorkRailwayActual> webByLikeDesc(HashMap<String, Object> parameters);
     List<MeterWorkRailwayActual> noPage(Map<String, Object> params);
 
     RESTfulResult batchUpdateLcNo(List<MeterWorkRailwayActual> models);

+ 224 - 38
src/main/java/com/steerinfo/meterwork/meterworkrailwayactual/service/impl/MeterWorkRailwayActualServiceImpl.java

@@ -893,53 +893,130 @@ public class MeterWorkRailwayActualServiceImpl extends BaseServiceImpl<MeterWork
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public List<String> distinctRailwayNo(String railwayTypeNo, String lcNo, String railwayNo, String startTime, String endTime,String baseSpotName,String matterName,String predictionNo, String valueFlag) {
-        HashMap<String, Object> obj = new HashMap<>();
-        obj.put("railwayTypeNo", railwayTypeNo);
-        obj.put("railwayNo", railwayNo);
-        obj.put("lcNo", lcNo);
-        obj.put("startTime", startTime);
-        obj.put("endTime", endTime);
-        obj.put("baseSpotName", baseSpotName);
-        obj.put("matterName", matterName);
-        obj.put("predictionNo", predictionNo);
-        obj.put("valueFlag", valueFlag);
-        List<String> list = meterWorkRailwayActualMapper.distinctRailwayNo(obj).stream().map(MeterWorkRailwayActual::getRailwayNo).collect(Collectors.toList());
+    public List<String> distinctRailwayNo(HashMap<String, Object> param) {
+//        String railwayTypeNo = param.get("railwayTypeNo") == null ? "":param.get("railwayTypeNo").toString();
+//        String lcNo = param.get("lcNo") == null ? "" : param.get("lcNo").toString();
+//        String railwayNo = param.get("railwayNo") == null ? "":param.get("railwayNo").toString();
+//        String startTime = param.get("startTime") == null ? "":param.get("startTime").toString();
+//        String endTime = param.get("endTime") == null ? "":param.get("endTime").toString();;
+//        String baseSpotName = param.get("baseSpotName") == null ? "": param.get("baseSpotName").toString();
+//        String matterName = param.get("matterName") == null ? "": param.get("matterName").toString();
+//        String predictionNo = param.get("predictionNo") == null ? "": param.get("predictionNo").toString();
+//        String valueFlag = param.get("valueFlag") == null ? "":param.get("valueFlag").toString();
+//
+//        HashMap<String, Object> obj = new HashMap<>();
+//        obj.put("railwayTypeNo", railwayTypeNo);
+//        obj.put("railwayNo", railwayNo);
+//        obj.put("lcNo", lcNo);
+//        obj.put("startTime", startTime);
+//        obj.put("endTime", endTime);
+//        obj.put("baseSpotName", baseSpotName);
+//        obj.put("matterName", matterName);
+//        obj.put("predictionNo", predictionNo);
+//        obj.put("valueFlag", valueFlag);
+//        List<String> list = meterWorkRailwayActualMapper.distinctRailwayNo(param).stream().map(MeterWorkRailwayActual::getRailwayNo).collect(Collectors.toList());
+//        return list;
+
+        String[] lcNoTemp = param.get("lcNo").toString().split(",");
+//        param.remove("lcNo");
+        param.put("lcNoTemp", lcNoTemp);
+        for (String str:
+                lcNoTemp) {
+            if(str.equals("")) {
+                param.put("lcNoNull", "1");
+                break;
+            }else {
+                param.put("lcNoNull", "");
+            }
+        }
+        List<String> list = new ArrayList<>();
+        try{
+            list = meterWorkRailwayActualMapper.distinctRailwayNo(param)
+                    .stream()
+                    .map(MeterWorkRailwayActual::getRailwayNo)
+                    .collect(Collectors.toList());
+            if(list==null && list.isEmpty()) {
+                list.add("");
+            }
+        }catch (Exception e) {
+            list.add("");
+        }
         return list;
     }
 
     @Override
-    public List<String> distinctLcNo(String railwayTypeNo, String startTime, String endTime) {
-        HashMap<String, Object> obj = new HashMap<>();
-        obj.put("railwayTypeNo", railwayTypeNo);
-        obj.put("startTime", startTime);
-        obj.put("endTime", endTime);
-        List<MeterWorkRailwayActual> templist = meterWorkRailwayActualMapper.distinctLcNo(obj);
-        List<String> list = null;
-        if(templist.size() != 0)
-        {
-            list = templist.stream().map(MeterWorkRailwayActual::getLcNo).collect(Collectors.toList());
+    public List<String> distinctLcNo(HashMap<String, Object> param) {
+//        String railwayTypeNo = param.get("railwayTypeNo") == null ? "":param.get("railwayTypeNo").toString();
+//        String startTime = param.get("startTime") == null ? "":param.get("startTime").toString();
+//        String endTime = param.get("endTime") == null ? "":param.get("endTime").toString();
+//        String railwayNo = param.get("railwayNo") == null ? "": param.get("railwayNo").toString();
+//        String baseSpotNo = param.get("baseSpotNo") == null ? "":param.get("baseSpotNo").toString();
+//        String matterName = param.get("matterName") == null ? "":param.get("matterName").toString();
+//        String predictionNo = param.get("predictionNo") == null ? "":param.get("predictionNo").toString();
+//        String forwardingUnitName = param.get("forwardingUnitName") == null ? "": param.get("forwardingUnitName").toString();
+//        String receivingUintName = param.get("receivingUintName") == null ? "":param.get("receivingUintName").toString();
+//        String valueFlag = param.get("valueFlag") == null ? "": param.get("valueFlag").toString();
+//        String lcNo = param.get("lcNo") == null ? "": param.get("lcNo").toString();
+//
+//        HashMap<String, Object> obj = new HashMap<>();
+//        obj.put("railwayTypeNo", railwayTypeNo);
+//        obj.put("startTime", startTime);
+//        obj.put("endTime", endTime);
+//        obj.put("railwayNo", railwayNo);
+//        obj.put("baseSpotNo", baseSpotNo);
+//        obj.put("matterName", matterName);
+//        obj.put("predictionNo", predictionNo);
+//        obj.put("forwardingUnitName", forwardingUnitName);
+//        obj.put("receivingUintName", receivingUintName);
+//        obj.put("valueFlag", valueFlag);
+//        obj.put("lcNo", lcNo);
+        List<MeterWorkRailwayActual> templist = meterWorkRailwayActualMapper.distinctLcNo(param);
+        List<String> list = new ArrayList<>();
+        if (templist != null && !templist.isEmpty() ) {
+            try{
+                list = templist.stream().map(MeterWorkRailwayActual::getLcNo).distinct().collect(Collectors.toList());
+                if(list==null && list.isEmpty()) {
+                    list.add("");
+                }
+            }catch (Exception e) {
+                list.add("");
+            }
         }
         return list;
+//        List<String> list = null;
+//        if(templist.size() != 0)
+//        {
+//            list = templist.stream().map(MeterWorkRailwayActual::getLcNo).collect(Collectors.toList());
+//        }
+//        return list;
     }
 
     @Override
-    public RESTfulResult distinctLcNoAndRailwayNo(String railwayTypeNo, String startTime, String endTime, String railwayNo, String baseSpotName, String matterName, String predictionNo, String valueFlag) {
+    public RESTfulResult distinctLcNoAndRailwayNo(HashMap<String, Object> param) {
         RESTfulResult rm = new RESTfulResult();
         rm.setFailed();
         try{
-            HashMap<String, Object> param = new HashMap<>();
+//            String railwayTypeNo = param.get("railwayTypeNo") == null ? "":param.get("railwayTypeNo").toString();
+//            String startTime = param.get("startTime") == null ? "":param.get("startTime").toString();
+//            String endTime = param.get("endTime") == null ? "":param.get("endTime").toString();
+//            String railwayNo = param.get("railwayNo") == null ? "":param.get("railwayNo").toString();
+//            String baseSpotName = param.get("baseSpotName") == null ? "": param.get("baseSpotName").toString();
+//            String matterName = param.get("matterName") == null ? "": param.get("matterName").toString();
+//            String predictionNo = param.get("predictionNo") == null ? "": param.get("predictionNo").toString();
+//            String valueFlag = param.get("valueFlag") == null ? "":param.get("valueFlag").toString();
+//
+//            HashMap<String, Object> param = new HashMap<>();
             HashMap<String, Object> obj = new HashMap<>();
-            obj.put("railwayTypeNo", railwayTypeNo);
-            obj.put("startTime", startTime);
-            obj.put("endTime", endTime);
-            obj.put("railwayNo", railwayNo);
-            obj.put("baseSpotName", baseSpotName);
-            obj.put("matterName", matterName);
-            obj.put("predictionNo", predictionNo);
-            obj.put("valueFlag", valueFlag);
-
-            List<MeterWorkRailwayActual> tempList = meterWorkRailwayActualMapper.distinctLcNo(obj);
+//            obj.put("railwayTypeNo", railwayTypeNo);
+//            obj.put("startTime", startTime);
+//            obj.put("endTime", endTime);
+//            obj.put("railwayNo", railwayNo);
+//            obj.put("baseSpotName", baseSpotName);
+//            obj.put("matterName", matterName);
+//            obj.put("predictionNo", predictionNo);
+//            obj.put("valueFlag", valueFlag);
+
+            List<MeterWorkRailwayActual> tempList = meterWorkRailwayActualMapper.distinctLcNo(param);
             List<String> list = null;
             List<String> railwayNum = null;
             if(tempList.size() != 0)
@@ -947,12 +1024,12 @@ public class MeterWorkRailwayActualServiceImpl extends BaseServiceImpl<MeterWork
                 list = tempList.stream().map(MeterWorkRailwayActual::getLcNo).distinct().collect(Collectors.toList());
                 railwayNum = tempList.stream().map(MeterWorkRailwayActual::getRailwayNo).distinct().collect(Collectors.toList());
             }
-            param.put("LcList", list);
-            param.put("railwayNoList", railwayNum);
+            obj.put("LcList", list);
+            obj.put("railwayNoList", railwayNum);
             rm.setSucceed();
             rm.setCode("200");
             rm.setMessage("操作成功!!");
-            rm.setData(param);
+            rm.setData(obj);
         }catch(Exception e) {
             e.printStackTrace();
             rm.setMessage("操作异常!!>>" + e.getMessage());
@@ -2064,6 +2141,97 @@ public class MeterWorkRailwayActualServiceImpl extends BaseServiceImpl<MeterWork
         return rm;
     }
 
+    @Override
+    public RESTfulResult commonRemove(HashMap params) {
+        RESTfulResult rm = new RESTfulResult();
+        rm.setFailed();
+        rm.setData(null);
+        rm.setCode("500");
+        try{
+
+            MeterWorkRailwayActual actualModel = meterWorkRailwayActualMapper.selectByPrimaryKey(params.get("actualNo").toString());
+            if(actualModel == null){
+                rm.setMessage("未找到洁净计量数据,请确认!!!");
+                return rm;
+            }
+            List<MeterWorkRailwayActual> models = new ArrayList<>();
+            models.add(actualModel);
+
+            for(MeterWorkRailwayActual modelTemp: models) {
+                if(modelTemp.getPredictionNo() != null && StringUtils.isNotEmpty(modelTemp.getPredictionNo())){
+                    PreRailwayScale scaleTemp = preRailwayScaleMapper.selectByPrimaryKey(modelTemp.getPredictionNo());
+                    if(scaleTemp.getValueFlag().equals("9")) {
+                        rm.setMessage("洁净数据中包含已结算的委托!!!");
+                        return rm;
+                    }
+                    if(scaleTemp.getPredictionType().equals("5") || scaleTemp.getPredictionType().equals("6") || scaleTemp.getPredictionType().equals("7")){
+                        rm.setMessage("洁净数据中包含特殊委托匹配结净的数据!!!");
+                        return rm;
+                    }
+                }
+            }
+            for (MeterWorkRailwayActual model: models) {
+                //循环每一个洁净记录
+                //委托不能为空
+                if(StringUtils.isNotEmpty(model.getPredictionNo())){
+                    // 改委托
+                    if (StringUtils.isNotEmpty(model.getPredictionNo())) {
+                        PreRailwayScale scale = preRailwayScaleMapper.selectByPrimaryKey(model.getPredictionNo());
+                        scale.setValueFlag("1");
+                        scale.setUploadFlag("1");
+                        scale.setUpdateTime(new Date());
+                        scale.setUpdateManNo("system");
+                        scale.setUpdateManName("洁净废除操作");
+                        preRailwayScaleMapper.updateByPrimaryKeySelective(scale);
+                    }
+                }
+                // 清空一次毛重、皮重委托信息
+                MeterWorkRailwayActFirst firstGross;
+                MeterWorkRailwayActFirst firstTare;
+                if(StringUtils.isNotEmpty(model.getActualFirst1No())&&StringUtils.isNotEmpty(model.getActualFirst2No())){
+                    firstGross = meterWorkRailwayActFirstMapper.selectAndRemove(model.getActualFirst1No());
+                    firstTare =  meterWorkRailwayActFirstMapper.selectAndRemove(model.getActualFirst2No());
+                }else{
+                    firstGross = meterWorkRailwayActFirstMapper.selectByPrimaryKey(model.getActualFirst1No());
+                    firstTare = meterWorkRailwayActFirstMapper.selectByPrimaryKey(model.getActualFirst2No());
+                }
+                if(firstGross != null){
+                    firstGross.setValueFlag(DbConstants.VALID);
+                    firstGross.setUpdateManName("system");
+                    firstGross.setUpdateManName("洁净废除更新");
+                    firstGross.setNote(model.getNote());
+                    firstGross.setUpdateTime(new Date());
+                    firstGross.setIsPreSacale("0");
+                    firstGross.setValueFlag("0");
+                    meterWorkRailwayActFirstMapper.updateByPrimaryKey(firstGross);
+                }
+                if(firstTare != null){
+                    firstTare.setValueFlag(DbConstants.VALID);
+                    firstTare.setUpdateManName("system");
+                    firstTare.setUpdateManName("洁净废除更新");
+                    firstTare.setNote(model.getNote());
+                    firstTare.setUpdateTime(new Date());
+                    firstTare.setIsPreSacale("0");
+                    firstTare.setValueFlag("0");
+                    meterWorkRailwayActFirstMapper.updateByPrimaryKey(firstTare);
+                }
+                // 作废洁净
+                model.setUploadFlag("1");
+                model.setValueFlag("0");
+                meterWorkRailwayActualMapper.updateByPrimaryKeySelective(model);
+                //删洁净
+                //meterWorkCarActualMapper.deleteByPrimaryKey(model.getActualNo());
+            }
+            rm.setSucceed();
+            rm.setMessage("操作成功!!");
+            rm.setCode("200");
+        }catch(Exception e){
+            e.printStackTrace();
+            rm.setMessage("操作异常,请确认!>>>" + e.getMessage());
+        }
+        return rm;
+    }
+
     //还原委托
     public void removeScaleEl(String predictionNo){
         String userId;
@@ -2137,6 +2305,24 @@ public class MeterWorkRailwayActualServiceImpl extends BaseServiceImpl<MeterWork
         return pageInfo;
     }
 
+    @Override
+    public List<MeterWorkRailwayActual> webByLikeDesc(HashMap<String, Object> parameters) {
+        String[] lcNoTemp = parameters.get("lcNoTemp").toString().split(",");
+        parameters.remove("lcNoTemp");
+        parameters.put("lcNoTemp", lcNoTemp);
+        for (String str:
+                lcNoTemp) {
+            if(str.equals("")) {
+                parameters.put("lcNoNull", "1");
+                break;
+            }else {
+                parameters.put("lcNoNull", "");
+            }
+        }
+        List<MeterWorkRailwayActual> rows = meterWorkRailwayActualMapper.likeByDesc(parameters);
+        return rows;
+    }
+
     @Override
     public List<MeterWorkRailwayActual> noPage(Map<String, Object> params) {
         List<MeterWorkRailwayActual> rows = meterWorkRailwayActualMapper.likeByDesc(params);
@@ -2152,7 +2338,7 @@ public class MeterWorkRailwayActualServiceImpl extends BaseServiceImpl<MeterWork
             String lcNo = sdf.format(new Date());
             int count = 0;
             for(MeterWorkRailwayActual model: models) {
-                model.setLcNo(lcNo);
+                model.setLcNo(model.getNetSpot3No() + "-" + lcNo);
                 meterWorkRailwayActualMapper.updateByPrimaryKeySelective(model);
                 count++;
             }