|
@@ -1035,7 +1035,6 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
|
|
|
RESTfulResult rm = new RESTfulResult();
|
|
RESTfulResult rm = new RESTfulResult();
|
|
|
rm.setCode("200");
|
|
rm.setCode("200");
|
|
|
|
|
|
|
|
-
|
|
|
|
|
//1、存储当前计量的数据
|
|
//1、存储当前计量的数据
|
|
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
|
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
|
|
|
String afl = formatter.format(new Date());
|
|
String afl = formatter.format(new Date());
|
|
@@ -1068,22 +1067,27 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
|
|
|
if (StringUtils.isNotEmpty(netDb.getPredictionNo())) {
|
|
if (StringUtils.isNotEmpty(netDb.getPredictionNo())) {
|
|
|
MeterWorkCarActualFirst meca1 = meterWorkCarActualFirstMapper.selectAndMatch(firstUpdate.getActualFirstNo(), netDb.getPredictionNo());
|
|
MeterWorkCarActualFirst meca1 = meterWorkCarActualFirstMapper.selectAndMatch(firstUpdate.getActualFirstNo(), netDb.getPredictionNo());
|
|
|
meterWorkCarActualFirstMapper.updateByPrimaryKeySelective(meca1);
|
|
meterWorkCarActualFirstMapper.updateByPrimaryKeySelective(meca1);
|
|
|
|
|
+ PreTrackScale preTrackScale = new PreTrackScale();
|
|
|
|
|
+ preTrackScale.setPredictionNo(netDb.getPredictionNo());
|
|
|
|
|
+ preTrackScale.setValueFlag("2");
|
|
|
|
|
+ preTrackScale.setUploadFlag("1");
|
|
|
|
|
+ preTrackScaleMapper.updateByPrimaryKeySelective(preTrackScale);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 判断当前数据是否存在委托
|
|
// 判断当前数据是否存在委托
|
|
|
- if (netDb.getPredictionNo() != null && "".equals(netDb.getPredictionNo())) {
|
|
|
|
|
- MeterWorkCarActualFirst gross = meterWorkCarActualFirstMapper.selectByPrimaryKey(netDb.getActualFirst1No());
|
|
|
|
|
- if ((gross.getPredictionNo() == null || "".equals(gross.getPredictionNo()))) {
|
|
|
|
|
- // 如果毛重数据还未匹配委托,则匹配委托操作
|
|
|
|
|
- MeterWorkCarActualFirst meca1 = meterWorkCarActualFirstMapper.selectAndMatch(gross.getActualFirstNo(), netDb.getPredictionNo());
|
|
|
|
|
- meterWorkCarActualFirstMapper.updateByPrimaryKeySelective(meca1);
|
|
|
|
|
- PreTrackScale preTrackScale = new PreTrackScale();
|
|
|
|
|
- preTrackScale.setPredictionNo(netDb.getPredictionNo());
|
|
|
|
|
- preTrackScale.setValueFlag("2");
|
|
|
|
|
- preTrackScale.setUploadFlag("1");
|
|
|
|
|
- preTrackScaleMapper.updateByPrimaryKeySelective(preTrackScale);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// if (netDb.getPredictionNo() != null && "".equals(netDb.getPredictionNo())) {
|
|
|
|
|
+// MeterWorkCarActualFirst gross = meterWorkCarActualFirstMapper.selectByPrimaryKey(netDb.getActualFirst1No());
|
|
|
|
|
+// if ((gross.getPredictionNo() == null || "".equals(gross.getPredictionNo()))) {
|
|
|
|
|
+// // 如果毛重数据还未匹配委托,则匹配委托操作
|
|
|
|
|
+// MeterWorkCarActualFirst meca1 = meterWorkCarActualFirstMapper.selectAndMatch(gross.getActualFirstNo(), netDb.getPredictionNo());
|
|
|
|
|
+// meterWorkCarActualFirstMapper.updateByPrimaryKeySelective(meca1);
|
|
|
|
|
+// PreTrackScale preTrackScale = new PreTrackScale();
|
|
|
|
|
+// preTrackScale.setPredictionNo(netDb.getPredictionNo());
|
|
|
|
|
+// preTrackScale.setValueFlag("2");
|
|
|
|
|
+// preTrackScale.setUploadFlag("1");
|
|
|
|
|
+// preTrackScaleMapper.updateByPrimaryKeySelective(preTrackScale);
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
|
|
|
String no1 = meterWorkCarActualMapper.getNewID(afl);
|
|
String no1 = meterWorkCarActualMapper.getNewID(afl);
|
|
|
netDb.setActualNo(afl + no1);
|
|
netDb.setActualNo(afl + no1);
|
|
@@ -1175,7 +1179,7 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- rm.setData(secondDb.getActualFirstNo());
|
|
|
|
|
|
|
+ rm.setData(afl + no1);
|
|
|
rm.setMessage(flag);
|
|
rm.setMessage(flag);
|
|
|
return rm;
|
|
return rm;
|
|
|
}
|
|
}
|
|
@@ -2708,21 +2712,21 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
|
|
|
preTrackScaleMapper.updateByPrimaryKeySelective(scale1);
|
|
preTrackScaleMapper.updateByPrimaryKeySelective(scale1);
|
|
|
|
|
|
|
|
//更新一次数据
|
|
//更新一次数据
|
|
|
- //更新第一次皮重数据库
|
|
|
|
|
|
|
+ //更新第一次皮重数据
|
|
|
mwcaf1.setValueFlag(DbConstants.NET);
|
|
mwcaf1.setValueFlag(DbConstants.NET);
|
|
|
mwcaf1.setUpdateManName("system");
|
|
mwcaf1.setUpdateManName("system");
|
|
|
mwcaf1.setUpdateManName("二次计量洁净更新");
|
|
mwcaf1.setUpdateManName("二次计量洁净更新");
|
|
|
mwcaf1.setUpdateTime(new Date());
|
|
mwcaf1.setUpdateTime(new Date());
|
|
|
mwcaf1.setIsPreScale("1");
|
|
mwcaf1.setIsPreScale("1");
|
|
|
meterWorkCarActualFirstMapper.updateByPrimaryKey(mwcaf1);
|
|
meterWorkCarActualFirstMapper.updateByPrimaryKey(mwcaf1);
|
|
|
- //更新第一次毛重数据库
|
|
|
|
|
|
|
+ //更新第一次毛重数据
|
|
|
mwcaf2.setValueFlag(DbConstants.NET);
|
|
mwcaf2.setValueFlag(DbConstants.NET);
|
|
|
mwcaf2.setUpdateManName("system");
|
|
mwcaf2.setUpdateManName("system");
|
|
|
mwcaf2.setUpdateManName("二次计量洁净更新");
|
|
mwcaf2.setUpdateManName("二次计量洁净更新");
|
|
|
mwcaf2.setUpdateTime(new Date());
|
|
mwcaf2.setUpdateTime(new Date());
|
|
|
mwcaf2.setIsPreScale("1");
|
|
mwcaf2.setIsPreScale("1");
|
|
|
meterWorkCarActualFirstMapper.updateByPrimaryKey(mwcaf2);
|
|
meterWorkCarActualFirstMapper.updateByPrimaryKey(mwcaf2);
|
|
|
- //添加第一次皮重数据库
|
|
|
|
|
|
|
+ //添加第二次皮重数据
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
|
|
|
String afl = sdf.format(new Date());
|
|
String afl = sdf.format(new Date());
|
|
|
String actualFirstNo = sdf.format(new Date()) + meterWorkCarActualFirstMapper.getNewID(afl);
|
|
String actualFirstNo = sdf.format(new Date()) + meterWorkCarActualFirstMapper.getNewID(afl);
|
|
@@ -2733,7 +2737,7 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
|
|
|
mwcaf3.setUpdateTime(new Date());
|
|
mwcaf3.setUpdateTime(new Date());
|
|
|
mwcaf3.setIsPreScale("1");
|
|
mwcaf3.setIsPreScale("1");
|
|
|
meterWorkCarActualFirstMapper.insertSelective(mwcaf3);
|
|
meterWorkCarActualFirstMapper.insertSelective(mwcaf3);
|
|
|
- //更新第二次毛重数据库
|
|
|
|
|
|
|
+ //更新第二次毛重数据
|
|
|
mwcaf4.setValueFlag(DbConstants.NET);
|
|
mwcaf4.setValueFlag(DbConstants.NET);
|
|
|
mwcaf4.setUpdateManName("system");
|
|
mwcaf4.setUpdateManName("system");
|
|
|
mwcaf4.setUpdateManName("二次计量洁净更新");
|
|
mwcaf4.setUpdateManName("二次计量洁净更新");
|
|
@@ -2749,6 +2753,9 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
|
|
|
actualRow1.setNote("混装结净");
|
|
actualRow1.setNote("混装结净");
|
|
|
actualRow1.setUploadFlag("1");
|
|
actualRow1.setUploadFlag("1");
|
|
|
actualRow1.setIsPreScale("1");
|
|
actualRow1.setIsPreScale("1");
|
|
|
|
|
+ actualRow1.setValueFlag("2");
|
|
|
|
|
+ actualRow1.setCreateTime(new Date());
|
|
|
|
|
+ actualRow1.setCreateManName("洁净");
|
|
|
actualRow1.setNetWeight(mwcaf2.getMeterWeight().subtract(mwcaf1.getMeterWeight()));
|
|
actualRow1.setNetWeight(mwcaf2.getMeterWeight().subtract(mwcaf1.getMeterWeight()));
|
|
|
meterWorkCarActualMapper.insertSelective(actualRow1);
|
|
meterWorkCarActualMapper.insertSelective(actualRow1);
|
|
|
|
|
|
|
@@ -2759,6 +2766,9 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
|
|
|
actualRow2.setNote("混装结净");
|
|
actualRow2.setNote("混装结净");
|
|
|
actualRow2.setUploadFlag("1");
|
|
actualRow2.setUploadFlag("1");
|
|
|
actualRow2.setIsPreScale("1");
|
|
actualRow2.setIsPreScale("1");
|
|
|
|
|
+ actualRow2.setValueFlag("2");
|
|
|
|
|
+ actualRow2.setCreateTime(new Date());
|
|
|
|
|
+ actualRow2.setCreateManName("洁净");
|
|
|
actualRow2.setNetWeight(mwcaf4.getMeterWeight().subtract(mwcaf3.getMeterWeight()));
|
|
actualRow2.setNetWeight(mwcaf4.getMeterWeight().subtract(mwcaf3.getMeterWeight()));
|
|
|
meterWorkCarActualMapper.insertSelective(actualRow2);
|
|
meterWorkCarActualMapper.insertSelective(actualRow2);
|
|
|
}
|
|
}
|
|
@@ -2847,34 +2857,34 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
|
|
|
preTrackScaleMapper.updateByPrimaryKeySelective(scale1);
|
|
preTrackScaleMapper.updateByPrimaryKeySelective(scale1);
|
|
|
|
|
|
|
|
//更新一次数据
|
|
//更新一次数据
|
|
|
- //更新第一次毛重数据库
|
|
|
|
|
|
|
+ //更新第一次毛重数据
|
|
|
mwcaf1.setValueFlag(DbConstants.NET);
|
|
mwcaf1.setValueFlag(DbConstants.NET);
|
|
|
- mwcaf1.setUpdateManName("system");
|
|
|
|
|
|
|
+ mwcaf1.setUpdateManNo("system");
|
|
|
mwcaf1.setUpdateManName("二次计量洁净更新");
|
|
mwcaf1.setUpdateManName("二次计量洁净更新");
|
|
|
mwcaf1.setUpdateTime(new Date());
|
|
mwcaf1.setUpdateTime(new Date());
|
|
|
mwcaf1.setIsPreScale("1");
|
|
mwcaf1.setIsPreScale("1");
|
|
|
meterWorkCarActualFirstMapper.updateByPrimaryKey(mwcaf1);
|
|
meterWorkCarActualFirstMapper.updateByPrimaryKey(mwcaf1);
|
|
|
- //更新第一次皮重数据库
|
|
|
|
|
|
|
+ //更新第一次皮重数据
|
|
|
mwcaf2.setValueFlag(DbConstants.NET);
|
|
mwcaf2.setValueFlag(DbConstants.NET);
|
|
|
- mwcaf2.setUpdateManName("system");
|
|
|
|
|
|
|
+ mwcaf2.setUpdateManNo("system");
|
|
|
mwcaf2.setUpdateManName("二次计量洁净更新");
|
|
mwcaf2.setUpdateManName("二次计量洁净更新");
|
|
|
mwcaf2.setUpdateTime(new Date());
|
|
mwcaf2.setUpdateTime(new Date());
|
|
|
mwcaf2.setIsPreScale("1");
|
|
mwcaf2.setIsPreScale("1");
|
|
|
meterWorkCarActualFirstMapper.updateByPrimaryKey(mwcaf2);
|
|
meterWorkCarActualFirstMapper.updateByPrimaryKey(mwcaf2);
|
|
|
- //添加第一次毛重数据库
|
|
|
|
|
|
|
+ //添加第二次毛重数据
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
|
|
|
String afl = sdf.format(new Date());
|
|
String afl = sdf.format(new Date());
|
|
|
String actualFirstNo = sdf.format(new Date()) + meterWorkCarActualFirstMapper.getNewID(afl);
|
|
String actualFirstNo = sdf.format(new Date()) + meterWorkCarActualFirstMapper.getNewID(afl);
|
|
|
mwcaf3.setActualFirstNo(actualFirstNo);
|
|
mwcaf3.setActualFirstNo(actualFirstNo);
|
|
|
mwcaf3.setValueFlag(DbConstants.NET);
|
|
mwcaf3.setValueFlag(DbConstants.NET);
|
|
|
- mwcaf3.setUpdateManName("system");
|
|
|
|
|
|
|
+ mwcaf3.setUpdateManNo("system");
|
|
|
mwcaf3.setUpdateManName("二次计量洁净更新");
|
|
mwcaf3.setUpdateManName("二次计量洁净更新");
|
|
|
mwcaf3.setUpdateTime(new Date());
|
|
mwcaf3.setUpdateTime(new Date());
|
|
|
mwcaf3.setIsPreScale("1");
|
|
mwcaf3.setIsPreScale("1");
|
|
|
meterWorkCarActualFirstMapper.insertSelective(mwcaf3);
|
|
meterWorkCarActualFirstMapper.insertSelective(mwcaf3);
|
|
|
- //更新第二次皮重数据库
|
|
|
|
|
|
|
+ //更新第二次皮重数据
|
|
|
mwcaf4.setValueFlag(DbConstants.NET);
|
|
mwcaf4.setValueFlag(DbConstants.NET);
|
|
|
- mwcaf4.setUpdateManName("system");
|
|
|
|
|
|
|
+ mwcaf4.setUpdateManNo("system");
|
|
|
mwcaf4.setUpdateManName("二次计量洁净更新");
|
|
mwcaf4.setUpdateManName("二次计量洁净更新");
|
|
|
mwcaf4.setUpdateTime(new Date());
|
|
mwcaf4.setUpdateTime(new Date());
|
|
|
mwcaf4.setIsPreScale("1");
|
|
mwcaf4.setIsPreScale("1");
|
|
@@ -2888,6 +2898,9 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
|
|
|
actualRow1.setNote("混装结净");
|
|
actualRow1.setNote("混装结净");
|
|
|
actualRow1.setUploadFlag("1");
|
|
actualRow1.setUploadFlag("1");
|
|
|
actualRow1.setIsPreScale("1");
|
|
actualRow1.setIsPreScale("1");
|
|
|
|
|
+ actualRow1.setValueFlag("2");
|
|
|
|
|
+ actualRow1.setCreateManName("洁净");
|
|
|
|
|
+ actualRow1.setCreateTime(new Date());
|
|
|
actualRow1.setNetWeight(mwcaf1.getMeterWeight().subtract(mwcaf2.getMeterWeight()));
|
|
actualRow1.setNetWeight(mwcaf1.getMeterWeight().subtract(mwcaf2.getMeterWeight()));
|
|
|
meterWorkCarActualMapper.insertSelective(actualRow1);
|
|
meterWorkCarActualMapper.insertSelective(actualRow1);
|
|
|
|
|
|
|
@@ -2895,9 +2908,12 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
|
|
|
actualRow2.setActualNo(sdf.format(new Date()) + no1);
|
|
actualRow2.setActualNo(sdf.format(new Date()) + no1);
|
|
|
actualRow2.setNetTime(new Date());
|
|
actualRow2.setNetTime(new Date());
|
|
|
actualRow2.setNetMode(DbConstants.TYPE);
|
|
actualRow2.setNetMode(DbConstants.TYPE);
|
|
|
- actualRow2.setNote(" 结净");
|
|
|
|
|
|
|
+ actualRow2.setNote("混装结净");
|
|
|
actualRow2.setUploadFlag("1");
|
|
actualRow2.setUploadFlag("1");
|
|
|
actualRow2.setIsPreScale("1");
|
|
actualRow2.setIsPreScale("1");
|
|
|
|
|
+ actualRow2.setValueFlag("2");
|
|
|
|
|
+ actualRow2.setCreateManName("洁净");
|
|
|
|
|
+ actualRow2.setCreateTime(new Date());
|
|
|
actualRow2.setNetWeight(mwcaf3.getMeterWeight().subtract(mwcaf4.getMeterWeight()));
|
|
actualRow2.setNetWeight(mwcaf3.getMeterWeight().subtract(mwcaf4.getMeterWeight()));
|
|
|
meterWorkCarActualMapper.insertSelective(actualRow2);
|
|
meterWorkCarActualMapper.insertSelective(actualRow2);
|
|
|
}
|
|
}
|
|
@@ -3173,106 +3189,146 @@ public class MeterWorkCarActualFirstServiceImpl extends BaseServiceImpl<MeterWor
|
|
|
return rm;
|
|
return rm;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// @Override
|
|
|
|
|
-// public RESTfulResult doNetMass(MeterWorkCarActualFirst one, MeterWorkCarActual two, PreTrackScale three, PreTrackScale four) throws Exception {
|
|
|
|
|
-// RESTfulResult rm = new RESTfulResult();
|
|
|
|
|
-// rm.setCode("200");
|
|
|
|
|
-//
|
|
|
|
|
-// //1、存储当前计量的数据
|
|
|
|
|
-// SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
|
|
|
|
|
-// String afl = formatter.format(one.getCreateTime());
|
|
|
|
|
-// String no = meterWorkCarActualFirstMapper.getNewID(afl);
|
|
|
|
|
-// String actualNo = formatter.format(new Date()) + no;
|
|
|
|
|
-// one.setActualFirstNo(actualNo);
|
|
|
|
|
-// one.setValueFlag("2");//洁净
|
|
|
|
|
-// meterWorkCarActualFirstMapper.insertSelective(one);
|
|
|
|
|
-//
|
|
|
|
|
-// //2、存储第二次一次数据编号
|
|
|
|
|
-// two.setActualFirst2No(actualNo);
|
|
|
|
|
-//
|
|
|
|
|
-// //2、修改第一次存储的计量数据状态为洁净
|
|
|
|
|
-// MeterWorkCarActualFirst firstUpdate = new MeterWorkCarActualFirst();
|
|
|
|
|
-// firstUpdate.setActualFirstNo(two.getActualFirst1No());
|
|
|
|
|
-// firstUpdate.setValueFlag("2");
|
|
|
|
|
-// meterWorkCarActualFirstMapper.updateByPrimaryKeySelective(firstUpdate);
|
|
|
|
|
-//
|
|
|
|
|
-//
|
|
|
|
|
-// //4、判断第一次计量数据是否匹配委托
|
|
|
|
|
-// MeterWorkCarActualFirst mwca1 = meterWorkCarActualFirstMapper.selectByPrimaryKey(firstUpdate.getActualFirstNo());
|
|
|
|
|
-// if(StringUtils.isEmpty(mwca1.getPredictionNo())){
|
|
|
|
|
-// MeterWorkCarActualFirst meca1 = meterWorkCarActualFirstMapper.selectAndMatch(firstUpdate.getActualFirstNo(), three.getPredictionNo());
|
|
|
|
|
-// meca1.setIsPreScale("1");
|
|
|
|
|
-// meterWorkCarActualFirstMapper.updateByPrimaryKeySelective(meca1);
|
|
|
|
|
-// }
|
|
|
|
|
-// //5、判断这次一次计量数据是否匹配委托
|
|
|
|
|
-// if (StringUtils.isEmpty(one.getPredictionNo())){
|
|
|
|
|
-// MeterWorkCarActualFirst meca1 = meterWorkCarActualFirstMapper.selectAndMatch(actualNo, three.getPredictionNo());
|
|
|
|
|
-// meca1.setIsPreScale("1");
|
|
|
|
|
-// meterWorkCarActualFirstMapper.updateByPrimaryKeySelective(meca1);
|
|
|
|
|
-// }
|
|
|
|
|
-//
|
|
|
|
|
-// //复制此次计量数据并设置类型为毛重
|
|
|
|
|
-// MeterWorkCarActualFirst actualFirstNew = new MeterWorkCarActualFirst();
|
|
|
|
|
-// String noNew = meterWorkCarActualFirstMapper.getNewID(afl);
|
|
|
|
|
-// String actualNoNew = formatter.format(new Date()) + noNew;
|
|
|
|
|
-// actualFirstNew.setActualFirstNo(actualNoNew);
|
|
|
|
|
-// actualFirstNew.setWeightType("0");
|
|
|
|
|
-// meterWorkCarActualFirstMapper.insertSelective(actualFirstNew);
|
|
|
|
|
-//
|
|
|
|
|
-// //将新加的毛重数据匹配第二条委托
|
|
|
|
|
-// MeterWorkCarActualFirst meca1 = meterWorkCarActualFirstMapper.selectAndMatch(actualNoNew, four.getPredictionNo());
|
|
|
|
|
-// meca1.setIsPreScale("1");
|
|
|
|
|
-// meterWorkCarActualFirstMapper.updateByPrimaryKeySelective(meca1);
|
|
|
|
|
-//
|
|
|
|
|
-// //7、判断洁净数据是否匹配委托
|
|
|
|
|
-// if(StringUtils.isEmpty(two.getPredictionNo())){
|
|
|
|
|
-// MeterWorkCarActual mwcaOld = meterWorkCarActualMapper.manualAddPre(two.getActualFirst1No(),two.getActualFirst2No(), three.getPredictionNo());
|
|
|
|
|
-// BeanUtils.copyProperties(mwcaOld,two);
|
|
|
|
|
-// }
|
|
|
|
|
-//
|
|
|
|
|
-// //8、插入洁净数据
|
|
|
|
|
-// String no1 = meterWorkCarActualMapper.getNewID(afl);
|
|
|
|
|
-// two.setActualNo(afl + no1);
|
|
|
|
|
-// two.setIsPreScale("1");
|
|
|
|
|
-// two.setUploadFlag("1");
|
|
|
|
|
-// if (two != null && two.getNetWeight() != null) {
|
|
|
|
|
-// //2021年3月7日 净重保留两位小数;
|
|
|
|
|
-// BigDecimal net;
|
|
|
|
|
-// net = new BigDecimal(String.valueOf(two.getNetWeight())).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
-// two.setNetWeight(net);
|
|
|
|
|
-// }
|
|
|
|
|
-// meterWorkCarActualMapper.insert(two);
|
|
|
|
|
-//
|
|
|
|
|
-// //修改委托为已使用状态
|
|
|
|
|
-// three.setValueFlag("4");
|
|
|
|
|
-// three.setUploadFlag("1");
|
|
|
|
|
-// preTrackScaleMapper.updateByPrimaryKeySelective(three);
|
|
|
|
|
-// four.setValueFlag("4");
|
|
|
|
|
-// four.setUploadFlag("1");
|
|
|
|
|
-// preTrackScaleMapper.updateByPrimaryKeySelective(four);
|
|
|
|
|
-//
|
|
|
|
|
-// //10、保存图片
|
|
|
|
|
-// SaveImg(one);
|
|
|
|
|
-//
|
|
|
|
|
-// //11、修改计量监控
|
|
|
|
|
-// updateMonitor(one.getBaseSpotNo());
|
|
|
|
|
-//
|
|
|
|
|
-// //12、当存储一次数据或者结净时,将本车辆的预处理重量改为已使用
|
|
|
|
|
-// updatePreWeight(one.getCarNo());
|
|
|
|
|
-//
|
|
|
|
|
-// updateMonitorOver(one.getActualFirstNo(), one.getBaseSpotNo());
|
|
|
|
|
-//
|
|
|
|
|
-// //重量类型为毛重则调用接口为
|
|
|
|
|
-// String flag = "";
|
|
|
|
|
-//
|
|
|
|
|
-// //补充附加重量的数据
|
|
|
|
|
-// if (StringUtils.isNotEmpty(one.getAddWgtPk())) {
|
|
|
|
|
-// insertAddWgtNo(one.getActualFirstNo(), one.getAddWgtPk(), one.getCreateManNo(), one.getCreateManName());
|
|
|
|
|
-// }
|
|
|
|
|
-//
|
|
|
|
|
-// rm.setData(one.getActualFirstNo());
|
|
|
|
|
-// rm.setMessage(flag);
|
|
|
|
|
-// return rm;
|
|
|
|
|
-// }
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 内倒车辆洁净
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param secondDb 二次计量数据
|
|
|
|
|
+ * @param netDb 净重数据
|
|
|
|
|
+ * @param saveTare 0 不保存历史皮,1保存历史皮
|
|
|
|
|
+ * @return
|
|
|
|
|
+ * @throws Exception
|
|
|
|
|
+ */
|
|
|
|
|
+ @Override
|
|
|
|
|
+ @Transactional(value = "tm", rollbackFor = Exception.class)
|
|
|
|
|
+ public RESTfulResult doNetTermTare(MeterWorkCarActualFirst secondDb, MeterWorkCarActual netDb, String saveTare) throws Exception {
|
|
|
|
|
+ try{
|
|
|
|
|
+ RESTfulResult rm = new RESTfulResult();
|
|
|
|
|
+ rm.setCode("200");
|
|
|
|
|
+
|
|
|
|
|
+ //1、存储当前计量的数据
|
|
|
|
|
+ SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
|
|
|
|
|
+ String afl = formatter.format(new Date());
|
|
|
|
|
+ String no = meterWorkCarActualFirstMapper.getNewID(afl);
|
|
|
|
|
+ secondDb.setActualFirstNo(formatter.format(new Date()) + no);
|
|
|
|
|
+ secondDb.setValueFlag("2");//洁净
|
|
|
|
|
+ meterWorkCarActualFirstMapper.insertSelective(secondDb);
|
|
|
|
|
+
|
|
|
|
|
+ String no1 = meterWorkCarActualMapper.getNewID(afl);
|
|
|
|
|
+ netDb.setActualNo(afl + no1);
|
|
|
|
|
+ if (netDb != null && netDb.getNetWeight() != null) {
|
|
|
|
|
+ //2021年3月7日 净重保留两位小数;
|
|
|
|
|
+ BigDecimal net;
|
|
|
|
|
+ net = new BigDecimal(String.valueOf(netDb.getNetWeight())).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
+ netDb.setNetWeight(net);
|
|
|
|
|
+ }
|
|
|
|
|
+ netDb.setUploadFlag("1");
|
|
|
|
|
+ meterWorkCarActualMapper.insert(netDb);
|
|
|
|
|
+
|
|
|
|
|
+ //4、将期限皮重转化为一条皮重计量数据保存
|
|
|
|
|
+ MeterBaseTermTareData mbttd = new MeterBaseTermTareData();
|
|
|
|
|
+ HashMap mbMap = new HashMap();
|
|
|
|
|
+ SimpleDateFormat mbsdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
+ mbMap.put("endTime",mbsdf.format(new Date()));
|
|
|
|
|
+ if(StringUtils.isNotEmpty(netDb.getActualFirst2No())){
|
|
|
|
|
+ mbMap.put("dataNo",netDb.getActualFirst2No());
|
|
|
|
|
+ mbttd = meterBaseTermTareDataMapper.selectByDataNo(mbMap);
|
|
|
|
|
+ }
|
|
|
|
|
+ else{
|
|
|
|
|
+ mbMap.put("carNo",netDb.getCarNo());
|
|
|
|
|
+ mbttd = meterBaseTermTareDataMapper.selectByCarNo(mbMap);
|
|
|
|
|
+ }
|
|
|
|
|
+ MeterWorkCarActualFirst imTare = new MeterWorkCarActualFirst();
|
|
|
|
|
+ //补充数据
|
|
|
|
|
+ String afl1 = formatter.format(new Date());
|
|
|
|
|
+ String imTareNO = meterWorkCarActualFirstMapper.getNewID(afl1);
|
|
|
|
|
+ String actualNo = afl1 + imTareNO;
|
|
|
|
|
+ imTare.setActualFirstNo(actualNo);
|
|
|
|
|
+ imTare.setMeterTypeNo(secondDb.getMeterTypeNo());
|
|
|
|
|
+ imTare.setMeterTypeName(secondDb.getMeterTypeName());
|
|
|
|
|
+ imTare.setBaseSpotNo(mbttd.getBaseSpotNo());
|
|
|
|
|
+ imTare.setBaseSpotName(mbttd.getBaseSpotName());
|
|
|
|
|
+ imTare.setCarNo(mbttd.getCarNo());
|
|
|
|
|
+ imTare.setCreateTime(mbttd.getCreateTime());
|
|
|
|
|
+ imTare.setCreateManNo(mbttd.getCreateManNo());
|
|
|
|
|
+ imTare.setCreateManName(mbttd.getCreateManName());
|
|
|
|
|
+ imTare.setMeterWeight(mbttd.getMeterWeight());
|
|
|
|
|
+ imTare.setWeightType("2");//期限皮重
|
|
|
|
|
+ imTare.setValueFlag("2");//洁净
|
|
|
|
|
+ imTare.setDataSource("1");
|
|
|
|
|
+ meterWorkCarActualFirstMapper.insertSelective(imTare);
|
|
|
|
|
+ //将洁净数据中的皮重编号修改
|
|
|
|
|
+ MeterWorkCarActual mwca = new MeterWorkCarActual();
|
|
|
|
|
+ mwca.setActualNo(netDb.getActualNo());
|
|
|
|
|
+ mwca.setActualFirst2No(imTare.getActualFirstNo());
|
|
|
|
|
+ mwca.setTareWeight(mbttd.getMeterWeight());
|
|
|
|
|
+ mwca.setNetWeight(secondDb.getMeterWeight().subtract(imTare.getMeterWeight()));
|
|
|
|
|
+ meterWorkCarActualMapper.updateByPrimaryKeySelective(mwca);
|
|
|
|
|
+
|
|
|
|
|
+ //皮重数据匹配委托
|
|
|
|
|
+ MeterWorkCarActualFirst mwcaf2 = meterWorkCarActualFirstMapper.selectAndMatch(actualNo, netDb.getPredictionNo());
|
|
|
|
|
+ String nomwcaf2 = meterWorkCarActualFirstMapper.getNewID(afl);
|
|
|
|
|
+ mwcaf2.setIsPreScale("1");
|
|
|
|
|
+ mwcaf2.setActualFirstNo(actualNo);
|
|
|
|
|
+ meterWorkCarActualFirstMapper.updateByPrimaryKeySelective(mwcaf2);
|
|
|
|
|
+
|
|
|
|
|
+ //判断洁净数据是否匹配委托
|
|
|
|
|
+ if (StringUtils.isNotEmpty(netDb.getPredictionNo())) {
|
|
|
|
|
+ PreTrackScale preTrackScale = new PreTrackScale();
|
|
|
|
|
+ preTrackScale.setPredictionNo(netDb.getPredictionNo());
|
|
|
|
|
+ preTrackScale.setValueFlag("2");
|
|
|
|
|
+ preTrackScale.setUploadFlag("1");
|
|
|
|
|
+ preTrackScaleMapper.updateByPrimaryKeySelective(preTrackScale);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ //4、存储历史皮重及历史皮重明细信息
|
|
|
|
|
+ if ("1".equals(saveTare)) {
|
|
|
|
|
+ MeterWorkCarActualFirst oci = new MeterWorkCarActualFirst();
|
|
|
|
|
+ oci.setCarNo(netDb.getCarNo());
|
|
|
|
|
+ oci.setCreateTime(mbttd.getCreateTime());
|
|
|
|
|
+ oci.setBaseSpotNo(mbttd.getBaseSpotNo());
|
|
|
|
|
+ oci.setBaseSpotName(mbttd.getBaseSpotName());
|
|
|
|
|
+ oci.setMeterWeight(mbttd.getMeterWeight());
|
|
|
|
|
+ oci.setActualFirstNo(actualNo);
|
|
|
|
|
+ doSaveHisTare(oci);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ //5、保存图片
|
|
|
|
|
+ SaveImg(secondDb);
|
|
|
|
|
+
|
|
|
|
|
+ //6、修改计量监控
|
|
|
|
|
+ updateMonitor(secondDb.getBaseSpotNo());
|
|
|
|
|
+
|
|
|
|
|
+ //当存储一次数据或者结净时,将本车辆的预处理重量改为已使用
|
|
|
|
|
+ updatePreWeight(secondDb.getCarNo());
|
|
|
|
|
+
|
|
|
|
|
+ updateMonitorOver(secondDb.getActualFirstNo(), secondDb.getBaseSpotNo());
|
|
|
|
|
+
|
|
|
|
|
+ //重量类型为毛重则调用接口为
|
|
|
|
|
+ String flag = "";
|
|
|
|
|
+ /*
|
|
|
|
|
+ if("0".equals(secondDb.getWeightType())){
|
|
|
|
|
+ flag = transferParamForLims(netDb.getCarNo(),netDb.getMatterNo(),netDb.getReceivingUintName(),netDb.getForwardingUnitName(),netDb.getNetWeight().toString(),netDb.getNetTime(),"",netDb.getActualNo());
|
|
|
|
|
+ }
|
|
|
|
|
+ //*/
|
|
|
|
|
+
|
|
|
|
|
+ //补充附加重量的数据
|
|
|
|
|
+ if (StringUtils.isNotEmpty(secondDb.getAddWgtPk())) {
|
|
|
|
|
+ insertAddWgtNo(secondDb.getActualFirstNo(), secondDb.getAddWgtPk(), secondDb.getCreateManNo(), secondDb.getCreateManName());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ rm.setData(afl + no1);
|
|
|
|
|
+ rm.setMessage(flag);
|
|
|
|
|
+ return rm;
|
|
|
|
|
+ }
|
|
|
|
|
+ catch (Exception e){
|
|
|
|
|
+ RESTfulResult rm = new RESTfulResult();
|
|
|
|
|
+ rm.setCode("500");
|
|
|
|
|
+ rm.setData(null);
|
|
|
|
|
+ rm.setMessage(e.getMessage());
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ return rm;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|