|
@@ -21,6 +21,7 @@ import com.steerinfo.util.StringUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.text.ParseException;
|
|
import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
@@ -708,13 +709,207 @@ public class MeterWorkDataCountServiceImpl implements IMeterWorkDataCountService
|
|
|
for (MeasurementAccuracyAnalysis model : models) {
|
|
for (MeasurementAccuracyAnalysis model : models) {
|
|
|
if (StringUtils.isNotEmpty(model.getBeforeFix())) {
|
|
if (StringUtils.isNotEmpty(model.getBeforeFix())) {
|
|
|
String str = model.getBeforeFix();
|
|
String str = model.getBeforeFix();
|
|
|
|
|
+ if(str.indexOf("MeterWorkCarActualFirst") >= 0){
|
|
|
|
|
+ model.setBeforeFix(translationModel(str));
|
|
|
|
|
+ }else if(str.indexOf("MeterWorkCarActual") >= 0) {
|
|
|
|
|
+ model.setBeforeFix(translationModel(str));
|
|
|
|
|
+ }else if(str.indexOf("MeterWorkRailwayActFirst") >= 0) {
|
|
|
|
|
+ model.setBeforeFix(translationModel(str));
|
|
|
|
|
+ }else if(str.indexOf("MeterWorkRailwayActual") >= 0) {
|
|
|
|
|
+ model.setBeforeFix(translationModel(str));
|
|
|
|
|
+ }else if(str.indexOf("MeterWorkRailwayReceived") >= 0) {
|
|
|
|
|
+ model.setBeforeFix(translationModel(str));
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
if (StringUtils.isNotEmpty(model.getAfterFix())) {
|
|
if (StringUtils.isNotEmpty(model.getAfterFix())) {
|
|
|
-
|
|
|
|
|
|
|
+ String str = model.getAfterFix();
|
|
|
|
|
+ if(str.indexOf("MeterWorkCarActualFirst") >= 0){
|
|
|
|
|
+ model.setAfterFix(translationModel(str));
|
|
|
|
|
+ }else if(str.indexOf("MeterWorkCarActual") >= 0) {
|
|
|
|
|
+ model.setAfterFix(translationModel(str));
|
|
|
|
|
+ }else if(str.indexOf("MeterWorkRailwayActFirst") >= 0) {
|
|
|
|
|
+ model.setAfterFix(translationModel(str));
|
|
|
|
|
+ }else if(str.indexOf("MeterWorkRailwayActual") >= 0) {
|
|
|
|
|
+ model.setAfterFix(translationModel(str));
|
|
|
|
|
+ }else if(str.indexOf("MeterWorkRailwayReceived") >= 0) {
|
|
|
|
|
+ model.setAfterFix(translationModel(str));
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
PageList<MeasurementAccuracyAnalysis> rows = new PageList<>(models);
|
|
PageList<MeasurementAccuracyAnalysis> rows = new PageList<>(models);
|
|
|
return rows;
|
|
return rows;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ public String translationModel(String str) {
|
|
|
|
|
+ String strAll = "";
|
|
|
|
|
+ if(str.indexOf("MeterWorkCarActualFirst") >= 0){
|
|
|
|
|
+ if(str.indexOf("predictionNo=") >= 1) {
|
|
|
|
|
+ str = str.substring(str.indexOf("predictionNo="));
|
|
|
|
|
+ strAll += "委托号:" + str.substring("predictionNo=".length(), str.indexOf(","));
|
|
|
|
|
+ }
|
|
|
|
|
+ if(str.indexOf("carNo=") >= 1) {
|
|
|
|
|
+ str = str.substring(str.indexOf("carNo="));
|
|
|
|
|
+ strAll += ", 车号:" + str.substring("carNo=".length(), str.indexOf(","));
|
|
|
|
|
+ }
|
|
|
|
|
+ if(str.indexOf("meterWeight=") >= 1) {
|
|
|
|
|
+ str = str.substring(str.indexOf("meterWeight="));
|
|
|
|
|
+ String meterWeightStr = str.substring("meterWeight=".length(), str.indexOf(","));
|
|
|
|
|
+ String meterWeight = "0.00";
|
|
|
|
|
+ if(!meterWeightStr.equals("null")) {
|
|
|
|
|
+ meterWeight = String.format("%.2f", Double.parseDouble(meterWeightStr)/1000);
|
|
|
|
|
+ }
|
|
|
|
|
+ strAll += ", 重量:" + meterWeight + "t";
|
|
|
|
|
+ }
|
|
|
|
|
+ if(str.indexOf("baseSpotName=") >= 1) {
|
|
|
|
|
+ str = str.substring(str.indexOf("baseSpotName="));
|
|
|
|
|
+ strAll += ", 计量点:" + str.substring("baseSpotName=".length(), str.indexOf(","));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if(str.indexOf("MeterWorkCarActual") >= 0){
|
|
|
|
|
+ if(str.indexOf("predictionNo=") >= 1) {
|
|
|
|
|
+ str = str.substring(str.indexOf("predictionNo="));
|
|
|
|
|
+ strAll += "委托号:" + str.substring("predictionNo=".length(), str.indexOf(","));
|
|
|
|
|
+ }
|
|
|
|
|
+ if(str.indexOf("carNo=") >= 1) {
|
|
|
|
|
+ str = str.substring(str.indexOf("carNo="));
|
|
|
|
|
+ strAll += ", 车号:" + str.substring("carNo=".length(), str.indexOf(","));
|
|
|
|
|
+ }
|
|
|
|
|
+ if(str.indexOf("grossWeight=") >= 1) {
|
|
|
|
|
+ str = str.substring(str.indexOf("grossWeight="));
|
|
|
|
|
+ String grossStr = str.substring("grossWeight=".length(), str.indexOf(","));
|
|
|
|
|
+ String grossWeight = "0.00";
|
|
|
|
|
+ if(!grossStr.equals("null")) {
|
|
|
|
|
+ grossWeight = String.format("%.2f", Double.parseDouble(grossStr)/1000);
|
|
|
|
|
+ }
|
|
|
|
|
+ strAll += ", 毛重:" + grossWeight + "t";
|
|
|
|
|
+ }
|
|
|
|
|
+ if(str.indexOf("baseSpot1Name=") >= 1) {
|
|
|
|
|
+ str = str.substring(str.indexOf("baseSpot1Name="));
|
|
|
|
|
+ strAll += ", 毛重计量点:" + str.substring("baseSpot1Name=".length(), str.indexOf(","));
|
|
|
|
|
+ }
|
|
|
|
|
+ if(str.indexOf("tareWeight=") >= 1) {
|
|
|
|
|
+ str = str.substring(str.indexOf("tareWeight="));
|
|
|
|
|
+ String tareStr = str.substring("tareWeight=".length(), str.indexOf(","));
|
|
|
|
|
+ String tareWeight = "0.00";
|
|
|
|
|
+ if(!tareStr.equals("null")) {
|
|
|
|
|
+ tareWeight = String.format("%.2f", Double.parseDouble(tareStr)/1000);
|
|
|
|
|
+ }
|
|
|
|
|
+ strAll += ", 皮重:" + tareWeight + "t";
|
|
|
|
|
+ }
|
|
|
|
|
+ if(str.indexOf("baseSpot2Name=") >= 1) {
|
|
|
|
|
+ str = str.substring(str.indexOf("baseSpot2Name="));
|
|
|
|
|
+ strAll += ", 皮重计量点:" + str.substring("baseSpot2Name=".length(), str.indexOf(","));
|
|
|
|
|
+ }
|
|
|
|
|
+ if(str.indexOf("netWeight=") >= 1) {
|
|
|
|
|
+ str = str.substring(str.indexOf("netWeight="));
|
|
|
|
|
+ String netStr = str.substring("netWeight=".length(), str.indexOf(","));
|
|
|
|
|
+ String netWeight = "0.00";
|
|
|
|
|
+ if(!netStr.equals("null")) {
|
|
|
|
|
+ netWeight = String.format("%.2f", Double.parseDouble(netStr)/1000);
|
|
|
|
|
+ }
|
|
|
|
|
+ strAll += ", 净重:" + netWeight + "t";
|
|
|
|
|
+ }
|
|
|
|
|
+ if(str.indexOf("netSpot3Name=") >= 1) {
|
|
|
|
|
+ str = str.substring(str.indexOf("netSpot3Name="));
|
|
|
|
|
+ strAll += ", 净重计量点:" + str.substring("netSpot3Name=".length(), str.indexOf(","));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if(str.indexOf("MeterWorkRailwayActFirst") >= 0){
|
|
|
|
|
+ if(str.indexOf("predictionNo=") >= 1) {
|
|
|
|
|
+ str = str.substring(str.indexOf("predictionNo="));
|
|
|
|
|
+ strAll += "委托号:" + str.substring("predictionNo=".length(), str.indexOf(","));
|
|
|
|
|
+ }
|
|
|
|
|
+ if(str.indexOf("railwayNo=") >= 1) {
|
|
|
|
|
+ str = str.substring(str.indexOf("railwayNo="));
|
|
|
|
|
+ strAll += ", 车号:" + str.substring("railwayNo=".length(), str.indexOf(","));
|
|
|
|
|
+ }
|
|
|
|
|
+ if(str.indexOf("meterWeight=") >= 1) {
|
|
|
|
|
+ str = str.substring(str.indexOf("meterWeight="));
|
|
|
|
|
+ String meterWeightStr = str.substring("meterWeight=".length(), str.indexOf(","));
|
|
|
|
|
+ String meterWeight = "0.00";
|
|
|
|
|
+ if(!meterWeightStr.equals("null")) {
|
|
|
|
|
+ meterWeight = String.format("%.2f", Double.parseDouble(meterWeightStr)/1000);
|
|
|
|
|
+ }
|
|
|
|
|
+ strAll += ", 重量:" + meterWeight + "t";
|
|
|
|
|
+ }
|
|
|
|
|
+ if(str.indexOf("baseSpotName=") >= 1) {
|
|
|
|
|
+ str = str.substring(str.indexOf("baseSpotName="));
|
|
|
|
|
+ strAll += ", 计量点:" + str.substring("baseSpotName=".length(), str.indexOf(","));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if(str.indexOf("MeterWorkRailwayActual") >= 0){
|
|
|
|
|
+ if(str.indexOf("predictionNo=") >= 1) {
|
|
|
|
|
+ str = str.substring(str.indexOf("predictionNo="));
|
|
|
|
|
+ strAll += "委托号:" + str.substring("predictionNo=".length(), str.indexOf(","));
|
|
|
|
|
+ }
|
|
|
|
|
+ if(str.indexOf("railwayNo=") >= 1) {
|
|
|
|
|
+ str = str.substring(str.indexOf("railwayNo="));
|
|
|
|
|
+ strAll += ", 车号:" + str.substring("railwayNo=".length(), str.indexOf(","));
|
|
|
|
|
+ }
|
|
|
|
|
+ if(str.indexOf("grossWeight=") >= 1) {
|
|
|
|
|
+ str = str.substring(str.indexOf("grossWeight="));
|
|
|
|
|
+ String grossStr = str.substring("grossWeight=".length(), str.indexOf(","));
|
|
|
|
|
+ String grossWeight = "0.00";
|
|
|
|
|
+ if(!grossStr.equals("null")) {
|
|
|
|
|
+ grossWeight = String.format("%.2f", Double.parseDouble(grossStr)/1000);
|
|
|
|
|
+ }
|
|
|
|
|
+ strAll += ", 毛重:" + grossWeight + "t";
|
|
|
|
|
+ }
|
|
|
|
|
+ if(str.indexOf("baseSpot1Name=") >= 1) {
|
|
|
|
|
+ str = str.substring(str.indexOf("baseSpot1Name="));
|
|
|
|
|
+ strAll += ", 毛重计量点:" + str.substring("baseSpot1Name=".length(), str.indexOf(","));
|
|
|
|
|
+ }
|
|
|
|
|
+ if(str.indexOf("tareWeight=") >= 1) {
|
|
|
|
|
+ str = str.substring(str.indexOf("tareWeight="));
|
|
|
|
|
+ String tareStr = str.substring("tareWeight=".length(), str.indexOf(","));
|
|
|
|
|
+ String tareWeight = "0.00";
|
|
|
|
|
+ if(!tareStr.equals("null")) {
|
|
|
|
|
+ tareWeight = String.format("%.2f", Double.parseDouble(tareStr)/1000);
|
|
|
|
|
+ }
|
|
|
|
|
+ strAll += ", 皮重:" + tareWeight + "t";
|
|
|
|
|
+ }
|
|
|
|
|
+ if(str.indexOf("baseSpot2Name=") >= 1) {
|
|
|
|
|
+ str = str.substring(str.indexOf("baseSpot2Name="));
|
|
|
|
|
+ strAll += ", 皮重计量点:" + str.substring("baseSpot2Name=".length(), str.indexOf(","));
|
|
|
|
|
+ }
|
|
|
|
|
+ if(str.indexOf("netWeight=") >= 1) {
|
|
|
|
|
+ str = str.substring(str.indexOf("netWeight="));
|
|
|
|
|
+ String netStr = str.substring("netWeight=".length(), str.indexOf(","));
|
|
|
|
|
+ String netWeight = "0.00";
|
|
|
|
|
+ if(!netStr.equals("null")) {
|
|
|
|
|
+ netWeight = String.format("%.2f", Double.parseDouble(netStr)/1000);
|
|
|
|
|
+ }
|
|
|
|
|
+ strAll += ", 净重:" + netWeight + "t";
|
|
|
|
|
+ }
|
|
|
|
|
+ if(str.indexOf("netSpot3Name=") >= 1) {
|
|
|
|
|
+ str = str.substring(str.indexOf("netSpot3Name="));
|
|
|
|
|
+ strAll += ", 净重计量点:" + str.substring("netSpot3Name=".length(), str.indexOf(","));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if(str.indexOf("MeterWorkRailwayReceived") >= 0){
|
|
|
|
|
+ if(str.indexOf("predictionNo=") >= 1) {
|
|
|
|
|
+ str = str.substring(str.indexOf("predictionNo="));
|
|
|
|
|
+ strAll += "委托号:" + str.substring("predictionNo=".length(), str.indexOf(","));
|
|
|
|
|
+ }
|
|
|
|
|
+ if(str.indexOf("railwayNo=") >= 1) {
|
|
|
|
|
+ str = str.substring(str.indexOf("railwayNo="));
|
|
|
|
|
+ strAll += ", 车号:" + str.substring("railwayNo=".length(), str.indexOf(","));
|
|
|
|
|
+ }
|
|
|
|
|
+ if(str.indexOf("meterWeight=") >= 1) {
|
|
|
|
|
+ str = str.substring(str.indexOf("meterWeight="));
|
|
|
|
|
+ String meterWeightStr = str.substring("meterWeight=".length(), str.indexOf(","));
|
|
|
|
|
+ String meterWeight = "0.00";
|
|
|
|
|
+ if(!meterWeightStr.equals("null")) {
|
|
|
|
|
+ meterWeight = String.format("%.2f", Double.parseDouble(meterWeightStr)/1000);
|
|
|
|
|
+ }
|
|
|
|
|
+ strAll += ", 重量:" + meterWeight + "t";
|
|
|
|
|
+ }
|
|
|
|
|
+ if(str.indexOf("baseSpotName=") >= 1) {
|
|
|
|
|
+ str = str.substring(str.indexOf("baseSpotName="));
|
|
|
|
|
+ strAll += ", 计量点:" + str.substring("baseSpotName=".length(), str.indexOf(","));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return strAll;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|