Kaynağa Gözat

后端修改

dengyj 4 yıl önce
ebeveyn
işleme
df5fd0ef9a

+ 23 - 1
src/main/java/com/steerinfo/meterwork/meterworkcaractual/controller/MeterWorkCarActualController.java

@@ -446,7 +446,7 @@ throw new MarkerMetException(500, "操作异常!!");
         return rm;
     }
 
-    @ApiOperation(value = "解除", notes = "将洁净后的数据进行还原")
+    @ApiOperation(value = "解除", notes = "将洁净后的数据进行还原且清除委托信息")
     @PostMapping(value = "/remove")
     public RESTfulResult remove(@RequestBody List<MeterWorkCarActual> models) {
         RESTfulResult rm = failed();
@@ -468,6 +468,28 @@ throw new MarkerMetException(500, "操作异常!!");
         }
         return rm;
     }
+    @ApiOperation(value = "解除", notes = "将洁净后的数据进行还原但不清除委托信息")
+    @PostMapping(value = "/removeButNotEntrust")
+    public RESTfulResult removeButNotEntrust(@RequestBody List<MeterWorkCarActual> models) {
+        RESTfulResult rm = failed();
+        try {
+            int num = meterWorkCarActualService.removeButNotEntrust(models);
+            if (num >= 1) {
+                return success(num);
+            } else {
+                return failed("操作失败");
+            }
+        } catch (MarkerMetException e) {
+            e.printStackTrace();
+            rm.setMessage(e.getMessage());
+        } catch (Exception e) {
+            e.printStackTrace();
+            rm.setMessage("操作异常,请确认!");
+        } finally {
+
+        }
+        return rm;
+    }
 
     @ApiOperation(value = "特殊委托解除洁净", notes = "将洁净后的数据进行还原")
     @PostMapping(value = "/specialRemove")

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

@@ -57,6 +57,8 @@ public interface IMeterWorkCarActualService extends IBaseService<MeterWorkCarAct
 
     int remove(List<MeterWorkCarActual> models);
 
+    public int removeButNotEntrust(List<MeterWorkCarActual> models);
+
     RESTfulResult specialRemove(HashMap map);
 
     MeterWorkCarActual termclean(String actualFirstNo, String dataNo);

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

@@ -389,7 +389,6 @@ public class MeterWorkCarActualServiceImpl extends BaseServiceImpl<MeterWorkCarA
             actualRow.setActualNo(sdf.format(new Date()) + no);
             actualRow.setNote(note);
             actualRow.setUploadFlag("1");
-//            actualRow.setDataSource("1");
             actualRow.setNetWeight(mwcaf1.getMeterWeight().subtract(mwcaf2.getMeterWeight()));
             meterWorkCarActualMapper.insertSelective(actualRow);
             return actualRow;
@@ -483,6 +482,60 @@ public class MeterWorkCarActualServiceImpl extends BaseServiceImpl<MeterWorkCarA
         }
     }
 
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public int removeButNotEntrust(List<MeterWorkCarActual> models) {
+        try {
+            int num = 0;
+            if (models == null || models.size() <= 0) {
+                throw new MarkerMetException(500, "参数为空!!!");
+            }
+            for (MeterWorkCarActual model : models) {
+                //毛重
+                MeterWorkCarActualFirst mwcaf1 = meterWorkCarActualFirstMapper.selectByPrimaryKey(model.getActualFirst1No());
+                if (mwcaf1 == null) {
+                    throw new MarkerMetException(500, "未查询到相应的毛重数据!!");
+                }
+                // 清空毛重数据中的委托信息
+                mwcaf1.setValueFlag(DbConstants.VALID);
+                mwcaf1.setNote(model.getNote());
+                mwcaf1.setUpdateManName("system");
+                mwcaf1.setUpdateManName("二次计量解除更新");
+                mwcaf1.setUpdateTime(new Date());
+                meterWorkCarActualFirstMapper.updateByPrimaryKey(mwcaf1);
+                //皮重
+                MeterWorkCarActualFirst mwcaf2 = meterWorkCarActualFirstMapper.selectByPrimaryKey(model.getActualFirst2No());
+                MeterBaseTermTareData mbttd = meterBaseTermTareDataMapper.selectByPrimaryKey(model.getActualFirst2No());
+                if (mwcaf2 == null && mbttd == null) {
+                    throw new MarkerMetException(500, "未查询到相应的皮重数据!!");
+                }
+                if (mwcaf2 != null) {
+                    if ("2".equals(mwcaf2.getWeightType())) {
+                        mwcaf2.setValueFlag(DbConstants.INVALID); //期限皮重置为作废
+                        mwcaf2.setUpdateManName("system");
+                        mwcaf2.setUpdateManName("二次计量解除作废");
+                        mwcaf2.setUpdateTime(new Date());
+                    } else {
+                        mwcaf2.setValueFlag(DbConstants.VALID);
+                        mwcaf2.setUpdateManName("system");
+                        mwcaf2.setUpdateManName("二次计量解除更新");
+                        mwcaf2.setNote(model.getNote());
+                        mwcaf2.setUpdateTime(new Date());
+                    }
+                    meterWorkCarActualFirstMapper.updateByPrimaryKey(mwcaf2);
+                }
+                meterWorkCarActualMapper.deleteByPrimaryKey(model.getActualNo());
+                //model.setUploadFlag("1");
+                //model.setValueFlag("0");
+                //meterWorkCarActualMapper.updateByPrimaryKey(model);
+                num++;
+            }
+            return num;
+        } catch (MarkerMetException e) {
+            throw e;
+        }
+    }
+
     @Override
     public RESTfulResult specialRemove(HashMap params) {
         RESTfulResult rm = new RESTfulResult();
@@ -539,8 +592,7 @@ public class MeterWorkCarActualServiceImpl extends BaseServiceImpl<MeterWorkCarA
                         // 删一次
                         MeterWorkCarActualFirst firstGross = meterWorkCarActualFirstMapper.selectByPrimaryKey(model.getActualFirst1No());
                         MeterWorkCarActualFirst firstTare = meterWorkCarActualFirstMapper.selectByPrimaryKey(model.getActualFirst2No());
-                        boolean flag = firstGross.getPredictionNo().equals(model.getPredictionNo());
-                        if(flag){
+                        if(firstGross.getPredictionNo().equals(model.getPredictionNo())){
                             meterWorkCarActualFirstMapper.deleteByPrimaryKey(model.getActualFirst1No());
                         }
                         if(firstTare.getPredictionNo().equals(model.getPredictionNo())){
@@ -601,14 +653,170 @@ public class MeterWorkCarActualServiceImpl extends BaseServiceImpl<MeterWorkCarA
                         rm.setMessage("选中的计量数据当中有一条或多条不是混卸委托洁净数据,请确认!!");
                     }
                 }
+                for (MeterWorkCarActual model: models) {
+                    //循环每一个洁净记录
+                    //判断委托是否为双委托组合的第二个委托,是:删除一次数据和洁净记录、否:修改一次记录、
+                    String combination = model.getPredictionCombination();
+                    String[] param = combination.split(",");
+
+                    if(model.getPredictionNo().equals(param[1])){
+                        // 改委托
+                        if (StringUtils.isNotEmpty(model.getPredictionNo())) {
+                            PreTrackScale scale = preTrackScaleMapper.selectByPrimaryKey(model.getPredictionNo());
+                            scale.setValueFlag("1");
+                            scale.setUploadFlag("1");
+                            scale.setUpdateTime(new Date());
+                            scale.setUpdateManNo("system");
+                            scale.setUpdateManName("混卸解除操作");
+                            preTrackScaleMapper.updateByPrimaryKeySelective(scale);
+                        }
+                        // 删一次毛重、清空一次皮重委托信息
+                        MeterWorkCarActualFirst firstTare = meterWorkCarActualFirstMapper.selectByPrimaryKey(model.getActualFirst2No());
+                        MeterWorkCarActualFirst firstGross = meterWorkCarActualFirstMapper.selectAndRemove(model.getActualFirst1No());
+                        if(firstTare.getPredictionNo().equals(model.getPredictionNo())){
+                            meterWorkCarActualFirstMapper.deleteByPrimaryKey(model.getActualFirst2No());
+                        }
+                        if(firstGross != null){
+                            firstGross.setValueFlag(DbConstants.VALID);
+                            firstGross.setUpdateManName("system");
+                            firstGross.setUpdateManName("混卸解除更新");
+                            firstGross.setNote(model.getNote());
+                            firstGross.setUpdateTime(new Date());
+                            firstGross.setIsPreScale("0");
+                            meterWorkCarActualFirstMapper.updateByPrimaryKey(firstGross);
+                        }
+                        // 删洁净
+                        meterWorkCarActualMapper.deleteByPrimaryKey(model.getActualNo());
+                    }
+                    else {
+                        // 清空毛重数据中的委托信息
+                        MeterWorkCarActualFirst mwcafg = meterWorkCarActualFirstMapper.selectAndRemove(model.getActualFirst1No());
+                        if (mwcafg == null) {
+                            rm.setMessage("未查询到相应的毛重数据!!");
+                            return rm;
+                        }
+                        mwcafg.setValueFlag(DbConstants.VALID);
+                        mwcafg.setNote(model.getNote());
+                        mwcafg.setUpdateManName("system");
+                        mwcafg.setUpdateManName("混卸解除更新");
+                        mwcafg.setUpdateTime(new Date());
+                        mwcafg.setIsPreScale("0");
+                        meterWorkCarActualFirstMapper.updateByPrimaryKey(mwcafg);
+                        //皮重
+                        MeterWorkCarActualFirst mwcaft = meterWorkCarActualFirstMapper.selectAndRemove(model.getActualFirst2No());
+                        if (mwcaft == null) {
+                            rm.setMessage("未查询到相应的皮重数据!!");
+                            return rm;
+                        }
+                        mwcaft.setValueFlag(DbConstants.VALID);
+                        mwcaft.setUpdateManName("system");
+                        mwcaft.setUpdateManName("混卸解除更新");
+                        mwcaft.setNote(model.getNote());
+                        mwcaft.setUpdateTime(new Date());
+                        mwcaft.setIsPreScale("0");
+                        meterWorkCarActualFirstMapper.updateByPrimaryKey(mwcaft);
+                        //修改预报
+                        if (StringUtils.isNotEmpty(model.getPredictionNo())) {
+                            PreTrackScale scale = preTrackScaleMapper.selectByPrimaryKey(model.getPredictionNo());
+                            scale.setValueFlag("1");
+                            scale.setUploadFlag("1");
+                            scale.setUpdateTime(new Date());
+                            scale.setUpdateManNo("system");
+                            scale.setUpdateManName("混卸解除操作");
+                            preTrackScaleMapper.updateByPrimaryKeySelective(scale);
+                        }
+                        meterWorkCarActualMapper.deleteByPrimaryKey(model.getActualNo());
+                    }
+                }
+                rm.setSucceed();
+                rm.setMessage("操作成功!!");
+                rm.setCode("200");
             }
             break;
-            case "7": {         //类型为混卸类型
+            case "7": {         //类型为混类型
                 for (MeterWorkCarActual model: models) {
                     if(!model.getPredictionType().equals("7")) {
                         rm.setMessage("选中的计量数据当中有一条或多条不是混装委托洁净数据,请确认!!");
                     }
                 }
+                for (MeterWorkCarActual model: models) {
+                    //循环每一个洁净记录
+                    //判断委托是否为双委托组合的第二个委托,是:删除一次数据和洁净记录、否:修改一次记录、
+                    String combination = model.getPredictionCombination();
+                    String[] param = combination.split(",");
+
+                    if(model.getPredictionNo().equals(param[1])){
+                        // 改委托
+                        if (StringUtils.isNotEmpty(model.getPredictionNo())) {
+                            PreTrackScale scale = preTrackScaleMapper.selectByPrimaryKey(model.getPredictionNo());
+                            scale.setValueFlag("1");
+                            scale.setUploadFlag("1");
+                            scale.setUpdateTime(new Date());
+                            scale.setUpdateManNo("system");
+                            scale.setUpdateManName("混装解除操作");
+                            preTrackScaleMapper.updateByPrimaryKeySelective(scale);
+                        }
+                        // 删一次毛重、清空一次皮重委托信息
+                        MeterWorkCarActualFirst firstGross = meterWorkCarActualFirstMapper.selectByPrimaryKey(model.getActualFirst1No());
+                        MeterWorkCarActualFirst firstTare = meterWorkCarActualFirstMapper.selectAndRemove(model.getActualFirst2No());
+                        if(firstGross.getPredictionNo().equals(model.getPredictionNo())){
+                            meterWorkCarActualFirstMapper.deleteByPrimaryKey(model.getActualFirst1No());
+                        }
+                        if(firstTare != null){
+                            firstTare.setValueFlag(DbConstants.VALID);
+                            firstTare.setUpdateManName("system");
+                            firstTare.setUpdateManName("混装解除更新");
+                            firstTare.setNote(model.getNote());
+                            firstTare.setUpdateTime(new Date());
+                            firstTare.setIsPreScale("0");
+                            meterWorkCarActualFirstMapper.updateByPrimaryKey(firstTare);
+                        }
+                        // 删洁净
+                        meterWorkCarActualMapper.deleteByPrimaryKey(model.getActualNo());
+                    }
+                    else {
+                        // 清空毛重数据中的委托信息
+                        MeterWorkCarActualFirst mwcafg = meterWorkCarActualFirstMapper.selectAndRemove(model.getActualFirst1No());
+                        if (mwcafg == null) {
+                            rm.setMessage("未查询到相应的毛重数据!!");
+                            return rm;
+                        }
+                        mwcafg.setValueFlag(DbConstants.VALID);
+                        mwcafg.setNote(model.getNote());
+                        mwcafg.setUpdateManName("system");
+                        mwcafg.setUpdateManName("混装解除更新");
+                        mwcafg.setUpdateTime(new Date());
+                        mwcafg.setIsPreScale("0");
+                        meterWorkCarActualFirstMapper.updateByPrimaryKey(mwcafg);
+                        //皮重
+                        MeterWorkCarActualFirst mwcaft = meterWorkCarActualFirstMapper.selectAndRemove(model.getActualFirst2No());
+                        if (mwcaft == null) {
+                            rm.setMessage("未查询到相应的皮重数据!!");
+                            return rm;
+                        }
+                        mwcaft.setValueFlag(DbConstants.VALID);
+                        mwcaft.setUpdateManName("system");
+                        mwcaft.setUpdateManName("混装解除更新");
+                        mwcaft.setNote(model.getNote());
+                        mwcaft.setUpdateTime(new Date());
+                        mwcaft.setIsPreScale("0");
+                        meterWorkCarActualFirstMapper.updateByPrimaryKey(mwcaft);
+                        //修改预报
+                        if (StringUtils.isNotEmpty(model.getPredictionNo())) {
+                            PreTrackScale scale = preTrackScaleMapper.selectByPrimaryKey(model.getPredictionNo());
+                            scale.setValueFlag("1");
+                            scale.setUploadFlag("1");
+                            scale.setUpdateTime(new Date());
+                            scale.setUpdateManNo("system");
+                            scale.setUpdateManName("混装解除操作");
+                            preTrackScaleMapper.updateByPrimaryKeySelective(scale);
+                        }
+                        meterWorkCarActualMapper.deleteByPrimaryKey(model.getActualNo());
+                    }
+                }
+                rm.setSucceed();
+                rm.setMessage("操作成功!!");
+                rm.setCode("200");
             }
             break;
         }

+ 17 - 0
src/main/java/com/steerinfo/meterwork/meterworkcaractualfirst/controller/MeterWorkCarActualFirstController.java

@@ -99,6 +99,23 @@ public class MeterWorkCarActualFirstController extends BaseRESTfulController {
         }
     }
 
+    @ApiOperation(value = "获取列表", notes = "分页模糊查询")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer")
+    })
+    //@RequiresPermissions("meterworkcaractualfirst:view")
+    @PostMapping(value = "/likeByValueFlag/")
+    public RESTfulResult likeByValueFlag(@RequestBody HashMap parmas, Integer pageNum, Integer pageSize) {
+        try {
+            PageList<MeterWorkCarActualFirst> list = meterWorkCarActualFirstService.likeByValueFlag(parmas, pageNum, pageSize);
+            return success(list);
+        } catch (Exception ex) {
+            ex.printStackTrace();
+            throw new MarkerMetException(500, "操作异常!!");
+        }
+    }
+
 
     @ApiOperation(value = "创建", notes = "根据MeterWorkCarActualFirst对象创建")
     @ApiImplicitParam(name = "meterWorkCarActualFirst", value = "详细实体meterWorkCarActualFirst", required = true, dataType = "MeterWorkCarActualFirst")

+ 2 - 0
src/main/java/com/steerinfo/meterwork/meterworkcaractualfirst/mapper/MeterWorkCarActualFirstMapper.java

@@ -72,4 +72,6 @@ public interface MeterWorkCarActualFirstMapper extends IBaseMapper<MeterWorkCarA
     List<MeterWorkCarActualFirst> distinctCarNo(HashMap<String, Object> obj);
 
     void repairPre(Map<String, Object> map);
+
+    List<MeterWorkCarActualFirst> likeByValueFlag(Map<String, Object> params);
 }

+ 5 - 0
src/main/java/com/steerinfo/meterwork/meterworkcaractualfirst/mapper/MeterWorkCarActualFirstMapper.xml

@@ -1954,6 +1954,11 @@
     <include refid="select"/>
     <include refid="whereLike"/>
   </select>
+  <select id="likeByValueFlag" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    <include refid="select"/>
+    <include refid="whereLike"/>
+    and value_flag != '0'
+  </select>
   <insert id="batchInsert" parameterType="java.util.List">
     insert into METER_WORK_CAR_ACTUAL_FIRST 
       (ACTUAL_FIRST_NO, 

+ 2 - 0
src/main/java/com/steerinfo/meterwork/meterworkcaractualfirst/service/IMeterWorkCarActualFirstService.java

@@ -120,4 +120,6 @@ public interface IMeterWorkCarActualFirstService extends IBaseService<MeterWorkC
     RESTfulResult doubleEntrustmentMatch(String actualNo1, String actualNo2, String predictionNo1, String predictionNo2);
 
     RESTfulResult addEmergency(List<MeterWorkCarActualFirst> meterWorkCarActualFirsts)  throws Exception;
+
+    PageList<MeterWorkCarActualFirst> likeByValueFlag(Map<String, Object> var1, Integer pageNum, Integer pageSize);
 }

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

@@ -192,7 +192,9 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
 
             //当存储一次数据或者结净时,将本车辆的预处理重量改为已使用
             updatePreWeight(model.getCarNo());
-            model.setValueFlag("1");
+            if(StringUtils.isEmpty(model.getValueFlag())){
+                model.setValueFlag("1");
+            }
             if(StringUtils.isNotEmpty(model.getPredictionNo())){
                 model.setIsPreScale("1");
             }
@@ -2642,35 +2644,32 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
             MeterWorkCarActualFirst mwcaf2 = meterWorkCarActualFirstMapper.selectByPrimaryKey(actualNo2);
             MeterWorkCarActualFirst mwcaf3 = meterWorkCarActualFirstMapper.selectByPrimaryKey(actualNo2);
             MeterWorkCarActualFirst mwcaf4 = meterWorkCarActualFirstMapper.selectByPrimaryKey(actualNo3);
-
             //查询所有的委托数据
             PreTrackScale pts1 = preTrackScaleMapper.selectByPrimaryKey(predictionNo1);
             PreTrackScale pts2 = preTrackScaleMapper.selectByPrimaryKey(predictionNo2);
-
             //定义新的结净数据实体
             MeterWorkCarActual actualRow1 = new MeterWorkCarActual();
             MeterWorkCarActual actualRow2 = new MeterWorkCarActual();
 
             //判断是否为混装逻辑
-            if(mwcaf1.getMeterWeight().compareTo(mwcaf2.getMeterWeight()) == 1 || mwcaf1.getMeterWeight().compareTo(mwcaf4.getMeterWeight()) == 1 || mwcaf2.getMeterWeight().compareTo(mwcaf4.getMeterWeight()) == 1){
+            if(mwcaf1.getMeterWeight().compareTo(mwcaf2.getMeterWeight()) == 1 ||
+                    mwcaf1.getMeterWeight().compareTo(mwcaf4.getMeterWeight()) == 1 ||
+                    mwcaf2.getMeterWeight().compareTo(mwcaf4.getMeterWeight()) == 1){
                 return "不为混装逻辑!!";
             }
-
             //判断一次数据是否存在
             if (mwcaf1 == null || mwcaf2 == null || mwcaf3 == null || mwcaf4 == null) {
                 return "未查询到相应的一次数据!!";
             }
-
             //判断一次数据是否已结净
-            if (mwcaf1.getValueFlag().equals("2") || mwcaf2.getValueFlag().equals("2") || mwcaf3.getValueFlag().equals("2") || mwcaf4.getValueFlag().equals("2")) {
+            if (mwcaf1.getValueFlag().equals("2") || mwcaf2.getValueFlag().equals("2") ||
+                    mwcaf3.getValueFlag().equals("2") || mwcaf4.getValueFlag().equals("2")) {
                 return "存在已结净的一次数据!!";
             }
-
             //判断委托数据是否存在
             if (pts1 == null || pts2 == null) {
                 return "未查询到相应的委托数据!!";
             }
-
             //判断委托数据是否已使用
             if (!pts1.getValueFlag().equals("1") || !pts1.getValueFlag().equals("1")) {
                 return "委托不是未使用状态!!";
@@ -2685,20 +2684,15 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
             BeanUtils.copyProperties(first3,mwcaf3);
             MeterWorkCarActualFirst first4 = meterWorkCarActualFirstMapper.selectAndMatch(actualNo3, predictionNo2);
             BeanUtils.copyProperties(first4, mwcaf4);
-
-            //将委托中的编号和收发货单位和一次数据等数据拷贝进结净数据中
-            MeterWorkCarActual mwca1 = meterWorkCarActualMapper.manualAddPre(actualNo2, actualNo1, predictionNo1);
-            BeanUtils.copyProperties(mwca1, actualRow1);
-            MeterWorkCarActual mwca2 = meterWorkCarActualMapper.manualAddPre(actualNo3, actualNo2, predictionNo2);
-            BeanUtils.copyProperties(mwca2,actualRow2);
-
             //更新预报数据
             PreTrackScale scale = new PreTrackScale();
             scale.setPredictionNo(predictionNo1);
             scale.setValueFlag(DbConstants.NET);
             scale.setUpdateTime(new Date());
             scale.setUpdateManNo("system");
-            scale.setUpdateManName("二次计量洁净更新");
+            scale.setUpdateManName("混装洁净更新");
+            scale.setPredictionType("7");
+            scale.setPredictionCombination(predictionNo1 + "," + predictionNo2);
             scale.setUploadFlag("1");
             preTrackScaleMapper.updateByPrimaryKeySelective(scale);
 
@@ -2707,7 +2701,9 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
             scale1.setValueFlag(DbConstants.NET);
             scale1.setUpdateTime(new Date());
             scale1.setUpdateManNo("system");
-            scale1.setUpdateManName("二次计量洁净更新");
+            scale1.setUpdateManName("混装洁净更新");
+            scale1.setPredictionType("7");
+            scale1.setPredictionCombination(predictionNo1 + "," + predictionNo2);
             scale1.setUploadFlag("1");
             preTrackScaleMapper.updateByPrimaryKeySelective(scale1);
 
@@ -2715,16 +2711,22 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
             //更新第一次皮重数据
             mwcaf1.setValueFlag(DbConstants.NET);
             mwcaf1.setUpdateManName("system");
-            mwcaf1.setUpdateManName("二次计量洁净更新");
+            mwcaf1.setUpdateManName("混装洁净更新");
             mwcaf1.setUpdateTime(new Date());
             mwcaf1.setIsPreScale("1");
+            mwcaf1.setPredictionNo(predictionNo1);
+            mwcaf1.setPredictionType("7");
+            mwcaf1.setPredictionCombination(predictionNo1 + "," + predictionNo2);
             meterWorkCarActualFirstMapper.updateByPrimaryKey(mwcaf1);
             //更新第一次毛重数据
             mwcaf2.setValueFlag(DbConstants.NET);
             mwcaf2.setUpdateManName("system");
-            mwcaf2.setUpdateManName("二次计量洁净更新");
+            mwcaf2.setUpdateManName("混装洁净更新");
             mwcaf2.setUpdateTime(new Date());
             mwcaf2.setIsPreScale("1");
+            mwcaf2.setPredictionNo(predictionNo1);
+            mwcaf2.setPredictionType("7");
+            mwcaf2.setPredictionCombination(predictionNo1 + "," + predictionNo2);
             meterWorkCarActualFirstMapper.updateByPrimaryKey(mwcaf2);
             //添加第二次皮重数据
             SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
@@ -2733,29 +2735,43 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
             mwcaf3.setActualFirstNo(actualFirstNo);
             mwcaf3.setValueFlag(DbConstants.NET);
             mwcaf3.setUpdateManName("system");
-            mwcaf3.setUpdateManName("二次计量洁净更新");
+            mwcaf3.setUpdateManName("混装洁净更新");
             mwcaf3.setUpdateTime(new Date());
             mwcaf3.setIsPreScale("1");
+            mwcaf3.setPredictionNo(predictionNo2);
+            mwcaf3.setPredictionType("7");
+            mwcaf3.setPredictionCombination(predictionNo1 + "," + predictionNo2);
             meterWorkCarActualFirstMapper.insertSelective(mwcaf3);
             //更新第二次毛重数据
             mwcaf4.setValueFlag(DbConstants.NET);
             mwcaf4.setUpdateManName("system");
-            mwcaf4.setUpdateManName("二次计量洁净更新");
+            mwcaf4.setUpdateManName("混装洁净更新");
             mwcaf4.setUpdateTime(new Date());
             mwcaf4.setIsPreScale("1");
+            mwcaf4.setPredictionNo(predictionNo2);
+            mwcaf4.setPredictionType("7");
+            mwcaf4.setPredictionCombination(predictionNo1 + "," + predictionNo2);
             meterWorkCarActualFirstMapper.updateByPrimaryKey(mwcaf4);
+            //将委托中的编号和收发货单位和一次数据等数据拷贝进结净数据中
+            MeterWorkCarActual mwca1 = meterWorkCarActualMapper.manualAddPre(actualNo2, actualNo1, predictionNo1);
+            BeanUtils.copyProperties(mwca1, actualRow1);
+            MeterWorkCarActual mwca2 = meterWorkCarActualMapper.manualAddPre(actualNo3, actualFirstNo, predictionNo2);
+            BeanUtils.copyProperties(mwca2,actualRow2);
 
             //添加结净数据
             String no = meterWorkCarActualMapper.getNewID(sdf.format(new Date()));
             actualRow1.setActualNo(sdf.format(new Date()) + no);
             actualRow1.setNetTime(new Date());
             actualRow1.setNetMode(DbConstants.TYPE);
-            actualRow1.setNote("混装结净");
+            actualRow1.setNote("混装匹配结净");
             actualRow1.setUploadFlag("1");
             actualRow1.setIsPreScale("1");
-            actualRow1.setValueFlag("2");
+            actualRow1.setValueFlag("1");
             actualRow1.setCreateTime(new Date());
-            actualRow1.setCreateManName("洁净");
+            actualRow1.setCreateManName("混装匹配结净");
+            actualRow1.setPredictionType("7");
+            actualRow1.setPredictionCombination(predictionNo1 + "," + predictionNo2);
+            actualRow1.setPredictionNo(predictionNo2);
             actualRow1.setNetWeight(mwcaf2.getMeterWeight().subtract(mwcaf1.getMeterWeight()));
             meterWorkCarActualMapper.insertSelective(actualRow1);
 
@@ -2763,12 +2779,15 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
             actualRow2.setActualNo(sdf.format(new Date()) + no1);
             actualRow2.setNetTime(new Date());
             actualRow2.setNetMode(DbConstants.TYPE);
-            actualRow2.setNote("混装结净");
+            actualRow2.setNote("混装匹配结净");
             actualRow2.setUploadFlag("1");
             actualRow2.setIsPreScale("1");
-            actualRow2.setValueFlag("2");
+            actualRow2.setValueFlag("1");
             actualRow2.setCreateTime(new Date());
-            actualRow2.setCreateManName("洁净");
+            actualRow2.setCreateManName("混装匹配结净");
+            actualRow2.setPredictionType("7");
+            actualRow2.setPredictionCombination(predictionNo1 + "," + predictionNo2);
+            actualRow2.setPredictionNo(predictionNo2);
             actualRow2.setNetWeight(mwcaf4.getMeterWeight().subtract(mwcaf3.getMeterWeight()));
             meterWorkCarActualMapper.insertSelective(actualRow2);
         }
@@ -2825,11 +2844,6 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
             BeanUtils.copyProperties(first3,mwcaf3);
             MeterWorkCarActualFirst first4 = meterWorkCarActualFirstMapper.selectAndMatch(actualNo3, predictionNo2);
             BeanUtils.copyProperties(first4, mwcaf4);
-            //将委托中的编号和收发货单位和一次数据等数据拷贝进结净数据中
-            MeterWorkCarActual mwca1 = meterWorkCarActualMapper.manualAddPre(actualNo1, actualNo2, predictionNo1);
-            BeanUtils.copyProperties(mwca1, actualRow1);
-            MeterWorkCarActual mwca2 = meterWorkCarActualMapper.manualAddPre(actualNo2, actualNo3, predictionNo2);
-            BeanUtils.copyProperties(mwca2,actualRow2);
 
             //更新预报数据
             PreTrackScale scale = new PreTrackScale();
@@ -2837,11 +2851,11 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
             scale.setValueFlag(DbConstants.NET);
             scale.setUpdateTime(new Date());
             scale.setUpdateManNo("system");
-            scale.setUpdateManName("二次计量洁净更新");
+            scale.setUpdateManName("混卸洁净更新");
             scale.setUploadFlag("1");
             scale.setValueFlag("2");
             //预报类型:双委托(5)、预报组合:A预报,B预报
-            scale.setPredictionType("7");
+            scale.setPredictionType("6");
             scale.setPredictionCombination(predictionNo1 + "," + predictionNo2);
             preTrackScaleMapper.updateByPrimaryKeySelective(scale);
 
@@ -2850,10 +2864,10 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
             scale1.setValueFlag(DbConstants.NET);
             scale1.setUpdateTime(new Date());
             scale1.setUpdateManNo("system");
-            scale1.setUpdateManName("二次计量洁净更新");
+            scale1.setUpdateManName("混卸洁净更新");
             scale1.setUploadFlag("1");
             scale1.setValueFlag("2");
-            scale1.setPredictionType("7");
+            scale1.setPredictionType("6");
             scale1.setPredictionCombination(predictionNo1 + "," + predictionNo2);
             preTrackScaleMapper.updateByPrimaryKeySelective(scale1);
 
@@ -2861,19 +2875,21 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
             //更新第一次毛重数据
             mwcaf1.setValueFlag(DbConstants.NET);
             mwcaf1.setUpdateManNo("system");
-            mwcaf1.setUpdateManName("二次计量洁净更新");
+            mwcaf1.setUpdateManName("混卸洁净更新");
             mwcaf1.setUpdateTime(new Date());
             mwcaf1.setIsPreScale("1");
-            mwcaf1.setPredictionType("7");
+            mwcaf1.setPredictionNo(predictionNo1);
+            mwcaf1.setPredictionType("6");
             mwcaf1.setPredictionCombination(predictionNo1 + "," + predictionNo2);
             meterWorkCarActualFirstMapper.updateByPrimaryKey(mwcaf1);
             //更新第一次皮重数据
             mwcaf2.setValueFlag(DbConstants.NET);
             mwcaf2.setUpdateManNo("system");
-            mwcaf2.setUpdateManName("二次计量洁净更新");
+            mwcaf2.setUpdateManName("混卸洁净更新");
             mwcaf2.setUpdateTime(new Date());
             mwcaf2.setIsPreScale("1");
-            mwcaf2.setPredictionType("7");
+            mwcaf2.setPredictionNo(predictionNo1);
+            mwcaf2.setPredictionType("6");
             mwcaf2.setPredictionCombination(predictionNo1 + "," + predictionNo2);
             meterWorkCarActualFirstMapper.updateByPrimaryKey(mwcaf2);
             //添加第二次毛重数据
@@ -2883,34 +2899,41 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
             mwcaf3.setActualFirstNo(actualFirstNo);
             mwcaf3.setValueFlag(DbConstants.NET);
             mwcaf3.setUpdateManNo("system");
-            mwcaf3.setUpdateManName("二次计量洁净更新");
+            mwcaf3.setUpdateManName("混卸洁净更新");
             mwcaf3.setUpdateTime(new Date());
             mwcaf3.setIsPreScale("1");
-            mwcaf3.setPredictionType("7");
+            mwcaf3.setPredictionNo(predictionNo2);
+            mwcaf3.setPredictionType("6");
             mwcaf3.setPredictionCombination(predictionNo1 + "," + predictionNo2);
             meterWorkCarActualFirstMapper.insertSelective(mwcaf3);
             //更新第二次皮重数据
             mwcaf4.setValueFlag(DbConstants.NET);
             mwcaf4.setUpdateManNo("system");
-            mwcaf4.setUpdateManName("二次计量洁净更新");
+            mwcaf4.setUpdateManName("混卸洁净更新");
             mwcaf4.setUpdateTime(new Date());
             mwcaf4.setIsPreScale("1");
-            mwcaf4.setPredictionType("7");
+            mwcaf4.setPredictionNo(predictionNo2);
+            mwcaf4.setPredictionType("6");
             mwcaf4.setPredictionCombination(predictionNo1 + "," + predictionNo2);
             meterWorkCarActualFirstMapper.updateByPrimaryKey(mwcaf4);
+            //将委托中的编号和收发货单位和一次数据等数据拷贝进结净数据中
+            MeterWorkCarActual mwca1 = meterWorkCarActualMapper.manualAddPre(actualNo1, actualNo2, predictionNo1);
+            BeanUtils.copyProperties(mwca1, actualRow1);
+            MeterWorkCarActual mwca2 = meterWorkCarActualMapper.manualAddPre(actualFirstNo, actualNo3, predictionNo2);
+            BeanUtils.copyProperties(mwca2,actualRow2);
 
             //添加结净数据
             String no = meterWorkCarActualMapper.getNewID(sdf.format(new Date()));
             actualRow1.setActualNo(sdf.format(new Date()) + no);
             actualRow1.setNetTime(new Date());
             actualRow1.setNetMode(DbConstants.TYPE);
-            actualRow1.setNote("混结净");
+            actualRow1.setNote("混卸匹配结净");
             actualRow1.setUploadFlag("1");
             actualRow1.setIsPreScale("1");
-            actualRow1.setValueFlag("2");
-            actualRow1.setCreateManName("净");
+            actualRow1.setValueFlag("1");
+            actualRow1.setCreateManName("混卸匹配结净");
             actualRow1.setCreateTime(new Date());
-            actualRow1.setPredictionNo("7");
+            actualRow1.setPredictionType("6");
             actualRow1.setPredictionCombination(predictionNo1 + "," + predictionNo2);
             actualRow1.setPredictionNo(predictionNo1);
             actualRow1.setNetWeight(mwcaf1.getMeterWeight().subtract(mwcaf2.getMeterWeight()));
@@ -2920,13 +2943,13 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
             actualRow2.setActualNo(sdf.format(new Date()) + no1);
             actualRow2.setNetTime(new Date());
             actualRow2.setNetMode(DbConstants.TYPE);
-            actualRow2.setNote("混结净");
+            actualRow2.setNote("混卸匹配结净");
             actualRow2.setUploadFlag("1");
             actualRow2.setIsPreScale("1");
-            actualRow2.setValueFlag("2");
-            actualRow2.setCreateManName("净");
+            actualRow2.setValueFlag("1");
+            actualRow2.setCreateManName("混卸匹配结净");
             actualRow2.setCreateTime(new Date());
-            actualRow2.setPredictionNo("7");
+            actualRow2.setPredictionType("6");
             actualRow2.setPredictionCombination(predictionNo1 + "," + predictionNo2);
             actualRow2.setPredictionNo(predictionNo2);
             actualRow2.setNetWeight(mwcaf3.getMeterWeight().subtract(mwcaf4.getMeterWeight()));
@@ -3428,13 +3451,21 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
         }
     }
 
+    @Override
+    public PageList<MeterWorkCarActualFirst> likeByValueFlag(Map<String, Object> params, Integer pageNum, Integer pageSize) {
+        PageHelper.startPage(pageNum, pageSize);
+        List<MeterWorkCarActualFirst> rows = meterWorkCarActualFirstMapper.likeByValueFlag(params);
+        PageList pageInfo = new PageList(rows);
+        return pageInfo;
+    }
+
     @Override
     @Transactional(value = "tm", rollbackFor = Exception.class)
     public RESTfulResult doNetAddMuch(MeterWorkCarActualFirst actualFirst) throws Exception {
-        try {
-            RESTfulResult rm = new RESTfulResult();
-            rm.setCode("200");
+        RESTfulResult rm = new RESTfulResult();
+        rm.setCode("200");
 
+        try {
             HashMap map = new HashMap();
             map.put("valueFlag","1");
             map.put("carNo",actualFirst.getCarNo());
@@ -3446,14 +3477,15 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
                 String afl = formatter.format(new Date());
                 String no = meterWorkCarActualFirstMapper.getNewID(afl);
                 actualFirst.setActualFirstNo(formatter.format(new Date()) + no);
-                actualFirst.setValueFlag("2");//洁净
-                meterWorkCarActualFirstMapper.insertSelective(actualFirst);
+                actualFirst.setValueFlag("2");//洁净
+                int i = meterWorkCarActualFirstMapper.insertSelective(actualFirst);
 
                 //将毛重委托匹配到皮重中
                 MeterWorkCarActualFirst meterWorkCarActualFirst = meterWorkCarActualFirstMapper.selectAndMatch(actualFirst.getActualFirstNo(), model.getPredictionNo());
-                meterWorkCarActualFirst.setIsPreScale("1s");
+                meterWorkCarActualFirst.setIsPreScale("1");
                 meterWorkCarActualFirstMapper.updateByPrimaryKeySelective(meterWorkCarActualFirst);
 
+
                 //修改毛重数据状态为结净
                 model.setValueFlag("2");
                 meterWorkCarActualFirstMapper.updateByPrimaryKeySelective(model);
@@ -3480,7 +3512,6 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
                 preTrackScaleMapper.updateByPrimaryKeySelective(preTrackScale);
                 num++;
             }
-
             //当存储一次数据或者结净时,将本车辆的预处理重量改为已使用
             updatePreWeight(actualFirst.getCarNo());
 
@@ -3489,7 +3520,6 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
             return rm;
         }
         catch (Exception e){
-            RESTfulResult rm = new RESTfulResult();
             rm.setCode("500");
             rm.setData(null);
             rm.setMessage(e.getMessage());

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

@@ -502,7 +502,7 @@ public class MeterWorkRailwayActFirstServiceImpl extends BaseServiceImpl<MeterWo
             }
             //洁净数据不能小于400
             if(num01.compareTo(BigDecimal.valueOf(400)) == -1){
-                return "选择的两条一次计量数据不能小于400!!";
+                return "选择的两条一次计量数据不能小于400kg!!";
             }
             if(pts01.getValueFlag().equals("2") || pts02.getValueFlag().equals("2")){
                 return "委托信息已使用!!";