|
@@ -1,9 +1,6 @@
|
|
|
package com.steerinfo.meterwork.meterworkrailwayactfirst.service.impl;
|
|
package com.steerinfo.meterwork.meterworkrailwayactfirst.service.impl;
|
|
|
|
|
|
|
|
-import com.fasterxml.jackson.databind.node.BigIntegerNode;
|
|
|
|
|
-import com.google.inject.internal.cglib.proxy.$UndeclaredThrowableException;
|
|
|
|
|
import com.steerinfo.baseinfo.combaseinfo.mapper.ComBaseInfoMapper;
|
|
import com.steerinfo.baseinfo.combaseinfo.mapper.ComBaseInfoMapper;
|
|
|
-import com.steerinfo.baseinfo.meterbasematterinfo.mapper.MeterBaseMatterInfoMapper;
|
|
|
|
|
import com.steerinfo.baseinfo.meterbaseoperationlog.mapper.MeterBaseOperationLogMapper;
|
|
import com.steerinfo.baseinfo.meterbaseoperationlog.mapper.MeterBaseOperationLogMapper;
|
|
|
import com.steerinfo.baseinfo.meterbaseoperationlog.model.MeterBaseOperationLog;
|
|
import com.steerinfo.baseinfo.meterbaseoperationlog.model.MeterBaseOperationLog;
|
|
|
import com.steerinfo.baseinfo.meterbaserailwayaiweight.mapper.MeterBaseRailwayAiweightMapper;
|
|
import com.steerinfo.baseinfo.meterbaserailwayaiweight.mapper.MeterBaseRailwayAiweightMapper;
|
|
@@ -30,7 +27,6 @@ import com.steerinfo.meterwork.constants.DbConstants;
|
|
|
import com.steerinfo.meterwork.dto.CommonCombination;
|
|
import com.steerinfo.meterwork.dto.CommonCombination;
|
|
|
import com.steerinfo.meterwork.dto.StaffPerformanceAnalysis;
|
|
import com.steerinfo.meterwork.dto.StaffPerformanceAnalysis;
|
|
|
import com.steerinfo.meterwork.except.MarkerMetException;
|
|
import com.steerinfo.meterwork.except.MarkerMetException;
|
|
|
-import com.steerinfo.meterwork.meterworkcaractual.model.MeterWorkCarActual;
|
|
|
|
|
import com.steerinfo.meterwork.meterworkcaractualfirst.model.MeterWorkCarActualFirst;
|
|
import com.steerinfo.meterwork.meterworkcaractualfirst.model.MeterWorkCarActualFirst;
|
|
|
import com.steerinfo.meterwork.meterworkimage.mapper.MeterWorkImageMapper;
|
|
import com.steerinfo.meterwork.meterworkimage.mapper.MeterWorkImageMapper;
|
|
|
import com.steerinfo.meterwork.meterworkimage.model.MeterWorkImage;
|
|
import com.steerinfo.meterwork.meterworkimage.model.MeterWorkImage;
|
|
@@ -47,19 +43,12 @@ import com.steerinfo.meterwork.meterworkrailwayrecmain.model.MeterWorkRailwayRec
|
|
|
import com.steerinfo.meterwork.meterworkrailwayscheduledhelp.mapper.MeterWorkRailwayScheduledHelpMapper;
|
|
import com.steerinfo.meterwork.meterworkrailwayscheduledhelp.mapper.MeterWorkRailwayScheduledHelpMapper;
|
|
|
import com.steerinfo.meterwork.meterworkrailwayscheduledhelp.model.MeterWorkRailwayScheduledHelp;
|
|
import com.steerinfo.meterwork.meterworkrailwayscheduledhelp.model.MeterWorkRailwayScheduledHelp;
|
|
|
import com.steerinfo.meterwork.meterworkrailwayscheduledhelp.service.IMeterWorkRailwayScheduledHelpService;
|
|
import com.steerinfo.meterwork.meterworkrailwayscheduledhelp.service.IMeterWorkRailwayScheduledHelpService;
|
|
|
-import com.steerinfo.meterwork.meterworkscheduledhelp.model.MeterWorkScheduledHelp;
|
|
|
|
|
import com.steerinfo.pretrack.prerailwayscale.mapper.PreRailwayScaleMapper;
|
|
import com.steerinfo.pretrack.prerailwayscale.mapper.PreRailwayScaleMapper;
|
|
|
import com.steerinfo.pretrack.prerailwayscale.model.PreRailwayScale;
|
|
import com.steerinfo.pretrack.prerailwayscale.model.PreRailwayScale;
|
|
|
-import com.steerinfo.pretrack.pretrackscale.model.PreTrackScale;
|
|
|
|
|
import com.steerinfo.util.FieldsCollector;
|
|
import com.steerinfo.util.FieldsCollector;
|
|
|
import com.steerinfo.util.PublicMethod;
|
|
import com.steerinfo.util.PublicMethod;
|
|
|
import com.steerinfo.util.StringUtils;
|
|
import com.steerinfo.util.StringUtils;
|
|
|
-import io.micrometer.core.instrument.Meter;
|
|
|
|
|
-import org.apache.poi.hssf.record.ArrayRecord;
|
|
|
|
|
-import org.apache.shiro.crypto.hash.Hash;
|
|
|
|
|
-import org.bytedeco.tesseract.STRING;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
|
-import org.springframework.context.annotation.Bean;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
|
@@ -1441,6 +1430,9 @@ public class MeterWorkRailwayActFirstServiceImpl extends BaseServiceImpl<MeterWo
|
|
|
actualRow01.setActualNo(PublicMethod.IdCreate(3));
|
|
actualRow01.setActualNo(PublicMethod.IdCreate(3));
|
|
|
actualRow01.setIsPreSacale("1");
|
|
actualRow01.setIsPreSacale("1");
|
|
|
actualRow01.setTareWeight(tareWeight01);
|
|
actualRow01.setTareWeight(tareWeight01);
|
|
|
|
|
+ actualRow01.setNetMode("2");
|
|
|
|
|
+ actualRow01.setValueFlag("1");
|
|
|
|
|
+ actualRow01.setUploadFlag("1");
|
|
|
actualRow01.setNetWeight(actualRow01.getGrossWeight().subtract(tareWeight01));
|
|
actualRow01.setNetWeight(actualRow01.getGrossWeight().subtract(tareWeight01));
|
|
|
actualRow01.setPredictionType("5");
|
|
actualRow01.setPredictionType("5");
|
|
|
actualRow01.setPredictionCombination(scales.get(0).getPredictionNo() + "," + scales.get(1).getPredictionNo());
|
|
actualRow01.setPredictionCombination(scales.get(0).getPredictionNo() + "," + scales.get(1).getPredictionNo());
|
|
@@ -1459,6 +1451,9 @@ public class MeterWorkRailwayActFirstServiceImpl extends BaseServiceImpl<MeterWo
|
|
|
actualRow02.setTareWeight(tareWeight02);
|
|
actualRow02.setTareWeight(tareWeight02);
|
|
|
actualRow02.setNetWeight(actualRow02.getGrossWeight().subtract(tareWeight02));
|
|
actualRow02.setNetWeight(actualRow02.getGrossWeight().subtract(tareWeight02));
|
|
|
actualRow02.setPredictionType("5");
|
|
actualRow02.setPredictionType("5");
|
|
|
|
|
+ actualRow02.setNetMode("2");
|
|
|
|
|
+ actualRow02.setValueFlag("1");
|
|
|
|
|
+ actualRow02.setUploadFlag("1");
|
|
|
actualRow02.setPredictionCombination(scales.get(0).getPredictionNo() + "," + scales.get(1).getPredictionNo());
|
|
actualRow02.setPredictionCombination(scales.get(0).getPredictionNo() + "," + scales.get(1).getPredictionNo());
|
|
|
actualRow02.setLcNo(meterWorkRailwayActFirstMapper.getFirstLcNo(actualRow02.getActualFirst1No()));
|
|
actualRow02.setLcNo(meterWorkRailwayActFirstMapper.getFirstLcNo(actualRow02.getActualFirst1No()));
|
|
|
//是否发布 ture发布,false不发布
|
|
//是否发布 ture发布,false不发布
|
|
@@ -1583,7 +1578,7 @@ public class MeterWorkRailwayActFirstServiceImpl extends BaseServiceImpl<MeterWo
|
|
|
String no = PublicMethod.IdCreate(3);
|
|
String no = PublicMethod.IdCreate(3);
|
|
|
actualRow.setActualNo(no);
|
|
actualRow.setActualNo(no);
|
|
|
actualRow.setNote("双委托匹配结净");
|
|
actualRow.setNote("双委托匹配结净");
|
|
|
- actualRow.setNetMode("3");
|
|
|
|
|
|
|
+ actualRow.setNetMode("2");
|
|
|
actualRow.setPredictionType("5");
|
|
actualRow.setPredictionType("5");
|
|
|
actualRow.setPredictionCombination(selectedFirsts.get(0).getPredictionNo() + "," + addFirsts.get(1).getPredictionNo());
|
|
actualRow.setPredictionCombination(selectedFirsts.get(0).getPredictionNo() + "," + addFirsts.get(1).getPredictionNo());
|
|
|
if(actualRow.getGrossTime().compareTo(actualRow.getTareTime()) >= 0) {
|
|
if(actualRow.getGrossTime().compareTo(actualRow.getTareTime()) >= 0) {
|
|
@@ -2546,7 +2541,7 @@ public class MeterWorkRailwayActFirstServiceImpl extends BaseServiceImpl<MeterWo
|
|
|
//更新一次数据
|
|
//更新一次数据
|
|
|
//更新第一次毛重数据库
|
|
//更新第一次毛重数据库
|
|
|
mwcaf01.setValueFlag(DbConstants.NET);
|
|
mwcaf01.setValueFlag(DbConstants.NET);
|
|
|
- mwcaf01.setUpdateManName("system");
|
|
|
|
|
|
|
+ mwcaf01.setUpdateManNo("system");
|
|
|
mwcaf01.setUpdateManName("双委托结净更新");
|
|
mwcaf01.setUpdateManName("双委托结净更新");
|
|
|
mwcaf01.setUpdateTime(new Date());
|
|
mwcaf01.setUpdateTime(new Date());
|
|
|
mwcaf01.setIsPreSacale("1");
|
|
mwcaf01.setIsPreSacale("1");
|
|
@@ -2557,7 +2552,7 @@ public class MeterWorkRailwayActFirstServiceImpl extends BaseServiceImpl<MeterWo
|
|
|
meterWorkRailwayActFirstMapper.updateByPrimaryKey(mwcaf01);
|
|
meterWorkRailwayActFirstMapper.updateByPrimaryKey(mwcaf01);
|
|
|
//更新第一次皮重数据库
|
|
//更新第一次皮重数据库
|
|
|
mwcaf02.setValueFlag(DbConstants.NET);
|
|
mwcaf02.setValueFlag(DbConstants.NET);
|
|
|
- mwcaf02.setUpdateManName("system");
|
|
|
|
|
|
|
+ mwcaf02.setUpdateManNo("system");
|
|
|
mwcaf02.setUpdateManName("双委托结净更新");
|
|
mwcaf02.setUpdateManName("双委托结净更新");
|
|
|
mwcaf02.setUpdateTime(new Date());
|
|
mwcaf02.setUpdateTime(new Date());
|
|
|
mwcaf02.setIsPreSacale("1");
|
|
mwcaf02.setIsPreSacale("1");
|
|
@@ -2574,7 +2569,7 @@ public class MeterWorkRailwayActFirstServiceImpl extends BaseServiceImpl<MeterWo
|
|
|
String actualFirstNo = PublicMethod.IdCreate(3);
|
|
String actualFirstNo = PublicMethod.IdCreate(3);
|
|
|
mwcaf03.setActualFirstNo(actualFirstNo);
|
|
mwcaf03.setActualFirstNo(actualFirstNo);
|
|
|
mwcaf03.setValueFlag(DbConstants.NET);
|
|
mwcaf03.setValueFlag(DbConstants.NET);
|
|
|
- mwcaf03.setUpdateManName("system");
|
|
|
|
|
|
|
+ mwcaf03.setUpdateManNo("system");
|
|
|
mwcaf03.setUpdateManName("双委托结净更新");
|
|
mwcaf03.setUpdateManName("双委托结净更新");
|
|
|
mwcaf03.setUpdateTime(new Date());
|
|
mwcaf03.setUpdateTime(new Date());
|
|
|
mwcaf03.setIsPreSacale("1");
|
|
mwcaf03.setIsPreSacale("1");
|
|
@@ -2591,7 +2586,7 @@ public class MeterWorkRailwayActFirstServiceImpl extends BaseServiceImpl<MeterWo
|
|
|
String actualSecondNo = PublicMethod.IdCreate(3);
|
|
String actualSecondNo = PublicMethod.IdCreate(3);
|
|
|
mwcaf04.setActualFirstNo(actualSecondNo);
|
|
mwcaf04.setActualFirstNo(actualSecondNo);
|
|
|
mwcaf04.setValueFlag(DbConstants.NET);
|
|
mwcaf04.setValueFlag(DbConstants.NET);
|
|
|
- mwcaf04.setUpdateManName("system");
|
|
|
|
|
|
|
+ mwcaf04.setUpdateManNo("system");
|
|
|
mwcaf04.setUpdateManName("双委托结净更新");
|
|
mwcaf04.setUpdateManName("双委托结净更新");
|
|
|
mwcaf04.setUpdateTime(new Date());
|
|
mwcaf04.setUpdateTime(new Date());
|
|
|
mwcaf04.setIsPreSacale("1");
|
|
mwcaf04.setIsPreSacale("1");
|
|
@@ -2707,6 +2702,260 @@ public class MeterWorkRailwayActFirstServiceImpl extends BaseServiceImpl<MeterWo
|
|
|
preRailwayScaleMapper.updateByPrimaryKeySelective(scale1);
|
|
preRailwayScaleMapper.updateByPrimaryKeySelective(scale1);
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
|
|
+ return "操作异常,请确认";
|
|
|
|
|
+ }
|
|
|
|
|
+ return "";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
|
+ public String doubleEntrustAiWeightMatch(String actualNo1, BigDecimal tareWeight, String predictionNo1, String predictionNo2) {
|
|
|
|
|
+ try {
|
|
|
|
|
+
|
|
|
|
|
+ String userId = "";
|
|
|
|
|
+ String userName = "";
|
|
|
|
|
+ try{
|
|
|
|
|
+ UserPayload userPayload = UserPayload.getCurrUser();
|
|
|
|
|
+ userId = userPayload.getUserCode();
|
|
|
|
|
+ userName = userPayload.getUserName();
|
|
|
|
|
+ }catch (Exception e) {
|
|
|
|
|
+ userId = "admin";
|
|
|
|
|
+ userName = "admins";
|
|
|
|
|
+ }
|
|
|
|
|
+ //查询出一次计量数据
|
|
|
|
|
+
|
|
|
|
|
+ //查询出一次计量数据
|
|
|
|
|
+ MeterWorkRailwayActFirst mwcaf01 = meterWorkRailwayActFirstMapper.selectByPrimaryKey(actualNo1);
|
|
|
|
|
+ MeterWorkRailwayActFirst mwcaf02 = meterWorkRailwayActFirstMapper.selectByPrimaryKey(actualNo1);
|
|
|
|
|
+ MeterWorkRailwayActFirst mwcaf03 = meterWorkRailwayActFirstMapper.selectByPrimaryKey(actualNo1);
|
|
|
|
|
+ MeterWorkRailwayActFirst mwcaf04 = meterWorkRailwayActFirstMapper.selectByPrimaryKey(actualNo1);
|
|
|
|
|
+ //查询出所有委托信息
|
|
|
|
|
+ PreRailwayScale pts01 = preRailwayScaleMapper.selectByPrimaryKey(predictionNo1);
|
|
|
|
|
+ PreRailwayScale pts02 = preRailwayScaleMapper.selectByPrimaryKey(predictionNo2);
|
|
|
|
|
+ //定义两个结净类
|
|
|
|
|
+ MeterWorkRailwayActual actualRow1 = new MeterWorkRailwayActual();
|
|
|
|
|
+ MeterWorkRailwayActual actualRow2 = new MeterWorkRailwayActual();
|
|
|
|
|
+ if (mwcaf01 == null) {
|
|
|
|
|
+ return "未找到相应的一次计量信息,请确认!!";
|
|
|
|
|
+ }
|
|
|
|
|
+ if (pts01 == null || pts02 == null) {
|
|
|
|
|
+ return "未找到相应的委托信息,请确认!!";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ //获取两个一次重量的差值
|
|
|
|
|
+ BigDecimal num01 = mwcaf01.getMeterWeight().subtract(tareWeight);
|
|
|
|
|
+ BigDecimal num02 = mwcaf01.getMeterWeight();
|
|
|
|
|
+ //判断毛重必须大于皮重
|
|
|
|
|
+ if (num01.compareTo(BigDecimal.valueOf(0)) == -1) {
|
|
|
|
|
+ return "输入的标识皮重大于所选择的一次计量数据,请重新操作!!";
|
|
|
|
|
+ }
|
|
|
|
|
+ //一次数据是否为有效
|
|
|
|
|
+ if (mwcaf01.getValueFlag().equals("2")) {
|
|
|
|
|
+ return "一次计量数据已结净,请确认!!";
|
|
|
|
|
+ }
|
|
|
|
|
+ if (mwcaf01.getValueFlag().equals("0")) {
|
|
|
|
|
+ return "一次计量数据已作废,请确认!!";
|
|
|
|
|
+ }
|
|
|
|
|
+ //判断双委托 物料相同、A委托的收货单位是B委托的发货单位 或者 B委托的收货单位是A委托的发货单位
|
|
|
|
|
+// if (!(pts01.getMatterNo().equals(pts02.getMatterNo()) &&
|
|
|
|
|
+// (pts01.getReceivingUintNo().equals(pts02.getForwardingUnitNo()) ||
|
|
|
|
|
+// pts01.getForwardingUnitNo().equals(pts02.getReceivingUintNo())))) {
|
|
|
|
|
+// return "委托信息不符合双委托规则,请确认!!";
|
|
|
|
|
+// }
|
|
|
|
|
+ if (!(pts01.getReceivingUintNo().equals(pts02.getForwardingUnitNo()) ||
|
|
|
|
|
+ pts01.getForwardingUnitNo().equals(pts02.getReceivingUintNo()))) {
|
|
|
|
|
+ return "委托信息不符合双委托规则,请确认!!";
|
|
|
|
|
+ }
|
|
|
|
|
+ //委托信息是否为有效数据
|
|
|
|
|
+ if (pts01.getValueFlag().equals("2") || pts02.getValueFlag().equals("2")) {
|
|
|
|
|
+ return "委托信息已使用!!";
|
|
|
|
|
+ }
|
|
|
|
|
+ if (pts01.getValueFlag().equals("3") || pts02.getValueFlag().equals("3")) {
|
|
|
|
|
+ return "委托信息已作废!!";
|
|
|
|
|
+ }
|
|
|
|
|
+ //将委托中的编号和收发货的等数据拷贝进一次数据中
|
|
|
|
|
+ MeterWorkRailwayActFirst first1 = meterWorkRailwayActFirstMapper.selectAndMatch(actualNo1, predictionNo1);
|
|
|
|
|
+ BeanUtils.copyProperties(first1, mwcaf01);
|
|
|
|
|
+ MeterWorkRailwayActFirst first2 = meterWorkRailwayActFirstMapper.selectAndMatch(actualNo1, predictionNo1);
|
|
|
|
|
+ BeanUtils.copyProperties(first2, mwcaf02);
|
|
|
|
|
+ MeterWorkRailwayActFirst first3 = meterWorkRailwayActFirstMapper.selectAndMatch(actualNo1, predictionNo2);
|
|
|
|
|
+ BeanUtils.copyProperties(first3, mwcaf03);
|
|
|
|
|
+ MeterWorkRailwayActFirst first4 = meterWorkRailwayActFirstMapper.selectAndMatch(actualNo1, predictionNo2);
|
|
|
|
|
+ BeanUtils.copyProperties(first4, mwcaf04);
|
|
|
|
|
+
|
|
|
|
|
+ //更新一次数据
|
|
|
|
|
+ //更新第一次毛重数据库
|
|
|
|
|
+ mwcaf01.setValueFlag(DbConstants.NET);
|
|
|
|
|
+ mwcaf01.setUpdateManNo(userId);
|
|
|
|
|
+ mwcaf01.setUpdateManName(userName);
|
|
|
|
|
+ mwcaf01.setUpdateTime(new Date());
|
|
|
|
|
+ mwcaf01.setIsPreSacale("1");
|
|
|
|
|
+ mwcaf01.setWeightType("0");
|
|
|
|
|
+ mwcaf01.setPredictionNo(predictionNo1);
|
|
|
|
|
+ mwcaf01.setPredictionType("5");
|
|
|
|
|
+ mwcaf01.setPredictionCombination(predictionNo1 + "," + predictionNo2);
|
|
|
|
|
+ meterWorkRailwayActFirstMapper.updateByPrimaryKey(mwcaf01);
|
|
|
|
|
+ //更新第一次皮重数据库
|
|
|
|
|
+ String tareNo1 = PublicMethod.IdCreate(3);
|
|
|
|
|
+ mwcaf02.setActualFirstNo(tareNo1);
|
|
|
|
|
+ mwcaf02.setValueFlag(DbConstants.NET);
|
|
|
|
|
+ mwcaf02.setMeterWeight(tareWeight);
|
|
|
|
|
+ mwcaf02.setCreateManNo(userId);
|
|
|
|
|
+ mwcaf02.setCreateManName(userName);
|
|
|
|
|
+ mwcaf02.setCreateTime(new Date());
|
|
|
|
|
+ mwcaf02.setUpdateManNo(userId);
|
|
|
|
|
+ mwcaf02.setUpdateManName(userName);
|
|
|
|
|
+ mwcaf02.setUpdateTime(new Date());
|
|
|
|
|
+ mwcaf02.setIsPreSacale("1");
|
|
|
|
|
+ mwcaf02.setWeightType("1");
|
|
|
|
|
+ mwcaf02.setPredictionNo(predictionNo1);
|
|
|
|
|
+ mwcaf02.setPredictionType("5");
|
|
|
|
|
+ mwcaf02.setPredictionCombination(predictionNo1 + "," + predictionNo2);
|
|
|
|
|
+ meterWorkRailwayActFirstMapper.insertSelective(mwcaf02);
|
|
|
|
|
+
|
|
|
|
|
+ //添加第一次毛重数据库
|
|
|
|
|
+ String grossNo1 = PublicMethod.IdCreate(3);
|
|
|
|
|
+ mwcaf03.setActualFirstNo(grossNo1);
|
|
|
|
|
+ mwcaf03.setValueFlag(DbConstants.NET);
|
|
|
|
|
+ mwcaf03.setMeterWeight(num02);
|
|
|
|
|
+ mwcaf03.setCreateManNo(userId);
|
|
|
|
|
+ mwcaf03.setCreateManName(userName);
|
|
|
|
|
+ mwcaf03.setCreateTime(new Date());
|
|
|
|
|
+ mwcaf03.setUpdateManNo(userId);
|
|
|
|
|
+ mwcaf03.setUpdateManName(userName);
|
|
|
|
|
+ mwcaf03.setUpdateTime(new Date());
|
|
|
|
|
+ mwcaf03.setIsPreSacale("1");
|
|
|
|
|
+ mwcaf03.setWeightType("0");
|
|
|
|
|
+ mwcaf03.setPredictionNo(predictionNo2);
|
|
|
|
|
+ mwcaf03.setPredictionType("5");
|
|
|
|
|
+ mwcaf03.setPredictionCombination(predictionNo1 + "," + predictionNo2);
|
|
|
|
|
+ meterWorkRailwayActFirstMapper.insertSelective(mwcaf03);
|
|
|
|
|
+ //添加第二次皮重数据库
|
|
|
|
|
+ String tareNo2 = PublicMethod.IdCreate(3);
|
|
|
|
|
+ mwcaf04.setActualFirstNo(tareNo2);
|
|
|
|
|
+ mwcaf04.setValueFlag(DbConstants.NET);
|
|
|
|
|
+ mwcaf04.setMeterWeight(tareWeight);
|
|
|
|
|
+ mwcaf04.setCreateManNo(userId);
|
|
|
|
|
+ mwcaf04.setCreateManName(userName);
|
|
|
|
|
+ mwcaf04.setCreateTime(new Date());
|
|
|
|
|
+ mwcaf04.setUpdateManNo(userId);
|
|
|
|
|
+ mwcaf04.setUpdateManName(userName);
|
|
|
|
|
+ mwcaf04.setUpdateTime(new Date());
|
|
|
|
|
+ mwcaf04.setIsPreSacale("1");
|
|
|
|
|
+ mwcaf04.setWeightType("1");
|
|
|
|
|
+ mwcaf04.setPredictionNo(predictionNo2);
|
|
|
|
|
+ mwcaf04.setPredictionType("5");
|
|
|
|
|
+ mwcaf04.setPredictionCombination(predictionNo1 + "," + predictionNo2);
|
|
|
|
|
+ meterWorkRailwayActFirstMapper.insertSelective(mwcaf04);
|
|
|
|
|
+
|
|
|
|
|
+ //将委托中的编号和收发货单位和一次数据等数据拷贝进结净数据中
|
|
|
|
|
+ MeterWorkRailwayActual mwca1 = meterWorkRailwayActualMapper.manualAddPre(actualNo1, tareNo1, predictionNo1);
|
|
|
|
|
+ BeanUtils.copyProperties(mwca1, actualRow1);
|
|
|
|
|
+ MeterWorkRailwayActual mwca2 = meterWorkRailwayActualMapper.manualAddPre(grossNo1, tareNo2, predictionNo2);
|
|
|
|
|
+ BeanUtils.copyProperties(mwca2, actualRow2);
|
|
|
|
|
+ //添加结净数据
|
|
|
|
|
+ actualRow1.setActualNo(PublicMethod.IdCreate(3));
|
|
|
|
|
+ actualRow1.setNetTime(new Date());
|
|
|
|
|
+ actualRow1.setNetMode(DbConstants.TYPE);
|
|
|
|
|
+ actualRow1.setNote("双委托匹配结净");
|
|
|
|
|
+ actualRow1.setNetMode("2");
|
|
|
|
|
+ actualRow1.setUploadFlag("1");
|
|
|
|
|
+ actualRow1.setValueFlag("1");
|
|
|
|
|
+ actualRow1.setIsPreSacale("1");
|
|
|
|
|
+ actualRow1.setPredictionNo(predictionNo1);
|
|
|
|
|
+ actualRow1.setPredictionType("5");
|
|
|
|
|
+ actualRow1.setPredictionCombination(predictionNo1 + "," + predictionNo2);
|
|
|
|
|
+ actualRow1.setNetWeight(num01);
|
|
|
|
|
+ if(actualRow1.getGrossTime().compareTo(actualRow1.getTareTime()) >= 0) {
|
|
|
|
|
+ actualRow1.setNetSpot3No(actualRow1.getBaseSpot1No());
|
|
|
|
|
+ actualRow1.setNetSpot3Name(actualRow1.getBaseSpot1Name());
|
|
|
|
|
+ actualRow1.setNetManNo(actualRow1.getGrossManNo());
|
|
|
|
|
+ actualRow1.setNetManName(actualRow1.getGrossManName());
|
|
|
|
|
+ actualRow1.setNetTime(actualRow1.getGrossTime());
|
|
|
|
|
+ actualRow1.setCreateTime(actualRow1.getGrossTime());
|
|
|
|
|
+ actualRow1.setCreateManName(actualRow1.getGrossManName());
|
|
|
|
|
+ actualRow1.setLcNo(meterWorkRailwayActFirstMapper.getFirstLcNo(actualRow1.getActualFirst1No()));
|
|
|
|
|
+ }else {
|
|
|
|
|
+ actualRow1.setNetSpot3No(actualRow1.getBaseSpot2No());
|
|
|
|
|
+ actualRow1.setNetSpot3Name(actualRow1.getBaseSpot2Name());
|
|
|
|
|
+ actualRow1.setNetManNo(actualRow1.getTareManNo());
|
|
|
|
|
+ actualRow1.setNetManName(actualRow1.getTareManName());
|
|
|
|
|
+ actualRow1.setNetTime(actualRow1.getTareTime());
|
|
|
|
|
+ actualRow1.setCreateTime(actualRow1.getTareTime());
|
|
|
|
|
+ actualRow1.setCreateManName(actualRow1.getTareManName());
|
|
|
|
|
+ actualRow1.setLcNo(meterWorkRailwayActFirstMapper.getFirstLcNo(actualRow1.getActualFirst2No()));
|
|
|
|
|
+ }
|
|
|
|
|
+ actualRow1.setUpdateManNo(userId);
|
|
|
|
|
+ actualRow1.setUpdateManName(userName);
|
|
|
|
|
+ actualRow1.setUpdateTime(new Date());
|
|
|
|
|
+ meterWorkRailwayActualMapper.insertSelective(actualRow1);
|
|
|
|
|
+
|
|
|
|
|
+ actualRow2.setActualNo(PublicMethod.IdCreate(3));
|
|
|
|
|
+ actualRow2.setNetTime(new Date());
|
|
|
|
|
+ actualRow2.setNetMode(DbConstants.TYPE);
|
|
|
|
|
+ actualRow2.setNote("双委托匹配结净");
|
|
|
|
|
+ actualRow2.setNetMode("2");
|
|
|
|
|
+ actualRow2.setValueFlag("1");
|
|
|
|
|
+ actualRow2.setUploadFlag("1");
|
|
|
|
|
+ actualRow2.setIsPreSacale("1");
|
|
|
|
|
+ actualRow2.setPredictionNo(predictionNo2);
|
|
|
|
|
+ actualRow2.setPredictionType("5");
|
|
|
|
|
+ actualRow2.setPredictionCombination(predictionNo1 + "," + predictionNo2);
|
|
|
|
|
+ actualRow2.setNetWeight(num01);
|
|
|
|
|
+ if(actualRow2.getGrossTime().compareTo(actualRow2.getTareTime()) >= 0) {
|
|
|
|
|
+ actualRow2.setNetSpot3No(actualRow2.getBaseSpot1No());
|
|
|
|
|
+ actualRow2.setNetSpot3Name(actualRow2.getBaseSpot1Name());
|
|
|
|
|
+ actualRow2.setNetManNo(actualRow2.getGrossManNo());
|
|
|
|
|
+ actualRow2.setNetManName(actualRow2.getGrossManName());
|
|
|
|
|
+ actualRow2.setNetTime(actualRow2.getGrossTime());
|
|
|
|
|
+ actualRow2.setCreateTime(actualRow2.getGrossTime());
|
|
|
|
|
+ actualRow2.setCreateManName(actualRow2.getGrossManName());
|
|
|
|
|
+ actualRow2.setLcNo(meterWorkRailwayActFirstMapper.getFirstLcNo(actualRow2.getActualFirst1No()));
|
|
|
|
|
+ }else {
|
|
|
|
|
+ actualRow2.setNetSpot3No(actualRow2.getBaseSpot2No());
|
|
|
|
|
+ actualRow2.setNetSpot3Name(actualRow2.getBaseSpot2Name());
|
|
|
|
|
+ actualRow2.setNetManNo(actualRow2.getTareManNo());
|
|
|
|
|
+ actualRow2.setNetManName(actualRow2.getTareManName());
|
|
|
|
|
+ actualRow2.setNetTime(actualRow2.getTareTime());
|
|
|
|
|
+ actualRow2.setCreateTime(actualRow2.getTareTime());
|
|
|
|
|
+ actualRow2.setCreateManName(actualRow2.getTareManName());
|
|
|
|
|
+ actualRow2.setLcNo(meterWorkRailwayActFirstMapper.getFirstLcNo(actualRow2.getActualFirst2No()));
|
|
|
|
|
+ }
|
|
|
|
|
+ actualRow2.setUpdateManNo(userId);
|
|
|
|
|
+ actualRow2.setUpdateManName(userName);
|
|
|
|
|
+ actualRow2.setUpdateTime(new Date());
|
|
|
|
|
+ meterWorkRailwayActualMapper.insertSelective(actualRow2);
|
|
|
|
|
+
|
|
|
|
|
+ //更新预报数据
|
|
|
|
|
+ PreRailwayScale scale1 = new PreRailwayScale();
|
|
|
|
|
+ scale1.setPredictionNo(predictionNo1);
|
|
|
|
|
+ scale1.setValueFlag(DbConstants.NET);
|
|
|
|
|
+ scale1.setUpdateTime(new Date());
|
|
|
|
|
+ scale1.setUpdateManNo(userId);
|
|
|
|
|
+ scale1.setUpdateManName(userName);
|
|
|
|
|
+ scale1.setUploadFlag("1");
|
|
|
|
|
+ scale1.setPredictionType("5");
|
|
|
|
|
+ scale1.setPredictionCombination(predictionNo1 + "," + predictionNo2);
|
|
|
|
|
+ scale1.setMeasureStation(actualRow1.getNetSpot3No());
|
|
|
|
|
+ scale1.setMeasureStationName(actualRow1.getNetSpot3Name());
|
|
|
|
|
+ preRailwayScaleMapper.updateByPrimaryKeySelective(scale1);
|
|
|
|
|
+
|
|
|
|
|
+ PreRailwayScale scale2 = new PreRailwayScale();
|
|
|
|
|
+ scale2.setPredictionNo(predictionNo2);
|
|
|
|
|
+ scale2.setValueFlag(DbConstants.NET);
|
|
|
|
|
+ scale2.setUpdateTime(new Date());
|
|
|
|
|
+ scale2.setUpdateManNo(userId);
|
|
|
|
|
+ scale2.setUpdateManName(userName);
|
|
|
|
|
+ scale2.setUploadFlag("1");
|
|
|
|
|
+ scale2.setPredictionType("5");
|
|
|
|
|
+ scale2.setPredictionCombination(predictionNo1 + "," + predictionNo2);
|
|
|
|
|
+ scale2.setMeasureStation(actualRow2.getNetSpot3No());
|
|
|
|
|
+ scale2.setMeasureStationName(actualRow2.getNetSpot3Name());
|
|
|
|
|
+ preRailwayScaleMapper.updateByPrimaryKeySelective(scale2);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
return "操作异常,请确认";
|
|
return "操作异常,请确认";
|
|
|
}
|
|
}
|
|
|
return "";
|
|
return "";
|
|
@@ -2934,6 +3183,7 @@ public class MeterWorkRailwayActFirstServiceImpl extends BaseServiceImpl<MeterWo
|
|
|
preRailwayScaleMapper.updateByPrimaryKeySelective(scale1);
|
|
preRailwayScaleMapper.updateByPrimaryKeySelective(scale1);
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
return "操作异常,请确认";
|
|
return "操作异常,请确认";
|
|
|
}
|
|
}
|
|
|
return "";
|
|
return "";
|
|
@@ -3166,6 +3416,7 @@ public class MeterWorkRailwayActFirstServiceImpl extends BaseServiceImpl<MeterWo
|
|
|
preRailwayScaleMapper.updateByPrimaryKeySelective(scale1);
|
|
preRailwayScaleMapper.updateByPrimaryKeySelective(scale1);
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
return "操作异常,请确认";
|
|
return "操作异常,请确认";
|
|
|
}
|
|
}
|
|
|
return "";
|
|
return "";
|
|
@@ -5150,8 +5401,7 @@ public class MeterWorkRailwayActFirstServiceImpl extends BaseServiceImpl<MeterWo
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//覆盖期限皮重
|
|
//覆盖期限皮重
|
|
|
- @Transactional(rollbackFor = Exception.class)
|
|
|
|
|
- private void updateRailWeight(MeterWorkRailwayActFirst model) {
|
|
|
|
|
|
|
+ public void updateRailWeight(MeterWorkRailwayActFirst model) {
|
|
|
try {
|
|
try {
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
HashMap<String, Object> obj = new HashMap<>();
|
|
HashMap<String, Object> obj = new HashMap<>();
|
|
@@ -5196,6 +5446,7 @@ public class MeterWorkRailwayActFirstServiceImpl extends BaseServiceImpl<MeterWo
|
|
|
meterBaseRailwayWeightMapper.insertSelective(railwayWeight);
|
|
meterBaseRailwayWeightMapper.insertSelective(railwayWeight);
|
|
|
}
|
|
}
|
|
|
} catch (ParseException e) {
|
|
} catch (ParseException e) {
|
|
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|