|
|
@@ -2845,6 +2845,10 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
|
|
|
scale.setUpdateManNo("system");
|
|
|
scale.setUpdateManName("二次计量洁净更新");
|
|
|
scale.setUploadFlag("1");
|
|
|
+ scale.setValueFlag("2");
|
|
|
+ //预报类型:双委托(5)、预报组合:A预报,B预报
|
|
|
+ scale.setPredictionType("7");
|
|
|
+ scale.setPredictionCombination(predictionNo1 + "," + predictionNo2);
|
|
|
preTrackScaleMapper.updateByPrimaryKeySelective(scale);
|
|
|
|
|
|
PreTrackScale scale1 = new PreTrackScale();
|
|
|
@@ -2854,6 +2858,9 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
|
|
|
scale1.setUpdateManNo("system");
|
|
|
scale1.setUpdateManName("二次计量洁净更新");
|
|
|
scale1.setUploadFlag("1");
|
|
|
+ scale1.setValueFlag("2");
|
|
|
+ scale1.setPredictionType("7");
|
|
|
+ scale1.setPredictionCombination(predictionNo1 + "," + predictionNo2);
|
|
|
preTrackScaleMapper.updateByPrimaryKeySelective(scale1);
|
|
|
|
|
|
//更新一次数据
|
|
|
@@ -2863,6 +2870,8 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
|
|
|
mwcaf1.setUpdateManName("二次计量洁净更新");
|
|
|
mwcaf1.setUpdateTime(new Date());
|
|
|
mwcaf1.setIsPreScale("1");
|
|
|
+ mwcaf1.setPredictionType("7");
|
|
|
+ mwcaf1.setPredictionCombination(predictionNo1 + "," + predictionNo2);
|
|
|
meterWorkCarActualFirstMapper.updateByPrimaryKey(mwcaf1);
|
|
|
//更新第一次皮重数据
|
|
|
mwcaf2.setValueFlag(DbConstants.NET);
|
|
|
@@ -2870,6 +2879,8 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
|
|
|
mwcaf2.setUpdateManName("二次计量洁净更新");
|
|
|
mwcaf2.setUpdateTime(new Date());
|
|
|
mwcaf2.setIsPreScale("1");
|
|
|
+ mwcaf2.setPredictionType("7");
|
|
|
+ mwcaf2.setPredictionCombination(predictionNo1 + "," + predictionNo2);
|
|
|
meterWorkCarActualFirstMapper.updateByPrimaryKey(mwcaf2);
|
|
|
//添加第二次毛重数据
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
|
|
|
@@ -2881,6 +2892,8 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
|
|
|
mwcaf3.setUpdateManName("二次计量洁净更新");
|
|
|
mwcaf3.setUpdateTime(new Date());
|
|
|
mwcaf3.setIsPreScale("1");
|
|
|
+ mwcaf3.setPredictionType("7");
|
|
|
+ mwcaf3.setPredictionCombination(predictionNo1 + "," + predictionNo2);
|
|
|
meterWorkCarActualFirstMapper.insertSelective(mwcaf3);
|
|
|
//更新第二次皮重数据
|
|
|
mwcaf4.setValueFlag(DbConstants.NET);
|
|
|
@@ -2888,6 +2901,8 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
|
|
|
mwcaf4.setUpdateManName("二次计量洁净更新");
|
|
|
mwcaf4.setUpdateTime(new Date());
|
|
|
mwcaf4.setIsPreScale("1");
|
|
|
+ mwcaf4.setPredictionType("7");
|
|
|
+ mwcaf4.setPredictionCombination(predictionNo1 + "," + predictionNo2);
|
|
|
meterWorkCarActualFirstMapper.updateByPrimaryKey(mwcaf4);
|
|
|
|
|
|
//添加结净数据
|
|
|
@@ -2901,6 +2916,9 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
|
|
|
actualRow1.setValueFlag("2");
|
|
|
actualRow1.setCreateManName("洁净");
|
|
|
actualRow1.setCreateTime(new Date());
|
|
|
+ actualRow1.setPredictionNo("7");
|
|
|
+ actualRow1.setPredictionCombination(predictionNo1 + "," + predictionNo2);
|
|
|
+ actualRow1.setPredictionNo(predictionNo1);
|
|
|
actualRow1.setNetWeight(mwcaf1.getMeterWeight().subtract(mwcaf2.getMeterWeight()));
|
|
|
meterWorkCarActualMapper.insertSelective(actualRow1);
|
|
|
|
|
|
@@ -2914,6 +2932,9 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
|
|
|
actualRow2.setValueFlag("2");
|
|
|
actualRow2.setCreateManName("洁净");
|
|
|
actualRow2.setCreateTime(new Date());
|
|
|
+ actualRow2.setPredictionNo("7");
|
|
|
+ actualRow2.setPredictionCombination(predictionNo1 + "," + predictionNo2);
|
|
|
+ actualRow2.setPredictionNo(predictionNo2);
|
|
|
actualRow2.setNetWeight(mwcaf3.getMeterWeight().subtract(mwcaf4.getMeterWeight()));
|
|
|
meterWorkCarActualMapper.insertSelective(actualRow2);
|
|
|
}
|
|
|
@@ -2925,7 +2946,10 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public String doubleEntrustmentMatch(String actualNo1, String actualNo2, String predictionNo1, String predictionNo2) {
|
|
|
+ public RESTfulResult doubleEntrustmentMatch(String actualNo1, String actualNo2, String predictionNo1, String predictionNo2) {
|
|
|
+ RESTfulResult rm = new RESTfulResult();
|
|
|
+ rm.setFailed();
|
|
|
+
|
|
|
try{
|
|
|
//查询出一次计量数据
|
|
|
MeterWorkCarActualFirst mwcaf01 = meterWorkCarActualFirstMapper.selectByPrimaryKey(actualNo1);
|
|
|
@@ -2943,33 +2967,44 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
|
|
|
|
|
|
BigDecimal num01 = mwcaf01.getMeterWeight().subtract(mwcaf03.getMeterWeight()).abs();
|
|
|
if(mwcaf01 == null || mwcaf03 == null ){
|
|
|
- return "一次计量数据为空,请确认!!";
|
|
|
+ rm.setMessage("一次计量数据为空,请确认!!");
|
|
|
+ return rm;
|
|
|
}
|
|
|
//判断毛重必须大于皮重
|
|
|
if(num01.compareTo(BigDecimal.valueOf(0)) == -1){
|
|
|
- return "第一个一次计量重量一定要大于第二条一次计量重量!!";
|
|
|
+ rm.setMessage("第一个一次计量重量一定要大于第二条一次计量重量!!");
|
|
|
+ return rm;
|
|
|
}
|
|
|
if(pts01 == null || pts02 == null){
|
|
|
- return "委托信息为空,请确认!!";
|
|
|
+ rm.setMessage("委托信息为空,请确认!!");
|
|
|
+ return rm;
|
|
|
+ }
|
|
|
+ if(!pts01.getPredictionType().equals("5") || !pts02.getPredictionType().equals("5")){
|
|
|
+ rm.setMessage("委托信息不是双委托,请确认");
|
|
|
+ return rm;
|
|
|
}
|
|
|
if(!mwcaf01.getCarNo().equals(mwcaf03.getCarNo())){
|
|
|
- return "车号不一致,不能匹配洁净!!";
|
|
|
+ rm.setMessage("车号不一致,不能匹配洁净!!");
|
|
|
+ return rm;
|
|
|
}
|
|
|
//洁净数据不能小于400
|
|
|
if(num01.compareTo(BigDecimal.valueOf(400)) == -1){
|
|
|
- return "选择的两条一次计量数据不能小于400!!";
|
|
|
+ rm.setMessage("选择的两条一次计量数据不能小于400!!");
|
|
|
+ return rm;
|
|
|
}
|
|
|
if(pts01.getValueFlag().equals("2") || pts02.getValueFlag().equals("2")){
|
|
|
- return "委托信息已使用!!";
|
|
|
+ rm.setMessage("委托信息已使用!!");
|
|
|
+ return rm;
|
|
|
}
|
|
|
|
|
|
if(pts01.getValueFlag().equals("3") || pts02.getValueFlag().equals("3")){
|
|
|
- return "委托信息已作废!!";
|
|
|
+ rm.setMessage("委托信息已作废!!");
|
|
|
+ return rm;
|
|
|
}
|
|
|
if(mwcaf01.getValueFlag().equals("2") || mwcaf03.getValueFlag().equals("2")){
|
|
|
- return "一次计量数据已洁净!!";
|
|
|
+ rm.setMessage("一次计量数据已洁净!!");
|
|
|
+ return rm;
|
|
|
}
|
|
|
-
|
|
|
//将委托中的编号和收发货的等数据拷贝进一次数据中
|
|
|
MeterWorkCarActualFirst first1 = meterWorkCarActualFirstMapper.selectAndMatch(actualNo1, predictionNo1);
|
|
|
BeanUtils.copyProperties(first1,mwcaf01);
|
|
|
@@ -2980,20 +3015,16 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
|
|
|
MeterWorkCarActualFirst first4 = meterWorkCarActualFirstMapper.selectAndMatch(actualNo2, predictionNo2);
|
|
|
BeanUtils.copyProperties(first4, mwcaf04);
|
|
|
|
|
|
- //将委托中的编号和收发货单位和一次数据等数据拷贝进结净数据中
|
|
|
- MeterWorkCarActual mwca1 = meterWorkCarActualMapper.manualAddPre(actualNo1, actualNo2, predictionNo1);
|
|
|
- BeanUtils.copyProperties(mwca1, actualRow1);
|
|
|
- MeterWorkCarActual mwca2 = meterWorkCarActualMapper.manualAddPre(actualNo1, 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.setUploadFlag("1");
|
|
|
+ scale.setPredictionType("5");
|
|
|
+ scale.setPredictionCombination(predictionNo1 + "," + predictionNo2);
|
|
|
preTrackScaleMapper.updateByPrimaryKeySelective(scale);
|
|
|
|
|
|
PreTrackScale scale1 = new PreTrackScale();
|
|
|
@@ -3001,24 +3032,32 @@ 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.setPredictionType("5");
|
|
|
+ scale1.setPredictionCombination(predictionNo1 + "," + predictionNo2);
|
|
|
preTrackScaleMapper.updateByPrimaryKeySelective(scale1);
|
|
|
|
|
|
//更新一次数据
|
|
|
//更新第一次毛重数据库
|
|
|
mwcaf01.setValueFlag(DbConstants.NET);
|
|
|
mwcaf01.setUpdateManName("system");
|
|
|
- mwcaf01.setUpdateManName("二次计量洁净更新");
|
|
|
+ mwcaf01.setUpdateManName("双委托洁净更新");
|
|
|
mwcaf01.setUpdateTime(new Date());
|
|
|
mwcaf01.setIsPreScale("1");
|
|
|
+ mwcaf01.setPredictionNo(predictionNo1);
|
|
|
+ mwcaf01.setPredictionType("5");
|
|
|
+ mwcaf01.setPredictionCombination(predictionNo1 + "," + predictionNo2);
|
|
|
meterWorkCarActualFirstMapper.updateByPrimaryKey(mwcaf01);
|
|
|
//更新第一次皮重数据库
|
|
|
mwcaf02.setValueFlag(DbConstants.NET);
|
|
|
mwcaf02.setUpdateManName("system");
|
|
|
- mwcaf02.setUpdateManName("二次计量洁净更新");
|
|
|
+ mwcaf02.setUpdateManName("双委托洁净更新");
|
|
|
mwcaf02.setUpdateTime(new Date());
|
|
|
mwcaf02.setIsPreScale("1");
|
|
|
+ mwcaf02.setPredictionNo(predictionNo1);
|
|
|
+ mwcaf02.setPredictionType("5");
|
|
|
+ mwcaf02.setPredictionCombination(predictionNo1 + "," + predictionNo2);
|
|
|
meterWorkCarActualFirstMapper.updateByPrimaryKey(mwcaf02);
|
|
|
//添加第一次毛重数据库
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
|
|
|
@@ -3027,9 +3066,12 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
|
|
|
mwcaf03.setActualFirstNo(actualFirstNo);
|
|
|
mwcaf03.setValueFlag(DbConstants.NET);
|
|
|
mwcaf03.setUpdateManName("system");
|
|
|
- mwcaf03.setUpdateManName("二次计量洁净更新");
|
|
|
+ mwcaf03.setUpdateManName("双委托洁净更新");
|
|
|
mwcaf03.setUpdateTime(new Date());
|
|
|
mwcaf03.setIsPreScale("1");
|
|
|
+ mwcaf03.setPredictionNo(predictionNo2);
|
|
|
+ mwcaf03.setPredictionType("5");
|
|
|
+ mwcaf03.setPredictionCombination(predictionNo1 + "," + predictionNo2);
|
|
|
meterWorkCarActualFirstMapper.insertSelective(mwcaf03);
|
|
|
//添加第二次皮重数据库
|
|
|
SimpleDateFormat sdf01 = new SimpleDateFormat("yyyyMMdd");
|
|
|
@@ -3038,11 +3080,20 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
|
|
|
mwcaf04.setActualFirstNo(actualSecondNo);
|
|
|
mwcaf04.setValueFlag(DbConstants.NET);
|
|
|
mwcaf04.setUpdateManName("system");
|
|
|
- mwcaf04.setUpdateManName("二次计量洁净更新");
|
|
|
+ mwcaf04.setUpdateManName("双委托洁净更新");
|
|
|
mwcaf04.setUpdateTime(new Date());
|
|
|
mwcaf04.setIsPreScale("1");
|
|
|
+ mwcaf04.setPredictionNo(predictionNo2);
|
|
|
+ mwcaf04.setPredictionType("5");
|
|
|
+ mwcaf04.setPredictionCombination(predictionNo1 + "," + predictionNo2);
|
|
|
meterWorkCarActualFirstMapper.insertSelective(mwcaf04);
|
|
|
|
|
|
+ //将委托中的编号和收发货单位和一次数据等数据拷贝进结净数据中
|
|
|
+ MeterWorkCarActual mwca1 = meterWorkCarActualMapper.manualAddPre(actualNo1, actualNo2, predictionNo1);
|
|
|
+ BeanUtils.copyProperties(mwca1, actualRow1);
|
|
|
+ MeterWorkCarActual mwca2 = meterWorkCarActualMapper.manualAddPre(actualFirstNo, actualSecondNo, predictionNo2);
|
|
|
+ BeanUtils.copyProperties(mwca2,actualRow2);
|
|
|
+
|
|
|
//添加结净数据
|
|
|
String no = meterWorkCarActualMapper.getNewID(sdf.format(new Date()));
|
|
|
actualRow1.setActualNo(sdf.format(new Date()) + no);
|
|
|
@@ -3051,6 +3102,10 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
|
|
|
actualRow1.setNote("双委托匹配洁净");
|
|
|
actualRow1.setUploadFlag("1");
|
|
|
actualRow1.setIsPreScale("1");
|
|
|
+ actualRow1.setValueFlag("1");
|
|
|
+ actualRow1.setPredictionNo(predictionNo1);
|
|
|
+ actualRow1.setPredictionType("5");
|
|
|
+ actualRow1.setPredictionCombination(predictionNo1 + "," + predictionNo2);
|
|
|
actualRow1.setNetWeight(mwcaf01.getMeterWeight().subtract(mwcaf02.getMeterWeight()));
|
|
|
meterWorkCarActualMapper.insertSelective(actualRow1);
|
|
|
|
|
|
@@ -3061,13 +3116,22 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
|
|
|
actualRow2.setNote("双委托匹配洁净");
|
|
|
actualRow2.setUploadFlag("1");
|
|
|
actualRow2.setIsPreScale("1");
|
|
|
+ actualRow2.setValueFlag("1");
|
|
|
+ actualRow2.setPredictionNo(predictionNo2);
|
|
|
+ actualRow2.setPredictionType("5");
|
|
|
+ actualRow2.setPredictionCombination(predictionNo1 + "," + predictionNo2);
|
|
|
actualRow2.setNetWeight(mwcaf03.getMeterWeight().subtract(mwcaf04.getMeterWeight()));
|
|
|
meterWorkCarActualMapper.insertSelective(actualRow2);
|
|
|
+
|
|
|
+ rm.setSucceed();
|
|
|
+ rm.setMessage("操作成功!!");
|
|
|
+ rm.setCode("200");
|
|
|
+ return rm;
|
|
|
}catch(Exception e){
|
|
|
e.printStackTrace();
|
|
|
- return "操作异常,请确认";
|
|
|
+ rm.setMessage("操作异常,请确认");
|
|
|
+ return rm;
|
|
|
}
|
|
|
- return "";
|
|
|
}
|
|
|
|
|
|
@Override
|