|
|
@@ -13,6 +13,7 @@ import com.steerinfo.meterwork.meterworkcaractualfirst.model.MeterWorkCarActualF
|
|
|
import com.steerinfo.util.CommonPage;
|
|
|
import com.steerinfo.util.CompareUtil;
|
|
|
import com.steerinfo.util.PublicMethod;
|
|
|
+import com.steerinfo.util.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@@ -76,10 +77,214 @@ public class MeterBaseOperationLogServiceImpl extends BaseServiceImpl<MeterBaseO
|
|
|
public PageList<MeterBaseOperationLog> likeByDesc(HashMap<String, Object> params, Integer pageNum, Integer pageSize) {
|
|
|
PageHelper.startPage(pageNum, pageSize);
|
|
|
List<MeterBaseOperationLog> rows = meterBaseOperationLogMapper.likeByDesc(params);
|
|
|
+ if(rows.size() >= 1) {
|
|
|
+ for(MeterBaseOperationLog model: rows) {
|
|
|
+ if (StringUtils.isNotEmpty(model.getOperationBeforeFix())) {
|
|
|
+ String str = model.getOperationBeforeFix();
|
|
|
+ if(str.indexOf("MeterWorkCarActualFirst") >= 0){
|
|
|
+ model.setOperationBeforeFix(translationModel(str));
|
|
|
+ }else if(str.indexOf("MeterWorkCarActual") >= 0) {
|
|
|
+ model.setOperationBeforeFix(translationModel(str));
|
|
|
+ }else if(str.indexOf("MeterWorkRailwayActFirst") >= 0) {
|
|
|
+ model.setOperationBeforeFix(translationModel(str));
|
|
|
+ }else if(str.indexOf("MeterWorkRailwayActual") >= 0) {
|
|
|
+ model.setOperationBeforeFix(translationModel(str));
|
|
|
+ }else if(str.indexOf("MeterWorkRailwayReceived") >= 0) {
|
|
|
+ model.setOperationBeforeFix(translationModel(str));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(model.getOperationAfterFix())) {
|
|
|
+ String str = model.getOperationAfterFix();
|
|
|
+ if(str.indexOf("MeterWorkCarActualFirst") >= 0){
|
|
|
+ model.setOperationAfterFix(translationModel(str));
|
|
|
+ }else if(str.indexOf("MeterWorkCarActual") >= 0) {
|
|
|
+ model.setOperationAfterFix(translationModel(str));
|
|
|
+ }else if(str.indexOf("MeterWorkRailwayActFirst") >= 0) {
|
|
|
+ model.setOperationAfterFix(translationModel(str));
|
|
|
+ }else if(str.indexOf("MeterWorkRailwayActual") >= 0) {
|
|
|
+ model.setOperationAfterFix(translationModel(str));
|
|
|
+ }else if(str.indexOf("MeterWorkRailwayReceived") >= 0) {
|
|
|
+ model.setOperationAfterFix(translationModel(str));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
PageList pageInfo = new PageList(rows);
|
|
|
return pageInfo;
|
|
|
}
|
|
|
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public int doAddLog(MeterBaseOperationLog model) {
|
|
|
try {
|